-
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-align-3] grid-*-gap
should be aliases instead of shorthands
#8014
Comments
In practice, the difference can be observed as such: document.body.style.gridGap = "var(--gap)";
document.body.style.gap; Firefox and WebKit say |
Do you mean the difference between a simple alias and a legacy shorthand?
Is this the expected behavior of a legacy shorthand? If so, I do not understand. EDIT: oh right, ok, it is specific to substitution-value, I will have to think harder to understand how it could be wrong to not serialize |
Yes, this is just when using document.body.style.cssText = "--bb: page; break-before: var(--bb)";
document.body.style.pageBreakBefore; // "" It can't be |
Then when syntaxes are different, UAs must implement the legacy property as a legacy shorthand, otherwise they can choose the mechanism they want. |
I would not want to stray too far from the topic of this issue (which is to allow aliasing style.pageBreakAfter = 'var(--custom)'
style.cssText; // 'break-after: ;'
style.breakAfter = 'var(--custom)'
style.cssText; // 'break-after: var(--custom);' But how to serialize these cases may not be fully defined though (cf. #3109). |
This could maybe be addressed as part of #2515? https://drafts.csswg.org/css-cascade-4/#legacy-shorthand says
but I think they should be used when a longhand has a pending-substitution value linked to the legacy shorthand. style.pageBreakAfter = 'always'
style.cssText; // 'break-after: page;'
style.pageBreakAfter = 'var(--custom)'
style.cssText; // 'page-break-after: var(--custom);' |
I was thinking to serializing the legacy shorthand with style['--custom'] = 'recto'
style.breakAfter = 'var(--custom)'
style.pageBreakAfter; // 'var(--custom)'
computedStyle.pageBreakAfter; // '' But yeah, "using" it in a style block also makes sense to me, and I am fine with discussing it in #2515. I subscribed to it. |
Based on @Loirooriol 's comment in a Chromium code review, it sounds like:
I will also admit when reading the spec that I didn't catch the distinction that these weren't aliases. |
(We should probably also add helper functions to |
FYI, Chrome has done this. |
The CSS Working Group just discussed
The full IRC log of that discussion<jarhar> oriol: so we had the case with grid that we initially added the grid properties but then we wanted to ? as gap and then the currently the specification that grid gap should be a hsorthand of gap<jarhar> oriol: however, but firefox and webkit implement it not as a hsorthand but as an alias <jarhar> oriol: both cases basically have the same behavior but if you set a variable to the grid gap property, then you try to read the value of the gap property, if they are aliasses then you get the ? otherwise you get the emptry string <jarhar> oriol: if it gets set to an internal ? value <emilio> s/?/pending substitution/ <jarhar> oriol: and then i think that doing show interest or ended up doing it as an alias i dont remember the situation <jarhar> dbaron: it is already done and shipping in 125 <jarhar> oriol: the propsoed resolution would be that grid gap should be an alias of gap and not a shorthand <jarhar> oriol: not sure if i missed anything <iank_> make the spec fiction, non-fiction :) <jarhar> miriam: so thats the proposed resolution and is also whats now shipping? <jarhar> dbaron: yes it is now shipping in 3 engines <jarhar> dbaron: we added it to the agenda around the same time we made the change and it took some time to come to the meeting <jarhar> miriam: great, lets resolve on the thing that all the engines do <jarhar> fantasai: make grid gap aliases <fantasai> PROPOSED: Make grid*gap properties be legacy name aliases <fantasai> RESOLVED: Make grid*gap properties be legacy name aliases |
…acy shorthands. This is a followup to the discussion in w3c/csswg-drafts#8014 and tests the concepts in https://drafts.csswg.org/css-cascade-5/#aliasing partly using the rules in https://drafts.csswg.org/css-variables/#substitution-in-shorthands . Bug: 40834250 Change-Id: Ic8c2044a091ec609bb447c739052888a4ec6e603
…acy shorthands. This is a followup to the discussion in w3c/csswg-drafts#8014 and tests the concepts in https://drafts.csswg.org/css-cascade-5/#aliasing partly using the rules in https://drafts.csswg.org/css-variables/#substitution-in-shorthands . Bug: 40834250 Change-Id: Ic8c2044a091ec609bb447c739052888a4ec6e603 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5838006 Commit-Queue: David Baron <dbaron@chromium.org> Reviewed-by: Oriol Brufau <obrufau@igalia.com> Cr-Commit-Position: refs/heads/main@{#1351453}
…acy shorthands. This is a followup to the discussion in w3c/csswg-drafts#8014 and tests the concepts in https://drafts.csswg.org/css-cascade-5/#aliasing partly using the rules in https://drafts.csswg.org/css-variables/#substitution-in-shorthands . Bug: 40834250 Change-Id: Ic8c2044a091ec609bb447c739052888a4ec6e603 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5838006 Commit-Queue: David Baron <dbaron@chromium.org> Reviewed-by: Oriol Brufau <obrufau@igalia.com> Cr-Commit-Position: refs/heads/main@{#1351453}
…acy shorthands. This is a followup to the discussion in w3c/csswg-drafts#8014 and tests the concepts in https://drafts.csswg.org/css-cascade-5/#aliasing partly using the rules in https://drafts.csswg.org/css-variables/#substitution-in-shorthands . Bug: 40834250 Change-Id: Ic8c2044a091ec609bb447c739052888a4ec6e603 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5838006 Commit-Queue: David Baron <dbaron@chromium.org> Reviewed-by: Oriol Brufau <obrufau@igalia.com> Cr-Commit-Position: refs/heads/main@{#1351453}
…n legacy name aliases and legacy shorthands., a=testonly Automatic update from web-platform-tests Add tests to test the distinction between legacy name aliases and legacy shorthands. This is a followup to the discussion in w3c/csswg-drafts#8014 and tests the concepts in https://drafts.csswg.org/css-cascade-5/#aliasing partly using the rules in https://drafts.csswg.org/css-variables/#substitution-in-shorthands . Bug: 40834250 Change-Id: Ic8c2044a091ec609bb447c739052888a4ec6e603 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5838006 Commit-Queue: David Baron <dbaron@chromium.org> Reviewed-by: Oriol Brufau <obrufau@igalia.com> Cr-Commit-Position: refs/heads/main@{#1351453} -- wpt-commits: 67a07c1964180a3ea630a5968a236db010a20e42 wpt-pr: 47982
…n legacy name aliases and legacy shorthands., a=testonly Automatic update from web-platform-tests Add tests to test the distinction between legacy name aliases and legacy shorthands. This is a followup to the discussion in w3c/csswg-drafts#8014 and tests the concepts in https://drafts.csswg.org/css-cascade-5/#aliasing partly using the rules in https://drafts.csswg.org/css-variables/#substitution-in-shorthands . Bug: 40834250 Change-Id: Ic8c2044a091ec609bb447c739052888a4ec6e603 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5838006 Commit-Queue: David Baron <dbaron@chromium.org> Reviewed-by: Oriol Brufau <obrufau@igalia.com> Cr-Commit-Position: refs/heads/main@{#1351453} -- wpt-commits: 67a07c1964180a3ea630a5968a236db010a20e42 wpt-pr: 47982
…n legacy name aliases and legacy shorthands., a=testonly Automatic update from web-platform-tests Add tests to test the distinction between legacy name aliases and legacy shorthands. This is a followup to the discussion in w3c/csswg-drafts#8014 and tests the concepts in https://drafts.csswg.org/css-cascade-5/#aliasing partly using the rules in https://drafts.csswg.org/css-variables/#substitution-in-shorthands . Bug: 40834250 Change-Id: Ic8c2044a091ec609bb447c739052888a4ec6e603 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5838006 Commit-Queue: David Baron <dbaron@chromium.org> Reviewed-by: Oriol Brufau <obrufau@igalia.com> Cr-Commit-Position: refs/heads/main@{#1351453} -- wpt-commits: 67a07c1964180a3ea630a5968a236db010a20e42 wpt-pr: 47982
…n legacy name aliases and legacy shorthands., a=testonly Automatic update from web-platform-tests Add tests to test the distinction between legacy name aliases and legacy shorthands. This is a followup to the discussion in w3c/csswg-drafts#8014 and tests the concepts in https://drafts.csswg.org/css-cascade-5/#aliasing partly using the rules in https://drafts.csswg.org/css-variables/#substitution-in-shorthands . Bug: 40834250 Change-Id: Ic8c2044a091ec609bb447c739052888a4ec6e603 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5838006 Commit-Queue: David Baron <dbaronchromium.org> Reviewed-by: Oriol Brufau <obrufauigalia.com> Cr-Commit-Position: refs/heads/main{#1351453} -- wpt-commits: 67a07c1964180a3ea630a5968a236db010a20e42 wpt-pr: 47982 UltraBlame original commit: d85e48ddef6f68ec481f98cce15461dd50857ab7
…n legacy name aliases and legacy shorthands., a=testonly Automatic update from web-platform-tests Add tests to test the distinction between legacy name aliases and legacy shorthands. This is a followup to the discussion in w3c/csswg-drafts#8014 and tests the concepts in https://drafts.csswg.org/css-cascade-5/#aliasing partly using the rules in https://drafts.csswg.org/css-variables/#substitution-in-shorthands . Bug: 40834250 Change-Id: Ic8c2044a091ec609bb447c739052888a4ec6e603 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5838006 Commit-Queue: David Baron <dbaronchromium.org> Reviewed-by: Oriol Brufau <obrufauigalia.com> Cr-Commit-Position: refs/heads/main{#1351453} -- wpt-commits: 67a07c1964180a3ea630a5968a236db010a20e42 wpt-pr: 47982 UltraBlame original commit: d85e48ddef6f68ec481f98cce15461dd50857ab7
…n legacy name aliases and legacy shorthands., a=testonly Automatic update from web-platform-tests Add tests to test the distinction between legacy name aliases and legacy shorthands. This is a followup to the discussion in w3c/csswg-drafts#8014 and tests the concepts in https://drafts.csswg.org/css-cascade-5/#aliasing partly using the rules in https://drafts.csswg.org/css-variables/#substitution-in-shorthands . Bug: 40834250 Change-Id: Ic8c2044a091ec609bb447c739052888a4ec6e603 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5838006 Commit-Queue: David Baron <dbaronchromium.org> Reviewed-by: Oriol Brufau <obrufauigalia.com> Cr-Commit-Position: refs/heads/main{#1351453} -- wpt-commits: 67a07c1964180a3ea630a5968a236db010a20e42 wpt-pr: 47982 UltraBlame original commit: d85e48ddef6f68ec481f98cce15461dd50857ab7
grid-row-gap
,grid-column-gap
,grid-gap
, are defined to be treated as legacy shorthands instead of legacy name aliases, but they must take the same grammar as the property they are aliasing, whereas CSS Cascade defines:I did not quite understand the whole discussions in #866 (especially the meeting transcript) that led to the changes in CSS Cascade for the above definition and the definition of legacy shorthands, so I am not sure the resolution is you must use legacy name aliasing when the syntax is the same. I also note that the details of the aliasing mechanism is intentionally left up to the UA for some legacy properties whose syntax is the same as the new property (eg.
-webkit-user-select
).The text was updated successfully, but these errors were encountered: