Re: [whatwg/dom] Revamp the way DOM talks about nodes (#1004)

@domenic approved this pull request.

LGTM with nits

>  <dfn export id=concept-node-tree>node tree</dfn>.
 
-<p>A <a>node tree</a> is constrained as follows, expressed as a relationship between the type of
-<a>node</a> and its allowed <a>children</a>:
+<div class=note>
+ <p>In practice you deal with more specific objects.
+
+ <p>Objects that <a>implement</a> {{Node}} also implement an inherited interface: {{Document}},
+ {{DocumentType}}, {{DocumentFragment}}, {{Element}}, {{CharacterData}}, or {{Attr}}.
+
+ <p>Objects that implement {{DocumentFragment}} sometimes implement {{ShadowRoot}}.
+
+ <p>Objects that <a>implement</a> {{Element}} also typically implement an inherited interface, such

The inconsistent linking of "implement" here is a bit confusing. I'd suggest either in every sentence in this note, or in just the first instance.

>   <dt>{{DocumentType}}
- <dt>{{Text}}
- <dt>{{ProcessingInstruction}}
- <dt>{{Comment}}
+ <dt>{{CharacterData}}
+ <dt>{{Attr}}
  <dd><p>None.

"No allowed children"? I had to go back and re-read the intro paragraph to see what you meant.

>   <dd><p>None.
 </dl>
 
-<p>To determine the <dfn export id=concept-node-length for=Node>length</dfn> of a <a>node</a>
-<var>node</var>, switch on <var>node</var>:
+<p class=note>{{Attr}} <a for=/>nodes</a> <a>participate</a> in a <a>tree</a> for historical
+reasons; they never have a <a for=tree>parent</a> or <a for=tree>children</a> and are therefore

I think "their parent is always null" is a bit more technically accurate. Because https://whatpr.org/dom/1004.html#concept-tree-participate says "An object that participates in a tree has a parent", which seems to contradict this.

I guess technically "never have children" should be "always have an empty set for their children", but that one bothers me much less for some reason.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/whatwg/dom/pull/1004#pullrequestreview-723761086

Received on Thursday, 5 August 2021 20:24:28 UTC