Re: [csswg-drafts] [cssom] How safe is it really to shorthandify properties? (#8398)

> So this is nothing new. So, any changes to CSSOM should take that into account. An API change like adding shorthands to the enumeration might break some logic. Admittedly, the risk for that is probably very low, though it should be considered, nonetheless.

Actually this seems fairly risky, both performance-wise and breakage-wise.

If we keep the enumeration order alphabetic, there's a chance that a shorthand is enumerated after its longhands, and serializes as the empty string. So something like a loop calling `setPropertyValue(prop, value)` deletes all the shorthand's properties already set. Unless you enumerate shorthands before longhands, but then you're back at square one.

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


-- 
Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config

Received on Sunday, 5 February 2023 08:36:56 UTC