CSSOM icon indicating copy to clipboard operation
CSSOM copied to clipboard

Expand shortcut properties

Open NV opened this issue 15 years ago • 4 comments
trafficstars

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.

NV avatar Oct 26 '10 16:10 NV

Agreed, i find it more explicit and useful

Inviz avatar Oct 27 '10 01:10 Inviz

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.

papandreou avatar Feb 28 '11 23:02 papandreou

Yes, it will be configurable.

NV avatar Mar 01 '11 13:03 NV

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.

cburgmer avatar Oct 10 '12 21:10 cburgmer