diff --git a/Overview.src.html b/Overview.src.html index e098c3664..6e421ead1 100644 --- a/Overview.src.html +++ b/Overview.src.html @@ -5232,7 +5232,8 @@

Interface Element

Attr setAttributeNode(Attr newAttr); Attr removeAttributeNode(Attr oldAttr); --> - boolean matches(DOMString selectors); + Element? closest(DOMString selectors); + boolean matches(DOMString selectors); HTMLCollection getElementsByTagName(DOMString localName); HTMLCollection getElementsByTagNameNS(DOMString? namespace, DOMString localName); @@ -5774,18 +5775,23 @@

Interface Element


-
element . matches(selectors) -

Returns true if matching selectors against +

element . closest(selectors) +

Returns the first (starting at element) + inclusive ancestor that matches + selectors, and null otherwise. + +

element . matches(selectors) +

Returns true if matching selectors against element's root yields element, and false otherwise.

-

To match a selectors string selectors against a +

To match a selectors string selectors against a set, run these steps:

  1. Let s be the result of - parse a selector from selectors. + parse a selector from selectors. SELECTORS

  2. If s is failure, throw a @@ -5797,9 +5803,26 @@

    Interface Element

    set. SELECTORS
+

The closest(selectors) +method must run these steps: + +

    +
  1. Let elements be context object's + inclusive ancestor that are + elements, in reverse + tree order. + +

  2. For each element in elements, return + element if element is in the result of running + match a selectors string selectors against a set consisting + of element. + +

  3. Return null. +

+

The matches(selectors) method must return true if the context object is in the result of running -match a selectors string selectors against a set consisting +match a selectors string selectors against a set consisting of context object, and false otherwise.


diff --git a/dom-core.html b/dom-core.html index 7e0e89325..11ba30bf6 100644 --- a/dom-core.html +++ b/dom-core.html @@ -9,7 +9,7 @@

DOM

-

Living Standard — Last Updated 22 May 2014

+

Living Standard — Last Updated 26 May 2014

@@ -44,7 +44,7 @@

Living Standard — Last Updated 22 May 2014

5.8 Interface Attr setAttributeNode(Attr newAttr); Attr removeAttributeNode(Attr oldAttr); --> - boolean matches(DOMString selectors); + Element? closest(DOMString selectors); + boolean matches(DOMString selectors); HTMLCollection getElementsByTagName(DOMString localName); HTMLCollection getElementsByTagNameNS(DOMString? namespace, DOMString localName); @@ -5848,18 +5849,23 @@

5.8 Interface
-
element . matches(selectors) -

Returns true if matching selectors against +

element . closest(selectors) +

Returns the first (starting at element) + inclusive ancestor that matches + selectors, and null otherwise. + +

element . matches(selectors) +

Returns true if matching selectors against element's root yields element, and false otherwise.

-

To match a selectors string selectors against a +

To match a selectors string selectors against a set, run these steps:

  1. Let s be the result of - parse a selector from selectors. + parse a selector from selectors. [SELECTORS]

  2. If s is failure, throw a @@ -5871,9 +5877,26 @@

    5.8 Interface set. [SELECTORS]

+

The closest(selectors) +method must run these steps: + +

    +
  1. Let elements be context object's + inclusive ancestor that are + elements, in reverse + tree order. + +

  2. For each element in elements, return + element if element is in the result of running + match a selectors string selectors against a set consisting + of element. + +

  3. Return null. +

+

The matches(selectors) method must return true if the context object is in the result of running -match a selectors string selectors against a set consisting +match a selectors string selectors against a set consisting of context object, and false otherwise.