mirror of
https://github.com/servo/servo.git
synced 2025-08-06 22:15:33 +01:00
Support HTML parser reentrancy (#32820)
* Update parser interface for reentrancy. Signed-off-by: Josh Matthews <josh@joshmatthews.net> * Remove assertions around invoking scripts with active parser. Signed-off-by: Josh Matthews <josh@joshmatthews.net> * Add regression test. Signed-off-by: Josh Matthews <josh@joshmatthews.net> * Run test with normal and async html parser. Signed-off-by: Josh Matthews <josh@joshmatthews.net> --------- Signed-off-by: Josh Matthews <josh@joshmatthews.net>
This commit is contained in:
parent
d44c0f7e5d
commit
4df7a1af25
13 changed files with 248 additions and 211 deletions
33
tests/wpt/mozilla/meta/MANIFEST.json
vendored
33
tests/wpt/mozilla/meta/MANIFEST.json
vendored
|
@ -13776,6 +13776,39 @@
|
|||
{}
|
||||
]
|
||||
],
|
||||
"parser-reentrancy-customelement.window.js": [
|
||||
"0df997aa6c521ef31c32c4054568ed005e011663",
|
||||
[
|
||||
"mozilla/parser-reentrancy-customelement.window.html?async",
|
||||
{
|
||||
"script_metadata": [
|
||||
[
|
||||
"variant",
|
||||
"?default"
|
||||
],
|
||||
[
|
||||
"variant",
|
||||
"?async"
|
||||
]
|
||||
]
|
||||
}
|
||||
],
|
||||
[
|
||||
"mozilla/parser-reentrancy-customelement.window.html?default",
|
||||
{
|
||||
"script_metadata": [
|
||||
[
|
||||
"variant",
|
||||
"?default"
|
||||
],
|
||||
[
|
||||
"variant",
|
||||
"?async"
|
||||
]
|
||||
]
|
||||
}
|
||||
]
|
||||
],
|
||||
"partial_shadow_dom.html": [
|
||||
"74e308f94036a6dbf5c4223cd3d229f49ffceb4e",
|
||||
[
|
||||
|
|
6
tests/wpt/mozilla/meta/mozilla/parser-reentrancy-customelement.window.js.ini
vendored
Normal file
6
tests/wpt/mozilla/meta/mozilla/parser-reentrancy-customelement.window.js.ini
vendored
Normal file
|
@ -0,0 +1,6 @@
|
|||
[parser-reentrancy-customelement.window.html?default]
|
||||
prefs: ["dom.servoparser.async_html_tokenizer.enabled:false"]
|
||||
|
||||
[parser-reentrancy-customelement.window.html?async]
|
||||
expected: CRASH
|
||||
prefs: ["dom.servoparser.async_html_tokenizer.enabled:true"]
|
22
tests/wpt/mozilla/tests/mozilla/parser-reentrancy-customelement.window.js
vendored
Normal file
22
tests/wpt/mozilla/tests/mozilla/parser-reentrancy-customelement.window.js
vendored
Normal file
|
@ -0,0 +1,22 @@
|
|||
// META: variant=?default
|
||||
// META: variant=?async
|
||||
|
||||
let script = "\
|
||||
class PopupInfo extends HTMLElement { \
|
||||
connectedCallback() { \
|
||||
frameElement.globalTest.step_timeout(() => frameElement.globalTest.done(), 0); \
|
||||
document.open(); \
|
||||
document.write('did not panic'); \
|
||||
document.close(); \
|
||||
} \
|
||||
} \
|
||||
\
|
||||
customElements.define('popup-info', PopupInfo); \
|
||||
";
|
||||
|
||||
async_test(function(t) {
|
||||
let iframe = document.createElement('iframe');
|
||||
iframe.globalTest = t;
|
||||
iframe.srcdoc = "<script>" + script + "<" + "/script><popup-info></popup-info>";
|
||||
document.body.appendChild(iframe);
|
||||
}, "Dynamic markup insertion during custom element callbacks does not panic");
|
Loading…
Add table
Add a link
Reference in a new issue