[CSSWG][selectors-4] Updated WD of Selectors L4

# fantasai (4 months ago)

The CSS WG has published an updated Working Draft of Selectors Level 4:


Selectors are patterns that match against elements in a tree and are used as a core part of CSS and in DOM methods such as .querySelector()

This update adds, drops, and renames a number of selectors:

  • zero-specificity pseudo-class named :where()
  • :matches() renamed to :is()
  • :blank defined to select empty user input elements
  • :empty redefined to ignore whitespace-only text nodes
  • :drop() dropped due to removal of support in HTML
  • Added case-sensitive attribute value matching flag

In addition, the specificity rules for :is() and :nth-child() were altered to use the most specific selector argument rather than the most specific selector that happened to match. See www.w3.org/TR/selectors-4/#specificity-rules and discussion in w3c/csswg-drafts#1027

Changes since the February 2018 WD are all listed at: www.w3.org/TR/2018/WD-selectors-4-20181121/#changes

One major issue that's open is redefining the way invalid selectors are handled within :is() and similar pseudo-classes to ignore unknown selectors rather than invalidating the entire style rule. See w3c/csswg-drafts#3264

Another series of open issues concerns the :visited pseudo-class and how to balance security concerns with usability requirements. See e.g. w3c/csswg-drafts#3012, w3c/csswg-drafts#2263

Please review the draft, and send any comments to the CSSWG mailing list,

<www-style at w3.org>, prefixed with [selectors-4] (as I did on this

message) or (preferably) file them in the GitHub repository at w3c/csswg-drafts/issues

For the CSS WG, ~fantasai

Contact us to advertise here
# fantasai (a day ago)

On 11/21/18 2:33 PM, Andrew Fedoniouk wrote:

:blank is quite bad as a state name

For example <input type="text" value=""> shall be considered as not :blank as it has initial value deliberately set to blank string (empty string allowed).

This would match :blank.


Want more features?

Request early access to our private beta of readable email premium.