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

Unified Diff: Source/core/page/EventHandler.cpp

Issue 724673003: Don't make :hover sticky on tap on sites that set a mobile viewport set (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Refactored logic and corrected viewport checking Created 6 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
« no previous file with comments | « Source/core/page/ChromeClient.h ('k') | Source/core/page/Page.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/page/EventHandler.cpp
diff --git a/Source/core/page/EventHandler.cpp b/Source/core/page/EventHandler.cpp
index 3d1279c3b704166d04a0ca9dd72322472a2267e8..7b93a2830fde359b0739a2662ee162c110421b21 100644
--- a/Source/core/page/EventHandler.cpp
+++ b/Source/core/page/EventHandler.cpp
@@ -2665,7 +2665,11 @@ HitTestRequest::HitTestRequestType EventHandler::getHitTypeForGestureType(Platfo
hitType |= HitTestRequest::ReadOnly;
return hitType | HitTestRequest::Release;
case PlatformEvent::GestureTap:
- return hitType | HitTestRequest::Release;
+ hitType |= HitTestRequest::Release;
+ // needs to clear hover on mobile optimized pages
+ if (m_frame->page()->shouldDisableDesktopWorkarounds())
+ hitType |= HitTestRequest::Leave;
+ return hitType;
case PlatformEvent::GestureTapDown:
case PlatformEvent::GestureLongPress:
case PlatformEvent::GestureLongTap:
@@ -2960,7 +2964,14 @@ void EventHandler::activeIntervalTimerFired(Timer<EventHandler>*)
&& m_lastDeferredTapElement) {
// FIXME: Enable condition when http://crbug.com/226842 lands
// m_lastDeferredTapElement.get() == m_frame->document()->activeElement()
- HitTestRequest request(HitTestRequest::TouchEvent | HitTestRequest::Release);
+
+ HitTestRequest::HitTestRequestType hitType = HitTestRequest::TouchEvent | HitTestRequest::Release;
+ // This is delayed updating of hover/active states for GestureTap.
+ // So, this needs to clear hover on mobile optimized pages
+ if (m_frame->page()->shouldDisableDesktopWorkarounds())
+ hitType |= HitTestRequest::Leave;
+
+ HitTestRequest request(hitType);
m_frame->document()->updateHoverActiveState(request, m_lastDeferredTapElement.get());
}
m_lastDeferredTapElement = nullptr;
« no previous file with comments | « Source/core/page/ChromeClient.h ('k') | Source/core/page/Page.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698