diff --git a/servo/src/components/script/dom/element.rs b/servo/src/components/script/dom/element.rs index 941bb637e9f3..e384ed02c1f1 100644 --- a/servo/src/components/script/dom/element.rs +++ b/servo/src/components/script/dom/element.rs @@ -451,7 +451,6 @@ pub trait ElementMethods { fn QuerySelector(&self, selectors: DOMString) -> Fallible>>; fn QuerySelectorAll(&self, selectors: DOMString) -> Fallible>; fn Remove(&self); - fn Matches(&self, selectors: DOMString) -> Fallible; } impl<'a> ElementMethods for JSRef<'a, Element> { @@ -758,12 +757,6 @@ impl<'a> ElementMethods for JSRef<'a, Element> { let node: &JSRef = NodeCast::from_ref(self); node.remove_self(); } - - // http://dom.spec.whatwg.org/#dom-element-matches - fn Matches(&self, selectors: DOMString) -> Fallible { - let root: &JSRef = NodeCast::from_ref(self); - root.matches(selectors) - } } pub fn get_attribute_parts(name: DOMString) -> (Option, String) { diff --git a/servo/src/components/script/dom/node.rs b/servo/src/components/script/dom/node.rs index b7904dd9ca84..9892f0b5f271 100644 --- a/servo/src/components/script/dom/node.rs +++ b/servo/src/components/script/dom/node.rs @@ -396,7 +396,6 @@ pub trait NodeHelpers { fn query_selector_all(&self, selectors: DOMString) -> Fallible>; fn remove_self(&self); - fn matches(&self, selectors: DOMString) -> Fallible; } impl<'a> NodeHelpers for JSRef<'a, Node> { @@ -649,28 +648,6 @@ impl<'a> NodeHelpers for JSRef<'a, Node> { None => () } } - - // http://dom.spec.whatwg.org/#dom-element-matches - fn matches(&self, selectors: DOMString) -> Fallible { - assert!(self.is_element()); - // Step 1. - let namespace = NamespaceMap::new(); - match parse_selector_list(tokenize(selectors.as_slice()).map(|(token, _)| token).collect(), &namespace) { - // Step 2. - None => return Err(Syntax), - // Step 3. - Some(ref selectors) => { - for selector in selectors.iter() { - assert!(selector.pseudo_element.is_none()); - let mut _shareable: bool = false; - if matches_compound_selector(selector.compound_selectors.deref(), self, &mut _shareable) { - return Ok(true); - } - } - } - } - Ok(false) - } } /// If the given untrusted node address represents a valid DOM node in the given runtime, diff --git a/servo/src/components/script/dom/webidls/Element.webidl b/servo/src/components/script/dom/webidls/Element.webidl index d7d3ad6da25b..e088a2263dd2 100644 --- a/servo/src/components/script/dom/webidls/Element.webidl +++ b/servo/src/components/script/dom/webidls/Element.webidl @@ -46,9 +46,6 @@ interface Element : Node { boolean hasAttribute(DOMString name); boolean hasAttributeNS(DOMString? namespace, DOMString localName); - [Throws] - boolean matches(DOMString selectors); - HTMLCollection getElementsByTagName(DOMString localName); HTMLCollection getElementsByTagNameNS(DOMString? namespace, DOMString localName); HTMLCollection getElementsByClassName(DOMString classNames); diff --git a/servo/src/test/content/test_element_matches.html b/servo/src/test/content/test_element_matches.html deleted file mode 100644 index 55f89d4a3fcd..000000000000 --- a/servo/src/test/content/test_element_matches.html +++ /dev/null @@ -1,18 +0,0 @@ - - - - - - -
- - - -