mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-05-14 07:02:54 +00:00
The specification says the final step of this algorithm is to return null. Previously, the browser would crash if the content of an iframe was appended to the document before its offsetParent property was queried.
22 lines
746 B
HTML
22 lines
746 B
HTML
<!DOCTYPE html>
|
|
<script src="include.js"></script>
|
|
<script>
|
|
function offsetParentOfChildDocument() {
|
|
const frameDocument = document.querySelector("iframe").contentDocument;
|
|
const frameRoot = frameDocument.documentElement;
|
|
document.documentElement.append(frameRoot);
|
|
document.dispatchEvent(new CustomEvent("offsetParentCalled", { detail: { iframeOffsetParent: frameRoot.offsetParent }}));
|
|
}
|
|
|
|
asyncTest(done => {
|
|
document.addEventListener("offsetParentCalled", event => {
|
|
println(`iframe offsetParent value: ${event.detail.iframeOffsetParent}`);
|
|
done();
|
|
});
|
|
});
|
|
</script>
|
|
<iframe srcdoc="
|
|
<script>
|
|
window.parent.offsetParentOfChildDocument();
|
|
</script>
|
|
">
|