Fix the situation when :any-link starts or stops matching to actually restyle correctly.

This commit is contained in:
Boris Zbarsky 2017-05-12 13:22:41 -04:00
parent eeb1ee9723
commit 51cf50f20b
2 changed files with 4 additions and 2 deletions

View file

@ -38,7 +38,9 @@
* possible. * possible.
* *
* $gecko_type can be either "_" or an ident in Gecko's CSSPseudoClassType. * $gecko_type can be either "_" or an ident in Gecko's CSSPseudoClassType.
* $state can be either "_" or an expression of type ElementState. * $state can be either "_" or an expression of type ElementState. If present,
* the semantics are that the pseudo-class matches if any of the bits in
* $state are set on the element.
* $flags can be either "_" or an expression of type NonTSPseudoClassFlag, * $flags can be either "_" or an expression of type NonTSPseudoClassFlag,
* see selector_parser.rs for more details. * see selector_parser.rs for more details.
*/ */

View file

@ -343,7 +343,7 @@ impl<'a, E> Element for ElementWrapper<'a, E>
&mut |_, _| {}) &mut |_, _| {})
} }
match self.snapshot().and_then(|s| s.state()) { match self.snapshot().and_then(|s| s.state()) {
Some(snapshot_state) => snapshot_state.contains(flag), Some(snapshot_state) => snapshot_state.intersects(flag),
None => { None => {
self.element.match_non_ts_pseudo_class(pseudo_class, self.element.match_non_ts_pseudo_class(pseudo_class,
relations, relations,