mirror of
https://github.com/servo/servo.git
synced 2025-08-06 14:10:11 +01:00
style: Support multiple parts in ::part() selectors.
Differential Revision: https://phabricator.services.mozilla.com/D48753
This commit is contained in:
parent
f701192e38
commit
7965ddefa6
3 changed files with 30 additions and 15 deletions
|
@ -2032,11 +2032,17 @@ impl CascadeData {
|
|||
// Part is special, since given it doesn't have any
|
||||
// selectors inside, it's not worth using a whole
|
||||
// SelectorMap for it.
|
||||
if let Some(part) = selector.part() {
|
||||
if let Some(parts) = selector.parts() {
|
||||
// ::part() has all semantics, so we just need to
|
||||
// put any of them in the selector map.
|
||||
//
|
||||
// We choose the last one quite arbitrarily,
|
||||
// expecting it's slightly more likely to be more
|
||||
// specific.
|
||||
self.part_rules
|
||||
.get_or_insert_with(|| Box::new(Default::default()))
|
||||
.for_insertion(pseudo_element)
|
||||
.try_entry(part.clone())?
|
||||
.try_entry(parts.last().unwrap().clone())?
|
||||
.or_insert_with(SmallVec::new)
|
||||
.try_push(rule)?;
|
||||
} else {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue