[IntersectionObserver] Implement rootMargin parsing
authorajuma@chromium.org <ajuma@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 10 Aug 2018 17:08:44 +0000 (17:08 +0000)
committerajuma@chromium.org <ajuma@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 10 Aug 2018 17:08:44 +0000 (17:08 +0000)
commit1ab2a3136bd2dcb64d3fa97c5b350ee91c47bd53
tree673cf9303874bf633403add98a5d40608d42d841
parent4b56cb587088a57bba41a95de1ba3016bc56408c
[IntersectionObserver] Implement rootMargin parsing
https://bugs.webkit.org/show_bug.cgi?id=188469

Reviewed by Darin Adler.

LayoutTests/imported/w3c:

Update expectations for newly passing test cases.

* web-platform-tests/intersection-observer/observer-attributes-expected.txt:
* web-platform-tests/intersection-observer/observer-exceptions-expected.txt:

Source/WebCore:

Parse IntersectionObserver's rootMargin argument and throw an exception if it's invalid.
Change the stored rootMargin from a String to a LengthBox so that future patches can
use this value in intersection logic.

Tested by: imported/w3c/web-platform-tests/intersection-observer/observer-attributes.html
           imported/w3c/web-platform-tests/intersection-observer/observer-exceptions.html
           intersection-observer/intersection-observer-interface.html

* page/IntersectionObserver.cpp:
(WebCore::parseRootMargin):
(WebCore::IntersectionObserver::create):
(WebCore::IntersectionObserver::IntersectionObserver):
(WebCore::IntersectionObserver::rootMargin const):
* page/IntersectionObserver.h:
(WebCore::IntersectionObserver::create): Deleted.
(WebCore::IntersectionObserver::rootMargin const): Deleted.
* page/IntersectionObserver.idl:

LayoutTests:

* intersection-observer/intersection-observer-interface-expected.txt:
* intersection-observer/intersection-observer-interface.html:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@234761 268f45cc-cd09-0410-ab3c-d52691b4dbfc
LayoutTests/ChangeLog
LayoutTests/imported/w3c/ChangeLog
LayoutTests/imported/w3c/web-platform-tests/intersection-observer/observer-attributes-expected.txt
LayoutTests/imported/w3c/web-platform-tests/intersection-observer/observer-exceptions-expected.txt
LayoutTests/intersection-observer/intersection-observer-interface-expected.txt
LayoutTests/intersection-observer/intersection-observer-interface.html
Source/WebCore/ChangeLog
Source/WebCore/page/IntersectionObserver.cpp
Source/WebCore/page/IntersectionObserver.h
Source/WebCore/page/IntersectionObserver.idl