style: Handle correctly document state invalidation inside negation.

This commit is contained in:
Emilio Cobos Álvarez 2018-01-18 14:47:30 +01:00
parent bccb757bcd
commit e74fad6259
No known key found for this signature in database
GPG key ID: 056B727BB9C1027C
3 changed files with 32 additions and 3 deletions

View file

@ -625,6 +625,8 @@ where
E: Element,
F: FnMut(&E, ElementSelectorFlags),
{
debug_assert!(context.shared.is_nested() || !context.shared.in_negation());
match *selector {
Component::Combinator(_) => unreachable!(),
Component::Slotted(ref selector) => {
@ -777,7 +779,7 @@ where
matches_generic_nth_child(element, context, 0, 1, true, true, flags_setter)
}
Component::Negation(ref negated) => {
context.shared.nest(|context| {
context.shared.nest_for_negation(|context| {
let mut local_context = LocalMatchingContext {
matches_hover_and_active_quirk: MatchesHoverAndActiveQuirk::No,
shared: context,