Auto merge of #15966 - mbrubeck:any, r=emilio

Bug 1340683 - stylo: Implement the :-moz-any pseudo-class

Adds support for the non-standard [:-moz-any](https://developer.mozilla.org/en-US/docs/Web/CSS/:any) selector.

---

- [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=1340683
- [x] These changes do not require tests because they are gecko-only

<!-- 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/15966)
<!-- Reviewable:end -->
This commit is contained in:
bors-servo 2017-03-16 16:19:12 -07:00 committed by GitHub
commit 0a747e23c6
10 changed files with 146 additions and 40 deletions

View file

@ -86,7 +86,7 @@ use parking_lot::RwLock;
use ref_filter_map::ref_filter_map;
use script_layout_interface::message::ReflowQueryType;
use script_thread::Runnable;
use selectors::matching::{ElementSelectorFlags, matches};
use selectors::matching::{ElementSelectorFlags, StyleRelations, matches};
use selectors::matching::{HAS_EDGE_CHILD_SELECTOR, HAS_SLOW_SELECTOR, HAS_SLOW_SELECTOR_LATER_SIBLINGS};
use selectors::parser::{AttrSelector, NamespaceConstraint};
use servo_atoms::Atom;
@ -2392,7 +2392,10 @@ impl<'a> ::selectors::Element for Root<Element> {
self.namespace()
}
fn match_non_ts_pseudo_class(&self, pseudo_class: &NonTSPseudoClass) -> bool {
fn match_non_ts_pseudo_class(&self,
pseudo_class: &NonTSPseudoClass,
_: &mut StyleRelations,
_: &mut ElementSelectorFlags) -> bool {
match *pseudo_class {
// https://github.com/servo/servo/issues/8718
NonTSPseudoClass::Link |

View file

@ -50,7 +50,7 @@ use script_layout_interface::{HTMLCanvasData, LayoutNodeType, SVGSVGData, Truste
use script_layout_interface::{OpaqueStyleAndLayoutData, PartialPersistentLayoutData};
use script_layout_interface::wrapper_traits::{DangerousThreadSafeLayoutNode, GetLayoutData, LayoutNode};
use script_layout_interface::wrapper_traits::{PseudoElementType, ThreadSafeLayoutElement, ThreadSafeLayoutNode};
use selectors::matching::ElementSelectorFlags;
use selectors::matching::{ElementSelectorFlags, StyleRelations};
use selectors::parser::{AttrSelector, NamespaceConstraint};
use servo_atoms::Atom;
use servo_url::ServoUrl;
@ -611,7 +611,10 @@ impl<'le> ::selectors::Element for ServoLayoutElement<'le> {
self.element.namespace()
}
fn match_non_ts_pseudo_class(&self, pseudo_class: &NonTSPseudoClass) -> bool {
fn match_non_ts_pseudo_class(&self,
pseudo_class: &NonTSPseudoClass,
_: &mut StyleRelations,
_: &mut ElementSelectorFlags) -> bool {
match *pseudo_class {
// https://github.com/servo/servo/issues/8718
NonTSPseudoClass::Link |
@ -1106,7 +1109,10 @@ impl<'le> ::selectors::Element for ServoThreadSafeLayoutElement<'le> {
self.element.get_namespace()
}
fn match_non_ts_pseudo_class(&self, _: &NonTSPseudoClass) -> bool {
fn match_non_ts_pseudo_class(&self,
_: &NonTSPseudoClass,
_: &mut StyleRelations,
_: &mut ElementSelectorFlags) -> bool {
// NB: This could maybe be implemented
warn!("ServoThreadSafeLayoutElement::match_non_ts_pseudo_class called");
false