Chromium Code Reviews| 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 c4b8be9bd2429711db21cfc9df3e5f292108c97f..889dd642f6ce00c3d2c160835388ce21979332f3 100644 |
| --- a/third_party/WebKit/Source/core/input/EventHandler.cpp |
| +++ b/third_party/WebKit/Source/core/input/EventHandler.cpp |
| @@ -411,7 +411,7 @@ WebInputEventResult EventHandler::handleMouseDraggedEvent(const MouseEventWithHi |
| m_mouseDownMayStartDrag = false; |
| - if (m_mouseDownMayStartAutoscroll && !m_scrollManager.panScrollInProgress()) { |
| + if (m_mouseDownMayStartAutoscroll && !m_scrollManager.middleClickAutoscrollInProgress()) { |
| if (AutoscrollController* controller = m_scrollManager.autoscrollController()) { |
| controller->startAutoscrollForSelection(layoutObject); |
| m_mouseDownMayStartAutoscroll = false; |
| @@ -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) |
| { |
|
bokan
2016/09/07 16:33:46
Add a DCHECK for the new RuntimeEnabledFeature her
|
| 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"); |
| @@ -601,7 +597,7 @@ OptionalCursor EventHandler::selectCursor(const HitTestResult& result) |
| Page* page = m_frame->page(); |
| if (!page) |
| return NoCursorChange; |
| - if (m_scrollManager.panScrollInProgress()) |
| + if (m_scrollManager.middleClickAutoscrollInProgress()) |
| return NoCursorChange; |
| Node* node = result.innerPossiblyPseudoNode(); |
| @@ -831,18 +827,18 @@ 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::middleClickAutoscrollEnabled()) { |
| + // 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.middleClickAutoscrollInProgress(); |
| + 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; |
| + } |
| } |
| -#endif |
| m_clickCount = mouseEvent.clickCount(); |
| m_clickNode = mev.innerNode()->isTextNode() ? FlatTreeTraversal::parent(*mev.innerNode()) : mev.innerNode(); |
| @@ -1113,10 +1109,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::middleClickAutoscrollEnabled()) { |
| + if (Page* page = m_frame->page()) |
| + page->autoscrollController().handleMouseReleaseForPanScrolling(m_frame, mouseEvent); |
| + } |
| m_mousePressed = false; |
| setLastKnownMousePosition(mouseEvent); |