Bug 250506 - Update whitespace expectations for custom properties to match CSS Syntax Level 3 in some WPTs
Summary: Update whitespace expectations for custom properties to match CSS Syntax Leve...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: CSS (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Antti Koivisto
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2023-01-12 02:58 PST by Antti Koivisto
Modified: 2023-09-13 20:34 PDT (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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.