haikuwebkit/LayoutTests/css3/scroll-snap/resources
Martin Robinson dea02544b5 Improve the serialization of scroll-snap-type and scroll-snap-align
https://bugs.webkit.org/show_bug.cgi?id=221324

LayoutTests/imported/w3c:

Reviewed by Alex Christensen.

* web-platform-tests/css/css-scroll-snap/inheritance-expected.txt:
* web-platform-tests/css/css-scroll-snap/parsing/scroll-snap-align-computed-expected.txt:
* web-platform-tests/css/css-scroll-snap/parsing/scroll-snap-align-valid-expected.txt:
* web-platform-tests/css/css-scroll-snap/parsing/scroll-snap-type-valid-expected.txt:
* web-platform-tests/css/cssom/cssstyledeclaration-csstext-expected.txt:

Source/WebCore:

Reviewed by Alex Christensen.

Improve serialization of scroll-snap-type and scroll-snap-align. When the values
are the same for both dimensions or a default value is used, don't add it to
the list of consumed tokens. The primitive conversion process will handle this
default correctly and serialization will produce a canonical serialization correctly.

We handle this case for both serialization of the style (eg getPropertyValue) and
for serialization of computed style.

No new tests.

* css/CSSComputedStyleDeclaration.cpp:
(WebCore::valueForScrollSnapAlignment): For the computed style don't serialize
the second value if it is the same as the first.
* css/parser/CSSPropertyParser.cpp:
(WebCore::consumeScrollSnapAlign): Only add the second value to the value list if it
exists and if it is different than the first value.
(WebCore::consumeScrollSnapType): Only add the second value if it is a non-default value.

LayoutTests:

Reviewed by Alex Christensen.

* css3/scroll-snap/resources/iframe-content-rtl.html:
* css3/scroll-snap/resources/iframe-content.html:
* css3/scroll-snap/scroll-snap-inherit-expected.txt:
* css3/scroll-snap/scroll-snap-inherit.html:
* css3/scroll-snap/scroll-snap-initial-expected.txt:
* css3/scroll-snap/scroll-snap-initial.html:
* css3/scroll-snap/scroll-snap-property-computed-style-expected.txt:
* css3/scroll-snap/scroll-snap-property-computed-style.js:
* platform/ios-wk2/imported/w3c/web-platform-tests/css/cssom/cssstyledeclaration-csstext-expected.txt:


Canonical link: https://commits.webkit.org/233694@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@272366 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-02-04 12:01:29 +00:00
..
iframe-content-rtl.html
iframe-content.html