-
Notifications
You must be signed in to change notification settings - Fork 707
Do the CSSOM part of #866 #3109
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
I understand that fixing this issue may not be a priority but can I assume that it can be partially fixed in serialize a CSS declaration block (instead of serialize a CSS value, what seems to be a better seperation of concerns to ignore a legacy shorthand): - 3. If `property` maps to one or more shorthand properties, let `shorthands` be an array of those shorthand properties, in preferred order.
+ 3. If `property` maps to one or more shorthand properties, let `shorthands` be an array of those shorthand properties, in preferred order, ignoring legacy shorthands. Also, there are some cases discussed in #8014 that I would like to be clarified. Assuming an hypothetical legacy shorthand // EDIT: the following case shoud not exist (`longhand` should accept `a` for back-compat)
style.shorthand = 'a'
style.shorthand; // 'a'
style.longhand; // ''
style.cssText; // 'shorthand: a;'
style.shorthand = 'b'
style.shorthand; // 'b'
style.longhand; // 'c'
style.cssText; // 'longhand: c;'
style.shorthand = 'c'
style.shorthand; // ''
style.longhand; // ''
style.cssText; // ''
style['--custom'] = 'a'
style.shorthand = 'var(--custom)'
style.shorthand; // 'var(--custom)'
style.longhand; // 'var(--custom)'
style.cssText; // 'shorthand: var(--custom);'
computedStyle.shorthand; // 'a'
computedStyle.longhand; // ''
style.longhand = 'c'
style.shorthand; // 'b'
style.longhand; // 'c'
style.cssText; // 'longhand: c;'
style.longhand = 'var(--custom)'
style.shorthand; // 'var(--custom)'
style.longhand; // 'var(--custom)'
style.cssText; // 'longhand: var(--custom);' |
style.shorthand = 'a' See #7195 for this case style.shorthand = 'var(--custom)'
style.longhand; // 'var(--custom)' No, because we could have style.longhand = 'var(--custom)'
style.shorthand; // 'var(--custom)' Similarly, if See https://drafts.csswg.org/css-variables-1/#variables-in-shorthands
|
Thanks for the link. It makes sense that the target property should include the legacy value in its syntax for back compat. So the first case in my examples should not exist. What would you expect in the following situation? style['--custom] = 'b'
style.shorthand = var(--custom)
style['--custom] = 'c'
style.longhand; // ?? I am not very comfortable with of their own because it prevents serializing a shorthand when all its longhand have been independently declared with the same custom variable (and the same fallbacks, if any). But comparing custom variables for checking equality seems non-trivial. But I am not sure this is the reason of this restriction. Anyway, I do not have a strong opinion on serializing the target longhand when the legacy shorthand is declared with |
First, note that to set Then, |
Asides from the edits already done in #866, @tabatkins mentioned that:
This remains to be done.
The text was updated successfully, but these errors were encountered: