Don't run scripts in documents that don't have a browsing context (#35871)

* Don't run scripts in document that don't have a browsing context

For confirmation that this is correct, refer to the note under
Step 3 of https://html.spec.whatwg.org/multipage/dynamic-markup-insertion.html#dom-domparser-parsefromstring.

Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>

* Update WPT expectations

Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>

---------

Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>
This commit is contained in:
Simon Wülker 2025-03-10 17:34:09 +01:00 committed by GitHub
parent 1200617683
commit ccd4b113a8
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 8 additions and 3 deletions

View file

@ -56,6 +56,7 @@ impl Tokenizer {
let options = TreeBuilderOpts {
ignore_missing_rules: true,
scripting_enabled: document.has_browsing_context(),
..Default::default()
};