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

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

Issue 2137483003: Add UMA metrics for root scroller intervention to track forcing passive breakage. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Change layout test to a unit test Created 4 years, 5 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/events/Event.cpp
diff --git a/third_party/WebKit/Source/core/events/Event.cpp b/third_party/WebKit/Source/core/events/Event.cpp
index 1c5361af5ce8fb380044a3bea8b94d1643824e3f..75354650ffca4cc03ee2ca562fd5c8d137d1b14a 100644
--- a/third_party/WebKit/Source/core/events/Event.cpp
+++ b/third_party/WebKit/Source/core/events/Event.cpp
@@ -225,6 +225,7 @@ bool Event::isBeforeUnloadEvent() const
void Event::preventDefault()
{
if (m_handlingPassive) {
+ m_preventDefaultCalledDuringPassive = true;
const LocalDOMWindow* window = m_eventPath ? m_eventPath->windowEventContext().window() : 0;
if (window)
window->printErrorMessage("Unable to preventDefault inside passive event listener invocation.");
@@ -277,6 +278,12 @@ HeapVector<Member<EventTarget>> Event::composedPath(ScriptState* scriptState) co
return pathInternal(scriptState, EmptyAfterDispatch);
}
+void Event::setHandlingPassive(bool value)
+{
+ m_handlingPassive = value;
+ m_preventDefaultCalledDuringPassive = false;
+}
+
HeapVector<Member<EventTarget>> Event::pathInternal(ScriptState* scriptState, EventPathMode mode) const
{
if (m_target)
« no previous file with comments | « third_party/WebKit/Source/core/events/Event.h ('k') | third_party/WebKit/Source/core/events/EventListenerMap.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698