From e77771300cb2a1cad4eb0ac8ff7b09af06eba65a Mon Sep 17 00:00:00 2001 From: James Stuckey Weber Date: Mon, 4 Nov 2024 10:34:32 -0500 Subject: [PATCH 1/8] Add nth-of-type and expand nth-child --- features/nth-child.yml | 14 +++++++++ features/nth-child.yml.dist | 56 +++++++++++++++++++++++++++++++++-- features/nth-of-type.yml | 10 +++++++ features/nth-of-type.yml.dist | 45 ++++++++++++++++++++++++++++ 4 files changed, 123 insertions(+), 2 deletions(-) create mode 100644 features/nth-of-type.yml create mode 100644 features/nth-of-type.yml.dist diff --git a/features/nth-child.yml b/features/nth-child.yml index db2c57da4ad..f414dc35409 100644 --- a/features/nth-child.yml +++ b/features/nth-child.yml @@ -1,6 +1,20 @@ name: ":nth-child() (initial support)" +# TODO: Update to include all pseudo-classes description: "The `:nth-child()` and `:nth-last-child()` CSS functional pseudo-classes match elements by the relative position of elements (first, second, third, fourth, and so on), counted from the first or last sibling." spec: - https://drafts.csswg.org/selectors-3/#nth-child-pseudo - https://drafts.csswg.org/selectors-3/#nth-last-child-pseudo group: selectors +status: + compute_from: css.selectors.nth-child +compat_features: + - css.selectors.first-child + - css.selectors.first-child.no_parent_required + - css.selectors.last-child + - css.selectors.last-child.no_parent_required + - css.selectors.nth-child + - css.selectors.nth-child.no_parent_required + - css.selectors.nth-last-child + - css.selectors.nth-last-child.no_parent_required + - css.selectors.only-child + - css.selectors.only-child.no_parent_required diff --git a/features/nth-child.yml.dist b/features/nth-child.yml.dist index cb5796d7350..bc5c5b81826 100644 --- a/features/nth-child.yml.dist +++ b/features/nth-child.yml.dist @@ -6,7 +6,7 @@ status: baseline_low_date: 2015-07-29 baseline_high_date: 2018-01-29 support: - chrome: "4" + chrome: "1" chrome_android: "18" edge: "12" firefox: "3.5" @@ -14,6 +14,20 @@ status: safari: "3.1" safari_ios: "2" compat_features: + # baseline: high + # baseline_low_date: 2015-07-29 + # baseline_high_date: 2018-01-29 + # support: + # chrome: "1" + # chrome_android: "18" + # edge: "12" + # firefox: "1" + # firefox_android: "4" + # safari: "3.1" + # safari_ios: "2" + - css.selectors.last-child + + # ⬇️ Same status as overall feature ⬇️ # baseline: high # baseline_low_date: 2015-07-29 # baseline_high_date: 2018-01-29 @@ -27,7 +41,32 @@ compat_features: # safari_ios: "2" - css.selectors.nth-child - # ⬇️ Same status as overall feature ⬇️ + # baseline: high + # baseline_low_date: 2015-07-29 + # baseline_high_date: 2018-01-29 + # support: + # chrome: "2" + # chrome_android: "18" + # edge: "12" + # firefox: "1.5" + # firefox_android: "4" + # safari: "3.1" + # safari_ios: "2" + - css.selectors.only-child + + # baseline: high + # baseline_low_date: 2015-07-29 + # baseline_high_date: 2018-01-29 + # support: + # chrome: "4" + # chrome_android: "18" + # edge: "12" + # firefox: "3" + # firefox_android: "4" + # safari: "3.1" + # safari_ios: "4" + - css.selectors.first-child + # baseline: high # baseline_low_date: 2015-07-29 # baseline_high_date: 2018-01-29 @@ -40,3 +79,16 @@ compat_features: # safari: "3.1" # safari_ios: "2" - css.selectors.nth-last-child + + # baseline: false + # support: + # chrome: "57" + # chrome_android: "57" + # edge: "79" + # firefox: "52" + # firefox_android: "52" + - css.selectors.first-child.no_parent_required + - css.selectors.last-child.no_parent_required + - css.selectors.nth-child.no_parent_required + - css.selectors.nth-last-child.no_parent_required + - css.selectors.only-child.no_parent_required diff --git a/features/nth-of-type.yml b/features/nth-of-type.yml new file mode 100644 index 00000000000..64a62e0e82b --- /dev/null +++ b/features/nth-of-type.yml @@ -0,0 +1,10 @@ +name: "" +description: "" +spec: https://drafts.csswg.org/selectors-4/#typed-child-index +caniuse: "" +compat_features: + - css.selectors.nth-last-of-type + - css.selectors.first-of-type + - css.selectors.last-of-type + - css.selectors.nth-of-type + - css.selectors.only-of-type diff --git a/features/nth-of-type.yml.dist b/features/nth-of-type.yml.dist new file mode 100644 index 00000000000..bf0d8e64b9f --- /dev/null +++ b/features/nth-of-type.yml.dist @@ -0,0 +1,45 @@ +# Generated from: nth-of-type.yml +# Do not edit this file by hand. Edit the source file instead! + +status: + baseline: high + baseline_low_date: 2015-07-29 + baseline_high_date: 2018-01-29 + support: + chrome: "4" + chrome_android: "18" + edge: "12" + firefox: "3.5" + firefox_android: "4" + safari: "3.1" + safari_ios: "2" +compat_features: + # baseline: high + # baseline_low_date: 2015-07-29 + # baseline_high_date: 2018-01-29 + # support: + # chrome: "1" + # chrome_android: "18" + # edge: "12" + # firefox: "3.5" + # firefox_android: "4" + # safari: "3.1" + # safari_ios: "2" + - css.selectors.first-of-type + - css.selectors.last-of-type + - css.selectors.nth-of-type + - css.selectors.only-of-type + + # ⬇️ Same status as overall feature ⬇️ + # baseline: high + # baseline_low_date: 2015-07-29 + # baseline_high_date: 2018-01-29 + # support: + # chrome: "4" + # chrome_android: "18" + # edge: "12" + # firefox: "3.5" + # firefox_android: "4" + # safari: "3.1" + # safari_ios: "2" + - css.selectors.nth-last-of-type From d111dddaf80dbdd2590f5437ce766a5ac0360577 Mon Sep 17 00:00:00 2001 From: SondraE Date: Mon, 4 Nov 2024 16:21:23 -0700 Subject: [PATCH 2/8] add group and descriptions --- features/nth-child.yml | 2 +- features/nth-of-type.yml | 7 ++++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/features/nth-child.yml b/features/nth-child.yml index f414dc35409..272ebe84e87 100644 --- a/features/nth-child.yml +++ b/features/nth-child.yml @@ -1,6 +1,6 @@ name: ":nth-child() (initial support)" # TODO: Update to include all pseudo-classes -description: "The `:nth-child()` and `:nth-last-child()` CSS functional pseudo-classes match elements by the relative position of elements (first, second, third, fourth, and so on), counted from the first or last sibling." +description: "The `:nth-child()` and `:nth-last-child()` CSS functional pseudo-classes match elements by the relative position of elements (first, second, third, fourth, and so on), counted from the first or last sibling. The `:first-child` and `:last-child` pseudo-classes represent elements that are the first or last in a list of siblings. The `:only-child` pseudo-class represents an element that has no siblings." spec: - https://drafts.csswg.org/selectors-3/#nth-child-pseudo - https://drafts.csswg.org/selectors-3/#nth-last-child-pseudo diff --git a/features/nth-of-type.yml b/features/nth-of-type.yml index 64a62e0e82b..41885d4384d 100644 --- a/features/nth-of-type.yml +++ b/features/nth-of-type.yml @@ -1,7 +1,8 @@ -name: "" -description: "" +name: ":nth-of-type() pseudo-classes" +description: "The `:nth-of-type()` CSS functional pseudo-classes match elements based on their position among siblings of the same type (first, second, third, fourth, and so on), counted from the first or last sibling. The `:only-of-type` pseudo-class matches any element that is the only child of its type, of its parent." spec: https://drafts.csswg.org/selectors-4/#typed-child-index -caniuse: "" +caniuse: css-sel3 +group: selectors compat_features: - css.selectors.nth-last-of-type - css.selectors.first-of-type From 5160fd79de1e09d5c5ce15c5b7dfc7909bf52f23 Mon Sep 17 00:00:00 2001 From: SondraE Date: Tue, 5 Nov 2024 13:52:33 -0700 Subject: [PATCH 3/8] remove caniuse --- features/nth-of-type.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/features/nth-of-type.yml b/features/nth-of-type.yml index 41885d4384d..a17800d677e 100644 --- a/features/nth-of-type.yml +++ b/features/nth-of-type.yml @@ -1,7 +1,6 @@ name: ":nth-of-type() pseudo-classes" description: "The `:nth-of-type()` CSS functional pseudo-classes match elements based on their position among siblings of the same type (first, second, third, fourth, and so on), counted from the first or last sibling. The `:only-of-type` pseudo-class matches any element that is the only child of its type, of its parent." spec: https://drafts.csswg.org/selectors-4/#typed-child-index -caniuse: css-sel3 group: selectors compat_features: - css.selectors.nth-last-of-type From b1f1fbd5750c282b3c1ef417d546139d10029ecc Mon Sep 17 00:00:00 2001 From: James Stuckey Weber Date: Wed, 6 Nov 2024 16:57:38 -0500 Subject: [PATCH 4/8] Shorten descriptions --- features/nth-child.yml | 3 +-- features/nth-of-type.yml | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/features/nth-child.yml b/features/nth-child.yml index 272ebe84e87..ce36552f576 100644 --- a/features/nth-child.yml +++ b/features/nth-child.yml @@ -1,6 +1,5 @@ name: ":nth-child() (initial support)" -# TODO: Update to include all pseudo-classes -description: "The `:nth-child()` and `:nth-last-child()` CSS functional pseudo-classes match elements by the relative position of elements (first, second, third, fourth, and so on), counted from the first or last sibling. The `:first-child` and `:last-child` pseudo-classes represent elements that are the first or last in a list of siblings. The `:only-child` pseudo-class represents an element that has no siblings." +description: "The `:nth-child()` and `:nth-last-child()` CSS functional pseudo-classes match elements by their relative position, counted from the first or last sibling. The `:first-child`, `:last-child`, and `:only-child` pseudo-classes represent common use cases." spec: - https://drafts.csswg.org/selectors-3/#nth-child-pseudo - https://drafts.csswg.org/selectors-3/#nth-last-child-pseudo diff --git a/features/nth-of-type.yml b/features/nth-of-type.yml index a17800d677e..18379900b62 100644 --- a/features/nth-of-type.yml +++ b/features/nth-of-type.yml @@ -1,5 +1,5 @@ name: ":nth-of-type() pseudo-classes" -description: "The `:nth-of-type()` CSS functional pseudo-classes match elements based on their position among siblings of the same type (first, second, third, fourth, and so on), counted from the first or last sibling. The `:only-of-type` pseudo-class matches any element that is the only child of its type, of its parent." +description: "The `:nth-of-type()` CSS functional pseudo-classes match elements based on their position among siblings of the same type, counted from the first or last sibling. The `:only-of-type` pseudo-class matches any element that is the only child of its type, of its parent." spec: https://drafts.csswg.org/selectors-4/#typed-child-index group: selectors compat_features: From aea9d3b6f87b613e5cb65898540f39e727729e41 Mon Sep 17 00:00:00 2001 From: James Stuckey Weber Date: Wed, 13 Nov 2024 12:49:13 -0500 Subject: [PATCH 5/8] Update descriptions, but too long --- features/nth-child.yml | 2 +- features/nth-of-type.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/features/nth-child.yml b/features/nth-child.yml index ce36552f576..fbc3dc8d485 100644 --- a/features/nth-child.yml +++ b/features/nth-child.yml @@ -1,5 +1,5 @@ name: ":nth-child() (initial support)" -description: "The `:nth-child()` and `:nth-last-child()` CSS functional pseudo-classes match elements by their relative position, counted from the first or last sibling. The `:first-child`, `:last-child`, and `:only-child` pseudo-classes represent common use cases." +description: "The `:nth-child()` and `:nth-last-child()` CSS functional pseudo-classes match elements based on their relative position within a list of elements, counted from the first or last sibling. The `:first-child` and `:last-child` pseudo-classes match the first and last element in a list, and the `:only-child` pseudo-class matches an element with no siblings." spec: - https://drafts.csswg.org/selectors-3/#nth-child-pseudo - https://drafts.csswg.org/selectors-3/#nth-last-child-pseudo diff --git a/features/nth-of-type.yml b/features/nth-of-type.yml index 18379900b62..535ce17a179 100644 --- a/features/nth-of-type.yml +++ b/features/nth-of-type.yml @@ -1,5 +1,5 @@ name: ":nth-of-type() pseudo-classes" -description: "The `:nth-of-type()` CSS functional pseudo-classes match elements based on their position among siblings of the same type, counted from the first or last sibling. The `:only-of-type` pseudo-class matches any element that is the only child of its type, of its parent." +description: "The `:nth-of-type()` and `:nth-last-of-type()` CSS functional pseudo-classes match elements based on their position among siblings of the same type, counted from the first or last sibling. The `:first-of-type` and `:last-of-type` pseudo-classes match the first and last elements of its type, and the `:only-of-type` pseudo-class matches any element that has no siblings of the same type." spec: https://drafts.csswg.org/selectors-4/#typed-child-index group: selectors compat_features: From a15f874e2f51233c18948356489a5344b10d0426 Mon Sep 17 00:00:00 2001 From: James Stuckey Weber Date: Wed, 13 Nov 2024 12:55:27 -0500 Subject: [PATCH 6/8] Shorten descriptions --- features/nth-child.yml | 2 +- features/nth-of-type.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/features/nth-child.yml b/features/nth-child.yml index fbc3dc8d485..63713ae2380 100644 --- a/features/nth-child.yml +++ b/features/nth-child.yml @@ -1,5 +1,5 @@ name: ":nth-child() (initial support)" -description: "The `:nth-child()` and `:nth-last-child()` CSS functional pseudo-classes match elements based on their relative position within a list of elements, counted from the first or last sibling. The `:first-child` and `:last-child` pseudo-classes match the first and last element in a list, and the `:only-child` pseudo-class matches an element with no siblings." +description: "The `:nth-child()` and `:nth-last-child()` CSS functional pseudo-classes match elements based on their index within a list of elements. The `:first-child` and `:last-child` pseudo-classes match the first and last element in a list, and the `:only-child` pseudo-class matches an element with no siblings." spec: - https://drafts.csswg.org/selectors-3/#nth-child-pseudo - https://drafts.csswg.org/selectors-3/#nth-last-child-pseudo diff --git a/features/nth-of-type.yml b/features/nth-of-type.yml index 535ce17a179..738f86f9007 100644 --- a/features/nth-of-type.yml +++ b/features/nth-of-type.yml @@ -1,5 +1,5 @@ name: ":nth-of-type() pseudo-classes" -description: "The `:nth-of-type()` and `:nth-last-of-type()` CSS functional pseudo-classes match elements based on their position among siblings of the same type, counted from the first or last sibling. The `:first-of-type` and `:last-of-type` pseudo-classes match the first and last elements of its type, and the `:only-of-type` pseudo-class matches any element that has no siblings of the same type." +description: "The `:nth-of-type()` and `:nth-last-of-type()` CSS functional pseudo-classes match elements based on their position among siblings of the same type. The `:first-of-type`, `:last-of-type`, and :only-of-type` pseudo-classes match the first, last, and only elements of its type." spec: https://drafts.csswg.org/selectors-4/#typed-child-index group: selectors compat_features: From d49576fae0a9d914853216e08dad0a0974352def Mon Sep 17 00:00:00 2001 From: James Stuckey Weber Date: Thu, 14 Nov 2024 08:42:14 -0500 Subject: [PATCH 7/8] Remove (initial support) Co-authored-by: Patrick Brosset --- features/nth-child.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/features/nth-child.yml b/features/nth-child.yml index 63713ae2380..30725760fba 100644 --- a/features/nth-child.yml +++ b/features/nth-child.yml @@ -1,4 +1,4 @@ -name: ":nth-child() (initial support)" +name: ":nth-child() description: "The `:nth-child()` and `:nth-last-child()` CSS functional pseudo-classes match elements based on their index within a list of elements. The `:first-child` and `:last-child` pseudo-classes match the first and last element in a list, and the `:only-child` pseudo-class matches an element with no siblings." spec: - https://drafts.csswg.org/selectors-3/#nth-child-pseudo From 3671bc263df864c036dbae7e5e69a2c72fc1d6c1 Mon Sep 17 00:00:00 2001 From: James Stuckey Weber Date: Thu, 14 Nov 2024 08:43:50 -0500 Subject: [PATCH 8/8] Fix missing quote --- features/nth-child.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/features/nth-child.yml b/features/nth-child.yml index 30725760fba..679ced2641e 100644 --- a/features/nth-child.yml +++ b/features/nth-child.yml @@ -1,4 +1,4 @@ -name: ":nth-child() +name: ":nth-child()" description: "The `:nth-child()` and `:nth-last-child()` CSS functional pseudo-classes match elements based on their index within a list of elements. The `:first-child` and `:last-child` pseudo-classes match the first and last element in a list, and the `:only-child` pseudo-class matches an element with no siblings." spec: - https://drafts.csswg.org/selectors-3/#nth-child-pseudo