@@ -118,7 +118,7 @@ <h2>Extensibility</h2>
118
118
This specification concerns itself with defining various APIs for both parsing and serializing a
119
119
DOM.
120
120
121
- < div class =example > For example: the < a for ="Element "> innerHTML</ a > API is a common way to both
121
+ < div class =example > For example: the < a data-link- for ="Element "> innerHTML</ a > API is a common way to both
122
122
parse and serialize a DOM (it does both). If a particular < a > Node</ a > , has the following in-memory
123
123
DOM:
124
124
< pre >
@@ -134,7 +134,7 @@ <h2>Extensibility</h2>
134
134
</ pre >
135
135
And the < code > HTMLDivElement</ code > node is stored in a variable < code > < var > myDiv</ var > </ code > ,
136
136
then to serialize < code > < var > myDiv</ var > </ code > 's children simply < em > get</ em > (read) the
137
- < a > Element</ a > 's < a for ="Element "> innerHTML</ a > property (this triggers the serialization):
137
+ < a > Element</ a > 's < a data-link- for ="Element "> innerHTML</ a > property (this triggers the serialization):
138
138
139
139
< pre class =javascript >
140
140
var serializedChildren = myDiv.innerHTML;
@@ -143,7 +143,7 @@ <h2>Extensibility</h2>
143
143
</ pre >
144
144
145
145
< p > To parse new children for < code > < var > myDiv</ var > </ code > from a string (replacing its existing
146
- children), simply < em > set</ em > the < a for ="Element "> innerHTML</ a > property (this triggers
146
+ children), simply < em > set</ em > the < a data-link- for ="Element "> innerHTML</ a > property (this triggers
147
147
parsing of the assigned string):
148
148
149
149
< pre class =javascript >
@@ -221,10 +221,10 @@ <h2>Extensibility</h2>
221
221
</ pre >
222
222
223
223
< dl class =domintro >
224
- < dt > < var > domparser</ var > = new < a for =DOMParser > DOMParser</ a > ()</ var >
224
+ < dt > < var > domparser</ var > = new < a data-link- for =DOMParser > DOMParser</ a > ()</ var >
225
225
< dd > Constructs a new DOMParser object.
226
226
227
- < dt > < var > document</ var > = < var > domparser</ var > . < a for =DOMParser > parseFromString</ a > ( < var > str</ var > , < var > type</ var > )
227
+ < dt > < var > document</ var > = < var > domparser</ var > . < a data-link- for =DOMParser > parseFromString</ a > ( < var > str</ var > , < var > type</ var > )
228
228
< dd > Parse < var > str</ var > using a parser that matches < var > type</ var > 's supported MIME types
229
229
(either XML or HTML), and return a < a > Document</ a > object contained the parsed content if
230
230
successful. If not successful, returns a < a > Document</ a > describing the error.
@@ -235,11 +235,11 @@ <h2>Extensibility</h2>
235
235
< p > The < dfn > < code > DOMParser</ code > </ dfn > constructor must return a new < a > DOMParser</ a > object.
236
236
237
237
< p > The
238
- < code > < dfn for =DOMParser > parseFromString</ dfn > (< var > str</ var > , < var > type</ var > )</ code > </ dfn >
238
+ < code > < dfn data-dfn- for =DOMParser > parseFromString</ dfn > (< var > str</ var > , < var > type</ var > )</ code > </ dfn >
239
239
method must run these steps, depending on < var > type</ var > :
240
240
241
241
< dl class =switch >
242
- < dt > "< dfn for =SupportedType > < code > text/html</ code > </ dfn > "
242
+ < dt > "< dfn data-dfn- for =SupportedType > < code > text/html</ code > </ dfn > "
243
243
< dd > Parse < var > str</ var > with an < code > < a > HTML parser</ a > </ code > , and return the newly created
244
244
< a > Document</ a > .
245
245
@@ -250,10 +250,10 @@ <h2>Extensibility</h2>
250
250
251
251
< p class =note > < code > < a > script</ a > </ code > elements get marked unexecutable and the contents of
252
252
< code > < a > noscript</ a > </ code > get parsed as markup.
253
- < dt > "< dfn for =SupportedType > < code > text/xml</ code > </ dfn > "
254
- < dt > "< dfn for =SupportedType > < code > application/xml</ code > </ dfn > "
255
- < dt > "< dfn for =SupportedType > < code > application/xhtml+xml</ code > </ dfn > "
256
- < dt > "< dfn for =SupportedType > < code > image/svg+xml</ code > </ dfn > "
253
+ < dt > "< dfn data-dfn- for =SupportedType > < code > text/xml</ code > </ dfn > "
254
+ < dt > "< dfn data-dfn- for =SupportedType > < code > application/xml</ code > </ dfn > "
255
+ < dt > "< dfn data-dfn- for =SupportedType > < code > application/xhtml+xml</ code > </ dfn > "
256
+ < dt > "< dfn data-dfn- for =SupportedType > < code > image/svg+xml</ code > </ dfn > "
257
257
< dd >
258
258
< ol >
259
259
< li > Parse < var > str</ var > with a namespace-enabled < code > < a > XML parser</ a > </ code > .
@@ -299,18 +299,18 @@ <h2>Extensibility</h2>
299
299
</ pre >
300
300
301
301
< dl class =domintro >
302
- < dt > < var > xmlserializer</ var > = new < a for =XMLSerializer > XMLSerializer</ a > ()</ var >
302
+ < dt > < var > xmlserializer</ var > = new < a data-link- for =XMLSerializer > XMLSerializer</ a > ()</ var >
303
303
< dd > Constructs a new XMLSerializer object.
304
304
305
- < dt > < var > string</ var > = < var > xmlserializer</ var > . < a for =XMLSerializer > serializeToString</ a > ( < var > root</ var > )
305
+ < dt > < var > string</ var > = < var > xmlserializer</ var > . < a data-link- for =XMLSerializer > serializeToString</ a > ( < var > root</ var > )
306
306
< dd > Serializes < var > root</ var > into a string using an XML serialization. Throws a
307
307
< a > TypeError</ a > exception if < var > root</ var > is not a < a > Node</ a > or an < a > Attr</ a > object.
308
308
</ dl >
309
309
310
310
< p > The < dfn > < code > XMLSerializer</ code > </ dfn > () constructor must return a new < a > XMLSerializer</ a >
311
311
object.
312
312
313
- < p > The < dfn for ="XMLSerializer "> < code > serializeToString</ code > </ dfn > (< var > root</ var > ) method must
313
+ < p > The < dfn data-dfn- for ="XMLSerializer "> < code > serializeToString</ code > </ dfn > (< var > root</ var > ) method must
314
314
produce an < a > XML serialization</ a > of < var > root</ var > passing a value of < code > false</ code > for
315
315
the < a > < var > require well-formed</ var > </ a > parameter, and return the result.
316
316
@@ -328,11 +328,11 @@ <h2>Extensibility</h2>
328
328
329
329
<!-- innerHTML -->
330
330
331
- < p > The < dfn for ="Element "> < code > innerHTML</ code > </ dfn > IDL attribute represents the markup of the
331
+ < p > The < dfn data-dfn- for ="Element "> < code > innerHTML</ code > </ dfn > IDL attribute represents the markup of the
332
332
< code > < a > Element</ a > </ code > 's contents.
333
333
334
334
< dl class =domintro >
335
- < dt > < var > element</ var > . < a for ="Element "> innerHTML</ a > [ = < var > value</ var > ]
335
+ < dt > < var > element</ var > . < a data-link- for ="Element "> innerHTML</ a > [ = < var > value</ var > ]
336
336
< dd > Returns a fragment of HTML or XML that represents the element's contents.
337
337
338
338
< p > Can be set, to replace the contents of the element with nodes parsed from the given string.
@@ -358,7 +358,7 @@ <h2>Extensibility</h2>
358
358
< a > context object</ a > be the < code > < a > template</ a > </ code > 's < a > template contents</ a > (a
359
359
< code > < a > DocumentFragment</ a > </ code > ).
360
360
361
- < p class =note > Setting < a for ="Element "> innerHTML</ a > on a < a > template</ a > element will replace
361
+ < p class =note > Setting < a data-link- for ="Element "> innerHTML</ a > on a < a > template</ a > element will replace
362
362
all the nodes in its < a > template contents</ a >
363
363
(< a > template</ a > .< a data-lt ="template contents "> content</ a > ) rather than its < a > children</ a > .</ p >
364
364
@@ -367,11 +367,11 @@ <h2>Extensibility</h2>
367
367
368
368
<!-- outerHTML -->
369
369
370
- < p > The < dfn for ="Element "> < code > outerHTML</ code > </ dfn > IDL attribute represents the markup of the
370
+ < p > The < dfn data-dfn- for ="Element "> < code > outerHTML</ code > </ dfn > IDL attribute represents the markup of the
371
371
< code > < a > Element</ a > </ code > and its contents.
372
372
373
373
< dl class =domintro >
374
- < dt > < var > element</ var > . < a for ="Element "> outerHTML</ a > [ = < var > value</ var > ]
374
+ < dt > < var > element</ var > . < a data-link- for ="Element "> outerHTML</ a > [ = < var > value</ var > ]
375
375
< dd > Returns a fragment of HTML or XML that represents the element and its contents.
376
376
377
377
< p > Can be set, to replace the element with nodes parsed from the given string.
@@ -421,7 +421,7 @@ <h2>Extensibility</h2>
421
421
<!-- insertAdjacentHTML -->
422
422
423
423
< dl class =domintro >
424
- < dt > < var > element</ var > . < a for ="Element "> insertAdjacentHTML</ a > ( < var > position</ var > , < var > text</ var > )
424
+ < dt > < var > element</ var > . < a data-link- for ="Element "> insertAdjacentHTML</ a > ( < var > position</ var > , < var > text</ var > )
425
425
< dd > Parses the given string < var > text</ var > as HTML or XML and inserts the resulting nodes into
426
426
the tree in the position given by the < var > position</ var > argument, as follows:
427
427
@@ -449,7 +449,7 @@ <h2>Extensibility</h2>
449
449
</ dl >
450
450
451
451
< p > The
452
- < dfn for ="Element " data-lt ="insertAdjacentHTML "> < code > insertAdjacentHTML(< var > position</ var > , < var > text</ var > )</ code > </ dfn >
452
+ < dfn data-dfn- for ="Element " data-lt ="insertAdjacentHTML "> < code > insertAdjacentHTML(< var > position</ var > , < var > text</ var > )</ code > </ dfn >
453
453
method must run these steps:
454
454
455
455
< ol >
@@ -524,10 +524,10 @@ <h2>Extensibility</h2>
524
524
525
525
< p class =note > No special handling for < code > < a > template</ a > </ code > elements is included in the
526
526
above "< code > afterbegin</ code > " and "< code > beforeend</ code > " cases. As with other direct
527
- < a > Node</ a > -manipulation APIs (and unlike < a for ="Element "> innerHTML</ a > ),
528
- < a for ="Element "> insertAdjacentHTML</ a > does not include any special handling for
527
+ < a > Node</ a > -manipulation APIs (and unlike < a data-link- for ="Element "> innerHTML</ a > ),
528
+ < a data-link- for ="Element "> insertAdjacentHTML</ a > does not include any special handling for
529
529
< code > < a > template</ a > </ code > elements. In most cases you will wish to use
530
- < a > template</ a > .< a data-lt ="template contents "> content</ a > .< a for ="Element "> insertAdjacentHTML</ a >
530
+ < a > template</ a > .< a data-lt ="template contents "> content</ a > .< a data-link- for ="Element "> insertAdjacentHTML</ a >
531
531
instead of directly manipulating the < a > child nodes</ a > of a < code > < a > template</ a > </ code >
532
532
element.</ p >
533
533
@@ -542,13 +542,13 @@ <h2>Extensibility</h2>
542
542
</ pre >
543
543
544
544
< dl class =domintro >
545
- < dt > < var > docFragment</ var > = < var > range</ var > . < a for ="Range "> createContextualFragment</ a > ( < var > fragment</ var > )
545
+ < dt > < var > docFragment</ var > = < var > range</ var > . < a data-link- for ="Range "> createContextualFragment</ a > ( < var > fragment</ var > )
546
546
< dd > Returns a < code > < a > DocumentFragment</ a > </ code > , created from the markup string
547
547
< var > fragment</ var > using < var > range</ var > 's start node as the context in which
548
548
< var > fragment</ var > is parsed.
549
549
</ dl >
550
550
551
- < p > The < dfn for ="Range "> < code > createContextualFragment(< var > fragment</ var > )</ code > </ dfn > method
551
+ < p > The < dfn data-dfn- for ="Range " data-lt =" createContextualFragment "> < code > createContextualFragment(< var > fragment</ var > )</ code > </ dfn > method
552
552
must run these steps:
553
553
554
554
< ol >
@@ -566,7 +566,7 @@ <h2>Extensibility</h2>
566
566
567
567
< dt > < code > < a > Text</ a > </ code >
568
568
< dt > < code > < a > Comment</ a > </ code >
569
- < dd > < var > node</ var > 's < a > parent element</ a >
569
+ < dd > < var > node</ var > 's < a data-cite =" DOM#parent-element " > parent element</ a >
570
570
571
571
< dt > < code > < a > DocumentType</ a > </ code >
572
572
< dt > < code > < a > ProcessingInstruction</ a > </ code >
@@ -617,20 +617,20 @@ <h2>Extensibility</h2>
617
617
</pre>
618
618
619
619
<dl class=domintro>
620
- <dt><var>text</var> . <a for="Text">serializeAsCDATA</a> [ = <var>value</var> ]
620
+ <dt><var>text</var> . <a data-link- for="Text">serializeAsCDATA</a> [ = <var>value</var> ]
621
621
<dd>Controls whether, in XML, this node is serialized as a CDATA section.
622
622
</dl>
623
623
624
624
<p><code><a>Text</a></code> nodes have an additional associated flag, the
625
625
<dfn>serialize as CDATA flag</dfn>.
626
626
627
- <p>The <dfn for="Text"><code>serializeAsCDATA</code></dfn> attribute must return true if the
627
+ <p>The <dfn data-dfn- for="Text"><code>serializeAsCDATA</code></dfn> attribute must return true if the
628
628
<a>context object</a> has its <a>serialize as CDATA flag</a> set, or false otherwise.
629
629
630
- <p>Setting the <a for="Text">serializeAsCDATA</a> attribute must, if the new value is true, set
630
+ <p>Setting the <a data-link- for="Text">serializeAsCDATA</a> attribute must, if the new value is true, set
631
631
the <a>context object</a>'s <a>serialize as CDATA flag</a>, or unset it otherwise.
632
632
633
- </section><!-- end Extensions to the Text interface -->
633
+ </section>--> <!-- end Extensions to the Text interface -->
634
634
635
635
</ section > <!-- end APIs for DOM Parsing and Serializing -->
636
636
@@ -1848,8 +1848,8 @@ <h2>Acknowledgements</h2>
1848
1848
and Boris Zbarsky,
1849
1849
for their useful comments.
1850
1850
1851
- < p > Special thanks to Ian Hickson for first defining the < a for ="Element "> innerHTML</ a > and < a for ="Element "> outerHTML</ a >
1852
- attributes, and the < a for ="Element "> insertAdjacentHTML</ a > method in [[HTML5]] and his useful comments.
1851
+ < p > Special thanks to Ian Hickson for first defining the < a data-link- for ="Element "> innerHTML</ a > and < a data-link- for ="Element "> outerHTML</ a >
1852
+ attributes, and the < a data-link- for ="Element "> insertAdjacentHTML</ a > method in [[HTML5]] and his useful comments.
1853
1853
</ section >
1854
1854
1855
1855
</ body >
0 commit comments