LCWD-DOM-Parsing-20131205.html
author Art Barstow <art.barstow@nokia.com>
Fri, 13 Jun 2014 10:56:15 -0400
changeset 73 d69286304cc3
parent 29 9425d4d28248
permissions -rw-r--r--
Update title of WHATWG version of DOM P&S spec
25
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
     1
<!DOCTYPE html>
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
     2
<html lang="en" dir="ltr" typeof="bibo:Document w3p:LastCall" about="" property="dcterms:language" content="en">
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
     3
<head>
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
     4
    <meta charset="UTF-8">
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
     5
    <title>DOM Parsing and Serialization</title>
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
     6
    <style>
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
     7
        /* Make these stand-out more... */
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
     8
        .externalDFN {
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
     9
            font-style: italic;
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
    10
            background-color: #fff9d6;
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
    11
        }
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
    12
        /* Switch statement */
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
    13
        dl.switch dt::before {
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
    14
            content: "↪ ";
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
    15
            margin-left: 1em;
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
    16
        }
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
    17
        /* Better spacing around various lists (implied paragraph children) */
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
    18
        ol > li, section:not(#toc) ul > li, section dl > dt {
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
    19
            margin: 1em 0;
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
    20
        }
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
    21
        /* domintro styling */
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
    22
        dl.domintro {
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
    23
            background-color: rgb(221, 255, 221);
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
    24
            padding: 1em 0.5em 1em 2em;
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
    25
            clear: both;
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
    26
        }
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
    27
        dl.domintro dt {
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
    28
            color: black;
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
    29
        }
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
    30
        dl.domintro > dd {
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
    31
            color: green;
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
    32
        }
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
    33
        dl.domintro::before {
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
    34
            float: right;
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
    35
            background-color: white;
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
    36
            display: block;
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
    37
            border: 2px solid black;
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
    38
            color: green;
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
    39
            margin-top: -20px;
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
    40
            padding: 2px;
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
    41
            content: "This box is non-normative. Implementation requirements are given below this box.";
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
    42
        }
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
    43
        /* Fancy table stuff */
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
    44
        table {
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
    45
            border-collapse: collapse;
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
    46
        }
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
    47
        thead tr {
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
    48
            border-bottom: 2px solid black;
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
    49
        }
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
    50
        tbody tr:not(:last-child) {
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
    51
            border-bottom: 1px solid black;
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
    52
        }
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
    53
        td {
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
    54
            border-left: 1px solid black;
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
    55
            padding: 4px;
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
    56
        }
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
    57
        /* Extra IDL :-) */
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
    58
        .extraidl {
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
    59
            line-height: 120%;
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
    60
            padding: 1em;
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
    61
            border-top: 1px solid #90b8de;
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
    62
            border-bottom: 1px solid #90b8de;
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
    63
        }
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
    64
        .extraidl:before {
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
    65
            width: 150px;
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
    66
            color: #fff;
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
    67
            padding: 3px;
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
    68
            font-weight: bold;
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
    69
            font-family: initial;
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
    70
            margin: -1em 0 1em -1em;
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
    71
            display: block;
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
    72
            content: "WebIDL";
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
    73
            background-color: rgb(144, 184, 222);
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
    74
        }
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
    75
    </style>
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
    76
    
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
    77
    
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
    78
<style>/*****************************************************************
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
    79
 * ReSpec 3 CSS
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
    80
 * Robin Berjon - http://berjon.com/
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
    81
 *****************************************************************/
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
    82
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
    83
/* --- INLINES --- */
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
    84
em.rfc2119 { 
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
    85
    text-transform:     lowercase;
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
    86
    font-variant:       small-caps;
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
    87
    font-style:         normal;
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
    88
    color:              #900;
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
    89
}
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
    90
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
    91
h1 acronym, h2 acronym, h3 acronym, h4 acronym, h5 acronym, h6 acronym, a acronym,
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
    92
h1 abbr, h2 abbr, h3 abbr, h4 abbr, h5 abbr, h6 abbr, a abbr {
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
    93
    border: none;
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
    94
}
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
    95
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
    96
dfn {
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
    97
    font-weight:    bold;
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
    98
}
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
    99
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   100
a.internalDFN {
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   101
    color:  inherit;
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   102
    border-bottom:  1px solid #99c;
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   103
    text-decoration:    none;
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   104
}
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   105
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   106
a.externalDFN {
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   107
    color:  inherit;
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   108
    border-bottom:  1px dotted #ccc;
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   109
    text-decoration:    none;
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   110
}
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   111
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   112
a.bibref {
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   113
    text-decoration:    none;
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   114
}
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   115
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   116
cite .bibref {
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   117
    font-style: normal;
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   118
}
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   119
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   120
code {
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   121
    color:  #ff4500;
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   122
}
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   123
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   124
/* --- TOC --- */
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   125
.toc a, .tof a {
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   126
    text-decoration:    none;
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   127
}
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   128
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   129
a .secno, a .figno {
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   130
    color:  #000;
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   131
}
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   132
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   133
ul.tof, ol.tof {
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   134
    list-style: none outside none;
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   135
}
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   136
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   137
.caption {
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   138
    margin-top: 0.5em;
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   139
    font-style:   italic;
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   140
}
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   141
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   142
/* --- TABLE --- */
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   143
table.simple {
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   144
    border-spacing: 0;
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   145
    border-collapse:    collapse;
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   146
    border-bottom:  3px solid #005a9c;
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   147
}
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   148
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   149
.simple th {
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   150
    background: #005a9c;
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   151
    color:  #fff;
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   152
    padding:    3px 5px;
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   153
    text-align: left;
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   154
}
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   155
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   156
.simple th[scope="row"] {
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   157
    background: inherit;
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   158
    color:  inherit;
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   159
    border-top: 1px solid #ddd;
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   160
}
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   161
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   162
.simple td {
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   163
    padding:    3px 10px;
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   164
    border-top: 1px solid #ddd;
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   165
}
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   166
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   167
.simple tr:nth-child(even) {
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   168
    background: #f0f6ff;
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   169
}
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   170
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   171
/* --- DL --- */
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   172
.section dd > p:first-child {
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   173
    margin-top: 0;
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   174
}
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   175
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   176
.section dd > p:last-child {
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   177
    margin-bottom: 0;
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   178
}
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   179
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   180
.section dd {
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   181
    margin-bottom:  1em;
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   182
}
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   183
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   184
.section dl.attrs dd, .section dl.eldef dd {
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   185
    margin-bottom:  0;
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   186
}
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   187
</style><style>/* --- ISSUES/NOTES --- */
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   188
div.issue-title, div.note-title {
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   189
    padding-right:  1em;
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   190
    min-width: 7.5em;
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   191
    color: #b9ab2d;
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   192
}
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   193
div.issue-title { color: #e05252; }
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   194
div.note-title { color: #2b2; }
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   195
div.issue-title span, div.note-title span {
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   196
    text-transform: uppercase;
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   197
}
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   198
div.note, div.issue {
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   199
    margin-top: 1em;
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   200
    margin-bottom: 1em;
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   201
}
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   202
.note > p:first-child, .issue > p:first-child { margin-top: 0 }
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   203
.issue, .note {
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   204
    padding: .5em;
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   205
    border-left-width: .5em;
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   206
    border-left-style: solid;
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   207
}
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   208
div.issue, div.note {
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   209
    padding: 1em 1.2em 0.5em;
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   210
    margin: 1em 0;
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   211
    position: relative;
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   212
    clear: both;
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   213
}
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   214
span.note, span.issue { padding: .1em .5em .15em; }
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   215
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   216
.issue {
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   217
    border-color: #e05252;
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   218
    background: #fbe9e9;
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   219
}
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   220
.note {
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   221
    border-color: #52e052;
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   222
    background: #e9fbe9;
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   223
}
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   224
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   225
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   226
</style><style>/* --- WEB IDL --- */
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   227
pre.idl {
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   228
    border-top: 1px solid #90b8de;
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   229
    border-bottom: 1px solid #90b8de;
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   230
    padding:    1em;
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   231
    line-height:    120%;
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   232
}
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   233
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   234
pre.idl::before {
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   235
    content:    "WebIDL";
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   236
    display:    block;
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   237
    width:      150px;
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   238
    background: #90b8de;
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   239
    color:  #fff;
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   240
    font-family:    initial;
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   241
    padding:    3px;
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   242
    font-weight:    bold;
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   243
    margin: -1em 0 1em -1em;
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   244
}
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   245
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   246
.idlType {
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   247
    color:  #ff4500;
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   248
    font-weight:    bold;
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   249
    text-decoration:    none;
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   250
}
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   251
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   252
/*.idlModule*/
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   253
/*.idlModuleID*/
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   254
/*.idlInterface*/
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   255
.idlInterfaceID, .idlDictionaryID, .idlCallbackID, .idlEnumID {
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   256
    font-weight:    bold;
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   257
    color:  #005a9c;
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   258
}
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   259
a.idlEnumItem {
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   260
    color:  #000;
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   261
    border-bottom:  1px dotted #ccc;
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   262
    text-decoration: none;
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   263
}
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   264
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   265
.idlSuperclass {
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   266
    font-style: italic;
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   267
    color:  #005a9c;
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   268
}
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   269
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   270
/*.idlAttribute*/
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   271
.idlAttrType, .idlFieldType, .idlMemberType {
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   272
    color:  #005a9c;
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   273
}
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   274
.idlAttrName, .idlFieldName, .idlMemberName {
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   275
    color:  #ff4500;
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   276
}
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   277
.idlAttrName a, .idlFieldName a, .idlMemberName a {
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   278
    color:  #ff4500;
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   279
    border-bottom:  1px dotted #ff4500;
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   280
    text-decoration: none;
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   281
}
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   282
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   283
/*.idlMethod*/
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   284
.idlMethType, .idlCallbackType {
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   285
    color:  #005a9c;
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   286
}
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   287
.idlMethName {
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   288
    color:  #ff4500;
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   289
}
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   290
.idlMethName a {
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   291
    color:  #ff4500;
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   292
    border-bottom:  1px dotted #ff4500;
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   293
    text-decoration: none;
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   294
}
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   295
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   296
/*.idlCtor*/
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   297
.idlCtorName {
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   298
    color:  #ff4500;
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   299
}
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   300
.idlCtorName a {
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   301
    color:  #ff4500;
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   302
    border-bottom:  1px dotted #ff4500;
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   303
    text-decoration: none;
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   304
}
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   305
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   306
/*.idlParam*/
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   307
.idlParamType {
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   308
    color:  #005a9c;
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   309
}
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   310
.idlParamName, .idlDefaultValue {
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   311
    font-style: italic;
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   312
}
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   313
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   314
.extAttr {
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   315
    color:  #666;
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   316
}
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   317
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   318
/*.idlSectionComment*/
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   319
.idlSectionComment {
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   320
    color: gray;
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   321
}
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   322
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   323
/*.idlConst*/
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   324
.idlConstType {
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   325
    color:  #005a9c;
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   326
}
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   327
.idlConstName {
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   328
    color:  #ff4500;
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   329
}
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   330
.idlConstName a {
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   331
    color:  #ff4500;
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   332
    border-bottom:  1px dotted #ff4500;
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   333
    text-decoration: none;
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   334
}
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   335
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   336
/*.idlException*/
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   337
.idlExceptionID {
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   338
    font-weight:    bold;
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   339
    color:  #c00;
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   340
}
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   341
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   342
.idlTypedefID, .idlTypedefType {
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   343
    color:  #005a9c;
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   344
}
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   345
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   346
.idlRaises, .idlRaises a.idlType, .idlRaises a.idlType code, .excName a, .excName a code {
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   347
    color:  #c00;
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   348
    font-weight:    normal;
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   349
}
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   350
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   351
.excName a {
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   352
    font-family:    monospace;
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   353
}
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   354
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   355
.idlRaises a.idlType, .excName a.idlType {
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   356
    border-bottom:  1px dotted #c00;
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   357
}
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   358
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   359
.excGetSetTrue, .excGetSetFalse, .prmNullTrue, .prmNullFalse, .prmOptTrue, .prmOptFalse {
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   360
    width:  45px;
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   361
    text-align: center;
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   362
}
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   363
.excGetSetTrue, .prmNullTrue, .prmOptTrue { color:  #0c0; }
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   364
.excGetSetFalse, .prmNullFalse, .prmOptFalse { color:  #c00; }
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   365
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   366
.idlImplements a {
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   367
    font-weight:    bold;
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   368
}
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   369
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   370
dl.attributes, dl.methods, dl.constants, dl.constructors, dl.fields, dl.dictionary-members {
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   371
    margin-left:    2em;
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   372
}
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   373
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   374
.attributes dt, .methods dt, .constants dt, .constructors dt, .fields dt, .dictionary-members dt {
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   375
    font-weight:    normal;
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   376
}
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   377
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   378
.attributes dt code, .methods dt code, .constants dt code, .constructors dt code, .fields dt code, .dictionary-members dt code {
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   379
    font-weight:    bold;
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   380
    color:  #000;
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   381
    font-family:    monospace;
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   382
}
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   383
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   384
.attributes dt code, .fields dt code, .dictionary-members dt code {
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   385
    background:  #ffffd2;
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   386
}
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   387
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   388
.attributes dt .idlAttrType code, .fields dt .idlFieldType code, .dictionary-members dt .idlMemberType code {
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   389
    color:  #005a9c;
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   390
    background:  transparent;
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   391
    font-family:    inherit;
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   392
    font-weight:    normal;
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   393
    font-style: italic;
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   394
}
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   395
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   396
.methods dt code {
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   397
    background:  #d9e6f8;
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   398
}
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   399
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   400
.constants dt code {
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   401
    background:  #ddffd2;
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   402
}
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   403
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   404
.constructors dt code {
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   405
    background:  #cfc;
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   406
}
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   407
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   408
.attributes dd, .methods dd, .constants dd, .constructors dd, .fields dd, .dictionary-members dd {
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   409
    margin-bottom:  1em;
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   410
}
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   411
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   412
table.parameters, table.exceptions {
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   413
    border-spacing: 0;
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   414
    border-collapse:    collapse;
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   415
    margin: 0.5em 0;
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   416
    width:  100%;
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   417
}
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   418
table.parameters { border-bottom:  1px solid #90b8de; }
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   419
table.exceptions { border-bottom:  1px solid #deb890; }
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   420
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   421
.parameters th, .exceptions th {
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   422
    color:  #fff;
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   423
    padding:    3px 5px;
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   424
    text-align: left;
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   425
    font-family:    initial;
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   426
    font-weight:    normal;
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   427
    text-shadow:    #666 1px 1px 0;
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   428
}
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   429
.parameters th { background: #90b8de; }
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   430
.exceptions th { background: #deb890; }
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   431
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   432
.parameters td, .exceptions td {
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   433
    padding:    3px 10px;
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   434
    border-top: 1px solid #ddd;
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   435
    vertical-align: top;
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   436
}
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   437
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   438
.parameters tr:first-child td, .exceptions tr:first-child td {
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   439
    border-top: none;
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   440
}
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   441
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   442
.parameters td.prmName, .exceptions td.excName, .exceptions td.excCodeName {
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   443
    width:  100px;
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   444
}
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   445
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   446
.parameters td.prmType {
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   447
    width:  120px;
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   448
}
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   449
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   450
table.exceptions table {
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   451
    border-spacing: 0;
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   452
    border-collapse:    collapse;
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   453
    width:  100%;
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   454
}
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   455
</style><link href="https://www.w3.org/StyleSheets/TR/W3C-WD" rel="stylesheet"><!--[if lt IE 9]><script src='https://www.w3.org/2008/site/js/html5shiv.js'></script><![endif]--></head>
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   456
<body id="respecDocument" role="document" class="h-entry"><div id="respecHeader" role="contentinfo" class="head">
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   457
  <p>
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   458
    
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   459
      <a href="http://www.w3.org/"><img src="https://www.w3.org/Icons/w3c_home" alt="W3C" height="48" width="72"></a>
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   460
    
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   461
  </p>
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   462
  <h1 class="title p-name" id="title" property="dcterms:title">DOM Parsing and Serialization</h1>
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   463
  
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   464
    <h2 property="bibo:subtitle" id="subtitle">DOMParser, XMLSerializer, innerHTML, and similar APIs</h2>
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   465
  
28
8f29e6f6eea2 Updates required by Ian Jacobs
Art Barstow <art.barstow@nokia.com>
parents: 27
diff changeset
   466
  <h2 id="w3c-last-call-working-draft-10-december-2013" property="dcterms:issued" datatype="xsd:dateTime" content="2013-12-04T02:16:56.000Z"><abbr title="World Wide Web Consortium">W3C</abbr> Last Call Working Draft <time class="dt-published" datetime="2013-12-10">10 December 2013</time></h2>
25
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   467
  <dl>
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   468
    
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   469
      <dt>This version:</dt>
28
8f29e6f6eea2 Updates required by Ian Jacobs
Art Barstow <art.barstow@nokia.com>
parents: 27
diff changeset
   470
      <dd><a class="u-url" href="http://www.w3.org/TR/2013/WD-DOM-Parsing-20131210/">http://www.w3.org/TR/2013/WD-DOM-Parsing-20131210/</a></dd>
25
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   471
      <dt>Latest published version:</dt>
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   472
      <dd><a href="http://www.w3.org/TR/DOM-Parsing/">http://www.w3.org/TR/DOM-Parsing/</a></dd>
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   473
    
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   474
    
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   475
      <dt>Latest editor's draft:</dt>
26
b7368fab6d73 Minor editorial fixes for LCWD pub on 5-Dec-2013
Art Barstow <art.barstow@nokia.com>
parents: 25
diff changeset
   476
      <dd><a href="https://dvcs.w3.org/hg/innerhtml/raw-file/tip/index.html">https://dvcs.w3.org/hg/innerhtml/raw-file/tip/index.html</a></dd>
25
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   477
    
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   478
    
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   479
      <dt>Test suite:</dt>
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   480
      <dd><a href="https://github.com/whatwg/domparsing/tree/master/tests">https://github.com/whatwg/domparsing/tree/master/tests</a></dd>
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   481
    
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   482
    
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   483
    
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   484
    
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   485
      <dt>Previous version:</dt>
26
b7368fab6d73 Minor editorial fixes for LCWD pub on 5-Dec-2013
Art Barstow <art.barstow@nokia.com>
parents: 25
diff changeset
   486
      <dd><a rel="dcterms:replaces" href="http://www.w3.org/TR/2012/WD-DOM-Parsing-20120920/">http://www.w3.org/TR/2012/WD-DOM-Parsing-20120920/</a></dd>
25
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   487
    
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   488
    
29
9425d4d28248 Remove Ms2ger per resolution of Bug 18935
Art Barstow <art.barstow@nokia.com>
parents: 28
diff changeset
   489
    <dt>Editor:</dt>
25
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   490
    <dd class="p-author h-card vcard" rel="bibo:editor" inlist=""><span typeof="foaf:Person"><span property="foaf:name" class="p-name fn">Travis Leithead</span>, <a rel="foaf:workplaceHomepage" class="p-org org h-org h-card" href="http://www.microsoft.com">Microsoft</a>, <span class="ed_mailto"><a class="u-email email" rel="foaf:mbox" href="mailto:travis.leithead@microsoft.com">travis.leithead@microsoft.com</a></span></span>
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   491
</dd>
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   492
29
9425d4d28248 Remove Ms2ger per resolution of Bug 18935
Art Barstow <art.barstow@nokia.com>
parents: 28
diff changeset
   493
<!-- <dd class="p-author h-card vcard" rel="bibo:editor" inlist=""><span typeof="foaf:Person"><span property="foaf:name" class="p-name fn">Ms2ger</span>, <a rel="foaf:workplaceHomepage" class="p-org org h-org h-card" href="http://www.mozilla.org/">Mozilla</a> (Upstream WHATWG version)</span>
9425d4d28248 Remove Ms2ger per resolution of Bug 18935
Art Barstow <art.barstow@nokia.com>
parents: 28
diff changeset
   494
</dd> -->
25
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   495
    
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   496
    
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   497
      
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   498
        
28
8f29e6f6eea2 Updates required by Ian Jacobs
Art Barstow <art.barstow@nokia.com>
parents: 27
diff changeset
   499
       <!--   <dt>WHATWG Living Standard:</dt>
25
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   500
          
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   501
             
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   502
                
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   503
                  <dd>
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   504
                    <a href="http://domparsing.spec.whatwg.org/">
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   505
                      http://domparsing.spec.whatwg.org/
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   506
                    </a>
28
8f29e6f6eea2 Updates required by Ian Jacobs
Art Barstow <art.barstow@nokia.com>
parents: 27
diff changeset
   507
                  </dd> -->
25
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   508
                
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   509
             
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   510
          
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   511
        
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   512
      
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   513
    
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   514
  </dl>
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   515
  
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   516
  
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   517
  
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   518
  
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   519
    
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   520
      <p class="copyright">
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   521
        <a href="http://www.w3.org/Consortium/Legal/ipr-notice#Copyright">Copyright</a> ©
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   522
        2013
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   523
        
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   524
        <a href="http://www.w3.org/"><abbr title="World Wide Web Consortium">W3C</abbr></a><sup>®</sup>
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   525
        (<a href="http://www.csail.mit.edu/"><abbr title="Massachusetts Institute of Technology">MIT</abbr></a>,
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   526
        <a href="http://www.ercim.eu/"><abbr title="European Research Consortium for Informatics and Mathematics">ERCIM</abbr></a>,
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   527
        <a href="http://www.keio.ac.jp/">Keio</a>, <a href="http://ev.buaa.edu.cn/">Beihang</a>), 
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   528
        
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   529
        All Rights Reserved.
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   530
        
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   531
        <abbr title="World Wide Web Consortium">W3C</abbr> <a href="http://www.w3.org/Consortium/Legal/ipr-notice#Legal_Disclaimer">liability</a>,
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   532
        <a href="http://www.w3.org/Consortium/Legal/ipr-notice#W3C_Trademarks">trademark</a> and
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   533
        
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   534
          <a href="http://www.w3.org/Consortium/Legal/copyright-documents">document use</a>
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   535
        
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   536
        rules apply.
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   537
      </p>
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   538
    
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   539
  
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   540
  <hr>
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   541
</div>
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   542
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   543
    <section rel="bibo:Chapter" resource="#ref" typeof="bibo:Chapter" datatype="" property="dcterms:abstract" class="introductory" id="abstract"><h2 id="h2_abstract" role="heading" aria-level="1">Abstract</h2>
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   544
       <p>This specification defines various APIs for programmatic access to 
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   545
          HTML and generic XML parsers by web applications for use in parsing 
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   546
          and serializing DOM nodes.</p>
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   547
    </section><section rel="bibo:Chapter" resource="#ref" typeof="bibo:Chapter" id="sotd" class="introductory"><h2 id="h2_sotd" role="heading" aria-level="1">Status of This Document</h2>
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   548
  
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   549
    
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   550
      
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   551
        <p>
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   552
          <em>This section describes the status of this document at the time of its publication.
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   553
          Other documents may supersede this document. A list of current <abbr title="World Wide Web Consortium">W3C</abbr> publications and the
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   554
          latest revision of this technical report can be found in the <a href="http://www.w3.org/TR/"><abbr title="World Wide Web Consortium">W3C</abbr> technical reports index</a> at
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   555
          http://www.w3.org/TR/.</em>
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   556
        </p>
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   557
        
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   558
        <p>This specification is based on the original work of the <a href="http://domparsing.spec.whatwg.org/">
28
8f29e6f6eea2 Updates required by Ian Jacobs
Art Barstow <art.barstow@nokia.com>
parents: 27
diff changeset
   559
            DOM Parsing and Serialization</a> Living Specification, though it has diverged in terms of 
25
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   560
            supported features, normative requirements, and algorithm specificity. As appropriate, 
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   561
            relevant fixes from the living standard are incorporated into this document. 
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   562
    </p>
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   563
        <p>
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   564
          This document was published by the <a href="http://www.w3.org/2008/webapps/">Web Applications Working Group</a> as a Last Call Working Draft.
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   565
          
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   566
            This document is intended to become a <abbr title="World Wide Web Consortium">W3C</abbr> Recommendation.
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   567
          
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   568
          
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   569
            If you wish to make comments regarding this document, please send them to 
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   570
            <a href="mailto:www-dom@w3.org?subject=DOM-Parsing">www-dom@w3.org</a> 
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   571
            (<a href="mailto:www-dom-request@w3.org?subject=subscribe">subscribe</a>,
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   572
            <a href="http://lists.w3.org/Archives/Public/www-dom/">archives</a>)
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   573
              with <code>DOM-Parsing</code> at the start of your email's subject.
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   574
          
28
8f29e6f6eea2 Updates required by Ian Jacobs
Art Barstow <art.barstow@nokia.com>
parents: 27
diff changeset
   575
          The Last Call comment period ends 07 January 2014.
25
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   576
          
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   577
          
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   578
            All comments are welcome.
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   579
          
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   580
        </p>
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   581
        
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   582
        
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   583
          <p>
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   584
            Publication as a Last Call Working Draft does not imply endorsement by the <abbr title="World Wide Web Consortium">W3C</abbr>
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   585
            Membership. This is a draft document and may be updated, replaced or obsoleted by other
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   586
            documents at any time. It is inappropriate to cite this document as other than work in
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   587
            progress.
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   588
          </p>
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   589
        
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   590
        
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   591
          <p>
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   592
            This is a Last Call Working Draft and thus the Working Group has determined that this
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   593
            document has satisfied the relevant technical requirements and is sufficiently stable to
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   594
            advance through the Technical Recommendation process.
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   595
          </p>
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   596
        
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   597
        <p>
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   598
          
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   599
            This document was produced by a group operating under the 
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   600
            <a id="sotd_patent" about="" rel="w3p:patentRules" href="http://www.w3.org/Consortium/Patent-Policy-20040205/">5 February 2004 <abbr title="World Wide Web Consortium">W3C</abbr> Patent
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   601
            Policy</a>.
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   602
          
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   603
          
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   604
          
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   605
            
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   606
              <abbr title="World Wide Web Consortium">W3C</abbr> maintains a <a href="http://www.w3.org/2004/01/pp-impl/42538/status" rel="disclosure">public list of any patent
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   607
              disclosures</a> 
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   608
            
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   609
            made in connection with the deliverables of the group; that page also includes
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   610
            instructions for disclosing a patent. An individual who has actual knowledge of a patent
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   611
            which the individual believes contains
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   612
            <a href="http://www.w3.org/Consortium/Patent-Policy-20040205/#def-essential">Essential
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   613
            Claim(s)</a> must disclose the information in accordance with
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   614
            <a href="http://www.w3.org/Consortium/Patent-Policy-20040205/#sec-Disclosure">section
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   615
            6 of the <abbr title="World Wide Web Consortium">W3C</abbr> Patent Policy</a>.
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   616
          
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   617
          
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   618
        </p>
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   619
        
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   620
      
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   621
    
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   622
  
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   623
</section><section id="toc"><h2 id="h2_toc" role="heading" aria-level="1" class="introductory">Table of Contents</h2><ul id="respecContents" role="directory" class="toc"><li class="tocline"><a class="tocxref" href="#conformance"><span class="secno">1. </span>Conformance</a><ul class="toc"><li class="tocline"><a class="tocxref" href="#dependencies"><span class="secno">1.1 </span>Dependencies</a></li><li class="tocline"><a class="tocxref" href="#extensibility"><span class="secno">1.2 </span>Extensibility</a></li></ul></li><li class="tocline"><a class="tocxref" href="#terminology"><span class="secno">2. </span>Terminology</a></li><li class="tocline"><a class="tocxref" href="#parsing-and-serializing-nodes"><span class="secno">3. </span>Parsing and serializing <span title="node" data-spec="DOM4" class="formerLink">Node</span>s</a><ul class="toc"><li class="tocline"><a class="tocxref" href="#parsing"><span class="secno">3.1 </span>Parsing</a></li><li class="tocline"><a class="tocxref" href="#serializing"><span class="secno">3.2 </span>Serializing</a></li></ul></li><li class="tocline"><a class="tocxref" href="#the-domparser-interface"><span class="secno">4. </span>The <code>DOMParser</code> interface</a><ul class="toc"><li class="tocline"><a class="tocxref" href="#methods"><span class="secno">4.1 </span>Methods</a></li></ul></li><li class="tocline"><a class="tocxref" href="#the-xmlserializer-interface"><span class="secno">5. </span>The <code>XMLSerializer</code> interface</a><ul class="toc"><li class="tocline"><a class="tocxref" href="#methods-1"><span class="secno">5.1 </span>Methods</a></li></ul></li><li class="tocline"><a class="tocxref" href="#extensions-to-the-element-interface"><span class="secno">6. </span>Extensions to the <code><span title="element" data-spec="DOM4" class="formerLink">Element</span></code> interface</a><ul class="toc"><li class="tocline"><a class="tocxref" href="#attributes"><span class="secno">6.1 </span>Attributes</a></li><li class="tocline"><a class="tocxref" href="#methods-2"><span class="secno">6.2 </span>Methods</a></li></ul></li><li class="tocline"><a class="tocxref" href="#extensions-to-the-range-interface"><span class="secno">7. </span>Extensions to the <code><span data-spec="DOM4" title="range" class="formerLink">Range</span></code> interface</a><ul class="toc"><li class="tocline"><a class="tocxref" href="#methods-3"><span class="secno">7.1 </span>Methods</a></li></ul></li><li class="tocline"><a class="tocxref" href="#acknowledgements"><span class="secno">A. </span>Acknowledgements</a></li><li class="tocline"><a class="tocxref" href="#references"><span class="secno">B. </span>References</a><ul class="toc"><li class="tocline"><a class="tocxref" href="#normative-references"><span class="secno">B.1 </span>Normative references</a></li><li class="tocline"><a class="tocxref" href="#informative-references"><span class="secno">B.2 </span>Informative references</a></li></ul></li></ul></section>
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   624
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   625
    
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   626
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   627
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   628
    <section rel="bibo:Chapter" resource="#ref" typeof="bibo:Chapter" id="issues" class="introductory">
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   629
        <h1 id="h1_issues" role="heading" aria-level="1">Issues</h1>
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   630
        
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   631
        <div class="issue"><div id="h_issue_1" role="heading" aria-level="2" class="issue-title"><span>Issue 1</span></div><p class="">Open issues that appear throughout the remainder of this 
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   632
        document will be highlighted like this.</p></div>
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   633
        
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   634
        <!-- I don't believe this is a point of contention anymore...
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   635
        <p class="issue">This specification currently requires using the XML 
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   636
        Parser for some APIs, when in an XML document. It is unclear whether 
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   637
        consensus can be found for this approach.</p>
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   638
        -->
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   639
    </section>
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   640
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   641
    <section rel="bibo:Chapter" resource="#ref" typeof="bibo:Chapter" id="conformance"><!--OddPage--><h2 id="h2_conformance" role="heading" aria-level="1"><span class="secno">1. </span>Conformance</h2>
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   642
<p>
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   643
  As well as sections marked as non-normative, all authoring guidelines, diagrams, examples,
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   644
  and notes in this specification are non-normative. Everything else in this specification is
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   645
  normative.
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   646
</p>
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   647
<p>
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   648
  The key words <em title="MUST" class="rfc2119">MUST</em>, <em title="MUST NOT" class="rfc2119">MUST NOT</em>, <em title="REQUIRED" class="rfc2119">REQUIRED</em>, <em title="SHOULD" class="rfc2119">SHOULD</em>, <em title="SHOULD NOT" class="rfc2119">SHOULD NOT</em>, <em title="RECOMMENDED" class="rfc2119">RECOMMENDED</em>, <em title="MAY" class="rfc2119">MAY</em>,
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   649
  and <em title="OPTIONAL" class="rfc2119">OPTIONAL</em> in this specification are to be interpreted as described in [<cite><a href="#bib-RFC2119" class="bibref">RFC2119</a></cite>].
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   650
</p>
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   651
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   652
        <p>Requirements phrased in the imperative as part of algorithms
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   653
        (such as "strip any leading space characters" or "return false and
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   654
        terminate these steps") are to be interpreted with the meaning of the
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   655
        key word ("must", "should", "may", etc) used in introducing the
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   656
        algorithm.</p>
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   657
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   658
        <p>Conformance requirements phrased as algorithms or specific steps
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   659
        may be implemented in any manner, so long as the end result is
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   660
        equivalent. (In particular, the algorithms defined in this
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   661
        specification are intended to be easy to follow, and not intended to
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   662
        be performant.)</p>
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   663
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   664
        <p id="hardwareLimitations">User agents may impose
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   665
        implementation-specific limits on otherwise unconstrained inputs,
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   666
        e.g. to prevent denial of service attacks, to guard against running
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   667
        out of memory, or to work around platform-specific limitations.</p>
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   668
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   669
        <p>When a method or an attribute is said to call another method or 
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   670
        attribute, the user agent must invoke its internal API for that 
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   671
        attribute or method so that e.g. the author can't change the behavior 
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   672
        by overriding attributes or methods with custom properties or functions 
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   673
        in ECMAScript.</p>
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   674
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   675
        <p>Unless otherwise stated, string comparisons are done in a <a data-spec="DOM4" class="externalDFN" title="case-sensitive">
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   676
        case-sensitive</a> manner.</p>
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   677
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   678
        <p>If an algorithm calls into another algorithm, any exception that is 
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   679
        thrown by the latter (unless it is explicitly caught), must cause the 
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   680
        former to terminate, and the exception to be propagated up to 
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   681
        <em>its</em> caller.</p>
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   682
    
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   683
        <section id="dependencies">
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   684
            <h3 id="h3_dependencies" role="heading" aria-level="2"><span class="secno">1.1 </span>Dependencies</h3>
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   685
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   686
            <p>The IDL fragments in this specification must be interpreted as
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   687
            required for conforming IDL fragments, as described in the Web IDL
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   688
            specification. [<cite><a href="#bib-WEBIDL" class="bibref">WEBIDL</a></cite>]</p>
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   689
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   690
            <p>Some of the terms used in this specification are defined in
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   691
            [<cite><a href="#bib-DOM4" class="bibref">DOM4</a></cite>], [<cite><a href="#bib-HTML5" class="bibref">HTML5</a></cite>], and [<cite><a href="#bib-XML10" class="bibref">XML10</a></cite>].
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   692
        </p></section>
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   693
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   694
        <section id="extensibility">
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   695
            <h3 id="h3_extensibility" role="heading" aria-level="2"><span class="secno">1.2 </span>Extensibility</h3>
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   696
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   697
            <p>Vendor-specific proprietary extensions to this specification are
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   698
            strongly discouraged. Authors must not use such extensions, as
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   699
            doing so reduces interoperability and fragments the user base,
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   700
            allowing only users of specific user agents to access the content in
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   701
            question.</p>
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   702
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   703
            <p>If vendor-specific extensions are needed, the members should be
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   704
            prefixed by vendor-specific strings to prevent clashes with future
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   705
            versions of this specification. Extensions must be defined so that
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   706
            the use of extensions neither contradicts nor causes the
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   707
            non-conformance of functionality defined in the specification.</p>
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   708
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   709
            <p>When vendor-neutral extensions to this specification are needed,
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   710
            either this specification can be updated accordingly, or an
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   711
            extension specification can be written that overrides the
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   712
            requirements in this specification. When someone applying this
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   713
            specification to their activities decides that they will recognise
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   714
            the requirements of such an extension specification, it becomes an
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   715
            <dfn id="dfn-other-applicable-specifications" title="other applicable specifications">applicable
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   716
            specification</dfn> for the purposes of conformance requirements in
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   717
            this specification.</p>
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   718
            <!-- http://www.w3.org/mid/17E341CD-E790-422C-9F9A-69347EE01CEB@iki.fi -->
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   719
        </section>
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   720
    </section>
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   721
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   722
    <section id="terminology">
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   723
        <!--OddPage--><h2 id="h2_terminology" role="heading" aria-level="1"><span class="secno">2. </span>Terminology</h2>
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   724
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   725
        <p>The term <dfn id="dfn-context-object">context object</dfn> means the object on which the method or
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   726
        attribute being discussed was called.
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   727
    </p></section>
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   728
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   729
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   730
    <section id="parsing-and-serializing-nodes">
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   731
        <!--OddPage--><h2 id="h2_parsing-and-serializing-nodes" role="heading" aria-level="1"><span class="secno">3. </span>Parsing and serializing <a title="node" data-spec="DOM4" class="externalDFN">Node</a>s</h2>
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   732
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   733
        <section id="parsing">
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   734
            <h3 id="h3_parsing" role="heading" aria-level="2"><span class="secno">3.1 </span>Parsing</h3>
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   735
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   736
            <p>The following steps form the
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   737
            <dfn id="dfn-concept-parse-fragment" title="concept-parse-fragment">fragment parsing algorithm</dfn>, whose
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   738
            arguments are a <var>markup</var> string and a
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   739
            <var>context element</var>.
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   740
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   741
            </p><ol>
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   742
              <li>
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   743
                <p>If the <var>context element</var>'s
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   744
                <a title="concept-node-document" data-spec="DOM4" class="externalDFN">node document</a>
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   745
                is an <a title="html-document" data-spec="DOM4" class="externalDFN">HTML document</a>: let
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   746
                <var>algorithm</var> be the
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   747
                <a title="html-fragment-parsing-algorithm" data-spec="HTML5" class="externalDFN">HTML 
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   748
                fragment parsing algorithm</a>.</p>
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   749
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   750
                <p>If the <var>context element</var>'s
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   751
                <a title="concept-node-document" data-spec="DOM4" class="externalDFN">node document</a>
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   752
                is an <a title="xml-document" data-spec="DOM4" class="externalDFN">XML document</a>: let
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   753
                <var>algorithm</var> be the
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   754
                <a title="xml-fragment-parsing-algorithm" data-spec="HTML5" class="externalDFN">XML 
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   755
                fragment parsing algorithm</a>.</p>
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   756
              </li>
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   757
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   758
              <li>Invoke <var>algorithm</var> with <var>markup</var> as
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   759
              the <var>input</var>, and <var>context element</var> as the
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   760
              <var><a data-spec="HTML5" title="concept-frag-parse-context" class="externalDFN">context</a></var>
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   761
              element.</li>
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   762
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   763
              <li>Let <var>new children</var> be the nodes returned.</li>
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   764
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   765
              <li>Let <var>fragment</var> be a new
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   766
              <code><a title="documentfragment" data-spec="DOM4" class="externalDFN">DocumentFragment</a></code> whose
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   767
              <a title="concept-node-document" data-spec="DOM4" class="externalDFN">node document</a>
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   768
              is <var>context element</var>'s
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   769
              <a title="concept-node-document" data-spec="DOM4" class="externalDFN">node document</a>.
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   770
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   771
              </li><li><a data-spec="DOM4" title="concept-node-append" class="externalDFN">Append</a>
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   772
              each <a data-spec="DOM4" title="concept-node" class="externalDFN">node</a> in
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   773
              <var>new children</var> to <var>fragment</var> (in order).
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   774
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   775
              <div class="note"><div id="h_note_1" role="heading" aria-level="3" class="note-title"><span>Note</span></div><p class="">This ensures the
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   776
              <a title="concept-node-document" data-spec="DOM4" class="externalDFN">node document</a>
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   777
              for the new <a data-spec="DOM4" title="concept-node" class="externalDFN">nodes</a> is correct.
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   778
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   779
              </p></div></li><li>Return <var>fragment</var>.
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   780
            </li></ol>
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   781
    </section>
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   782
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   783
    <section id="serializing">
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   784
        <h3 id="h3_serializing" role="heading" aria-level="2"><span class="secno">3.2 </span>Serializing</h3>
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   785
        <p>To <dfn id="dfn-concept-serialize" title="concept-serialize">serialize</dfn> a
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   786
        <a title="node" data-spec="DOM4" class="externalDFN">Node</a> <var>node</var>, the user agent
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   787
        must run the following steps:
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   788
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   789
        </p><ol>
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   790
            <li>Let <var>document</var> be <var>node</var>'s
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   791
                <a title="concept-node-document" data-spec="DOM4" class="externalDFN">node document</a>.
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   792
            </li><li>If <var>document</var> is an
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   793
                <a title="html-document" data-spec="DOM4" class="externalDFN">HTML document</a>, 
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   794
                return an <a class="internalDFN" href="#dfn-concept-serialize-html" title="concept-serialize-html">HTML serialization</a> of <var>node</var>.
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   795
            </li><li>Otherwise, <var>document</var> is an
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   796
                <a title="xml-document" data-spec="DOM4" class="externalDFN">XML document</a>.
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   797
            </li><li>Let <var>context namespace</var> be <code>null</code>.
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   798
            </li><li>Let <var>prefix list</var> be an empty list. The <var>prefix list</var> will 
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   799
                contain strings that represent a history of namespace prefixes [<cite><a href="#bib-XML-NAMES" class="bibref">XML-NAMES</a></cite>]
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   800
                that have been serialized by the <a class="internalDFN" href="#dfn-concept-serialize-xml" title="concept-serialize-xml">XML serialization</a>
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   801
                algorithm for a subtree.
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   802
            </li><li>Return an <a class="internalDFN" href="#dfn-concept-serialize-xml" title="concept-serialize-xml">XML serialization</a> of <var>node</var>
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   803
                providing to the algorithm <var>context namespace</var> as the <var>namespace</var>
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   804
                and <var>prefix list</var> as <var>prefixes</var>.
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   805
        </li></ol>
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   806
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   807
        <p>To produce an <dfn id="dfn-concept-serialize-html" title="concept-serialize-html">HTML serialization</dfn> of a
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   808
        <a title="node" data-spec="DOM4" class="externalDFN">Node</a> <var>node</var>, the user agent
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   809
        must run the
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   810
        <a data-spec="HTML5" title="html-fragment-serialization-algorithm" class="externalDFN">HTML 
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   811
        fragment serialization algorithm</a> [<cite><a href="#bib-HTML5" class="bibref">HTML5</a></cite>] on <var>node</var> and return the string produced.
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   812
          
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   813
        </p><p>To produce an <dfn id="dfn-concept-serialize-xml" title="concept-serialize-xml">XML serialization</dfn> of a
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   814
            <a title="node" data-spec="DOM4" class="externalDFN">Node</a> <var>node</var> given a
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   815
            context namespace <var>namespace</var> and prefix list <var>prefixes</var>, the user 
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   816
            agent must run the appropriate steps, depending on <var>node</var>'s interface:</p>
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   817
        
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   818
        <div class="note"><div id="h_note_2" role="heading" aria-level="3" class="note-title"><span>Note</span></div><p class="">The following steps for serializing a <var>node</var> belonging to an
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   819
            <a title="xml-document" data-spec="DOM4" class="externalDFN">XML document</a> are 
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   820
            designed to produce a serialization that is compatible with the
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   821
            <a title="html-parser" data-spec="HTML5" class="externalDFN">HTML parser</a>. For example,
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   822
            elements in the XHTML namespace that contain no child nodes are serialized with
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   823
            an explicit begin and end tag rather than using the XML self-closing syntax. Exceptions 
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   824
            to this rule occur when an XHTML element's equivalent HTML element is a 
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   825
            <a title="void-elements" data-spec="HTML5" class="externalDFN">void element</a> that 
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   826
            would be auto-closed by the 
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   827
            <a title="html-parser" data-spec="HTML5" class="externalDFN">HTML parser</a>.
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   828
            
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   829
        </p></div><dl class="switch">
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   830
            <dt><code><a title="element" data-spec="DOM4" class="externalDFN">Element</a></code>
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   831
            </dt><dd>
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   832
                <p>Run the following algorithm:
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   833
                </p><ol>
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   834
                    <!-- "namespace" was passed via the caller -->
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   835
                    <li>Let <var>markup</var> be an empty string.
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   836
                    </li><li>Let <var>list</var> be a copy of the <var>prefixes</var> array.
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   837
                    </li><li>Let <var>prefix</var> be the value of <var>node</var>'s 
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   838
                        <code><a title="dom-Element-prefix" data-spec="DOM4" class="externalDFN">prefix</a></code>
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   839
                        attribute.
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   840
                    </li><li>Let <var>ns</var> be the value of <var>node</var>'s 
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   841
                        <code><a title="dom-Element-namespaceURI" data-spec="DOM4" class="externalDFN">namespaceURI</a></code>
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   842
                        attribute.
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   843
                    </li><li>Let a <var>skip end tag</var> flag have the value <code>false</code>.
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   844
                    </li><li>Append "<code>&lt;</code>" (U+003C LESS-THAN SIGN) to <var>markup</var>.
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   845
                    </li><li>If <var>prefix</var> is not <code>null</code> then append the following to
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   846
                        <var>markup</var>:
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   847
                        <ol>
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   848
                            <li>The value of <var>prefix</var>;
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   849
                            </li><li>"<code>:</code>" (U+003A COLON).
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   850
                        </li></ol>
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   851
                    </li><li>Append the value of <var>node</var>'s
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   852
                        <code><a title="dom-Element-localName" data-spec="DOM4" class="externalDFN">localName</a></code>
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   853
                        attribute to <var>markup</var>.
27
69213860713e Fix bugs found by HTML validator
Art Barstow <art.barstow@nokia.com>
parents: 26
diff changeset
   854
                    <!-- Tried ":" in names, but this doesn't trick the serializer-it just produces 
25
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   855
                        a serialization that is not round-trippable
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   856
                        <p class="issue">escaping / throwing -->
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   857
                    </li><li>If <var>namespace</var> is not equal to <var>ns</var> (the <var>node</var>'s
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   858
                        own namespace is different from its parent), and <var>prefix</var> is not 
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   859
                        <code>null</code>, then run these sub-steps:
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   860
                        <div class="note"><div id="h_note_3" role="heading" aria-level="3" class="note-title"><span>Note</span></div><p class="">These steps determine whether a namespace prefix is 
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   861
                            serialized for this node.
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   862
                        </p></div><ol>
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   863
                            <li>If <var>list</var> contains the value of <var>prefix</var>, then
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   864
                                abort these sub-steps. This namespace prefix
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   865
                                was already serialized.
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   866
                            </li><li>Add the value of <var>prefix</var> to <var>list</var>.
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   867
                            </li><li>If <var>node</var> has an attribute whose 
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   868
                                <a title="concept-attribute-name" data-spec="DOM4" class="externalDFN">name</a>
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   869
                                attribute value is equal to the concatenation of the string 
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   870
                                "<code>xmlns:</code>" with the value of <var>prefix</var>, abort 
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   871
                                these sub-steps. The <var>prefix</var> namespace definition will be 
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   872
                                serialized later as part of the <a class="internalDFN" href="#dfn-concept-serialize-xml-attributes" title="concept-serialize-xml-attributes">XML 
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   873
                                serialization of <var>node</var>'s attributes</a>.
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   874
                            </li><li>Append the following to <var>markup</var>, in order:
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   875
                            <ol>
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   876
                                <li>"<code> </code>" (U+0020 SPACE);
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   877
                                </li><li>The string "<code>xmlns:</code>";
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   878
                                </li><li>The value of <var>prefix</var>;
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   879
                                </li><li>"<code>="</code>" (U+003D EQUALS SIGN, U+0022 QUOTATION MARK);
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   880
                                </li><li>The value of <var>ns</var>;
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   881
                                </li><li>"<code>"</code>" (U+0022 QUOTATION MARK);
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   882
                            </li></ol>
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   883
                        </li></ol>
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   884
                    </li><li>If <var>namespace</var> is not equal to <var>ns</var>, and <var>prefix</var>
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   885
                        is <code>null</code>, then run these sub-steps:
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   886
                        <div class="note"><div id="h_note_4" role="heading" aria-level="3" class="note-title"><span>Note</span></div><p class="">These steps determine whether a default namespace is 
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   887
                            serialized for this node.
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   888
                        </p></div><ol>
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   889
                            <li>If <var>node</var> has an attribute whose 
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   890
                                <a title="concept-attribute-name" data-spec="DOM4" class="externalDFN">name</a>
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   891
                                attribute value is equal to "<code>xmlns</code>", abort 
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   892
                                these sub-steps. The default namespace will be 
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   893
                                serialized later as part of the <a class="internalDFN" href="#dfn-concept-serialize-xml-attributes" title="concept-serialize-xml-attributes">XML 
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   894
                                serialization of <var>node</var>'s attributes</a>.
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   895
                            </li><li>Append the following to <var>markup</var>, in order:
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   896
                            <ol>
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   897
                                <li>"<code> </code>" (U+0020 SPACE);
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   898
                                </li><li>The string "<code>xmlns</code>";
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   899
                                </li><li>"<code>="</code>" (U+003D EQUALS SIGN, U+0022 QUOTATION MARK);
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   900
                                </li><li>The value of <var>ns</var>;
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   901
                                </li><li>"<code>"</code>" (U+0022 QUOTATION MARK);
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   902
                            </li></ol>
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   903
                        </li></ol>
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   904
                    </li><li>Append to <var>markup</var> the result of the 
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   905
                        <a class="internalDFN" href="#dfn-concept-serialize-xml-attributes" title="concept-serialize-xml-attributes">XML 
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   906
                        serialization of <var>node</var>'s attributes</a>, passing <var>list</var>
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   907
                        as the <var>prefixes</var>.
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   908
                    </li><li>If the value of <var>ns</var> is the string "<code>http://www.w3.org/1999/xhtml</code>",
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   909
                        and the <var>node</var>'s list of 
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   910
                        <a title="concept-tree-child" data-spec="DOM4" class="externalDFN">children</a>
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   911
                        is empty, and the <var>node</var>'s
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   912
                        <code><a title="dom-Element-tagName" data-spec="DOM4" class="externalDFN">tagName</a></code>
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   913
                        matches any one of the following 
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   914
                        <a title="void-elements" data-spec="HTML5" class="externalDFN">void elements</a>:
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   915
                        "<code>area</code>",
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   916
                        "<code>base</code>",
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   917
                        "<code>br</code>",
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   918
                        "<code>col</code>",
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   919
                        "<code>embed</code>",
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   920
                        "<code>hr</code>",
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   921
                        "<code>img</code>",
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   922
                        "<code>input</code>",
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   923
                        "<code>keygen</code>",
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   924
                        "<code>link</code>",
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   925
                        "<code>menuitem</code>",
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   926
                        "<code>meta</code>",
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   927
                        "<code>param</code>",
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   928
                        "<code>source</code>",
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   929
                        "<code>track</code>",
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   930
                        "<code>wbr</code>";
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   931
                        then append the following to <var>markup</var>, in order:
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   932
                        <ol>
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   933
                            <li>"<code> </code>" (U+0020 SPACE);
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   934
                            </li><li>"<code>/</code>" (U+002F SOLIDUS);
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   935
                        </li></ol>
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   936
                        and set the <var>skip end tag</var> flag to <code>true</code>.
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   937
                    </li><li>If the value of <var>ns</var> is not the string "<code>http://www.w3.org/1999/xhtml</code>",
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   938
                        and the <var>node</var>'s list of 
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   939
                        <a title="concept-tree-child" data-spec="DOM4" class="externalDFN">children</a>
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   940
                        is empty, then append "<code>/</code>" (U+002F SOLIDUS) to <var>markup</var>
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   941
                        and set the <var>skip end tag</var> flag to <code>true</code>.
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   942
                    </li><li>Append "<code>&gt;</code>" (U+003E GREATER-THAN SIGN) to <var>markup</var>.
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   943
                    </li><li>If the value of <var>skip end tag</var> is <code>true</code>, then return 
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   944
                        the value of <var>markup</var> and skip the remaining steps. The 
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   945
                        <var>node</var> is a leaf-node.
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   946
                    </li><li>Append to <var>markup</var> the result of performing an 
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   947
                        <a class="internalDFN" href="#dfn-concept-serialize-xml" title="concept-serialize-xml">XML serialization</a> of each of 
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   948
                        <var>node</var>'s
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   949
                        <a title="concept-tree-child" data-spec="DOM4" class="externalDFN">children</a>,
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   950
                        in order, providing the value of <var>ns</var> for the <var>namespace</var>
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   951
                        and <var>list</var> for the <var>prefixes</var>.
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   952
                    </li><li>Append "<code>&lt;/</code>" (U+003C LESS-THAN SIGN, U+002F SOLIDUS) to 
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   953
                        <var>markup</var>.
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   954
                    </li><li>If the value of <var>prefix</var> is not <code>null</code>, then append the 
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   955
                        following to <var>markup</var>, in order:
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   956
                        <ol>
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   957
                            <li>The value of <var>prefix</var>;
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   958
                            </li><li>"<code>:</code>" (U+003A COLON).
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   959
                        </li></ol>
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   960
                    </li><li>Append the value of <var>node</var>'s
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   961
                        <code><a title="dom-Element-localName" data-spec="DOM4" class="externalDFN">localName</a></code>
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   962
                        attribute to <var>markup</var>.
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   963
                    </li><li>Append "<code>&gt;</code>" (U+003E GREATER-THAN SIGN) to <var>markup</var>.
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   964
                    </li><li>Return the value of <var>markup</var>.
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   965
                </li></ol>
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   966
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   967
            </dd><dt><code><a title="document" data-spec="DOM4" class="externalDFN">Document</a></code>
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   968
            </dt><dd>
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   969
                <p>Return the result of concatenating the following, in order:
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   970
                </p><ol>
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   971
                    <li>The string produced by running the steps to 
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   972
                        <a class="internalDFN" href="#dfn-concept-serialize-doctype" title="concept-serialize-doctype">produce a DocumentType serialization</a>
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   973
                        of <var>node</var>'s 
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   974
                        <a title="dom-Document-doctype" data-spec="HTML5" class="externalDFN">doctype</a>
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   975
                        attribute;
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   976
                    </li><li>The string produced by an <a class="internalDFN" href="#dfn-concept-serialize-xml" title="concept-serialize-xml">XML serialization</a>
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   977
                        of <var>node</var>'s 
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   978
                        <a title="dom-Document-documentElement" data-spec="HTML5" class="externalDFN">documentElement</a>
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   979
                        attribute, providing <code>null</code> as the <var>namespace</var> and an 
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   980
                        empty list as <var>prefixes</var>. 
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   981
                </li></ol>
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   982
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   983
            </dd><dt><code><a title="comment" data-spec="DOM4" class="externalDFN">Comment</a></code>
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   984
            </dt><dd><ol>
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   985
                <li>Let <var>markup</var> be the concatenation of "<code>&lt;!--</code>", <var>node</var>'s
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   986
                <code><a title="dom-characterdata-data" data-spec="DOM4" class="externalDFN">data</a></code>, and
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   987
                "<code>--&gt;</code>".
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   988
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   989
                </li><li>If <var>markup</var> matches the
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   990
                <code><a data-spec="XML10" title="comment" class="externalDFN">Comment</a></code> production, return
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   991
                <var>markup</var>. Otherwise, throw a
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   992
                <code><a title="domexception" data-spec="DOM4" class="externalDFN">DOMException</a></code>
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   993
                with name <code>InvalidStateError</code>.
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   994
              </li></ol>
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   995
            </dd><dt><code><a title="cdata" data-spec="DOML2" class="externalDFN">CDATASection</a></code>
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   996
            </dt><dd><ol>
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   997
                <li>Let <var>markup</var> be the concatenation of "<code>&lt;![CDATA[</code>", 
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   998
                <var>node</var>'s
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
   999
                <code><a title="dom-characterdata-data" data-spec="DOM4" class="externalDFN">data</a></code>, 
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
  1000
                and "<code>]]&gt;</code>".
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
  1001
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
  1002
                <!-- This does not actually appear to be the case in implementations today.
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
  1003
                <p>If <var>data</var> doesn't match the
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
  1004
                  <code><a title="NT-CData" data-spec="XML10" class="externalDFN">CDSect</a></code> production, throw a
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
  1005
                  <code><a title=domexception data-spec="DOM4" class="externalDFN">DOMException</a></code>
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
  1006
                  with name <code>InvalidStateError</code> and terminate the entire algorithm.
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
  1007
                -->
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
  1008
                
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
  1009
                </li><li>Return <var>markup</var>.
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
  1010
              </li></ol>
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
  1011
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
  1012
              <div class="note"><div id="h_note_5" role="heading" aria-level="3" class="note-title"><span>Note</span></div><p class="">CDATASection objects may be created by the historical 
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
  1013
            <code>document.createCDATASection</code> API, or as a result of parsing an
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
  1014
            <a title="xml-document" data-spec="DOM4" class="externalDFN">XML document</a>.
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
  1015
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
  1016
            </p></div></dd><dt><code><a title="text" data-spec="DOM4" class="externalDFN">Text</a></code>
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
  1017
            </dt><dd><ol>
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
  1018
                <li>Let <var>markup</var> be <var>node</var>'s
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
  1019
                <code><a title="dom-characterdata-data" data-spec="DOM4" class="externalDFN">data</a></code>.
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
  1020
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
  1021
                </li><li>Replace any occurrences of "<code>&amp;</code>" in <var>markup</var> by
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
  1022
                "<code>&amp;amp;</code>".
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
  1023
                
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
  1024
                </li><li>Replace any occurrences of "<code>&lt;</code>" in <var>markup</var> by
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
  1025
                "<code>&amp;lt;</code>".
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
  1026
                
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
  1027
                </li><li>Replace any occurrences of "<code>&gt;</code>" in <var>markup</var> by
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
  1028
                "<code>&amp;gt;</code>".
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
  1029
                
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
  1030
                </li><li>Return <var>data</var>.
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
  1031
              </li></ol>
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
  1032
            </dd><dt><code><a title="documentfragment" data-spec="DOM4" class="externalDFN">DocumentFragment</a></code>
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
  1033
            </dt><dd><ol>
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
  1034
                <li>Let <var>markup</var> the empty string.
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
  1035
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
  1036
                </li><li>For each
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
  1037
                <a title="concept-tree-child" data-spec="DOM4" class="externalDFN">child</a> of
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
  1038
                <var>node</var>, in order,
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
  1039
                <a class="internalDFN" href="#dfn-concept-serialize-xml" title="concept-serialize-xml">produce an XML serialization</a>
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
  1040
                of the child and concatenate the result to <var>markup</var>.
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
  1041
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
  1042
                </li><li>Return <var>markup</var>.
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
  1043
              </li></ol>
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
  1044
            </dd><dt><code><a title="documenttype" data-spec="DOM4" class="externalDFN">DocumentType</a></code>
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
  1045
            </dt><dd>Run the steps to <a class="internalDFN" href="#dfn-concept-serialize-doctype" title="concept-serialize-doctype">produce a DocumentType 
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
  1046
                serialization</a> of <var>node</var>
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
  1047
                and return the string this produced.           
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
  1048
            
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
  1049
            </dd><dt><code><a title="processinginstruction" data-spec="DOM4" class="externalDFN">ProcessingInstruction</a></code>
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
  1050
            </dt><dd><ol>
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
  1051
                <li>Let <var>markup</var> be the concatenation of "<code>&lt;?</code>", 
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
  1052
                <var>node</var>'s
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
  1053
                <code><a title="dom-characterdata-data" data-spec="DOM4" class="externalDFN">data</a></code>, 
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
  1054
                and "<code>?&gt;</code>".
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
  1055
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
  1056
                <!-- This does not actually appear to be the case in implementations today.
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
  1057
                <p>If <var>data</var> doesn't match the
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
  1058
                  <code><a title="NT-PI" data-spec="XML10" class="externalDFN">PI</a></code> production, throw a
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
  1059
                  <code><a title=domexception data-spec="DOM4" class="externalDFN">DOMException</a></code>
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
  1060
                  with name <code>InvalidStateError</code> and terminate the entire algorithm.
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
  1061
                -->
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
  1062
                
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
  1063
                </li><li>Return <var>markup</var>.
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
  1064
              </li></ol>
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
  1065
            <div class="note"><div id="h_note_6" role="heading" aria-level="3" class="note-title"><span>Note</span></div><p class="">ProcessingInstruction objects may be created by the historical 
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
  1066
            <code>document.createProcessingInstruction</code> API, or as a result of parsing an
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
  1067
            <a title="xml-document" data-spec="DOM4" class="externalDFN">XML document</a>.
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
  1068
         
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
  1069
        </p></div></dd></dl>
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
  1070
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
  1071
        <p>To <dfn id="dfn-concept-serialize-doctype" title="concept-serialize-doctype">produce a DocumentType serialization</dfn> of a
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
  1072
        <a title="node" data-spec="DOM4" class="externalDFN">Node</a> <var>node</var>, the user agent
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
  1073
        must return the result of the following algorithm:</p>
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
  1074
                
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
  1075
        <ol>
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
  1076
            <li>Let <var>markup</var> be an empty string.
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
  1077
            </li><li>Append the string "<code>&lt;!DOCTYPE</code>" to <var>markup</var>.
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
  1078
            </li><li>Append "<code> </code>" (U+0020 SPACE) to <var>markup</var>.
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
  1079
            </li><li>Append the value of the <var>node</var>'s 
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
  1080
                <code><a title="dom-documenttype-name" data-spec="DOM4" class="externalDFN">name</a></code>
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
  1081
                attribute to <var>markup</var>. For a <var>node</var> belonging to an
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
  1082
                <a title="html-document" data-spec="DOM4" class="externalDFN">HTML document</a>,
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
  1083
                the value will be all lowercase.
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
  1084
            </li><li>If the <var>node</var>'s 
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
  1085
                <code><a title="dom-documenttype-publicid" data-spec="DOM4" class="externalDFN">publicId</a></code>
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
  1086
                is not the empty string then append the following, in order, to <var>markup</var>:
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
  1087
                <ol>
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
  1088
                    <li>"<code> </code>" (U+0020 SPACE);
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
  1089
                    </li><li>The string "<code>PUBLIC</code>";
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
  1090
                    </li><li>"<code> </code>" (U+0020 SPACE);
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
  1091
                    </li><li>"<code>"</code>" (U+0022 QUOTATION MARK);
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
  1092
                    </li><li>The value of the <var>node</var>'s 
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
  1093
                        <code><a title="dom-documenttype-publicid" data-spec="DOM4" class="externalDFN">publicId</a></code>
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
  1094
                        attribute;
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
  1095
                    </li><li>"<code>"</code>" (U+0022 QUOTATION MARK);
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
  1096
                </li></ol>
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
  1097
            </li>
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
  1098
            <li>If the <var>node</var>'s 
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
  1099
                <code><a title="dom-documenttype-systemid" data-spec="DOM4" class="externalDFN">systemId</a></code>
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
  1100
                is not the empty string and the <var>node</var>'s 
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
  1101
                <code><a title="dom-documenttype-publicid" data-spec="DOM4" class="externalDFN">publicId</a></code>
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
  1102
                is set to the empty string, then append the following, in order, to <var>markup</var>:
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
  1103
                <ol>
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
  1104
                    <li>"<code> </code>" (U+0020 SPACE);
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
  1105
                    </li><li>The string "<code>SYSTEM</code>";
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
  1106
                </li></ol>
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
  1107
            </li>
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
  1108
            <li>If the <var>node</var>'s 
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
  1109
                <code><a title="dom-documenttype-systemid" data-spec="DOM4" class="externalDFN">systemId</a></code>
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
  1110
                is not the empty string then append the following, in order, to <var>markup</var>:
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
  1111
                <ol>
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
  1112
                    <li>"<code> </code>" (U+0020 SPACE);
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
  1113
                    </li><li>"<code>"</code>" (U+0022 QUOTATION MARK);
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
  1114
                    </li><li>The value of the <var>node</var>'s 
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
  1115
                        <code><a title="dom-documenttype-systemid" data-spec="DOM4" class="externalDFN">systemId</a></code>
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
  1116
                        attribute;
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
  1117
                    </li><li>"<code>"</code>" (U+0022 QUOTATION MARK);
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
  1118
                </li></ol>
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
  1119
            </li>
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
  1120
            <li>Optional: if the <var>node</var> has an (historical) 
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
  1121
                <code><a title="ID-Core-DocType-internalSubset" data-spec="DOM3" class="externalDFN">internalSubset</a></code>
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
  1122
                and the
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
  1123
                <code><a title="ID-Core-DocType-internalSubset" data-spec="DOM3" class="externalDFN">internalSubset</a></code>
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
  1124
                attribute's value is a non-empty string, then append the following,
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
  1125
                in order, to <var>markup</var>:
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
  1126
                <ol>
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
  1127
                    <li>"<code> </code>" (U+0020 SPACE);
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
  1128
                    </li><li>"<code>[</code>" (U+005B LEFT SQUARE BRACKET);
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
  1129
                    </li><li>The value of the <var>node</var>'s 
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
  1130
                        <code><a title="ID-Core-DocType-internalSubset" data-spec="DOM3" class="externalDFN">internalSubset</a></code>
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
  1131
                        attribute;
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
  1132
                    </li><li>"<code>]</code>" (U+005D RIGHT SQUARE BRACKET);
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
  1133
                </li></ol>
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
  1134
                <div class="note"><div id="h_note_7" role="heading" aria-level="3" class="note-title"><span>Note</span></div><p class="">A <var>node</var> belonging to an
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
  1135
                   <a title="html-document" data-spec="DOM4" class="externalDFN">HTML document</a>
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
  1136
                   will never have an 
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
  1137
                   <code><a title="ID-Core-DocType-internalSubset" data-spec="DOM3" class="externalDFN">internalSubset</a></code>
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
  1138
                   because any <code><a title="ID-Core-DocType-internalSubset" data-spec="DOM3" class="externalDFN">internalSubset</a></code>
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
  1139
                   markup is ignored by the parser.</p></div>
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
  1140
            </li>
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
  1141
            <li>Append "<code>&gt;</code>" (U+003E GREATER-THAN SIGN) to <var>markup</var>.
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
  1142
        </li></ol>
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
  1143
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
  1144
        
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
  1145
        <p>The <dfn id="dfn-concept-serialize-xml-attributes" title="concept-serialize-xml-attributes">XML serialization of the attributes</dfn>
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
  1146
        of an <a title="concept-element" data-spec="DOM4" class="externalDFN">element</a>
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
  1147
        <var>element</var> together with a prefix list <var>prefixes</var> is the result of the 
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
  1148
        following algorithm:
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
  1149
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
  1150
        </p><ol>
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
  1151
            <li>Let <var>result</var> be the empty string.
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
  1152
            </li><li>For each
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
  1153
                <a title="concept-attribute" data-spec="DOM4" class="externalDFN">attribute</a>
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
  1154
                <var>attr</var> in <var>element</var>'s
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
  1155
                <a title="concept-element-attribute" data-spec="DOM4" class="externalDFN">attributes</a>,
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
  1156
                in order:
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
  1157
                <ol>
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
  1158
                    <li>Append the following strings to <var>result</var>:
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
  1159
                        <ol>
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
  1160
                            <li>"<code> </code>" (U+0020 SPACE);
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
  1161
                            </li><li><var>attr</var>'s
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
  1162
                            <a title="concept-attribute-name" data-spec="DOM4" class="externalDFN">name</a>;
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
  1163
                            <!--<p class="issue">escaping / throwing  NO issues here to my knowledge -->
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
  1164
                            </li><li>"<code>="</code>" (U+003D EQUALS SIGN, U+0022 QUOTATION MARK);
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
  1165
                            </li><li><var>attr</var>'s
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
  1166
                            <a title="concept-attribute-value" data-spec="DOM4" class="externalDFN">value</a>,
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
  1167
                            replacing any occurrences of the following:
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
  1168
                            <ol>
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
  1169
                                <li>"<code>"</code>" with "<code>&amp;quot;</code>"
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
  1170
                                </li><li>"<code>&amp;</code>" with "<code>&amp;amp;</code>"
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
  1171
                            </li></ol>
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
  1172
                            </li><li>"<code>"</code>" (U+0022 QUOTATION MARK).
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
  1173
                        </li></ol>
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
  1174
                    </li><li>If the first six characters of the value of <var>attr</var>'s 
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
  1175
                        <a title="concept-attribute-name" data-spec="DOM4" class="externalDFN">name</a> 
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
  1176
                        attribute case-sensitively match the string "<code>xmlns:</code>", then:
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
  1177
                        <ol>
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
  1178
                            <li>Let <var>prefix definition</var> be the result of trimming 
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
  1179
                                "<code>xmlns:</code>" from the beginning of the value of <var>attr</var>'s 
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
  1180
                                <a title="concept-attribute-name" data-spec="DOM4" class="externalDFN">name</a>.
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
  1181
                            </li><li>Add the value of <var>prefix definition</var> to <var>prefixes</var>. 
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
  1182
                                Since this namespace prefix definition has been serialized, it is 
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
  1183
                                unnecessary to serialize it again if subsequently encountered in 
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
  1184
                                <var>element</var>'s children.
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
  1185
                        </li></ol>
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
  1186
                </li></ol>
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
  1187
            </li><li>Return <var>result</var>.
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
  1188
        </li></ol>
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
  1189
    </section>
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
  1190
</section>
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
  1191
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
  1192
<section id="the-domparser-interface">
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
  1193
    <!--OddPage--><h2 id="h2_the-domparser-interface" role="heading" aria-level="1"><span class="secno">4. </span>The <code>DOMParser</code> interface</h2>
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
  1194
    
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
  1195
<pre class="extraidl">enum <span class="idlInterfaceID">SupportedType</span> {
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
  1196
    "text/html",
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
  1197
    "text/xml",
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
  1198
    "application/xml",
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
  1199
    "application/xhtml+xml",
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
  1200
    "image/svg+xml"
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
  1201
};</pre>
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
  1202
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
  1203
    <p>The <dfn id="dfn-dom-domparser" title="dom-DOMParser"><code>DOMParser()</code></dfn> constructor
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
  1204
    must return a new <code>DOMParser</code> object.
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
  1205
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
  1206
    </p><pre class="idl"><span class="idlInterface" id="idl-def-DOMParser">[<span class="extAttr">Constructor</span>]
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
  1207
interface <span class="idlInterfaceID">DOMParser</span> {
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
  1208
<span class="idlMethod">    <span class="idlMethType">Document</span> <span class="idlMethName"><a href="#widl-DOMParser-parseFromString-Document-DOMString-str-SupportedType-type">parseFromString</a></span> (<span class="idlParam"><span class="idlParamType">DOMString</span> <span class="idlParamName">str</span></span>, <span class="idlParam"><span class="idlParamType">SupportedType</span> <span class="idlParamName">type</span></span>);</span>
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
  1209
};</span></pre><section id="methods"><h3 id="h3_methods" role="heading" aria-level="2"><span class="secno">4.1 </span>Methods</h3><dl class="methods"><dt id="widl-DOMParser-parseFromString-Document-DOMString-str-SupportedType-type"><code>parseFromString</code></dt><dd>
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
  1210
            <p>The
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
  1211
            <dfn id="dfn-dom-domparser-parsefromstring" title="dom-DOMParser-parseFromString"><code>parseFromString(<var>str</var>, <var>type</var>)</code></dfn>
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
  1212
            method must run these steps, depending on <var>type</var>:
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
  1213
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
  1214
            </p><dl class="switch">
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
  1215
                <dt>"<code>text/html</code>"
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
  1216
                </dt><dd>
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
  1217
                <p>Parse <var>str</var> with an
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
  1218
                <code><a data-spec="HTML5" title="html-parser" class="externalDFN">HTML parser</a></code>, and return the newly
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
  1219
                created <a title="concept-document" data-spec="DOM4" class="externalDFN">document</a>.
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
  1220
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
  1221
                </p><p>The <a data-spec="HTML5" title="scripting-flag" class="externalDFN">scripting flag</a> must be set to
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
  1222
                "disabled".
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
  1223
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
  1224
                </p><div class="note"><div id="h_note_8" role="heading" aria-level="3" class="note-title"><span>Note</span></div><p class=""><code><a data-spec="HTML5" title="meta" class="externalDFN">meta</a></code> elements are not
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
  1225
                taken into account for the encoding used, as a Unicode stream is passed into
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
  1226
                the parser.
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
  1227
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
  1228
                </p></div><div class="note"><div id="h_note_9" role="heading" aria-level="3" class="note-title"><span>Note</span></div><p class=""><code><a data-spec="HTML5" title="script" class="externalDFN">script</a></code> elements get marked
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
  1229
                unexecutable and the contents of <code><a data-spec="HTML5" title="noscript" class="externalDFN">noscript</a></code>
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
  1230
                get parsed as markup.
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
  1231
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
  1232
                </p></div></dd><dt>"<code>text/xml</code>"
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
  1233
                </dt><dt>"<code>application/xml</code>"
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
  1234
                </dt><dt>"<code>application/xhtml+xml</code>"
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
  1235
                </dt><dt>"<code>image/svg+xml</code>"
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
  1236
                </dt><dd>
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
  1237
                <ol>
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
  1238
                    <li>Parse <var>str</var> with a namespace-enabled
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
  1239
                    <code><a data-spec="HTML5" title="xml-parser" class="externalDFN">XML parser</a></code>.
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
  1240
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
  1241
                    </li><li>If the previous step didn't return an error, return the newly
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
  1242
                    created <a title="concept-document" data-spec="DOM4" class="externalDFN">document</a>
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
  1243
                    and terminate these steps.
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
  1244
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
  1245
                    </li><li>Otherwise, throw a 
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
  1246
                    <a data-spec="DOM4" title="domexception" class="externalDFN">DOMException</a> 
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
  1247
                    with name <code>SyntaxError</code>.
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
  1248
                    
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
  1249
                    <div class="note"><div id="h_note_10" role="heading" aria-level="3" class="note-title"><span>Note</span></div><p class="">Some UAs do not throw an exception, but rather return a minimal 
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
  1250
                    well-formed XML document that describes the error. In these cases, the error 
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
  1251
                    document's root element will be named <code>parsererror</code> and its namespace
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
  1252
                    will be set to "<code>http://www.mozilla.org/newlayout/xml/parsererror.xml</code>".
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
  1253
                    
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
  1254
                    <!--
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
  1255
                    It does not make sense to pave the cow paths by standardizing the 
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
  1256
                    mozilla error handling approach, when there is clear objection to that approach
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
  1257
                    from web developers who expect success to load the document they want, rather
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
  1258
                    than an error document. Browsers are reluctant to change behavior due to web
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
  1259
                    compatibility, but IE has thrown in these cases for multiple releases now without
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
  1260
                    any significant compatibility impact, and thus it seems feasable to spec the 
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
  1261
                    simpler and developer-expected behavior here.
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
  1262
                    appropriate behavior here.
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
  1263
                    
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
  1264
                    <li>Let <var>document</var> be a newly-created
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
  1265
                    <code><a data-spec="DOM4" title="xmldocument" class="externalDFN">XMLDocument</a></code>.
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
  1266
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
  1267
                    <li>
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
  1268
                    <p>Let <var>root</var> be a new
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
  1269
                    <code><a title="element" data-spec="DOM4" class="externalDFN">Element</a></code>, with its
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
  1270
                    <a title=concept-element-local-name data-spec="DOM4" class="externalDFN">local name</a>
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
  1271
                    set to "<code>parsererror</code>" and its
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
  1272
                    <a title=concept-element-namespace data-spec="DOM4" class="externalDFN">namespace</a>
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
  1273
                    set to
27
69213860713e Fix bugs found by HTML validator
Art Barstow <art.barstow@nokia.com>
parents: 26
diff changeset
  1274
                    "<code>http://www.mozilla.org/newlayout/xml/parsererror.xml</code>". -->
25
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
  1275
                    <!-- see https://bugzilla.mozilla.org/show_bug.cgi?id=45566 --><!--
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
  1276
                    <p>At this point user agents may
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
  1277
                    <a data-spec="DOM4" title=concept-node-append class="externalDFN">append</a> nodes
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
  1278
                    to <var>root</var>, for example to describe the nature of the
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
  1279
                    error.
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
  1280
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
  1281
                    <li><a data-spec="DOM4" title="concept-node-append" class="externalDFN">Append</a>
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
  1282
                    <var>root</var> to <var>document</var>.
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
  1283
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
  1284
                    <li>Return <var>document</var>.
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
  1285
                    -->
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
  1286
                </p></div></li></ol>
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
  1287
            </dd></dl>
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
  1288
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
  1289
            <p>In any case, the returned
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
  1290
            <a title="concept-document" data-spec="DOM4" class="externalDFN">document</a>'s
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
  1291
            <a title="concept-document-content-type" data-spec="DOM4" class="externalDFN">content type</a>
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
  1292
            must be the <var>type</var> argument. Additionally, the 
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
  1293
            <a title="concept-document" data-spec="DOM4" class="externalDFN">document</a> must have a
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
  1294
            <a title="concept-document-url" data-spec="DOM4" class="externalDFN">URL</a> value equal to 
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
  1295
            the URL of the 
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
  1296
            <a title="active-document" data-spec="HTML5" class="externalDFN">active document</a>, a 
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
  1297
            <a title="location" data-spec="HTML5" class="externalDFN">location</a> value of <code>null</code>.
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
  1298
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
  1299
            </p><div class="note"><div id="h_note_11" role="heading" aria-level="3" class="note-title"><span>Note</span></div><p class="">The returned
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
  1300
            <a title="concept-document" data-spec="DOM4" class="externalDFN">document</a>'s
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
  1301
            <a title="concept-document-encoding" data-spec="DOM4" class="externalDFN">encoding</a> is
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
  1302
            the default, UTF-8.
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
  1303
        </p></div><table class="parameters"><tbody><tr><th>Parameter</th><th>Type</th><th>Nullable</th><th>Optional</th><th>Description</th></tr><tr><td class="prmName">str</td><td class="prmType"><code>DOMString</code></td><td class="prmNullFalse"><span role="img" aria-label="False">✘</span></td><td class="prmOptFalse"><span role="img" aria-label="False">✘</span></td><td class="prmDesc"></td></tr><tr><td class="prmName">type</td><td class="prmType"><code>SupportedType</code></td><td class="prmNullFalse"><span role="img" aria-label="False">✘</span></td><td class="prmOptFalse"><span role="img" aria-label="False">✘</span></td><td class="prmDesc"></td></tr></tbody></table><div><em>Return type: </em><code>Document</code></div></dd></dl></section>
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
  1304
</section>
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
  1305
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
  1306
<section id="the-xmlserializer-interface">
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
  1307
    <!--OddPage--><h2 id="h2_the-xmlserializer-interface" role="heading" aria-level="1"><span class="secno">5. </span>The <code>XMLSerializer</code> interface</h2>
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
  1308
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
  1309
    <p>The <dfn id="dfn-dom-xmlserializer" title="dom-XMLSerializer"><code>XMLSerializer()</code></dfn>
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
  1310
    constructor must return a new <code>XMLSerializer</code> object.
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
  1311
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
  1312
    </p><pre class="idl"><span class="idlInterface" id="idl-def-XMLSerializer">[<span class="extAttr">Constructor</span>]
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
  1313
interface <span class="idlInterfaceID">XMLSerializer</span> {
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
  1314
<span class="idlMethod">    <span class="idlMethType">DOMString</span> <span class="idlMethName"><a href="#widl-XMLSerializer-serializeToString-DOMString-Node-root">serializeToString</a></span> (<span class="idlParam"><span class="idlParamType">Node</span> <span class="idlParamName">root</span></span>);</span>
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
  1315
};</span></pre><section id="methods-1"><h3 id="h3_methods-1" role="heading" aria-level="2"><span class="secno">5.1 </span>Methods</h3><dl class="methods"><dt id="widl-XMLSerializer-serializeToString-DOMString-Node-root"><code>serializeToString</code></dt><dd>The <code>serializeToString(<var>root</var>)</code>
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
  1316
        method must <a class="internalDFN" href="#dfn-concept-serialize-xml" title="concept-serialize-xml">produce an XML serialization</a> of <var>root</var> and return the result.<table class="parameters"><tbody><tr><th>Parameter</th><th>Type</th><th>Nullable</th><th>Optional</th><th>Description</th></tr><tr><td class="prmName">root</td><td class="prmType"><code>Node</code></td><td class="prmNullFalse"><span role="img" aria-label="False">✘</span></td><td class="prmOptFalse"><span role="img" aria-label="False">✘</span></td><td class="prmDesc"></td></tr></tbody></table><div><em>Return type: </em><code>DOMString</code></div></dd></dl></section>
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
  1317
</section>
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
  1318
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
  1319
<section id="extensions-to-the-element-interface">
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
  1320
    <!--OddPage--><h2 id="h2_extensions-to-the-element-interface" role="heading" aria-level="1"><span class="secno">6. </span>Extensions to the <code><a title="element" data-spec="DOM4" class="externalDFN">Element</a></code> interface</h2>
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
  1321
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
  1322
    <pre class="idl"><span class="idlInterface" id="idl-def-Element">partial interface <span class="idlInterfaceID">Element</span> {
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
  1323
<span class="idlAttribute">    [<span class="extAttr">TreatNullAs=EmptyString</span>]
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
  1324
                attribute <span class="idlAttrType">DOMString</span> <span class="idlAttrName"><a href="#widl-Element-innerHTML">innerHTML</a></span>;</span>
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
  1325
<span class="idlAttribute">    [<span class="extAttr">TreatNullAs=EmptyString</span>]
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
  1326
                attribute <span class="idlAttrType">DOMString</span> <span class="idlAttrName"><a href="#widl-Element-outerHTML">outerHTML</a></span>;</span>
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
  1327
<span class="idlMethod">    <span class="idlMethType">void</span> <span class="idlMethName"><a href="#widl-Element-insertAdjacentHTML-void-DOMString-position-DOMString-text">insertAdjacentHTML</a></span> (<span class="idlParam"><span class="idlParamType">DOMString</span> <span class="idlParamName">position</span></span>, <span class="idlParam"><span class="idlParamType">DOMString</span> <span class="idlParamName">text</span></span>);</span>
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
  1328
};</span></pre><section id="attributes"><h3 id="h3_attributes" role="heading" aria-level="2"><span class="secno">6.1 </span>Attributes</h3><dl class="attributes"><dt id="widl-Element-innerHTML"><code>innerHTML</code> of type <span class="idlAttrType">DOMString</span>,            </dt><dd>
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
  1329
            <p>The <dfn id="dfn-dom-element-innerhtml" title="dom-Element-innerHTML"><code>innerHTML</code></dfn> IDL
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
  1330
            attribute represents the markup of the
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
  1331
            <code><a title="element" data-spec="DOM4" class="externalDFN">Element</a></code>'s contents.
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
  1332
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
  1333
            </p><dl class="domintro">
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
  1334
                <!--doc.ih
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
  1335
                <dt><var>document</var> . <code title=dom-Document-innerHTML>innerHTML</code> [ = <var>value</var> ]
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
  1336
                <dd>
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
  1337
                <p>Returns a fragment of HTML or XML that represents the
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
  1338
                <code><a title="document" data-spec="DOM4" class="externalDFN">Document</a></code>.
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
  1339
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
  1340
                <p>Can be set, to replace the
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
  1341
                <code><a title="document" data-spec="DOM4" class="externalDFN">Document</a></code>'s contents with the result of
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
  1342
                parsing the given string.
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
  1343
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
  1344
                <p>In the case of an <a title="xml-document" data-spec="DOM4" class="externalDFN">XML document</a>,
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
  1345
                will throw an
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
  1346
                <code><a data-spec="DOM4" title=domexception class="externalDFN">DOMException</a></code> with name <code>InvalidStateError</code>
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
  1347
                if the <code><a title="document" data-spec="DOM4" class="externalDFN">Document</a></code> cannot be serialized
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
  1348
                to XML, and a
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
  1349
                <code><a data-spec="DOM4" title=domexception class="externalDFN">DOMException</a></code> with name <code>SyntaxError</code>
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
  1350
                if the given string is not well-formed.
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
  1351
                -->
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
  1352
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
  1353
                <dt><var>element</var> . <code title="dom-Element-innerHTML">innerHTML</code> [ = <var>value</var> ]
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
  1354
                </dt><dd>
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
  1355
                <p>Returns a fragment of HTML or XML that represents the element's
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
  1356
                contents.
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
  1357
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
  1358
                </p><p>Can be set, to replace the contents of the element with nodes
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
  1359
                parsed from the given string.
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
  1360
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
  1361
                </p><p>In the case of an <a title="xml-document" data-spec="DOM4" class="externalDFN">XML document</a>,
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
  1362
                will throw a
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
  1363
                <code><a data-spec="DOM4" title="domexception" class="externalDFN">DOMException</a></code> with name <code>InvalidStateError</code>
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
  1364
                if the <code><a title="element" data-spec="DOM4" class="externalDFN">Element</a></code> cannot be serialized
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
  1365
                to XML, and a
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
  1366
                <code><a data-spec="DOM4" title="domexception" class="externalDFN">DOMException</a></code> with name <code>SyntaxError</code>
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
  1367
                if the given string is not well-formed.
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
  1368
            </p></dd></dl>
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
  1369
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
  1370
            <p>On getting, if the <a class="internalDFN" href="#dfn-context-object" title="context object">context object</a>'s
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
  1371
            <a title="concept-node-document" data-spec="DOM4" class="externalDFN">node document</a>
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
  1372
            is an <a title="html-document" data-spec="DOM4" class="externalDFN">HTML document</a>, then the attribute
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
  1373
            must return the result of running the
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
  1374
            <a data-spec="HTML5" title="html-fragment-serialization-algorithm" class="externalDFN">HTML fragment serialization algorithm</a> on the
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
  1375
            <a class="internalDFN" href="#dfn-context-object" title="context object">context object</a>; otherwise, the <a class="internalDFN" href="#dfn-context-object" title="context object">context object</a>'s
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
  1376
            <a title="concept-node-document" data-spec="DOM4" class="externalDFN">node document</a>
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
  1377
            is an <a title="xml-document" data-spec="DOM4" class="externalDFN">XML document</a>, and the attribute must
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
  1378
            return the result of running the        
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
  1379
            <a data-spec="HTML5" title="xml-fragment-serialization-algorithm" class="externalDFN">XML fragment serialization algorithm</a> on the
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
  1380
            <a class="internalDFN" href="#dfn-context-object" title="context object">context object</a> instead (this might throw an
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
  1381
            exception instead of returning a string).
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
  1382
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
  1383
            </p><p>On setting, these steps must be run:
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
  1384
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
  1385
            </p><ol>
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
  1386
                <li>Let <var>fragment</var> be the result of invoking the
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
  1387
                <a class="internalDFN" href="#dfn-concept-parse-fragment" title="concept-parse-fragment">fragment parsing algorithm</a> with
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
  1388
                the new value as <var>markup</var>, and the
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
  1389
                <a class="internalDFN" href="#dfn-context-object" title="context object">context object</a> as the <var>context element</var>.
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
  1390
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
  1391
                </li><li><a data-spec="DOM4" title="concept-node-replace-all" class="externalDFN">Replace all</a>
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
  1392
                with <var>fragment</var> within the <a class="internalDFN" href="#dfn-context-object" title="context object">context object</a>.
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
  1393
            </li></ol>
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
  1394
        </dd><dt id="widl-Element-outerHTML"><code>outerHTML</code> of type <span class="idlAttrType">DOMString</span>,            </dt><dd>
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
  1395
            <p>The <dfn id="dfn-dom-element-outerhtml" title="dom-Element-outerHTML"><code>outerHTML</code></dfn> IDL
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
  1396
            attribute represents the markup of the
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
  1397
            <code><a title="element" data-spec="DOM4" class="externalDFN">Element</a></code> and its contents.
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
  1398
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
  1399
            </p><dl class="domintro">
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
  1400
              <dt><var>element</var> . <code title="dom-Element-outerHTML">outerHTML</code> [ = <var>value</var> ]
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
  1401
              </dt><dd>
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
  1402
                <p>Returns a fragment of HTML or XML that represents the element and its
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
  1403
                contents.
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
  1404
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
  1405
                </p><p>Can be set, to replace the element with nodes parsed from the given
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
  1406
                string.
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
  1407
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
  1408
                </p><p>In the case of an <a title="xml-document" data-spec="DOM4" class="externalDFN">XML document</a>,
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
  1409
                will throw a
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
  1410
                <code><a data-spec="DOM4" title="domexception" class="externalDFN">DOMException</a></code> with name <code>InvalidStateError</code>
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
  1411
                if the element cannot be serialized to XML, and a
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
  1412
                <code><a data-spec="DOM4" title="domexception" class="externalDFN">DOMException</a></code> with name <code>SyntaxError</code>
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
  1413
                if the given string is not well-formed.
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
  1414
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
  1415
                </p><p>Throws a
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
  1416
                <code><a data-spec="DOM4" title="domexception" class="externalDFN">DOMException</a></code> with name <code>NoModificationAllowedError</code>
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
  1417
                if the parent of the element is the
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
  1418
                <code><a title="document" data-spec="DOM4" class="externalDFN">Document</a></code> node.
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
  1419
            </p></dd></dl>
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
  1420
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
  1421
            <p>On getting, if the <a class="internalDFN" href="#dfn-context-object" title="context object">context object</a>'s
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
  1422
            <a title="concept-node-document" data-spec="DOM4" class="externalDFN">node document</a>
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
  1423
            is an <a title="html-document" data-spec="DOM4" class="externalDFN">HTML document</a>, then the attribute
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
  1424
            must return the result of running the
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
  1425
            <a data-spec="HTML5" title="html-fragment-serialization-algorithm" class="externalDFN">HTML fragment serialization algorithm</a> on a
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
  1426
            fictional node whose only child is <a class="internalDFN" href="#dfn-context-object" title="context object">context object</a>; otherwise, the
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
  1427
            <a class="internalDFN" href="#dfn-context-object" title="context object">context object</a>'s
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
  1428
            <a title="concept-node-document" data-spec="DOM4" class="externalDFN">node document</a>
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
  1429
            is an <a title="xml-document" data-spec="DOM4" class="externalDFN">XML document</a>, and the attribute must
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
  1430
            return the result of running the
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
  1431
            <a data-spec="HTML5" title="xml-fragment-serialization-algorithm" class="externalDFN">XML fragment serialization algorithm</a> on that
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
  1432
            fictional node instead (this might throw an exception instead of returning a
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
  1433
            string).
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
  1434
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
  1435
            </p><p>On setting, the following steps must be run:
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
  1436
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
  1437
            </p><ol>
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
  1438
                <li>Let <var>parent</var> be the <a class="internalDFN" href="#dfn-context-object" title="context object">context object</a>'s
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
  1439
                <a data-spec="DOM4" title="concept-tree-parent" class="externalDFN">parent</a>.
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
  1440
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
  1441
                </li><li>If <var>parent</var> is null, terminate these steps. There would be no
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
  1442
                way to obtain a reference to the nodes created even if the remaining steps
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
  1443
                were run.
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
  1444
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
  1445
                </li><li>If <var>parent</var> is a
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
  1446
                <code><a title="document" data-spec="DOM4" class="externalDFN">Document</a></code>, throw a
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
  1447
                <code><a data-spec="DOM4" title="domexception" class="externalDFN">DOMException</a></code> with name <code>NoModificationAllowedError</code>
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
  1448
                exception and terminate these steps.
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
  1449
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
  1450
                </li><li>If <var>parent</var> is a
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
  1451
                <code><a title="documentfragment" data-spec="DOM4" class="externalDFN">DocumentFragment</a></code>, let
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
  1452
                <var>parent</var> be a new
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
  1453
                <code><a title="element" data-spec="DOM4" class="externalDFN">Element</a></code> with
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
  1454
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
  1455
                <ul>
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
  1456
                    <li><code>body</code> as its
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
  1457
                    <a data-spec="DOM4" title="concept-element-local-name" class="externalDFN">local name</a>,
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
  1458
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
  1459
                    </li><li>the <a data-spec="DOM4" title="html-namespace" class="externalDFN">HTML namespace</a> as its
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
  1460
                    <a data-spec="DOM4" title="concept-element-namespace" class="externalDFN">namespace</a>, and
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
  1461
                    </li><li>the <a class="internalDFN" href="#dfn-context-object" title="context object">context object</a>'s
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
  1462
                    <a title="concept-node-document" data-spec="DOM4" class="externalDFN">node document</a>
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
  1463
                    as its
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
  1464
                    <a title="concept-node-document" data-spec="DOM4" class="externalDFN">node document</a>.
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
  1465
                </li></ul>
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
  1466
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
  1467
                </li><li>Let <var>fragment</var> be the result of invoking the
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
  1468
                <a class="internalDFN" href="#dfn-concept-parse-fragment" title="concept-parse-fragment">fragment parsing algorithm</a> with
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
  1469
                the new value as <var>markup</var>, and <var>parent</var> as
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
  1470
                the <var>context element</var>.
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
  1471
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
  1472
                </li><li><a data-spec="DOM4" title="concept-node-replace" class="externalDFN">Replace</a>
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
  1473
                the <a class="internalDFN" href="#dfn-context-object" title="context object">context object</a> with <var>fragment</var> within
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
  1474
                the <a class="internalDFN" href="#dfn-context-object" title="context object">context object</a>'s
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
  1475
                <a data-spec="DOM4" title="concept-tree-parent" class="externalDFN">parent</a>.
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
  1476
            </li></ol>
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
  1477
        </dd></dl></section><section id="methods-2"><h3 id="h3_methods-2" role="heading" aria-level="2"><span class="secno">6.2 </span>Methods</h3><dl class="methods"><dt id="widl-Element-insertAdjacentHTML-void-DOMString-position-DOMString-text"><code>insertAdjacentHTML</code></dt><dd>
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
  1478
             <dl class="domintro">
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
  1479
                  <dt><var>element</var> . <code title="dom-Element-insertAdjacentHTML">insertAdjacentHTML</code>(<var>position</var>, <var>text</var>)
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
  1480
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
  1481
                  </dt><dd>
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
  1482
                    <p>Parses the given string <var>text</var> as HTML or XML and inserts
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
  1483
                    the resulting nodes into the tree in the position given by the
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
  1484
                    <var>position</var> argument, as follows:
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
  1485
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
  1486
                    </p><dl>
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
  1487
                      <dt>"beforebegin"
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
  1488
                      </dt><dd>Before the element itself.
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
  1489
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
  1490
                      </dd><dt>"afterbegin"
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
  1491
                      </dt><dd>Just inside the element, before its first child.
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
  1492
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
  1493
                      </dd><dt>"beforeend"
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
  1494
                      </dt><dd>Just inside the element, after its last child.
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
  1495
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
  1496
                      </dd><dt>"afterend"
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
  1497
                      </dt><dd>After the element itself.
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
  1498
                    </dd></dl>
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
  1499
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
  1500
                    <p>Throws a <code>SyntaxError</code> exception if the arguments have invalid values (e.g., in the case of an
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
  1501
                    <a data-spec="DOM4" title="XML-document" class="externalDFN">XML document</a>, if the given string is
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
  1502
                    not well-formed).
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
  1503
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
  1504
                    </p><p>Throws a
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
  1505
                    <code><a data-spec="DOM4" title="domexception" class="externalDFN">DOMException</a></code> with name <code>NoModificationAllowedError</code>
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
  1506
                    if the given position isn't possible (e.g. inserting elements
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
  1507
                    after the root element of a <code><a title="document" data-spec="DOM4" class="externalDFN">Document</a></code>).
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
  1508
                </p></dd></dl>
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
  1509
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
  1510
                <p>The
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
  1511
                <dfn id="dfn-dom-element-insertadjacenthtml" title="dom-Element-insertAdjacentHTML"><code>insertAdjacentHTML(<var>position</var>, <var>text</var>)</code></dfn>
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
  1512
                method must run these steps:
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
  1513
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
  1514
                </p><ol>
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
  1515
                    <li>Use the first matching item from this list:
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
  1516
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
  1517
                    <dl class="switch">
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
  1518
                        <dt>If <var>position</var> is an
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
  1519
                        <a data-spec="DOM4" class="externalDFN" title="ascii-case-insensitive">ASCII case-insensitive</a> match for
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
  1520
                        the string "beforebegin"
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
  1521
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
  1522
                        </dt><dt>If <var>position</var> is an
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
  1523
                        <a data-spec="DOM4" class="externalDFN" title="ascii-case-insensitive">ASCII case-insensitive</a> match for
f6bb7dd2219d Preparing LC publication
travil
parents:
diff changeset
  1524
                        the string "afterend"