Index: third_party/WebKit/Source/core/input/EventHandler.cpp |
diff --git a/third_party/WebKit/Source/core/input/EventHandler.cpp b/third_party/WebKit/Source/core/input/EventHandler.cpp |
index b3d05d79c33807ff153a024ffc3580ff1cc56a87..bc8a2511ace99d0061e2acfde50c867b601112c3 100644 |
--- a/third_party/WebKit/Source/core/input/EventHandler.cpp |
+++ b/third_party/WebKit/Source/core/input/EventHandler.cpp |
@@ -436,8 +436,6 @@ WebInputEventResult EventHandler::handleMouseReleaseEvent(const MouseEventWithHi |
return selectionController().handleMouseReleaseEvent(event, m_dragStartPos) ? WebInputEventResult::HandledSystem : WebInputEventResult::NotHandled; |
} |
-#if OS(WIN) |
- |
void EventHandler::startPanScrolling(LayoutObject* layoutObject) |
{ |
if (!layoutObject->isBox()) |
@@ -449,8 +447,6 @@ void EventHandler::startPanScrolling(LayoutObject* layoutObject) |
invalidateClick(); |
} |
-#endif // OS(WIN) |
- |
HitTestResult EventHandler::hitTestResultAtPoint(const LayoutPoint& point, HitTestRequest::HitTestRequestType hitType, const LayoutSize& padding) |
{ |
TRACE_EVENT0("blink", "EventHandler::hitTestResultAtPoint"); |
@@ -831,18 +827,19 @@ WebInputEventResult EventHandler::handleMousePressEvent(const PlatformMouseEvent |
return result; |
} |
-#if OS(WIN) |
- // We store whether pan scrolling is in progress before calling stopAutoscroll() |
- // because it will set m_autoscrollType to NoAutoscroll on return. |
- bool isPanScrollInProgress = m_scrollManager.panScrollInProgress(); |
- m_scrollManager.stopAutoscroll(); |
- if (isPanScrollInProgress) { |
- // We invalidate the click when exiting pan scrolling so that we don't inadvertently navigate |
- // away from the current page (e.g. the click was on a hyperlink). See <rdar://problem/6095023>. |
- invalidateClick(); |
- return WebInputEventResult::HandledSuppressed; |
+ if (RuntimeEnabledFeatures::panScrollingEnabled()) { |
+ // We store whether pan scrolling is in progress before calling stopAutoscroll() |
+ // because it will set m_autoscrollType to NoAutoscroll on return. |
+ bool isPanScrollInProgress = m_scrollManager.panScrollInProgress(); |
+ m_scrollManager.stopAutoscroll(); |
+ if (isPanScrollInProgress) { |
+ // We invalidate the click when exiting pan scrolling so that we don't inadvertently navigate |
+ // away from the current page (e.g. the click was on a hyperlink). See <rdar://problem/6095023>. |
+ invalidateClick(); |
+ updatePointerTargetAndDispatchEvents(EventTypeNames::mousedown, mev.innerNode(), m_clickCount, mev.event()); |
sunyunjia
2016/09/01 01:50:31
I'm not sure the side effects of adding this line
Navid Zolghadr
2016/09/02 17:36:57
When pan is enabled and that pan circle is shown,
|
+ return WebInputEventResult::HandledSuppressed; |
+ } |
} |
-#endif |
m_clickCount = mouseEvent.clickCount(); |
m_clickNode = mev.innerNode()->isTextNode() ? FlatTreeTraversal::parent(*mev.innerNode()) : mev.innerNode(); |
@@ -1113,10 +1110,10 @@ WebInputEventResult EventHandler::handleMouseReleaseEvent(const PlatformMouseEve |
else |
gestureIndicator = wrapUnique(new UserGestureIndicator(DefinitelyProcessingUserGesture)); |
-#if OS(WIN) |
- if (Page* page = m_frame->page()) |
- page->autoscrollController().handleMouseReleaseForPanScrolling(m_frame, mouseEvent); |
-#endif |
+ if (RuntimeEnabledFeatures::panScrollingEnabled()) { |
+ if (Page* page = m_frame->page()) |
+ page->autoscrollController().handleMouseReleaseForPanScrolling(m_frame, mouseEvent); |
+ } |
m_mousePressed = false; |
setLastKnownMousePosition(mouseEvent); |