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 0e63681afa13968b740bfcbab3032796d84d8acf..92bd274edfce15a084ab1bacf2935052978e3aef 100644 |
--- a/third_party/WebKit/Source/core/events/EventTarget.cpp |
+++ b/third_party/WebKit/Source/core/events/EventTarget.cpp |
@@ -199,6 +199,20 @@ void EventTarget::setDefaultAddEventListenerOptions(const AtomicString& eventTyp |
} |
} |
+ if (RuntimeEnabledFeatures::passiveDocumentEventListenersEnabled()) { |
+ if (!options.hasPassive()) { |
+ if (Node* node = toNode()) { |
+ if (node->isDocumentNode() || node->document().documentElement() == node || node->document().body() == node) { |
+ options.setPassive(true); |
+ return; |
+ } |
+ } else if (toLocalDOMWindow()) { |
+ options.setPassive(true); |
+ return; |
+ } |
+ } |
+ } |
+ |
if (Settings* settings = windowSettings(executingWindow())) { |
switch (settings->passiveListenerDefault()) { |
case PassiveListenerDefault::False: |
@@ -212,17 +226,6 @@ void EventTarget::setDefaultAddEventListenerOptions(const AtomicString& eventTyp |
case PassiveListenerDefault::ForceAllTrue: |
options.setPassive(true); |
break; |
- case PassiveListenerDefault::DocumentTrue: |
- if (!options.hasPassive()) { |
- if (Node* node = toNode()) { |
- if (node->isDocumentNode() || node->document().documentElement() == node || node->document().body() == node) { |
- options.setPassive(true); |
- } |
- } else if (toLocalDOMWindow()) { |
- options.setPassive(true); |
- } |
- } |
- break; |
} |
} else { |
if (!options.hasPassive()) |