aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorbors-servo <lbergstrom+bors@mozilla.com>2017-05-13 01:00:46 -0500
committerGitHub <noreply@github.com>2017-05-13 01:00:46 -0500
commit3b13b152a0198b9a005ca122e6cb411b12f8c334 (patch)
tree0f68f5d8a9fa9839c4d320a23945bd4f95717e94
parent29f5b226ac6029cfa3806a36e58974b94c12d655 (diff)
parent51cf50f20bffc99790ef23045ba85e036f3719fd (diff)
downloadservo-3b13b152a0198b9a005ca122e6cb411b12f8c334.tar.gz
servo-3b13b152a0198b9a005ca122e6cb411b12f8c334.zip
Auto merge of #16841 - bzbarsky:fix-moz-any-matching, r=emilio
Fix the situation when :any-link starts or stops matching to actually restyle correctly. <!-- Please describe your changes on the following line: --> --- <!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `__` with appropriate data: --> - [X] `./mach build -d` does not report any errors - [X] `./mach test-tidy` does not report any errors - [X] These changes fix https://bugzilla.mozilla.org/show_bug.cgi?id=1364335 <!-- Either: --> - [ ] There are tests for these changes OR - [ ] These changes do not require tests because _____ <!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.--> <!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. --> <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/16841) <!-- Reviewable:end -->
-rw-r--r--components/style/gecko/non_ts_pseudo_class_list.rs4
-rw-r--r--components/style/restyle_hints.rs2
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 160bc5b1615..145126656c2 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,