style: Don't support a list of selectors in ::slotted yet.

Bug: 1425757
Reviewed-by: xidorn
MozReview-Commit-ID: G0I0gM2sWTh
This commit is contained in:
Emilio Cobos Álvarez 2017-12-17 18:45:51 +01:00
parent c2cacb69f3
commit b556ddbf55
No known key found for this signature in database
GPG key ID: 056B727BB9C1027C
3 changed files with 66 additions and 39 deletions

View file

@ -415,6 +415,25 @@ fn specific_bucket_for<'a>(
lower_name: &selector.lower_name,
}
}
// ::slotted(..) isn't a normal pseudo-element, so we can insert it on
// the rule hash normally without much problem. For example, in a
// selector like:
//
// div::slotted(span)::before
//
// It looks like:
//
// [
// LocalName(div),
// Combinator(SlotAssignment),
// Slotted(span),
// Combinator::PseudoElement,
// PseudoElement(::before),
// ]
//
// So inserting `span` in the rule hash makes sense since we want to
// match the slotted <span>.
Component::Slotted(ref selector) => find_bucket(selector.iter()),
_ => Bucket::Universal
}
}