iframe and scrollbar with "overflow:auto" should support autoscroll with mousedrag
authortonikitoo@webkit.org <tonikitoo@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 23 Sep 2013 04:03:25 +0000 (04:03 +0000)
committertonikitoo@webkit.org <tonikitoo@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 23 Sep 2013 04:03:25 +0000 (04:03 +0000)
commit18391ecaa9864749ce0357357380a0f23987031a
tree651eb8c29523139f205aeb39656aa3dd10b94e97
parentb64463857586d119c17cf9501ca9a3cb26cb8530
iframe and scrollbar with "overflow:auto" should support autoscroll with mousedrag
https://bugs.webkit.org/show_bug.cgi?id=40981

Reviewed by Darin Adler.
Patch by Antonio Gomes <a1.gomes@sisa.samsung.com>

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@156257 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]
Source/WebCore/ChangeLog
Source/WebCore/rendering/RenderBox.cpp