CSSOM
CSSOM copied to clipboard
Expand shortcut properties
Browsers mostly store longhand properties rather than shortcuts. When you write background: rgb(40, 40, 40) WebKit stores it as
style:
0: "background-image"
1: "background-repeat-x"
2: "background-repeat-y"
3: "background-attachment"
4: "background-position-x"
5: "background-position-y"
6: "background-origin"
7: "background-clip"
8: "background-color"
And that's how Firefox stores it:
style:
0: "background-color"
1: "background-image"
2: "background-repeat"
3: "background-attachment"
4: "background-position"
5: "background-clip"
6: "background-origin"
7: "background-size"
The differences are just about in every property. I'll probably stick to WebKit implementation.
Agreed, i find it more explicit and useful
Could the expansion be an optional feature? I'm using CSSOM to perform some specific manipulations on other people's CSS, and if they used the "background" shorthand they probably meant it and wouldn't like it to be expanded to the 8 background-* properties.
Yes, it will be configurable.
I'd be interested in this feature, as I need to manipulate the background-image url, independent of whether it is encapsulated in a broad background statement or not. For now that's possibly the biggest showstopper for me when moving away from JSCSSP.