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

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

Issue 2316373005: Enable untrusted mousedown on select boxes for webview (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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..ff05f07bb0e8173e8b77b5775075fa92fed6c2d4 100644
--- a/third_party/WebKit/Source/core/events/EventDispatcher.cpp
+++ b/third_party/WebKit/Source/core/events/EventDispatcher.cpp
@@ -35,6 +35,7 @@
#include "core/frame/Deprecation.h"
#include "core/frame/FrameView.h"
#include "core/frame/LocalDOMWindow.h"
+#include "core/frame/Settings.h"
#include "core/frame/UseCounter.h"
#include "core/inspector/InspectorTraceEvents.h"
#include "platform/EventDispatchForbiddenScope.h"
@@ -221,6 +222,16 @@ inline void EventDispatcher::dispatchEventPostProcess(EventDispatchHandlingState
// should not have their default handlers invoked.
bool isTrustedOrClick = !RuntimeEnabledFeatures::trustedEventsDefaultActionEnabled() || m_event->isTrusted() || isClick;
+ // For Android WebView (distinguished by wideViewportQuirkEnabled)
+ // enable untrusted events for mouse down on select elements because
+ // fastclick.js seems to generate these. crbug.com/642698
+ // TODO(dtapuska): Change this to a target SDK quirk crbug.com/643705
+ if (!isTrustedOrClick && m_event->isMouseEvent() && m_event->type() == EventTypeNames::mousedown && isHTMLSelectElement(*m_node)) {
+ if (Settings* settings = m_node->document().settings()) {
+ isTrustedOrClick = settings->wideViewportQuirkEnabled();
+ }
+ }
+
// Call default event handlers. While the DOM does have a concept of preventing
// default handling, the detail of which handlers are called is an internal
// implementation detail and not part of the DOM.
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698