From 9416bbc62e70ff73c27d36fc34648653d8ec79d7 Mon Sep 17 00:00:00 2001
From: Guillaume
Date: Thu, 2 Nov 2023 09:04:43 +0100
Subject: [PATCH 1/4] [selectors-4] Replace with
---
selectors-4/Overview.bs | 40 +++++++++++++++-------------------------
1 file changed, 15 insertions(+), 25 deletions(-)
diff --git a/selectors-4/Overview.bs b/selectors-4/Overview.bs
index 56be50e259d..c443cccb03f 100644
--- a/selectors-4/Overview.bs
+++ b/selectors-4/Overview.bs
@@ -2949,18 +2949,16 @@ Child-indexed Pseudo-classes
'':nth-child()'' pseudo-class
- The :nth-child(An+B [of S]? )
+ The :nth-child(<> [of <>]?)
pseudo-class notation represents elements that
are among An+Bth elements
from the list composed of
- their inclusive siblings that match the selector list S,
+ their inclusive siblings that match the selector list,
which is a <>.
- If S is omitted,
+ If the selector list is omitted,
it defaults to ''*|*''.
- The An+B notation and its interpretation
- are defined in [[css-syntax-3#anb-microsyntax]];
- it represents any index i = An + B
+ The <> production represents any index i = An + B
for any non-negative integer n.
Note: For these purposes, the list of elements is 1-indexed;
@@ -2983,11 +2981,11 @@ Child-indexed Pseudo-classes
Note: The specificity of the '':nth-child()'' pseudo-class is
the specificity of a single pseudo-class plus,
- if S is specified,
+ if the selector list S is specified,
the specificity of the most specific complex selector in S.
See [[#specificity-rules]].
- Thus ''S:nth-child(An+B)''
- and '':nth-child(An+B of S)''
+ Thus ''S:nth-child(<>)''
+ and '':nth-child(<> of S)''
have the exact same specificity,
although they do differ in behavior
(see example below).
@@ -3045,14 +3043,14 @@ Child-indexed Pseudo-classes
'':nth-last-child()'' pseudo-class
- The :nth-last-child(An+B [of S]? )
+ The :nth-last-child(<> [of <>]?)
pseudo-class notation represents elements that
are among An+Bth elements
from the list composed of
- their inclusive siblings that match the selector list S,
+ their inclusive siblings that match the selector list,
+ which is a <>,
counting backwards from the end.
- S is <>.
- If S is omitted,
+ If the selector list is omitted,
it defaults to ''*|*''.
Note: The specificity of the '':nth-last-child()'' pseudo-class,
@@ -3061,8 +3059,6 @@ Child-indexed Pseudo-classes
with that of its selector argument S.
See [[#specificity-rules]].
- The CSS Syntax Module [[!CSS3SYN]] defines the An+B notation.
-
Examples:
@@ -3150,7 +3146,7 @@ Typed Child-indexed Pseudo-classes
'':nth-of-type()'' pseudo-class
- The
:nth-of-type(An+B) pseudo-class notation
+ The
:nth-of-type(<>) pseudo-class notation
represents the same elements that would be matched by '':nth-child(|An+B| of |S|)'',
where |S| is a [=type selector=] and namespace prefix matching the element in question.
For example,
@@ -3177,7 +3173,7 @@ Typed Child-indexed Pseudo-classes
'':nth-last-of-type()'' pseudo-class
- The
:nth-last-of-type(An+B) pseudo-class notation
+ The
:nth-last-of-type(<>) pseudo-class notation
represents the same elements that would be matched by '':nth-last-child(|An+B| of |S|)'',
where |S| is a [=type selector=] and namespace prefix matching the element in question.
For example,
@@ -3438,7 +3434,7 @@ Column combinator (
||)
'':nth-col()'' pseudo-class
- The
:nth-col(An+B)
+ The
:nth-col(<>)
pseudo-class notation represents a cell element belonging to a column
that has
An+B-1 columns
before it, for any positive
@@ -3448,14 +3444,10 @@ Column combinator (
||)
more than one column, it is represented by a selector indicating any of
those columns.
- The CSS Syntax Module [[!CSS3SYN]] defines the
An+B notation.
-
-
-
'':nth-last-col()'' pseudo-class
- The
:nth-last-col(An+B)
+ The
:nth-last-col(<>)
pseudo-class notation represents a cell element belonging to a column
that has
An+B-1 columns
after it, for any positive
@@ -3465,8 +3457,6 @@ Column combinator (
||)
more than one column, it is represented by a selector indicating any of
those columns.
- The CSS Syntax Module [[!CSS3SYN]] defines the
An+B notation.
-
Calculating a selector's specificity
From 5519f395e2690e15ee4caf006fc9c865c6e428c4 Mon Sep 17 00:00:00 2001
From: Guillaume
Date: Tue, 21 Nov 2023 12:15:09 +0100
Subject: [PATCH 2/4] Apply suggestions from code review
Co-authored-by: fantasai
---
selectors-4/Overview.bs | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/selectors-4/Overview.bs b/selectors-4/Overview.bs
index c443cccb03f..f942ab99da3 100644
--- a/selectors-4/Overview.bs
+++ b/selectors-4/Overview.bs
@@ -2953,8 +2953,7 @@ Child-indexed Pseudo-classes
pseudo-class notation represents elements that
are among An+Bth elements
from the list composed of
- their inclusive siblings that match the selector list,
- which is a <>.
+ their inclusive siblings that match the selector list <>.
If the selector list is omitted,
it defaults to ''*|*''.
@@ -3047,8 +3046,7 @@ Child-indexed Pseudo-classes
pseudo-class notation represents elements that
are among An+Bth elements
from the list composed of
- their inclusive siblings that match the selector list,
- which is a <>,
+ their inclusive siblings that match the selector list <>,
counting backwards from the end.
If the selector list is omitted,
it defaults to ''*|*''.
From 06c3f97c5fe7430c0a37cbe97c321483adf5a307 Mon Sep 17 00:00:00 2001
From: Guillaume
Date: Tue, 21 Nov 2023 12:19:26 +0100
Subject: [PATCH 3/4] [selectors-4] Restore references of An+B to CSS Syntax
---
selectors-4/Overview.bs | 10 +++++++++-
1 file changed, 9 insertions(+), 1 deletion(-)
diff --git a/selectors-4/Overview.bs b/selectors-4/Overview.bs
index f942ab99da3..41e6cd88d33 100644
--- a/selectors-4/Overview.bs
+++ b/selectors-4/Overview.bs
@@ -2957,7 +2957,9 @@ Child-indexed Pseudo-classes
If the selector list is omitted,
it defaults to ''*|*''.
- The <> production represents any index i = An + B
+ The An+B notation and its interpretation
+ are defined in [[css-syntax-3#anb-microsyntax]];
+ it represents any index i = An + B
for any non-negative integer n.
Note: For these purposes, the list of elements is 1-indexed;
@@ -3057,6 +3059,8 @@ Child-indexed Pseudo-classes
with that of its selector argument S.
See [[#specificity-rules]].
+ The CSS Syntax Module [[!CSS3SYN]] defines the An+B notation.
+
Examples:
@@ -3442,6 +3446,8 @@ Column combinator (
||)
more than one column, it is represented by a selector indicating any of
those columns.
+ The CSS Syntax Module [[!CSS3SYN]] defines the
An+B notation.
+
'':nth-last-col()'' pseudo-class
@@ -3455,6 +3461,8 @@ Column combinator (
||)
more than one column, it is represented by a selector indicating any of
those columns.
+ The CSS Syntax Module [[!CSS3SYN]] defines the
An+B notation.
+
Calculating a selector's specificity
From 1eb9005ff4e93023e06c1e91a721e947d436664a Mon Sep 17 00:00:00 2001
From: Guillaume
Date: Tue, 21 Nov 2023 12:20:55 +0100
Subject: [PATCH 4/4] [selectors-4] Wrap references of An+B to CSS Syntax in
notes
---
selectors-4/Overview.bs | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/selectors-4/Overview.bs b/selectors-4/Overview.bs
index 41e6cd88d33..aaca136d33f 100644
--- a/selectors-4/Overview.bs
+++ b/selectors-4/Overview.bs
@@ -2957,7 +2957,7 @@ Child-indexed Pseudo-classes
If the selector list is omitted,
it defaults to ''*|*''.
- The An+B notation and its interpretation
+ Note: The An+B notation and its interpretation
are defined in [[css-syntax-3#anb-microsyntax]];
it represents any index i = An + B
for any non-negative integer n.
@@ -3059,7 +3059,7 @@ Child-indexed Pseudo-classes
with that of its selector argument S.
See [[#specificity-rules]].
- The CSS Syntax Module [[!CSS3SYN]] defines the An+B notation.
+ Note: The CSS Syntax Module [[!CSS3SYN]] defines the An+B notation.
Examples:
@@ -3446,7 +3446,7 @@ Column combinator (
||)
more than one column, it is represented by a selector indicating any of
those columns.
- The CSS Syntax Module [[!CSS3SYN]] defines the
An+B notation.
+ Note: The CSS Syntax Module [[!CSS3SYN]] defines the
An+B notation.
'':nth-last-col()'' pseudo-class
@@ -3461,7 +3461,7 @@ Column combinator (
||)
more than one column, it is represented by a selector indicating any of
those columns.
- The CSS Syntax Module [[!CSS3SYN]] defines the
An+B notation.
+ Note: The CSS Syntax Module [[!CSS3SYN]] defines the
An+B notation.
Calculating a selector's specificity