Chromium Code Reviews| Index: third_party/WebKit/Source/core/html/HTMLInputElement.cpp |
| diff --git a/third_party/WebKit/Source/core/html/HTMLInputElement.cpp b/third_party/WebKit/Source/core/html/HTMLInputElement.cpp |
| index dd60325e359704461bc601ac3a7ba95e1048314c..8fba3d920ae94c0f425b03a258f327a8a3d38cbf 100644 |
| --- a/third_party/WebKit/Source/core/html/HTMLInputElement.cpp |
| +++ b/third_party/WebKit/Source/core/html/HTMLInputElement.cpp |
| @@ -113,10 +113,10 @@ HTMLInputElement::HTMLInputElement(Document& document, HTMLFormElement* form, bo |
| , m_parsingInProgress(createdByParser) |
| , m_valueAttributeWasUpdatedAfterParsing(false) |
| , m_canReceiveDroppedFiles(false) |
| - , m_hasTouchEventHandler(false) |
| , m_shouldRevealPassword(false) |
| , m_needsToUpdateViewValue(true) |
| , m_isPlaceholderVisible(false) |
| + , m_touchEventHandlerType(NoHandler) |
| // |m_inputType| is lazily created when constructed by the parser to avoid |
| // constructing unnecessarily a text inputType and its shadow subtree, just |
| // to destroy them when the |type| attribute gets set by the parser to |
| @@ -405,18 +405,18 @@ void HTMLInputElement::updateTouchEventHandlerRegistry() |
| { |
| ASSERT(m_inputTypeView); |
| - bool hasTouchEventHandler = m_inputTypeView->hasTouchEventHandler(); |
| - if (hasTouchEventHandler == !!m_hasTouchEventHandler) |
| + TouchHandlerType touchEventHandlerType = m_inputTypeView->touchEventHandlerType(); |
| + if (touchEventHandlerType == m_touchEventHandlerType) |
| return; |
| // If the Document is being or has been stopped, don't register any handlers. |
| if (document().frameHost() && document().lifecycle().state() < DocumentLifecycle::Stopping) { |
| EventHandlerRegistry& registry = document().frameHost()->eventHandlerRegistry(); |
| // TODO(dtapuska): Make this passive touch listener see crbug.com/584438 |
| - if (hasTouchEventHandler) |
| + if (touchEventHandlerType == Passive) |
| registry.didAddEventHandler(*this, EventHandlerRegistry::TouchStartOrMoveEventBlocking); |
|
majidvp
2016/08/04 15:20:36
The idea is to use TouchStartOrMoveEventPassive he
|
| else |
| registry.didRemoveEventHandler(*this, EventHandlerRegistry::TouchStartOrMoveEventBlocking); |
| - m_hasTouchEventHandler = hasTouchEventHandler; |
| + m_touchEventHandlerType = touchEventHandlerType; |
| } |
| } |
| @@ -1161,7 +1161,7 @@ void HTMLInputElement::defaultEventHandler(Event* evt) |
| return; |
| } |
| - if (evt->isTouchEvent() && m_inputTypeView->hasTouchEventHandler()) { |
| + if (evt->isTouchEvent() && m_inputTypeView->touchEventHandlerType() == Passive) { |
| m_inputTypeView->handleTouchEvent(toTouchEvent(evt)); |
| if (evt->defaultHandled()) |
| return; |
| @@ -1514,7 +1514,7 @@ void HTMLInputElement::didMoveToNewDocument(Document& oldDocument) |
| void HTMLInputElement::removeAllEventListeners() |
| { |
| HTMLTextFormControlElement::removeAllEventListeners(); |
| - m_hasTouchEventHandler = false; |
| + m_touchEventHandlerType = NoHandler; |
| } |
| bool HTMLInputElement::recalcWillValidate() const |