mirror of
https://github.com/servo/servo.git
synced 2025-07-23 07:13:52 +01:00
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:
parent
9972aee81f
commit
8a0775fc89
5 changed files with 8 additions and 48 deletions
|
@ -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()
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue