html5ever produces tokens for each line of inline content, and invokes the tree builder sink's append callback with the new text data. This ends up finding an existing CharacterData node to append to and appending the new line's contents to the existing data, which calls into the children_updated callback for the parent node. This can be a significant amount of unnecessary work for multiline scripts/stylesheets, and it would be more efficient to buffer all the text lines and update the CharacterData value once at the end.
html5ever produces tokens for each line of inline content, and invokes the tree builder sink's
appendcallback with the new text data. This ends up finding an existing CharacterData node to append to and appending the new line's contents to the existing data, which calls into thechildren_updatedcallback for the parent node. This can be a significant amount of unnecessary work for multiline scripts/stylesheets, and it would be more efficient to buffer all the text lines and update the CharacterData value once at the end.