Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
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
- Loading branch information
1 parent
dd5e8f4
commit 5d2cf87
Showing
18 changed files
with
156 additions
and
39 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...ported/w3c/web-platform-tests/css/css-backgrounds/parsing/background-invalid-expected.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
|
||
PASS e.style['background'] = "red, green" should not set the property value | ||
FAIL e.style['background'] = "black 0 url(https://example.invalid/) / cover" should not set the property value assert_equals: expected "" but got "url(\"https://example.invalid/\") 0px center / cover black" | ||
PASS e.style['background'] = "black 0 url(https://example.invalid/) / cover" should not set the property value | ||
|
18 changes: 18 additions & 0 deletions
18
...imported/w3c/web-platform-tests/css/css-backgrounds/parsing/background-valid-expected.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,21 @@ | ||
|
||
PASS e.style['background'] = "url(\"https://example.com/\") 1px 2px / 3px 4px space round local padding-box content-box, rgb(5, 6, 7) url(\"https://example.com/\") 1px 2px / 3px 4px space round local padding-box content-box" should set the property value | ||
PASS e.style['background'] = "none" should set background-attachment | ||
PASS e.style['background'] = "none" should set background-clip | ||
PASS e.style['background'] = "none" should set background-color | ||
PASS e.style['background'] = "none" should set background-image | ||
PASS e.style['background'] = "none" should set background-origin | ||
PASS e.style['background'] = "none" should set background-position | ||
PASS e.style['background'] = "none" should set background-repeat | ||
PASS e.style['background'] = "none" should set background-size | ||
PASS e.style['background'] = "none" should not set unrelated longhands | ||
PASS e.style['background'] = "url(\"https://example.com/\") 1px 2px / 3px 4px space round local padding-box content-box, rgb(5, 6, 7) url(\"https://example.com/\") 1px 2px / 3px 4px space round local padding-box content-box" should set background-attachment | ||
PASS e.style['background'] = "url(\"https://example.com/\") 1px 2px / 3px 4px space round local padding-box content-box, rgb(5, 6, 7) url(\"https://example.com/\") 1px 2px / 3px 4px space round local padding-box content-box" should set background-clip | ||
PASS e.style['background'] = "url(\"https://example.com/\") 1px 2px / 3px 4px space round local padding-box content-box, rgb(5, 6, 7) url(\"https://example.com/\") 1px 2px / 3px 4px space round local padding-box content-box" should set background-color | ||
PASS e.style['background'] = "url(\"https://example.com/\") 1px 2px / 3px 4px space round local padding-box content-box, rgb(5, 6, 7) url(\"https://example.com/\") 1px 2px / 3px 4px space round local padding-box content-box" should set background-image | ||
PASS e.style['background'] = "url(\"https://example.com/\") 1px 2px / 3px 4px space round local padding-box content-box, rgb(5, 6, 7) url(\"https://example.com/\") 1px 2px / 3px 4px space round local padding-box content-box" should set background-origin | ||
PASS e.style['background'] = "url(\"https://example.com/\") 1px 2px / 3px 4px space round local padding-box content-box, rgb(5, 6, 7) url(\"https://example.com/\") 1px 2px / 3px 4px space round local padding-box content-box" should set background-position | ||
PASS e.style['background'] = "url(\"https://example.com/\") 1px 2px / 3px 4px space round local padding-box content-box, rgb(5, 6, 7) url(\"https://example.com/\") 1px 2px / 3px 4px space round local padding-box content-box" should set background-repeat | ||
PASS e.style['background'] = "url(\"https://example.com/\") 1px 2px / 3px 4px space round local padding-box content-box, rgb(5, 6, 7) url(\"https://example.com/\") 1px 2px / 3px 4px space round local padding-box content-box" should set background-size | ||
PASS e.style['background'] = "url(\"https://example.com/\") 1px 2px / 3px 4px space round local padding-box content-box, rgb(5, 6, 7) url(\"https://example.com/\") 1px 2px / 3px 4px space round local padding-box content-box" should not set unrelated longhands | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.