Skip to content

Commit

Permalink
Fix an issue with unset_boxes_in_subtree in layout_2020
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
mrobinson committed Jan 21, 2020
1 parent 8825d58 commit 27e0400
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions components/layout_2020/dom_traversal.rs
Expand Up @@ -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() {
Expand Down

0 comments on commit 27e0400

Please sign in to comment.