esrille / escudo

The Escudo Web Browser
Apache License 2.0
68 stars 13 forks source link

[HTML] Fix the timing to trigger mutation events from the HTML parser. #48

Closed ShikiOkasaka closed 11 years ago

ShikiOkasaka commented 11 years ago

Since 739eaac16c4f69ee1681c8030298d67b665501d2, a DOMCharacterDataModified event is triggered for each character which is just parsed and inserted to a DOM node. It should be just one event at the end of a sequence of characters within a node.

In practice, what we'd need is a single DOMNodeInserted event for a Text node instead of a DOMNodeInserted event followed by a sequence of DOMCharacterDataModified events.

ShikiOkasaka commented 11 years ago

Probably using the suppress observers flag specified in the DOM Standard would be the right way to do this. cf. http://dom.spec.whatwg.org/#concept-node-insert

ShikiOkasaka commented 11 years ago

Fixed at 3abd2494e069d7c965b88b47b4b96962a963986c. The fix actually does not suppress redundant mutation events but simply adds a text node with the full text data at once.