-
Notifications
You must be signed in to change notification settings - Fork 707
[cssom-1] Serialization for declaration block with variable reference in shorthand may not be useful #2515
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
It becomes complicated again that #2924 makes it not append, but just has some constraints... |
… that browser_parsable_css.js doesn't get mad. rs=mconley It would detect the variable as unreferenced because the background-repeat that was added on this bug makes the values not serialize, see w3c/csswg-drafts#2515 CLOSED TREE of course
… that browser_parsable_css.js doesn't get mad. rs=mconley It would detect the variable as unreferenced because the background-repeat that was added on this bug makes the values not serialize, see w3c/csswg-drafts#2515 CLOSED TREE of course
… that browser_parsable_css.js doesn't get mad. rs=mconley It would detect the variable as unreferenced because the background-repeat that was added on this bug makes the values not serialize, see w3c/csswg-drafts#2515 CLOSED TREE of course UltraBlame original commit: eb384663078998538a5af4dfa7f45972fe29da49
… that browser_parsable_css.js doesn't get mad. rs=mconley It would detect the variable as unreferenced because the background-repeat that was added on this bug makes the values not serialize, see w3c/csswg-drafts#2515 CLOSED TREE of course UltraBlame original commit: eb384663078998538a5af4dfa7f45972fe29da49
… that browser_parsable_css.js doesn't get mad. rs=mconley It would detect the variable as unreferenced because the background-repeat that was added on this bug makes the values not serialize, see w3c/csswg-drafts#2515 CLOSED TREE of course UltraBlame original commit: eb384663078998538a5af4dfa7f45972fe29da49
As per w3c/csswg-drafts#3030. Also remove a system font special-case. It's generally handled in shorthands/font.mako.rs, and when it's not, it's really the same issue as w3c/csswg-drafts#2515. Browsers are all over the place for the system font case, so I think it's fine. Differential Revision: https://phabricator.services.mozilla.com/D96045 bugzilla-url: https://bugzilla.mozilla.org/show_bug.cgi?id=1675514 gecko-commit: 6dcbbdb84c453149f460f6868eeb135d6622c57d gecko-reviewers: boris
…ies. r=boris As per w3c/csswg-drafts#3030. Also remove a system font special-case. It's generally handled in shorthands/font.mako.rs, and when it's not, it's really the same issue as w3c/csswg-drafts#2515. Browsers are all over the place for the system font case, so I think it's fine. Differential Revision: https://phabricator.services.mozilla.com/D96045
As per w3c/csswg-drafts#3030. Also remove a system font special-case. It's generally handled in shorthands/font.mako.rs, and when it's not, it's really the same issue as w3c/csswg-drafts#2515. Browsers are all over the place for the system font case, so I think it's fine. Differential Revision: https://phabricator.services.mozilla.com/D96045 bugzilla-url: https://bugzilla.mozilla.org/show_bug.cgi?id=1675514 gecko-commit: 6dcbbdb84c453149f460f6868eeb135d6622c57d gecko-reviewers: boris
…ies. r=boris As per w3c/csswg-drafts#3030. Also remove a system font special-case. It's generally handled in shorthands/font.mako.rs, and when it's not, it's really the same issue as w3c/csswg-drafts#2515. Browsers are all over the place for the system font case, so I think it's fine. Differential Revision: https://phabricator.services.mozilla.com/D96045
Commenting to not that legacy shorthands (which serialize to the non-legacy shorthands that replaced them) are a subset of this issue, but are handled slightly differently in CSSOM, so we should make sure they're solved properly at the same time as this. |
As per w3c/csswg-drafts#3030. Also remove a system font special-case. It's generally handled in shorthands/font.mako.rs, and when it's not, it's really the same issue as w3c/csswg-drafts#2515. Browsers are all over the place for the system font case, so I think it's fine. Differential Revision: https://phabricator.services.mozilla.com/D96045
The CSS Working Group just discussed The full IRC log of that discussion<dael> Topic: [cssom-1] Serialization for declaration block with variable reference in shorthand may not be useful<dael> github: https://github.com//issues/2515 <dael> Rossen_: Do we have the right people? <dael> Rossen_: Doubt we have xidorn. Can anyone represent this? <dael> TabAtkins: This was put on by fantasai, presumably b/c needs to be addressed. not certain we need to address on a call. It's for me and emilio to work on <dael> Rossen_: I'm fine moving forward if we don't need group consensus. <dael> TabAtkins: Not yet. May come back later. |
The serialization for declaration block with variable reference in shorthand while some longhand is set differently can lead to undesired result, i.e. it would produce non-idempotent result.
For example, for a declaration block like
in the current algorithm would be serialized to something like
which apparently doesn't have the same meaning as before. This is unfortunate.
We should probably change the serialization algorithm to that, when we find a longhand which is expanded from some shorthand with variable reference, the shorthand reference is always serialized. If there are longhands that have been changed from the expansion of shorthand (like
margin-top
in the case above), the longhands are not added to already serialized, so that their value is still preserved and will be serialized later.The above algorithm should works fine with declaration block from parsing, since the parsing result uses specified order, and thus any update to longhand which was expanded from a shorthand would always come after the shorthand. However, there is currently some problem with CSSOM setters, because in the spec they still set in place rather than append.
For that, we've resolved in #1898 (comment) that setters should append rather than set in place, so this is probably not a problem anyway. We may still want that change to happen first, though.
cc @csnardi
The text was updated successfully, but these errors were encountered: