Skip to content

Commit

Permalink
script: Element.webkitMatchesSelector()
Browse files Browse the repository at this point in the history
  • Loading branch information
tetsuharuohzeki committed Oct 25, 2015
1 parent bb88832 commit 04967ed
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
5 changes: 5 additions & 0 deletions components/script/dom/element.rs
Expand Up @@ -1461,6 +1461,11 @@ impl ElementMethods for Element {
}
}

// https://dom.spec.whatwg.org/#dom-element-webkitmatchesselector
fn WebkitMatchesSelector(&self, selectors: DOMString) -> Fallible<bool> {
self.Matches(selectors)
}

// https://dom.spec.whatwg.org/#dom-element-closest
fn Closest(&self, selectors: DOMString) -> Fallible<Option<Root<Element>>> {
match parse_author_origin_selector_list_from_str(&selectors) {
Expand Down
2 changes: 2 additions & 0 deletions components/script/dom/webidls/Element.webidl
Expand Up @@ -55,6 +55,8 @@ interface Element : Node {

[Pure, Throws]
boolean matches(DOMString selectors);
[Pure, Throws]
boolean webkitMatchesSelector(DOMString selectors);

HTMLCollection getElementsByTagName(DOMString localName);
HTMLCollection getElementsByTagNameNS(DOMString? namespace, DOMString localName);
Expand Down

0 comments on commit 04967ed

Please sign in to comment.