index.html
author travil
Mon, 18 Nov 2013 16:20:44 -0800
changeset 18 15a9ba955a3a
parent 17 b1c206041ab9
child 19 1ec229b6723a
permissions -rw-r--r--
Expanded the XML Serialization algorithm for Elements (and a sligt enhancement
for attribute serialization.
1
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
     1
<!doctype html>
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
     2
<html>
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
     3
<head>
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
     4
    <meta charset=UTF-8>
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
     5
    <title>DOM Parsing and Serialization</title>
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
     6
    <style>
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
     7
        /* Make these stand-out more... */
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
     8
        .externalDFN {
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
     9
            font-style: italic;
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
    10
            background-color: #fff9d6;
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
    11
        }
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
    12
        /* Switch statement */
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
    13
        dl.switch dt::before {
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
    14
            content: "↪ ";
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
    15
            margin-left: 1em;
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
    16
        }
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
    17
        /* Better spacing around various lists (implied paragraph children) */
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
    18
        ol > li, section:not(#toc) ul > li, section dl > dt {
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
    19
            margin: 1em 0;
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
    20
        }
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
    21
        /* domintro styling */
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
    22
        dl.domintro {
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
    23
            background-color: rgb(221, 255, 221);
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
    24
            padding: 1em 0.5em 1em 2em;
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
    25
            clear: both;
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
    26
        }
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
    27
        dl.domintro dt {
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
    28
            color: black;
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
    29
        }
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
    30
        dl.domintro > dd {
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
    31
            color: green;
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
    32
        }
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
    33
        dl.domintro::before {
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
    34
            float: right;
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
    35
            background-color: white;
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
    36
            display: block;
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
    37
            border: 2px solid black;
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
    38
            color: green;
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
    39
            margin-top: -20px;
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
    40
            padding: 2px;
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
    41
            content: "This box is non-normative. Implementation requirements are given below this box.";
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
    42
        }
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
    43
        /* Fancy table stuff */
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
    44
        table {
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
    45
            border-collapse: collapse;
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
    46
        }
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
    47
        thead tr {
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
    48
            border-bottom: 2px solid black;
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
    49
        }
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
    50
        tbody tr:not(:last-child) {
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
    51
            border-bottom: 1px solid black;
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
    52
        }
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
    53
        td {
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
    54
            border-left: 1px solid black;
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
    55
            padding: 4px;
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
    56
        }
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
    57
        /* Extra IDL :-) */
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
    58
        .extraidl {
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
    59
            line-height: 120%;
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
    60
            padding: 1em;
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
    61
            border-top: 1px solid #90b8de;
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
    62
            border-bottom: 1px solid #90b8de;
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
    63
        }
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
    64
        .extraidl:before {
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
    65
            width: 150px;
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
    66
            color: #fff;
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
    67
            padding: 3px;
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
    68
            font-weight: bold;
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
    69
            font-family: initial;
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
    70
            margin: -1em 0 1em -1em;
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
    71
            display: block;
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
    72
            content: "WebIDL";
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
    73
            background-color: rgb(144, 184, 222);
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
    74
        }
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
    75
    </style>
8
7bddbad3c43e Update http -> https
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 6
diff changeset
    76
    <script type="text/javascript" src='https://www.w3.org/Tools/respec/respec-w3c-common' class='remove' async></script>
1
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
    77
    <script type="text/javascript" src="respecConfig.js" class='remove'></script>
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
    78
</head>
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
    79
<body>
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
    80
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
    81
    <section id="abstract">
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
    82
       <p>This specification defines various APIs for programmatic access to 
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
    83
          HTML and generic XML parsers by web applications for use in parsing 
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
    84
          and serializing DOM nodes</p>
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
    85
    </section>
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
    86
12
378c0aa679ec Boilerplate update to latest respec features; added relevant links to WHATWG
travil
parents: 11
diff changeset
    87
    <section id="sotd"></section>
1
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
    88
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
    89
3
881b6e205d22 PubRules fixup
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 1
diff changeset
    90
    <section id="issues" class="introductory">
1
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
    91
        <h1>Issues</h1>
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
    92
        
13
49bc54f5937f First issue removed, and issues section clarified.
travil
parents: 12
diff changeset
    93
        <p class=issue>Open issues that appear throughout the remainder of this 
49bc54f5937f First issue removed, and issues section clarified.
travil
parents: 12
diff changeset
    94
        document will be highlighted like this.</p>
1
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
    95
        
13
49bc54f5937f First issue removed, and issues section clarified.
travil
parents: 12
diff changeset
    96
        <!-- I don't believe this is a point of contention anymore...
1
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
    97
        <p class="issue">This specification currently requires using the XML 
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
    98
        Parser for some APIs, when in an XML document. It is unclear whether 
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
    99
        consensus can be found for this approach.</p>
13
49bc54f5937f First issue removed, and issues section clarified.
travil
parents: 12
diff changeset
   100
        -->
1
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   101
    </section>
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   102
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   103
    <section id="conformance">
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   104
        <p>Requirements phrased in the imperative as part of algorithms
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   105
        (such as "strip any leading space characters" or "return false and
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   106
        terminate these steps") are to be interpreted with the meaning of the
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   107
        key word ("must", "should", "may", etc) used in introducing the
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   108
        algorithm.</p>
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   109
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   110
        <p>Conformance requirements phrased as algorithms or specific steps
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   111
        may be implemented in any manner, so long as the end result is
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   112
        equivalent. (In particular, the algorithms defined in this
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   113
        specification are intended to be easy to follow, and not intended to
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   114
        be performant.)</p>
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   115
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   116
        <p id="hardwareLimitations">User agents may impose
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   117
        implementation-specific limits on otherwise unconstrained inputs,
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   118
        e.g. to prevent denial of service attacks, to guard against running
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   119
        out of memory, or to work around platform-specific limitations.</p>
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   120
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   121
        <p>When a method or an attribute is said to call another method or 
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   122
        attribute, the user agent must invoke its internal API for that 
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   123
        attribute or method so that e.g. the author can't change the behavior 
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   124
        by overriding attributes or methods with custom properties or functions 
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   125
        in ECMAScript.</p>
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   126
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   127
        <p>Unless otherwise stated, string comparisons are done in a <a
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   128
        data-spec="DOM4" class="externalDFN" title="case-sensitive">
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   129
        case-sensitive</a> manner.</p>
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   130
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   131
        <p>If an algorithm calls into another algorithm, any exception that is 
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   132
        thrown by the latter (unless it is explicitly caught), must cause the 
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   133
        former to terminate, and the exception to be propagated up to 
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   134
        <em>its</em> caller.</p>
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   135
    
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   136
        <section>
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   137
            <h2>Dependencies</h2>
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   138
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   139
            <p>The IDL fragments in this specification must be interpreted as
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   140
            required for conforming IDL fragments, as described in the Web IDL
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   141
            specification. [[!WEBIDL]]</p>
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   142
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   143
            <p>Some of the terms used in this specification are defined in
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   144
            [[DOM4]], [[HTML5]], and [[XML10]].
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   145
        </section>
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   146
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   147
        <section>
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   148
            <h2>Extensibility</h2>
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   149
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   150
            <p>Vendor-specific proprietary extensions to this specification are
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   151
            strongly discouraged. Authors must not use such extensions, as
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   152
            doing so reduces interoperability and fragments the user base,
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   153
            allowing only users of specific user agents to access the content in
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   154
            question.</p>
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   155
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   156
            <p>If vendor-specific extensions are needed, the members should be
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   157
            prefixed by vendor-specific strings to prevent clashes with future
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   158
            versions of this specification. Extensions must be defined so that
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   159
            the use of extensions neither contradicts nor causes the
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   160
            non-conformance of functionality defined in the specification.</p>
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   161
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   162
            <p>When vendor-neutral extensions to this specification are needed,
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   163
            either this specification can be updated accordingly, or an
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   164
            extension specification can be written that overrides the
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   165
            requirements in this specification. When someone applying this
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   166
            specification to their activities decides that they will recognise
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   167
            the requirements of such an extension specification, it becomes an
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   168
            <dfn title="other applicable specifications">applicable
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   169
            specification</dfn> for the purposes of conformance requirements in
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   170
            this specification.</p>
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   171
            <!-- http://www.w3.org/mid/17E341CD-E790-422C-9F9A-69347EE01CEB@iki.fi -->
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   172
        </section>
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   173
    </section>
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   174
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   175
    <section>
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   176
        <h2>Terminology</h2>
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   177
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   178
        <p>The term <dfn>context object</dfn> means the object on which the method or
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   179
        attribute being discussed was called.
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   180
    </section>
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   181
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   182
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   183
    <section>
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   184
        <h1>Parsing and serializing <a title="node" data-spec="DOM4" class="externalDFN">Node</a>s</h1>
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   185
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   186
        <section>
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   187
            <h2>Parsing</h2>
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   188
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   189
            <p>The following steps form the
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   190
            <dfn title="concept-parse-fragment">fragment parsing algorithm</dfn>, whose
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   191
            arguments are a <var>markup</var> string and a
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   192
            <var>context element</var>.
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   193
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   194
            <ol>
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   195
              <li>
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   196
                <p>If the <var>context element</var>'s
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   197
                <a title="concept-node-document" data-spec="DOM4" class="externalDFN">node document</a>
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   198
                is an <a title="html-document" data-spec="DOM4" class="externalDFN">HTML document</a>: let
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   199
                <var>algorithm</var> be the
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   200
                <a title="html-fragment-parsing-algorithm" data-spec="HTML5" class="externalDFN">HTML 
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   201
                fragment parsing algorithm</a>.</p>
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   202
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   203
                <p>If the <var>context element</var>'s
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   204
                <a title="concept-node-document" data-spec="DOM4" class="externalDFN">node document</a>
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   205
                is an <a title="xml-document" data-spec="DOM4" class="externalDFN">XML document</a>: let
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   206
                <var>algorithm</var> be the
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   207
                <a title="xml-fragment-parsing-algorithm" data-spec="HTML5" class="externalDFN">XML 
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   208
                fragment parsing algorithm</a>.</p>
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   209
              </li>
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   210
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   211
              <li>Invoke <var>algorithm</var> with <var>markup</var> as
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   212
              the <var>input</var>, and <var>context element</var> as the
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   213
              <var><a data-spec="HTML5" title="concept-frag-parse-context" class="externalDFN">context</a></var>
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   214
              element.</li>
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   215
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   216
              <li>Let <var>new children</var> be the nodes returned.</li>
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   217
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   218
              <li>Let <var>fragment</var> be a new
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   219
              <code><a title="documentfragment" data-spec="DOM4" class="externalDFN">DocumentFragment</a></code> whose
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   220
              <a title="concept-node-document" data-spec="DOM4" class="externalDFN">node document</a>
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   221
              is <var>context element</var>'s
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   222
              <a title="concept-node-document" data-spec="DOM4" class="externalDFN">node document</a>.
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   223
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   224
              <li><a data-spec="DOM4" title="concept-node-append" class="externalDFN">Append</a>
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   225
              each <a data-spec="DOM4" title="concept-node" class="externalDFN">node</a> in
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   226
              <var>new children</var> to <var>fragment</var> (in order).
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   227
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   228
              <p class=note>This ensures the
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   229
              <a title="concept-node-document" data-spec="DOM4" class="externalDFN">node document</a>
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   230
              for the new <a data-spec="DOM4" title=concept-node class="externalDFN">nodes</a> is correct.
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   231
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   232
              <li>Return <var>fragment</var>.
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   233
            </ol>
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   234
    </section>
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   235
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   236
    <section>
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   237
        <h2>Serializing</h2>
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   238
        <p>To <dfn title=concept-serialize>serialize</dfn> a
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   239
        <a title="node" data-spec="DOM4" class="externalDFN">Node</a> <var>node</var>, the user agent
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   240
        must run the following steps:
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   241
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   242
        <ol>
18
15a9ba955a3a Expanded the XML Serialization algorithm for Elements (and a sligt enhancement
travil
parents: 17
diff changeset
   243
            <li>Let <var>document</var> be <var>node</var>'s
15a9ba955a3a Expanded the XML Serialization algorithm for Elements (and a sligt enhancement
travil
parents: 17
diff changeset
   244
                <a title="concept-node-document" data-spec="DOM4" class="externalDFN">node document</a>.
15a9ba955a3a Expanded the XML Serialization algorithm for Elements (and a sligt enhancement
travil
parents: 17
diff changeset
   245
            <li>If <var>document</var> is an
15a9ba955a3a Expanded the XML Serialization algorithm for Elements (and a sligt enhancement
travil
parents: 17
diff changeset
   246
                <a title="html-document" data-spec="DOM4" class="externalDFN">HTML document</a>, 
15a9ba955a3a Expanded the XML Serialization algorithm for Elements (and a sligt enhancement
travil
parents: 17
diff changeset
   247
                return an <a title=concept-serialize-html>HTML serialization</a> of <var>node</var>.
15a9ba955a3a Expanded the XML Serialization algorithm for Elements (and a sligt enhancement
travil
parents: 17
diff changeset
   248
            <li>Otherwise, <var>document</var> is an
15a9ba955a3a Expanded the XML Serialization algorithm for Elements (and a sligt enhancement
travil
parents: 17
diff changeset
   249
                <a title="xml-document" data-spec="DOM4" class="externalDFN">XML document</a>.
15a9ba955a3a Expanded the XML Serialization algorithm for Elements (and a sligt enhancement
travil
parents: 17
diff changeset
   250
            <li>Let <var>context namespace</var> be <code>null</code>.
15a9ba955a3a Expanded the XML Serialization algorithm for Elements (and a sligt enhancement
travil
parents: 17
diff changeset
   251
            <li>Let <var>prefix list</var> be an empty list. The <var>prefix list</var> will 
15a9ba955a3a Expanded the XML Serialization algorithm for Elements (and a sligt enhancement
travil
parents: 17
diff changeset
   252
                contain strings that represent a history of namespace prefixes [[XML-NAMES]]
15a9ba955a3a Expanded the XML Serialization algorithm for Elements (and a sligt enhancement
travil
parents: 17
diff changeset
   253
                that have been serialized by the <a title=concept-serialize-xml>XML serialization</a>
15a9ba955a3a Expanded the XML Serialization algorithm for Elements (and a sligt enhancement
travil
parents: 17
diff changeset
   254
                algorithm for a subtree.
15a9ba955a3a Expanded the XML Serialization algorithm for Elements (and a sligt enhancement
travil
parents: 17
diff changeset
   255
            <li>Return an <a title=concept-serialize-xml>XML serialization</a> of <var>node</var>
15a9ba955a3a Expanded the XML Serialization algorithm for Elements (and a sligt enhancement
travil
parents: 17
diff changeset
   256
                providing to the algorithm <var>context namespace</var> as the <var>namespace</var>
15a9ba955a3a Expanded the XML Serialization algorithm for Elements (and a sligt enhancement
travil
parents: 17
diff changeset
   257
                and <var>prefix list</var> as <var>prefixes</var>.
1
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   258
        </ol>
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   259
17
b1c206041ab9 Small consistency fix plus validation error fix.
travil
parents: 16
diff changeset
   260
        <p>To produce an <dfn title=concept-serialize-html>HTML serialization</dfn> of a
1
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   261
        <a title="node" data-spec="DOM4" class="externalDFN">Node</a> <var>node</var>, the user agent
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   262
        must run the appropriate steps, depending on <var>node</var>'s interface:
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   263
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   264
        <dl class=switch>
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   265
          <dt><code><a title="element" data-spec="DOM4" class="externalDFN">Element</a></code>
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   266
          <dt><code><a title="document" data-spec="DOM4" class="externalDFN">Document</a></code>
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   267
          <dt><code><a title="documentfragment" data-spec="DOM4" class="externalDFN">DocumentFragment</a></code>
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   268
          <dd><p>Run the
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   269
          <a data-spec="HTML5" title="html-fragment-serialization-algorithm" class="externalDFN">HTML fragment serialization algorithm</a> on
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   270
          <var>node</var>. Return the returned string.
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   271
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   272
          <dt><code><a title="comment" data-spec="DOM4" class="externalDFN">Comment</a></code>
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   273
          <dt><code><a title="text" data-spec="DOM4" class="externalDFN">Text</a></code>
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   274
          <dt><code><a title="documenttype" data-spec="DOM4" class="externalDFN">DocumentType</a></code>
16
809c9f8a41a9 Factored the DOCTYPE serialization algorithm to additionally support HTML docs
travil
parents: 15
diff changeset
   275
          <dd><p>Run the steps to <a title=concept-serialize-doctype>produce a DocumentType 
809c9f8a41a9 Factored the DOCTYPE serialization algorithm to additionally support HTML docs
travil
parents: 15
diff changeset
   276
                serialization</a> of <var>node</var> and return the string this produced.</p>
1
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   277
          <dt><code><a title="processinginstruction" data-spec="DOM4" class="externalDFN">ProcessingInstruction</a></code>
3
881b6e205d22 PubRules fixup
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 1
diff changeset
   278
          <dd class="issue">Define how these are serialized...</dd>
1
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   279
        </dl>
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   280
17
b1c206041ab9 Small consistency fix plus validation error fix.
travil
parents: 16
diff changeset
   281
        <p>To produce an <dfn title=concept-serialize-xml>XML serialization</dfn> of a
18
15a9ba955a3a Expanded the XML Serialization algorithm for Elements (and a sligt enhancement
travil
parents: 17
diff changeset
   282
            <a title="node" data-spec="DOM4" class="externalDFN">Node</a> <var>node</var> given a
15a9ba955a3a Expanded the XML Serialization algorithm for Elements (and a sligt enhancement
travil
parents: 17
diff changeset
   283
            context namespace <var>namespace</var> and prefix list <var>prefixes</var>, the user 
15a9ba955a3a Expanded the XML Serialization algorithm for Elements (and a sligt enhancement
travil
parents: 17
diff changeset
   284
            agent must run the appropriate steps, depending on <var>node</var>'s interface:</p>
15a9ba955a3a Expanded the XML Serialization algorithm for Elements (and a sligt enhancement
travil
parents: 17
diff changeset
   285
        
15a9ba955a3a Expanded the XML Serialization algorithm for Elements (and a sligt enhancement
travil
parents: 17
diff changeset
   286
        <p class=note>The following steps for serializing a <var>node</var> belonging to an
15a9ba955a3a Expanded the XML Serialization algorithm for Elements (and a sligt enhancement
travil
parents: 17
diff changeset
   287
            <a title="xml-document" data-spec="DOM4" class="externalDFN">XML document</a> are 
15a9ba955a3a Expanded the XML Serialization algorithm for Elements (and a sligt enhancement
travil
parents: 17
diff changeset
   288
            designed to produce a serialization that is compatible with the
15a9ba955a3a Expanded the XML Serialization algorithm for Elements (and a sligt enhancement
travil
parents: 17
diff changeset
   289
            <a title="html-parser" data-spec="HTML5" class="externalDFN">HTML parser</a>. For example,
15a9ba955a3a Expanded the XML Serialization algorithm for Elements (and a sligt enhancement
travil
parents: 17
diff changeset
   290
            elements in the XHTML namespace that contain no child nodes are serialized with
15a9ba955a3a Expanded the XML Serialization algorithm for Elements (and a sligt enhancement
travil
parents: 17
diff changeset
   291
            an explicit begin and end tag rather than using the XML self-closing syntax. Exceptions 
15a9ba955a3a Expanded the XML Serialization algorithm for Elements (and a sligt enhancement
travil
parents: 17
diff changeset
   292
            to this rule occur when an XHTML element's equivalent HTML element would be auto-closed
15a9ba955a3a Expanded the XML Serialization algorithm for Elements (and a sligt enhancement
travil
parents: 17
diff changeset
   293
            by the HTML parser.
15a9ba955a3a Expanded the XML Serialization algorithm for Elements (and a sligt enhancement
travil
parents: 17
diff changeset
   294
            
1
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   295
        <dl class=switch>
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   296
            <dt><code><a title="element" data-spec="DOM4" class="externalDFN">Element</a></code>
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   297
            <dd>
18
15a9ba955a3a Expanded the XML Serialization algorithm for Elements (and a sligt enhancement
travil
parents: 17
diff changeset
   298
                <p>Run the following algorithm:
1
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   299
                <ol>
18
15a9ba955a3a Expanded the XML Serialization algorithm for Elements (and a sligt enhancement
travil
parents: 17
diff changeset
   300
                    <!-- "namespace" was passed via the caller -->
15a9ba955a3a Expanded the XML Serialization algorithm for Elements (and a sligt enhancement
travil
parents: 17
diff changeset
   301
                    <li>Let <var>markup</var> be an empty string.
15a9ba955a3a Expanded the XML Serialization algorithm for Elements (and a sligt enhancement
travil
parents: 17
diff changeset
   302
                    <li>Let <var>list</var> be a copy of the <var>prefixes</var> array.
15a9ba955a3a Expanded the XML Serialization algorithm for Elements (and a sligt enhancement
travil
parents: 17
diff changeset
   303
                    <li>Let <var>prefix</var> be the value of <var>node</var>'s 
15a9ba955a3a Expanded the XML Serialization algorithm for Elements (and a sligt enhancement
travil
parents: 17
diff changeset
   304
                        <code><a title="dom-Element-prefix" data-spec="DOM4" class="externalDFN">prefix</a></code>
15a9ba955a3a Expanded the XML Serialization algorithm for Elements (and a sligt enhancement
travil
parents: 17
diff changeset
   305
                        attribute.
15a9ba955a3a Expanded the XML Serialization algorithm for Elements (and a sligt enhancement
travil
parents: 17
diff changeset
   306
                    <li>Let <var>ns</var> be the value of <var>node</var>'s 
15a9ba955a3a Expanded the XML Serialization algorithm for Elements (and a sligt enhancement
travil
parents: 17
diff changeset
   307
                        <code><a title="dom-Element-namespaceURI" data-spec="DOM4" class="externalDFN">namespaceURI</a></code>
15a9ba955a3a Expanded the XML Serialization algorithm for Elements (and a sligt enhancement
travil
parents: 17
diff changeset
   308
                        attribute.
15a9ba955a3a Expanded the XML Serialization algorithm for Elements (and a sligt enhancement
travil
parents: 17
diff changeset
   309
                    <li>Let a <var>skip end tag</var> flag have the value <code>false</code>.
15a9ba955a3a Expanded the XML Serialization algorithm for Elements (and a sligt enhancement
travil
parents: 17
diff changeset
   310
                    <li>Append "<code>&lt;</code>" (U+003C LESS-THAN SIGN) to <var>markup</var>.
15a9ba955a3a Expanded the XML Serialization algorithm for Elements (and a sligt enhancement
travil
parents: 17
diff changeset
   311
                    <li>If <var>prefix</var> is not <code>null</code> then append the following to
15a9ba955a3a Expanded the XML Serialization algorithm for Elements (and a sligt enhancement
travil
parents: 17
diff changeset
   312
                        <var>markup</var>:
15a9ba955a3a Expanded the XML Serialization algorithm for Elements (and a sligt enhancement
travil
parents: 17
diff changeset
   313
                        <ol>
15a9ba955a3a Expanded the XML Serialization algorithm for Elements (and a sligt enhancement
travil
parents: 17
diff changeset
   314
                            <li>The value of <var>prefix</var>;
15a9ba955a3a Expanded the XML Serialization algorithm for Elements (and a sligt enhancement
travil
parents: 17
diff changeset
   315
                            <li>"<code>:</code>" (U+003A COLON).
15a9ba955a3a Expanded the XML Serialization algorithm for Elements (and a sligt enhancement
travil
parents: 17
diff changeset
   316
                        </ol>
15a9ba955a3a Expanded the XML Serialization algorithm for Elements (and a sligt enhancement
travil
parents: 17
diff changeset
   317
                    <li>Append the value of <var>node</var>'s
15a9ba955a3a Expanded the XML Serialization algorithm for Elements (and a sligt enhancement
travil
parents: 17
diff changeset
   318
                        <code><a title="dom-Element-localName" data-spec="DOM4" class="externalDFN">localName</a></code>
15a9ba955a3a Expanded the XML Serialization algorithm for Elements (and a sligt enhancement
travil
parents: 17
diff changeset
   319
                        attribute to <var>markup</var>.
15a9ba955a3a Expanded the XML Serialization algorithm for Elements (and a sligt enhancement
travil
parents: 17
diff changeset
   320
                    <p class="issue">escaping / throwing
15a9ba955a3a Expanded the XML Serialization algorithm for Elements (and a sligt enhancement
travil
parents: 17
diff changeset
   321
                    <li>If <var>namespace</var> is not equal to <var>ns</var> (the <var>node</var>'s
15a9ba955a3a Expanded the XML Serialization algorithm for Elements (and a sligt enhancement
travil
parents: 17
diff changeset
   322
                        own namespace is different from its parent), and <var>prefix</var> is not 
15a9ba955a3a Expanded the XML Serialization algorithm for Elements (and a sligt enhancement
travil
parents: 17
diff changeset
   323
                        <code>null</code>, then run these sub-steps:
15a9ba955a3a Expanded the XML Serialization algorithm for Elements (and a sligt enhancement
travil
parents: 17
diff changeset
   324
                        <p class=note>These steps determine whether a namespace prefix is 
15a9ba955a3a Expanded the XML Serialization algorithm for Elements (and a sligt enhancement
travil
parents: 17
diff changeset
   325
                            serialized for this node.
15a9ba955a3a Expanded the XML Serialization algorithm for Elements (and a sligt enhancement
travil
parents: 17
diff changeset
   326
                        <ol>
15a9ba955a3a Expanded the XML Serialization algorithm for Elements (and a sligt enhancement
travil
parents: 17
diff changeset
   327
                            <li>If <var>list</var> contains the value of <var>prefix</var>, then
15a9ba955a3a Expanded the XML Serialization algorithm for Elements (and a sligt enhancement
travil
parents: 17
diff changeset
   328
                                abort these sub-steps. This namespace prefix
15a9ba955a3a Expanded the XML Serialization algorithm for Elements (and a sligt enhancement
travil
parents: 17
diff changeset
   329
                                was already serialized.
15a9ba955a3a Expanded the XML Serialization algorithm for Elements (and a sligt enhancement
travil
parents: 17
diff changeset
   330
                            <li>Add the value of <var>prefix</var> to <var>list</var>.
15a9ba955a3a Expanded the XML Serialization algorithm for Elements (and a sligt enhancement
travil
parents: 17
diff changeset
   331
                            <li>If <var>node</var> has an attribute whose 
15a9ba955a3a Expanded the XML Serialization algorithm for Elements (and a sligt enhancement
travil
parents: 17
diff changeset
   332
                                <a title=concept-attribute-name data-spec="DOM4" class="externalDFN">name</a>
15a9ba955a3a Expanded the XML Serialization algorithm for Elements (and a sligt enhancement
travil
parents: 17
diff changeset
   333
                                attribute value is equal to the concatenation of the string 
15a9ba955a3a Expanded the XML Serialization algorithm for Elements (and a sligt enhancement
travil
parents: 17
diff changeset
   334
                                "<code>xmlns:</code>" with the value of <var>prefix</var>, abort 
15a9ba955a3a Expanded the XML Serialization algorithm for Elements (and a sligt enhancement
travil
parents: 17
diff changeset
   335
                                these sub-steps. The <var>prefix</var> namespace definition will be 
15a9ba955a3a Expanded the XML Serialization algorithm for Elements (and a sligt enhancement
travil
parents: 17
diff changeset
   336
                                serialized later as part of the <a title=concept-serialize-xml-attributes>XML 
15a9ba955a3a Expanded the XML Serialization algorithm for Elements (and a sligt enhancement
travil
parents: 17
diff changeset
   337
                                serialization of <var>node</var>'s attributes</a>.
15a9ba955a3a Expanded the XML Serialization algorithm for Elements (and a sligt enhancement
travil
parents: 17
diff changeset
   338
                            <li>Append the following to <var>markup</var>, in order:
15a9ba955a3a Expanded the XML Serialization algorithm for Elements (and a sligt enhancement
travil
parents: 17
diff changeset
   339
                            <ol>
15a9ba955a3a Expanded the XML Serialization algorithm for Elements (and a sligt enhancement
travil
parents: 17
diff changeset
   340
                                <li>"<code> </code>" (U+0020 SPACE);
15a9ba955a3a Expanded the XML Serialization algorithm for Elements (and a sligt enhancement
travil
parents: 17
diff changeset
   341
                                <li>The string "<code>xmlns:</code>";
15a9ba955a3a Expanded the XML Serialization algorithm for Elements (and a sligt enhancement
travil
parents: 17
diff changeset
   342
                                <li>The value of <var>prefix</var>;
15a9ba955a3a Expanded the XML Serialization algorithm for Elements (and a sligt enhancement
travil
parents: 17
diff changeset
   343
                                <li>"<code>="</code>" (U+003D EQUALS SIGN, U+0022 QUOTATION MARK);
15a9ba955a3a Expanded the XML Serialization algorithm for Elements (and a sligt enhancement
travil
parents: 17
diff changeset
   344
                                <li>The value of <var>ns</var>;
15a9ba955a3a Expanded the XML Serialization algorithm for Elements (and a sligt enhancement
travil
parents: 17
diff changeset
   345
                                <li>"<code>"</code>" (U+0022 QUOTATION MARK);
15a9ba955a3a Expanded the XML Serialization algorithm for Elements (and a sligt enhancement
travil
parents: 17
diff changeset
   346
                            </ol>
15a9ba955a3a Expanded the XML Serialization algorithm for Elements (and a sligt enhancement
travil
parents: 17
diff changeset
   347
                        </ol>
15a9ba955a3a Expanded the XML Serialization algorithm for Elements (and a sligt enhancement
travil
parents: 17
diff changeset
   348
                    <li>If <var>namespace</var> is not equal to <var>ns</var>, and <var>prefix</var>
15a9ba955a3a Expanded the XML Serialization algorithm for Elements (and a sligt enhancement
travil
parents: 17
diff changeset
   349
                        is <code>null</code>, then run these sub-steps:
15a9ba955a3a Expanded the XML Serialization algorithm for Elements (and a sligt enhancement
travil
parents: 17
diff changeset
   350
                        <p class=note>These steps determine whether a default namespace is 
15a9ba955a3a Expanded the XML Serialization algorithm for Elements (and a sligt enhancement
travil
parents: 17
diff changeset
   351
                            serialized for this node.
15a9ba955a3a Expanded the XML Serialization algorithm for Elements (and a sligt enhancement
travil
parents: 17
diff changeset
   352
                        <ol>
15a9ba955a3a Expanded the XML Serialization algorithm for Elements (and a sligt enhancement
travil
parents: 17
diff changeset
   353
                            <li>If <var>node</var> has an attribute whose 
15a9ba955a3a Expanded the XML Serialization algorithm for Elements (and a sligt enhancement
travil
parents: 17
diff changeset
   354
                                <a title=concept-attribute-name data-spec="DOM4" class="externalDFN">name</a>
15a9ba955a3a Expanded the XML Serialization algorithm for Elements (and a sligt enhancement
travil
parents: 17
diff changeset
   355
                                attribute value is equal to "<code>xmlns</code>", abort 
15a9ba955a3a Expanded the XML Serialization algorithm for Elements (and a sligt enhancement
travil
parents: 17
diff changeset
   356
                                these sub-steps. The default namespace will be 
15a9ba955a3a Expanded the XML Serialization algorithm for Elements (and a sligt enhancement
travil
parents: 17
diff changeset
   357
                                serialized later as part of the <a title=concept-serialize-xml-attributes>XML 
15a9ba955a3a Expanded the XML Serialization algorithm for Elements (and a sligt enhancement
travil
parents: 17
diff changeset
   358
                                serialization of <var>node</var>'s attributes</a>.
15a9ba955a3a Expanded the XML Serialization algorithm for Elements (and a sligt enhancement
travil
parents: 17
diff changeset
   359
                            <li>Append the following to <var>markup</var>, in order:
15a9ba955a3a Expanded the XML Serialization algorithm for Elements (and a sligt enhancement
travil
parents: 17
diff changeset
   360
                            <ol>
15a9ba955a3a Expanded the XML Serialization algorithm for Elements (and a sligt enhancement
travil
parents: 17
diff changeset
   361
                                <li>"<code> </code>" (U+0020 SPACE);
15a9ba955a3a Expanded the XML Serialization algorithm for Elements (and a sligt enhancement
travil
parents: 17
diff changeset
   362
                                <li>The string "<code>xmlns</code>";
15a9ba955a3a Expanded the XML Serialization algorithm for Elements (and a sligt enhancement
travil
parents: 17
diff changeset
   363
                                <li>"<code>="</code>" (U+003D EQUALS SIGN, U+0022 QUOTATION MARK);
15a9ba955a3a Expanded the XML Serialization algorithm for Elements (and a sligt enhancement
travil
parents: 17
diff changeset
   364
                                <li>The value of <var>ns</var>;
15a9ba955a3a Expanded the XML Serialization algorithm for Elements (and a sligt enhancement
travil
parents: 17
diff changeset
   365
                                <li>"<code>"</code>" (U+0022 QUOTATION MARK);
15a9ba955a3a Expanded the XML Serialization algorithm for Elements (and a sligt enhancement
travil
parents: 17
diff changeset
   366
                            </ol>
15a9ba955a3a Expanded the XML Serialization algorithm for Elements (and a sligt enhancement
travil
parents: 17
diff changeset
   367
                        </ol>
15a9ba955a3a Expanded the XML Serialization algorithm for Elements (and a sligt enhancement
travil
parents: 17
diff changeset
   368
                    <li>Append to <var>markup</var> the result of the 
15a9ba955a3a Expanded the XML Serialization algorithm for Elements (and a sligt enhancement
travil
parents: 17
diff changeset
   369
                        <a title=concept-serialize-xml-attributes>XML 
15a9ba955a3a Expanded the XML Serialization algorithm for Elements (and a sligt enhancement
travil
parents: 17
diff changeset
   370
                        serialization of <var>node</var>'s attributes</a>, passing <var>list</var>
15a9ba955a3a Expanded the XML Serialization algorithm for Elements (and a sligt enhancement
travil
parents: 17
diff changeset
   371
                        as the <var>prefixes</var>.
15a9ba955a3a Expanded the XML Serialization algorithm for Elements (and a sligt enhancement
travil
parents: 17
diff changeset
   372
                    <li>If the value of <var>ns</var> is the string "<code>http://www.w3.org/1999/xhtml</code>",
15a9ba955a3a Expanded the XML Serialization algorithm for Elements (and a sligt enhancement
travil
parents: 17
diff changeset
   373
                        and the <var>node</var>'s list of 
15a9ba955a3a Expanded the XML Serialization algorithm for Elements (and a sligt enhancement
travil
parents: 17
diff changeset
   374
                        <a title="concept-tree-child" data-spec="DOM4" class="externalDFN">children</a>
15a9ba955a3a Expanded the XML Serialization algorithm for Elements (and a sligt enhancement
travil
parents: 17
diff changeset
   375
                        is empty, and the <var>node</var>'s
15a9ba955a3a Expanded the XML Serialization algorithm for Elements (and a sligt enhancement
travil
parents: 17
diff changeset
   376
                        <code><a title="dom-Element-tagName" data-spec="DOM4" class="externalDFN">tagName</a></code>
15a9ba955a3a Expanded the XML Serialization algorithm for Elements (and a sligt enhancement
travil
parents: 17
diff changeset
   377
                        case-sensitively matches any one of the following:
15a9ba955a3a Expanded the XML Serialization algorithm for Elements (and a sligt enhancement
travil
parents: 17
diff changeset
   378
                        <ul>
15a9ba955a3a Expanded the XML Serialization algorithm for Elements (and a sligt enhancement
travil
parents: 17
diff changeset
   379
                            <li>"<code>br</code>";
15a9ba955a3a Expanded the XML Serialization algorithm for Elements (and a sligt enhancement
travil
parents: 17
diff changeset
   380
                            <li>"<code>img</code>";
15a9ba955a3a Expanded the XML Serialization algorithm for Elements (and a sligt enhancement
travil
parents: 17
diff changeset
   381
                            <li>"<code>input</code>";
15a9ba955a3a Expanded the XML Serialization algorithm for Elements (and a sligt enhancement
travil
parents: 17
diff changeset
   382
                            <li>"<code>link</code>";
15a9ba955a3a Expanded the XML Serialization algorithm for Elements (and a sligt enhancement
travil
parents: 17
diff changeset
   383
                            <li>"<code>meta</code>";
15a9ba955a3a Expanded the XML Serialization algorithm for Elements (and a sligt enhancement
travil
parents: 17
diff changeset
   384
                            <li>"<code>param</code>";
15a9ba955a3a Expanded the XML Serialization algorithm for Elements (and a sligt enhancement
travil
parents: 17
diff changeset
   385
                        </ul>
15a9ba955a3a Expanded the XML Serialization algorithm for Elements (and a sligt enhancement
travil
parents: 17
diff changeset
   386
                        then append the following to <var>markup</var>, in order:
15a9ba955a3a Expanded the XML Serialization algorithm for Elements (and a sligt enhancement
travil
parents: 17
diff changeset
   387
                        <ol>
15a9ba955a3a Expanded the XML Serialization algorithm for Elements (and a sligt enhancement
travil
parents: 17
diff changeset
   388
                            <li>"<code> </code>" (U+0020 SPACE);
15a9ba955a3a Expanded the XML Serialization algorithm for Elements (and a sligt enhancement
travil
parents: 17
diff changeset
   389
                            <li>"<code>/</code>" (U+002F SOLIDUS);
15a9ba955a3a Expanded the XML Serialization algorithm for Elements (and a sligt enhancement
travil
parents: 17
diff changeset
   390
                        </ol>
15a9ba955a3a Expanded the XML Serialization algorithm for Elements (and a sligt enhancement
travil
parents: 17
diff changeset
   391
                        and set the <var>skip end tag</var> flag to <code>true</code>.
15a9ba955a3a Expanded the XML Serialization algorithm for Elements (and a sligt enhancement
travil
parents: 17
diff changeset
   392
                    <li>If the value of <var>ns</var> is not the string "<code>http://www.w3.org/1999/xhtml</code>",
15a9ba955a3a Expanded the XML Serialization algorithm for Elements (and a sligt enhancement
travil
parents: 17
diff changeset
   393
                        and the <var>node</var>'s list of 
15a9ba955a3a Expanded the XML Serialization algorithm for Elements (and a sligt enhancement
travil
parents: 17
diff changeset
   394
                        <a title="concept-tree-child" data-spec="DOM4" class="externalDFN">children</a>
15a9ba955a3a Expanded the XML Serialization algorithm for Elements (and a sligt enhancement
travil
parents: 17
diff changeset
   395
                        is empty, then append "<code>/</code>" (U+002F SOLIDUS) to <var>markup</var>
15a9ba955a3a Expanded the XML Serialization algorithm for Elements (and a sligt enhancement
travil
parents: 17
diff changeset
   396
                        and set the <var>skip end tag</var> flag to <code>true</code>.
15a9ba955a3a Expanded the XML Serialization algorithm for Elements (and a sligt enhancement
travil
parents: 17
diff changeset
   397
                    <li>Append "<code>&gt;</code>" (U+003E GREATER-THAN SIGN) to <var>markup</var>.
15a9ba955a3a Expanded the XML Serialization algorithm for Elements (and a sligt enhancement
travil
parents: 17
diff changeset
   398
                    <li>If the value of <var>skip end tag</var> is <code>true</code>, then return 
15a9ba955a3a Expanded the XML Serialization algorithm for Elements (and a sligt enhancement
travil
parents: 17
diff changeset
   399
                        the value of <var>markup</var> and skip the remaining steps. The 
15a9ba955a3a Expanded the XML Serialization algorithm for Elements (and a sligt enhancement
travil
parents: 17
diff changeset
   400
                        <var>node</var> is a leaf-node.
15a9ba955a3a Expanded the XML Serialization algorithm for Elements (and a sligt enhancement
travil
parents: 17
diff changeset
   401
                    <li>Append to <var>markup</var> the result of performing an 
15a9ba955a3a Expanded the XML Serialization algorithm for Elements (and a sligt enhancement
travil
parents: 17
diff changeset
   402
                        <a title=concept-serialize-xml>XML serialization</a> of each of 
15a9ba955a3a Expanded the XML Serialization algorithm for Elements (and a sligt enhancement
travil
parents: 17
diff changeset
   403
                        <var>node</var>'s
15a9ba955a3a Expanded the XML Serialization algorithm for Elements (and a sligt enhancement
travil
parents: 17
diff changeset
   404
                        <a title="concept-tree-child" data-spec="DOM4" class="externalDFN">children</a>,
15a9ba955a3a Expanded the XML Serialization algorithm for Elements (and a sligt enhancement
travil
parents: 17
diff changeset
   405
                        in order, providing the value of <var>ns</var> for the <var>namespace</var>
15a9ba955a3a Expanded the XML Serialization algorithm for Elements (and a sligt enhancement
travil
parents: 17
diff changeset
   406
                        and <var>list</var> for the <var>prefixes</var>.
15a9ba955a3a Expanded the XML Serialization algorithm for Elements (and a sligt enhancement
travil
parents: 17
diff changeset
   407
                    <li>Append "<code>&lt;/</code>" (U+003C LESS-THAN SIGN, U+002F SOLIDUS) to 
15a9ba955a3a Expanded the XML Serialization algorithm for Elements (and a sligt enhancement
travil
parents: 17
diff changeset
   408
                        <var>markup</var>.
15a9ba955a3a Expanded the XML Serialization algorithm for Elements (and a sligt enhancement
travil
parents: 17
diff changeset
   409
                    <li>If the value of <var>prefix</var> is not <code>null</code>, then append the 
15a9ba955a3a Expanded the XML Serialization algorithm for Elements (and a sligt enhancement
travil
parents: 17
diff changeset
   410
                        following to <var>markup</var>, in order:
15a9ba955a3a Expanded the XML Serialization algorithm for Elements (and a sligt enhancement
travil
parents: 17
diff changeset
   411
                        <ol>
15a9ba955a3a Expanded the XML Serialization algorithm for Elements (and a sligt enhancement
travil
parents: 17
diff changeset
   412
                            <li>The value of <var>prefix</var>;
15a9ba955a3a Expanded the XML Serialization algorithm for Elements (and a sligt enhancement
travil
parents: 17
diff changeset
   413
                            <li>"<code>:</code>" (U+003A COLON).
15a9ba955a3a Expanded the XML Serialization algorithm for Elements (and a sligt enhancement
travil
parents: 17
diff changeset
   414
                        </ol>
15a9ba955a3a Expanded the XML Serialization algorithm for Elements (and a sligt enhancement
travil
parents: 17
diff changeset
   415
                    <li>Append the value of <var>node</var>'s
15a9ba955a3a Expanded the XML Serialization algorithm for Elements (and a sligt enhancement
travil
parents: 17
diff changeset
   416
                        <code><a title="dom-Element-localName" data-spec="DOM4" class="externalDFN">localName</a></code>
15a9ba955a3a Expanded the XML Serialization algorithm for Elements (and a sligt enhancement
travil
parents: 17
diff changeset
   417
                        attribute to <var>markup</var>.
15a9ba955a3a Expanded the XML Serialization algorithm for Elements (and a sligt enhancement
travil
parents: 17
diff changeset
   418
                    <li>Append "<code>&gt;</code>" (U+003E GREATER-THAN SIGN) to <var>markup</var>.
15a9ba955a3a Expanded the XML Serialization algorithm for Elements (and a sligt enhancement
travil
parents: 17
diff changeset
   419
                    <li>Return the value of <var>markup</var>.
1
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   420
                </ol>
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   421
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   422
            <dt><code><a title="document" data-spec="DOM4" class="externalDFN">Document</a></code>
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   423
            <dd>
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   424
                <p>Run the
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   425
                <a data-spec="HTML5" title="xml-fragment-serialization-algorithm" class="externalDFN">XML fragment serialization algorithm</a> on
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   426
                <var>node</var>. Return the string this produced.
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   427
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   428
            <dt><code><a title="comment" data-spec="DOM4" class="externalDFN">Comment</a></code>
15
072801890ccd Add support for DOCTYPE serialization on XML docs. Fixed an error with Text in
travil
parents: 14
diff changeset
   429
            <dd><ol>
072801890ccd Add support for DOCTYPE serialization on XML docs. Fixed an error with Text in
travil
parents: 14
diff changeset
   430
                <li>Let <var>markup</var> be the concatenation of "<code>&lt;!--</code>", <var>node</var>'s
1
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   431
                <code><a title="dom-characterdata-data" data-spec="DOM4" class="externalDFN">data</a></code>, and
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   432
                "<code>--></code>".
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   433
15
072801890ccd Add support for DOCTYPE serialization on XML docs. Fixed an error with Text in
travil
parents: 14
diff changeset
   434
                <li>If <var>markup</var> matches the
1
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   435
                <code><a data-spec="XML10" title="comment" class="externalDFN">Comment</a></code> production, return
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   436
                <var>markup</var>. Otherwise, throw a
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   437
                <code><a title=domexception data-spec="DOM4" class="externalDFN">DOMException</a></code>
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   438
                with name <code>InvalidStateError</code>.
15
072801890ccd Add support for DOCTYPE serialization on XML docs. Fixed an error with Text in
travil
parents: 14
diff changeset
   439
              </ol>
14
edebbe3facb6 Add support for CDATA serializations in DOM (for XML and programmatic creation).
travil
parents: 13
diff changeset
   440
            <dt><code><a title="cdata" data-spec="DOML2" class="externalDFN">CDATASection</a></code>
15
072801890ccd Add support for DOCTYPE serialization on XML docs. Fixed an error with Text in
travil
parents: 14
diff changeset
   441
            <dd><ol>
072801890ccd Add support for DOCTYPE serialization on XML docs. Fixed an error with Text in
travil
parents: 14
diff changeset
   442
                <li>Let <var>markup</var> be the concatenation of "<code>&lt;![CDATA[</code>", 
14
edebbe3facb6 Add support for CDATA serializations in DOM (for XML and programmatic creation).
travil
parents: 13
diff changeset
   443
                <var>node</var>'s
edebbe3facb6 Add support for CDATA serializations in DOM (for XML and programmatic creation).
travil
parents: 13
diff changeset
   444
                <code><a title="dom-characterdata-data" data-spec="DOM4" class="externalDFN">data</a></code>, 
edebbe3facb6 Add support for CDATA serializations in DOM (for XML and programmatic creation).
travil
parents: 13
diff changeset
   445
                and "<code>]]></code>".
edebbe3facb6 Add support for CDATA serializations in DOM (for XML and programmatic creation).
travil
parents: 13
diff changeset
   446
edebbe3facb6 Add support for CDATA serializations in DOM (for XML and programmatic creation).
travil
parents: 13
diff changeset
   447
                <!-- This does not actually appear to be the case in implementations today.
edebbe3facb6 Add support for CDATA serializations in DOM (for XML and programmatic creation).
travil
parents: 13
diff changeset
   448
                <p>If <var>data</var> doesn't match the
15
072801890ccd Add support for DOCTYPE serialization on XML docs. Fixed an error with Text in
travil
parents: 14
diff changeset
   449
                  <code><a title="NT-CData" data-spec="XML10" class="externalDFN">CDSect</a></code> production, throw a
14
edebbe3facb6 Add support for CDATA serializations in DOM (for XML and programmatic creation).
travil
parents: 13
diff changeset
   450
                  <code><a title=domexception data-spec="DOM4" class="externalDFN">DOMException</a></code>
edebbe3facb6 Add support for CDATA serializations in DOM (for XML and programmatic creation).
travil
parents: 13
diff changeset
   451
                  with name <code>InvalidStateError</code> and terminate the entire algorithm.
edebbe3facb6 Add support for CDATA serializations in DOM (for XML and programmatic creation).
travil
parents: 13
diff changeset
   452
                -->
edebbe3facb6 Add support for CDATA serializations in DOM (for XML and programmatic creation).
travil
parents: 13
diff changeset
   453
                
15
072801890ccd Add support for DOCTYPE serialization on XML docs. Fixed an error with Text in
travil
parents: 14
diff changeset
   454
                <li>Return <var>markup</var>.
072801890ccd Add support for DOCTYPE serialization on XML docs. Fixed an error with Text in
travil
parents: 14
diff changeset
   455
              </ol>
072801890ccd Add support for DOCTYPE serialization on XML docs. Fixed an error with Text in
travil
parents: 14
diff changeset
   456
072801890ccd Add support for DOCTYPE serialization on XML docs. Fixed an error with Text in
travil
parents: 14
diff changeset
   457
              <p class=note>CDATASection objects may be created by the historical 
072801890ccd Add support for DOCTYPE serialization on XML docs. Fixed an error with Text in
travil
parents: 14
diff changeset
   458
            <code>document.createCDATASection</code> API, or as a result of parsing an
072801890ccd Add support for DOCTYPE serialization on XML docs. Fixed an error with Text in
travil
parents: 14
diff changeset
   459
            <a title="xml-document" data-spec="DOM4" class="externalDFN">XML document</a>.
14
edebbe3facb6 Add support for CDATA serializations in DOM (for XML and programmatic creation).
travil
parents: 13
diff changeset
   460
1
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   461
            <dt><code><a title="text" data-spec="DOM4" class="externalDFN">Text</a></code>
15
072801890ccd Add support for DOCTYPE serialization on XML docs. Fixed an error with Text in
travil
parents: 14
diff changeset
   462
            <dd><ol>
072801890ccd Add support for DOCTYPE serialization on XML docs. Fixed an error with Text in
travil
parents: 14
diff changeset
   463
                <li>Let <var>markup</var> be <var>node</var>'s
1
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   464
                <code><a title="dom-characterdata-data" data-spec="DOM4" class="externalDFN">data</a></code>.
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   465
15
072801890ccd Add support for DOCTYPE serialization on XML docs. Fixed an error with Text in
travil
parents: 14
diff changeset
   466
                <li>Replace any occurrences of "<code>&amp;</code>" in <var>markup</var> by
072801890ccd Add support for DOCTYPE serialization on XML docs. Fixed an error with Text in
travil
parents: 14
diff changeset
   467
                "<code>&amp;amp;</code>".
14
edebbe3facb6 Add support for CDATA serializations in DOM (for XML and programmatic creation).
travil
parents: 13
diff changeset
   468
                
15
072801890ccd Add support for DOCTYPE serialization on XML docs. Fixed an error with Text in
travil
parents: 14
diff changeset
   469
                <li>Replace any occurrences of "<code>&lt;</code>" in <var>markup</var> by
072801890ccd Add support for DOCTYPE serialization on XML docs. Fixed an error with Text in
travil
parents: 14
diff changeset
   470
                "<code>&amp;lt;</code>".
072801890ccd Add support for DOCTYPE serialization on XML docs. Fixed an error with Text in
travil
parents: 14
diff changeset
   471
                
072801890ccd Add support for DOCTYPE serialization on XML docs. Fixed an error with Text in
travil
parents: 14
diff changeset
   472
                <li>Replace any occurrences of "<code>&gt;</code>" in <var>markup</var> by
072801890ccd Add support for DOCTYPE serialization on XML docs. Fixed an error with Text in
travil
parents: 14
diff changeset
   473
                "<code>&amp;gt;</code>".
072801890ccd Add support for DOCTYPE serialization on XML docs. Fixed an error with Text in
travil
parents: 14
diff changeset
   474
                
072801890ccd Add support for DOCTYPE serialization on XML docs. Fixed an error with Text in
travil
parents: 14
diff changeset
   475
                <li>Return <var>data</var>.
072801890ccd Add support for DOCTYPE serialization on XML docs. Fixed an error with Text in
travil
parents: 14
diff changeset
   476
              </ol>
1
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   477
            <dt><code><a title="documentfragment" data-spec="DOM4" class="externalDFN">DocumentFragment</a></code>
15
072801890ccd Add support for DOCTYPE serialization on XML docs. Fixed an error with Text in
travil
parents: 14
diff changeset
   478
            <dd><ol>
072801890ccd Add support for DOCTYPE serialization on XML docs. Fixed an error with Text in
travil
parents: 14
diff changeset
   479
                <li>Let <var>markup</var> the empty string.
1
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   480
15
072801890ccd Add support for DOCTYPE serialization on XML docs. Fixed an error with Text in
travil
parents: 14
diff changeset
   481
                <li>For each
1
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   482
                <a title=concept-tree-child data-spec="DOM4" class="externalDFN">child</a> of
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   483
                <var>node</var>, in order,
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   484
                <a title=concept-serialize-xml>produce an XML serialization</a>
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   485
                of the child and concatenate the result to <var>markup</var>.
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   486
15
072801890ccd Add support for DOCTYPE serialization on XML docs. Fixed an error with Text in
travil
parents: 14
diff changeset
   487
                <li>Return <var>markup</var>.
072801890ccd Add support for DOCTYPE serialization on XML docs. Fixed an error with Text in
travil
parents: 14
diff changeset
   488
              </ol>
072801890ccd Add support for DOCTYPE serialization on XML docs. Fixed an error with Text in
travil
parents: 14
diff changeset
   489
            <dt><code><a title="documenttype" data-spec="DOM4" class="externalDFN">DocumentType</a></code>
16
809c9f8a41a9 Factored the DOCTYPE serialization algorithm to additionally support HTML docs
travil
parents: 15
diff changeset
   490
            <dd>Run the steps to <a title=concept-serialize-doctype>produce a DocumentType 
809c9f8a41a9 Factored the DOCTYPE serialization algorithm to additionally support HTML docs
travil
parents: 15
diff changeset
   491
                serialization</a> of <var>node</var>
809c9f8a41a9 Factored the DOCTYPE serialization algorithm to additionally support HTML docs
travil
parents: 15
diff changeset
   492
                and return the string this produced.           
15
072801890ccd Add support for DOCTYPE serialization on XML docs. Fixed an error with Text in
travil
parents: 14
diff changeset
   493
            
072801890ccd Add support for DOCTYPE serialization on XML docs. Fixed an error with Text in
travil
parents: 14
diff changeset
   494
            <dt><code><a title="processinginstruction" data-spec="DOM4" class="externalDFN">ProcessingInstruction</a></code>
072801890ccd Add support for DOCTYPE serialization on XML docs. Fixed an error with Text in
travil
parents: 14
diff changeset
   495
            <dd><ol>
072801890ccd Add support for DOCTYPE serialization on XML docs. Fixed an error with Text in
travil
parents: 14
diff changeset
   496
                <li>Let <var>markup</var> be the concatenation of "<code>&lt;?</code>", 
072801890ccd Add support for DOCTYPE serialization on XML docs. Fixed an error with Text in
travil
parents: 14
diff changeset
   497
                <var>node</var>'s
072801890ccd Add support for DOCTYPE serialization on XML docs. Fixed an error with Text in
travil
parents: 14
diff changeset
   498
                <code><a title="dom-characterdata-data" data-spec="DOM4" class="externalDFN">data</a></code>, 
072801890ccd Add support for DOCTYPE serialization on XML docs. Fixed an error with Text in
travil
parents: 14
diff changeset
   499
                and "<code>?></code>".
1
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   500
15
072801890ccd Add support for DOCTYPE serialization on XML docs. Fixed an error with Text in
travil
parents: 14
diff changeset
   501
                <!-- This does not actually appear to be the case in implementations today.
072801890ccd Add support for DOCTYPE serialization on XML docs. Fixed an error with Text in
travil
parents: 14
diff changeset
   502
                <p>If <var>data</var> doesn't match the
072801890ccd Add support for DOCTYPE serialization on XML docs. Fixed an error with Text in
travil
parents: 14
diff changeset
   503
                  <code><a title="NT-PI" data-spec="XML10" class="externalDFN">PI</a></code> production, throw a
072801890ccd Add support for DOCTYPE serialization on XML docs. Fixed an error with Text in
travil
parents: 14
diff changeset
   504
                  <code><a title=domexception data-spec="DOM4" class="externalDFN">DOMException</a></code>
072801890ccd Add support for DOCTYPE serialization on XML docs. Fixed an error with Text in
travil
parents: 14
diff changeset
   505
                  with name <code>InvalidStateError</code> and terminate the entire algorithm.
072801890ccd Add support for DOCTYPE serialization on XML docs. Fixed an error with Text in
travil
parents: 14
diff changeset
   506
                -->
072801890ccd Add support for DOCTYPE serialization on XML docs. Fixed an error with Text in
travil
parents: 14
diff changeset
   507
                
072801890ccd Add support for DOCTYPE serialization on XML docs. Fixed an error with Text in
travil
parents: 14
diff changeset
   508
                <li>Return <var>markup</var>.
072801890ccd Add support for DOCTYPE serialization on XML docs. Fixed an error with Text in
travil
parents: 14
diff changeset
   509
              </ol>
072801890ccd Add support for DOCTYPE serialization on XML docs. Fixed an error with Text in
travil
parents: 14
diff changeset
   510
            <p class=note>ProcessingInstruction objects may be created by the historical 
072801890ccd Add support for DOCTYPE serialization on XML docs. Fixed an error with Text in
travil
parents: 14
diff changeset
   511
            <code>document.createProcessingInstruction</code> API, or as a result of parsing an
072801890ccd Add support for DOCTYPE serialization on XML docs. Fixed an error with Text in
travil
parents: 14
diff changeset
   512
            <a title="xml-document" data-spec="DOM4" class="externalDFN">XML document</a>.
16
809c9f8a41a9 Factored the DOCTYPE serialization algorithm to additionally support HTML docs
travil
parents: 15
diff changeset
   513
         
1
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   514
        </dl>
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   515
16
809c9f8a41a9 Factored the DOCTYPE serialization algorithm to additionally support HTML docs
travil
parents: 15
diff changeset
   516
        <p>To <dfn title=concept-serialize-doctype>produce a DocumentType serialization</dfn> of a
809c9f8a41a9 Factored the DOCTYPE serialization algorithm to additionally support HTML docs
travil
parents: 15
diff changeset
   517
        <a title="node" data-spec="DOM4" class="externalDFN">Node</a> <var>node</var>, the user agent
809c9f8a41a9 Factored the DOCTYPE serialization algorithm to additionally support HTML docs
travil
parents: 15
diff changeset
   518
        must return the result of the following algorithm:</p>
809c9f8a41a9 Factored the DOCTYPE serialization algorithm to additionally support HTML docs
travil
parents: 15
diff changeset
   519
                
809c9f8a41a9 Factored the DOCTYPE serialization algorithm to additionally support HTML docs
travil
parents: 15
diff changeset
   520
        <ol>
809c9f8a41a9 Factored the DOCTYPE serialization algorithm to additionally support HTML docs
travil
parents: 15
diff changeset
   521
            <li>Let <var>markup</var> be an empty string.
809c9f8a41a9 Factored the DOCTYPE serialization algorithm to additionally support HTML docs
travil
parents: 15
diff changeset
   522
            <li>Append the string "<code>&lt;!DOCTYPE</code>" to <var>markup</var>.
809c9f8a41a9 Factored the DOCTYPE serialization algorithm to additionally support HTML docs
travil
parents: 15
diff changeset
   523
            <li>Append "<code> </code>" (U+0020 SPACE) to <var>markup</var>.
809c9f8a41a9 Factored the DOCTYPE serialization algorithm to additionally support HTML docs
travil
parents: 15
diff changeset
   524
            <li>Append the value of the <var>node</var>'s 
809c9f8a41a9 Factored the DOCTYPE serialization algorithm to additionally support HTML docs
travil
parents: 15
diff changeset
   525
                <code><a title="dom-documenttype-name" data-spec="DOM4" class="externalDFN">name</a></code>
809c9f8a41a9 Factored the DOCTYPE serialization algorithm to additionally support HTML docs
travil
parents: 15
diff changeset
   526
                attribute to <var>markup</var>. For a <var>node</var> belonging to an
809c9f8a41a9 Factored the DOCTYPE serialization algorithm to additionally support HTML docs
travil
parents: 15
diff changeset
   527
                <a title="html-document" data-spec="DOM4" class="externalDFN">HTML document</a>,
809c9f8a41a9 Factored the DOCTYPE serialization algorithm to additionally support HTML docs
travil
parents: 15
diff changeset
   528
                the value will be all lowercase.
809c9f8a41a9 Factored the DOCTYPE serialization algorithm to additionally support HTML docs
travil
parents: 15
diff changeset
   529
            <li>If the <var>node</var>'s 
809c9f8a41a9 Factored the DOCTYPE serialization algorithm to additionally support HTML docs
travil
parents: 15
diff changeset
   530
                <code><a title="dom-documenttype-publicid" data-spec="DOM4" class="externalDFN">publicId</a></code>
809c9f8a41a9 Factored the DOCTYPE serialization algorithm to additionally support HTML docs
travil
parents: 15
diff changeset
   531
                is not the empty string then append the following, in order, to <var>markup</var>:
809c9f8a41a9 Factored the DOCTYPE serialization algorithm to additionally support HTML docs
travil
parents: 15
diff changeset
   532
                <ol>
809c9f8a41a9 Factored the DOCTYPE serialization algorithm to additionally support HTML docs
travil
parents: 15
diff changeset
   533
                    <li>"<code> </code>" (U+0020 SPACE);
809c9f8a41a9 Factored the DOCTYPE serialization algorithm to additionally support HTML docs
travil
parents: 15
diff changeset
   534
                    <li>The string "<code>PUBLIC</code>";
809c9f8a41a9 Factored the DOCTYPE serialization algorithm to additionally support HTML docs
travil
parents: 15
diff changeset
   535
                    <li>"<code> </code>" (U+0020 SPACE);
809c9f8a41a9 Factored the DOCTYPE serialization algorithm to additionally support HTML docs
travil
parents: 15
diff changeset
   536
                    <li>"<code>"</code>" (U+0022 QUOTATION MARK);
809c9f8a41a9 Factored the DOCTYPE serialization algorithm to additionally support HTML docs
travil
parents: 15
diff changeset
   537
                    <li>The value of the <var>node</var>'s 
809c9f8a41a9 Factored the DOCTYPE serialization algorithm to additionally support HTML docs
travil
parents: 15
diff changeset
   538
                        <code><a title="dom-documenttype-publicid" data-spec="DOM4" class="externalDFN">publicId</a></code>
809c9f8a41a9 Factored the DOCTYPE serialization algorithm to additionally support HTML docs
travil
parents: 15
diff changeset
   539
                        attribute;
809c9f8a41a9 Factored the DOCTYPE serialization algorithm to additionally support HTML docs
travil
parents: 15
diff changeset
   540
                    <li>"<code>"</code>" (U+0022 QUOTATION MARK);
809c9f8a41a9 Factored the DOCTYPE serialization algorithm to additionally support HTML docs
travil
parents: 15
diff changeset
   541
                </ol>
809c9f8a41a9 Factored the DOCTYPE serialization algorithm to additionally support HTML docs
travil
parents: 15
diff changeset
   542
            </li>
809c9f8a41a9 Factored the DOCTYPE serialization algorithm to additionally support HTML docs
travil
parents: 15
diff changeset
   543
            <li>If the <var>node</var>'s 
809c9f8a41a9 Factored the DOCTYPE serialization algorithm to additionally support HTML docs
travil
parents: 15
diff changeset
   544
                <code><a title="dom-documenttype-systemid" data-spec="DOM4" class="externalDFN">systemId</a></code>
809c9f8a41a9 Factored the DOCTYPE serialization algorithm to additionally support HTML docs
travil
parents: 15
diff changeset
   545
                is not the empty string and the <var>node</var>'s 
809c9f8a41a9 Factored the DOCTYPE serialization algorithm to additionally support HTML docs
travil
parents: 15
diff changeset
   546
                <code><a title="dom-documenttype-publicid" data-spec="DOM4" class="externalDFN">publicId</a></code>
809c9f8a41a9 Factored the DOCTYPE serialization algorithm to additionally support HTML docs
travil
parents: 15
diff changeset
   547
                is set to the empty string, then append the following, in order, to <var>markup</var>:
809c9f8a41a9 Factored the DOCTYPE serialization algorithm to additionally support HTML docs
travil
parents: 15
diff changeset
   548
                <ol>
809c9f8a41a9 Factored the DOCTYPE serialization algorithm to additionally support HTML docs
travil
parents: 15
diff changeset
   549
                    <li>"<code> </code>" (U+0020 SPACE);
809c9f8a41a9 Factored the DOCTYPE serialization algorithm to additionally support HTML docs
travil
parents: 15
diff changeset
   550
                    <li>The string "<code>SYSTEM</code>";
809c9f8a41a9 Factored the DOCTYPE serialization algorithm to additionally support HTML docs
travil
parents: 15
diff changeset
   551
                </ol>
809c9f8a41a9 Factored the DOCTYPE serialization algorithm to additionally support HTML docs
travil
parents: 15
diff changeset
   552
            </li>
809c9f8a41a9 Factored the DOCTYPE serialization algorithm to additionally support HTML docs
travil
parents: 15
diff changeset
   553
            <li>If the <var>node</var>'s 
809c9f8a41a9 Factored the DOCTYPE serialization algorithm to additionally support HTML docs
travil
parents: 15
diff changeset
   554
                <code><a title="dom-documenttype-systemid" data-spec="DOM4" class="externalDFN">systemId</a></code>
809c9f8a41a9 Factored the DOCTYPE serialization algorithm to additionally support HTML docs
travil
parents: 15
diff changeset
   555
                is not the empty string then append the following, in order, to <var>markup</var>:
809c9f8a41a9 Factored the DOCTYPE serialization algorithm to additionally support HTML docs
travil
parents: 15
diff changeset
   556
                <ol>
809c9f8a41a9 Factored the DOCTYPE serialization algorithm to additionally support HTML docs
travil
parents: 15
diff changeset
   557
                    <li>"<code> </code>" (U+0020 SPACE);
809c9f8a41a9 Factored the DOCTYPE serialization algorithm to additionally support HTML docs
travil
parents: 15
diff changeset
   558
                    <li>"<code>"</code>" (U+0022 QUOTATION MARK);
809c9f8a41a9 Factored the DOCTYPE serialization algorithm to additionally support HTML docs
travil
parents: 15
diff changeset
   559
                    <li>The value of the <var>node</var>'s 
809c9f8a41a9 Factored the DOCTYPE serialization algorithm to additionally support HTML docs
travil
parents: 15
diff changeset
   560
                        <code><a title="dom-documenttype-systemid" data-spec="DOM4" class="externalDFN">systemId</a></code>
809c9f8a41a9 Factored the DOCTYPE serialization algorithm to additionally support HTML docs
travil
parents: 15
diff changeset
   561
                        attribute;
809c9f8a41a9 Factored the DOCTYPE serialization algorithm to additionally support HTML docs
travil
parents: 15
diff changeset
   562
                    <li>"<code>"</code>" (U+0022 QUOTATION MARK);
809c9f8a41a9 Factored the DOCTYPE serialization algorithm to additionally support HTML docs
travil
parents: 15
diff changeset
   563
                </ol>
809c9f8a41a9 Factored the DOCTYPE serialization algorithm to additionally support HTML docs
travil
parents: 15
diff changeset
   564
            </li>
809c9f8a41a9 Factored the DOCTYPE serialization algorithm to additionally support HTML docs
travil
parents: 15
diff changeset
   565
            <li>Optional: if the <var>node</var> has an (historical) 
809c9f8a41a9 Factored the DOCTYPE serialization algorithm to additionally support HTML docs
travil
parents: 15
diff changeset
   566
                <code><a title="ID-Core-DocType-internalSubset" data-spec="DOM3" class="externalDFN">internalSubset</a></code>
809c9f8a41a9 Factored the DOCTYPE serialization algorithm to additionally support HTML docs
travil
parents: 15
diff changeset
   567
                and the
809c9f8a41a9 Factored the DOCTYPE serialization algorithm to additionally support HTML docs
travil
parents: 15
diff changeset
   568
                <code><a title="ID-Core-DocType-internalSubset" data-spec="DOM3" class="externalDFN">internalSubset</a></code>
809c9f8a41a9 Factored the DOCTYPE serialization algorithm to additionally support HTML docs
travil
parents: 15
diff changeset
   569
                attribute's value is a non-empty string, then append the following,
809c9f8a41a9 Factored the DOCTYPE serialization algorithm to additionally support HTML docs
travil
parents: 15
diff changeset
   570
                in order, to <var>markup</var>:
809c9f8a41a9 Factored the DOCTYPE serialization algorithm to additionally support HTML docs
travil
parents: 15
diff changeset
   571
                <ol>
809c9f8a41a9 Factored the DOCTYPE serialization algorithm to additionally support HTML docs
travil
parents: 15
diff changeset
   572
                    <li>"<code> </code>" (U+0020 SPACE);
809c9f8a41a9 Factored the DOCTYPE serialization algorithm to additionally support HTML docs
travil
parents: 15
diff changeset
   573
                    <li>"<code>[</code>" (U+005B LEFT SQUARE BRACKET);
809c9f8a41a9 Factored the DOCTYPE serialization algorithm to additionally support HTML docs
travil
parents: 15
diff changeset
   574
                    <li>The value of the <var>node</var>'s 
809c9f8a41a9 Factored the DOCTYPE serialization algorithm to additionally support HTML docs
travil
parents: 15
diff changeset
   575
                        <code><a title="ID-Core-DocType-internalSubset" data-spec="DOM3" class="externalDFN">internalSubset</a></code>
809c9f8a41a9 Factored the DOCTYPE serialization algorithm to additionally support HTML docs
travil
parents: 15
diff changeset
   576
                        attribute;
809c9f8a41a9 Factored the DOCTYPE serialization algorithm to additionally support HTML docs
travil
parents: 15
diff changeset
   577
                    <li>"<code>]</code>" (U+005D RIGHT SQUARE BRACKET);
809c9f8a41a9 Factored the DOCTYPE serialization algorithm to additionally support HTML docs
travil
parents: 15
diff changeset
   578
                </ol>
809c9f8a41a9 Factored the DOCTYPE serialization algorithm to additionally support HTML docs
travil
parents: 15
diff changeset
   579
                <p class=note>A <var>node</var> belonging to an
809c9f8a41a9 Factored the DOCTYPE serialization algorithm to additionally support HTML docs
travil
parents: 15
diff changeset
   580
                   <a title="html-document" data-spec="DOM4" class="externalDFN">HTML document</a>
809c9f8a41a9 Factored the DOCTYPE serialization algorithm to additionally support HTML docs
travil
parents: 15
diff changeset
   581
                   will never have an 
809c9f8a41a9 Factored the DOCTYPE serialization algorithm to additionally support HTML docs
travil
parents: 15
diff changeset
   582
                   <code><a title="ID-Core-DocType-internalSubset" data-spec="DOM3" class="externalDFN">internalSubset</a></code>
809c9f8a41a9 Factored the DOCTYPE serialization algorithm to additionally support HTML docs
travil
parents: 15
diff changeset
   583
                   because any <code><a title="ID-Core-DocType-internalSubset" data-spec="DOM3" class="externalDFN">internalSubset</a></code>
809c9f8a41a9 Factored the DOCTYPE serialization algorithm to additionally support HTML docs
travil
parents: 15
diff changeset
   584
                   markup is ignored by the parser.</p>
809c9f8a41a9 Factored the DOCTYPE serialization algorithm to additionally support HTML docs
travil
parents: 15
diff changeset
   585
            </li>
809c9f8a41a9 Factored the DOCTYPE serialization algorithm to additionally support HTML docs
travil
parents: 15
diff changeset
   586
            <li>Append "<code>&gt;</code>" (U+003E GREATER-THAN SIGN) to <var>markup</var>.
809c9f8a41a9 Factored the DOCTYPE serialization algorithm to additionally support HTML docs
travil
parents: 15
diff changeset
   587
        </ol>
809c9f8a41a9 Factored the DOCTYPE serialization algorithm to additionally support HTML docs
travil
parents: 15
diff changeset
   588
809c9f8a41a9 Factored the DOCTYPE serialization algorithm to additionally support HTML docs
travil
parents: 15
diff changeset
   589
        
18
15a9ba955a3a Expanded the XML Serialization algorithm for Elements (and a sligt enhancement
travil
parents: 17
diff changeset
   590
        <p>The <dfn title=concept-serialize-xml-attributes>XML serialization of the attributes</dfn>
15a9ba955a3a Expanded the XML Serialization algorithm for Elements (and a sligt enhancement
travil
parents: 17
diff changeset
   591
        of an <a title=concept-element data-spec="DOM4" class="externalDFN">element</a>
15a9ba955a3a Expanded the XML Serialization algorithm for Elements (and a sligt enhancement
travil
parents: 17
diff changeset
   592
        <var>element</var> together with a prefix list <var>prefixes</var> is the result of the 
15a9ba955a3a Expanded the XML Serialization algorithm for Elements (and a sligt enhancement
travil
parents: 17
diff changeset
   593
        following algorithm:
1
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   594
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   595
        <ol>
18
15a9ba955a3a Expanded the XML Serialization algorithm for Elements (and a sligt enhancement
travil
parents: 17
diff changeset
   596
            <li>Let <var>result</var> be the empty string.
15a9ba955a3a Expanded the XML Serialization algorithm for Elements (and a sligt enhancement
travil
parents: 17
diff changeset
   597
            <li>For each
15a9ba955a3a Expanded the XML Serialization algorithm for Elements (and a sligt enhancement
travil
parents: 17
diff changeset
   598
                <a title=concept-attribute data-spec="DOM4" class="externalDFN">attribute</a>
15a9ba955a3a Expanded the XML Serialization algorithm for Elements (and a sligt enhancement
travil
parents: 17
diff changeset
   599
                <var>attr</var> in <var>element</var>'s
15a9ba955a3a Expanded the XML Serialization algorithm for Elements (and a sligt enhancement
travil
parents: 17
diff changeset
   600
                <a title=concept-element-attribute data-spec="DOM4" class="externalDFN">attributes</a>,
15a9ba955a3a Expanded the XML Serialization algorithm for Elements (and a sligt enhancement
travil
parents: 17
diff changeset
   601
                in order:
15a9ba955a3a Expanded the XML Serialization algorithm for Elements (and a sligt enhancement
travil
parents: 17
diff changeset
   602
                <ol>
15a9ba955a3a Expanded the XML Serialization algorithm for Elements (and a sligt enhancement
travil
parents: 17
diff changeset
   603
                    <li>Append the following strings to <var>result</var>:
15a9ba955a3a Expanded the XML Serialization algorithm for Elements (and a sligt enhancement
travil
parents: 17
diff changeset
   604
                        <ol>
15a9ba955a3a Expanded the XML Serialization algorithm for Elements (and a sligt enhancement
travil
parents: 17
diff changeset
   605
                            <li>"<code> </code>" (U+0020 SPACE);
15a9ba955a3a Expanded the XML Serialization algorithm for Elements (and a sligt enhancement
travil
parents: 17
diff changeset
   606
                            <li><var>attr</var>'s
15a9ba955a3a Expanded the XML Serialization algorithm for Elements (and a sligt enhancement
travil
parents: 17
diff changeset
   607
                            <a title=concept-attribute-name data-spec="DOM4" class="externalDFN">name</a>;
15a9ba955a3a Expanded the XML Serialization algorithm for Elements (and a sligt enhancement
travil
parents: 17
diff changeset
   608
                            <p class="issue">escaping / throwing
15a9ba955a3a Expanded the XML Serialization algorithm for Elements (and a sligt enhancement
travil
parents: 17
diff changeset
   609
                            <li>"<code>="</code>" (U+003D EQUALS SIGN, U+0022 QUOTATION MARK);
15a9ba955a3a Expanded the XML Serialization algorithm for Elements (and a sligt enhancement
travil
parents: 17
diff changeset
   610
                            <li><var>attr</var>'s
15a9ba955a3a Expanded the XML Serialization algorithm for Elements (and a sligt enhancement
travil
parents: 17
diff changeset
   611
                            <a title=concept-attribute-value data-spec="DOM4" class="externalDFN">value</a>;
15a9ba955a3a Expanded the XML Serialization algorithm for Elements (and a sligt enhancement
travil
parents: 17
diff changeset
   612
                            <p class="issue">escaping / throwing
15a9ba955a3a Expanded the XML Serialization algorithm for Elements (and a sligt enhancement
travil
parents: 17
diff changeset
   613
                            <li>"<code>"</code>" (U+0022 QUOTATION MARK).
15a9ba955a3a Expanded the XML Serialization algorithm for Elements (and a sligt enhancement
travil
parents: 17
diff changeset
   614
                        </ol>
15a9ba955a3a Expanded the XML Serialization algorithm for Elements (and a sligt enhancement
travil
parents: 17
diff changeset
   615
                    <li>If the first six characters of the value of <var>attr</var>'s 
15a9ba955a3a Expanded the XML Serialization algorithm for Elements (and a sligt enhancement
travil
parents: 17
diff changeset
   616
                        <a title=concept-attribute-name data-spec="DOM4" class="externalDFN">name</a> 
15a9ba955a3a Expanded the XML Serialization algorithm for Elements (and a sligt enhancement
travil
parents: 17
diff changeset
   617
                        attribute case-sensitively match the string "<code>xmlns:</code>", then:
15a9ba955a3a Expanded the XML Serialization algorithm for Elements (and a sligt enhancement
travil
parents: 17
diff changeset
   618
                        <ol>
15a9ba955a3a Expanded the XML Serialization algorithm for Elements (and a sligt enhancement
travil
parents: 17
diff changeset
   619
                            <li>Let <var>prefix definition</var> be the result of trimming 
15a9ba955a3a Expanded the XML Serialization algorithm for Elements (and a sligt enhancement
travil
parents: 17
diff changeset
   620
                                "<code>xmlns:</code>" from the beginning of the value of <var>attr</var>'s 
15a9ba955a3a Expanded the XML Serialization algorithm for Elements (and a sligt enhancement
travil
parents: 17
diff changeset
   621
                                <a title=concept-attribute-name data-spec="DOM4" class="externalDFN">name</a>.
15a9ba955a3a Expanded the XML Serialization algorithm for Elements (and a sligt enhancement
travil
parents: 17
diff changeset
   622
                            <li>Add the value of <var>prefix definition</var> to <var>prefixes</var>. 
15a9ba955a3a Expanded the XML Serialization algorithm for Elements (and a sligt enhancement
travil
parents: 17
diff changeset
   623
                                Since this namespace prefix definition has been serialized, it is 
15a9ba955a3a Expanded the XML Serialization algorithm for Elements (and a sligt enhancement
travil
parents: 17
diff changeset
   624
                                unnecessary to serialize it again if subsequently encountered in 
15a9ba955a3a Expanded the XML Serialization algorithm for Elements (and a sligt enhancement
travil
parents: 17
diff changeset
   625
                                <var>element</var>'s children.
15a9ba955a3a Expanded the XML Serialization algorithm for Elements (and a sligt enhancement
travil
parents: 17
diff changeset
   626
                        </ol>
15a9ba955a3a Expanded the XML Serialization algorithm for Elements (and a sligt enhancement
travil
parents: 17
diff changeset
   627
                </ol>
15a9ba955a3a Expanded the XML Serialization algorithm for Elements (and a sligt enhancement
travil
parents: 17
diff changeset
   628
            <li>Return <var>result</var>.
1
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   629
        </ol>
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   630
    </section>
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   631
</section>
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   632
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   633
<section>
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   634
    <h1>The <code>DOMParser</code> interface</h1>
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   635
    
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   636
<pre class=extraidl>enum <span class=idlInterfaceID>SupportedType</span> {
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   637
    "text/html",
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   638
    "text/xml",
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   639
    "application/xml",
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   640
    "application/xhtml+xml",
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   641
    "image/svg+xml"
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   642
};</pre>
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   643
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   644
    <p>The <dfn title=dom-DOMParser><code>DOMParser()</code></dfn> constructor
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   645
    must return a new <code>DOMParser</code> object.
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   646
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   647
    <dl class="idl" title="[Constructor] interface DOMParser">
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   648
        <dt>Document parseFromString(DOMString str, SupportedType type)</dt>
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   649
        <dd>
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   650
            <p>The
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   651
            <dfn title=dom-DOMParser-parseFromString><code>parseFromString(<var>str</var>, <var>type</var>)</code></dfn>
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   652
            method must run these steps, depending on <var>type</var>:
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   653
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   654
            <dl class=switch>
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   655
                <dt>"<code>text/html</code>"
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   656
                <dd>
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   657
                <p>Parse <var>str</var> with an
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   658
                <code><a data-spec="HTML5" title="html-parser" class="externalDFN">HTML parser</a></code>, and return the newly
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   659
                created <a title=concept-document data-spec="DOM4" class="externalDFN">document</a>.
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   660
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   661
                <p>The <a data-spec="HTML5" title="scripting-flag" class="externalDFN">scripting flag</a> must be set to
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   662
                "disabled".
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   663
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   664
                <p class=note><code><a data-spec="HTML5" title="meta" class="externalDFN">meta</a></code> elements are not
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   665
                taken into account for the encoding used, as a Unicode stream is passed into
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   666
                the parser.
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   667
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   668
                <p class=note><code><a data-spec="HTML5" title="script" class="externalDFN">script</a></code> elements get marked
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   669
                unexecutable and the contents of <code><a data-spec="HTML5" title="noscript" class="externalDFN">noscript</a></code>
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   670
                get parsed as markup.
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   671
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   672
                <dt>"<code>text/xml</code>"
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   673
                <dt>"<code>application/xml</code>"
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   674
                <dt>"<code>application/xhtml+xml</code>"
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   675
                <dt>"<code>image/svg+xml</code>"
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   676
                <dd>
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   677
                <ol>
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   678
                    <li>Parse <var>str</var> with a namespace-enabled
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   679
                    <code><a data-spec="HTML5" title="xml-parser" class="externalDFN">XML parser</a></code>.
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   680
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   681
                    <li>If the previous step didn't return an error, return the newly
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   682
                    created <a title=concept-document data-spec="DOM4" class="externalDFN">document</a>
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   683
                    and terminate these steps.
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   684
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   685
                    <li>Let <var>document</var> be a newly-created
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   686
                    <code><a data-spec="DOM4" title="xmldocument" class="externalDFN">XMLDocument</a></code>.
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   687
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   688
                    <li>
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   689
                    <p>Let <var>root</var> be a new
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   690
                    <code><a title="element" data-spec="DOM4" class="externalDFN">Element</a></code>, with its
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   691
                    <a title=concept-element-local-name data-spec="DOM4" class="externalDFN">local name</a>
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   692
                    set to "<code>parsererror</code>" and its
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   693
                    <a title=concept-element-namespace data-spec="DOM4" class="externalDFN">namespace</a>
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   694
                    set to
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   695
                    "<code>http://www.mozilla.org/newlayout/xml/parsererror.xml</code>".
3
881b6e205d22 PubRules fixup
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 1
diff changeset
   696
                    <!-- see https://bugzilla.mozilla.org/show_bug.cgi?id=45566 -->
1
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   697
                    <p>At this point user agents may
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   698
                    <a data-spec="DOM4" title=concept-node-append class="externalDFN">append</a> nodes
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   699
                    to <var>root</var>, for example to describe the nature of the
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   700
                    error.
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   701
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   702
                    <li><a data-spec="DOM4" title="concept-node-append" class="externalDFN">Append</a>
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   703
                    <var>root</var> to <var>document</var>.
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   704
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   705
                    <li>Return <var>document</var>.
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   706
                </ol>
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   707
            </dl>
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   708
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   709
            <p>In any case, the returned
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   710
            <a title=concept-document data-spec="DOM4" class="externalDFN">document</a>'s
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   711
            <a title=concept-document-content-type data-spec="DOM4" class="externalDFN">content type</a>
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   712
            must be the <var>type</var> argument.
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   713
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   714
            <div class="issue">
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   715
                <p>It is currently unclear what the
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   716
                <a title=concept-document-url data-spec="DOM4" class="externalDFN">URL</a> of the returned
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   717
                <a title=concept-document data-spec="DOM4" class="externalDFN">document</a> should be.
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   718
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   719
                <p>Results for a <a href="http://software.hixie.ch/utilities/js/live-dom-viewer/saved/1322">test case</a>:
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   720
                <table>
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   721
                <thead>
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   722
                    <tr>
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   723
                    <th><th>Gecko<th>Opera<th>Chrome
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   724
                <tbody>
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   725
                    <tr>
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   726
                    <th>document.location <td colspan=3>null
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   727
                    <tr>
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   728
                    <th>document.URL <td>unsupported <td>unsupported <td>""
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   729
                    <tr>
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   730
                    <th>document.documentURI <td>Page URL <td>null <td>null
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   731
                </table>
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   732
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   733
                <p>Anne van Kesteren suggests using the default, about:blank.
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   734
            </div>
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   735
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   736
            <p class=note>The returned
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   737
            <a title=concept-document data-spec="DOM4" class="externalDFN">document</a>'s
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   738
            <a title=concept-document-encoding data-spec="DOM4" class="externalDFN">encoding</a> is
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   739
            the default, UTF-8.
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   740
        </dd>
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   741
    </dl>
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   742
</section>
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   743
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   744
<section>
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   745
    <h1>The <code>XMLSerializer</code> interface</h1>
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   746
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   747
    <p>The <dfn title=dom-XMLSerializer><code>XMLSerializer()</code></dfn>
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   748
    constructor must return a new <code>XMLSerializer</code> object.
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   749
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   750
    <dl class="idl" title="[Constructor] interface XMLSerializer">
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   751
        <dt>DOMString serializeToString(Node root)</dt>
0
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   752
17
b1c206041ab9 Small consistency fix plus validation error fix.
travil
parents: 16
diff changeset
   753
        <dd>The <code>serializeToString(<var>root</var>)</code>
1
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   754
        method must <a title=concept-serialize-xml>produce an XML serialization</a> of <var>root</var> and return the result.</dd>
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   755
    </dl>
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   756
</section>
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   757
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   758
<section>
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   759
    <h1>Extensions to the <code><a title="element" data-spec="DOM4" class="externalDFN">Element</a></code> interface</h1>
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   760
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   761
    <dl class="idl" title="partial interface Element">
11
ed0d76e9894d Processing WHATWG checkin:
travil
parents: 10
diff changeset
   762
        <dt>[TreatNullAs=EmptyString] attribute DOMString innerHTML</dt>
1
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   763
        <dd>
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   764
            <p>The <dfn title=dom-Element-innerHTML><code>innerHTML</code></dfn> IDL
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   765
            attribute represents the markup of the
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   766
            <code><a title="element" data-spec="DOM4" class="externalDFN">Element</a></code>'s contents.
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   767
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   768
            <dl class=domintro>
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   769
                <!--doc.ih
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   770
                <dt><var>document</var> . <code title=dom-Document-innerHTML>innerHTML</code> [ = <var>value</var> ]
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   771
                <dd>
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   772
                <p>Returns a fragment of HTML or XML that represents the
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   773
                <code><a title="document" data-spec="DOM4" class="externalDFN">Document</a></code>.
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   774
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   775
                <p>Can be set, to replace the
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   776
                <code><a title="document" data-spec="DOM4" class="externalDFN">Document</a></code>'s contents with the result of
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   777
                parsing the given string.
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   778
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   779
                <p>In the case of an <a title="xml-document" data-spec="DOM4" class="externalDFN">XML document</a>,
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   780
                will throw an
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   781
                <code><a data-spec="DOM4" title=domexception class="externalDFN">DOMException</a></code> with name <code>InvalidStateError</code>
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   782
                if the <code><a title="document" data-spec="DOM4" class="externalDFN">Document</a></code> cannot be serialized
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   783
                to XML, and a
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   784
                <code><a data-spec="DOM4" title=domexception class="externalDFN">DOMException</a></code> with name <code>SyntaxError</code>
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   785
                if the given string is not well-formed.
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   786
                -->
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   787
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   788
                <dt><var>element</var> . <code title=dom-Element-innerHTML>innerHTML</code> [ = <var>value</var> ]
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   789
                <dd>
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   790
                <p>Returns a fragment of HTML or XML that represents the element's
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   791
                contents.
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   792
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   793
                <p>Can be set, to replace the contents of the element with nodes
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   794
                parsed from the given string.
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   795
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   796
                <p>In the case of an <a title="xml-document" data-spec="DOM4" class="externalDFN">XML document</a>,
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   797
                will throw a
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   798
                <code><a data-spec="DOM4" title=domexception class="externalDFN">DOMException</a></code> with name <code>InvalidStateError</code>
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   799
                if the <code><a title="element" data-spec="DOM4" class="externalDFN">Element</a></code> cannot be serialized
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   800
                to XML, and a
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   801
                <code><a data-spec="DOM4" title=domexception class="externalDFN">DOMException</a></code> with name <code>SyntaxError</code>
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   802
                if the given string is not well-formed.
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   803
            </dl>
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   804
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   805
            <p>On getting, if the <a title="context object">context object</a>'s
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   806
            <a title="concept-node-document" data-spec="DOM4" class="externalDFN">node document</a>
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   807
            is an <a title="html-document" data-spec="DOM4" class="externalDFN">HTML document</a>, then the attribute
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   808
            must return the result of running the
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   809
            <a data-spec="HTML5" title="html-fragment-serialization-algorithm" class="externalDFN">HTML fragment serialization algorithm</a> on the
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   810
            <a title="context object">context object</a>; otherwise, the <a title="context object">context object</a>'s
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   811
            <a title="concept-node-document" data-spec="DOM4" class="externalDFN">node document</a>
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   812
            is an <a title="xml-document" data-spec="DOM4" class="externalDFN">XML document</a>, and the attribute must
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   813
            return the result of running the        
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   814
            <a data-spec="HTML5" title="xml-fragment-serialization-algorithm" class="externalDFN">XML fragment serialization algorithm</a> on the
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   815
            <a title="context object">context object</a> instead (this might throw an
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   816
            exception instead of returning a string).
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   817
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   818
            <p>On setting, these steps must be run:
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   819
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   820
            <ol>
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   821
                <li>Let <var>fragment</var> be the result of invoking the
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   822
                <a title="concept-parse-fragment">fragment parsing algorithm</a> with
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   823
                the new value as <var>markup</var>, and the
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   824
                <a title="context object">context object</a> as the <var>context element</var>.
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   825
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   826
                <li><a data-spec="DOM4" title=concept-node-replace-all class="externalDFN">Replace all</a>
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   827
                with <var>fragment</var> within the <a title="context object">context object</a>.
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   828
            </ol>
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   829
        </dd>
0
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   830
1
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   831
        <!-- outerHTML -->
11
ed0d76e9894d Processing WHATWG checkin:
travil
parents: 10
diff changeset
   832
        <dt>[TreatNullAs=EmptyString] attribute DOMString outerHTML</dt>
1
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   833
        <dd>
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   834
            <p>The <dfn title=dom-Element-outerHTML><code>outerHTML</code></dfn> IDL
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   835
            attribute represents the markup of the
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   836
            <code><a title="element" data-spec="DOM4" class="externalDFN">Element</a></code> and its contents.
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   837
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   838
            <dl class=domintro>
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   839
              <dt><var>element</var> . <code title=dom-Element-outerHTML>outerHTML</code> [ = <var>value</var> ]
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   840
              <dd>
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   841
                <p>Returns a fragment of HTML or XML that represents the element and its
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   842
                contents.
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   843
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   844
                <p>Can be set, to replace the element with nodes parsed from the given
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   845
                string.
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   846
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   847
                <p>In the case of an <a title="xml-document" data-spec="DOM4" class="externalDFN">XML document</a>,
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   848
                will throw a
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   849
                <code><a data-spec="DOM4" title=domexception class="externalDFN">DOMException</a></code> with name <code>InvalidStateError</code>
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   850
                if the element cannot be serialized to XML, and a
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   851
                <code><a data-spec="DOM4" title=domexception class="externalDFN">DOMException</a></code> with name <code>SyntaxError</code>
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   852
                if the given string is not well-formed.
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   853
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   854
                <p>Throws a
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   855
                <code><a data-spec="DOM4" title=domexception class="externalDFN">DOMException</a></code> with name <code>NoModificationAllowedError</code>
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   856
                if the parent of the element is the
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   857
                <code><a title="document" data-spec="DOM4" class="externalDFN">Document</a></code> node.
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   858
            </dl>
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   859
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   860
            <p>On getting, if the <a title="context object">context object</a>'s
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   861
            <a title="concept-node-document" data-spec="DOM4" class="externalDFN">node document</a>
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   862
            is an <a title="html-document" data-spec="DOM4" class="externalDFN">HTML document</a>, then the attribute
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   863
            must return the result of running the
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   864
            <a data-spec="HTML5" title="html-fragment-serialization-algorithm" class="externalDFN">HTML fragment serialization algorithm</a> on a
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   865
            fictional node whose only child is <a title="context object">context object</a>; otherwise, the
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   866
            <a title="context object">context object</a>'s
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   867
            <a title="concept-node-document" data-spec="DOM4" class="externalDFN">node document</a>
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   868
            is an <a title="xml-document" data-spec="DOM4" class="externalDFN">XML document</a>, and the attribute must
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   869
            return the result of running the
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   870
            <a data-spec="HTML5" title="xml-fragment-serialization-algorithm" class="externalDFN">XML fragment serialization algorithm</a> on that
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   871
            fictional node instead (this might throw an exception instead of returning a
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   872
            string).
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   873
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   874
            <p>On setting, the following steps must be run:
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   875
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   876
            <ol>
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   877
                <li>Let <var>parent</var> be the <a title="context object">context object</a>'s
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   878
                <a data-spec="DOM4" title=concept-tree-parent class="externalDFN">parent</a>.
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   879
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   880
                <li>If <var>parent</var> is null, terminate these steps. There would be no
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   881
                way to obtain a reference to the nodes created even if the remaining steps
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   882
                were run.
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   883
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   884
                <li>If <var>parent</var> is a
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   885
                <code><a title="document" data-spec="DOM4" class="externalDFN">Document</a></code>, throw a
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   886
                <code><a data-spec="DOM4" title=domexception class="externalDFN">DOMException</a></code> with name <code>NoModificationAllowedError</code>
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   887
                exception and terminate these steps.
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   888
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   889
                <li>If <var>parent</var> is a
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   890
                <code><a title="documentfragment" data-spec="DOM4" class="externalDFN">DocumentFragment</a></code>, let
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   891
                <var>parent</var> be a new
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   892
                <code><a title="element" data-spec="DOM4" class="externalDFN">Element</a></code> with
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   893
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   894
                <ul>
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   895
                    <li><code>body</code> as its
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   896
                    <a data-spec="DOM4" title=concept-element-local-name class="externalDFN">local name</a>,
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   897
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   898
                    <li>the <a data-spec="DOM4" title="html-namespace" class="externalDFN">HTML namespace</a> as its
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   899
                    <a data-spec="DOM4" title="concept-element-namespace" class="externalDFN">namespace</a>, and
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   900
                    <li>the <a title="context object">context object</a>'s
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   901
                    <a title="concept-node-document" data-spec="DOM4" class="externalDFN">node document</a>
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   902
                    as its
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   903
                    <a title="concept-node-document" data-spec="DOM4" class="externalDFN">node document</a>.
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   904
                </ul>
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   905
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   906
                <li>Let <var>fragment</var> be the result of invoking the
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   907
                <a title="concept-parse-fragment">fragment parsing algorithm</a> with
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   908
                the new value as <var>markup</var>, and <var>parent</var> as
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   909
                the <var>context element</var>.
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   910
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   911
                <li><a data-spec="DOM4" title=concept-node-replace class="externalDFN">Replace</a>
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   912
                the <a title="context object">context object</a> with <var>fragment</var> within
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   913
                the <a title="context object">context object</a>'s
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   914
                <a data-spec="DOM4" title=concept-tree-parent class="externalDFN">parent</a>.
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   915
            </ol>
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   916
        </dd>
0
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   917
1
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   918
        <!-- insertAdjacentHTML -->
9
da5f2328b74a Processing WHATWG checkin:
travil
parents: 8
diff changeset
   919
        <dt>void insertAdjacentHTML(DOMString position, DOMString text)</dt>
1
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   920
        <dd>
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   921
             <dl class=domintro>
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   922
                  <dt><var>element</var> . <code title=dom-Element-insertAdjacentHTML>insertAdjacentHTML</code>(<var>position</var>, <var>text</var>)
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   923
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   924
                  <dd>
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   925
                    <p>Parses the given string <var>text</var> as HTML or XML and inserts
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   926
                    the resulting nodes into the tree in the position given by the
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   927
                    <var>position</var> argument, as follows:
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   928
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   929
                    <dl>
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   930
                      <dt>"beforebegin"
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   931
                      <dd>Before the element itself.
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   932
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   933
                      <dt>"afterbegin"
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   934
                      <dd>Just inside the element, before its first child.
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   935
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   936
                      <dt>"beforeend"
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   937
                      <dd>Just inside the element, after its last child.
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   938
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   939
                      <dt>"afterend"
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   940
                      <dd>After the element itself.
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   941
                    </dl>
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   942
9
da5f2328b74a Processing WHATWG checkin:
travil
parents: 8
diff changeset
   943
                    <p>Throws a <code>SyntaxError</code> exception if the arguments have invalid values (e.g., in the case of an
da5f2328b74a Processing WHATWG checkin:
travil
parents: 8
diff changeset
   944
                    <a data-spec="DOM4" title="XML-document" class="externalDFN">XML document</a>, if the given string is
da5f2328b74a Processing WHATWG checkin:
travil
parents: 8
diff changeset
   945
                    not well-formed).
1
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   946
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   947
                    <p>Throws a
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   948
                    <code><a data-spec="DOM4" title=domexception class="externalDFN">DOMException</a></code> with name <code>NoModificationAllowedError</code>
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   949
                    if the given position isn't possible (e.g. inserting elements
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   950
                    after the root element of a <code><a title="document" data-spec="DOM4" class="externalDFN">Document</a></code>).
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   951
                </dl>
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   952
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   953
                <p>The
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   954
                <dfn title=dom-Element-insertAdjacentHTML><code>insertAdjacentHTML(<var>position</var>, <var>text</var>)</code></dfn>
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   955
                method must run these steps:
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   956
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   957
                <ol>
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   958
                    <li>Use the first matching item from this list:
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   959
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   960
                    <dl class=switch>
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   961
                        <dt>If <var>position</var> is an
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   962
                        <a data-spec="DOM4" class="externalDFN" title="ascii-case-insensitive">ASCII case-insensitive</a> match for
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   963
                        the string "beforebegin"
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   964
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   965
                        <dt>If <var>position</var> is an
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   966
                        <a data-spec="DOM4" class="externalDFN" title="ascii-case-insensitive">ASCII case-insensitive</a> match for
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   967
                        the string "afterend"
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   968
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   969
                        <dd>
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   970
                            <p>Let <var>context</var> be the <a title="context object">context object</a>'s
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   971
                            <a data-spec="DOM4" title=concept-tree-parent class="externalDFN">parent</a>.
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   972
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   973
                            <p>If <var>context</var> is null or a
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   974
                            <a data-spec="DOM4" class="externalDFN" title="concept-document">document</a>, throw
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   975
                            a
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   976
                            <code><a data-spec="DOM4" title=domexception class="externalDFN">DOMException</a></code> with name <code>NoModificationAllowedError</code>
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   977
                            and terminate these steps.
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   978
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   979
                        <dt>If <var>position</var> is an
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   980
                        <a data-spec="DOM4" class="externalDFN" title="ascii-case-insensitive">ASCII case-insensitive</a> match for
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   981
                        the string "afterbegin"
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   982
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   983
                        <dt>If <var>position</var> is an
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   984
                        <a data-spec="DOM4" class="externalDFN" title="ascii-case-insensitive">ASCII case-insensitive</a> match for
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   985
                        the string "beforeend"
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   986
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   987
                        <dd>Let <var>context</var> be the <a title="context object">context object</a>.
9
da5f2328b74a Processing WHATWG checkin:
travil
parents: 8
diff changeset
   988
da5f2328b74a Processing WHATWG checkin:
travil
parents: 8
diff changeset
   989
                        <dt>Otherwise
da5f2328b74a Processing WHATWG checkin:
travil
parents: 8
diff changeset
   990
                        <dd>
da5f2328b74a Processing WHATWG checkin:
travil
parents: 8
diff changeset
   991
                            <p>Throw a <code>SyntaxError</code> exception.
1
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   992
                    </dl>
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   993
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   994
                  <li>If <var>context</var> is not an
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   995
                    <code><a title="element" data-spec="DOM4" class="externalDFN">Element</a></code> or the following are all true:
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   996
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   997
                    <ul>
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   998
                      <li><var>context</var>'s
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   999
                      <a title="concept-node-document" data-spec="DOM4" class="externalDFN">node document</a>
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
  1000
                      is an <a title="html-document" data-spec="DOM4" class="externalDFN">HTML document</a>,
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
  1001
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
  1002
                      <li><var>context</var>'s
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
  1003
                      <a data-spec="DOM4" title=concept-element-local-name class="externalDFN">local name</a>
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
  1004
                      is "<code>html</code>", and
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
  1005
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
  1006
                      <li><var>context</var>'s
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
  1007
                      <a data-spec="DOM4" title="concept-element-namespace" class="externalDFN">namespace</a>
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
  1008
                      is the <a data-spec="DOM4" title="html-namespace" class="externalDFN">HTML namespace</a>;
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
  1009
                    </ul>
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
  1010
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
  1011
                    <p>let <var>context</var> be a new
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
  1012
                    <code><a title="element" data-spec="DOM4" class="externalDFN">Element</a></code> with
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
  1013
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
  1014
                    <ul>
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
  1015
                      <li><code>body</code> as its
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
  1016
                      <a data-spec="DOM4" title=concept-element-local-name class="externalDFN">local name</a>,
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
  1017
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
  1018
                      <li>the <a data-spec="DOM4" title="html-namespace" class="externalDFN">HTML namespace</a> as its
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
  1019
                      <a data-spec="DOM4" title="concept-element-namespace" class="externalDFN">namespace</a>, and
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
  1020
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
  1021
                      <li>the <a title="context object">context object</a>'s
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
  1022
                      <a title="concept-node-document" data-spec="DOM4" class="externalDFN">node document</a>
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
  1023
                      as its
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
  1024
                      <a title="concept-node-document" data-spec="DOM4" class="externalDFN">node document</a>.
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
  1025
                    </ul>
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
  1026
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
  1027
                <li>Let <var>fragment</var> be the result of invoking the
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
  1028
                <a title="concept-parse-fragment">fragment parsing algorithm</a> with <var>text</var> as 
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
  1029
                <var>markup</var>, and <var>parent</var> as the <var>context element</var>.
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
  1030
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
  1031
                <li>Use the first matching item from this list:
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
  1032
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
  1033
                <dl class=switch>
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
  1034
                    <dt>If <var>position</var> is an
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
  1035
                    <a data-spec="DOM4" class="externalDFN" title="ascii-case-insensitive">ASCII case-insensitive</a> match for
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
  1036
                    the string "beforebegin"
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
  1037
            
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
  1038
                    <dd><a data-spec="DOM4" title=concept-node-insert class="externalDFN">Insert</a>
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
  1039
                    <var>fragment</var> into the <a title="context object">context object</a>'s
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
  1040
                    <a data-spec="DOM4" title=concept-tree-parent class="externalDFN">parent</a>
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
  1041
                    before the <a title="context object">context object</a>.
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
  1042
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
  1043
                    <dt>If <var>position</var> is an
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
  1044
                    <a data-spec="DOM4" class="externalDFN" title="ascii-case-insensitive">ASCII case-insensitive</a> match for
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
  1045
                    the string "afterbegin"
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
  1046
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
  1047
                    <dd><a data-spec="DOM4" title=concept-node-insert class="externalDFN">Insert</a>
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
  1048
                    <var>fragment</var> into the <a title="context object">context object</a>
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
  1049
                    before its
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
  1050
                    <a data-spec="DOM4" title=concept-tree-first-child class="externalDFN">first child</a>.
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
  1051
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
  1052
                    <dt>If <var>position</var> is an
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
  1053
                    <a data-spec="DOM4" class="externalDFN" title="ascii-case-insensitive">ASCII case-insensitive</a> match for
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
  1054
                    the string "beforeend"
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
  1055
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
  1056
                    <dd><a data-spec="DOM4" title="concept-node-append" class="externalDFN">Append</a>
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
  1057
                    <var>fragment</var> to the <a title="context object">context object</a>.
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
  1058
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
  1059
                    <dt>If <var>position</var> is an
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
  1060
                    <a data-spec="DOM4" class="externalDFN" title="ascii-case-insensitive">ASCII case-insensitive</a> match for
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
  1061
                    the string "afterend"
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
  1062
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
  1063
                    <dd><a data-spec="DOM4" title=concept-node-insert class="externalDFN">Insert</a>
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
  1064
                    <var>fragment</var> into the <a title="context object">context object</a>'s
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
  1065
                    <a data-spec="DOM4" title=concept-tree-parent class="externalDFN">parent</a>
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
  1066
                    before the <a title="context object">context object</a>'s
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
  1067
                    <a data-spec="DOM4" title=concept-tree-next-sibling class="externalDFN">next sibling</a>.
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
  1068
                </dl>
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
  1069
            </ol>
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
  1070
        </dd>
0
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
  1071
1
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
  1072
    </dl>
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
  1073
</section>
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
  1074
14
edebbe3facb6 Add support for CDATA serializations in DOM (for XML and programmatic creation).
travil
parents: 13
diff changeset
  1075
<!-- Dropping this extention as it is not implemented, nor does it appear that any browser
edebbe3facb6 Add support for CDATA serializations in DOM (for XML and programmatic creation).
travil
parents: 13
diff changeset
  1076
     is currently interested in supporting it. Perhaps it can come back in a V2 of this spec
edebbe3facb6 Add support for CDATA serializations in DOM (for XML and programmatic creation).
travil
parents: 13
diff changeset
  1077
     if browsers become interested.
1
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
  1078
<section>
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
  1079
    <h1>Extensions to the <code><a title="text" data-spec="DOM4" class="externalDFN">Text</a></code> interface</h1>
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
  1080
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
  1081
    <dl class="idl" title="partial interface Text">
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
  1082
        <dt>attribute boolean serializeAsCDATA</dt>
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
  1083
        <dd>
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
  1084
            <dl class=domintro>
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
  1085
              <dt><var>text</var> .
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
  1086
                  <code title=dom-Text-serializeAsCDATA>serializeAsCDATA</code> [ = <var>value</var> ]
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
  1087
              <dd>Controls whether, in XML, this node is serialized as a CDATA section.
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
  1088
            </dl>
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
  1089
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
  1090
            <p><code><a title="text" data-spec="DOM4" class="externalDFN">Text</a></code> nodes have an additional
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
  1091
            associated flag, the <dfn>serialize as CDATA flag</dfn>.
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
  1092
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
  1093
            <p>The
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
  1094
            <dfn title=dom-Text-serializeAsCDATA><code>serializeAsCDATA</code></dfn>
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
  1095
            attribute must return true if the <a title="context object">context object</a> has its
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
  1096
            <a>serialize as CDATA flag</a> set, or false otherwise.
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
  1097
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
  1098
            <p>Setting the <code title=dom-Text-serializeAsCDATA>serializeAsCDATA</code>
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
  1099
            attribute must, if the new value is true, set the
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
  1100
            <a title="context object">context object</a>'s <a>serialize as CDATA flag</a>, or unset
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
  1101
            it otherwise.
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
  1102
        </dd>
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
  1103
    </dl>
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
  1104
</section>
14
edebbe3facb6 Add support for CDATA serializations in DOM (for XML and programmatic creation).
travil
parents: 13
diff changeset
  1105
-->
1
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
  1106
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
  1107
<section>
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
  1108
    <h1>Extensions to the <code><a data-spec="DOM4" title="range" class="externalDFN">Range</a></code> interface</h1>
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
  1109
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
  1110
    <dl class="idl" title="partial interface Range">
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
  1111
        <dt>DocumentFragment createContextualFragment(DOMString fragment)</dt>
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
  1112
        <dd>
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
  1113
            <dl class=domintro>
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
  1114
              <dt><var>fragment</var> = <var>range</var> . <code title=dom-Range-createContextualFragment>createContextualFragment</code>(<var>fragment</var>)
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
  1115
              <dd>Returns a <code><a title="documentfragment" data-spec="DOM4" class="externalDFN">DocumentFragment</a></code>, created
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
  1116
                from the markup string given.
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
  1117
            </dl>
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
  1118
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
  1119
            <p>The
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
  1120
            <dfn title=dom-Range-createContextualFragment><code>createContextualFragment(<var>fragment</var>)</code></dfn>
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
  1121
            method must run these steps: