-
Notifications
You must be signed in to change notification settings - Fork 673
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[css-values-3] Restrict none/auto/normal from <custom-ident> #7431
Comments
I gathered some compatibility data on this using Cluster Telemetry, specifically with trace counters using this patch. I also included I ran through a pageset of 10K pages (generally the homepages of sites, and cached rather than live pages) with the custom ident parsing function in Chromium's CSS parser instrumented. This detected the following pages as being affected by changes to the set of allowed values in
I have not attempted to look at any of the pages. (I could also do a re-run against live pages if it turns out the cached ones are meaningfully out-of-date.) |
Per recent CSSWG resolution [1], the initial value is now 'normal'. The function StyleBuilderConverter::ConvertFlags had hard-coded handling of CSSValueID::kNone which interpreted that to mean "flags=0". Since we now also need kNormal to mean "flags=0", this CL adds a template parameter to indicate which CSSValueID we should treat as zero. This CL also disallows the following values from the <custom-ident> of the container-name property: - normal, which was clearly intended from reading the discussion in [1]. - auto, which is not explicitly mentioned in [1] as something to disallow, but it's aligned with the ambition to disallow none/normal/auto from <custom-ident> in general [2]. [1] w3c/csswg-drafts#7402 [2] w3c/csswg-drafts#7431 Fixed: 1340859 Change-Id: I841303e2b5673c65d69d97522a0a3661e5d1ec24
Per recent CSSWG resolution [1], the initial value is now 'normal'. The function StyleBuilderConverter::ConvertFlags had hard-coded handling of CSSValueID::kNone which interpreted that to mean "flags=0". Since we now also need kNormal to mean "flags=0", this CL adds a template parameter to indicate which CSSValueID we should treat as zero. This CL also disallows the following values from the <custom-ident> of the container-name property: - normal, which was clearly intended from reading the discussion in [1]. - auto, which is not explicitly mentioned in [1] as something to disallow, but it's aligned with the ambition to disallow none/normal/auto from <custom-ident> in general [2]. [1] w3c/csswg-drafts#7402 [2] w3c/csswg-drafts#7431 Fixed: 1340859 Change-Id: I841303e2b5673c65d69d97522a0a3661e5d1ec24
Per recent CSSWG resolution [1], the initial value is now 'normal'. The function StyleBuilderConverter::ConvertFlags had hard-coded handling of CSSValueID::kNone which interpreted that to mean "flags=0". Since we now also need kNormal to mean "flags=0", this CL adds a template parameter to indicate which CSSValueID we should treat as zero. This CL also disallows the following values from the <custom-ident> of the container-name property: - normal, which was clearly intended from reading the discussion in [1]. - auto, which is not explicitly mentioned in [1] as something to disallow, but it's aligned with the ambition to disallow none/normal/auto from <custom-ident> in general [2]. [1] w3c/csswg-drafts#7402 [2] w3c/csswg-drafts#7431 Fixed: 1340859 Change-Id: I841303e2b5673c65d69d97522a0a3661e5d1ec24 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3736384 Commit-Queue: Anders Hartvoll Ruud <andruud@chromium.org> Reviewed-by: Morten Stenshorne <mstensho@chromium.org> Cr-Commit-Position: refs/heads/main@{#1019597}
Per recent CSSWG resolution [1], the initial value is now 'normal'. The function StyleBuilderConverter::ConvertFlags had hard-coded handling of CSSValueID::kNone which interpreted that to mean "flags=0". Since we now also need kNormal to mean "flags=0", this CL adds a template parameter to indicate which CSSValueID we should treat as zero. This CL also disallows the following values from the <custom-ident> of the container-name property: - normal, which was clearly intended from reading the discussion in [1]. - auto, which is not explicitly mentioned in [1] as something to disallow, but it's aligned with the ambition to disallow none/normal/auto from <custom-ident> in general [2]. [1] w3c/csswg-drafts#7402 [2] w3c/csswg-drafts#7431 Fixed: 1340859 Change-Id: I841303e2b5673c65d69d97522a0a3661e5d1ec24 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3736384 Commit-Queue: Anders Hartvoll Ruud <andruud@chromium.org> Reviewed-by: Morten Stenshorne <mstensho@chromium.org> Cr-Commit-Position: refs/heads/main@{#1019597}
Per recent CSSWG resolution [1], the initial value is now 'normal'. The function StyleBuilderConverter::ConvertFlags had hard-coded handling of CSSValueID::kNone which interpreted that to mean "flags=0". Since we now also need kNormal to mean "flags=0", this CL adds a template parameter to indicate which CSSValueID we should treat as zero. This CL also disallows the following values from the <custom-ident> of the container-name property: - normal, which was clearly intended from reading the discussion in [1]. - auto, which is not explicitly mentioned in [1] as something to disallow, but it's aligned with the ambition to disallow none/normal/auto from <custom-ident> in general [2]. [1] w3c/csswg-drafts#7402 [2] w3c/csswg-drafts#7431 Fixed: 1340859 Change-Id: I841303e2b5673c65d69d97522a0a3661e5d1ec24 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3736384 Commit-Queue: Anders Hartvoll Ruud <andruud@chromium.org> Reviewed-by: Morten Stenshorne <mstensho@chromium.org> Cr-Commit-Position: refs/heads/main@{#1019597}
…tainer-type to 'normal', a=testonly Automatic update from web-platform-tests [@container] Change initial value of container-type to 'normal' Per recent CSSWG resolution [1], the initial value is now 'normal'. The function StyleBuilderConverter::ConvertFlags had hard-coded handling of CSSValueID::kNone which interpreted that to mean "flags=0". Since we now also need kNormal to mean "flags=0", this CL adds a template parameter to indicate which CSSValueID we should treat as zero. This CL also disallows the following values from the <custom-ident> of the container-name property: - normal, which was clearly intended from reading the discussion in [1]. - auto, which is not explicitly mentioned in [1] as something to disallow, but it's aligned with the ambition to disallow none/normal/auto from <custom-ident> in general [2]. [1] w3c/csswg-drafts#7402 [2] w3c/csswg-drafts#7431 Fixed: 1340859 Change-Id: I841303e2b5673c65d69d97522a0a3661e5d1ec24 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3736384 Commit-Queue: Anders Hartvoll Ruud <andruud@chromium.org> Reviewed-by: Morten Stenshorne <mstensho@chromium.org> Cr-Commit-Position: refs/heads/main@{#1019597} -- wpt-commits: 470bdbafc3fd827c20172ca192cabfe79f9e92aa wpt-pr: 34658
…tainer-type to 'normal', a=testonly Automatic update from web-platform-tests [@container] Change initial value of container-type to 'normal' Per recent CSSWG resolution [1], the initial value is now 'normal'. The function StyleBuilderConverter::ConvertFlags had hard-coded handling of CSSValueID::kNone which interpreted that to mean "flags=0". Since we now also need kNormal to mean "flags=0", this CL adds a template parameter to indicate which CSSValueID we should treat as zero. This CL also disallows the following values from the <custom-ident> of the container-name property: - normal, which was clearly intended from reading the discussion in [1]. - auto, which is not explicitly mentioned in [1] as something to disallow, but it's aligned with the ambition to disallow none/normal/auto from <custom-ident> in general [2]. [1] w3c/csswg-drafts#7402 [2] w3c/csswg-drafts#7431 Fixed: 1340859 Change-Id: I841303e2b5673c65d69d97522a0a3661e5d1ec24 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3736384 Commit-Queue: Anders Hartvoll Ruud <andruud@chromium.org> Reviewed-by: Morten Stenshorne <mstensho@chromium.org> Cr-Commit-Position: refs/heads/main@{#1019597} -- wpt-commits: 470bdbafc3fd827c20172ca192cabfe79f9e92aa wpt-pr: 34658
Some further details on the compatibility data above, gathered by running Chrome locally with this patch. These four are all grid lines named
For the final
This
These
This
This
This
Finally, the case on |
Okay, at least for most of these the CSS is already invalid and/or useless. In particular, the CSS counter So, uh, seems like we're pretty reasonably compatible? |
Agenda+ to discuss this change |
The CSS Working Group just discussed The full IRC log of that discussion<fantasai> Topic: [css-values-3] Restrict none/auto/normal from <custom-ident><fantasai> github: [css-values-3] Restrict none/auto/normal from <custom-ident> <fantasai> github: https://github.com//issues/7431#issuecomment-1178237576 <fantasai> TabAtkins: In the definition for <custom-ident> in Values and Units <fantasai> TabAtkins: can be any keyword, except CSS-wide keywords <fantasai> TabAtkins: can't name an animation "initial" <fantasai> TabAtkins: any other keywords that need to be xcluded for grammatical ambiguity reasons, you need to specify that explicitly <fantasai> TabAtkins: however, there's a handful of keywords that are used so often in properties, and seem so not-very-useful for naming things <fantasai> TabAtkins: that it might make sense to restrict them as well <fantasai> TabAtkins: specifically: auto, none, normal <fantasai> TabAtkins: these are used in a lot of properties, and are not good names for animations/counter-styles/etc. <fantasai> TabAtkins: First question is, are sites using these ? <fantasai> TabAtkins: dbaron did an initial analysis, and while they are used in a few places <fantasai> TabAtkins: they appear to be invalid in those places anywhere <fantasai> TabAtkins: e.g. 'none' as a line name in Grid, but [missed example] <fantasai> TabAtkins: so makes sense to treat as invalid anyway <fantasai> TabAtkins: I believe compat impact will be minimal to none <fantasai> TabAtkins: all uses we saw were already invalid <plinss> q+ <fantasai> TabAtkins: and this should make custom idents safer to use in general, without us having to remember to explicitly cut out these common keywords <andreubotella> s/[missed example]/no 'none' line <fantasai> TabAtkins: so that's the proposal -- restrict none/auto/normal from <custom-ident> <fantasai> plinss: If using 'none' as a line name now, would that invalidate the line name or the whole declaration <fantasai> TabAtkins: invalidate the whole declaration <fantasai> plinss: That's more breakage than making valid but matching nothing <fantasai> plinss: That said, I'm not too concerned <dbaron> One other example I've seen is the use of `auto` as a named toggle state in https://toggles.oddbird.net/#named-modes <fantasai> plinss: probably too late to do anything, allowing custom-idents without prefixing was risky in the first place <Rossen_> ack plinss <fantasai> TabAtkins: definitely it's a problem we should avoid <fantasai> plinss: Should we require that, and not repeat this mistake that allows potentially conflicting <custom-ident> <fantasai> TabAtkins: Could do that, make these legacy <fantasai> fantasai: I would prefer to stay consistent with existing practice <fantasai> fantasai: Anyway that's outside the scope of the issue <fantasai> dbaron: There are probably some uses of <custom-ident> that could be <ident> because don't conflict with other stuff <fantasai> dbaron: not sure if that's one of them <fantasai> TabAtkins: names, toggle-state, and line names won't <fantasai> TabAtkins: problems are things like animation-name, which we screwed up on, and don't want to repeat that <fantasai> plinss: original sin here was unquoted font names, all kinds of problems from day 1 <fantasai> fantasai: Back to original issue, do we exclude these keywords? I propose to accept <fantasai> TabAtkins: I'm now less convinced that we should <fantasai> TabAtkins: maybe revisit grammar, and require only using in unambiguous contexts like line names <fantasai> TabAtkins: Let's not screw it up again <fantasai> fantasai: I still think it's worth excluding these keywords <fantasai> TabAtkins: I say take it back to issue |
After the discussion today, I no longer think this is needed. The breakage potential seems higher than I initially thought, and the use-cases less important - generally, new APIs should use dashed-ident rather than custom-ident anyway. (And if it's safe to use custom-ident because it wont' mix with other keywords, like grid line names, then it's safe to name them none/auto/normal as well.) |
Per recent CSSWG resolution [1], the initial value is now 'normal'. The function StyleBuilderConverter::ConvertFlags had hard-coded handling of CSSValueID::kNone which interpreted that to mean "flags=0". Since we now also need kNormal to mean "flags=0", this CL adds a template parameter to indicate which CSSValueID we should treat as zero. This CL also disallows the following values from the <custom-ident> of the container-name property: - normal, which was clearly intended from reading the discussion in [1]. - auto, which is not explicitly mentioned in [1] as something to disallow, but it's aligned with the ambition to disallow none/normal/auto from <custom-ident> in general [2]. [1] w3c/csswg-drafts#7402 [2] w3c/csswg-drafts#7431 Fixed: 1340859 Change-Id: I841303e2b5673c65d69d97522a0a3661e5d1ec24 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3736384 Commit-Queue: Anders Hartvoll Ruud <andruud@chromium.org> Reviewed-by: Morten Stenshorne <mstensho@chromium.org> Cr-Commit-Position: refs/heads/main@{#1019597} NOKEYCHECK=True GitOrigin-RevId: def23d1f1adb194a537f4957bbdbe62252fe10f6
The CSS Working Group just discussed
The full IRC log of that discussion<fantasai> Topic: [css-values-3] Restrict none/auto/normal from <custom-ident><fantasai> github: [css-values-3] Restrict none/auto/normal from <custom-ident> <fantasai> github: https://github.com//issues/7431#issuecomment-1178237576 <fantasai> TabAtkins: I filed the issue, happy to withdraw <vmpstr> fantasai: would've been nice to make it excluded, but i understand there's compat risk <fantasai> astearns: Proposed resolution is to close no change <TabAtkins> I didn't file the issue actually, Elika did. (But it happened as a result of us discussing it together.) <fantasai> RESOLVED: Close no change |
…> values. In w3c/csswg-drafts#7431 the CSS Working Group resolved not to try to restrict none/normal/auto keywords, so there's no need to reject them to avoid worsening potential compatibility problems. Based on specs at https://drafts.csswg.org/css-contain-3/#container-name and https://drafts.csswg.org/css-contain-3/#container-rule, this adjusts ConsumeSingleContainerName to accept 'normal' and instead reject 'none'. Fixed: 1340852 Change-Id: I53b78e412b0797210c1b5463401bcc055f7bd550
…> values. In w3c/csswg-drafts#7431 the CSS Working Group resolved not to try to restrict none/normal/auto keywords, so there's no need to reject them to avoid worsening potential compatibility problems. Based on specs at https://drafts.csswg.org/css-contain-3/#container-name and https://drafts.csswg.org/css-contain-3/#container-rule, this adjusts ConsumeSingleContainerName to accept 'normal' and instead reject 'none'. Fixed: 1340852 Change-Id: I53b78e412b0797210c1b5463401bcc055f7bd550 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3966666 Reviewed-by: Anders Hartvoll Ruud <andruud@chromium.org> Commit-Queue: David Baron <dbaron@chromium.org> Cr-Commit-Position: refs/heads/main@{#1061600}
…> values. In w3c/csswg-drafts#7431 the CSS Working Group resolved not to try to restrict none/normal/auto keywords, so there's no need to reject them to avoid worsening potential compatibility problems. Based on specs at https://drafts.csswg.org/css-contain-3/#container-name and https://drafts.csswg.org/css-contain-3/#container-rule, this adjusts ConsumeSingleContainerName to accept 'normal' and instead reject 'none'. Fixed: 1340852 Change-Id: I53b78e412b0797210c1b5463401bcc055f7bd550 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3966666 Reviewed-by: Anders Hartvoll Ruud <andruud@chromium.org> Commit-Queue: David Baron <dbaron@chromium.org> Cr-Commit-Position: refs/heads/main@{#1061600}
…> values. In w3c/csswg-drafts#7431 the CSS Working Group resolved not to try to restrict none/normal/auto keywords, so there's no need to reject them to avoid worsening potential compatibility problems. Based on specs at https://drafts.csswg.org/css-contain-3/#container-name and https://drafts.csswg.org/css-contain-3/#container-rule, this adjusts ConsumeSingleContainerName to accept 'normal' and instead reject 'none'. Fixed: 1340852 Change-Id: I53b78e412b0797210c1b5463401bcc055f7bd550 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3966666 Reviewed-by: Anders Hartvoll Ruud <andruud@chromium.org> Commit-Queue: David Baron <dbaron@chromium.org> Cr-Commit-Position: refs/heads/main@{#1061600}
…l/auto on newer <custom-ident> values., a=testonly Automatic update from web-platform-tests Stop conservatively rejecting none/normal/auto on newer <custom-ident> values. In w3c/csswg-drafts#7431 the CSS Working Group resolved not to try to restrict none/normal/auto keywords, so there's no need to reject them to avoid worsening potential compatibility problems. Based on specs at https://drafts.csswg.org/css-contain-3/#container-name and https://drafts.csswg.org/css-contain-3/#container-rule, this adjusts ConsumeSingleContainerName to accept 'normal' and instead reject 'none'. Fixed: 1340852 Change-Id: I53b78e412b0797210c1b5463401bcc055f7bd550 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3966666 Reviewed-by: Anders Hartvoll Ruud <andruud@chromium.org> Commit-Queue: David Baron <dbaron@chromium.org> Cr-Commit-Position: refs/heads/main@{#1061600} -- wpt-commits: b602a0af80e724f8d1828341cfacb29842f02103 wpt-pr: 36561
…l/auto on newer <custom-ident> values., a=testonly Automatic update from web-platform-tests Stop conservatively rejecting none/normal/auto on newer <custom-ident> values. In w3c/csswg-drafts#7431 the CSS Working Group resolved not to try to restrict none/normal/auto keywords, so there's no need to reject them to avoid worsening potential compatibility problems. Based on specs at https://drafts.csswg.org/css-contain-3/#container-name and https://drafts.csswg.org/css-contain-3/#container-rule, this adjusts ConsumeSingleContainerName to accept 'normal' and instead reject 'none'. Fixed: 1340852 Change-Id: I53b78e412b0797210c1b5463401bcc055f7bd550 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3966666 Reviewed-by: Anders Hartvoll Ruud <andruud@chromium.org> Commit-Queue: David Baron <dbaron@chromium.org> Cr-Commit-Position: refs/heads/main@{#1061600} -- wpt-commits: b602a0af80e724f8d1828341cfacb29842f02103 wpt-pr: 36561
…emilio Per w3c/csswg-drafts#7431, both timeline name should accept `auto`. Differential Revision: https://phabricator.services.mozilla.com/D166476
…emilio Per w3c/csswg-drafts#7431, both timeline name should accept `auto`. Differential Revision: https://phabricator.services.mozilla.com/D166476
…emilio Per w3c/csswg-drafts#7431, both timeline name should accept `auto`. Differential Revision: https://phabricator.services.mozilla.com/D166476
…emilio Per w3c/csswg-drafts#7431, both timeline name should accept `auto`. Differential Revision: https://phabricator.services.mozilla.com/D166476
Per w3c/csswg-drafts#7431, both timeline name should accept `auto`. Differential Revision: https://phabricator.services.mozilla.com/D166476
Per w3c/csswg-drafts#7431, both timeline name should accept `auto`. Differential Revision: https://phabricator.services.mozilla.com/D166476
Per w3c/csswg-drafts#7431, both timeline name should accept `auto`. Differential Revision: https://phabricator.services.mozilla.com/D166476
Per w3c/csswg-drafts#7431, both timeline name should accept `auto`. Differential Revision: https://phabricator.services.mozilla.com/D166476
We often use these keywords in grammars, so @tabatkins suggested we blanket-restrict them the same way we do all the global keyboards (initial/inherit/etc.)
The text was updated successfully, but these errors were encountered: