mirror of
https://github.com/servo/servo.git
synced 2025-08-05 13:40:08 +01:00
style: Skip state pseudo-classes when finding a pseudo-element.
Bug: 1391577 Reviewed-by: heycam MozReview-Commit-ID: 1ICBijtcf2b
This commit is contained in:
parent
c1b196b7cb
commit
9e0dd19e7e
1 changed files with 14 additions and 1 deletions
|
@ -595,14 +595,27 @@ impl<'a, 'b: 'a, E> TreeStyleInvalidator<'a, 'b, E>
|
|||
matched = true;
|
||||
|
||||
if matches!(next_combinator, Combinator::PseudoElement) {
|
||||
// This will usually be the very next component, except for
|
||||
// the fact that we store compound selectors the other way
|
||||
// around, so there could also be state pseudo-classes.
|
||||
let pseudo_selector =
|
||||
invalidation.selector
|
||||
.iter_raw_parse_order_from(next_combinator_offset - 1)
|
||||
.skip_while(|c| matches!(**c, Component::NonTSPseudoClass(..)))
|
||||
.next()
|
||||
.unwrap();
|
||||
|
||||
let pseudo = match *pseudo_selector {
|
||||
Component::PseudoElement(ref pseudo) => pseudo,
|
||||
_ => unreachable!("Someone seriously messed up selector parsing"),
|
||||
_ => {
|
||||
unreachable!(
|
||||
"Someone seriously messed up selector parsing: \
|
||||
{:?} at offset {:?}: {:?}",
|
||||
invalidation.selector,
|
||||
next_combinator_offset,
|
||||
pseudo_selector,
|
||||
)
|
||||
}
|
||||
};
|
||||
|
||||
// FIXME(emilio): This is not ideal, and could not be
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue