Don't run scripts in documents that don't have a browsing context#35848
Don't run scripts in documents that don't have a browsing context#35848simonwuelker wants to merge 1 commit intoservo:mainfrom
Conversation
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>
|
🔨 Triggering try run (#13724581632) for Linux (WPT) |
|
Test results for linux-wpt-layout-2020 from try job (#13724581632): Flaky unexpected result (22)
Stable unexpected results that are known to be intermittent (15)
Stable unexpected results (2)
|
|
|
|
I'm not sure whether that is a bug in our parsing code or whether this change is wrong as a whole. I'll close this until I figure out where exactly in the spec it says that scripts outside browsing contexts should not be run. |
|
Odd, https://html.spec.whatwg.org/multipage/parsing.html#concept-frag-parse-context clearly says that when the context element is a |
|
Aha! Ladybird uses the scripting flag of the context element when parsing html fragments 1, we mistakenly use the scripting flag of the parser 2. That makes sense, because the I'll mark this test case as a failure for now, as it seems clear to me that the bug is in html5ever. Footnotes |
|
#35478 may be relevant. |
Yeah right now scripting is always enabled. With this change it is disabled when parsing outside of a browsing context, which exposes servo/html5ever#579. |
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.
./mach build -ddoes not report any errors./mach test-tidydoes not report any errors