gngr icon indicating copy to clipboard operation
gngr copied to clipboard

style nodes get processed twice

Open hrj opened this issue 9 years ago • 0 comments

Our HTML parser first appends the style node to the DOM, then appends its child nodes to the style node.

The style node gets an "attached-to-DOM" event and then a "child-list-changed" event. This causes the CSS to be parsed twice.

The simplest fix for this would be to detect the case of missing child-nodes and create an empty stylesheet directly.

A more sophisticated solution would avoid any duplicate processing. For eample, by inform the style node that parsing is incomplete when it is first attached to the DOM.

hrj avatar May 26 '16 17:05 hrj