Intent to prototype & ship: extended :lang() attribute matching (CSS Selectors 4)

48 views
Skip to first unread message

Jonathan Kew

unread,
Apr 8, 2023, 9:10:38 AM4/8/23
to dev-pl...@mozilla.org
Intent to Prototype:

Summary: The CSS Selectors Level 4 spec enhances the CSS :lang()
pseudo-class to provide authors with more flexible matching behavior,
based on BCP47 "Tags for Identifying Languages" and RFC4647 "Matching of
Language Tags".

For example, it becomes possible to use a selector such as :lang("*-CH")
to match content tagged as any language with a Swiss region subtag,
instead of having to write separate selectors for each of de-CH, fr-CH,
it-CH, etc.

Bug: https://bugzilla.mozilla.org/show_bug.cgi?id=1121792

Specification: https://w3c.github.io/csswg-drafts/selectors/#the-lang-pseudo

Standards Body: CSS Working Group

Platform coverage: All platforms/contexts

Preference: Not planning to put this behind a pref; it will simply be an
enhancement of the capabilities of an existing feature.

DevTools bug: n/a

Link to standards-positions discussion:
https://github.com/mozilla/standards-positions/issues/735.

Other browsers:

Blink: Intent to Ship:
https://groups.google.com/a/chromium.org/g/blink-dev/c/tO598HXuS94/m/x8rIA38aBgAJ

WebKit: Shipped (since around 2015, I believe), though I have noted some
spec-conformance issues with their implementation.

web-platform-tests: Proposing to add some WPT tests in the Gecko bug;
Blink implementers are also working on adding tests.


- - - - - - - - - -


Intent to Ship:

As of Firefox 114 (if all goes well), I intend to turn CSS Selectors 4
:lang() matching on by default for all platforms. I expect this to land
directly without being gated on a preference.

Status in other browsers is WebKit: shipping; Blink: Intent to Ship (see
above).

Bug to turn on by default:
https://bugzilla.mozilla.org/show_bug.cgi?id=1121792
Reply all
Reply to author
Forward
0 new messages