Bug 250506

Summary: Update whitespace expectations for custom properties to match CSS Syntax Level 3 in some WPTs
Product: WebKit Reporter: Antti Koivisto <koivisto>
Component: CSSAssignee: Antti Koivisto <koivisto>
Status: RESOLVED FIXED    
Severity: Normal CC: webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
See Also: https://github.com/web-platform-tests/wpt/pull/37923
https://bugs.webkit.org/show_bug.cgi?id=261546

Description Antti Koivisto 2023-01-12 02:58:35 PST
Tokenisation and parsing for whitespaces described in CSS Syntax Module Level 3 matches the current WebKit behavior in custom properties.
Some WPTs still have wrong expectations.

Both leading and trailing whitespaces should be stripped:

https://drafts.csswg.org/css-syntax/#consume-declaration

    2. While the next input token is a <whitespace-token>, consume the next input token.
    ...
    7. While the last token in decl’s value is a <whitespace-token>, remove that token."

Middle whitespaces collapse to a single <whitespace-token>:

https://drafts.csswg.org/css-syntax/#consume-token

    whitespace
    Consume as much whitespace as possible. Return a <whitespace-token>.
Comment 1 Radar WebKit Bug Importer 2023-01-12 02:59:46 PST
<rdar://problem/104162464>
Comment 2 Antti Koivisto 2023-01-12 07:08:22 PST
Pull request: https://github.com/WebKit/WebKit/pull/8573
Comment 3 Antti Koivisto 2023-01-12 22:43:52 PST
Submitted web-platform-tests pull request: https://github.com/web-platform-tests/wpt/pull/37923
Comment 4 EWS 2023-01-12 23:20:08 PST
Committed 258866@main (7a3b462e1d00): <https://commits.webkit.org/258866@main>

Reviewed commits have been landed. Closing PR #8573 and removing active labels.