mirror of
https://github.com/servo/servo.git
synced 2025-08-01 11:40:30 +01:00
Allow the style bloom filter to recover from switch to a node with no common ancestor with the old node.
This commit is contained in:
parent
07a3e9b226
commit
68af62f15f
1 changed files with 16 additions and 2 deletions
|
@ -214,11 +214,25 @@ impl StyleBloom {
|
|||
//
|
||||
// Not-so-happy case: Parent's don't match, so we need to keep going up
|
||||
// until we find a common ancestor.
|
||||
//
|
||||
// Gecko currently models native anonymous content that conceptually hangs
|
||||
// off the document (such as scrollbars) as a separate subtree from the
|
||||
// document root. Thus it's possible with Gecko that we do not find any
|
||||
// common ancestor.
|
||||
while *self.elements.last().unwrap() != common_parent.as_node().to_unsafe() {
|
||||
parents_to_insert.push(common_parent);
|
||||
common_parent =
|
||||
common_parent.parent_element().expect("We were lied again?");
|
||||
self.pop::<E>().unwrap();
|
||||
common_parent = match common_parent.parent_element() {
|
||||
Some(parent) => parent,
|
||||
None => {
|
||||
debug_assert!(self.elements.is_empty());
|
||||
if cfg!(feature = "gecko") {
|
||||
break;
|
||||
} else {
|
||||
panic!("should have found a common ancestor");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Now the parents match, so insert the stack of elements we have been
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue