Re: [csswg-drafts] [selectors-4] Case-sensitive attribute selectors (#2101)

Is there a way to support additional flags for matching qualities/inequalities?

Such as:
- a 'n' flag  for normalizing strings to compare (both to NFC, or equivalently NFD internally if this is more convenient to the implementation)
- a 'k' flag (for NFKC, or NFKD): the result is also in NFC or NFD, but matching is more lenient (for example a "wide" Latin letter 'a' would match a Basic Latin letter 'a'; adding the 'n' flag to the 'k' flag would have no effect)
-  a 's' flag for "Safe NFC" (or Safe NFD), i.e. ignoring extra "CGJ" added by the "safe normalization" to limit combining sequences to 30 characters for canonical equivalences/composition/decomposition: CGJ as splitting combining sequences into several ones ; note that the result "safely normalized" string is not necessarily "canonically equivalent", as canonical equivalence is bounded by characters with combing class 0 (including base charactrers, controls, and CGJ); using the 's' flag could be costly in terms of buffering as it may require long reordering if resulting strings are normalized by 'n' or 'k'.
- possibly the inverse flags 'N', 'K', 'S' if one does not want to use browser's default behavior and the browser already applies some of the 3 normalizations above.

So there could be multiple flags before the closing ']',  they coulld be speciified in any order, but if they contradict each other (e.g. 'i' and 's', or 'n' and 'N'), the last one takes place: flags are evaluated in order from left to right.

The idea is to support large values for attributes or pseudo-attributes containing arbitrary Unicode text (e.g. data from a large input form field or large text elements, including text fragments matched by pseudo-attributes).

Those flags could also apply to regexp matchings using operators with '~' instead of '='.



-- 
GitHub Notification of comment by verdy-p
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/2101#issuecomment-907726391 using your GitHub account


-- 
Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config

Received on Sunday, 29 August 2021 04:15:32 UTC