style: Simplify :dir() implementation

This I noticed while working on the following patches. Shouldn't have
any behavior change: the behavior does in fact match the element state
flag semantics correctly if we do this. We did split the dir flags into
two element bits a while ago.

:not(:dir()) still behaves correctly of course, and we have tests for that.

Differential Revision: https://phabricator.services.mozilla.com/D130734
This commit is contained in:
Emilio Cobos Álvarez 2023-05-31 11:37:02 +02:00 committed by Oriol Brufau
parent 327812e3eb
commit 5b68241958
4 changed files with 6 additions and 34 deletions

View file

@ -494,11 +494,7 @@ impl<'a> SelectorVisitor for SelectorDependencyCollector<'a> {
}
},
Component::NonTSPseudoClass(ref pc) => {
self.compound_state.element_state |= match *pc {
#[cfg(feature = "gecko")]
NonTSPseudoClass::Dir(ref dir) => dir.element_state(),
_ => pc.state_flag(),
};
self.compound_state.element_state |= pc.state_flag();
*self.document_state |= pc.document_state_flag();
let attr_name = match *pc {