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

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

Issue 2303013002: Add UMA metric to track usage of sending a mousedown to select elements. (Closed)
Patch Set: Created 4 years, 3 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/EventDispatcher.cpp
diff --git a/third_party/WebKit/Source/core/events/EventDispatcher.cpp b/third_party/WebKit/Source/core/events/EventDispatcher.cpp
index a20c4a0a1a4dfcd1791781c965ae3fc5155f92a4..284422958625c02a0b5452bc7faa68e154ac542e 100644
--- a/third_party/WebKit/Source/core/events/EventDispatcher.cpp
+++ b/third_party/WebKit/Source/core/events/EventDispatcher.cpp
@@ -244,6 +244,13 @@ inline void EventDispatcher::dispatchEventPostProcess(EventDispatchHandlingState
if (m_event->defaultHandled() && !m_event->isTrusted() && !isClick)
Deprecation::countDeprecation(m_node->document(), UseCounter::UntrustedEventDefaultHandled);
}
+
+ // Track the usage of sending a mousedown event to a select element to force
+ // it to open. This measures a possible breakage of not allow untrusted
Rick Byers 2016/09/01 21:58:56 nit: s/allow/allowing/
dtapuska 2016/09/02 02:57:43 Done.
+ // events to open select boxes.
+ if (!m_event->isTrusted() && m_event->isMouseEvent() && toMouseEvent(*m_event).type() == EventTypeNames::mousedown && isHTMLSelectElement(*m_node)) {
Rick Byers 2016/09/01 21:58:56 nit: the toMouseEvent is unnecessary, elsewhere in
dtapuska 2016/09/02 02:57:43 Done.
+ UseCounter::count(m_node->document(), UseCounter::UntrustedMouseDownEventDispatched);
+ }
}
} // namespace blink
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/frame/UseCounter.h » ('j') | third_party/WebKit/Source/core/frame/UseCounter.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698