[webkit-changes] [WebKit/WebKit] 1d99a9: [CSS-Typed-OM] Reification of non-list valued prop...

Chris Dumez noreply at github.com
Thu Dec 15 09:19:14 PST 2022


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 1d99a936a0dbf27116604766f70d1ecf74bcdf98
      https://github.com/WebKit/WebKit/commit/1d99a936a0dbf27116604766f70d1ecf74bcdf98
  Author: Chris Dumez <cdumez at apple.com>
  Date:   2022-12-15 (Thu, 15 Dec 2022)

  Changed paths:
    M LayoutTests/imported/w3c/web-platform-tests/css/css-typed-om/the-stylepropertymap/properties/backdrop-filter-expected.txt
    M LayoutTests/imported/w3c/web-platform-tests/css/css-typed-om/the-stylepropertymap/properties/contain-expected.txt
    M LayoutTests/imported/w3c/web-platform-tests/css/css-typed-om/the-stylepropertymap/properties/cursor-expected.txt
    M LayoutTests/imported/w3c/web-platform-tests/css/css-typed-om/the-stylepropertymap/properties/filter-expected.txt
    M LayoutTests/imported/w3c/web-platform-tests/css/css-typed-om/the-stylepropertymap/properties/font-variant-east-asian-expected.txt
    M LayoutTests/imported/w3c/web-platform-tests/css/css-typed-om/the-stylepropertymap/properties/font-variant-ligatures-expected.txt
    M LayoutTests/imported/w3c/web-platform-tests/css/css-typed-om/the-stylepropertymap/properties/font-variant-numeric-expected.txt
    M LayoutTests/imported/w3c/web-platform-tests/css/css-typed-om/the-stylepropertymap/properties/grid-auto-flow-expected.txt
    M LayoutTests/imported/w3c/web-platform-tests/css/css-typed-om/the-stylepropertymap/properties/grid-start-end-expected.txt
    M LayoutTests/imported/w3c/web-platform-tests/css/css-typed-om/the-stylepropertymap/properties/grid-template-columns-rows-expected.txt
    M LayoutTests/imported/w3c/web-platform-tests/css/css-typed-om/the-stylepropertymap/properties/offset-rotate-expected.txt
    M LayoutTests/imported/w3c/web-platform-tests/css/css-typed-om/the-stylepropertymap/properties/quotes-expected.txt
    M LayoutTests/imported/w3c/web-platform-tests/css/css-typed-om/the-stylepropertymap/properties/scroll-snap-align-expected.txt
    M LayoutTests/imported/w3c/web-platform-tests/css/css-typed-om/the-stylepropertymap/properties/scroll-snap-type-expected.txt
    M LayoutTests/imported/w3c/web-platform-tests/css/css-typed-om/the-stylepropertymap/properties/stroke-dasharray-expected.txt
    M LayoutTests/imported/w3c/web-platform-tests/css/css-typed-om/the-stylepropertymap/properties/text-indent-expected.txt
    M LayoutTests/imported/w3c/web-platform-tests/css/css-typed-om/the-stylepropertymap/properties/text-shadow-expected.txt
    M LayoutTests/imported/w3c/web-platform-tests/css/css-typed-om/the-stylepropertymap/properties/transition-property-expected.txt
    M LayoutTests/imported/w3c/web-platform-tests/css/css-typed-om/the-stylepropertymap/properties/will-change-expected.txt
    M Source/WebCore/css/typedom/CSSStyleValueFactory.cpp
    M Source/WebCore/css/typedom/CSSStyleValueFactory.h
    M Source/WebCore/css/typedom/ComputedStylePropertyMapReadOnly.cpp
    M Source/WebCore/css/typedom/DeclaredStylePropertyMap.cpp
    M Source/WebCore/css/typedom/HashMapStylePropertyMapReadOnly.cpp
    M Source/WebCore/css/typedom/InlineStylePropertyMap.cpp
    M Source/WebCore/css/typedom/MainThreadStylePropertyMapReadOnly.cpp
    M Source/WebCore/css/typedom/StylePropertyMapReadOnly.cpp
    M Source/WebCore/css/typedom/StylePropertyMapReadOnly.h
    M Source/WebCore/css/typedom/transform/CSSMatrixComponent.cpp
    M Source/WebCore/css/typedom/transform/CSSPerspective.cpp
    M Source/WebCore/css/typedom/transform/CSSRotate.cpp
    M Source/WebCore/css/typedom/transform/CSSScale.cpp
    M Source/WebCore/css/typedom/transform/CSSSkew.cpp
    M Source/WebCore/css/typedom/transform/CSSSkewX.cpp
    M Source/WebCore/css/typedom/transform/CSSSkewY.cpp
    M Source/WebCore/css/typedom/transform/CSSTranslate.cpp

  Log Message:
  -----------
  [CSS-Typed-OM] Reification of non-list valued properties is incorrect
https://bugs.webkit.org/show_bug.cgi?id=249351

Reviewed by Simon Fraser.

During reification of CSSValues, if encountering a CSSValueList, we would:
1. Return the first value in the list for StylePropertyMap.get()
2. Return each item in the list in an array for StylePropertyMap.getAll()

However, we're only supposed to do this if he property is a list-valued
property [1][2]. For non-list valued properties, we're should:
1. Return a generic CSSStyleValue wrapping the list for StylePropertyMap.get()
2. Return an array containing a single item that is a generic CSSStyleValue
   wrapping the list, for StylePropertyMap.getAll()

See:
[1] https://drafts.css-houdini.org/css-typed-om/#list-valued-properties
[2] https://drafts.css-houdini.org/css-typed-om/#reify-stylevalue

* LayoutTests/imported/w3c/web-platform-tests/css/css-typed-om/the-stylepropertymap/properties/backdrop-filter-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/css/css-typed-om/the-stylepropertymap/properties/contain-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/css/css-typed-om/the-stylepropertymap/properties/cursor-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/css/css-typed-om/the-stylepropertymap/properties/filter-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/css/css-typed-om/the-stylepropertymap/properties/font-variant-east-asian-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/css/css-typed-om/the-stylepropertymap/properties/font-variant-ligatures-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/css/css-typed-om/the-stylepropertymap/properties/font-variant-numeric-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/css/css-typed-om/the-stylepropertymap/properties/grid-auto-flow-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/css/css-typed-om/the-stylepropertymap/properties/grid-start-end-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/css/css-typed-om/the-stylepropertymap/properties/grid-template-columns-rows-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/css/css-typed-om/the-stylepropertymap/properties/quotes-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/css/css-typed-om/the-stylepropertymap/properties/scroll-snap-align-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/css/css-typed-om/the-stylepropertymap/properties/scroll-snap-type-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/css/css-typed-om/the-stylepropertymap/properties/stroke-dasharray-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/css/css-typed-om/the-stylepropertymap/properties/text-indent-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/css/css-typed-om/the-stylepropertymap/properties/text-shadow-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/css/css-typed-om/the-stylepropertymap/properties/transition-property-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/css/css-typed-om/the-stylepropertymap/properties/will-change-expected.txt:
Rebaseline WPT tests now that more checks are passing.

* LayoutTests/imported/w3c/web-platform-tests/css/css-typed-om/the-stylepropertymap/properties/offset-rotate-expected.txt:
The rebaseline actually looks like a regression here but I suspect the test is wrong. Our new behavior here is actually
aligned with Blink here. When setting the `offset-rotate` property to `auto` via StylePropertyMap.set(), we properly return
`new CSSKeywordValue("auto")` when calling StylePropertyMap.get() on the inline property map. However, for the computed
style property map, we now return `new CSSStylePropertyMap("auto 0deg")` instead of `new CSSKeywordValue("auto")`. The reason
for this is that the computed value actually contains an angle as part of a CSSValueList. I'll investigate this test separately
but I suspect our new behavior is correct and the test just needs updating.

* Source/WebCore/css/typedom/CSSStyleValueFactory.cpp:
(WebCore::CSSStyleValueFactory::parseStyleValue):
(WebCore::CSSStyleValueFactory::reifyValue):
* Source/WebCore/css/typedom/CSSStyleValueFactory.h:
* Source/WebCore/css/typedom/ComputedStylePropertyMapReadOnly.cpp:
(WebCore::ComputedStylePropertyMapReadOnly::entries const):
* Source/WebCore/css/typedom/DeclaredStylePropertyMap.cpp:
(WebCore::DeclaredStylePropertyMap::entries const):
* Source/WebCore/css/typedom/HashMapStylePropertyMapReadOnly.cpp:
(WebCore::HashMapStylePropertyMapReadOnly::entries const):
* Source/WebCore/css/typedom/InlineStylePropertyMap.cpp:
(WebCore::InlineStylePropertyMap::entries const):
* Source/WebCore/css/typedom/MainThreadStylePropertyMapReadOnly.cpp:
(WebCore::MainThreadStylePropertyMapReadOnly::get const):
(WebCore::MainThreadStylePropertyMapReadOnly::getAll const):
* Source/WebCore/css/typedom/StylePropertyMapReadOnly.cpp:
(WebCore::StylePropertyMapReadOnly::reifyValue):
(WebCore::StylePropertyMapReadOnly::reifyValueToVector):
* Source/WebCore/css/typedom/StylePropertyMapReadOnly.h:
* Source/WebCore/css/typedom/transform/CSSMatrixComponent.cpp:
(WebCore::CSSMatrixComponent::create):
* Source/WebCore/css/typedom/transform/CSSPerspective.cpp:
(WebCore::CSSPerspective::create):
* Source/WebCore/css/typedom/transform/CSSRotate.cpp:
(WebCore::CSSRotate::create):
* Source/WebCore/css/typedom/transform/CSSScale.cpp:
(WebCore::CSSScale::create):
* Source/WebCore/css/typedom/transform/CSSSkew.cpp:
(WebCore::CSSSkew::create):
* Source/WebCore/css/typedom/transform/CSSSkewX.cpp:
(WebCore::CSSSkewX::create):
* Source/WebCore/css/typedom/transform/CSSSkewY.cpp:
(WebCore::CSSSkewY::create):
* Source/WebCore/css/typedom/transform/CSSTranslate.cpp:
(WebCore::CSSTranslate::create):

Canonical link: https://commits.webkit.org/257927@main




More information about the webkit-changes mailing list