Skip to content

Commit

Permalink
Add Node.prototype.rootNode
Browse files Browse the repository at this point in the history
See WICG/webcomponents#80 for context and
discussion.
  • Loading branch information
annevk committed Mar 7, 2016
1 parent 5ec535e commit 0316b62
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 2 deletions.
7 changes: 7 additions & 0 deletions dom.bs
Original file line number Diff line number Diff line change
Expand Up @@ -2965,6 +2965,7 @@ interface Node : EventTarget {
readonly attribute DOMString baseURI;

readonly attribute Document? ownerDocument;
readonly attribute Node rootNode;
readonly attribute Node? parentNode;
readonly attribute Element? parentElement;
boolean hasChildNodes();
Expand Down Expand Up @@ -3194,6 +3195,9 @@ The <dfn attribute for=Node><code>baseURI</code></dfn> attribute's getter must r
Returns the <a>node document</a>.
Returns null for <a>documents</a>.

<dt><code><var>node</var> . {{Node/rootNode}}</code>
<dd>Returns the <a>root</a>.

<dt><code><var>node</var> . {{Node/parentNode}}</code>
<dd>Returns the <a>parent</a>.

Expand Down Expand Up @@ -3241,6 +3245,9 @@ All <a>nodes</a> have a
<a>document</a> at all times.
</div>

<p>The <dfn attribute for=Node><code>rootNode</code></dfn> attribute's getter must return
<a>context object</a>'s <a>root</a>.

The <dfn attribute for=Node>parentNode</dfn>
attribute must return the <a>parent</a>.
<!-- AttrExodus
Expand Down
10 changes: 8 additions & 2 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="2016-03-04">4 March 2016</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="2016-03-07">7 March 2016</time></span></h2>
<div data-fill-with="spec-metadata">
<dl>
<dt>Participate:
Expand Down Expand Up @@ -1749,6 +1749,7 @@ <h3 class="heading settled" data-level="4.4" id="interface-node"><span class="se
readonly attribute DOMString <a class="idl-code" data-link-type="attribute" data-readonly="" data-type="DOMString " href="#dom-node-baseuri">baseURI</a>;

readonly attribute <a data-link-type="idl-name" href="#document">Document</a>? <a class="idl-code" data-link-type="attribute" data-readonly="" data-type="Document? " href="#dom-node-ownerdocument">ownerDocument</a>;
readonly attribute <a data-link-type="idl-name" href="#node">Node</a> <a class="idl-code" data-link-type="attribute" data-readonly="" data-type="Node " href="#dom-node-rootnode">rootNode</a>;
readonly attribute <a data-link-type="idl-name" href="#node">Node</a>? <a class="idl-code" data-link-type="attribute" data-readonly="" data-type="Node? " href="#dom-node-parentnode">parentNode</a>;
readonly attribute <a data-link-type="idl-name" href="#element">Element</a>? <a class="idl-code" data-link-type="attribute" data-readonly="" data-type="Element? " href="#dom-node-parentelement">parentElement</a>;
boolean <a class="idl-code" data-link-type="method" href="#dom-node-haschildnodes">hasChildNodes</a>();
Expand Down Expand Up @@ -1879,6 +1880,8 @@ <h3 class="heading settled" data-level="4.4" id="interface-node"><span class="se
<dt><code><var>node</var> . <code class="idl"><a data-link-type="idl" href="#dom-node-ownerdocument">ownerDocument</a></code></code>
<dd> Returns the <a data-link-type="dfn" href="#concept-node-document">node document</a>.
Returns null for <a data-link-type="dfn" href="#concept-document">documents</a>.
<dt><code><var>node</var> . <code class="idl"><a data-link-type="idl" href="#dom-node-rootnode">rootNode</a></code></code>
<dd>Returns the <a data-link-type="dfn" href="#concept-tree-root">root</a>.
<dt><code><var>node</var> . <code class="idl"><a data-link-type="idl" href="#dom-node-parentnode">parentNode</a></code></code>
<dd>Returns the <a data-link-type="dfn" href="#concept-tree-parent">parent</a>.
<dt><code><var>node</var> . <code class="idl"><a data-link-type="idl" href="#dom-node-parentelement">parentElement</a></code></code>
Expand All @@ -1904,6 +1907,7 @@ <h3 class="heading settled" data-level="4.4" id="interface-node"><span class="se
</ol>
<div class="note" role="note"> The <a data-link-type="dfn" href="#concept-node-document">node document</a> of a <a data-link-type="dfn" href="#concept-document">document</a> is that <a data-link-type="dfn" href="#concept-document">document</a> itself.
All <a data-link-type="dfn" href="#concept-node">nodes</a> have a <a data-link-type="dfn" href="#concept-document">document</a> at all times. </div>
<p>The <dfn class="idl-code" data-dfn-for="Node" data-dfn-type="attribute" data-export="" id="dom-node-rootnode"><code>rootNode</code><a class="self-link" href="#dom-node-rootnode"></a></dfn> attribute’s getter must return <a data-link-type="dfn" href="#context-object">context object</a>’s <a data-link-type="dfn" href="#concept-tree-root">root</a>. </p>
<p>The <dfn class="idl-code" data-dfn-for="Node" data-dfn-type="attribute" data-export="" id="dom-node-parentnode">parentNode<a class="self-link" href="#dom-node-parentnode"></a></dfn> attribute must return the <a data-link-type="dfn" href="#concept-tree-parent">parent</a>.</p>
<p>The <dfn class="idl-code" data-dfn-for="Node" data-dfn-type="attribute" data-export="" id="dom-node-parentelement">parentElement<a class="self-link" href="#dom-node-parentelement"></a></dfn> attribute must return the <a data-link-type="dfn" href="#parent-element">parent element</a>.</p>
<p>The <dfn class="idl-code" data-dfn-for="Node" data-dfn-type="method" data-export="" id="dom-node-haschildnodes">hasChildNodes()<a class="self-link" href="#dom-node-haschildnodes"></a></dfn> method must return true if the <a data-link-type="dfn" href="#context-object">context object</a> has <a data-link-type="dfn" href="#concept-tree-child">children</a>, and false otherwise.</p>
Expand Down Expand Up @@ -5250,6 +5254,7 @@ <h3 class="no-num no-ref heading settled" id="index-defined-here"><span class="c
<li><a href="#dom-nodeiterator-root">attribute for NodeIterator</a><span>, in §6.1</span>
<li><a href="#dom-treewalker-root">attribute for TreeWalker</a><span>, in §6.2</span>
</ul>
<li><a href="#dom-node-rootnode">rootNode</a><span>, in §4.4</span>
<li><a href="#dom-element-schematypeinfo">schemaTypeInfo</a><span>, in §8.2</span>
<li><a href="#scope-match-a-selectors-string">scope-match a selectors string</a><span>, in §2.4</span>
<li><a href="#concept-range-select">select</a><span>, in §5.2</span>
Expand Down Expand Up @@ -5319,8 +5324,8 @@ <h3 class="no-num no-ref heading settled" id="index-defined-here"><span class="c
<li><a href="#concept-supported-tokens">supported tokens</a><span>, in §7.1</span>
<li><a href="#dom-domtokenlist-supports">supports(token)</a><span>, in §7.1</span>
<li><a href="#dom-range-surroundcontents">surroundContents(newParent)</a><span>, in §5.2</span>
<li><a href="#dom-documenttype-systemid">systemId</a><span>, in §4.7</span>
<li><a href="#concept-doctype-systemid">system ID</a><span>, in §4.7</span>
<li><a href="#dom-documenttype-systemid">systemId</a><span>, in §4.7</span>
<li><a href="#dom-element-tagname">tagName</a><span>, in §4.8</span>
<li><a href="#dom-mutationobserver-takerecords">takeRecords()</a><span>, in §4.3.1</span>
<li>
Expand Down Expand Up @@ -5667,6 +5672,7 @@ <h2 class="no-num no-ref heading settled" id="idl-index"><span class="content">I
readonly attribute DOMString <a class="idl-code" data-link-type="attribute" data-readonly="" data-type="DOMString " href="#dom-node-baseuri">baseURI</a>;

readonly attribute <a data-link-type="idl-name" href="#document">Document</a>? <a class="idl-code" data-link-type="attribute" data-readonly="" data-type="Document? " href="#dom-node-ownerdocument">ownerDocument</a>;
readonly attribute <a data-link-type="idl-name" href="#node">Node</a> <a class="idl-code" data-link-type="attribute" data-readonly="" data-type="Node " href="#dom-node-rootnode">rootNode</a>;
readonly attribute <a data-link-type="idl-name" href="#node">Node</a>? <a class="idl-code" data-link-type="attribute" data-readonly="" data-type="Node? " href="#dom-node-parentnode">parentNode</a>;
readonly attribute <a data-link-type="idl-name" href="#element">Element</a>? <a class="idl-code" data-link-type="attribute" data-readonly="" data-type="Element? " href="#dom-node-parentelement">parentElement</a>;
boolean <a class="idl-code" data-link-type="method" href="#dom-node-haschildnodes">hasChildNodes</a>();
Expand Down

0 comments on commit 0316b62

Please sign in to comment.