From 4c28983042ccdb0725176a829312bce1a1859114 Mon Sep 17 00:00:00 2001 From: "L. David Baron" Date: Tue, 13 Aug 2024 17:00:32 -0400 Subject: [PATCH] [selectors-5] Create selectors-5 delta spec draft from deferred-for-level-5 file. As part of the resolution in #4805 and as a followup to #8213, this moves the deferred-for-level-5 file from the selectors-4 directory into a new selectors-5 delta spec. --- .../Overview.bs | 153 +++++++++++++----- 1 file changed, 114 insertions(+), 39 deletions(-) rename selectors-4/deferred-for-level-5 => selectors-5/Overview.bs (60%) diff --git a/selectors-4/deferred-for-level-5 b/selectors-5/Overview.bs similarity index 60% rename from selectors-4/deferred-for-level-5 rename to selectors-5/Overview.bs index f53012644a7..70a9d4ed6f5 100644 --- a/selectors-4/deferred-for-level-5 +++ b/selectors-5/Overview.bs @@ -1,40 +1,42 @@ -

-Reference combinators /ref/

- - The reference combinator consists of two slashes - with an intervening CSS qualified name, - and separates two compound selectors, - e.g. ''A /attr/ B''. - The element represented by the first compound selector - explicitly references - the element represented by the second compound selector. - Unless the host language defines a different syntax for expressing this relationship, - this relationship is considered to exist if - the value of the specified attribute on the first element is an IDREF or an ID selector - referencing the second element. - - Attribute matching for reference combinators follow the same rules as for attribute selectors. - -
- The following example highlights an input element - when its <label> - is focused or hovered-over: - -
-		label:is(:hover, :focus) /for/ input,       /* association by "for" attribute */
-		label:is(:hover, :focus):not([for]) input { /* association by containment */
-			box-shadow: yellow 0 0 10px;
-		}
-		
-
- - +
+Title: Selectors Level 5
+Group: CSSWG
+Shortname: selectors
+Level: 5
+Status: ED
+Work Status: Exploring
+ED: https://drafts.csswg.org/selectors-5/
+TR: https://www.w3.org/TR/selectors-5/
+Editor: Elika J. Etemad / fantasai, Apple, http://fantasai.inkedblade.net/contact, w3cid 35400
+Editor: Tab Atkins Jr., Google, http://xanthir.com/contact/, w3cid 42199
+Abstract: Selectors are patterns that match against elements in a tree, and as such form one of several technologies that can be used to select nodes in a document. Selectors have been optimized for use with HTML and XML, and are designed to be usable in performance-critical code. They are a core component of CSS (Cascading Style Sheets), which uses Selectors to bind style properties to elements in the document.
+Abstract: Selectors Level 5 describes the selectors that already exist in [[!selectors-4]], and further introduces new selectors for CSS and other languages that may need them.
+
+ + +

+Introduction

+ + ISSUE: This is a diff spec against + Selectors Level 4. + +

+Module Interactions

+ + This module extends + the set of selectors defined for CSS in [[selectors-4]]. + +

+Location Pseudo-classes

The local link pseudo-class '':local-link''

The :local-link pseudo-class allows authors to style - hyperlinks based on the users current location within a site and to + [[selectors-4#the-any-link-pseudo|hyperlinks]] + based on the users current location within a site and to differentiate site-internal versus site-external links. The (non-functional) '':local-link'' pseudo-class represents an element that is @@ -115,7 +117,7 @@ The local link pseudo-class '':local-link'' The "origin" of the URL is defined by RFC 6454, Section 4. The username, password, query string, and fragment portions of the URL are not considered - when matching against '':local-link(n)''. + when matching against '':local-link(n)''. If the document's URL does not belong to a hierarchical scheme, the functional pseudo-class matches nothing. @@ -128,13 +130,86 @@ The local link pseudo-class '':local-link'' and the link is same-page? Should "null segments" count as matching, or not? -

Exposing custom state: the '':state()'' pseudo-class

+

+Exposing custom state: the '':state()'' pseudo-class

+ + The :state() pseudo-class takes a case-sensitive argument + and matches custom elements whose exposed custom states include the argument. + + The grammar of the '':state()'' pseudo-class is: + +
:state(  )
+ + The exact matching behavior of '':state()'' pseudo-class + is defined by the host language. + See HTML's definition. + +

+Combinators

+ +

+Reference combinators /ref/

+ + The reference combinator consists of two slashes + with an intervening CSS qualified name, + and separates two compound selectors, + e.g. ''A /attr/ B''. + The element represented by the first compound selector + explicitly references + the element represented by the second compound selector. + Unless the host language defines a different syntax for expressing this relationship, + this relationship is considered to exist if + the value of the specified attribute on the first element is an IDREF or an ID selector + referencing the second element. + + Attribute matching for reference combinators follow the same rules as for attribute selectors. + +
+ The following example highlights an input element + when its <label> + is focused or hovered-over: + +
+		label:is(:hover, :focus) /for/ input,       /* association by "for" attribute */
+		label:is(:hover, :focus):not([for]) input { /* association by containment */
+			box-shadow: yellow 0 0 10px;
+		}
+		
+
+ + +

+Changes

+ +

+Changes Since Level 4

+ + Additions since Level 4: + + + +

+Acknowledgements

+ + The CSS working group would like to thank everyone who contributed + to the previous Selectors specifications over the years, + as those specifications formed the basis for this one. + In particular, the working group would like to extend special thanks + to the following for their specific contributions to Selectors Level 5: + Joey Arhar. + +

Privacy Considerations

+ +

Should be copied from Level 4 when appropriate.

- The :state() pseudo-class takes a case-sensitive argument - and matches custom elements whose exposed custom states include the argument. +

Security Considerations

- The grammar of the '':state()'' pseudo-class is: +

Should be copied from Level 4 when appropriate.

-
:state(  )
- The exact matching behavior of '':state()'' pseudo-class is defined by the host language. See HTML's definition.