diff options
author | Emilio Cobos Álvarez <emilio@crisal.io> | 2017-11-10 01:29:41 +0100 |
---|---|---|
committer | Emilio Cobos Álvarez <emilio@crisal.io> | 2017-11-10 20:47:37 +0100 |
commit | 5200ded17c2c5e7f5f5dd92d302350d0b5b396c6 (patch) | |
tree | d986deebc02e25de0e597102c17f3a23671c71c6 /components/script/dom/node.rs | |
parent | 6704122927be6f3627299260519cec1867a8ed3f (diff) | |
download | servo-5200ded17c2c5e7f5f5dd92d302350d0b5b396c6.tar.gz servo-5200ded17c2c5e7f5f5dd92d302350d0b5b396c6.zip |
script: Fix Servo relying on descendants being visited when there's a reframe.
Diffstat (limited to 'components/script/dom/node.rs')
-rw-r--r-- | components/script/dom/node.rs | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/components/script/dom/node.rs b/components/script/dom/node.rs index ff69e2ae2b3..b0f85b1ccfa 100644 --- a/components/script/dom/node.rs +++ b/components/script/dom/node.rs @@ -483,6 +483,19 @@ impl Node { self.flags.set(flags); } + // FIXME(emilio): This and the function below should move to Element. + pub fn note_dirty_descendants(&self) { + debug_assert!(self.is_in_doc()); + + for ancestor in self.inclusive_ancestors() { + if ancestor.get_flag(NodeFlags::HAS_DIRTY_DESCENDANTS) { + return; + } + + ancestor.set_flag(NodeFlags::HAS_DIRTY_DESCENDANTS, true); + } + } + pub fn has_dirty_descendants(&self) -> bool { self.get_flag(NodeFlags::HAS_DIRTY_DESCENDANTS) } @@ -2499,7 +2512,7 @@ impl VirtualMethods for Node { if let Some(list) = self.child_list.get() { list.as_children_list().children_changed(mutation); } - self.owner_doc().content_and_heritage_changed(self, NodeDamage::OtherNodeDamage); + self.owner_doc().content_and_heritage_changed(self); } // This handles the ranges mentioned in steps 2-3 when removing a node. |