diff options
author | Emilio Cobos Álvarez <emilio@crisal.io> | 2019-11-21 10:32:10 +0000 |
---|---|---|
committer | Emilio Cobos Álvarez <emilio@crisal.io> | 2019-11-30 20:45:03 +0100 |
commit | f8ceb5cb8409f434ec4acec8ab9c186bea45bcbe (patch) | |
tree | 53a411befd1ed157af6d2126f88991b25f5e1a8a /components/style/invalidation/element/element_wrapper.rs | |
parent | e3009a4de9186c648c0a3beef4fdde6ce66b1a3b (diff) | |
download | servo-f8ceb5cb8409f434ec4acec8ab9c186bea45bcbe.tar.gz servo-f8ceb5cb8409f434ec4acec8ab9c186bea45bcbe.zip |
style: Invalidate parts in nested shadow trees correctly.
Differential Revision: https://phabricator.services.mozilla.com/D54010
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 { |