Skip to content

Commit 10dbae4

Browse files
committed
Meta: give all document references an explicit for attribute
This is needed for #1334.
1 parent e17e509 commit 10dbae4

File tree

1 file changed

+49
-48
lines changed

1 file changed

+49
-48
lines changed

dom.bs

Lines changed: 49 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -336,7 +336,7 @@ are invoked, now in reverse <a>tree order</a>.
336336

337337
<p>The <code>debug</code> function will be invoked twice. Each time the <a>event</a>'s
338338
{{Event/target}} attribute value will be the <code>span</code> <a for=/>element</a>. The first time
339-
{{Event/currentTarget}} attribute's value will be the <a>document</a>, the second time the
339+
{{Event/currentTarget}} attribute's value will be the <a for=/>document</a>, the second time the
340340
<code>body</code> <a for=/>element</a>. {{Event/eventPhase}} attribute's value switches from
341341
{{Event/CAPTURING_PHASE}} to {{Event/BUBBLING_PHASE}}. If an <a>event listener</a> was registered
342342
for the <code>span</code> <a for=/>element</a>, {{Event/eventPhase}} attribute's value would have
@@ -2340,16 +2340,16 @@ therefore alone in a <a>tree</a>.
23402340
<h4 id=document-trees>Document tree</h4>
23412341

23422342
<p>A <dfn export id=concept-document-tree>document tree</dfn> is a <a>node tree</a> whose
2343-
<a for=tree>root</a> is a <a>document</a>.
2343+
<a for=tree>root</a> is a <a for=/>document</a>.
23442344

2345-
<p>The <dfn export>document element</dfn> of a <a>document</a> is the <a for=/>element</a> whose
2346-
<a for=tree>parent</a> is that <a>document</a>, if it exists; otherwise null.
2345+
<p>The <dfn export>document element</dfn> of a <a for=/>document</a> is the <a for=/>element</a>
2346+
whose <a for=tree>parent</a> is that <a for=/>document</a>, if it exists; otherwise null.
23472347

23482348
<p class=note>Per the <a>node tree</a> constraints, there can be only one such
23492349
<a for=/>element</a>.
23502350

23512351
<p>A <a for=/>node</a> is <dfn export>in a document tree</dfn> if its <a for=tree>root</a> is a
2352-
<a>document</a>.
2352+
<a for=/>document</a>.
23532353

23542354
<p>A <a for=/>node</a> is <dfn export>in a document</dfn> if it is <a>in a document tree</a>.
23552355
<span class=note>The term <a>in a document</a> is no longer supposed to be used. It indicates that
@@ -2370,7 +2370,7 @@ referred to as the <dfn export id=concept-light-tree>light tree</dfn>.</p>
23702370
itself.</p>
23712371

23722372
<p id=in-a-shadow-including-document>A <a for=/>node</a> is <dfn export>connected</dfn> if its
2373-
<a>shadow-including root</a> is a <a>document</a>.
2373+
<a>shadow-including root</a> is a <a for=/>document</a>.
23742374

23752375
<h5 id=shadow-tree-slots>Slots</h5>
23762376

@@ -2628,12 +2628,12 @@ steps:
26282628
"{{HierarchyRequestError!!exception}}" {{DOMException}}.
26292629

26302630
<li><p>If either <var>node</var> is a {{Text}} <a for=/>node</a> and <var>parent</var> is a
2631-
<a>document</a>, or <var>node</var> is a <a>doctype</a> and <var>parent</var> is not a
2632-
<a>document</a>, then <a>throw</a> a "{{HierarchyRequestError!!exception}}" {{DOMException}}.
2631+
<a for=/>document</a>, or <var>node</var> is a <a>doctype</a> and <var>parent</var> is not a
2632+
<a for=/>document</a>, then <a>throw</a> a "{{HierarchyRequestError!!exception}}" {{DOMException}}.
26332633

26342634
<li>
2635-
<p>If <var>parent</var> is a <a>document</a>, and any of the statements below, switched on the
2636-
interface <var>node</var> <a>implements</a>, are true, then <a>throw</a> a
2635+
<p>If <var>parent</var> is a <a for=/>document</a>, and any of the statements below, switched on
2636+
the interface <var>node</var> <a>implements</a>, are true, then <a>throw</a> a
26372637
"{{HierarchyRequestError!!exception}}" {{DOMException}}.
26382638

26392639
<dl class=switch>
@@ -2898,12 +2898,12 @@ within a <var>parent</var>, run these steps:
28982898
"{{HierarchyRequestError!!exception}}" {{DOMException}}.
28992899

29002900
<li><p>If either <var>node</var> is a {{Text}} <a for=/>node</a> and <var>parent</var> is a
2901-
<a>document</a>, or <var>node</var> is a <a>doctype</a> and <var>parent</var> is not a
2902-
<a>document</a>, then <a>throw</a> a "{{HierarchyRequestError!!exception}}" {{DOMException}}.
2901+
<a for=/>document</a>, or <var>node</var> is a <a>doctype</a> and <var>parent</var> is not a
2902+
<a for=/>document</a>, then <a>throw</a> a "{{HierarchyRequestError!!exception}}" {{DOMException}}.
29032903

29042904
<li>
2905-
<p>If <var>parent</var> is a <a>document</a>, and any of the statements below, switched on the
2906-
interface <var>node</var> <a>implements</a>, are true, then <a>throw</a> a
2905+
<p>If <var>parent</var> is a <a for=/>document</a>, and any of the statements below, switched on
2906+
the interface <var>node</var> <a>implements</a>, are true, then <a>throw</a> a
29072907
"{{HierarchyRequestError!!exception}}" {{DOMException}}.
29082908

29092909
<dl class=switch>
@@ -4130,7 +4130,7 @@ get a direct instance of it.
41304130

41314131
<p>Each <a for=/>node</a> has an associated
41324132
<dfn export for=Node id=concept-node-document>node document</dfn>, set upon creation, that is a
4133-
<a>document</a>.
4133+
<a for=/>document</a>.
41344134

41354135
<p class=note>A <a for=/>node</a>'s <a for=Node>node document</a> can be changed by the
41364136
<a>adopt</a> algorithm.
@@ -4334,10 +4334,11 @@ statement, switching on the interface <a>this</a> <a>implements</a>:
43344334
if <a>this</a> is <a>connected</a>; otherwise false.</p>
43354335

43364336
<p>The <dfn attribute for=Node><code>ownerDocument</code></dfn> getter steps are to return null,
4337-
if <a>this</a> is a <a>document</a>; otherwise <a>this</a>'s <a for=Node>node document</a>.
4337+
if <a>this</a> is a <a for=/>document</a>; otherwise <a>this</a>'s <a for=Node>node document</a>.
43384338

4339-
<p class=note>The <a for=Node>node document</a> of a <a>document</a> is that <a>document</a> itself.
4340-
All <a for=/>nodes</a> have a <a for=Node>node document</a> at all times.
4339+
<p class=note>The <a for=Node>node document</a> of a <a for=/>document</a> is that
4340+
<a for=/>document</a> itself. All <a for=/>nodes</a> have a <a for=Node>node document</a> at all
4341+
times.
43414342

43424343
<p>The <dfn method for=Node><code>getRootNode(<var>options</var>)</code></dfn> method steps are to
43434344
return <a>this</a>'s <a>shadow-including root</a> if
@@ -5152,9 +5153,9 @@ dictionary ElementCreationOptions {
51525153
<p>{{Document}} <a for=/>nodes</a> are simply
51535154
known as <dfn export id=concept-document lt="document">documents</dfn>.
51545155

5155-
<p>A <a>document</a>'s <a>node document</a> is itself.
5156+
<p>A <a for=/>document</a>'s <a>node document</a> is itself.
51565157

5157-
<p>Each <a>document</a> has an associated
5158+
<p>Each <a for=/>document</a> has an associated
51585159
<dfn export for=Document id=concept-document-encoding>encoding</dfn> (an <a for=/>encoding</a>),
51595160
<dfn export for=Document id=concept-document-content-type>content type</dfn> (a string),
51605161
<dfn export for=Document id=concept-document-url>URL</dfn> (a <a for=/>URL</a>),
@@ -5166,18 +5167,19 @@ known as <dfn export id=concept-document lt="document">documents</dfn>.
51665167
[[!URL]]
51675168
[[!HTML]]
51685169

5169-
<p>Unless stated otherwise, a <a>document</a>'s <a for=Document>encoding</a> is the <a>utf-8</a>
5170-
<a for=/>encoding</a>, <a for=Document>content type</a> is
5170+
<p>Unless stated otherwise, a <a for=/>document</a>'s <a for=Document>encoding</a> is the
5171+
<a>utf-8</a> <a for=/>encoding</a>, <a for=Document>content type</a> is
51715172
"<code>application/xml</code>", <a for=Document>URL</a> is "<code>about:blank</code>",
51725173
<a for=Document>origin</a> is an <a>opaque origin</a>,
51735174
<a for=Document>type</a> is "<code>xml</code>", <a for=Document>mode</a> is
51745175
"<code>no-quirks</code>", and its <a for=Document>allow declarative shadow roots</a> is false.
51755176

5176-
<p>A <a>document</a> is said to be an <dfn export>XML document</dfn> if its <a for=Document>type</a>
5177-
is "<code>xml</code>"; otherwise an <dfn export>HTML document</dfn>. Whether a <a>document</a> is an
5178-
<a>HTML document</a> or an <a>XML document</a> affects the behavior of certain APIs.
5177+
<p>A <a for=/>document</a> is said to be an <dfn export>XML document</dfn> if its
5178+
<a for=Document>type</a> is "<code>xml</code>"; otherwise an <dfn export>HTML document</dfn>.
5179+
Whether a <a for=/>document</a> is an <a>HTML document</a> or an <a>XML document</a> affects the
5180+
behavior of certain APIs.
51795181

5180-
<p>A <a>document</a> is said to be in
5182+
<p>A <a for=/>document</a> is said to be in
51815183
<dfn export id=concept-document-no-quirks>no-quirks mode</dfn> if its
51825184
<a for=Document>mode</a> is "<code>no-quirks</code>",
51835185
<dfn export id=concept-document-quirks>quirks mode</dfn> if its <a for=Document>mode</a>
@@ -5196,16 +5198,16 @@ is "<code>quirks</code>", and
51965198
are nonsensical.)
51975199
</div>
51985200

5199-
<p>A <a>document</a>'s <a>get the parent</a> algorithm, given an <var>event</var>, returns
5201+
<p>A <a for=/>document</a>'s <a>get the parent</a> algorithm, given an <var>event</var>, returns
52005202
null if <var>event</var>'s {{Event/type}} attribute value is "<code>load</code>" or
5201-
<a>document</a> does not have a <a for=Document>browsing context</a>; otherwise the
5202-
<a>document</a>'s <a>relevant global object</a>.
5203+
<a for=/>document</a> does not have a <a for=Document>browsing context</a>; otherwise the
5204+
<a for=/>document</a>'s <a>relevant global object</a>.
52035205

52045206
<hr>
52055207

52065208
<dl class=domintro>
52075209
<dt><code><var>document</var> = new {{Document()}}</code>
5208-
<dd>Returns a new <a>document</a>.
5210+
<dd>Returns a new <a for=/>document</a>.
52095211

52105212
<dt><code><var>document</var> . {{Document/implementation}}</code>
52115213
<dd>Returns <var>document</var>'s {{DOMImplementation}} object.
@@ -5233,7 +5235,7 @@ steps are to set <a>this</a>'s <a for=Document>origin</a> to the <a for=Document
52335235
<a>current global object</a>'s <a>associated <code>Document</code></a>. [[!HTML]]
52345236

52355237
<p class=note>Unlike {{DOMImplementation/createDocument()}}, this constructor does not
5236-
return an {{XMLDocument}} object, but a <a>document</a> ({{Document}} object).
5238+
return an {{XMLDocument}} object, but a <a for=/>document</a> ({{Document}} object).
52375239

52385240
<p>The
52395241
<dfn attribute for=Document><code>implementation</code></dfn> getter steps are to return the
@@ -5297,7 +5299,7 @@ otherwise "<code>CSS1Compat</code>".
52975299
<dt><var>collection</var> = <var>document</var> . {{Document/getElementsByClassName(classNames)}}</code>
52985300
<dt><var>collection</var> = <var>element</var> . {{Element/getElementsByClassName(classNames)}}</code>
52995301
<dd><p>Returns an {{HTMLCollection}} of the <a for=/>elements</a> in the object on which the method
5300-
was invoked (a <a>document</a> or an <a for=/>element</a>) that have all the classes given by
5302+
was invoked (a <a for=/>document</a> or an <a for=/>element</a>) that have all the classes given by
53015303
<var>classNames</var>. The <var>classNames</var> argument is interpreted as a space-separated list
53025304
of classes.
53035305
</dl>
@@ -5557,16 +5559,16 @@ method steps are:
55575559
<p>Returns a copy of <var>node</var>. If <var>deep</var> is true, the copy also includes the
55585560
<var>node</var>'s <a for=tree>descendants</a>.
55595561

5560-
<p>If <var>node</var> is a <a>document</a> or a <a for=/>shadow root</a>, throws a
5562+
<p>If <var>node</var> is a <a for=/>document</a> or a <a for=/>shadow root</a>, throws a
55615563
"{{NotSupportedError!!exception}}" {{DOMException}}.
55625564

55635565
<dt><var>node</var> = <var>document</var> . {{adoptNode(node)}}
55645566

55655567
<dd>
55665568
Moves <var>node</var> from another
5567-
<a>document</a> and returns it.
5569+
<a for=/>document</a> and returns it.
55685570

5569-
If <var>node</var> is a <a>document</a>, throws a "{{NotSupportedError!!exception}}"
5571+
If <var>node</var> is a <a for=/>document</a>, throws a "{{NotSupportedError!!exception}}"
55705572
{{DOMException}} or, if <var>node</var> is a <a for=/>shadow root</a>, throws a
55715573
"{{HierarchyRequestError!!exception}}" {{DOMException}}.
55725574
</dl>
@@ -5575,8 +5577,8 @@ method steps are:
55755577
method steps are:
55765578

55775579
<ol>
5578-
<li><p>If <var>node</var> is a <a>document</a> or <a for=/>shadow root</a>, then <a>throw</a> a
5579-
"{{NotSupportedError!!exception}}" {{DOMException}}.
5580+
<li><p>If <var>node</var> is a <a for=/>document</a> or <a for=/>shadow root</a>, then <a>throw</a>
5581+
a "{{NotSupportedError!!exception}}" {{DOMException}}.
55805582

55815583
<li><p>Return a <a lt="clone a node">clone</a> of <var>node</var>, with <a>this</a> and the
55825584
<i>clone children flag</i> set if <var>deep</var> is true.
@@ -5627,7 +5629,7 @@ these steps:
56275629
<p>The <dfn method for=Document><code>adoptNode(<var>node</var>)</code></dfn> method steps are:
56285630

56295631
<ol>
5630-
<li><p>If <var>node</var> is a <a>document</a>, then <a>throw</a> a
5632+
<li><p>If <var>node</var> is a <a for=/>document</a>, then <a>throw</a> a
56315633
"{{NotSupportedError!!exception}}" {{DOMException}}.
56325634

56335635
<li><p>If <var>node</var> is a <a for=/>shadow root</a>, then <a>throw</a> a
@@ -5786,9 +5788,8 @@ method steps are:
57865788

57875789
<h4 id=interface-domimplementation>Interface {{DOMImplementation}}</h4>
57885790

5789-
User agents must create a {{DOMImplementation}} object whenever
5790-
a <a>document</a> is created and associate it
5791-
with that <a>document</a>.
5791+
<p>User agents must create a {{DOMImplementation}} object whenever a <a for=/>document</a> is
5792+
created and associate it with that <a for=/>document</a>.
57925793

57935794
<pre class=idl>
57945795
[Exposed=Window]
@@ -5831,7 +5832,7 @@ interface DOMImplementation {
58315832
<dt><code><var>doc</var> = <var>document</var> . {{Document/implementation}} . <a method for=DOMImplementation lt=createHTMLDocument()>createHTMLDocument([<var>title</var>])</a></code>
58325833

58335834
<dd>
5834-
Returns a <a>document</a>, with a basic
5835+
Returns a <a for=/>document</a>, with a basic
58355836
<a>tree</a> already constructed including a
58365837
<{title}> element, unless the <var>title</var>
58375838
argument is omitted.
@@ -5849,7 +5850,7 @@ method steps are:
58495850
<li><p>Return a new <a>doctype</a>, with <var>qualifiedName</var> as its
58505851
<a for=DocumentType>name</a>, <var>publicId</var> as its <a>public ID</a>, and <var>systemId</var>
58515852
as its <a>system ID</a>, and with its <a for=Node>node document</a> set to the associated
5852-
<a>document</a> of <a>this</a>.
5853+
<a for=/>document</a> of <a>this</a>.
58535854
</ol>
58545855

58555856
<p class=note>No check is performed that <var>publicId</var> code points match the
@@ -5874,7 +5875,7 @@ method steps are:
58745875
<li><p>If <var>element</var> is non-null, <a>append</a> <var>element</var> to <var>document</var>.
58755876

58765877
<li><p><var>document</var>'s <a for=Document>origin</a> is <a>this</a>'s associated
5877-
<a>document</a>'s <a for=Document>origin</a>.
5878+
<a for=/>document</a>'s <a for=Document>origin</a>.
58785879

58795880
<li>
58805881
<p><var>document</var>'s <a for=Document>content type</a> is determined by <var>namespace</var>:
@@ -5898,7 +5899,7 @@ method steps are:
58985899
method steps are:
58995900

59005901
<ol>
5901-
<li><p>Let <var>doc</var> be a new <a>document</a> that is an <a>HTML document</a>.
5902+
<li><p>Let <var>doc</var> be a new <a for=/>document</a> that is an <a>HTML document</a>.
59025903

59035904
<li><p>Set <var>doc</var>'s <a for=Document>content type</a> to "<code>text/html</code>".
59045905

@@ -5927,8 +5928,8 @@ method steps are:
59275928
<li><p><a>Append</a> the result of <a>creating an element</a> given <var>doc</var>,
59285929
"<code>body</code>", and the <a>HTML namespace</a>, to the <{html}> element created earlier.</li>
59295930

5930-
<li><p><var>doc</var>'s <a for=Document>origin</a> is <a>this</a>'s associated <a>document</a>'s
5931-
<a for=Document>origin</a>.
5931+
<li><p><var>doc</var>'s <a for=Document>origin</a> is <a>this</a>'s associated
5932+
<a for=/>document</a>'s <a for=Document>origin</a>.
59325933

59335934
<li><p>Return <var>doc</var>.
59345935
</ol>
@@ -8194,7 +8195,7 @@ to set <a>this</a>'s <a for=range>start</a> and <a for=range>end</a> to
81948195

81958196
<dl class=domintro>
81968197
<dt><var>container</var> = <var>range</var> . {{Range/commonAncestorContainer}}
8197-
<dd>Returns the <a for=/>node</a>, furthest away from the <a>document</a>, that is an
8198+
<dd>Returns the <a for=/>node</a>, furthest away from the <a for=/>document</a>, that is an
81988199
<a for=tree>ancestor</a> of both <var>range</var>'s <a for=range>start node</a> and
81998200
<a for=range>end node</a>.
82008201
</dl>

0 commit comments

Comments
 (0)