html5ever
html5ever copied to clipboard
`tokenizer_state_for_context_elem` should use scripting flag of the context element, not the parser
When determining the initial tokenizer state during fragment parsing for a noscript element we should use the scripting flag of the noscript element, not that of the fragment parser. Scripting is always disabled in the fragment parsing case, because the DocumentFragment never has a browsing context.
https://github.com/servo/html5ever/blob/6b3601add6f18389092759b3069c5facce6a7912/html5ever/src/tree_builder/mod.rs#L252-L258
This causes a failure in /html/syntax/parsing-html-fragments/tokenizer-modes-001.html.
For context, see https://github.com/servo/servo/pull/35848.
We always set the parser's scripting flag to true, which probably has an impact here.