mirror of
https://github.com/servo/servo.git
synced 2025-08-07 14:35:33 +01:00
style: Invalidate parts in nested shadow trees correctly.
Differential Revision: https://phabricator.services.mozilla.com/D54010
This commit is contained in:
parent
e3009a4de9
commit
f8ceb5cb84
6 changed files with 104 additions and 43 deletions
|
@ -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 {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue