index.html
author travil@travil1.wingroup.windeploy.ntdev.microsoft.com
Fri, 01 Jun 2012 13:06:01 -0700
changeset 0 f39b5b437d3d
child 1 5cb52744fe44
permissions -rw-r--r--
The beginning.

Copy of raw (pre-processed) ANOLIS source text from this spec's prior home
repository on bitbucket.
(http://bitbucket.org/ms2ger/dom-parsing-and-serialization/)
0
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
     1
<!doctype html>
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
     2
<meta charset=UTF-8>
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
     3
<title>DOM Parsing and Serialization</title>
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
     4
<link rel=stylesheet href=http://www.whatwg.org/style/specification>
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
     5
<style>
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
     6
 pre, code { font-family:monospace, sans-serif; }
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
     7
 h2 code, h3 code, h4 code,
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
     8
 h2 :link, h3 :link, h4 :link,
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
     9
 h2 :visited, h3 :visited, h4 :visited
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
    10
 { font:inherit; color:inherit; font-style:italic; }
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
    11
 @media print {
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
    12
   [data-anolis-spec]::after {
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
    13
     content: "[" attr(data-anolis-spec) "]";
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
    14
     font-size: 0.6em;
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
    15
     vertical-align: super;
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
    16
     text-transform: uppercase;
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
    17
   }
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
    18
 }
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
    19
</style>
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
    20
<body class=draft>
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
    21
<div class=head id=head>
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
    22
<h1>DOM Parsing and Serialization</h1>
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
    23
<h2 class="no-num no-toc">Work in Progress &mdash; Last Update <!--[DATE: 01 Jan 1901]-->3 April 2012</h2>
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
    24
<dl>
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
    25
  <dt>This Version:
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
    26
  <dd><a href="http://html5.org/specs/dom-parsing.html">http://html5.org/specs/dom-parsing.html</a>
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
    27
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
    28
  <dt>Participate:
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
    29
  <dd><a href="http://www.whatwg.org/mailing-list">whatwg@whatwg.org</a>
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
    30
  <dd><a href="https://www.w3.org/Bugs/Public/enter_bug.cgi?product=WebAppsWG&amp;component=DOM%20Parsing%20and%20Serialization">File a bug</a>
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
    31
  <dd><a href="http://wiki.whatwg.org/wiki/IRC">IRC: #whatwg on Freenode</a>
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
    32
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
    33
  <dt>Editors:
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
    34
  <dd>Ms2ger &lt;ms2ger@gmail.com>
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
    35
  <dd>Travis Leithead &lt;Travis.Leithead@microsoft.com> (newly joining...)</dd>
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
    36
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
    37
  <dt>Previous Home:
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
    38
  <dd><a href="http://html5.org/specs/dom-parsing.html">http://html5.org/specs/dom-parsing.html</a>
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
    39
</dl>
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
    40
</div>
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
    41
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
    42
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
    43
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
    44
<h2 class="no-num no-toc">Abstract</h2>
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
    45
<p>
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
    46
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
    47
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
    48
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
    49
<h2 class="no-num no-toc">Table of contents</h2>
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
    50
<!--toc-->
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
    51
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
    52
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
    53
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
    54
<h2 class=no-num>Issues</h2>
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
    55
<p>Various issues are listed in the rest of the document.
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
    56
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
    57
<p class=XXX>This specification currently requires using the XML Parser for
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
    58
some APIs, when in an XML document. It is unclear whether consensus can be
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
    59
found for this approach.
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
    60
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
    61
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
    62
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
    63
<h2>Conformance</h2>
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
    64
<p>All diagrams, examples, and notes in this specification are
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
    65
non-normative, as are all sections explicitly marked non-normative.
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
    66
Everything else in this specification is normative.</p>
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
    67
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
    68
<p>The key words "MUST", "MUST NOT", "REQUIRED", <!--"SHALL", "SHALL
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
    69
NOT",--> "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
    70
"OPTIONAL" in the normative parts of this document are to be
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
    71
interpreted as described in RFC2119. For readability, these words do
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
    72
not appear in all uppercase letters in this specification. <span
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
    73
data-anolis-ref>RFC2119</span></p>
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
    74
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
    75
<p>Requirements phrased in the imperative as part of algorithms
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
    76
(such as "strip any leading space characters" or "return false and
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
    77
terminate these steps") are to be interpreted with the meaning of the
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
    78
key word ("must", "should", "may", etc) used in introducing the
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
    79
algorithm.</p>
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
    80
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
    81
<p>Conformance requirements phrased as algorithms or specific steps
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
    82
may be implemented in any manner, so long as the end result is
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
    83
equivalent. (In particular, the algorithms defined in this
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
    84
specification are intended to be easy to follow, and not intended to
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
    85
be performant.)</p>
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
    86
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
    87
<p id="hardwareLimitations">User agents may impose
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
    88
implementation-specific limits on otherwise unconstrained inputs,
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
    89
e.g. to prevent denial of service attacks, to guard against running
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
    90
out of memory, or to work around platform-specific limitations.</p>
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
    91
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
    92
<p>When a method or an attribute is said to call another method or attribute, the user agent must invoke its internal API for that attribute or method so that e.g. the author can't change the behavior by overriding attributes or methods with custom properties or functions in ECMAScript.
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
    93
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
    94
<p>Unless otherwise stated, string comparisons are done in a <span
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
    95
data-anolis-spec=dom>case-sensitive</span> manner.
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
    96
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
    97
<p>If an algorithm calls into another algorithm, any exception that is thrown
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
    98
by the latter (unless it is explicitly caught), must cause the former to
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
    99
terminate, and the exception to be propagated up to <em>its</em> caller.
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   100
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   101
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   102
<h3>Dependencies</h3>
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   103
<p>The IDL fragments in this specification must be interpreted as
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   104
required for conforming IDL fragments, as described in the Web IDL
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   105
specification. <span data-anolis-ref>WEBIDL</span>
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   106
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   107
<p>Some of the terms used in this specification are defined in
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   108
<cite>DOM4</cite> and <cite>HTML</cite>.
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   109
<span data-anolis-ref>DOM</span>
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   110
<span data-anolis-ref>HTML</span>
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   111
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   112
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   113
<h3>Extensibility</h3>
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   114
<p>Vendor-specific proprietary extensions to this specification are
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   115
strongly discouraged. Authors must not use such extensions, as
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   116
doing so reduces interoperability and fragments the user base,
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   117
allowing only users of specific user agents to access the content in
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   118
question.</p>
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   119
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   120
<p>If vendor-specific extensions are needed, the members should be
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   121
prefixed by vendor-specific strings to prevent clashes with future
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   122
versions of this specification. Extensions must be defined so that
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   123
the use of extensions neither contradicts nor causes the
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   124
non-conformance of functionality defined in the specification.</p>
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   125
<!-- thanks to QA Framework -->
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   126
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   127
<p>When vendor-neutral extensions to this specification are needed,
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   128
either this specification can be updated accordingly, or an
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   129
extension specification can be written that overrides the
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   130
requirements in this specification. When someone applying this
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   131
specification to their activities decides that they will recognise
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   132
the requirements of such an extension specification, it becomes an
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   133
<dfn title="other applicable specifications">applicable
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   134
specification</dfn> for the purposes of conformance requirements in
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   135
this specification.</p>
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   136
<!-- http://www.w3.org/mid/17E341CD-E790-422C-9F9A-69347EE01CEB@iki.fi -->
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   137
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   138
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   139
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   140
<h2>Terminology</h2>
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   141
<p>The term <dfn>context object</dfn> means the object on which the method or
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   142
attribute being discussed was called.
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   143
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   144
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   145
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   146
<h2>Parsing and serializing <code data-anolis-spec=dom>Node</code>s</h2>
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   147
<h3>Parsing</h3>
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   148
<p>The following steps form the
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   149
<dfn title=concept-parse-fragment>fragment parsing algorithm</dfn>, whose
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   150
arguments are a <var title>markup</var> string and a
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   151
<var title>context element</var>.
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   152
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   153
<ol>
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   154
  <li>
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   155
    <p>If the <var title>context element</var>'s
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   156
    <span data-anolis-spec=dom title=concept-node-document>node document</span>
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   157
    is an <span data-anolis-spec=dom>HTML document</span>: let
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   158
    <var title>algorithm</var> be the
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   159
    <span data-anolis-spec=html>HTML fragment parsing algorithm</span>.
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   160
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   161
    <p>If the <var title>context element</var>'s
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   162
    <span data-anolis-spec=dom title=concept-node-document>node document</span>
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   163
    is an <span data-anolis-spec=dom>XML document</span>: let
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   164
    <var title>algorithm</var> be the
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   165
    <span data-anolis-spec=html>XML fragment parsing algorithm</span>.
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   166
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   167
  <li>
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   168
    <p>Invoke <var title>algorithm</var> with <var title>markup</var> as
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   169
    the <var title>input</var>, and <var title>context element</var> as the
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   170
    <var data-anolis-spec=html title=concept-frag-parse-context>context</var>
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   171
    element.
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   172
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   173
  <li>
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   174
    <p>Let <var title>new children</var> be the nodes returned.
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   175
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   176
  <li>
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   177
    <p>Let <var title>fragment</var> be a new
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   178
    <code data-anolis-spec=dom>DocumentFragment</code> whose
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   179
    <span data-anolis-spec=dom title=concept-node-document>node document</span>
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   180
    is <var title>context element</var>'s
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   181
    <span data-anolis-spec=dom title=concept-node-document>node document</span>.
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   182
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   183
  <li>
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   184
    <p><span data-anolis-spec=dom title=concept-node-append>Append</span>
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   185
    each <span data-anolis-spec=dom title=concept-node>node</span> in
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   186
    <var title>new children</var> to <var title>fragment</var> (in order).
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   187
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   188
    <p class=note>This ensures the
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   189
    <span data-anolis-spec=dom title=concept-node-document>node document</span>
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   190
    for the new <span data-anolis-spec=dom title=concept-node>nodes</span>
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   191
    is correct.
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   192
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   193
  <li>
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   194
    <p>Return <var title>fragment</var>.
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   195
</ol>
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   196
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   197
<h3>Serializing</h3>
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   198
<p>To <dfn title=concept-serialize>serialize</dfn> a
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   199
<code data-anolis-spec=dom>Node</code> <var title>node</var>, the user agent
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   200
must run the following steps:
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   201
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   202
<ol>
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   203
  <li>Let <var title>document</var> be <var title>node</var>'s
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   204
  <span data-anolis-spec=dom title=concept-node-document>node document</span>.
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   205
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   206
  <li>If <var title>document</var> is an
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   207
  <span data-anolis-spec=dom>HTML document</span>, return an
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   208
  <span title=concept-serialize-html>HTML serialization</span> of
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   209
  <var title>node</var>.
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   210
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   211
  <li>Otherwise, <var title>document</var> is an
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   212
  <span data-anolis-spec=dom>XML document</span>. Return an
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   213
  <span title=concept-serialize-xml>XML serialization</span> of
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   214
  <var title>node</var>.
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   215
</ol>
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   216
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   217
<p>To <dfn title=concept-serialize-html>produce an HTML serialization</dfn> of a
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   218
<code data-anolis-spec=dom>Node</code> <var title>node</var>, the user agent
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   219
must run the appropriate steps, depending on <var title>node</var>'s interface:
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   220
<dl class=switch>
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   221
  <dt><code data-anolis-spec=dom>Element</code>
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   222
  <dt><code data-anolis-spec=dom>Document</code>
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   223
  <dt><code data-anolis-spec=dom>DocumentFragment</code>
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   224
  <dd><p>Run the
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   225
  <span data-anolis-spec=html>HTML fragment serialization algorithm</span> on
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   226
  <var title>node</var>. Return the returned string.
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   227
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   228
  <dt><code data-anolis-spec=dom>Comment</code>
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   229
  <dt><code data-anolis-spec=dom>Text</code>
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   230
  <dt><code data-anolis-spec=dom>DocumentType</code>
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   231
  <dt><code data-anolis-spec=dom>ProcessingInstruction</code>
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   232
  <dd class=XXX>You tell me.
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   233
</dl>
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   234
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   235
<p>To <dfn title=concept-serialize-xml>produce an XML serialization</dfn> of a
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   236
<code data-anolis-spec=dom>Node</code> <var title>node</var>, the user agent
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   237
must run the appropriate steps, depending on <var title>node</var>'s interface:
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   238
<dl class=switch>
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   239
  <dt><code data-anolis-spec=dom>Element</code>
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   240
  <dd>
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   241
    <p>Return the concatenation of the following strings:
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   242
    <ul>
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   243
      <li>"<code title>&lt;</code>" (U+003C LESS-THAN SIGN);
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   244
      <li>the value of <var title>node</var>'s
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   245
      <code title=dom-Element-tagName data-anolis-spec=dom>tagName</code>
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   246
      attribute;
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   247
      <p class=XXX>escaping / throwing
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   248
      <li>the <span title=concept-serialize-xml-attributes>XML serialization of
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   249
      <var title>node</var>'s attributes</span>;
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   250
      <li>"<code title>&gt;</code>" (U+003E GREATER-THAN SIGN);
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   251
      <li>the <span title=concept-serialize-xml>serialization</span> of
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   252
      <var title>node</var>'s
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   253
      <span title=concept-tree-child data-anolis-spec=dom>children</span>, in
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   254
      order;
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   255
      <li>"<code title>&lt;/</code>" (U+003C LESS-THAN SIGN, U+002F SOLIDUS);
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   256
      <li>the value of <var title>node</var>'s
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   257
      <code title=dom-Element-tagName data-anolis-spec=dom>tagName</code>
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   258
      attribute;
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   259
      <li>"<code title>&gt;</code>" (U+003E GREATER-THAN SIGN).
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   260
    </ul>
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   261
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   262
  <dt><code data-anolis-spec=dom>Document</code>
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   263
  <dd><p>Run the
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   264
  <span data-anolis-spec=html>XML fragment serialization algorithm</span> on
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   265
  <var title>node</var>. Return the string this produced.
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   266
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   267
  <dt><code data-anolis-spec=dom>Comment</code>
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   268
  <dd>
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   269
    <p>Let <var title>markup</var> the concatenation of
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   270
    "<code title>&lt;!--</code>", <var title>node</var>'s
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   271
    <code title=dom-characterdata-data data-anolis-spec=dom>data</code>, and
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   272
    "<code title>--></code>".
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   273
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   274
    <p>If <var title>markup</var> matches the
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   275
    <code data-anolis-spec=xml>Comment</code> production, return
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   276
    <var title>markup</var>. Otherwise, throw an
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   277
    <code title=dom-DOMException-INVALID_STATE_ERR data-anolis-spec=dom>INVALID_STATE_ERR</code>
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   278
    exception.
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   279
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   280
  <dt><code data-anolis-spec=dom>Text</code>
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   281
  <dd>
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   282
    <p>Let <var title>data</var> be <var title>node</var>'s
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   283
    <code title=dom-characterdata-data data-anolis-spec=dom>data</code>.
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   284
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   285
    <p>If <var title>node</var> has its <span>serialize as CDATA flag</span>
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   286
    set, run the following steps:
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   287
    <ol>
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   288
      <li>If <var title>data</var> doesn't match the
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   289
      <code data-anolis-spec=xml>CData</code> production, throw an
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   290
      <code title=dom-DOMException-INVALID_STATE_ERR data-anolis-spec=dom>INVALID_STATE_ERR</code>
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   291
      exception and terminate the entire algorithm.
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   292
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   293
      <li>Let <var title>markup</var> be the concatenation of
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   294
      "<code title>&lt;![CDATA[</code>", <var title>data</var>, and
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   295
      "<code title>]]></code>".
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   296
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   297
      <li>Return <var title>markup</var>.
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   298
    </ol>
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   299
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   300
    <p>Otherwise, return <var title>data</var>.
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   301
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   302
  <dt><code data-anolis-spec=dom>DocumentFragment</code>
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   303
  <dd>
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   304
    <p>Let <var title>markup</var> the empty string.
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   305
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   306
    <p>For each
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   307
    <span title=concept-tree-child data-anolis-spec=dom>child</span> of
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   308
    <var title>node</var>, in order,
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   309
    <span title=concept-serialize-xml>produce an XML serialization</span>
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   310
    of the child and concatenate the result to <var title>markup</var>.
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   311
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   312
    <p>Return <var title>markup</var>.
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   313
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   314
  <dt><code data-anolis-spec=dom>DocumentType</code>
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   315
  <dt><code data-anolis-spec=dom>ProcessingInstruction</code>
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   316
  <dd class=XXX>You tell me.
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   317
</dl>
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   318
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   319
<p>The <dfn title=concept-serialize-xml-attributes>XML serialization of the
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   320
attributes</dfn> of an
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   321
<span title=concept-element data-anolis-spec=dom>element</span>
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   322
<var title>element</var> is the result of the following algorithm:
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   323
<ol>
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   324
  <li>Let <var title>result</var> be the empty string.
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   325
  <li>
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   326
    <p>For each
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   327
    <span title=concept-attribute data-anolis-spec=dom>attribute</span>
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   328
    <var title>attr</var> in <var title>element</var>
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   329
    <span title=concept-element-attribute data-anolis-spec=dom>attributes</span>,
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   330
    in order, append the following strings to <var title>result</var>:
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   331
    <ol>
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   332
      <li>"<code title> </code>" (U+0020 SPACE);
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   333
      <li><var title>attr</var>'s
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   334
      <span title=concept-attribute-name data-anolis-spec=dom>name</span>;
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   335
      <p class=XXX>escaping / throwing
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   336
      <li>"<code title>="</code>" (U+003D EQUALS SIGN, U+0022 QUOTATION MARK);
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   337
      <li><var title>attr</var>'s
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   338
      <span title=concept-attribute-value data-anolis-spec=dom>value</span>;
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   339
      <p class=XXX>escaping / throwing
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   340
      <li>"<code title>"</code>" (U+0022 QUOTATION MARK).
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   341
    </ol>
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   342
  <li>Return <var title>result</var>.
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   343
</ol>
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   344
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   345
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   346
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   347
<h2>The <code>DOMParser</code> interface</h2>
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   348
<pre class=idl>enum <dfn>SupportedType</dfn> {
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   349
  "text/html",
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   350
  "text/xml",
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   351
  "application/xml",
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   352
  "application/xhtml+xml",
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   353
  "image/svg+xml"
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   354
};
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   355
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   356
[<span title=dom-DOMParser>Constructor</span>]
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   357
interface <dfn>DOMParser</dfn> {
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   358
  <span data-anolis-spec=dom>Document</span> <!--
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   359
  --><span title=dom-DOMParser-parseFromString>parseFromString</span>(<!--
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   360
  -->DOMString <var title>str</var>, <!--
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   361
  --><span>SupportedType</span> <var title>type</var>);
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   362
};</pre>
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   363
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   364
<p>The <dfn title=dom-DOMParser><code>DOMParser()</code></dfn> constructor
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   365
must return a new <code>DOMParser</code> object.
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   366
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   367
<p>The
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   368
<dfn title=dom-DOMParser-parseFromString><code>parseFromString(<var title>str</var>, <var title>type</var>)</code></dfn>
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   369
method must run these steps, depending on <var title>type</var>:
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   370
<dl class=switch>
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   371
  <dt>"<code title>text/html</code>"
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   372
  <dd>
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   373
    <p>Parse <var title>str</var> with an
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   374
    <span data-anolis-spec=html>HTML parser</span>, and return the newly
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   375
    created <span title=concept-document data-anolis-spec=dom>document</span>.
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   376
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   377
    <p>The <span data-anolis-spec=html>scripting flag</span> must be set to
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   378
    "disabled".
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   379
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   380
    <p class=note><code data-anolis-spec=html>meta</code> elements are not
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   381
    taken into account for the encoding used, as a Unicode stream is passed into
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   382
    the parser.
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   383
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   384
    <p class=note><code data-anolis-spec=html>script</code> elements get marked
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   385
    unexecutable and the contents of <code data-anolis-spec=html>noscript</code>
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   386
    get parsed as markup.
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   387
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   388
  <dt>"<code title>text/xml</code>"
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   389
  <dt>"<code title>application/xml</code>"
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   390
  <dt>"<code title>application/xhtml+xml</code>"
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   391
  <dt>"<code title>image/svg+xml</code>"
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   392
  <dd>
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   393
    <ol>
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   394
      <li><p>Parse <var title>str</var> with a namespace-enabled
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   395
      <span data-anolis-spec=html>XML parser</span>.
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   396
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   397
      <li><p>If the previous step didn't return an error, return the newly
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   398
      created <span title=concept-document data-anolis-spec=dom>document</span>
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   399
      and terminate these steps.
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   400
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   401
      <li><p>Let <var title>document</var> be a newly-created
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   402
      <code data-anolis-spec=dom>XMLDocument</code>.
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   403
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   404
      <li>
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   405
        <p>Let <var title>root</var> be a new
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   406
        <code data-anolis-spec=dom>Element</code>, with its
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   407
        <span title=concept-element-local-name data-anolis-spec=dom>local name</span>
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   408
        set to "<code title>parsererror</code>" and its
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   409
        <span title=concept-element-namespace data-anolis-spec=dom>namespace</span>
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   410
        set to
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   411
        "<code title>http://www.mozilla.org/newlayout/xml/parsererror.xml</code>".
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   412
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   413
        <p>At this point user agents may
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   414
        <span data-anolis-spec=dom title=concept-node-append>append</span> nodes
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   415
        to <var title>root</var>, for example to describe the nature of the
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   416
        error.
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   417
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   418
      <li><p><span data-anolis-spec=dom title=concept-node-append>Append</span>
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   419
      <var title>root</var> to <var title>document</var>.
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   420
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   421
      <li><p>Return <var title>document</var>.
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   422
    </ol>
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   423
</dl>
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   424
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   425
<p>In any case, the returned
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   426
<span title=concept-document data-anolis-spec=dom>document</span>'s
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   427
<span title=concept-document-content-type data-anolis-spec=dom>content type</span>
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   428
must be the <var title>type</var> argument.
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   429
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   430
<div class=XXX>
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   431
<p>It is currently unclear what the
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   432
<span title=concept-document-url data-anolis-spec=dom>URL</span> of the returned
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   433
<span title=concept-document data-anolis-spec=dom>document</span> should be.
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   434
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   435
<p>Results for a <a href="http://software.hixie.ch/utilities/js/live-dom-viewer/saved/1322">test case</a>:
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   436
<table>
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   437
<thead>
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   438
  <tr>
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   439
    <th><th>Gecko<th>Opera<th>Chrome
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   440
<tbody>
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   441
  <tr>
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   442
    <th>document.location <td colspan=3>null
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   443
  <tr>
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   444
    <th>document.URL <td>unsupported <td>unsupported <td>""
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   445
  <tr>
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   446
    <th>document.documentURI <td>Page URL <td>null <td>null
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   447
</table>
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   448
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   449
<p>Anne van Kesteren suggests using the default, about:blank.
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   450
</div>
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   451
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   452
<p class=note>The returned
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   453
<span title=concept-document data-anolis-spec=dom>document</span>'s
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   454
<span title=concept-document-encoding data-anolis-spec=dom>encoding</span> is
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   455
the default, UTF-8.
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   456
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   457
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   458
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   459
<h2>The <code>XMLSerializer</code> interface</h2>
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   460
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   461
<pre class=idl>[<span title=dom-XMLSerializer>Constructor</span>]
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   462
interface <dfn>XMLSerializer</dfn> {
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   463
  DOMString <span title=dom-XMLSerializer-serializeToString>serializeToString</span>(<span data-anolis-spec=dom>Node</span> <var title>root</var>);
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   464
};</pre>
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   465
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   466
<p>The <dfn title=dom-XMLSerializer><code>XMLSerializer()</code></dfn>
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   467
constructor must return a new <code>XMLSerializer</code> object.
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   468
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   469
<p>The
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   470
<dfn title=dom-XMLSerializer-serializeToString><code>serializeToString(<var title>root</var>)</code></dfn>
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   471
method must
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   472
<span title=concept-serialize-xml>produce an XML serialization</span> of
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   473
<var title>root</var> and return the result.
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   474
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   475
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   476
<h2>Extensions to the <code data-anolis-spec=dom>Element</code> interface</h2>
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   477
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   478
<pre class=idl>enum insertAdjacentHTMLPosition {
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   479
  "beforebegin",
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   480
  "afterbegin",
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   481
  "beforeend",
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   482
  "afterend"
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   483
};
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   484
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   485
partial interface <span data-anolis-spec=dom>Element</span> {
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   486
  attribute DOMString <span title=dom-Element-innerHTML>innerHTML</span>;
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   487
  attribute DOMString <span title=dom-Element-outerHTML>outerHTML</span>;
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   488
  void <span title=dom-Element-insertAdjacentHTML>insertAdjacentHTML</span>(insertAdjacentHTMLPosition <var title>position</var>, DOMString <var title>text</var>);
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   489
};</pre>
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   490
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   491
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   492
<h3><code title=dom-Element-innerHTML>innerHTML</code></h3>
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   493
<p>The <dfn title=dom-Element-innerHTML><code>innerHTML</code></dfn> IDL
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   494
attribute represents the markup of the
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   495
<code data-anolis-spec=dom>Element</code>'s contents.
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   496
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   497
<dl class=domintro>
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   498
  <!--doc.ih
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   499
  <dt><var title>document</var> . <code title=dom-Document-innerHTML>innerHTML</code> [ = <var title>value</var> ]
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   500
  <dd>
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   501
    <p>Returns a fragment of HTML or XML that represents the
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   502
    <code data-anolis-spec=dom>Document</code>.
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   503
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   504
    <p>Can be set, to replace the
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   505
    <code data-anolis-spec=dom>Document</code>'s contents with the result of
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   506
    parsing the given string.
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   507
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   508
    <p>In the case of an <span data-anolis-spec=dom>XML document</span>,
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   509
    will throw an
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   510
    <code data-anolis-spec=dom title=dom-DOMException-INVALID_STATE_ERR>INVALID_STATE_ERR</code>
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   511
    if the <code data-anolis-spec=dom>Document</code> cannot be serialized
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   512
    to XML, and a
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   513
    <code data-anolis-spec=dom title=dom-DOMException-SYNTAX_ERR>SYNTAX_ERR</code>
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   514
    if the given string is not well-formed.
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   515
  -->
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   516
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   517
  <dt><var title>element</var> . <code title=dom-Element-innerHTML>innerHTML</code> [ = <var title>value</var> ]
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   518
  <dd>
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   519
    <p>Returns a fragment of HTML or XML that represents the element's
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   520
    contents.
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   521
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   522
    <p>Can be set, to replace the contents of the element with nodes
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   523
    parsed from the given string.
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   524
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   525
    <p>In the case of an <span data-anolis-spec=dom>XML document</span>,
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   526
    will throw an
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   527
    <code data-anolis-spec=dom title=dom-DOMException-INVALID_STATE_ERR>INVALID_STATE_ERR</code>
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   528
    if the <code data-anolis-spec=dom>Element</code> cannot be serialized
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   529
    to XML, and a
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   530
    <code data-anolis-spec=dom title=dom-DOMException-SYNTAX_ERR>SYNTAX_ERR</code>
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   531
    if the given string is not well-formed.
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   532
</dl>
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   533
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   534
<div class=impl>
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   535
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   536
<p>On getting, if the <span>context object</span>'s
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   537
<span data-anolis-spec=dom title=concept-node-document>node document</span>
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   538
is an <span data-anolis-spec=dom>HTML document</span>, then the attribute
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   539
must return the result of running the
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   540
<span data-anolis-spec=html>HTML fragment serialization algorithm</span> on the
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   541
<span>context object</span>; otherwise, the <span>context object</span>'s
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   542
<span data-anolis-spec=dom title=concept-node-document>node document</span>
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   543
is an <span data-anolis-spec=dom>XML document</span>, and the attribute must
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   544
return the result of running the
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   545
<span data-anolis-spec=html>XML fragment serialization algorithm</span> on the
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   546
<span>context object</span> instead (this might throw an
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   547
exception instead of returning a string).
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   548
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   549
<p>On setting, these steps must be run:
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   550
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   551
<ol>
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   552
 <li>
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   553
  <p>Let <var title>fragment</var> be the result of invoking the
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   554
  <span title=concept-parse-fragment>fragment parsing algorithm</span> with
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   555
  the new value as <var title>markup</var>, and the
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   556
  <span>context object</span> as the <var title>context element</var>.
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   557
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   558
 <li><p><span data-anolis-spec=dom title=concept-node-replace-all>Replace all</span>
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   559
 with <var title>fragment</var> within the <span>context object</span>.
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   560
</ol>
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   561
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   562
</div>
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   563
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   564
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   565
<h3><code title=dom-Element-outerHTML>outerHTML</code></h3>
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   566
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   567
<p>The <dfn title=dom-Element-outerHTML><code>outerHTML</code></dfn> IDL
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   568
attribute represents the markup of the
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   569
<code data-anolis-spec=dom>Element</code> and its contents.
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   570
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   571
<dl class=domintro>
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   572
  <dt><var title>element</var> . <code title=dom-Element-outerHTML>outerHTML</code> [ = <var title>value</var> ]
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   573
  <dd>
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   574
    <p>Returns a fragment of HTML or XML that represents the element and its
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   575
    contents.
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   576
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   577
    <p>Can be set, to replace the element with nodes parsed from the given
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   578
    string.
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   579
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   580
    <p>In the case of an <span data-anolis-spec=dom>XML document</span>,
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   581
    will throw an
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   582
    <code data-anolis-spec=dom title=dom-DOMException-INVALID_STATE_ERR>INVALID_STATE_ERR</code>
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   583
    if the element cannot be serialized to XML, and a
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   584
    <code data-anolis-spec=dom title=dom-DOMException-SYNTAX_ERR>SYNTAX_ERR</code>
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   585
    if the given string is not well-formed.
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   586
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   587
    <p>Throws a
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   588
    <code data-anolis-spec=dom title=dom-DOMException-NO_MODIFICATION_ALLOWED_ERR>NO_MODIFICATION_ALLOWED_ERR</code>
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   589
    exception if the parent of the element is the
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   590
    <code data-anolis-spec=dom>Document</code> node.
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   591
</dl>
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   592
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   593
<div class=impl>
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   594
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   595
<p>On getting, if the <span>context object</span>'s
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   596
<span data-anolis-spec=dom title=concept-node-document>node document</span>
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   597
is an <span data-anolis-spec=dom>HTML document</span>, then the attribute
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   598
must return the result of running the
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   599
<span data-anolis-spec=html>HTML fragment serialization algorithm</span> on a
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   600
fictional node whose only child is <span>context object</span>; otherwise, the
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   601
<span>context object</span>'s
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   602
<span data-anolis-spec=dom title=concept-node-document>node document</span>
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   603
is an <span data-anolis-spec=dom>XML document</span>, and the attribute must
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   604
return the result of running the
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   605
<span data-anolis-spec=html>XML fragment serialization algorithm</span> on that
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   606
fictional node instead (this might throw an exception instead of returning a
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   607
string).
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   608
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   609
<p>On setting, the following steps must be run:
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   610
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   611
<ol>
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   612
  <li>
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   613
    <p>Let <var title>parent</var> be the <span>context object</span>'s
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   614
    <span data-anolis-spec=dom title=concept-tree-parent>parent</span>.
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   615
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   616
  <li>
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   617
    <p>If <var title>parent</var> is null, terminate these steps. There would be no
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   618
    way to obtain a reference to the nodes created even if the remaining steps
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   619
    were run.
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   620
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   621
  <li>
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   622
    <p>If <var title>parent</var> is a
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   623
    <code data-anolis-spec=dom>Document</code>, throw a
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   624
    <code data-anolis-spec=dom title=dom-DOMException-NO_MODIFICATION_ALLOWED_ERR>NO_MODIFICATION_ALLOWED_ERR</code>
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   625
    exception and terminate these steps.
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   626
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   627
  <li>
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   628
    <p>If <var title>parent</var> is a
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   629
    <code data-anolis-spec=dom>DocumentFragment</code>, let
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   630
    <var title>parent</var> be a new
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   631
    <code data-anolis-spec=dom>Element</code> with
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   632
    <ul>
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   633
      <li><code title>body</code> as its
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   634
      <span data-anolis-spec=dom title=concept-element-local-name>local name</span>,
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   635
      <li>the <span data-anolis-spec=dom>HTML namespace</span> as its
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   636
      <span data-anolis-spec=dom title=concept-element-namespace>namespace</span>, and
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   637
      <li>the <span>context object</span>'s
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   638
      <span data-anolis-spec=dom title=concept-node-document>node document</span>
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   639
      as its
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   640
      <span data-anolis-spec=dom title=concept-node-document>node document</span>.
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   641
    </ul>
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   642
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   643
  <li>
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   644
    <p>Let <var title>fragment</var> be the result of invoking the
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   645
    <span title=concept-parse-fragment>fragment parsing algorithm</span> with
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   646
    the new value as <var title>markup</var>, and <var title>parent</var> as
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   647
    the <var title>context element</var>.
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   648
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   649
  <li>
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   650
    <p><span data-anolis-spec=dom title=concept-node-replace>Replace</span>
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   651
    the <span>context object</span> with <var title>fragment</var> within
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   652
    the <span>context object</span>'s
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   653
    <span data-anolis-spec=dom title=concept-tree-parent>parent</span>.
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   654
</ol>
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   655
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   656
</div>
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   657
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   658
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   659
<h3><code title=dom-Element-insertAdjacentHTML>insertAdjacentHTML()</code></h3>
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   660
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   661
<dl class=domintro>
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   662
  <dt><var title>element</var> . <code title=dom-Element-insertAdjacentHTML>insertAdjacentHTML</code>(<var title>position</var>, <var title>text</var>)
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   663
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   664
  <dd>
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   665
    <p>Parses the given string <var title>text</var> as HTML or XML and inserts
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   666
    the resulting nodes into the tree in the position given by the
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   667
    <var title>position</var> argument, as follows:
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   668
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   669
    <dl>
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   670
      <dt>"beforebegin"
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   671
      <dd>Before the element itself.
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   672
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   673
      <dt>"afterbegin"
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   674
      <dd>Just inside the element, before its first child.
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   675
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   676
      <dt>"beforeend"
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   677
      <dd>Just inside the element, after its last child.
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   678
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   679
      <dt>"afterend"
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   680
      <dd>After the element itself.
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   681
    </dl>
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   682
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   683
    <p>Throws a TypeError exception if the <var title>position</var> argument
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   684
    has an invalid value.
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   685
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   686
    <p>In <span data-anolis-spec=dom title="XML document">XML documents</span>,
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   687
    throws a
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   688
    <code data-anolis-spec=dom title=dom-DOMException-SYNTAX_ERR>SYNTAX_ERR</code>
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   689
    exception if the given string is not well-formed.
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   690
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   691
    <p>Throws a
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   692
    <code data-anolis-spec=dom title=dom-DOMException-NO_MODIFICATION_ALLOWED_ERR>NO_MODIFICATION_ALLOWED_ERR</code>
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   693
    exception if the given position isn't possible (e.g. inserting elements
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   694
    after the root element of a <code data-anolis-spec=dom>Document</code>).
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   695
</dl>
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   696
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   697
<div class=impl>
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   698
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   699
<p>The
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   700
<dfn title=dom-Element-insertAdjacentHTML><code>insertAdjacentHTML(<var title>position</var>, <var title>text</var>)</code></dfn>
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   701
method must run these steps:
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   702
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   703
<ol>
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   704
  <li>
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   705
    <p>Use the first matching item from this list:
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   706
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   707
    <dl class=switch>
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   708
      <dt>If <var title>position</var> is an
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   709
      <span data-anolis-spec=dom>ASCII case-insensitive</span> match for
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   710
      the string "beforebegin"
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   711
      <dt>If <var title>position</var> is an
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   712
      <span data-anolis-spec=dom>ASCII case-insensitive</span> match for
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   713
      the string "afterend"
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   714
      <dd>
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   715
        <p>Let <var title>context</var> be the <span>context object</span>'s
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   716
        <span data-anolis-spec=dom title=concept-tree-parent>parent</span>.
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   717
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   718
        <p>If <var title>context</var> is null or a
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   719
        <span data-anolis-spec=dom title=concept-document>document</span>, throw
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   720
        a
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   721
        <code data-anolis-spec=dom title=dom-DOMException-NO_MODIFICATION_ALLOWED_ERR>NO_MODIFICATION_ALLOWED_ERR</code>
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   722
        and terminate these steps.
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   723
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   724
      <dt>If <var title>position</var> is an
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   725
      <span data-anolis-spec=dom>ASCII case-insensitive</span> match for
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   726
      the string "afterbegin"
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   727
      <dt>If <var title>position</var> is an
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   728
      <span data-anolis-spec=dom>ASCII case-insensitive</span> match for
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   729
      the string "beforeend"
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   730
      <dd>
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   731
        <p>Let <var title>context</var> be the <span>context object</span>.
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   732
    </dl>
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   733
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   734
  <li>
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   735
    <p>If <var title>context</var> is not an
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   736
    <code data-anolis-spec=dom>Element</code> or the following are all true:
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   737
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   738
    <ul>
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   739
      <li><var title>context</var>'s
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   740
      <span data-anolis-spec=dom title=concept-node-document>node document</span>
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   741
      is an <span data-anolis-spec=dom>HTML document</span>,
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   742
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   743
      <li><var title>context</var>'s
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   744
      <span data-anolis-spec=dom title=concept-element-local-name>local name</span>
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   745
      is "<code title>html</code>", and
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   746
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   747
      <li><var title>context</var>'s
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   748
      <span data-anolis-spec=dom title=concept-element-namespace>namespace</span>
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   749
      is the <span data-anolis-spec=dom>HTML namespace</span>;
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   750
    </ul>
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   751
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   752
    <p>let <var title>context</var> be a new
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   753
    <code data-anolis-spec=dom>Element</code> with
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   754
    <ul>
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   755
      <li><code title>body</code> as its
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   756
      <span data-anolis-spec=dom title=concept-element-local-name>local name</span>,
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   757
      <li>the <span data-anolis-spec=dom>HTML namespace</span> as its
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   758
      <span data-anolis-spec=dom title=concept-element-namespace>namespace</span>, and
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   759
      <li>the <span>context object</span>'s
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   760
      <span data-anolis-spec=dom title=concept-node-document>node document</span>
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   761
      as its
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   762
      <span data-anolis-spec=dom title=concept-node-document>node document</span>.
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   763
    </ul>
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   764
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   765
  <li>
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   766
    <p>Let <var title>fragment</var> be the result of invoking the
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   767
    <span title=concept-parse-fragment>fragment parsing algorithm</span> with
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   768
    <var title>text</var> as <var title>markup</var>, and
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   769
    <var title>parent</var> as the <var title>context element</var>.
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   770
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   771
  <li>
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   772
    <p>Use the first matching item from this list:
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   773
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   774
    <dl class=switch>
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   775
      <dt>If <var title>position</var> is an
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   776
      <span data-anolis-spec=dom>ASCII case-insensitive</span> match for
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   777
      the string "beforebegin"
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   778
      <dd>
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   779
        <p><span data-anolis-spec=dom title=concept-node-insert>Insert</span>
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   780
        <var title>fragment</var> into the <span>context object</span>'s
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   781
        <span data-anolis-spec=dom title=concept-tree-parent>parent</span>
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   782
        before the <span>context object</span>.
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   783
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   784
      <dt>If <var title>position</var> is an
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   785
      <span data-anolis-spec=dom>ASCII case-insensitive</span> match for
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   786
      the string "afterbegin"
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   787
      <dd>
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   788
        <p><span data-anolis-spec=dom title=concept-node-insert>Insert</span>
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   789
        <var title>fragment</var> into the <span>context object</span>
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   790
        before its
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   791
        <span data-anolis-spec=dom title=concept-tree-first-child>first child</span>.
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   792
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   793
      <dt>If <var title>position</var> is an
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   794
      <span data-anolis-spec=dom>ASCII case-insensitive</span> match for
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   795
      the string "beforeend"
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   796
      <dd>
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   797
        <p><span data-anolis-spec=dom title=concept-node-append>Append</span>
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   798
        <var title>fragment</var> to the <span>context object</span>.
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   799
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   800
      <dt>If <var title>position</var> is an
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   801
      <span data-anolis-spec=dom>ASCII case-insensitive</span> match for
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   802
      the string "afterend"
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   803
      <dd>
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   804
        <p><span data-anolis-spec=dom title=concept-node-insert>Insert</span>
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   805
        <var title>fragment</var> into the <span>context object</span>'s
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   806
        <span data-anolis-spec=dom title=concept-tree-parent>parent</span>
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   807
        before the <span>context object</span>'s
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   808
        <span data-anolis-spec=dom title=concept-tree-next-sibling>next sibling</span>.
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   809
    </dl>
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   810
</ol>
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   811
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   812
</div>
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   813
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   814
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   815
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   816
<h2>Extensions to the <code data-anolis-spec=dom>Text</code> interface</h2>
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   817
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   818
<pre class=idl>partial interface <span data-anolis-spec=dom>Text</span> {
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   819
  attribute boolean <span title=dom-Text-serializeAsCDATA>serializeAsCDATA</span>;
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   820
};</pre>
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   821
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   822
<dl class=domintro>
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   823
  <dt><var title>text</var> .
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   824
      <code title=dom-Text-serializeAsCDATA>serializeAsCDATA</code> [ = <var title>value</var> ]
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   825
  <dd>Controls whether, in XML, this node is serialized as a CDATA section.
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   826
</dl>
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   827
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   828
<div class=impl>
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   829
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   830
<p><code data-anolis-spec=dom>Text</code> nodes have an additional
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   831
associated flag, the <dfn>serialize as CDATA flag</dfn>.
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   832
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   833
<p>The
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   834
<dfn title=dom-Text-serializeAsCDATA><code>serializeAsCDATA</code></dfn>
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   835
attribute must return true if the <span>context object</span> has its
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   836
<span>serialize as CDATA flag</span> set, or false otherwise.
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   837
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   838
<p>Setting the <code title=dom-Text-serializeAsCDATA>serializeAsCDATA</code>
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   839
attribute must, if the new value is true, set the
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   840
<span>context object</span>'s <span>serialize as CDATA flag</span>, or unset
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   841
it otherwise.
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   842
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   843
</div>
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   844
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   845
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   846
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   847
<h2>Extensions to the <code data-anolis-spec=dom>Range</code> interface</h2>
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   848
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   849
<pre class=idl>partial interface <span data-anolis-spec=dom>Range</span> {
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   850
  <span data-anolis-spec=dom>DocumentFragment</span> <span title=dom-Range-createContextualFragment>createContextualFragment</span>(DOMString <var title>fragment</var>);
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   851
};</pre>
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   852
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   853
<dl class=domintro>
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   854
  <dt><var title>fragment</var> = <var title>range</var> . <code title=dom-Range-createContextualFragment>createContextualFragment</code>(<var title>fragment</var>)
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   855
  <dd>
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   856
    <p>Returns a <code data-anolis-spec=dom>DocumentFragment</code>, created
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   857
    from the markup string given.
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   858
</dl>
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   859
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   860
<div class=impl>
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   861
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   862
<p>The
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   863
<dfn title=dom-Range-createContextualFragment><code>createContextualFragment(<var title>fragment</var>)</code></dfn>
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   864
method must run these steps:
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   865
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   866
<ol>
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   867
  <li>
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   868
    <p>If the <span>context object</span>'s
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   869
    <span data-anolis-spec=dom title=concept-range-detached>detached flag</span>
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   870
    is set, throw an
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   871
    <code data-anolis-spec=dom title=dom-DOMException-INVALID_STATE_ERR>INVALID_STATE_ERR</code>
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   872
    exception and terminate these steps.
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   873
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   874
  <li>
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   875
    <p>Let <var title>node</var> the <span>context object</span>'s
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   876
    <span data-anolis-spec=dom title=concept-range-start-node>start node</span>.
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   877
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   878
    <p>Let <var title>element</var> be as follows, depending on
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   879
    <var title>node</var>'s interface:
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   880
    <dl class=switch>
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   881
      <dt><code data-anolis-spec=dom>Document</code>
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   882
      <dt><code data-anolis-spec=dom>DocumentFragment</code>
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   883
      <dd>null
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   884
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   885
      <dt><code data-anolis-spec=dom>Element</code>
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   886
      <dd><var title>node</var>
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   887
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   888
      <dt><code data-anolis-spec=dom>Text</code>
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   889
      <dt><code data-anolis-spec=dom>Comment</code>
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   890
      <dd><var title>node</var>'s
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   891
      <span data-anolis-spec=dom>parent element</span>
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   892
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   893
      <dt><code data-anolis-spec=dom>DocumentType</code>
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   894
      <dt><code data-anolis-spec=dom>ProcessingInstruction</code>
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   895
      <dd>DOM4 prevents this case. <span data-anolis-ref>DOM</span>
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   896
    </dl>
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   897
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   898
  <li>
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   899
    <p>If either <var title>element</var> is null or the following are all true:
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   900
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   901
    <ul>
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   902
      <li><var title>element</var>'s
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   903
      <span data-anolis-spec=dom title=concept-node-document>node document</span>
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   904
      is an <span data-anolis-spec=dom>HTML document</span>,
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   905
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   906
      <li><var title>element</var>'s
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   907
      <span data-anolis-spec=dom title=concept-element-local-name>local name</span>
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   908
      is "<code title>html</code>", and
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   909
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   910
      <li><var title>element</var>'s
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   911
      <span data-anolis-spec=dom title=concept-element-namespace>namespace</span>
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   912
      is the <span data-anolis-spec=dom>HTML namespace</span>;
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   913
    </ul>
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   914
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   915
    <p>let <var title>element</var> be a new
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   916
    <span data-anolis-spec=dom title=concept-element>element</span> with
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   917
    <ul>
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   918
      <li>"<code title>body</code>" as its
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   919
      <span data-anolis-spec=dom title=concept-element-local-name>local name</span>,
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   920
      <li>the <span data-anolis-spec=dom>HTML namespace</span> as its
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   921
      <span data-anolis-spec=dom title=concept-element-namespace>namespace</span>, and
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   922
      <li>the <span>context object</span>'s
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   923
      <span data-anolis-spec=dom title=concept-node-document>node document</span>
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   924
      as its
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   925
      <span data-anolis-spec=dom title=concept-node-document>node document</span>.
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   926
    </ul>
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   927
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   928
  <li>
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   929
    <p>Let <var title>fragment node</var> be the result of invoking the
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   930
    <span title=concept-parse-fragment>fragment parsing algorithm</span> with
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   931
    <var title>fragment</var> as <var title>markup</var>, and
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   932
    <var title>element</var> as the <var title>context element</var>.
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   933
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   934
  <li>
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   935
    <p>Unmark all scripts in <var title>fragment node</var> as
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   936
    "already started".
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   937
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   938
  <li>
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   939
    <p>Return <var title>fragment node</var>.
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   940
</ol>
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   941
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   942
</div>
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   943
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   944
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   945
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   946
<h2 class=no-num>References</h2>
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   947
<p>All references are normative unless marked "Non-normative".</p>
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   948
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   949
<div id=anolis-references></div>
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   950
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   951
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   952
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   953
<h2 class=no-num>Acknowledgements</h2>
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   954
<p>Thanks to Ms2ger for maintaining the initial drafts of this specification.
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   955
<p>Thanks to
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   956
Anne van Kesteren, Aryeh Gregor, Henri Sivonen, Simon Pieters and timeless
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   957
for their useful comments.
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   958
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   959
<p>Special thanks to Ian Hickson for defining the
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   960
<code title=dom-Element-innerHTML>innerHTML</code> and
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   961
<code title=dom-Element-outerHTML>outerHTML</code> attributes, and the
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   962
<code title=dom-Element-insertAdjacentHTML>insertAdjacentHTML()</code> method in
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   963
<cite>HTML</cite> and his useful comments.
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   964
<span data-anolis-ref class=informative>HTML</span>
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   965
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   966
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   967
<script src="http://www.whatwg.org/specs/web-apps/current-work/dfn.js"></script>
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   968