Intersection Observer: rootMargin: '' gives weird results
authorajuma@chromium.org <ajuma@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 28 Nov 2018 15:06:19 +0000 (15:06 +0000)
committerajuma@chromium.org <ajuma@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 28 Nov 2018 15:06:19 +0000 (15:06 +0000)
commit2dd8929f0752e914177f3715db6ae071f27e45e4
tree702195973d596ae37e3fbbe3cf4475fa0699ad50
parent9c682b5e491ea4192f4612c38ddddcdaf3f5b2dc
Intersection Observer: rootMargin: '' gives weird results
https://bugs.webkit.org/show_bug.cgi?id=191975

Reviewed by Simon Fraser.

LayoutTests/imported/w3c:

Add test coverage.

* web-platform-tests/intersection-observer/empty-root-margin-expected.txt: Added.
* web-platform-tests/intersection-observer/empty-root-margin.html: Added.

Source/WebCore:

When converting the rootMargin string into a LengthBox, explicitly construct a Length
of size 0px for each dimension, instead of using Length's default constructor. The
default constructor creates a Length with value Auto, which causes us to incorrectly
apply a non-zero rootMargin.

Test: imported/w3c/web-platform-tests/intersection-observer/empty-root-margin.html

* page/IntersectionObserver.cpp:
(WebCore::parseRootMargin):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@238610 268f45cc-cd09-0410-ab3c-d52691b4dbfc
LayoutTests/imported/w3c/ChangeLog
LayoutTests/imported/w3c/web-platform-tests/intersection-observer/empty-root-margin-expected.txt [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/intersection-observer/empty-root-margin.html [new file with mode: 0644]
Source/WebCore/ChangeLog
Source/WebCore/page/IntersectionObserver.cpp