iframe and scrollbar with "overflow:auto" should support autoscroll with mousedrag
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 23 Sep 2013 21:50:16 +0000 (21:50 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 23 Sep 2013 21:50:16 +0000 (21:50 +0000)
commit71ef004eb568f915fbc2f209b3e9a3af44320196
tree76d0d62c7889b05cbfaadb3163355f0a2d119465
parent915a7563706a58f45ed6f949498cf52ef0a9c426
iframe and scrollbar with "overflow:auto" should support autoscroll with mousedrag
https://bugs.webkit.org/show_bug.cgi?id=40981

Patch by Antonio Gomes <a1.gomes@sisa.samsung.com> on 2013-09-23
Reviewed by Darin Adler.

Source/WebCore:

RenderBox::calculateAutoscrollDirection does not properly translate
inner frames' coordinates in order to determine its auto-scrollability.
By coincidence, if the inner frame box it placed near to page's 0, 0 position
(upper left corner), it might work.

Patch fixes it by changing ::calculateAutoscrollDirection algorithm to operate
with window coordinates, taking inner frames offset and scroll position into account.
The behavior of auto-scrollable non-frame overflow boxes, including divs, still works
as it is used to.

Test: fast/events/drag-and-drop-autoscroll-inner-frame.html

* rendering/RenderBox.cpp:
(WebCore::RenderBox::calculateAutoscrollDirection):

LayoutTests:

Test ensures that dragging an element close to the boundary of
scrollable Frames, scroll its content in that direction.

* fast/events/drag-and-drop-autoscroll-inner-frame-expected.txt: Added.
* fast/events/drag-and-drop-autoscroll-inner-frame.html: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@156297 268f45cc-cd09-0410-ab3c-d52691b4dbfc
LayoutTests/ChangeLog
LayoutTests/fast/events/drag-and-drop-autoscroll-inner-frame-expected.txt [new file with mode: 0644]
LayoutTests/fast/events/drag-and-drop-autoscroll-inner-frame.html [new file with mode: 0644]
LayoutTests/fast/events/resources/iframe-drag-and-drop-autoscroll.html [new file with mode: 0644]
Source/WebCore/ChangeLog
Source/WebCore/rendering/RenderBox.cpp