9
9
10
10
<hgroup>
11
11
<h1 class="allcaps">DOM</h1>
12
- <h2>Living Standard — Last Updated 22 May 2014</h2>
12
+ <h2>Living Standard — Last Updated 26 May 2014</h2>
13
13
</hgroup>
14
14
15
15
<dl>
@@ -44,7 +44,7 @@ <h2>Living Standard — Last Updated 22 May 2014</h2>
44
44
<p class="copyright"><a href="http://creativecommons.org/publicdomain/zero/1.0/" rel="license"><img alt="CC0" src="http://i.creativecommons.org/p/zero/1.0/80x15.png"></a>
45
45
To the extent possible under law, the editors have waived all copyright and
46
46
related or neighboring rights to this work. In addition, as of
47
- 22 May 2014, the editors have made this specification available
47
+ 26 May 2014, the editors have made this specification available
48
48
under the
49
49
<a href="http://www.openwebfoundation.org/legal/the-owf-1-0-agreements/owfa-1-0" rel="license">Open Web Foundation Agreement Version 1.0</a>,
50
50
which is available at
@@ -5306,7 +5306,8 @@ <h3 id="interface-element"><span class="secno">5.8 </span>Interface <code><a hre
5306
5306
<span>Attr</span> <span title=dom-Element-setAttributeNode>setAttributeNode</span>(Attr newAttr);
5307
5307
<span>Attr</span> <span title=dom-Element-removeAttributeNode>removeAttributeNode</span>(Attr oldAttr);
5308
5308
-->
5309
- boolean <a href="#dom-element-matches" title="dom-Element-matches">matches</a>(DOMString <var title="">selectors</var>);
5309
+ <a href="#element">Element</a>? <a href="#dom-element-closest" title="dom-Element-closest">closest</a>(DOMString <var>selectors</var>);
5310
+ boolean <a href="#dom-element-matches" title="dom-Element-matches">matches</a>(DOMString <var>selectors</var>);
5310
5311
5311
5312
<a href="#htmlcollection">HTMLCollection</a> <a href="#dom-element-getelementsbytagname" title="dom-Element-getElementsByTagName">getElementsByTagName</a>(DOMString <var title="">localName</var>);
5312
5313
<a href="#htmlcollection">HTMLCollection</a> <a href="#dom-element-getelementsbytagnamens" title="dom-Element-getElementsByTagNameNS">getElementsByTagNameNS</a>(DOMString? <var title="">namespace</var>, DOMString <var title="">localName</var>);
@@ -5848,18 +5849,23 @@ <h3 id="interface-element"><span class="secno">5.8 </span>Interface <code><a hre
5848
5849
<hr>
5849
5850
5850
5851
<dl class="domintro">
5851
- <dt><code><var title="">element</var> . <a href="#dom-element-matches" title="dom-Element-matches">matches</a>(<var title="">selectors</var>)</code>
5852
- <dd><p>Returns true if matching <var title="">selectors</var> against
5852
+ <dt><code><var title="">element</var> . <a href="#dom-element-closest" title="dom-Element-closest">closest</a>(<var>selectors</var>)</code>
5853
+ <dd><p>Returns the first (starting at <var title="">element</var>)
5854
+ <a href="#concept-tree-inclusive-ancestor" title="concept-tree-inclusive-ancestor">inclusive ancestor</a> that matches
5855
+ <var title="">selectors</var>, and null otherwise.
5856
+
5857
+ <dt><code><var title="">element</var> . <a href="#dom-element-matches" title="dom-Element-matches">matches</a>(<var>selectors</var>)</code>
5858
+ <dd><p>Returns true if matching <var>selectors</var> against
5853
5859
<var title="">element</var>'s <a href="#concept-tree-root" title="concept-tree-root">root</a> yields
5854
5860
<var title="">element</var>, and false otherwise.
5855
5861
</dl>
5856
5862
5857
- <p>To <dfn id="match-a-selectors-string">match a selectors string</dfn> <var title="" >selectors</var> against a
5863
+ <p>To <dfn id="match-a-selectors-string">match a selectors string</dfn> <var>selectors</var> against a
5858
5864
<var title="">set</var>, run these steps:
5859
5865
5860
5866
<ol>
5861
5867
<li><p>Let <var title="">s</var> be the result of
5862
- <a class="external" data-anolis-spec="selectors" href="http://dev.w3.org/csswg/selectors/#parse-a-selector">parse a selector</a> from <var title="" >selectors</var>.
5868
+ <a class="external" data-anolis-spec="selectors" href="http://dev.w3.org/csswg/selectors/#parse-a-selector">parse a selector</a> from <var>selectors</var>.
5863
5869
<a href="#refsSELECTORS">[SELECTORS]</a>
5864
5870
5865
5871
<li><p>If <var title="">s</var> is failure, <a href="#concept-throw" title="concept-throw">throw</a> a
@@ -5871,9 +5877,26 @@ <h3 id="interface-element"><span class="secno">5.8 </span>Interface <code><a hre
5871
5877
<var title="">set</var>. <a href="#refsSELECTORS">[SELECTORS]</a>
5872
5878
</ol>
5873
5879
5880
+ <p>The <dfn id="dom-element-closest" title="dom-Element-closest"><code>closest(<var>selectors</var>)</code></dfn>
5881
+ method must run these steps:
5882
+
5883
+ <ol>
5884
+ <li><p>Let <var><a href="#elements">elements</a></var> be <a href="#context-object">context object</a>'s
5885
+ <a href="#concept-tree-inclusive-ancestor" title="concept-tree-inclusive-ancestor">inclusive ancestor</a> that are
5886
+ <a href="#concept-element" title="concept-element">elements</a>, in reverse
5887
+ <a href="#concept-tree-order" title="concept-tree-order">tree order</a>.
5888
+
5889
+ <li><p>For each <var title="">element</var> in <var><a href="#elements">elements</a></var>, return
5890
+ <var title="">element</var> if <var title="">element</var> is in the result of running
5891
+ <a href="#match-a-selectors-string">match a selectors string</a> <var>selectors</var> against a set consisting
5892
+ of <var title="">element</var>.
5893
+
5894
+ <li><p>Return null.
5895
+ </ol>
5896
+
5874
5897
<p>The <dfn id="dom-element-matches" title="dom-Element-matches"><code>matches(<var>selectors</var>)</code></dfn>
5875
5898
method must return true if the <a href="#context-object">context object</a> is in the result of running
5876
- <a href="#match-a-selectors-string">match a selectors string</a> <var title="" >selectors</var> against a set consisting
5899
+ <a href="#match-a-selectors-string">match a selectors string</a> <var>selectors</var> against a set consisting
5877
5900
of <a href="#context-object">context object</a>, and false otherwise.
5878
5901
5879
5902
<hr>
0 commit comments