WebCore:
authoradele@apple.com <adele@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 30 Nov 2007 17:02:48 +0000 (17:02 +0000)
committeradele@apple.com <adele@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 30 Nov 2007 17:02:48 +0000 (17:02 +0000)
        Reviewed by Darin.

        Fix for http://bugs.webkit.org/show_bug.cgi?id=16072
        <rdar://problem/5463821> REGRESSION: Mousemove event isn't fired when mouse moves over scrollbar with pressed button (16072)

        Test: fast/events/mousemove-after-drag-over-scrollbar.html

        * page/EventHandler.cpp:
        (WebCore::EventHandler::handleMouseMoveEvent): If the mouse is pressed, and we've moved over a new scrollbar, then we can clear m_lastScrollbarUnderMouse.
         We should only need to show the hover effect when the mouse isn't pressed.

LayoutTests:

        Reviewed by Darin.

        Test for http://bugs.webkit.org/show_bug.cgi?id=16072
        <rdar://problem/5463821> REGRESSION: Mousemove event isn't fired when mouse moves over scrollbar with pressed button

        * fast/events/mousemove-after-drag-over-scrollbar-expected.txt: Added.
        * fast/events/mousemove-after-drag-over-scrollbar.html: Added.

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

LayoutTests/ChangeLog
LayoutTests/fast/events/mousemove-after-drag-over-scrollbar-expected.txt [new file with mode: 0644]
LayoutTests/fast/events/mousemove-after-drag-over-scrollbar.html [new file with mode: 0644]
WebCore/ChangeLog
WebCore/page/EventHandler.cpp

index 96147345093180778a70f41963b43959e60f6553..9ffc8efb7e183d97eb4b6b5b02d0493f353c1459 100644 (file)
@@ -1,3 +1,13 @@
+2007-11-30  Adele Peterson  <adele@apple.com>
+
+        Reviewed by Darin.
+
+        Test for http://bugs.webkit.org/show_bug.cgi?id=16072
+        <rdar://problem/5463821> REGRESSION: Mousemove event isn't fired when mouse moves over scrollbar with pressed button
+
+        * fast/events/mousemove-after-drag-over-scrollbar-expected.txt: Added.
+        * fast/events/mousemove-after-drag-over-scrollbar.html: Added.
+
 2007-11-30  Alexey Proskuryakov  <ap@webkit.org>
 
         * platform/win/Skipped: Added editing/selection/5241148.html, which crashes for me.
diff --git a/LayoutTests/fast/events/mousemove-after-drag-over-scrollbar-expected.txt b/LayoutTests/fast/events/mousemove-after-drag-over-scrollbar-expected.txt
new file mode 100644 (file)
index 0000000..cb08b15
--- /dev/null
@@ -0,0 +1,8 @@
+This tests that we continue to get mouse events after dragging past a scrollbar.
+Start a drag in this square, and drag past the scrollbar to the green square. Start a drag in this square, and drag past the scrollbar to the green square.  
+
+mousemove - box 1
+mousemove - box 1
+mousemove - box 2
+mousemove - box 2
+
diff --git a/LayoutTests/fast/events/mousemove-after-drag-over-scrollbar.html b/LayoutTests/fast/events/mousemove-after-drag-over-scrollbar.html
new file mode 100644 (file)
index 0000000..4ed01ed
--- /dev/null
@@ -0,0 +1,36 @@
+<html>
+    <head>
+        <script>
+            function test()
+            {
+                if (window.layoutTestController) {
+                    layoutTestController.dumpAsText();
+                    var d1 = document.getElementById('d1');
+                    var d2 = document.getElementById('d2');
+                    eventSender.dragMode = false;
+                    var left = d1.offsetLeft + 10;
+                    var top = d1.offsetTop + 10;
+                    
+                    eventSender.mouseMoveTo(left, top);
+                    eventSender.mouseDown();
+                    left = d2.offsetLeft - 10;
+                    eventSender.mouseMoveTo(left, top);
+                    left += 20;
+                    eventSender.mouseMoveTo(left, top);
+                    eventSender.mouseUp();
+                }
+            }
+                        
+            function log(msg)
+            {
+                document.getElementById('console').appendChild(document.createTextNode(msg + '\n'));
+            }
+        </script>
+    </head>
+    <body onload="test()">
+    This tests that we continue to get mouse events after dragging past a scrollbar.<br>
+    <div id="d1" style="height:120px; width:120px; overflow: auto; display: inline-block; background-color: red;" onmousemove="log('mousemove - box 1')">Start a drag in this square, and drag past the scrollbar to the green square.  Start a drag in this square, and drag past the scrollbar to the green square.  </div>
+    <div id="d2" style="height:120px; width:120px; display: inline-block; background-color: green;" onmousemove="log('mousemove - box 2')"></div><br><br>
+    <pre id="console"></pre>
+    </body>
+</html>
index 5dd481b71664548cd7b8d97bce9be9f2d9ac073c..de13e3a40fbca78023fbe85f65c0f80543f3d9de 100644 (file)
@@ -1,3 +1,16 @@
+2007-11-30  Adele Peterson  <adele@apple.com>
+
+        Reviewed by Darin.
+
+        Fix for http://bugs.webkit.org/show_bug.cgi?id=16072
+        <rdar://problem/5463821> REGRESSION: Mousemove event isn't fired when mouse moves over scrollbar with pressed button (16072)
+
+        Test: fast/events/mousemove-after-drag-over-scrollbar.html
+
+        * page/EventHandler.cpp:
+        (WebCore::EventHandler::handleMouseMoveEvent): If the mouse is pressed, and we've moved over a new scrollbar, then we can clear m_lastScrollbarUnderMouse.
+         We should only need to show the hover effect when the mouse isn't pressed.
+
 2007-11-29  Brady Eidson <beidson@apple.com>
 
         Reviewed by Tim
index 2eaafd511e3775864828aa1793ec9fab487fdd65..50ba0f131b18e7bb6dba63d875af3a1621a5a6a6 100644 (file)
@@ -1012,7 +1012,7 @@ bool EventHandler::handleMouseMoveEvent(const PlatformMouseEvent& mouseEvent, Hi
             // Send mouse exited to the old scrollbar.
             if (m_lastScrollbarUnderMouse)
                 m_lastScrollbarUnderMouse->handleMouseOutEvent(mouseEvent);
-            m_lastScrollbarUnderMouse = scrollbar;
+            m_lastScrollbarUnderMouse = m_mousePressed ? 0 : scrollbar;
         }
     }