Skip to content

HTML parser parses inline scripts/stylesheets line by line #34502

@jdm

Description

@jdm

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-content/parsersRelated to parsing HTML and XMLI-perf-slowUnnecessary performance degredation.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions