NV / CSSOM

Unmaintained! ⚠️ CSS Object Model implemented in pure JavaScript. Also, a CSS parser.
https://nv.github.io/CSSOM/docs/parse.html
MIT License
752 stars 98 forks source link

Support duplicate properties #43

Closed rstacruz closed 12 years ago

rstacruz commented 12 years ago

This is useful in sheets that use CSS3, say for example this:

div {
  background: -moz-linear-gradient(x);
  background: -webkit-linear-gradient(x);
  background: linear-gradient(x);
}

Gets you this styles structure:

{ '0': 'background',
  length: 1,
  parentRule: 
   { parentRule: null,
     parentStyleSheet: { parentStyleSheet: null, cssRules: [Object] },
     selectorText: 'div',
     style: [Circular],
     __starts: 0,
     __ends: 122 },
  _importants: { background: '' },
  __starts: 4,
  background: 'linear-gradient(x)' }

...which is less than ideal. Notice that the length is 1 and that the only background it knows about is the last one.

rstacruz commented 12 years ago

Oops, dupe of #16. Sorry.