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

Unified Diff: third_party/WebKit/Source/core/events/Event.cpp

Issue 2475443004: Add use counter when touch-action isn't used when preventDefault'd. (Closed)
Patch Set: Rebase Created 4 years, 1 month 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/events/Event.cpp
diff --git a/third_party/WebKit/Source/core/events/Event.cpp b/third_party/WebKit/Source/core/events/Event.cpp
index 5adbdb9f7a73acf950fd995aa4b22e1013caec62..68487d551634c0155fb61f6f3ee8cbb118e37006 100644
--- a/third_party/WebKit/Source/core/events/Event.cpp
+++ b/third_party/WebKit/Source/core/events/Event.cpp
@@ -92,7 +92,7 @@ Event::Event(const AtomicString& eventType,
m_wasInitialized(true),
m_isTrusted(false),
m_preventDefaultCalledOnUncancelableEvent(false),
- m_handlingPassive(PassiveMode::NotPassive),
+ m_handlingPassive(PassiveMode::NotPassiveDefault),
m_eventPhase(0),
m_currentTarget(nullptr),
m_platformTimeStamp(platformTimeStamp) {}
@@ -219,7 +219,8 @@ bool Event::isBeforeUnloadEvent() const {
}
void Event::preventDefault() {
- if (m_handlingPassive != PassiveMode::NotPassive) {
+ if (m_handlingPassive != PassiveMode::NotPassive &&
+ m_handlingPassive != PassiveMode::NotPassiveDefault) {
m_preventDefaultCalledDuringPassive = true;
const LocalDOMWindow* window =
@@ -228,9 +229,11 @@ void Event::preventDefault() {
const char* devToolsMsg = nullptr;
switch (m_handlingPassive) {
case PassiveMode::NotPassive:
+ case PassiveMode::NotPassiveDefault:
NOTREACHED();
break;
case PassiveMode::Passive:
+ case PassiveMode::PassiveDefault:
devToolsMsg =
"Unable to preventDefault inside passive event listener "
"invocation.";
« no previous file with comments | « third_party/WebKit/Source/core/events/Event.h ('k') | third_party/WebKit/Source/core/events/EventTarget.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698