Intent to Ship: CSS custom state new :state() syntax

345 views
Skip to first unread message

Joey Arhar

unread,
Jan 3, 2024, 12:44:39 PMJan 3
to blink-dev

Contact emails

jar...@chromium.org

Explainer

None

Specification

https://html.spec.whatwg.org/multipage/custom-elements.html#custom-state-pseudo-class

Summary

This is the new syntax for the CSS custom state feature for custom elements. The old syntax, :--foo, is being deprecated and removed. This new syntax, :state(foo), is shipping in WebKit. Deprecation for old syntax: https://groups.google.com/a/chromium.org/g/blink-dev/c/JvpHoUfhJYE Spec for new syntax: https://github.com/whatwg/html/pull/8467



Blink component

Blink>HTML>CustomElements

TAG review

None

TAG review status

Not applicable

Risks



Interoperability and Compatibility

The new syntax will not have any interop or compat risks. WebKit has enabled the new syntax by default. I will implement and ship the new syntax alongside the old syntax so that developers can have access to both at the same time on stable and migrate to the new syntax.



Gecko: No signal (https://bugzilla.mozilla.org/show_bug.cgi?id=1588763) I believe this is being implemented in gecko by Keith.

WebKit: Shipped/Shipping (https://github.com/WebKit/WebKit/pull/22223)

Web developers: No signals

Other signals:

Ergonomics

This will be used in tandem with custom elements. This API will not make it hard for chrome to maintain good performance.



Activation

Developers will be able to take advantage of this feature immediately. Documentation and outreach could be useful for the deprecation of the old syntax and migration to the new syntax.



Security

There are no security/privacy risks for this CSS feature.



WebView application risks

Does this intent deprecate or change behavior of existing APIs, such that it has potentially high risk for Android WebView-based applications?

None



Debuggability

Styles applied by the custom state pseudo classes will appear in the styles sidebar of DevTools.



Will this feature be supported on all six Blink platforms (Windows, Mac, Linux, ChromeOS, Android, and Android WebView)?

Yes

Is this feature fully tested by web-platform-tests?

Yes

https://wpt.fyi/results/custom-elements/state?label=experimental&label=master&aligned



Flag name on chrome://flags

CustomStatePseudoRename

Finch feature name

CustomStatePseudoRename

Requires code in //chrome?

False

Estimated milestones

DevTrial on desktop122
DevTrial on Android122


Anticipated spec changes

Open questions about a feature may be a source of future web compat or interop issues. Please list open issues (e.g. links to known github issues in the project for the feature specification) whose resolution may introduce web compat/interop risk (e.g., changing to naming or structure of the API in a non-backward-compatible way).

None

Link to entry on the Chrome Platform Status

https://chromestatus.com/feature/5586433790443520

This intent message was generated by Chrome Platform Status.

Chris Harrelson

unread,
Jan 3, 2024, 12:55:15 PMJan 3
to Joey Arhar, blink-dev
LGTM1

--
You received this message because you are subscribed to the Google Groups "blink-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to blink-dev+...@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/blink-dev/CAK6btwJzbjvYUjj55%2BReonmSUKMONT5zsH3MX8Unvq3ED%2B6Qaw%40mail.gmail.com.

Mike Taylor

unread,
Jan 3, 2024, 1:10:10 PMJan 3
to Chris Harrelson, Joey Arhar, blink-dev

Mike Taylor

unread,
Jan 3, 2024, 1:11:12 PMJan 3
to Chris Harrelson, Joey Arhar, blink-dev

(but please remember to request reviews for the other review gates in chromestatus)

TAMURA, Kent

unread,
Jan 8, 2024, 7:03:46 PMJan 8
to Joey Arhar, blink-dev, Chris Harrelson, Mike Taylor
LGTM3.




--
TAMURA Kent
Software Engineer, Google


Reply all
Reply to author
Forward
0 new messages