-
Notifications
You must be signed in to change notification settings - Fork 719
[css-display] Should values be aliased at parse time?
#5575
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
Comments
The CSS Working Group just discussed The full IRC log of that discussion |
I suspect the code @bfgeek was referring to is this code from jquery. I expect a fair amount of code like that to stop working if we decide to make them separate values with different serializations. Of course, that's the same kind of thing that would happen if we added a new display type, but it seems a bit unfortunate to enforce everyone to deal with a new name for an old thing :) Again, I won't object to such thing and I think that even though it's a breaking change for Gecko it's probably an ok change to make, if we go that route, but I'd love to have some feedback from JS frameworks as well if someone has contacts in that space. |
@stubbornella do you have an opinion on this, or know anyone who could weigh in? |
Yeah, as fantasai and others discussed during the call, focusing on "this will break old code that doesn't expect it" is gonna be true for every new feature we ever introduce, and is particularly true for this precise code when we add new display types (such as the half-dozen math-related display types we also decided to add during this call). I'm not sure why we're so pressed about this in particular - it's not changing any existing code, it's just new code written using the new syntax that will cause libraries like this to break (just like they would with |
Re-reviewing this, @fantasai and I still prefer to leave the new forms as separate values that just act identically. This doesn't change behavior for any code that currently uses a legacy value, and if code breaks with one of the new forms, it'll break with any other new display value, too, so there's not a lot we can do there. Agenda+ to confirm that this is okay (or decide the opposite). Also need to decide whether computed-value serialization will use the legacy keywords due to the shortest-serialization principle, or if we want to still consider them distinct values that act identically there, too. |
The CSS Working Group just discussed
The full IRC log of that discussion |
…alization" only to computed values. This CL follows resolutions of w3c/csswg-drafts#5575. * ParseDisplayMultipleKeywords() just checks validity of specified keywords, and does not reorder and shorten keywords. * Display::ApplyValue() supports unordered lists. Bug: w3c/csswg-drafts#5575 Bug: mozilla/wg-decisions#622 Bug: 995106 Change-Id: I6c916a8910b32f1d4849c68ac5595f9024bfa0f9
…alization" only to computed values. This CL follows resolutions of w3c/csswg-drafts#5575. * ParseDisplayMultipleKeywords() just checks validity of specified keywords, and does not reorder and shorten keywords. * Display::ApplyValue() supports unordered lists. Bug: w3c/csswg-drafts#5575 Bug: mozilla/wg-decisions#622 Bug: 995106 Change-Id: I6c916a8910b32f1d4849c68ac5595f9024bfa0f9
This CL follows resolutions of w3c/csswg-drafts#5575. * ParseDisplayMultipleKeywords() reorders and shortens keywords, but does not change the specified keywords to legacy keywords. * Display::ApplyValue() uses ValidateDisplayKeywords() Bug: w3c/csswg-drafts#5575 Bug: mozilla/wg-decisions#622 Bug: 995106 Change-Id: I6c916a8910b32f1d4849c68ac5595f9024bfa0f9
This CL follows resolutions of w3c/csswg-drafts#5575. * ParseDisplayMultipleKeywords() reorders and shortens keywords, but does not change the specified keywords to legacy keywords. * Display::ApplyValue() uses ValidateDisplayKeywords() Bug: w3c/csswg-drafts#5575 Bug: mozilla/wg-decisions#622 Bug: 995106 Change-Id: I6c916a8910b32f1d4849c68ac5595f9024bfa0f9
This CL follows resolutions of w3c/csswg-drafts#5575. * ParseDisplayMultipleKeywords() reorders and shortens keywords, but does not change the specified keywords to legacy keywords. It means - "el.style.display = 'block flow'; el.style.display" returns 'block'. - "el.style.display = 'flow-root inline'; el.style.display" returns 'inline flow-root', not 'inline-block'. * Display::ApplyValue() uses ValidateDisplayKeywords() Bug: w3c/csswg-drafts#5575 Bug: mozilla/wg-decisions#622 Bug: 995106 Change-Id: I6c916a8910b32f1d4849c68ac5595f9024bfa0f9
This CL follows resolutions of w3c/csswg-drafts#5575. * ParseDisplayMultipleKeywords() reorders and shortens keywords, but does not change the specified keywords to legacy keywords. It means - "el.style.display = 'block flow'; el.style.display" returns 'block'. - "el.style.display = 'flow-root inline'; el.style.display" returns 'inline flow-root', not 'inline-block'. * Display::ApplyValue() uses ValidateDisplayKeywords() Bug: w3c/csswg-drafts#5575 Bug: mozilla/wg-decisions#622 Bug: 995106 Change-Id: I6c916a8910b32f1d4849c68ac5595f9024bfa0f9
This CL follows resolutions of w3c/csswg-drafts#5575. * ParseDisplayMultipleKeywords() reorders and shortens keywords, but does not change the specified keywords to legacy keywords. It means - "el.style.display = 'block flow'; el.style.display" returns 'block'. - "el.style.display = 'flow-root inline'; el.style.display" returns 'inline flow-root', not 'inline-block'. * Display::ApplyValue() uses ValidateDisplayKeywords() Bug: w3c/csswg-drafts#5575 Bug: mozilla/wg-decisions#622 Bug: 995106 Change-Id: I6c916a8910b32f1d4849c68ac5595f9024bfa0f9 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4493792 Reviewed-by: Oriol BrufauAuto-Submit: Kent Tamura Commit-Queue: Kent Tamura Cr-Commit-Position: refs/heads/main@{#1141725}
This CL follows resolutions of w3c/csswg-drafts#5575. * ParseDisplayMultipleKeywords() reorders and shortens keywords, but does not change the specified keywords to legacy keywords. It means - "el.style.display = 'block flow'; el.style.display" returns 'block'. - "el.style.display = 'flow-root inline'; el.style.display" returns 'inline flow-root', not 'inline-block'. * Display::ApplyValue() uses ValidateDisplayKeywords() Bug: w3c/csswg-drafts#5575 Bug: mozilla/wg-decisions#622 Bug: 995106 Change-Id: I6c916a8910b32f1d4849c68ac5595f9024bfa0f9 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4493792 Reviewed-by: Oriol BrufauAuto-Submit: Kent Tamura Commit-Queue: Kent Tamura Cr-Commit-Position: refs/heads/main@{#1141725}
This CL follows resolutions of w3c/csswg-drafts#5575. * ParseDisplayMultipleKeywords() reorders and shortens keywords, but does not change the specified keywords to legacy keywords. It means - "el.style.display = 'block flow'; el.style.display" returns 'block'. - "el.style.display = 'flow-root inline'; el.style.display" returns 'inline flow-root', not 'inline-block'. * Display::ApplyValue() uses ValidateDisplayKeywords() Bug: w3c/csswg-drafts#5575 Bug: mozilla/wg-decisions#622 Bug: 995106 Change-Id: I6c916a8910b32f1d4849c68ac5595f9024bfa0f9 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4493792 Reviewed-by: Oriol BrufauAuto-Submit: Kent Tamura Commit-Queue: Kent Tamura Cr-Commit-Position: refs/heads/main@{#1141725}
…on, a=testonly Automatic update from web-platform-tests css-multiple-display: Update serialization This CL follows resolutions of w3c/csswg-drafts#5575. * ParseDisplayMultipleKeywords() reorders and shortens keywords, but does not change the specified keywords to legacy keywords. It means - "el.style.display = 'block flow'; el.style.display" returns 'block'. - "el.style.display = 'flow-root inline'; el.style.display" returns 'inline flow-root', not 'inline-block'. * Display::ApplyValue() uses ValidateDisplayKeywords() Bug: w3c/csswg-drafts#5575 Bug: mozilla/wg-decisions#622 Bug: 995106 Change-Id: I6c916a8910b32f1d4849c68ac5595f9024bfa0f9 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4493792 Reviewed-by: Oriol BrufauAuto-Submit: Kent Tamura Commit-Queue: Kent Tamura Cr-Commit-Position: refs/heads/main@{#1141725} -- wpt-commits: 06fdaf18990326fd1aebf5e52c94cf43eeca5b35 wpt-pr: 39800
https://drafts.csswg.org/css-display-3/#typedef-display-legacy defines some
values which are equivalent to a ||
combination:display
display
And then the spec says
What seems clear to me is that short and full displays have the same computed value, so we must have
What is less clear to me is whether the aliasing happens only at computed value time, or earlier at parse time:
Firefox says "inline-block", Chromium doesn't support the multi-values syntax yet.
While it's common to serialize declared values without optional components when the default value was provided (according to the shortest serialization principle), or with missing optional values that were omitted (against the SSP), or with a normalized order when there are multiple components, it seems less common to completely replace the declared value with another one.
For example, Chromium doesn't do it for
contain
:The text was updated successfully, but these errors were encountered: