Re: [csswg-drafts] [cssom] We may not want .setProperty() to change the order if it's setting an identical value to an existing declaration

The problem isn't only with variable properties, nor only with the order in which things are defined in the array. An amazing example: https://wptest.center/#/w1gw11

So this is just a mess. 

Here is how we currently do things in Edge and how I plan to potentially extend things in the future at the moment: 
- Properties are always serialized in the same order, regardless of their order in the array (margin always before padding, etc...)
- All the logical properties we will add will be shadowed under a fully-encompassing shorthand (e.g. "margin"), and serialization of all the longhands associated to this shorthand (e.g. "margin-top" and "margin-block-start") will always happen at the location where that full shorthand would be serialized if it could be. Their relative order will be preserved (is "margin-top" before or after "margin-block-start") but not their order in the full sequence (is "padding-top" before "margin-top").

This way we should limit the style attribute changed notification to a minimum while preserving correctness. Whether our implementation actually stores the full order or not doesn't matter because the serialization step normalizes that order away where it doesn't matter.

-- 
GitHub Notification of comment by FremyCompany
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/2667#issuecomment-388261583 using your GitHub account

Received on Friday, 11 May 2018 05:12:37 UTC