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

Unified Diff: third_party/WebKit/Source/core/dom/Document.cpp

Issue 2931433002: Disable hover state change for touch event on page with viewport meta and mobile. (Closed)
Patch Set: Created 3 years, 6 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/dom/Document.cpp
diff --git a/third_party/WebKit/Source/core/dom/Document.cpp b/third_party/WebKit/Source/core/dom/Document.cpp
index 071ff8f9a928767f6c2c6724e99e7db0e5c0c96a..91cff48e71d5e7e36d801ff2d2824f68e57e9c89 100644
--- a/third_party/WebKit/Source/core/dom/Document.cpp
+++ b/third_party/WebKit/Source/core/dom/Document.cpp
@@ -144,6 +144,7 @@
#include "core/frame/LocalFrameView.h"
#include "core/frame/PerformanceMonitor.h"
#include "core/frame/Settings.h"
+#include "core/frame/VisualViewport.h"
#include "core/frame/csp/ContentSecurityPolicy.h"
#include "core/html/DocumentNameCollection.h"
#include "core/html/HTMLAllCollection.h"
@@ -6411,6 +6412,12 @@ void Document::UpdateHoverActiveState(const HitTestRequest& request,
SetActiveHoverElement(new_active_element);
}
}
+
+ // Do not set hover state if event is from touch and on mobile.
+ if (request.TouchEvent() && GetPage() &&
+ GetPage()->GetVisualViewport().ShouldDisableDesktopWorkarounds())
+ return;
+
// If the mouse has just been pressed, set :active on the chain. Those (and
// only those) nodes should remain :active until the mouse is released.
bool allow_active_changes = !old_active_element && ActiveHoverElement();
« 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