blob: f7eef38acf159f031769689cdd91149ea2e98cd6 [file] [log] [blame]
<!DOCTYPE html>
<link id="sheet" href="doesnotexist.css" rel="stylesheet">
<p>Bug 377724: Don't crash when calling into layout on a detached document.</p>
<div id="first"></div>
<iframe id="iframe"></iframe>
<script>
onload = function() {
if (window.testRunner)
testRunner.dumpAsText();
var iframeDocument = iframe.contentDocument;
// Need to use link elements in this test to create placeholder styles so
// we'll go into the Force case inside updateLayoutIgnorePendingStylesheets.
var link = document.createElement("link");
link.href = "doesnotexist.css";
link.rel = "stylesheet";
document.getElementById("first").appendChild(document.getElementById("sheet"));
iframeDocument.replaceChild(link, iframeDocument.documentElement);
document.body.offsetTop;
iframe.remove();
iframeDocument.firstChild.offsetTop;
}
</script>