Open jdm opened 3 months ago
This specifically comes from:
<html>
element to the iframe's content document<iframe></iframe>
<script>
let i = document.querySelector('iframe');
i.contentDocument.open();
i.contentDocument.appendChild(i.contentDocument.createElement("html"));
i.contentDocument.close();
</script>
The same panic occurs in css/css-transitions/dynamic-root-element.html.
It looks like this is caused by: https://github.com/servo/servo/blob/d44c0f7e5dd9952506dfc491975cc84d7dac111a/components/script/dom/servoparser/mod.rs#L1015
but only when you try to appendChild
and html element:
// quirks.window.js
const html = frame.contentDocument.appendChild(frame.contentDocument.createElement("html"));
// dynamic-root-element.html.
let root = doc.createElement("html");
doc.appendChild(root);
``
I don't know if the kind of element matters, but appending to the document root when there's already a root element is the trigger.
To reproduce:
./mach test-wpt tests/wpt/tests/html/webappapis/dynamic-markup-insertion/opening-the-input-stream/quirks.window.js
Backtrace: