Skip to content

Commit 5d04d09

Browse files
mrobinsonservo-wpt-sync
authored andcommitted
layout: Do not assume layout data structures exist during queries
Data structures, such as the fragment tree and and stacking context tree, might not exist even after a layout if there is no root element. This change makes it so that the code stops asusming they exist. This does expose us to cases where logic errors may mean we try to run a script query without running the appropriate phase of layout first, but that is better than panicking. Signed-off-by: Martin Robinson <mrobinson@igalia.com>
1 parent 61688e1 commit 5d04d09

1 file changed

Lines changed: 10 additions & 0 deletions

File tree

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
<!DOCTYPE html>
2+
<link rel="help" href="https://github.com/servo/servo/issues/44536">
3+
<span id="span"></span>
4+
<script>
5+
var span = document.getElementById("span");
6+
document.documentElement.remove();
7+
span.offsetHeight;
8+
</script>
9+
10+

0 commit comments

Comments
 (0)