Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tokenizer_state_for_context_elem should use scripting flag of the context element, not the parser #579

Open
simonwuelker opened this issue Mar 9, 2025 · 1 comment

Comments

@simonwuelker
Copy link
Contributor

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.

local_name!("noscript") => {
if self.opts.scripting_enabled {
tok_state::RawData(tok_state::Rawtext)
} else {
tok_state::Data
}
},

This causes a failure in /html/syntax/parsing-html-fragments/tokenizer-modes-001.html.

For context, see servo/servo#35848.

@jdm
Copy link
Member

jdm commented Mar 9, 2025

We always set the parser's scripting flag to true, which probably has an impact here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants