diff options
author | bors-servo <lbergstrom+bors@mozilla.com> | 2017-06-10 12:25:59 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-06-10 12:25:59 -0700 |
commit | ddfe8b0468dcd57cc5f98cca5c5ba31134c04719 (patch) | |
tree | b6bc26d6f1ab794e6f4276c661771baef0fbbe95 /components/script/dom/element.rs | |
parent | ff17af064b672482e12d98ec474e2dc0013cb17f (diff) | |
parent | 309531e5b3c360594587e312d876b79776bea7ba (diff) | |
download | servo-ddfe8b0468dcd57cc5f98cca5c5ba31134c04719.tar.gz servo-ddfe8b0468dcd57cc5f98cca5c5ba31134c04719.zip |
Auto merge of #17266 - canaltinova:active_hover_quirk, r=bholley,emilio
stylo: Support :active and :hover quirk
Reviewed by bholley and emilo on the bugzilla bug.
---
<!-- 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 [Bug 1355724](https://bugzilla.mozilla.org/show_bug.cgi?id=1355724)
<!-- 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/17266)
<!-- Reviewable:end -->
Diffstat (limited to 'components/script/dom/element.rs')
-rw-r--r-- | components/script/dom/element.rs | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/components/script/dom/element.rs b/components/script/dom/element.rs index b4e7be3203a..3d7b0676fb8 100644 --- a/components/script/dom/element.rs +++ b/components/script/dom/element.rs @@ -86,7 +86,7 @@ use ref_filter_map::ref_filter_map; use script_layout_interface::message::ReflowQueryType; use script_thread::Runnable; use selectors::attr::{AttrSelectorOperation, NamespaceConstraint}; -use selectors::matching::{ElementSelectorFlags, MatchingContext, MatchingMode}; +use selectors::matching::{ElementSelectorFlags, LocalMatchingContext, MatchingContext, MatchingMode}; use selectors::matching::{HAS_EDGE_CHILD_SELECTOR, HAS_SLOW_SELECTOR, HAS_SLOW_SELECTOR_LATER_SIBLINGS}; use selectors::matching::{RelevantLinkStatus, matches_selector_list}; use servo_atoms::Atom; @@ -2063,7 +2063,9 @@ impl ElementMethods for Element { match SelectorParser::parse_author_origin_no_namespace(&selectors) { Err(_) => Err(Error::Syntax), Ok(selectors) => { - let mut ctx = MatchingContext::new(MatchingMode::Normal, None); + let quirks_mode = document_from_node(self).quirks_mode(); + let mut ctx = MatchingContext::new(MatchingMode::Normal, None, + quirks_mode); Ok(matches_selector_list(&selectors, &Root::from_ref(self), &mut ctx)) } } @@ -2082,7 +2084,9 @@ impl ElementMethods for Element { let root = self.upcast::<Node>(); for element in root.inclusive_ancestors() { if let Some(element) = Root::downcast::<Element>(element) { - let mut ctx = MatchingContext::new(MatchingMode::Normal, None); + let quirks_mode = document_from_node(self).quirks_mode(); + let mut ctx = MatchingContext::new(MatchingMode::Normal, None, + quirks_mode); if matches_selector_list(&selectors, &element, &mut ctx) { return Ok(Some(element)); } @@ -2432,7 +2436,7 @@ impl<'a> ::selectors::Element for Root<Element> { fn match_non_ts_pseudo_class<F>(&self, pseudo_class: &NonTSPseudoClass, - _: &mut MatchingContext, + _: &mut LocalMatchingContext<Self::Impl>, _: &RelevantLinkStatus, _: &mut F) -> bool |