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

@ -2111,7 +2111,7 @@ impl<'le> ::selectors::Element for GeckoElement<'le> {
NonTSPseudoClass::MozWindowInactive => {
let state_bit = DocumentState::NS_DOCUMENT_STATE_WINDOW_INACTIVE;
if context.extra_data.document_state.intersects(state_bit) {
return true;
return !context.in_negation();
}
self.document_state().contains(state_bit)
@ -2132,7 +2132,7 @@ impl<'le> ::selectors::Element for GeckoElement<'le> {
if context.extra_data.document_state.intersects(state_bit) {
// NOTE(emilio): We could still return false for
// Direction::Other(..), but we don't bother.
return true;
return !context.in_negation();
}
let doc_is_rtl = self.document_state().contains(state_bit);