undom icon indicating copy to clipboard operation
undom copied to clipboard

"elem.attributes" should include "style" attribute

Open feross opened this issue 8 years ago • 3 comments

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?

feross avatar Aug 23 '17 08:08 feross

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.

developit avatar Jan 22 '18 21:01 developit

@developit I think that would work for me.

feross avatar Jan 27 '18 02:01 feross

Would help cut down on size too!

developit avatar Jan 29 '18 20:01 developit