diff options
author | bors-servo <lbergstrom+bors@mozilla.com> | 2017-05-16 14:36:13 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-05-16 14:36:13 -0500 |
commit | 7b9e9caa1d0b075a82f0e202cf35808f00d7468d (patch) | |
tree | 444f26f7ba4735adad075e06afc973bf5e7dcb8a | |
parent | f87e362059f77bd7887cec0e8dd19df546538855 (diff) | |
parent | e03e9de6d0813f9f554b3903897439eeb2787662 (diff) | |
download | servo-7b9e9caa1d0b075a82f0e202cf35808f00d7468d.tar.gz servo-7b9e9caa1d0b075a82f0e202cf35808f00d7468d.zip |
Auto merge of #16895 - bzbarsky:moz-is-html, r=emilio
Add :-moz-is-html support for stylo.
<!-- 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=1365165
<!-- 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/16895)
<!-- Reviewable:end -->
-rw-r--r-- | components/style/gecko/non_ts_pseudo_class_list.rs | 3 | ||||
-rw-r--r-- | components/style/gecko/selector_parser.rs | 5 | ||||
-rw-r--r-- | components/style/gecko/wrapper.rs | 3 |
3 files changed, 8 insertions, 3 deletions
diff --git a/components/style/gecko/non_ts_pseudo_class_list.rs b/components/style/gecko/non_ts_pseudo_class_list.rs index 5b1b056ba91..f6551ce90d4 100644 --- a/components/style/gecko/non_ts_pseudo_class_list.rs +++ b/components/style/gecko/non_ts_pseudo_class_list.rs @@ -25,8 +25,6 @@ * * Pending pseudo-classes: * - * :-moz-is-html -> Used only in UA sheets, should be easy to support. - * * :-moz-lwtheme, :-moz-lwtheme-brighttext, :-moz-lwtheme-darktext, * :-moz-window-inactive. * @@ -108,6 +106,7 @@ macro_rules! apply_non_ts_list { ("-moz-last-node", MozLastNode, lastNode, _, _), ("-moz-only-whitespace", MozOnlyWhitespace, mozOnlyWhitespace, _, _), ("-moz-native-anonymous", MozNativeAnonymous, mozNativeAnonymous, _, PSEUDO_CLASS_INTERNAL), + ("-moz-is-html", MozIsHTML, mozIsHTML, _, _), ], string: [ ("-moz-system-metric", MozSystemMetric, mozSystemMetric, _, PSEUDO_CLASS_INTERNAL), diff --git a/components/style/gecko/selector_parser.rs b/components/style/gecko/selector_parser.rs index e46b8c489f5..22abaf63b67 100644 --- a/components/style/gecko/selector_parser.rs +++ b/components/style/gecko/selector_parser.rs @@ -164,7 +164,10 @@ impl NonTSPseudoClass { // revalidation, because we already compare states for elements and // candidates. self.state_flag().is_empty() && - !matches!(*self, NonTSPseudoClass::MozAny(_) | NonTSPseudoClass::Dir(_)) + !matches!(*self, + NonTSPseudoClass::MozAny(_) | + NonTSPseudoClass::Dir(_) | + NonTSPseudoClass::MozIsHTML) } /// Convert NonTSPseudoClass to Gecko's CSSPseudoClassType. diff --git a/components/style/gecko/wrapper.rs b/components/style/gecko/wrapper.rs index c38d3b73c93..c171404d3eb 100644 --- a/components/style/gecko/wrapper.rs +++ b/components/style/gecko/wrapper.rs @@ -1217,6 +1217,9 @@ impl<'le> ::selectors::Element for GeckoElement<'le> { NonTSPseudoClass::MozNativeAnonymous => unsafe { Gecko_MatchesElement(pseudo_class.to_gecko_pseudoclasstype().unwrap(), self.0) }, + NonTSPseudoClass::MozIsHTML => { + self.is_html_element_in_html_document() + } NonTSPseudoClass::MozAny(ref sels) => { sels.iter().any(|s| { matches_complex_selector(s, self, context, flags_setter) |