diff options
author | Anthony Ramine <nox@nox.paris> | 2020-04-04 14:39:53 +0200 |
---|---|---|
committer | Anthony Ramine <nox@nox.paris> | 2020-04-04 15:00:04 +0200 |
commit | 8a0775fc8906a796668d68f85543ff9613eac7fd (patch) | |
tree | d4cba76dd0c0545a98ff37085875ecf52dcd60db /components/script | |
parent | 9972aee81f0e80d34157325a5e13b3b1a7ef417a (diff) | |
download | servo-8a0775fc8906a796668d68f85543ff9613eac7fd.tar.gz servo-8a0775fc8906a796668d68f85543ff9613eac7fd.zip |
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.
Diffstat (limited to 'components/script')
-rw-r--r-- | components/script/dom/document.rs | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/components/script/dom/document.rs b/components/script/dom/document.rs index 8e05be1fb11..2d0f2ce1c26 100644 --- a/components/script/dom/document.rs +++ b/components/script/dom/document.rs @@ -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() } } |