Auto merge of #8183 - saneyuki:matches, r=nox

script: Element.webkitMatchesSelector()

spec:
- 9ac9c15486
  - https://github.com/whatwg/compat/issues/3

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/8183)
<!-- Reviewable:end -->
This commit is contained in:
bors-servo 2015-10-25 02:47:30 -05:00
commit 47a8256c2c
2 changed files with 7 additions and 0 deletions

View file

@ -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) {

View file

@ -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);