Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reinstate active flag for iterators #359

Merged
merged 1 commit into from
Aug 8, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion dom.bs
Original file line number Diff line number Diff line change
Expand Up @@ -8625,6 +8625,10 @@ and {{Range/getBoundingClientRect()}} methods are defined in other specification
to filter and traverse <a>node</a>
<a>trees</a>.

Each {{NodeIterator}} and {{TreeWalker}} object has an associated <dfn export
id=concept-traversal-active for=traversal>active flag</dfn> to avoid
recursive invocations. It is initially unset.

Each {{NodeIterator}} and {{TreeWalker}} object also
has an associated <dfn export id=concept-traversal-root for=traversal>root</dfn>
<a>node</a>,
Expand All @@ -8635,6 +8639,7 @@ To <dfn export id=concept-node-filter for=Node>filter</dfn> <var>node</var> run
these steps:

<ol>
<li>If the <a for=traversal>active flag</a> is set, throw an {{InvalidStateError}}.
<li>Let <var>n</var> be <var>node</var>'s
{{Node/nodeType}} attribute value minus 1.
<li>If the <var>n</var><sup>th</sup> bit (where 0 is the least
Expand All @@ -8644,9 +8649,11 @@ these steps:
<!-- !((1 << (node.nodeType - 1)) & whatToShow) -->
<li>If <a for=traversal>filter</a> is null,
return {{NodeFilter/FILTER_ACCEPT}}.
<li>Set the <a for=traversal>active flag</a>.
<li>Let <var>result</var> be the return value of <a>call a user object's operation</a> with
<a for=traversal>filter</a>, "<code>acceptNode</code>", and a list of arguments consisting of
<var>node</var>.
<li>Unset the <a for=traversal>active flag</a>.
<!-- no need to pass callback this value; it's undefined which becomes the global object -->
<li>Return <var>result</var>.
</ol>
Expand Down Expand Up @@ -8680,7 +8687,7 @@ Each {{NodeIterator}} object has an associated
<a>node</a>.

<p class="note no-backref">As mentioned earlier, {{NodeIterator}} objects have an
associated
associated <a for=traversal>active flag</a>,
<a for=traversal>root</a> <a>node</a>,
<a for=traversal>whatToShow</a> bitmask, and
<a for=traversal>filter</a> callback as well.
Expand Down