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

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: 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/EventTarget.cpp
diff --git a/third_party/WebKit/Source/core/events/EventTarget.cpp b/third_party/WebKit/Source/core/events/EventTarget.cpp
index 329f68dac5f754f349b632821aa2bf69577f238d..13346d6f9206d42f0419aea37bf81d968c63e899 100644
--- a/third_party/WebKit/Source/core/events/EventTarget.cpp
+++ b/third_party/WebKit/Source/core/events/EventTarget.cpp
@@ -69,11 +69,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) {
@@ -192,6 +197,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);
« no previous file with comments | « third_party/WebKit/Source/core/events/Event.cpp ('k') | third_party/WebKit/Source/core/events/RegisteredEventListener.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698