From 9bd4e4d974e3e1dcda5a6d0c714398117b60e7c4 Mon Sep 17 00:00:00 2001 From: Victor W Allen Date: Tue, 29 Oct 2024 12:41:04 -0700 Subject: [PATCH 1/5] Adds attr features --- features/attr.yml | 19 +++++++++++++++++++ features/attr.yml.dist | 26 ++++++++++++++++++++++++++ features/contents-attr.yml | 6 ++++++ features/contents-attr.yml.dist | 17 +++++++++++++++++ 4 files changed, 68 insertions(+) create mode 100644 features/attr.yml create mode 100644 features/attr.yml.dist create mode 100644 features/contents-attr.yml create mode 100644 features/contents-attr.yml.dist diff --git a/features/attr.yml b/features/attr.yml new file mode 100644 index 00000000000..548c13a8bc8 --- /dev/null +++ b/features/attr.yml @@ -0,0 +1,19 @@ +name: attr +description: The `attr()` CSS function returns the value of the specified attribute of an element. A default value may be provided if the attribute is missing or does not parse as the required type. +spec: https://drafts.csswg.org/css-values-5/#attr-notation +caniuse: css3-attr +group: css +compat_features: + # The css.types.attr key makes sense here but is already used in `contents-attr` + #- css.types.attr + - css.types.attr.fallback + - css.types.attr.type-or-unit + - css.types.attr.type-or-unit.angle + - css.types.attr.type-or-unit.color + - css.types.attr.type-or-unit.frequency + - css.types.attr.type-or-unit.integer + - css.types.attr.type-or-unit.length + - css.types.attr.type-or-unit.number + - css.types.attr.type-or-unit.percentage + - css.types.attr.type-or-unit.time + - css.types.attr.type-or-unit.url diff --git a/features/attr.yml.dist b/features/attr.yml.dist new file mode 100644 index 00000000000..634f38f5997 --- /dev/null +++ b/features/attr.yml.dist @@ -0,0 +1,26 @@ +# Generated from: attr.yml +# Do not edit this file by hand. Edit the source file instead! + +status: + baseline: false + support: {} +compat_features: + # baseline: false + # support: + # firefox: "119" + # firefox_android: "119" + - css.types.attr.fallback + + # ⬇️ Same status as overall feature ⬇️ + # baseline: false + # support: {} + - css.types.attr.type-or-unit + - css.types.attr.type-or-unit.angle + - css.types.attr.type-or-unit.color + - css.types.attr.type-or-unit.frequency + - css.types.attr.type-or-unit.integer + - css.types.attr.type-or-unit.length + - css.types.attr.type-or-unit.number + - css.types.attr.type-or-unit.percentage + - css.types.attr.type-or-unit.time + - css.types.attr.type-or-unit.url diff --git a/features/contents-attr.yml b/features/contents-attr.yml new file mode 100644 index 00000000000..3e473c31b51 --- /dev/null +++ b/features/contents-attr.yml @@ -0,0 +1,6 @@ +name: "contents: attr()" +description: "The `contents: attr()` CSS declaration sets an element's contents to the value of the specified attribute." +spec: https://drafts.csswg.org/css-values-5/#attr-notation +group: css +compat_features: + - css.types.attr diff --git a/features/contents-attr.yml.dist b/features/contents-attr.yml.dist new file mode 100644 index 00000000000..4db8870f2cb --- /dev/null +++ b/features/contents-attr.yml.dist @@ -0,0 +1,17 @@ +# Generated from: contents-attr.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: "2" + chrome_android: "18" + edge: "12" + firefox: "1" + firefox_android: "4" + safari: "3.1" + safari_ios: "2" +compat_features: + - css.types.attr From 78a1eecde4776a02a893d5db12aa33a8dc2fa7fe Mon Sep 17 00:00:00 2001 From: Victor Allen Date: Thu, 31 Oct 2024 10:26:49 -0700 Subject: [PATCH 2/5] Applies feedback Co-authored-by: Patrick Brosset --- features/attr.yml | 2 +- features/contents-attr.yml | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/features/attr.yml b/features/attr.yml index 548c13a8bc8..8327fc95257 100644 --- a/features/attr.yml +++ b/features/attr.yml @@ -1,5 +1,5 @@ name: attr -description: The `attr()` CSS function returns the value of the specified attribute of an element. A default value may be provided if the attribute is missing or does not parse as the required type. +description: The `attr()` CSS function returns the value of an HTML element's attribute, which can then be used as a typed value in a CSS declaration (types include length, number, angle, color, …). For example `width: attr(length);`. A default value may be provided if the attribute is missing or invalid. spec: https://drafts.csswg.org/css-values-5/#attr-notation caniuse: css3-attr group: css diff --git a/features/contents-attr.yml b/features/contents-attr.yml index 3e473c31b51..1e43e23f1ee 100644 --- a/features/contents-attr.yml +++ b/features/contents-attr.yml @@ -1,5 +1,5 @@ -name: "contents: attr()" -description: "The `contents: attr()` CSS declaration sets an element's contents to the value of the specified attribute." +name: "content: attr()" +description: "The `content: attr()` CSS declaration sets a `::before` or `::after` pseudo-element's content to the value of the specified HTML attribute." spec: https://drafts.csswg.org/css-values-5/#attr-notation group: css compat_features: From 5077927da0cfb08a7c642bb14c9fdc1cc6796cce Mon Sep 17 00:00:00 2001 From: Victor W Allen Date: Thu, 31 Oct 2024 10:36:05 -0700 Subject: [PATCH 3/5] Fixes YAML parsing error --- features/attr.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/features/attr.yml b/features/attr.yml index 8327fc95257..ada92f71d79 100644 --- a/features/attr.yml +++ b/features/attr.yml @@ -1,5 +1,5 @@ name: attr -description: The `attr()` CSS function returns the value of an HTML element's attribute, which can then be used as a typed value in a CSS declaration (types include length, number, angle, color, …). For example `width: attr(length);`. A default value may be provided if the attribute is missing or invalid. +description: "The `attr()` CSS function returns the value of an HTML element's attribute, which can then be used as a typed value in a CSS declaration (types include length, number, angle, color, etc.). For example `width: attr(length);`. A default value may be provided if the attribute is missing or invalid." spec: https://drafts.csswg.org/css-values-5/#attr-notation caniuse: css3-attr group: css From 559729ebd4d766f824033621f48129f1aa419e58 Mon Sep 17 00:00:00 2001 From: Victor Allen Date: Tue, 5 Nov 2024 07:08:12 -0800 Subject: [PATCH 4/5] Apply suggestions from code review Co-authored-by: Daniel D. Beck --- features/attr.yml | 4 ++-- features/contents-attr.yml | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/features/attr.yml b/features/attr.yml index ada92f71d79..59f2a53d38b 100644 --- a/features/attr.yml +++ b/features/attr.yml @@ -1,5 +1,5 @@ -name: attr -description: "The `attr()` CSS function returns the value of an HTML element's attribute, which can then be used as a typed value in a CSS declaration (types include length, number, angle, color, etc.). For example `width: attr(length);`. A default value may be provided if the attribute is missing or invalid." +name: attr() +description: "The `attr()` CSS function, in the context of any property, returns the value of an attribute of an HTML element, with the option to return it as a specific type or unit. You can set a default value for missing or invalid attributes." spec: https://drafts.csswg.org/css-values-5/#attr-notation caniuse: css3-attr group: css diff --git a/features/contents-attr.yml b/features/contents-attr.yml index 1e43e23f1ee..e4ca0799133 100644 --- a/features/contents-attr.yml +++ b/features/contents-attr.yml @@ -1,5 +1,5 @@ -name: "content: attr()" -description: "The `content: attr()` CSS declaration sets a `::before` or `::after` pseudo-element's content to the value of the specified HTML attribute." +name: attr() (content only) +description: "The `attr()` CSS function, in `content` property declarations, sets a `::before` or `::after` pseudo-element's content to the value of the specified HTML attribute." spec: https://drafts.csswg.org/css-values-5/#attr-notation group: css compat_features: From 6dd1af7a92b552aa713fff862c346dc6c8c25fe4 Mon Sep 17 00:00:00 2001 From: Victor W Allen Date: Tue, 5 Nov 2024 07:12:07 -0800 Subject: [PATCH 5/5] Renames attr-contents --- features/{contents-attr.yml => attr-contents.yml} | 0 features/{contents-attr.yml.dist => attr-contents.yml.dist} | 2 +- 2 files changed, 1 insertion(+), 1 deletion(-) rename features/{contents-attr.yml => attr-contents.yml} (100%) rename features/{contents-attr.yml.dist => attr-contents.yml.dist} (90%) diff --git a/features/contents-attr.yml b/features/attr-contents.yml similarity index 100% rename from features/contents-attr.yml rename to features/attr-contents.yml diff --git a/features/contents-attr.yml.dist b/features/attr-contents.yml.dist similarity index 90% rename from features/contents-attr.yml.dist rename to features/attr-contents.yml.dist index 4db8870f2cb..320b7f4b781 100644 --- a/features/contents-attr.yml.dist +++ b/features/attr-contents.yml.dist @@ -1,4 +1,4 @@ -# Generated from: contents-attr.yml +# Generated from: attr-contents.yml # Do not edit this file by hand. Edit the source file instead! status: