developit / undom

🍩 1kb minimally viable DOM Document implementation
https://npm.im/undom
MIT License
668 stars 25 forks source link

"elem.attributes" should include "style" attribute #11

Open feross opened 7 years ago

feross commented 7 years ago

Currently, elem.attributes does not include the style attribute since that's stored as a separate object. See: https://github.com/developit/undom/blob/master/src/undom.js#L93-L95

This differs from my expectations. It also means that the provided serializeHtml() function doesn't include inline styles without modification.

Update: also, elem.style.cssText returns an object when a string is expected. Is this level of DOM compliance out-of-scope for undom or is this a reasonable expectation?

developit commented 6 years ago

Whoops, this slipped through the cracks.

I think it would make most sense for undom to treat style as a non-special attribute like any other.

feross commented 6 years ago

@developit I think that would work for me.

developit commented 6 years ago

Would help cut down on size too!