mirror of
https://github.com/servo/servo.git
synced 2025-08-06 14:10:11 +01:00
style: Add parsing support for ::part().
Disabled for now of course. This should be pretty uncontroversial I'd think. Differential Revision: https://phabricator.services.mozilla.com/D28060
This commit is contained in:
parent
9f73576f6a
commit
a23ad3be50
10 changed files with 106 additions and 17 deletions
|
@ -340,6 +340,10 @@ where
|
|||
}
|
||||
}
|
||||
|
||||
fn is_part(&self, _name: &Atom) -> bool {
|
||||
unimplemented!();
|
||||
}
|
||||
|
||||
fn has_class(&self, name: &Atom, case_sensitivity: CaseSensitivity) -> bool {
|
||||
match self.snapshot() {
|
||||
Some(snapshot) if snapshot.has_attrs() => snapshot.has_class(name, case_sensitivity),
|
||||
|
|
|
@ -98,6 +98,7 @@ impl Dependency {
|
|||
// an eager pseudo, and return only Descendants here if not.
|
||||
Some(Combinator::PseudoElement) => DependencyInvalidationKind::ElementAndDescendants,
|
||||
Some(Combinator::SlotAssignment) => DependencyInvalidationKind::SlottedElements,
|
||||
Some(Combinator::Part) => unimplemented!("Need to add invalidation for shadow parts"),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -158,7 +158,10 @@ impl<'a> Invalidation<'a> {
|
|||
// We should be able to do better here!
|
||||
match self.selector.combinator_at_parse_order(self.offset - 1) {
|
||||
Combinator::Descendant | Combinator::LaterSibling | Combinator::PseudoElement => true,
|
||||
Combinator::SlotAssignment | Combinator::NextSibling | Combinator::Child => false,
|
||||
Combinator::Part |
|
||||
Combinator::SlotAssignment |
|
||||
Combinator::NextSibling |
|
||||
Combinator::Child => false,
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -171,6 +174,9 @@ impl<'a> Invalidation<'a> {
|
|||
Combinator::Child | Combinator::Descendant | Combinator::PseudoElement => {
|
||||
InvalidationKind::Descendant(DescendantInvalidationKind::Dom)
|
||||
},
|
||||
Combinator::Part => {
|
||||
unimplemented!("Need to add invalidation for shadow parts");
|
||||
},
|
||||
Combinator::SlotAssignment => {
|
||||
InvalidationKind::Descendant(DescendantInvalidationKind::Slotted)
|
||||
},
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue