mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-05-14 15:13:07 +00:00
I previously believed there was no way a detached document should have layout information, but it turns out there is a way: getComputedStyle(). So we need to account for cases where we have a layout node, but no navigable, since that is a state we can get into at this moment. Fixes #354
16 lines
604 B
HTML
16 lines
604 B
HTML
<script src="../include.js"></script>
|
|
<script>
|
|
test(() => {
|
|
let doc = document.implementation.createHTMLDocument();
|
|
let div = doc.createElement("div");
|
|
doc.body.appendChild(div);
|
|
|
|
// NOTE: We do a getComputedStyle() to trick the document into doing some style/layout work.
|
|
// In the future, we may optimize away some of this work, which would potentially
|
|
// make the test not work as intended anymore.
|
|
println(getComputedStyle(div));
|
|
|
|
println(div.getClientRects());
|
|
println("PASS (didn't crash)");
|
|
});
|
|
</script>
|