Kill ServoLayoutElement::note_dirty_descendant

There is no need to set the dirty descendants flag unsafely from the layout side
for elements with pending restyles, we can do that on the DOM side when draining
the restyles from the Document.
This commit is contained in:
Anthony Ramine 2020-04-04 14:39:53 +02:00
parent 9972aee81f
commit 8a0775fc89
5 changed files with 8 additions and 48 deletions

View file

@ -3587,8 +3587,14 @@ impl Document {
self.pending_restyles
.borrow_mut()
.drain()
.filter(|(k, _)| k.upcast::<Node>().get_flag(NodeFlags::IS_CONNECTED))
.map(|(k, v)| (k.upcast::<Node>().to_trusted_node_address(), v))
.filter_map(|(elem, restyle)| {
let node = elem.upcast::<Node>();
if !node.get_flag(NodeFlags::IS_CONNECTED) {
return None;
}
node.note_dirty_descendants();
Some((node.to_trusted_node_address(), restyle))
})
.collect()
}
}