scrollLeft returns different values for viewport and non-viewport scrolling with rtl
authorsimon.fraser@apple.com <simon.fraser@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sun, 3 Jan 2016 18:06:50 +0000 (18:06 +0000)
committersimon.fraser@apple.com <simon.fraser@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sun, 3 Jan 2016 18:06:50 +0000 (18:06 +0000)
commitb26a0a3429051798b1eb485e5cd860a2876e5407
tree3225583e78447d1e8a9f11137e5f357ed213723a
parent034b11b8445946affa0690ec7d93c98d980d0e31
scrollLeft returns different values for viewport and non-viewport scrolling with rtl
https://bugs.webkit.org/show_bug.cgi?id=94405
rdar://problem/21829754

Reviewed by Zalan Bujtas.

Source/WebCore:

Use scrollPosition for DOM-exposed scroll* values on overflow scroll elements,
matching the CSS OM View spec, and Gecko behavior.

Test: fast/scrolling/programmatic-overflow-rtl-scrollIntoView.html

* rendering/RenderBox.cpp:
(WebCore::RenderBox::scrollLeft):
(WebCore::RenderBox::scrollTop):
(WebCore::RenderBox::setScrollLeft):
(WebCore::RenderBox::setScrollTop):
* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::scrollToXPosition):
(WebCore::RenderLayer::scrollToYPosition):
* rendering/RenderLayer.h:

LayoutTests:

programmatic-overflow-rtl-scrollIntoView.html is a basic test for negative scrollLeft
in an RTL scroller.

Other tests are fixed to programmatically scroll to negative scroll positions.

* compositing/rtl/rtl-overflow-scrolling.html:
* fast/overflow/scroll-div-hide-show-expected.txt:
* fast/overflow/scroll-div-hide-show.html:
* fast/repaint/horizontal-bt-overflow-parent.html:
* fast/repaint/horizontal-bt-overflow-same.html:
* fast/repaint/vertical-overflow-parent.html:
* fast/repaint/vertical-overflow-same.html:
* fast/scrolling/programmatic-overflow-rtl-scrollIntoView-expected.txt: Added.
* fast/scrolling/programmatic-overflow-rtl-scrollIntoView.html: Added.
* fast/writing-mode/flipped-blocks-hit-test-overflow-scroll.html:
* imported/blink/compositing/overflow/rtl-overflow.html:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@194514 268f45cc-cd09-0410-ab3c-d52691b4dbfc
16 files changed:
LayoutTests/ChangeLog
LayoutTests/compositing/rtl/rtl-overflow-scrolling.html
LayoutTests/fast/overflow/scroll-div-hide-show-expected.txt
LayoutTests/fast/overflow/scroll-div-hide-show.html
LayoutTests/fast/repaint/horizontal-bt-overflow-parent.html
LayoutTests/fast/repaint/horizontal-bt-overflow-same.html
LayoutTests/fast/repaint/vertical-overflow-parent.html
LayoutTests/fast/repaint/vertical-overflow-same.html
LayoutTests/fast/scrolling/programmatic-overflow-rtl-scrollIntoView-expected.txt [new file with mode: 0644]
LayoutTests/fast/scrolling/programmatic-overflow-rtl-scrollIntoView.html [new file with mode: 0644]
LayoutTests/fast/writing-mode/flipped-blocks-hit-test-overflow-scroll.html
LayoutTests/imported/blink/compositing/overflow/rtl-overflow.html
Source/WebCore/ChangeLog
Source/WebCore/rendering/RenderBox.cpp
Source/WebCore/rendering/RenderLayer.cpp
Source/WebCore/rendering/RenderLayer.h