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; |