diff options
author | Martin Robinson <mrobinson@igalia.com> | 2020-01-20 13:54:23 +0100 |
---|---|---|
committer | Martin Robinson <mrobinson@igalia.com> | 2020-01-21 15:29:23 +0100 |
commit | 27e04008918acb939eeef74e1eb535d564b5f692 (patch) | |
tree | 589c9142979a290356ff050723c43a5393303264 | |
parent | 8825d588c14ba6a72fdad4ec5ae67c7b4397daf1 (diff) | |
download | servo-27e04008918acb939eeef74e1eb535d564b5f692.tar.gz servo-27e04008918acb939eeef74e1eb535d564b5f692.zip |
Fix an issue with `unset_boxes_in_subtree` in layout_2020
If the root node of the subtree doesn't have any boxes to unset, we
should exit early instead of unsetting boxes on siblings of the root.
This eliminates an infinite loop in this method, since the siblings of
the root are not in the subtree.
-rw-r--r-- | components/layout_2020/dom_traversal.rs | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/components/layout_2020/dom_traversal.rs b/components/layout_2020/dom_traversal.rs index 5ccf8310d53..9d8f54f057e 100644 --- a/components/layout_2020/dom_traversal.rs +++ b/components/layout_2020/dom_traversal.rs @@ -426,8 +426,13 @@ where node = child; continue; } + } else if node == self { + // If this is the root of the subtree and we aren't descending + // into our children return now. + return; } } + let mut next_is_a_sibling_of = node; node = loop { if let Some(sibling) = next_is_a_sibling_of.next_sibling() { |