From 51cf50f20bffc99790ef23045ba85e036f3719fd Mon Sep 17 00:00:00 2001 From: Boris Zbarsky Date: Fri, 12 May 2017 13:22:41 -0400 Subject: [PATCH] Fix the situation when :any-link starts or stops matching to actually restyle correctly. --- components/style/gecko/non_ts_pseudo_class_list.rs | 4 +++- components/style/restyle_hints.rs | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/components/style/gecko/non_ts_pseudo_class_list.rs b/components/style/gecko/non_ts_pseudo_class_list.rs index 4d9b91384a1..aca085ba49d 100644 --- a/components/style/gecko/non_ts_pseudo_class_list.rs +++ b/components/style/gecko/non_ts_pseudo_class_list.rs @@ -38,7 +38,9 @@ * possible. * * $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, * see selector_parser.rs for more details. */ diff --git a/components/style/restyle_hints.rs b/components/style/restyle_hints.rs index b90dc0350fc..539ddb41561 100644 --- a/components/style/restyle_hints.rs +++ b/components/style/restyle_hints.rs @@ -343,7 +343,7 @@ impl<'a, E> Element for ElementWrapper<'a, E> &mut |_, _| {}) } match self.snapshot().and_then(|s| s.state()) { - Some(snapshot_state) => snapshot_state.contains(flag), + Some(snapshot_state) => snapshot_state.intersects(flag), None => { self.element.match_non_ts_pseudo_class(pseudo_class, relations,