handleMouseMoveEvent should let hit-testing hit-test scrollbars
authorallan.jensen@digia.com <allan.jensen@digia.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 11 Apr 2013 16:52:29 +0000 (16:52 +0000)
committerallan.jensen@digia.com <allan.jensen@digia.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 11 Apr 2013 16:52:29 +0000 (16:52 +0000)
https://bugs.webkit.org/show_bug.cgi?id=114430

Reviewed by Antonio Gomes.

Allow hit-testing to hit-test frame scrollbars so handleMouseMoveEvent
does not have to do it itself.

* page/EventHandler.cpp:
(WebCore::EventHandler::handleMouseMoveEvent):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@148211 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/WebCore/ChangeLog
Source/WebCore/page/EventHandler.cpp

index cbf5b596c5d61e2ec40272cfacdae8d6c1d531ae..744aa24f88171982b58acb4b99a1cc975641a725 100644 (file)
@@ -1,3 +1,16 @@
+2013-04-11  Allan Sandfeld Jensen  <allan.jensen@digia.com>
+
+        handleMouseMoveEvent should let hit-testing hit-test scrollbars
+        https://bugs.webkit.org/show_bug.cgi?id=114430
+
+        Reviewed by Antonio Gomes.
+
+        Allow hit-testing to hit-test frame scrollbars so handleMouseMoveEvent
+        does not have to do it itself.
+
+        * page/EventHandler.cpp:
+        (WebCore::EventHandler::handleMouseMoveEvent):
+
 2013-04-11  Brian Holt  <brian.holt@samsung.com>
 
         [Gtk] Combo boxes should be arrow-out-of-able similar to list boxes when caret-browsing is enabled.
index 9efec77534d80c59c9be7ca53233cb854d70b462..0e8e357ab58392ba0906a2af16d39e70a8ad9e89 100644 (file)
@@ -1772,7 +1772,7 @@ bool EventHandler::handleMouseMoveEvent(const PlatformMouseEvent& mouseEvent, Hi
     if (m_lastScrollbarUnderMouse && m_mousePressed)
         return m_lastScrollbarUnderMouse->mouseMoved(mouseEvent);
 
-    HitTestRequest::HitTestRequestType hitType = HitTestRequest::Move | HitTestRequest::DisallowShadowContent;
+    HitTestRequest::HitTestRequestType hitType = HitTestRequest::Move | HitTestRequest::DisallowShadowContent | HitTestRequest::AllowFrameScrollbars;
     if (m_mousePressed)
         hitType |= HitTestRequest::Active;
     else if (onlyUpdateScrollbars) {
@@ -1793,18 +1793,13 @@ bool EventHandler::handleMouseMoveEvent(const PlatformMouseEvent& mouseEvent, Hi
     if (hoveredNode)
         *hoveredNode = mev.hitTestResult();
 
-    Scrollbar* scrollbar = 0;
-
     if (m_resizeLayer && m_resizeLayer->inResizeMode())
         m_resizeLayer->resize(mouseEvent, m_offsetFromResizeCorner);
     else {
-        if (FrameView* view = m_frame->view())
-            scrollbar = view->scrollbarAtPoint(mouseEvent.position());
-
-        if (!scrollbar)
-            scrollbar = mev.scrollbar();
-
+        Scrollbar* scrollbar = mev.scrollbar();
         updateLastScrollbarUnderMouse(scrollbar, !m_mousePressed);
+        if (!m_mousePressed && scrollbar)
+            scrollbar->mouseMoved(mouseEvent); // Handle hover effects on platforms that support visual feedback on scrollbar hovering.
         if (onlyUpdateScrollbars)
             return true;
     }
@@ -1825,8 +1820,6 @@ bool EventHandler::handleMouseMoveEvent(const PlatformMouseEvent& mouseEvent, Hi
         if (newSubframe->view())
             swallowEvent |= passMouseMoveEventToSubframe(mev, newSubframe.get(), hoveredNode);
     } else {
-        if (scrollbar && !m_mousePressed)
-            scrollbar->mouseMoved(mouseEvent); // Handle hover effects on platforms that support visual feedback on scrollbar hovering.
         if (FrameView* view = m_frame->view()) {
             OptionalCursor optionalCursor = selectCursor(mev.hitTestResult(), mouseEvent.shiftKey());
             if (optionalCursor.isCursorChange()) {