Fix by Mitz Pettel, reviewed by Maciej.
authorap <ap@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sun, 12 Mar 2006 22:17:38 +0000 (22:17 +0000)
committerap <ap@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sun, 12 Mar 2006 22:17:38 +0000 (22:17 +0000)
        - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=5923
          REGRESSION: scrolling on Google maps continues after the mouse is
          released outside the window

        Test: fast/events/drag-outside-window.html

        * rendering/render_layer.cpp:
        (WebCore::RenderLayer::containsPoint): Always return true for the root
        object to ensure that mouse events occurring outside the window target
        the document.

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

LayoutTests/ChangeLog
LayoutTests/fast/events/drag-outside-window-expected.txt [new file with mode: 0644]
LayoutTests/fast/events/drag-outside-window.html [new file with mode: 0644]
LayoutTests/fast/events/resources/drag-outside-window-frame.html [new file with mode: 0644]
WebCore/ChangeLog
WebCore/rendering/render_layer.cpp

index 41e7e19c6d97f3bab1baac7ae2a9033c09ac92f4..c633d79053dcc8f72cf76529df5a3c8738ebf9a2 100644 (file)
@@ -1,3 +1,16 @@
+2006-03-12  Mitz Pettel  <opendarwin.org@mitzpettel.com>
+
+        Reviewed by Maciej, landed by ap.
+
+        - test for http://bugzilla.opendarwin.org/show_bug.cgi?id=5923
+          REGRESSION: scrolling on Google maps continues after the mouse is 
+          released outside the window
+
+        * fast/events/drag-outside-window-expected.txt: Added.
+        * fast/events/drag-outside-window.html: Added.
+        * fast/events/resources: Added.
+        * fast/events/resources/drag-outside-window-frame.html: Added.
+
 2006-03-12  Alexey Proskuryakov  <ap@nypop.com>
 
         Reviewed by Maciej.
diff --git a/LayoutTests/fast/events/drag-outside-window-expected.txt b/LayoutTests/fast/events/drag-outside-window-expected.txt
new file mode 100644 (file)
index 0000000..d2b9809
--- /dev/null
@@ -0,0 +1,5 @@
+EDITING DELEGATE: shouldChangeSelectedDOMRange:(null) toDOMRange:range from 31 of #text > P > BODY > HTML > #document to 31 of #text > P > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
+EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
+EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 31 of #text > P > BODY > HTML > #document to 31 of #text > P > BODY > HTML > #document toDOMRange:range from 31 of #text > P > BODY > HTML > #document to 31 of #text > P > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
+ALERT: Test result: PASS
+
diff --git a/LayoutTests/fast/events/drag-outside-window.html b/LayoutTests/fast/events/drag-outside-window.html
new file mode 100644 (file)
index 0000000..7db7cc7
--- /dev/null
@@ -0,0 +1,4 @@
+<frameset cols="100, *">
+<frame>
+<frame src="resources/drag-outside-window-frame.html">
+</frameset>
diff --git a/LayoutTests/fast/events/resources/drag-outside-window-frame.html b/LayoutTests/fast/events/resources/drag-outside-window-frame.html
new file mode 100644 (file)
index 0000000..bec0292
--- /dev/null
@@ -0,0 +1,31 @@
+<body onload="test()">
+<script type="text/javascript">
+document.addEventListener("mousemove", mousemoved);
+
+var result = "FAIL";
+
+function mousemoved(event)
+{
+    if (event.clientX < -1)
+        result = "PASS";
+}
+
+function test()
+{
+    if (!window.layoutTestController)
+        return;
+    layoutTestController.dumpAsText();
+    eventSender.mouseMoveTo(150, 100);
+    eventSender.mouseDown();
+    eventSender.mouseMoveTo(50, 100);
+    alert("Test result: " + result);
+}
+</script>
+<p>
+    This is a test for <i><a href="http://bugzilla.opendarwin.org/show_bug.cgi?id=5923">http://bugzilla.opendarwin.org/show_bug.cgi?id=5923</a>
+    REGRESSION: scrolling on Google maps continues after the mouse is released outside the window</i>.
+</p>
+<p>
+    (Cannot run interactively)
+</p>
+</body>
index 5f81cadee7e4752f606b24d58a52b487fbbd8113..eeab8a739c5e7aa4830167c531f737925ee4febf 100644 (file)
@@ -1,4 +1,19 @@
-2006-03-13  Alexey Proskuryakov  <ap@nypop.com>
+2006-03-12  Mitz Pettel  <opendarwin.org@mitzpettel.com>
+
+        Reviewed by Maciej, landed by ap.
+
+        - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=5923
+          REGRESSION: scrolling on Google maps continues after the mouse is 
+          released outside the window
+
+        Test: fast/events/drag-outside-window.html
+
+        * rendering/render_layer.cpp:
+        (WebCore::RenderLayer::containsPoint): Always return true for the root
+        object to ensure that mouse events occurring outside the window target
+        the document.
+
+2006-03-12  Alexey Proskuryakov  <ap@nypop.com>
 
         Reviewed by Maciej.
 
index bc92e3b4215cd0674c4bda419e004c51d053a7df..8455a67cb9683b69295e6a529c178402b5236bf9 100644 (file)
@@ -1313,7 +1313,9 @@ bool RenderLayer::intersectsDamageRect(const IntRect& layerBounds, const IntRect
 
 bool RenderLayer::containsPoint(int x, int y, const IntRect& damageRect) const
 {
-    return damageRect.contains(x, y);
+    // Always returning true for the root object to ensure that mouse events occurring
+    // outside the window (when dragging) always target some node.
+    return renderer()->isRoot() || damageRect.contains(x, y);
 }
 
 void RenderLayer::clearClipRects()