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..6e8d6c2ce16580fe0c2fe21e314cf51bef4fe663 100644 |
--- a/third_party/WebKit/Source/core/html/HTMLInputElement.cpp |
+++ b/third_party/WebKit/Source/core/html/HTMLInputElement.cpp |
@@ -67,6 +67,7 @@ |
#include "core/html/forms/InputType.h" |
#include "core/html/forms/SearchInputType.h" |
#include "core/html/parser/HTMLParserIdioms.h" |
+#include "core/html/shadow/ShadowElementNames.h" |
#include "core/layout/LayoutTheme.h" |
#include "core/page/ChromeClient.h" |
#include "platform/Language.h" |
@@ -113,7 +114,7 @@ HTMLInputElement::HTMLInputElement(Document& document, HTMLFormElement* form, bo |
, m_parsingInProgress(createdByParser) |
, m_valueAttributeWasUpdatedAfterParsing(false) |
, m_canReceiveDroppedFiles(false) |
- , m_hasTouchEventHandler(false) |
+ , m_hasPassiveTouchEventHandler(false) |
, m_shouldRevealPassword(false) |
, m_needsToUpdateViewValue(true) |
, m_isPlaceholderVisible(false) |
@@ -405,18 +406,21 @@ void HTMLInputElement::updateTouchEventHandlerRegistry() |
{ |
ASSERT(m_inputTypeView); |
- bool hasTouchEventHandler = m_inputTypeView->hasTouchEventHandler(); |
- if (hasTouchEventHandler == !!m_hasTouchEventHandler) |
+ bool hasPassiveTouchEventHandler = m_inputTypeView->hasPassiveTouchEventHandler(); |
+ if (hasPassiveTouchEventHandler == !!m_hasPassiveTouchEventHandler) |
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) |
- registry.didAddEventHandler(*this, EventHandlerRegistry::TouchStartOrMoveEventBlocking); |
- else |
- registry.didRemoveEventHandler(*this, EventHandlerRegistry::TouchStartOrMoveEventBlocking); |
- m_hasTouchEventHandler = hasTouchEventHandler; |
+ if (hasPassiveTouchEventHandler) { |
+ registry.didAddEventHandler( |
+ *(this->userAgentShadowRoot()->getElementById(ShadowElementNames::sliderContainer())), |
majidvp
2016/08/12 03:35:43
This leaks lots of internal details of the RangeIn
tkent
2016/08/12 06:15:18
Yes, we shouldn't have inputtype-specific logic in
|
+ EventHandlerRegistry::TouchStartOrMoveEventPassive); |
+ } else { |
+ registry.didRemoveEventHandler( |
+ *(this->userAgentShadowRoot()->getElementById(ShadowElementNames::sliderContainer())), |
+ EventHandlerRegistry::TouchStartOrMoveEventPassive); |
+ } |
} |
} |
@@ -1161,7 +1165,7 @@ void HTMLInputElement::defaultEventHandler(Event* evt) |
return; |
} |
- if (evt->isTouchEvent() && m_inputTypeView->hasTouchEventHandler()) { |
+ if (evt->isTouchEvent() && m_inputTypeView->hasPassiveTouchEventHandler()) { |
m_inputTypeView->handleTouchEvent(toTouchEvent(evt)); |
if (evt->defaultHandled()) |
return; |
@@ -1514,7 +1518,7 @@ void HTMLInputElement::didMoveToNewDocument(Document& oldDocument) |
void HTMLInputElement::removeAllEventListeners() |
{ |
HTMLTextFormControlElement::removeAllEventListeners(); |
- m_hasTouchEventHandler = false; |
+ m_hasPassiveTouchEventHandler = false; |
} |
bool HTMLInputElement::recalcWillValidate() const |