diff options
Diffstat (limited to 'components/style/invalidation/element/element_wrapper.rs')
-rw-r--r-- | components/style/invalidation/element/element_wrapper.rs | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/components/style/invalidation/element/element_wrapper.rs b/components/style/invalidation/element/element_wrapper.rs index e17e42a31c0..bc74527bf16 100644 --- a/components/style/invalidation/element/element_wrapper.rs +++ b/components/style/invalidation/element/element_wrapper.rs @@ -62,6 +62,12 @@ pub trait ElementSnapshot: Sized { /// called if `has_attrs()` returns true. fn is_part(&self, name: &Atom) -> bool; + /// See Element::exported_part. + fn exported_part(&self, name: &Atom) -> Option<Atom>; + + /// See Element::imported_part. + fn imported_part(&self, name: &Atom) -> Option<Atom>; + /// A callback that should be called for each class of the snapshot. Should /// only be called if `has_attrs()` returns true. fn each_class<F>(&self, _: F) @@ -366,13 +372,17 @@ where } fn exported_part(&self, name: &Atom) -> Option<Atom> { - // FIXME(emilio): Implement for proper invalidation. - self.element.exported_part(name) + match self.snapshot() { + Some(snapshot) if snapshot.has_attrs() => snapshot.exported_part(name), + _ => self.element.exported_part(name), + } } fn imported_part(&self, name: &Atom) -> Option<Atom> { - // FIXME(emilio): Implement for proper invalidation. - self.element.imported_part(name) + match self.snapshot() { + Some(snapshot) if snapshot.has_attrs() => snapshot.imported_part(name), + _ => self.element.imported_part(name), + } } fn has_class(&self, name: &Atom, case_sensitivity: CaseSensitivity) -> bool { |