[webkit-changes] [WebKit/WebKit] 5d2cf8: Values set by mask and background shorthands shoul...

Darin Adler noreply at github.com
Sat Feb 11 11:14:23 PST 2023


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 5d2cf8738277ddd1678dba6ea00157c60f247814
      https://github.com/WebKit/WebKit/commit/5d2cf8738277ddd1678dba6ea00157c60f247814
  Author: Darin Adler <darin at apple.com>
  Date:   2023-02-11 (Sat, 11 Feb 2023)

  Changed paths:
    M LayoutTests/editing/deleting/paste-with-transparent-background-color-expected.txt
    M LayoutTests/editing/deleting/paste-with-transparent-background-color-live-range-expected.txt
    M LayoutTests/fast/backgrounds/background-shorthand-after-set-backgroundSize-expected.txt
    M LayoutTests/fast/backgrounds/background-shorthand-after-set-backgroundSize.html
    M LayoutTests/fast/backgrounds/background-shorthand-with-backgroundSize-style-expected.txt
    M LayoutTests/fast/backgrounds/background-shorthand-with-backgroundSize-style.html
    M LayoutTests/fast/css/remove-shorthand-expected.txt
    M LayoutTests/fast/dom/background-shorthand-csstext-expected.txt
    M LayoutTests/fast/dom/background-shorthand-csstext.html
    M LayoutTests/imported/w3c/web-platform-tests/css/css-backgrounds/parsing/background-invalid-expected.txt
    M LayoutTests/imported/w3c/web-platform-tests/css/css-backgrounds/parsing/background-valid-expected.txt
    M LayoutTests/imported/w3c/web-platform-tests/css/css-backgrounds/parsing/background-valid.html
    M LayoutTests/imported/w3c/web-platform-tests/css/css-masking/parsing/mask-valid.sub-expected.txt
    M LayoutTests/imported/w3c/web-platform-tests/css/css-masking/parsing/mask-valid.sub.html
    M LayoutTests/platform/glib/imported/w3c/web-platform-tests/css/css-masking/parsing/mask-valid.sub-expected.txt
    M Source/WebCore/css/CSSProperties.json
    M Source/WebCore/css/StyleProperties.cpp
    M Source/WebCore/css/parser/CSSPropertyParser.cpp

  Log Message:
  -----------
  Values set by mask and background shorthands should not serialize as "initial"
https://bugs.webkit.org/show_bug.cgi?id=251838
rdar://problem/105114588

Reviewed by Tim Nguyen.

Needed to expand the function that serializes longhands to cover this case.
Also fixed serialization of the background shorthand to more closely match
the specification and a mistake in the parser that allowed invalid background
shorthand values involving sizes without positions.

* LayoutTests/editing/deleting/paste-with-transparent-background-color-expected.txt:
* LayoutTests/editing/deleting/paste-with-transparent-background-color-live-range-expected.txt:
Updated for progression where we no longer add "background-image: none" as a side effect.

* LayoutTests/fast/backgrounds/background-shorthand-after-set-backgroundSize-expected.txt:
* LayoutTests/fast/backgrounds/background-shorthand-after-set-backgroundSize.html:
* LayoutTests/fast/backgrounds/background-shorthand-with-backgroundSize-style-expected.txt:
* LayoutTests/fast/backgrounds/background-shorthand-with-backgroundSize-style.html:
* LayoutTests/fast/css/remove-shorthand-expected.txt:
* LayoutTests/fast/dom/background-shorthand-csstext-expected.txt:
* LayoutTests/fast/dom/background-shorthand-csstext.html:
Updated to assume background-color will be serialized first, as specified.

* LayoutTests/imported/w3c/web-platform-tests/css/css-backgrounds/parsing/background-invalid-expected.txt:
Updated to expect PASS for the test of parsing a size without a position.

* LayoutTests/imported/w3c/web-platform-tests/css/css-backgrounds/parsing/background-valid-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/css/css-backgrounds/parsing/background-valid.html:
Added tests of the longhand values. Removed result that allowed WebKit's old
incorrect serialization.

* LayoutTests/imported/w3c/web-platform-tests/css/css-masking/parsing/mask-valid.sub-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/css/css-masking/parsing/mask-valid.sub.html:
* LayoutTests/platform/glib/imported/w3c/web-platform-tests/css/css-masking/parsing/mask-valid.sub-expected.txt:
Added tests of the longhand values.

* Source/WebCore/css/CSSProperties.json: Moved background-color to the start
of the background shorthand so serialization matches the specification.

* Source/WebCore/css/StyleProperties.cpp:
(WebCore::serializeLonghandValue): Added special case for the lists that are
used for the mask and background longhands, because the parser puts
placeholders in there when parsing the shorthands.

* Source/WebCore/css/parser/CSSPropertyParser.cpp:
(WebCore::CSSPropertyParser::consumeBackgroundShorthand): Only parse size
immediately after a position. The old code required that it be after a
position, but not immediately after. Removed comment saying this makes
"invalid longhands". They are now valid, and the serializeLonghandValue
function above makes them serialize correctly.

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




More information about the webkit-changes mailing list