Skip to content

[selectors-4] Case-insensitive health warning #13645

Closed

Description

@aphillips

Case Sensitivity
https://www.w3.org/TR/2026/WD-selectors-4-20260122/#attribute-case

To match attribute values ASCII case-insensitively regardless of document language rules, the attribute selector may include the identifier i before the closing bracket (]). When this flag is present, UAs must match the attribute’s value ASCII case-insensitively (i.e. [a-z] and [A-Z] are considered equivalent).

Alternately, the attribute selector may include the identifier s before the closing bracket (]); in this case the UA must match the value case-sensitively, with “identical to” semantics [INFRA], regardless of document language rules.

The text about case insensitive (ASCII case fold) matching probably should have some sort of prominent health warning so that users understand this is only an ASCII case fold.

Activity

  1. added
    selectors-4
    i18n-needs-resolution
    on Mar 12, 2026
  2. svgeesus commented on Mar 12, 2026

    @svgeesus
    Collaborator

    Isn't the name ASCII case-insensitively already a strong indication that this folds the ASCII range only? Even before one follows the link and reads:

    To ASCII lowercase a string, replace all ASCII upper alphas in the string with their corresponding code point in ASCII lower alpha.

    and

    An ASCII upper alpha is a code point in the range U+0041 (A) to U+005A (Z), inclusive.

  3. svgeesus commented on Mar 12, 2026

    @svgeesus
  4. svgeesus commented on Mar 12, 2026

    @svgeesus
  5. tabatkins commented on Mar 12, 2026

    @tabatkins
    Member

    I'm also not sure how a warning could provide more 'this is ASCII' information than the 'ASCII' already in the name of the operation.

  6. svgeesus commented on Mar 12, 2026

    @svgeesus
    Collaborator

    @aphillips sorry to be obtuse but what are we missing here? It seems simple and obvious to us, and the ASCII case-insensitively is used all over CSS specifications.

  7. aphillips commented on Mar 12, 2026

    @aphillips
    ContributorAuthor

    The challenge here is that ASCII case-insensitivity is quirky wrt CSS. Usually ASCII case-insensitivity is used where the value space is also limited to ASCII. But attribute values are not limited in this way. So green matches GREEN but grün doesn't match GRÜN (it does, however, match GRüN). The "ASCII" decoration of the case matching scheme normatively means this and most of us who have been around CSS know about this, but newcomers may be surprised.

  8. svgeesus commented on Mar 13, 2026

    @svgeesus
    Collaborator

    Okay, so an example illustrating that would be helpful.

  9. svgeesus commented on Mar 31, 2026

    @svgeesus
    Collaborator

    @aphillips does this example address your concern?

  10. aphillips commented on Mar 31, 2026

    @aphillips
    ContributorAuthor

    @svgeesus asked:

    does this example address your concern?

    Thanks, it does.

  11. added
    Closed Accepted as Editorial
    Commenter Satisfied
    on Mar 31, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Closed Accepted as EditorialCommenter Satisfiedi18n-needs-resolutionselectors-4

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      Sponsor
      SponsoredKunjungi sekarang
      Promo