-
Notifications
You must be signed in to change notification settings - Fork 715
[cssom] In what order should properties be serialized? #2509
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
CSS declaration block is an ordered collection of declarations according to its definition, and that that order is the specified order. Serialization is based on that order. That means, in this case, /* margin-top: {placeholder}; <- dropped in favor of the later one */
margin-right: {placeholder};
margin-bottom: {placeholder};
margin-left: {placeholder};
margin-top: 10px; /* <- the new one */ So I would say the behavior of Chrome and Firefox is expected, and this is a bug of Edge. |
I tend to close this as the spec should be clear enough for this case. The test should be fixed. |
Yep, I didn't see that section. Looks like the canonical order should be specified in the individual specs, which for some properties isn't quite clear, e.g. for |
See w3c/csswg-drafts#2509 (comment) for the change to target9. Also remove the extra whitespace in target8 and target1 which causes these tests to fail in Chrome and Firefox. Also remove testcase.propertyName from each test's name as this doesn't exist and just outputs undefined.
Yeah, in that case probably issues should be raised to the individual specs to make them specify the canonical order clearly. |
See w3c/csswg-drafts#2509 (comment) for the change to target9. Also remove the extra whitespace in target8 and target1 which causes these tests to fail in Chrome and Firefox. Also remove testcase.propertyName from each test's name as this doesn't exist and just outputs undefined.
…rty serialization, a=testonly Automatic update from web-platform-testsUpdate expected cssText for custom property serialization See w3c/csswg-drafts#2509 (comment) for the change to target9. Also remove the extra whitespace in target8 and target1 which causes these tests to fail in Chrome and Firefox. Also remove testcase.propertyName from each test's name as this doesn't exist and just outputs undefined. wpt-commits: d0d62244432d329aa22e9278d3e83184301c3e7f wpt-pr: 10353 wpt-commits: d0d62244432d329aa22e9278d3e83184301c3e7f wpt-pr: 10353
…rty serialization, a=testonly Automatic update from web-platform-testsUpdate expected cssText for custom property serialization See w3c/csswg-drafts#2509 (comment) for the change to target9. Also remove the extra whitespace in target8 and target1 which causes these tests to fail in Chrome and Firefox. Also remove testcase.propertyName from each test's name as this doesn't exist and just outputs undefined. wpt-commits: d0d62244432d329aa22e9278d3e83184301c3e7f wpt-pr: 10353 wpt-commits: d0d62244432d329aa22e9278d3e83184301c3e7f wpt-pr: 10353 UltraBlame original commit: 291cf72732db4c39939013dcf4376b0847c7965e
…rty serialization, a=testonly Automatic update from web-platform-testsUpdate expected cssText for custom property serialization See w3c/csswg-drafts#2509 (comment) for the change to target9. Also remove the extra whitespace in target8 and target1 which causes these tests to fail in Chrome and Firefox. Also remove testcase.propertyName from each test's name as this doesn't exist and just outputs undefined. wpt-commits: d0d62244432d329aa22e9278d3e83184301c3e7f wpt-pr: 10353 wpt-commits: d0d62244432d329aa22e9278d3e83184301c3e7f wpt-pr: 10353 UltraBlame original commit: 291cf72732db4c39939013dcf4376b0847c7965e
…rty serialization, a=testonly Automatic update from web-platform-testsUpdate expected cssText for custom property serialization See w3c/csswg-drafts#2509 (comment) for the change to target9. Also remove the extra whitespace in target8 and target1 which causes these tests to fail in Chrome and Firefox. Also remove testcase.propertyName from each test's name as this doesn't exist and just outputs undefined. wpt-commits: d0d62244432d329aa22e9278d3e83184301c3e7f wpt-pr: 10353 wpt-commits: d0d62244432d329aa22e9278d3e83184301c3e7f wpt-pr: 10353 UltraBlame original commit: 291cf72732db4c39939013dcf4376b0847c7965e
https://drafts.csswg.org/cssom/#serialize-a-css-declaration-block defines that shorthands should be considered in preferred order. However, it says no such thing for general longhands/properties, or how shorthands should be ordered with longhands.
This can lead to interoperability concerns, for example in https://wpt.fyi/css/css-variables/variable-cssText.html with the test of
target9
where Firefox/Chrome ordermargin-right
first but Edge ordersmargin-top
first.The text was updated successfully, but these errors were encountered: