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

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

Issue 2475443004: Add use counter when touch-action isn't used when preventDefault'd. (Closed)
Patch Set: Whoops missed updating a file 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/EventTarget.cpp
diff --git a/third_party/WebKit/Source/core/events/EventTarget.cpp b/third_party/WebKit/Source/core/events/EventTarget.cpp
index a21200c0c9aeaf182adc17b47bb7e9bca96c90ce..85c3047bb090820df8d63b90200ef47ede8b0430 100644
--- a/third_party/WebKit/Source/core/events/EventTarget.cpp
+++ b/third_party/WebKit/Source/core/events/EventTarget.cpp
@@ -67,11 +67,16 @@ enum PassiveForcedListenerResultType {
Event::PassiveMode eventPassiveMode(
const RegisteredEventListener& eventListener) {
- if (!eventListener.passive())
- return Event::PassiveMode::NotPassive;
+ if (!eventListener.passive()) {
+ if (eventListener.passiveSpecified())
+ return Event::PassiveMode::NotPassive;
+ return Event::PassiveMode::NotPassiveDefault;
+ }
if (eventListener.passiveForcedForDocumentTarget())
return Event::PassiveMode::PassiveForcedDocumentLevel;
- return Event::PassiveMode::Passive;
+ if (eventListener.passiveSpecified())
+ return Event::PassiveMode::Passive;
+ return Event::PassiveMode::PassiveDefault;
}
Settings* windowSettings(LocalDOMWindow* executingWindow) {
@@ -200,6 +205,8 @@ inline LocalDOMWindow* EventTarget::executingWindow() {
void EventTarget::setDefaultAddEventListenerOptions(
const AtomicString& eventType,
AddEventListenerOptionsResolved& options) {
+ options.setPassiveSpecified(options.hasPassive());
+
if (!isScrollBlockingEvent(eventType)) {
if (!options.hasPassive())
options.setPassive(false);

Powered by Google App Engine
This is Rietveld 408576698