Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(399)

Unified Diff: third_party/WebKit/Source/core/html/HTMLInputElement.cpp

Issue 2209773002: Remove the blocking touch handlers for the input[type=range] and add touch-action instead (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Use better functions, structures and names Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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..e6f0eff9a464800abe438a12badb77aed0e99d8b 100644
--- a/third_party/WebKit/Source/core/html/HTMLInputElement.cpp
+++ b/third_party/WebKit/Source/core/html/HTMLInputElement.cpp
@@ -113,7 +113,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 +405,17 @@ 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);
+ if (hasPassiveTouchEventHandler)
+ registry.didAddEventHandler(*this, EventHandlerRegistry::TouchStartOrMoveEventPassive);
else
- registry.didRemoveEventHandler(*this, EventHandlerRegistry::TouchStartOrMoveEventBlocking);
- m_hasTouchEventHandler = hasTouchEventHandler;
+ registry.didRemoveEventHandler(*this, EventHandlerRegistry::TouchStartOrMoveEventPassive);
+ m_hasPassiveTouchEventHandler = hasPassiveTouchEventHandler;
}
}
@@ -1161,7 +1160,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 +1513,7 @@ void HTMLInputElement::didMoveToNewDocument(Document& oldDocument)
void HTMLInputElement::removeAllEventListeners()
{
HTMLTextFormControlElement::removeAllEventListeners();
- m_hasTouchEventHandler = false;
+ m_hasPassiveTouchEventHandler = false;
}
bool HTMLInputElement::recalcWillValidate() const

Powered by Google App Engine
This is Rietveld 408576698