Skip to content

Commit

Permalink
Fix #60: make cache of getElementsByTagName more conditional
Browse files Browse the repository at this point in the history
In particular, require that the root’s node document hasn’t changed.
  • Loading branch information
annevk committed Oct 15, 2015
1 parent abad55d commit 4c44562
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
4 changes: 2 additions & 2 deletions dom.bs
Original file line number Diff line number Diff line change
Expand Up @@ -3910,8 +3910,8 @@ for a <a>node</a> <var>root</var> is the
<var>localName</var>.
</ol>

When invoked with the same argument, the same {{HTMLCollection}}
object may be returned as returned by an earlier call.
When invoked with the same argument, and as long as <var>root</var>'s <a>node document</a> has not
changed, the same {{HTMLCollection}} object may be returned as returned by an earlier call.


The
Expand Down
7 changes: 4 additions & 3 deletions dom.html
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@
<div class="head">
<p data-fill-with="logo"><a class="logo" href="https://whatwg.org/"> <img alt="WHATWG" height="100" src="https://resources.whatwg.org/logo-dom.svg"> </a> </p>
<h1 class="p-name no-ref allcaps" id="title">DOM</h1>
<h2 class="no-num no-toc no-ref heading settled" id="subtitle"><span class="content">Living Standard — Last Updated <time class="dt-updated" datetime="2015-10-06">6 October 2015</time></span></h2>
<h2 class="no-num no-toc no-ref heading settled" id="subtitle"><span class="content">Living Standard — Last Updated <time class="dt-updated" datetime="2015-10-15">15 October 2015</time></span></h2>
<div data-fill-with="spec-metadata">
<dl>
<dt>Participate:
Expand Down Expand Up @@ -2072,7 +2072,8 @@ <h3 class="heading settled" data-level="4.4" id="interface-node"><span class="se
</ul>
<li>Otherwise, return a <code class="idl"><a data-link-type="idl" href="#htmlcollection">HTMLCollection</a></code> rooted at <var>root</var>, whose filter matches <a data-link-type="dfn" href="#concept-tree-descendant">descendant</a> <a data-link-type="dfn" href="#concept-element">elements</a> whose <a data-link-type="dfn" href="#concept-element-local-name">local name</a> is <var>localName</var>.
</ol>
<p>When invoked with the same argument, the same <code class="idl"><a data-link-type="idl" href="#htmlcollection">HTMLCollection</a></code> object may be returned as returned by an earlier call.</p>
<p>When invoked with the same argument, and as long as <var>root</var>’s <a data-link-type="dfn" href="#concept-node-document">node document</a> has not
changed, the same <code class="idl"><a data-link-type="idl" href="#htmlcollection">HTMLCollection</a></code> object may be returned as returned by an earlier call.</p>
<p>The <dfn data-dfn-type="dfn" data-export="" id="concept-getElementsByTagNameNS">list of elements with namespace <var>namespace</var> and local name <var>localName</var><a class="self-link" href="#concept-getElementsByTagNameNS"></a></dfn> for a <a data-link-type="dfn" href="#concept-node">node</a> <var>root</var> is the <code class="idl"><a data-link-type="idl" href="#htmlcollection">HTMLCollection</a></code> returned by the following algorithm:</p>
<ol>
<li>If <var>namespace</var> is the empty string, set it to null.
Expand Down Expand Up @@ -5109,8 +5110,8 @@ <h3 class="no-num heading settled" id="index-defined-here"><span class="content"
<li><a href="#queue-a-mutation-observer-compound-microtask">queue a mutation observer compound microtask</a><span>, in §4.3</span>
<li><a href="#queue-a-mutation-record">queue a mutation record</a><span>, in §4.3.2</span>
<li><a href="#concept-document-quirks">quirks mode</a><span>, in §4.5</span>
<li><a href="#dom-range-range">Range()</a><span>, in §5.2</span>
<li><a href="#range">Range</a><span>, in §5.2</span>
<li><a href="#dom-range-range">Range()</a><span>, in §5.2</span>
<li><a href="#concept-range">range</a><span>, in §5.2</span>
<li><a href="#rangeexception">RangeException</a><span>, in §8.3</span>
<li><a href="#concept-MO-queue">record queue</a><span>, in §4.3.1</span>
Expand Down

0 comments on commit 4c44562

Please sign in to comment.