From 27ad5e8a401f913d2f674a9a4824821cc3414852 Mon Sep 17 00:00:00 2001 From: ap Date: Sun, 12 Mar 2006 22:17:38 +0000 Subject: [PATCH] Fix by Mitz Pettel, reviewed by Maciej. - 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 | 13 ++++++++ .../events/drag-outside-window-expected.txt | 5 +++ .../fast/events/drag-outside-window.html | 4 +++ .../resources/drag-outside-window-frame.html | 31 +++++++++++++++++++ WebCore/ChangeLog | 17 +++++++++- WebCore/rendering/render_layer.cpp | 4 ++- 6 files changed, 72 insertions(+), 2 deletions(-) create mode 100644 LayoutTests/fast/events/drag-outside-window-expected.txt create mode 100644 LayoutTests/fast/events/drag-outside-window.html create mode 100644 LayoutTests/fast/events/resources/drag-outside-window-frame.html diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog index 41e7e19c6d97..c633d79053dc 100644 --- a/LayoutTests/ChangeLog +++ b/LayoutTests/ChangeLog @@ -1,3 +1,16 @@ +2006-03-12 Mitz Pettel + + 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 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 index 000000000000..d2b9809e9ead --- /dev/null +++ b/LayoutTests/fast/events/drag-outside-window-expected.txt @@ -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 index 000000000000..7db7cc729d81 --- /dev/null +++ b/LayoutTests/fast/events/drag-outside-window.html @@ -0,0 +1,4 @@ + + + + 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 index 000000000000..bec029234316 --- /dev/null +++ b/LayoutTests/fast/events/resources/drag-outside-window-frame.html @@ -0,0 +1,31 @@ + + +

+ This is a 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. +

+

+ (Cannot run interactively) +

+ diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog index 5f81cadee7e4..eeab8a739c5e 100644 --- a/WebCore/ChangeLog +++ b/WebCore/ChangeLog @@ -1,4 +1,19 @@ -2006-03-13 Alexey Proskuryakov +2006-03-12 Mitz Pettel + + 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 Reviewed by Maciej. diff --git a/WebCore/rendering/render_layer.cpp b/WebCore/rendering/render_layer.cpp index bc92e3b4215c..8455a67cb968 100644 --- a/WebCore/rendering/render_layer.cpp +++ b/WebCore/rendering/render_layer.cpp @@ -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() -- 2.36.0