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

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: Check if element is nullptr to fix the crash 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 a86c04f8d736b33a95bd5eaee16deb66029462fb..f8d7bcbe059cf33dd3cf7080c13333b6acbb3047 100644
--- a/third_party/WebKit/Source/core/html/HTMLInputElement.cpp
+++ b/third_party/WebKit/Source/core/html/HTMLInputElement.cpp
@@ -47,9 +47,7 @@
#include "core/events/KeyboardEvent.h"
#include "core/events/MouseEvent.h"
#include "core/events/ScopedEventQueue.h"
-#include "core/events/TouchEvent.h"
#include "core/frame/Deprecation.h"
-#include "core/frame/EventHandlerRegistry.h"
#include "core/frame/FrameHost.h"
#include "core/frame/FrameView.h"
#include "core/frame/LocalFrame.h"
@@ -113,7 +111,6 @@ 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)
@@ -401,25 +398,6 @@ void HTMLInputElement::setType(const AtomicString& type)
setAttribute(typeAttr, type);
}
-void HTMLInputElement::updateTouchEventHandlerRegistry()
-{
- DCHECK(m_inputTypeView);
-
- bool hasTouchEventHandler = m_inputTypeView->hasTouchEventHandler();
- if (hasTouchEventHandler == !!m_hasTouchEventHandler)
- 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;
- }
-}
-
void HTMLInputElement::initializeTypeInParsing()
{
DCHECK(m_parsingInProgress);
@@ -431,8 +409,6 @@ void HTMLInputElement::initializeTypeInParsing()
m_inputTypeView = m_inputType->createView();
ensureUserAgentShadowRoot();
- updateTouchEventHandlerRegistry();
-
setNeedsWillValidateCheck();
m_inputType->warnIfValueIsInvalid(fastGetAttribute(valueAttr).getString());
@@ -465,8 +441,6 @@ void HTMLInputElement::updateType()
m_inputTypeView = m_inputType->createView();
m_inputTypeView->createShadowSubtree();
- updateTouchEventHandlerRegistry();
-
setNeedsWillValidateCheck();
bool willStoreValue = m_inputType->storesValueSeparateFromAttribute();
@@ -1161,12 +1135,6 @@ void HTMLInputElement::defaultEventHandler(Event* evt)
return;
}
- if (evt->isTouchEvent() && m_inputTypeView->hasTouchEventHandler()) {
- m_inputTypeView->handleTouchEvent(toTouchEvent(evt));
- if (evt->defaultHandled())
- return;
- }
-
if (evt->isKeyboardEvent() && evt->type() == EventTypeNames::keydown) {
m_inputTypeView->handleKeydownEvent(toKeyboardEvent(evt));
if (evt->defaultHandled())
@@ -1506,17 +1474,9 @@ void HTMLInputElement::didMoveToNewDocument(Document& oldDocument)
if (type() == InputTypeNames::radio)
treeScope().radioButtonGroupScope().removeButton(this);
- updateTouchEventHandlerRegistry();
-
HTMLTextFormControlElement::didMoveToNewDocument(oldDocument);
}
-void HTMLInputElement::removeAllEventListeners()
-{
- HTMLTextFormControlElement::removeAllEventListeners();
- m_hasTouchEventHandler = false;
-}
-
bool HTMLInputElement::recalcWillValidate() const
{
return m_inputType->supportsValidation() && HTMLTextFormControlElement::recalcWillValidate();
« no previous file with comments | « third_party/WebKit/Source/core/html/HTMLInputElement.h ('k') | third_party/WebKit/Source/core/html/forms/InputTypeView.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698