aboutsummaryrefslogtreecommitdiffstats
path: root/components/style/invalidation/element/element_wrapper.rs
diff options
context:
space:
mode:
authorEmilio Cobos Álvarez <emilio@crisal.io>2019-11-21 10:32:10 +0000
committerEmilio Cobos Álvarez <emilio@crisal.io>2019-11-30 20:45:03 +0100
commitf8ceb5cb8409f434ec4acec8ab9c186bea45bcbe (patch)
tree53a411befd1ed157af6d2126f88991b25f5e1a8a /components/style/invalidation/element/element_wrapper.rs
parente3009a4de9186c648c0a3beef4fdde6ce66b1a3b (diff)
downloadservo-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.rs18
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 {