Align element.scroll() / scrollTo() / scrollBy() with the CSSOM specification
authorsimon.fraser@apple.com <simon.fraser@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 6 Sep 2016 21:18:06 +0000 (21:18 +0000)
committersimon.fraser@apple.com <simon.fraser@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 6 Sep 2016 21:18:06 +0000 (21:18 +0000)
commit13d530e6683a6f5cb077d187b77ad55311d3697a
tree1a147d9f5da8458ff8733e86af895106b89d6fdf
parent836e2d05adbc2b326c7cb4822acc2ca2c935bbb4
Align element.scroll() / scrollTo() / scrollBy() with the CSSOM specification
https://bugs.webkit.org/show_bug.cgi?id=161610

Reviewed by Darin Adler, Chris Dumez.

Source/WebCore:

Implement Element.scroll(), scrollBy() and scrollTo() with x,y and ScrollToOptions
on Element, according to <https://drafts.csswg.org/cssom-view/#element-scrolling-members>

WebKit's behavior of treating scrolls on the body element in both quirks and strict mode
is preserved.

Tests: fast/dom/Element/scrolling-funtions-on-body-quirks.html
       fast/dom/Element/scrolling-funtions-on-body.html
       fast/dom/Element/scrolling-funtions-on-element.html

* dom/Element.cpp:
(WebCore::Element::scrollBy):
(WebCore::normalizeNonFiniteValue):
(WebCore::Element::scrollTo):
* dom/Element.h:
* dom/Element.idl:
* html/HTMLBodyElement.cpp:
(WebCore::HTMLBodyElement::scrollTo):
* html/HTMLBodyElement.h:

LayoutTests:

* fast/dom/Element/scrolling-funtions-on-body-expected.txt: Added.
* fast/dom/Element/scrolling-funtions-on-body-quirks-expected.txt: Added.
* fast/dom/Element/scrolling-funtions-on-body-quirks.html: Added.
* fast/dom/Element/scrolling-funtions-on-body.html: Added.
* fast/dom/Element/scrolling-funtions-on-element-expected.txt: Added.
* fast/dom/Element/scrolling-funtions-on-element.html: Added.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@205505 268f45cc-cd09-0410-ab3c-d52691b4dbfc
13 files changed:
LayoutTests/ChangeLog
LayoutTests/fast/dom/Element/scrolling-funtions-on-body-expected.txt [new file with mode: 0644]
LayoutTests/fast/dom/Element/scrolling-funtions-on-body-quirks-expected.txt [new file with mode: 0644]
LayoutTests/fast/dom/Element/scrolling-funtions-on-body-quirks.html [new file with mode: 0644]
LayoutTests/fast/dom/Element/scrolling-funtions-on-body.html [new file with mode: 0644]
LayoutTests/fast/dom/Element/scrolling-funtions-on-element-expected.txt [new file with mode: 0644]
LayoutTests/fast/dom/Element/scrolling-funtions-on-element.html [new file with mode: 0644]
Source/WebCore/ChangeLog
Source/WebCore/dom/Element.cpp
Source/WebCore/dom/Element.h
Source/WebCore/dom/Element.idl
Source/WebCore/html/HTMLBodyElement.cpp
Source/WebCore/html/HTMLBodyElement.h