index.html
author travil
Thu, 27 Mar 2014 17:37:49 -0700
changeset 49 bf16edd32039
parent 47 1920f7b853a1
child 50 f3d96628e2b5
permissions -rw-r--r--
Fix bug 25181: Enable the innerHTML and outerHTML getter calls to invoke the serialize steps directly
* https://www.w3.org/Bugs/Public/show_bug.cgi?id=25181
This does not yet implement the validation requirements, but puts the plumbing
in place to catch all the cases defined in:
HTML5's xml-fragment-serialization-algorithm.

The remained of this work is tracked in bug 25168
1
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
     1
<!doctype html>
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
     2
<html>
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
     3
<head>
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
     4
    <meta charset=UTF-8>
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
     5
    <title>DOM Parsing and Serialization</title>
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
     6
    <style>
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
     7
        /* Make these stand-out more... */
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
     8
        .externalDFN {
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
     9
            font-style: italic;
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
    10
            background-color: #fff9d6;
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
    11
        }
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
    12
        /* Switch statement */
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
    13
        dl.switch dt::before {
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
    14
            content: "↪ ";
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
    15
            margin-left: 1em;
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
    16
        }
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
    17
        /* Better spacing around various lists (implied paragraph children) */
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
    18
        ol > li, section:not(#toc) ul > li, section dl > dt {
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
    19
            margin: 1em 0;
38
fb9edcfb8f5f Rewrite of the Element serializing XML serializer algorithm. Should be much closer
travil
parents: 37
diff changeset
    20
        }
fb9edcfb8f5f Rewrite of the Element serializing XML serializer algorithm. Should be much closer
travil
parents: 37
diff changeset
    21
        var { color: maroon; }
1
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
    22
        /* domintro styling */
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
    23
        dl.domintro {
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
    24
            background-color: rgb(221, 255, 221);
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
    25
            padding: 1em 0.5em 1em 2em;
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
    26
            clear: both;
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
    27
        }
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
    28
        dl.domintro dt {
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
    29
            color: black;
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
    30
        }
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
    31
        dl.domintro > dd {
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
    32
            color: green;
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
    33
        }
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
    34
        dl.domintro::before {
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
    35
            float: right;
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
    36
            background-color: white;
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
    37
            display: block;
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
    38
            border: 2px solid black;
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
    39
            color: green;
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
    40
            margin-top: -20px;
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
    41
            padding: 2px;
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
    42
            content: "This box is non-normative. Implementation requirements are given below this box.";
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
    43
        }
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
    44
        /* Fancy table stuff */
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
    45
        table {
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
    46
            border-collapse: collapse;
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
    47
        }
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
    48
        thead tr {
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
    49
            border-bottom: 2px solid black;
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
    50
        }
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
    51
        tbody tr:not(:last-child) {
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
    52
            border-bottom: 1px solid black;
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
    53
        }
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
    54
        td {
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
    55
            border-left: 1px solid black;
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
    56
            padding: 4px;
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
    57
        }
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
    58
        /* Extra IDL :-) */
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
    59
        .extraidl {
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
    60
            line-height: 120%;
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
    61
            padding: 1em;
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
    62
            border-top: 1px solid #90b8de;
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
    63
            border-bottom: 1px solid #90b8de;
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
    64
        }
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
    65
        .extraidl:before {
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
    66
            width: 150px;
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
    67
            color: #fff;
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
    68
            padding: 3px;
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
    69
            font-weight: bold;
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
    70
            font-family: initial;
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
    71
            margin: -1em 0 1em -1em;
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
    72
            display: block;
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
    73
            content: "WebIDL";
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
    74
            background-color: rgb(144, 184, 222);
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
    75
        }
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
    76
    </style>
8
7bddbad3c43e Update http -> https
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 6
diff changeset
    77
    <script type="text/javascript" src='https://www.w3.org/Tools/respec/respec-w3c-common' class='remove' async></script>
1
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
    78
    <script type="text/javascript" src="respecConfig.js" class='remove'></script>
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
    79
</head>
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
    80
<body>
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
    81
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
    82
    <section id="abstract">
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
    83
       <p>This specification defines various APIs for programmatic access to 
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
    84
          HTML and generic XML parsers by web applications for use in parsing 
24
42973d9748d9 Attempt to address: https://www.w3.org/Bugs/Public/show_bug.cgi?id=18938
travil
parents: 23
diff changeset
    85
          and serializing DOM nodes.</p>
1
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
    86
    </section>
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
    87
24
42973d9748d9 Attempt to address: https://www.w3.org/Bugs/Public/show_bug.cgi?id=18938
travil
parents: 23
diff changeset
    88
    <section id="sotd">
42973d9748d9 Attempt to address: https://www.w3.org/Bugs/Public/show_bug.cgi?id=18938
travil
parents: 23
diff changeset
    89
        <p>This specification is based on the original work of the <a href="http://domparsing.spec.whatwg.org/">
31
979528721c40 Sync up the editor's draft with the last published format (post publication-process changes)
travil
parents: 24
diff changeset
    90
            DOM Parsing and Serialization</a> Living Specification, though it has diverged in terms of 
24
42973d9748d9 Attempt to address: https://www.w3.org/Bugs/Public/show_bug.cgi?id=18938
travil
parents: 23
diff changeset
    91
            supported features, normative requirements, and algorithm specificity. As appropriate, 
31
979528721c40 Sync up the editor's draft with the last published format (post publication-process changes)
travil
parents: 24
diff changeset
    92
            relevant fixes from the living specification are incorporated into this document. 
24
42973d9748d9 Attempt to address: https://www.w3.org/Bugs/Public/show_bug.cgi?id=18938
travil
parents: 23
diff changeset
    93
    </section>
1
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
    94
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
    95
3
881b6e205d22 PubRules fixup
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 1
diff changeset
    96
    <section id="issues" class="introductory">
1
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
    97
        <h1>Issues</h1>
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
    98
        
13
49bc54f5937f First issue removed, and issues section clarified.
travil
parents: 12
diff changeset
    99
        <p class=issue>Open issues that appear throughout the remainder of this 
49bc54f5937f First issue removed, and issues section clarified.
travil
parents: 12
diff changeset
   100
        document will be highlighted like this.</p>
1
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   101
        
13
49bc54f5937f First issue removed, and issues section clarified.
travil
parents: 12
diff changeset
   102
        <!-- I don't believe this is a point of contention anymore...
1
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   103
        <p class="issue">This specification currently requires using the XML 
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   104
        Parser for some APIs, when in an XML document. It is unclear whether 
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   105
        consensus can be found for this approach.</p>
13
49bc54f5937f First issue removed, and issues section clarified.
travil
parents: 12
diff changeset
   106
        -->
1
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   107
    </section>
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   108
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   109
    <section id="conformance">
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   110
        <p>Requirements phrased in the imperative as part of algorithms
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   111
        (such as "strip any leading space characters" or "return false and
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   112
        terminate these steps") are to be interpreted with the meaning of the
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   113
        key word ("must", "should", "may", etc) used in introducing the
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   114
        algorithm.</p>
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   115
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   116
        <p>Conformance requirements phrased as algorithms or specific steps
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   117
        may be implemented in any manner, so long as the end result is
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   118
        equivalent. (In particular, the algorithms defined in this
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   119
        specification are intended to be easy to follow, and not intended to
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   120
        be performant.)</p>
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   121
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   122
        <p id="hardwareLimitations">User agents may impose
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   123
        implementation-specific limits on otherwise unconstrained inputs,
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   124
        e.g. to prevent denial of service attacks, to guard against running
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   125
        out of memory, or to work around platform-specific limitations.</p>
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   126
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   127
        <p>When a method or an attribute is said to call another method or 
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   128
        attribute, the user agent must invoke its internal API for that 
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   129
        attribute or method so that e.g. the author can't change the behavior 
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   130
        by overriding attributes or methods with custom properties or functions 
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   131
        in ECMAScript.</p>
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   132
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   133
        <p>Unless otherwise stated, string comparisons are done in a <a
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   134
        data-spec="DOM4" class="externalDFN" title="case-sensitive">
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   135
        case-sensitive</a> manner.</p>
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   136
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   137
        <p>If an algorithm calls into another algorithm, any exception that is 
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   138
        thrown by the latter (unless it is explicitly caught), must cause the 
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   139
        former to terminate, and the exception to be propagated up to 
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   140
        <em>its</em> caller.</p>
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   141
    
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   142
        <section>
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   143
            <h2>Dependencies</h2>
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   144
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   145
            <p>The IDL fragments in this specification must be interpreted as
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   146
            required for conforming IDL fragments, as described in the Web IDL
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   147
            specification. [[!WEBIDL]]</p>
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   148
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   149
            <p>Some of the terms used in this specification are defined in
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   150
            [[DOM4]], [[HTML5]], and [[XML10]].
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   151
        </section>
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   152
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   153
        <section>
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   154
            <h2>Extensibility</h2>
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   155
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   156
            <p>Vendor-specific proprietary extensions to this specification are
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   157
            strongly discouraged. Authors must not use such extensions, as
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   158
            doing so reduces interoperability and fragments the user base,
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   159
            allowing only users of specific user agents to access the content in
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   160
            question.</p>
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   161
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   162
            <p>If vendor-specific extensions are needed, the members should be
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   163
            prefixed by vendor-specific strings to prevent clashes with future
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   164
            versions of this specification. Extensions must be defined so that
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   165
            the use of extensions neither contradicts nor causes the
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   166
            non-conformance of functionality defined in the specification.</p>
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   167
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   168
            <p>When vendor-neutral extensions to this specification are needed,
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   169
            either this specification can be updated accordingly, or an
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   170
            extension specification can be written that overrides the
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   171
            requirements in this specification. When someone applying this
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   172
            specification to their activities decides that they will recognise
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   173
            the requirements of such an extension specification, it becomes an
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   174
            <dfn title="other applicable specifications">applicable
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   175
            specification</dfn> for the purposes of conformance requirements in
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   176
            this specification.</p>
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   177
            <!-- http://www.w3.org/mid/17E341CD-E790-422C-9F9A-69347EE01CEB@iki.fi -->
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   178
        </section>
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   179
    </section>
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   180
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   181
    <section>
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   182
        <h2>Terminology</h2>
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   183
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   184
        <p>The term <dfn>context object</dfn> means the object on which the method or
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   185
        attribute being discussed was called.
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   186
    </section>
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   187
38
fb9edcfb8f5f Rewrite of the Element serializing XML serializer algorithm. Should be much closer
travil
parents: 37
diff changeset
   188
    <section>
fb9edcfb8f5f Rewrite of the Element serializing XML serializer algorithm. Should be much closer
travil
parents: 37
diff changeset
   189
        <h2>Namespaces</h2>
fb9edcfb8f5f Rewrite of the Element serializing XML serializer algorithm. Should be much closer
travil
parents: 37
diff changeset
   190
        
fb9edcfb8f5f Rewrite of the Element serializing XML serializer algorithm. Should be much closer
travil
parents: 37
diff changeset
   191
        <p>The <dfn title="html-ns">HTML namespace</dfn> is <code>http://www.w3.org/1999/xhtml</code>.
fb9edcfb8f5f Rewrite of the Element serializing XML serializer algorithm. Should be much closer
travil
parents: 37
diff changeset
   192
        <p>The <dfn title="xml-ns">XML namespace</dfn> is <code>http://www.w3.org/XML/1998/namespace</code>.
fb9edcfb8f5f Rewrite of the Element serializing XML serializer algorithm. Should be much closer
travil
parents: 37
diff changeset
   193
        <p>The <dfn title="xmlns-ns">XMLNS namespace</dfn> is <code>http://www.w3.org/2000/xmlns/</code>.
fb9edcfb8f5f Rewrite of the Element serializing XML serializer algorithm. Should be much closer
travil
parents: 37
diff changeset
   194
    </section>
1
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   195
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   196
    <section>
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   197
        <h1>Parsing and serializing <a title="node" data-spec="DOM4" class="externalDFN">Node</a>s</h1>
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   198
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   199
        <section>
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   200
            <h2>Parsing</h2>
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   201
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   202
            <p>The following steps form the
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   203
            <dfn title="concept-parse-fragment">fragment parsing algorithm</dfn>, whose
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   204
            arguments are a <var>markup</var> string and a
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   205
            <var>context element</var>.
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   206
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   207
            <ol>
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   208
              <li>
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   209
                <p>If the <var>context element</var>'s
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   210
                <a title="concept-node-document" data-spec="DOM4" class="externalDFN">node document</a>
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   211
                is an <a title="html-document" data-spec="DOM4" class="externalDFN">HTML document</a>: let
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   212
                <var>algorithm</var> be the
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   213
                <a title="html-fragment-parsing-algorithm" data-spec="HTML5" class="externalDFN">HTML 
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   214
                fragment parsing algorithm</a>.</p>
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   215
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   216
                <p>If the <var>context element</var>'s
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   217
                <a title="concept-node-document" data-spec="DOM4" class="externalDFN">node document</a>
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   218
                is an <a title="xml-document" data-spec="DOM4" class="externalDFN">XML document</a>: let
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   219
                <var>algorithm</var> be the
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   220
                <a title="xml-fragment-parsing-algorithm" data-spec="HTML5" class="externalDFN">XML 
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   221
                fragment parsing algorithm</a>.</p>
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   222
              </li>
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   223
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   224
              <li>Invoke <var>algorithm</var> with <var>markup</var> as
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   225
              the <var>input</var>, and <var>context element</var> as the
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   226
              <var><a data-spec="HTML5" title="concept-frag-parse-context" class="externalDFN">context</a></var>
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   227
              element.</li>
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   228
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   229
              <li>Let <var>new children</var> be the nodes returned.</li>
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   230
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   231
              <li>Let <var>fragment</var> be a new
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   232
              <code><a title="documentfragment" data-spec="DOM4" class="externalDFN">DocumentFragment</a></code> whose
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   233
              <a title="concept-node-document" data-spec="DOM4" class="externalDFN">node document</a>
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   234
              is <var>context element</var>'s
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   235
              <a title="concept-node-document" data-spec="DOM4" class="externalDFN">node document</a>.
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   236
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   237
              <li><a data-spec="DOM4" title="concept-node-append" class="externalDFN">Append</a>
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   238
              each <a data-spec="DOM4" title="concept-node" class="externalDFN">node</a> in
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   239
              <var>new children</var> to <var>fragment</var> (in order).
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   240
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   241
              <p class=note>This ensures the
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   242
              <a title="concept-node-document" data-spec="DOM4" class="externalDFN">node document</a>
34
f5458f389274 Applied consistent quoting around title attributes and lowercased all refs to
tleithea
parents: 33
diff changeset
   243
              for the new <a data-spec="DOM4" title="concept-node" class="externalDFN">nodes</a> is correct.
1
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   244
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   245
              <li>Return <var>fragment</var>.
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   246
            </ol>
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   247
    </section>
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   248
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   249
    <section>
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   250
        <h2>Serializing</h2>
49
bf16edd32039 Fix bug 25181: Enable the innerHTML and outerHTML getter calls to invoke the serialize steps directly
travil
parents: 47
diff changeset
   251
        <p>The following steps form the 
bf16edd32039 Fix bug 25181: Enable the innerHTML and outerHTML getter calls to invoke the serialize steps directly
travil
parents: 47
diff changeset
   252
            <dfn title="concept-fragment-serializing-algorithm">fragment serializing algorithm</dfn>,
bf16edd32039 Fix bug 25181: Enable the innerHTML and outerHTML getter calls to invoke the serialize steps directly
travil
parents: 47
diff changeset
   253
            whose arguments are a <a title="node" data-spec="DOM4" class="externalDFN">Node</a> 
bf16edd32039 Fix bug 25181: Enable the innerHTML and outerHTML getter calls to invoke the serialize steps directly
travil
parents: 47
diff changeset
   254
            <var>node</var> and a flag <dfn title="concept-strict-validation">strict validation</dfn>.
1
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   255
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   256
        <ol>
49
bf16edd32039 Fix bug 25181: Enable the innerHTML and outerHTML getter calls to invoke the serialize steps directly
travil
parents: 47
diff changeset
   257
            <li>Let <var>context document</var> be <var>node</var>'s
18
15a9ba955a3a Expanded the XML Serialization algorithm for Elements (and a sligt enhancement
travil
parents: 17
diff changeset
   258
                <a title="concept-node-document" data-spec="DOM4" class="externalDFN">node document</a>.
49
bf16edd32039 Fix bug 25181: Enable the innerHTML and outerHTML getter calls to invoke the serialize steps directly
travil
parents: 47
diff changeset
   259
            <li>If <var>context document</var> is an
18
15a9ba955a3a Expanded the XML Serialization algorithm for Elements (and a sligt enhancement
travil
parents: 17
diff changeset
   260
                <a title="html-document" data-spec="DOM4" class="externalDFN">HTML document</a>, 
34
f5458f389274 Applied consistent quoting around title attributes and lowercased all refs to
tleithea
parents: 33
diff changeset
   261
                return an <a title="concept-serialize-html">HTML serialization</a> of <var>node</var>.
49
bf16edd32039 Fix bug 25181: Enable the innerHTML and outerHTML getter calls to invoke the serialize steps directly
travil
parents: 47
diff changeset
   262
            <li>Otherwise, <var>context document</var> is an
bf16edd32039 Fix bug 25181: Enable the innerHTML and outerHTML getter calls to invoke the serialize steps directly
travil
parents: 47
diff changeset
   263
                <a title="xml-document" data-spec="DOM4" class="externalDFN">XML document</a>;
bf16edd32039 Fix bug 25181: Enable the innerHTML and outerHTML getter calls to invoke the serialize steps directly
travil
parents: 47
diff changeset
   264
                return an <a title="concept-serialize-xml">XML serialization</a> of <var>node</var>
bf16edd32039 Fix bug 25181: Enable the innerHTML and outerHTML getter calls to invoke the serialize steps directly
travil
parents: 47
diff changeset
   265
                passing the flag <var>strict validation</var>.
bf16edd32039 Fix bug 25181: Enable the innerHTML and outerHTML getter calls to invoke the serialize steps directly
travil
parents: 47
diff changeset
   266
            <p class="note">The <a title="concept-serialize-xml">XML serialization</a> defined in this document
bf16edd32039 Fix bug 25181: Enable the innerHTML and outerHTML getter calls to invoke the serialize steps directly
travil
parents: 47
diff changeset
   267
                conforms to the requirements of the <a data-spec="HTML5" title="xml-fragment-serialization-algorithm" 
bf16edd32039 Fix bug 25181: Enable the innerHTML and outerHTML getter calls to invoke the serialize steps directly
travil
parents: 47
diff changeset
   268
                class="externalDFN">XML fragment serialization algorithm</a> defined in [[HTML5]].</p>
bf16edd32039 Fix bug 25181: Enable the innerHTML and outerHTML getter calls to invoke the serialize steps directly
travil
parents: 47
diff changeset
   269
        </ol>
bf16edd32039 Fix bug 25181: Enable the innerHTML and outerHTML getter calls to invoke the serialize steps directly
travil
parents: 47
diff changeset
   270
bf16edd32039 Fix bug 25181: Enable the innerHTML and outerHTML getter calls to invoke the serialize steps directly
travil
parents: 47
diff changeset
   271
        <p>To produce an <dfn title="concept-serialize-html">HTML serialization</dfn> of a
bf16edd32039 Fix bug 25181: Enable the innerHTML and outerHTML getter calls to invoke the serialize steps directly
travil
parents: 47
diff changeset
   272
            <a title="node" data-spec="DOM4" class="externalDFN">Node</a> <var>node</var>, the user agent
bf16edd32039 Fix bug 25181: Enable the innerHTML and outerHTML getter calls to invoke the serialize steps directly
travil
parents: 47
diff changeset
   273
            must run the
bf16edd32039 Fix bug 25181: Enable the innerHTML and outerHTML getter calls to invoke the serialize steps directly
travil
parents: 47
diff changeset
   274
            <a data-spec="HTML5" title="html-fragment-serialization-algorithm" class="externalDFN">HTML 
bf16edd32039 Fix bug 25181: Enable the innerHTML and outerHTML getter calls to invoke the serialize steps directly
travil
parents: 47
diff changeset
   275
            fragment serialization algorithm</a> [[!HTML5]] on <var>node</var> and return the string produced.
bf16edd32039 Fix bug 25181: Enable the innerHTML and outerHTML getter calls to invoke the serialize steps directly
travil
parents: 47
diff changeset
   276
bf16edd32039 Fix bug 25181: Enable the innerHTML and outerHTML getter calls to invoke the serialize steps directly
travil
parents: 47
diff changeset
   277
        <p>To produce an <dfn title="concept-serialize-xml">XML serialization</dfn> of a
bf16edd32039 Fix bug 25181: Enable the innerHTML and outerHTML getter calls to invoke the serialize steps directly
travil
parents: 47
diff changeset
   278
            <a title="node" data-spec="DOM4" class="externalDFN">Node</a> <var>node</var> given a
bf16edd32039 Fix bug 25181: Enable the innerHTML and outerHTML getter calls to invoke the serialize steps directly
travil
parents: 47
diff changeset
   279
            flag <var>strict validation</var>, run the following steps:
bf16edd32039 Fix bug 25181: Enable the innerHTML and outerHTML getter calls to invoke the serialize steps directly
travil
parents: 47
diff changeset
   280
        <ol>
38
fb9edcfb8f5f Rewrite of the Element serializing XML serializer algorithm. Should be much closer
travil
parents: 37
diff changeset
   281
            <li>Let <dfn title="concept-context-namespace">context namespace</dfn> be <code>null</code>.
41
f9b5a818ef99 Another update to the Element/Attribute serialization algorithm to fix recent
travil
parents: 40
diff changeset
   282
                The <a title="concept-context-namespace">context namespace</a> is changed when a
49
bf16edd32039 Fix bug 25181: Enable the innerHTML and outerHTML getter calls to invoke the serialize steps directly
travil
parents: 47
diff changeset
   283
                <var>node</var> serializes a different default namespace definition from its parent. The 
bf16edd32039 Fix bug 25181: Enable the innerHTML and outerHTML getter calls to invoke the serialize steps directly
travil
parents: 47
diff changeset
   284
                algorithm assumes no namespace to start.
38
fb9edcfb8f5f Rewrite of the Element serializing XML serializer algorithm. Should be much closer
travil
parents: 37
diff changeset
   285
            <li>Let <dfn title="concept-namespace-prefix-map">namespace prefix map</dfn> be a new map 
fb9edcfb8f5f Rewrite of the Element serializing XML serializer algorithm. Should be much closer
travil
parents: 37
diff changeset
   286
                for associating <code>namespaceURI</code> and namespace <code>prefix</code> pairs, where 
fb9edcfb8f5f Rewrite of the Element serializing XML serializer algorithm. Should be much closer
travil
parents: 37
diff changeset
   287
                <code>namespaceURI</code> values are the map's keys, and <code>prefix</code> values are 
fb9edcfb8f5f Rewrite of the Element serializing XML serializer algorithm. Should be much closer
travil
parents: 37
diff changeset
   288
                the map's key values. The <a title="concept-namespace-prefix-map">namespace prefix map</a>
39
1860a8d798cf Cleanup of the Element and Processing Instruction parts of algorithm, plus some
travil
parents: 38
diff changeset
   289
                will be populated by previously seen namespaceURIs and their most recent prefix associations
1860a8d798cf Cleanup of the Element and Processing Instruction parts of algorithm, plus some
travil
parents: 38
diff changeset
   290
                for a subtree. <span class="note"><strong>Note:</strong> the 
38
fb9edcfb8f5f Rewrite of the Element serializing XML serializer algorithm. Should be much closer
travil
parents: 37
diff changeset
   291
                <a title="concept-namespace-prefix-map">namespace prefix map</a> only associates a single
39
1860a8d798cf Cleanup of the Element and Processing Instruction parts of algorithm, plus some
travil
parents: 38
diff changeset
   292
                prefix value with a given namespaceURI. During serialization, if different namespace prefixes 
1860a8d798cf Cleanup of the Element and Processing Instruction parts of algorithm, plus some
travil
parents: 38
diff changeset
   293
                are found that map to the same namespaceURI, the last one encountered "wins" by replacing the
38
fb9edcfb8f5f Rewrite of the Element serializing XML serializer algorithm. Should be much closer
travil
parents: 37
diff changeset
   294
                existing key value in the map with the new prefix value.</span>
39
1860a8d798cf Cleanup of the Element and Processing Instruction parts of algorithm, plus some
travil
parents: 38
diff changeset
   295
            <li>Initialize the <a title="concept-namespace-prefix-map">namespace prefix map</a> with the 
1860a8d798cf Cleanup of the Element and Processing Instruction parts of algorithm, plus some
travil
parents: 38
diff changeset
   296
                <a title="xml-ns">XML namespace</a> key and string <code>"xml"</code> as the key value.
38
fb9edcfb8f5f Rewrite of the Element serializing XML serializer algorithm. Should be much closer
travil
parents: 37
diff changeset
   297
            <li>Let <dfn title="concept-generated-prefix">generated namespace prefix index</dfn> be an integer
fb9edcfb8f5f Rewrite of the Element serializing XML serializer algorithm. Should be much closer
travil
parents: 37
diff changeset
   298
                with a value of <code>1</code>. The <a title="concept-generated-prefix">generated namespace
39
1860a8d798cf Cleanup of the Element and Processing Instruction parts of algorithm, plus some
travil
parents: 38
diff changeset
   299
                prefix index</a> is used to generate a new unique prefix value when no suitable existing 
1860a8d798cf Cleanup of the Element and Processing Instruction parts of algorithm, plus some
travil
parents: 38
diff changeset
   300
                namespace prefix is available to serialize a <var>node</var>'s namespaceURI (or the namespaceURI
1860a8d798cf Cleanup of the Element and Processing Instruction parts of algorithm, plus some
travil
parents: 38
diff changeset
   301
                of one of <var>node</var>'s attributes). <span class="note">See the 
1860a8d798cf Cleanup of the Element and Processing Instruction parts of algorithm, plus some
travil
parents: 38
diff changeset
   302
                <a title="concept-generate-prefix">generate a prefix</a> algorithm.</span>
49
bf16edd32039 Fix bug 25181: Enable the innerHTML and outerHTML getter calls to invoke the serialize steps directly
travil
parents: 47
diff changeset
   303
            <li>Return the result of running the <a title="concept-xml-serialization-algorithm">XML serialization
bf16edd32039 Fix bug 25181: Enable the innerHTML and outerHTML getter calls to invoke the serialize steps directly
travil
parents: 47
diff changeset
   304
                algorithm</a> on <var>node</var> passing the <a title="concept-context-namespace">context 
bf16edd32039 Fix bug 25181: Enable the innerHTML and outerHTML getter calls to invoke the serialize steps directly
travil
parents: 47
diff changeset
   305
                namespace</a>, <a title="concept-namespace-prefix-map">namespace prefix map</a>, 
bf16edd32039 Fix bug 25181: Enable the innerHTML and outerHTML getter calls to invoke the serialize steps directly
travil
parents: 47
diff changeset
   306
                <a title="concept-generated-prefix">generated namespace prefix index</a> reference, and the
bf16edd32039 Fix bug 25181: Enable the innerHTML and outerHTML getter calls to invoke the serialize steps directly
travil
parents: 47
diff changeset
   307
                flag <var>strict validation</var>. If an <dfn title="concept-algorithm-exception">exception</dfn>
bf16edd32039 Fix bug 25181: Enable the innerHTML and outerHTML getter calls to invoke the serialize steps directly
travil
parents: 47
diff changeset
   308
                occurs during the execution of the algorithm, then catch that exception and throw a 
bf16edd32039 Fix bug 25181: Enable the innerHTML and outerHTML getter calls to invoke the serialize steps directly
travil
parents: 47
diff changeset
   309
                <code><a data-spec="DOM4" title="domexception" class="externalDFN">DOMException</a></code> with 
bf16edd32039 Fix bug 25181: Enable the innerHTML and outerHTML getter calls to invoke the serialize steps directly
travil
parents: 47
diff changeset
   310
                name <code>InvalidStateError</code>.
1
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   311
        </ol>
49
bf16edd32039 Fix bug 25181: Enable the innerHTML and outerHTML getter calls to invoke the serialize steps directly
travil
parents: 47
diff changeset
   312
        
38
fb9edcfb8f5f Rewrite of the Element serializing XML serializer algorithm. Should be much closer
travil
parents: 37
diff changeset
   313
        <p>An <a title="concept-serialize-xml">XML serialization</a> differs from an 
fb9edcfb8f5f Rewrite of the Element serializing XML serializer algorithm. Should be much closer
travil
parents: 37
diff changeset
   314
            <a title="concept-serialize-html">HTML serialization</a> in the following ways:
35
c4fc4f1467ab Add note about the primary differences between and HTML and XML serialization
tleithea
parents: 34
diff changeset
   315
        <ul>
39
1860a8d798cf Cleanup of the Element and Processing Instruction parts of algorithm, plus some
travil
parents: 38
diff changeset
   316
            <li><a title="element" data-spec="DOM4" class="externalDFN">Elements</a> and
1860a8d798cf Cleanup of the Element and Processing Instruction parts of algorithm, plus some
travil
parents: 38
diff changeset
   317
                <a title="concept-attribute" data-spec="DOM4" class="externalDFN">attributes</a>
45
cddb90aca176 Clarification on what the XML Serialization does to nodes and what guarantees it
travil
parents: 44
diff changeset
   318
                will always be serialized such that their namespaceURI is preserved. In some cases 
cddb90aca176 Clarification on what the XML Serialization does to nodes and what guarantees it
travil
parents: 44
diff changeset
   319
                this means that an existing prefix, prefix declaration attribute or default namespace 
cddb90aca176 Clarification on what the XML Serialization does to nodes and what guarantees it
travil
parents: 44
diff changeset
   320
                declaration attribute might be dropped, substituted or changed.
46
dbaee43f1d5b Fix bug 25029: Sync up the void element list with latest HTML5.1 list
travil
parents: 45
diff changeset
   321
                An <a title="concept-serialize-html">HTML serialization</a> does not attempt to 
dbaee43f1d5b Fix bug 25029: Sync up the void element list with latest HTML5.1 list
travil
parents: 45
diff changeset
   322
                preserve the namespaceURI.
39
1860a8d798cf Cleanup of the Element and Processing Instruction parts of algorithm, plus some
travil
parents: 38
diff changeset
   323
            <li><a title="element" data-spec="DOM4" class="externalDFN">Elements</a> not in the
38
fb9edcfb8f5f Rewrite of the Element serializing XML serializer algorithm. Should be much closer
travil
parents: 37
diff changeset
   324
                <a title="html-ns">HTML namespace</a> containing no children, are serialized using 
39
1860a8d798cf Cleanup of the Element and Processing Instruction parts of algorithm, plus some
travil
parents: 38
diff changeset
   325
                the self-closing tag syntax (i.e., according to the <var>EmptyElemTag</var> 
1860a8d798cf Cleanup of the Element and Processing Instruction parts of algorithm, plus some
travil
parents: 38
diff changeset
   326
                production of [[XML10]]).
35
c4fc4f1467ab Add note about the primary differences between and HTML and XML serialization
tleithea
parents: 34
diff changeset
   327
        </ul>
38
fb9edcfb8f5f Rewrite of the Element serializing XML serializer algorithm. Should be much closer
travil
parents: 37
diff changeset
   328
        
39
1860a8d798cf Cleanup of the Element and Processing Instruction parts of algorithm, plus some
travil
parents: 38
diff changeset
   329
        <p>Otherwise, the algorithm for producing an <a title="concept-serialize-xml">XML serialization</a> 
1860a8d798cf Cleanup of the Element and Processing Instruction parts of algorithm, plus some
travil
parents: 38
diff changeset
   330
            is designed to produce a serialization that is compatible with the 
1860a8d798cf Cleanup of the Element and Processing Instruction parts of algorithm, plus some
travil
parents: 38
diff changeset
   331
            <a title="html-parser" data-spec="HTML5" class="externalDFN">HTML parser</a>. For example, 
1860a8d798cf Cleanup of the Element and Processing Instruction parts of algorithm, plus some
travil
parents: 38
diff changeset
   332
            elements in the <a title="html-ns">HTML namespace</a> that contain no child nodes are serialized 
1860a8d798cf Cleanup of the Element and Processing Instruction parts of algorithm, plus some
travil
parents: 38
diff changeset
   333
            with an explicit begin and end tag rather than using the self-closing tag syntax [[XML10]].
38
fb9edcfb8f5f Rewrite of the Element serializing XML serializer algorithm. Should be much closer
travil
parents: 37
diff changeset
   334
        
40
5fa98c6547a4 Formalized the issue of XML serialization producing invalid XML in certain cases
travil
parents: 39
diff changeset
   335
        <p class="issue"><a href="https://www.w3.org/Bugs/Public/show_bug.cgi?id=25168">Bug: 25168</a>
5fa98c6547a4 Formalized the issue of XML serialization producing invalid XML in certain cases
travil
parents: 39
diff changeset
   336
            Should an XML Serialization check for these potential issues and tweak element 
5fa98c6547a4 Formalized the issue of XML serialization producing invalid XML in certain cases
travil
parents: 39
diff changeset
   337
            and attribute localNames that could cause problems? For example, replace "<code>:</code>" 
5fa98c6547a4 Formalized the issue of XML serialization producing invalid XML in certain cases
travil
parents: 39
diff changeset
   338
            (U+003A COLON) with "<code>_</code>" (U+005F LOW LINE) in element localNames and drop/replace
5fa98c6547a4 Formalized the issue of XML serialization producing invalid XML in certain cases
travil
parents: 39
diff changeset
   339
            "<code>xmlns</code>" and "<code>xmlns:</code>" prefixes in attribute localNames? Or should
5fa98c6547a4 Formalized the issue of XML serialization producing invalid XML in certain cases
travil
parents: 39
diff changeset
   340
            the XML Serialization fail to serialize under these scenarios?
5fa98c6547a4 Formalized the issue of XML serialization producing invalid XML in certain cases
travil
parents: 39
diff changeset
   341
        
49
bf16edd32039 Fix bug 25181: Enable the innerHTML and outerHTML getter calls to invoke the serialize steps directly
travil
parents: 47
diff changeset
   342
        <p>To run the <dfn title="concept-xml-serialization-algorithm">XML serialization algorithm</dfn> on
bf16edd32039 Fix bug 25181: Enable the innerHTML and outerHTML getter calls to invoke the serialize steps directly
travil
parents: 47
diff changeset
   343
            a <var>node</var> given a <a title="concept-context-namespace">context namespace</a> 
bf16edd32039 Fix bug 25181: Enable the innerHTML and outerHTML getter calls to invoke the serialize steps directly
travil
parents: 47
diff changeset
   344
            <var>namespace</var>, a <a title="concept-namespace-prefix-map">namespace prefix map</a>
bf16edd32039 Fix bug 25181: Enable the innerHTML and outerHTML getter calls to invoke the serialize steps directly
travil
parents: 47
diff changeset
   345
            <var>prefix map</var>, a <a title="concept-generated-prefix">generated namespace prefix index</a>
bf16edd32039 Fix bug 25181: Enable the innerHTML and outerHTML getter calls to invoke the serialize steps directly
travil
parents: 47
diff changeset
   346
            <var>prefix index</var>, and a flag <var>strict validation</var>, the user agent must run the 
bf16edd32039 Fix bug 25181: Enable the innerHTML and outerHTML getter calls to invoke the serialize steps directly
travil
parents: 47
diff changeset
   347
            appropriate steps, depending on <var>node</var>'s interface:</p>
bf16edd32039 Fix bug 25181: Enable the innerHTML and outerHTML getter calls to invoke the serialize steps directly
travil
parents: 47
diff changeset
   348
        
1
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   349
        <dl class=switch>
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   350
            <dt><code><a title="element" data-spec="DOM4" class="externalDFN">Element</a></code>
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   351
            <dd>
18
15a9ba955a3a Expanded the XML Serialization algorithm for Elements (and a sligt enhancement
travil
parents: 17
diff changeset
   352
                <p>Run the following algorithm:
1
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   353
                <ol>
41
f9b5a818ef99 Another update to the Element/Attribute serialization algorithm to fix recent
travil
parents: 40
diff changeset
   354
                    <!-- "namespace" was passed via the caller, it's the default namespace scope -->
42
fa768c710fba Algorithm Polish (variable re-names, prose clean-up and clarifying notes here and there).
travil
parents: 41
diff changeset
   355
                    <!-- "prefix map" was passed via the caller, it's the namespace->prefix map -->
41
f9b5a818ef99 Another update to the Element/Attribute serialization algorithm to fix recent
travil
parents: 40
diff changeset
   356
                    <!-- "prefix index" was passed via the caller, it's a number for generating prefixes if necessary -->
49
bf16edd32039 Fix bug 25181: Enable the innerHTML and outerHTML getter calls to invoke the serialize steps directly
travil
parents: 47
diff changeset
   357
                    <!-- "strict validation" was passed via the caller, it's a flag (true/false) for whether certain validation steps should be taken during serialization. -->
41
f9b5a818ef99 Another update to the Element/Attribute serialization algorithm to fix recent
travil
parents: 40
diff changeset
   358
                    <li>Let <var>markup</var> be the string "<code>&lt;</code>" (U+003C LESS-THAN SIGN).
36
393c42a44e7f Fix Bug 25062, and some cleanup of the Element serialization algorithm
travil@microsoft.com
parents: 35
diff changeset
   359
                    <li>Let <var>qualified name</var> be an empty string.
41
f9b5a818ef99 Another update to the Element/Attribute serialization algorithm to fix recent
travil
parents: 40
diff changeset
   360
                    <li>Let a <var>skip end tag</var> flag have the value <code>false</code>.
f9b5a818ef99 Another update to the Element/Attribute serialization algorithm to fix recent
travil
parents: 40
diff changeset
   361
                    <li>Let an <var>ignore namespace definition attribute</var> flag have the value <code>false</code>.
42
fa768c710fba Algorithm Polish (variable re-names, prose clean-up and clarifying notes here and there).
travil
parents: 41
diff changeset
   362
                    <li>Let <var>map</var> be a copy of the <var>prefix map</var> <a 
39
1860a8d798cf Cleanup of the Element and Processing Instruction parts of algorithm, plus some
travil
parents: 38
diff changeset
   363
                        title="concept-namespace-prefix-map">namespace prefix map</a>.
38
fb9edcfb8f5f Rewrite of the Element serializing XML serializer algorithm. Should be much closer
travil
parents: 37
diff changeset
   364
                    <li>Let <var>element prefixes list</var> be an empty list. <span class="note">This list is 
fb9edcfb8f5f Rewrite of the Element serializing XML serializer algorithm. Should be much closer
travil
parents: 37
diff changeset
   365
                        local to each element. Its purpose is to ensure that there are no conflicting prefixes 
fb9edcfb8f5f Rewrite of the Element serializing XML serializer algorithm. Should be much closer
travil
parents: 37
diff changeset
   366
                        should a new namespace prefix attribute need to be generated.</span>
42
fa768c710fba Algorithm Polish (variable re-names, prose clean-up and clarifying notes here and there).
travil
parents: 41
diff changeset
   367
                    <li>Let <var>duplicate prefix definition</var> be <code>null</code>.
41
f9b5a818ef99 Another update to the Element/Attribute serialization algorithm to fix recent
travil
parents: 40
diff changeset
   368
                    <li>Let <var>local default namespace</var> be the result of 
f9b5a818ef99 Another update to the Element/Attribute serialization algorithm to fix recent
travil
parents: 40
diff changeset
   369
                        <a title="concept-record-namespace-info">recording the namespace information</a> for 
f9b5a818ef99 Another update to the Element/Attribute serialization algorithm to fix recent
travil
parents: 40
diff changeset
   370
                        <var>node</var> given <var>map</var>, <var>element prefixes list</var>, and 
42
fa768c710fba Algorithm Polish (variable re-names, prose clean-up and clarifying notes here and there).
travil
parents: 41
diff changeset
   371
                        <var>duplicate prefix definition</var>.
38
fb9edcfb8f5f Rewrite of the Element serializing XML serializer algorithm. Should be much closer
travil
parents: 37
diff changeset
   372
                    <p class="note">This above step will update the <var>map</var> with any found namespace prefix 
41
f9b5a818ef99 Another update to the Element/Attribute serialization algorithm to fix recent
travil
parents: 40
diff changeset
   373
                        definitions, add the found prefix definitions to the <var>element prefixes list</var>, optionally 
42
fa768c710fba Algorithm Polish (variable re-names, prose clean-up and clarifying notes here and there).
travil
parents: 41
diff changeset
   374
                        set the <var>duplicate prefix definition</var> value, and return a local default namespace 
41
f9b5a818ef99 Another update to the Element/Attribute serialization algorithm to fix recent
travil
parents: 40
diff changeset
   375
                        value defined by a default namespace attribute if one exists. Otherwise it returns
f9b5a818ef99 Another update to the Element/Attribute serialization algorithm to fix recent
travil
parents: 40
diff changeset
   376
                        <code>null</code>.</p>
f9b5a818ef99 Another update to the Element/Attribute serialization algorithm to fix recent
travil
parents: 40
diff changeset
   377
                    <li>Let <var>inherited ns</var> be a copy of <var>namespace</var>.
18
15a9ba955a3a Expanded the XML Serialization algorithm for Elements (and a sligt enhancement
travil
parents: 17
diff changeset
   378
                    <li>Let <var>ns</var> be the value of <var>node</var>'s 
34
f5458f389274 Applied consistent quoting around title attributes and lowercased all refs to
tleithea
parents: 33
diff changeset
   379
                        <code><a title="dom-element-namespaceuri" data-spec="DOM4" class="externalDFN">namespaceURI</a></code>
18
15a9ba955a3a Expanded the XML Serialization algorithm for Elements (and a sligt enhancement
travil
parents: 17
diff changeset
   380
                        attribute.
41
f9b5a818ef99 Another update to the Element/Attribute serialization algorithm to fix recent
travil
parents: 40
diff changeset
   381
                    <li>If <var>inherited ns</var> is equal to <var>ns</var>, then:
39
1860a8d798cf Cleanup of the Element and Processing Instruction parts of algorithm, plus some
travil
parents: 38
diff changeset
   382
                    <ol>
41
f9b5a818ef99 Another update to the Element/Attribute serialization algorithm to fix recent
travil
parents: 40
diff changeset
   383
                        <li>If <var>local default namespace</var> is not <code>null</code>, then set <var>ignore 
f9b5a818ef99 Another update to the Element/Attribute serialization algorithm to fix recent
travil
parents: 40
diff changeset
   384
                            namespace definition attribute</var> to <code>true</code>.
39
1860a8d798cf Cleanup of the Element and Processing Instruction parts of algorithm, plus some
travil
parents: 38
diff changeset
   385
                        <li>If <var>ns</var> is the <a title="xml-ns">XML namespace</a>, then let <var>qualified name</var> 
1860a8d798cf Cleanup of the Element and Processing Instruction parts of algorithm, plus some
travil
parents: 38
diff changeset
   386
                            be the concatenation of the string "<code>xml:</code>" and the value of <var>node</var>'s 
1860a8d798cf Cleanup of the Element and Processing Instruction parts of algorithm, plus some
travil
parents: 38
diff changeset
   387
                            <a title="dom-element-localname" data-spec="DOM4" class="externalDFN">localName</a>.
41
f9b5a818ef99 Another update to the Element/Attribute serialization algorithm to fix recent
travil
parents: 40
diff changeset
   388
                        <li>Otherwise, let <var>qualified name</var> be the value of <var>node</var>'s 
f9b5a818ef99 Another update to the Element/Attribute serialization algorithm to fix recent
travil
parents: 40
diff changeset
   389
                            <a title="dom-element-localname" data-spec="DOM4" class="externalDFN">localName</a>.
42
fa768c710fba Algorithm Polish (variable re-names, prose clean-up and clarifying notes here and there).
travil
parents: 41
diff changeset
   390
                            <span class="note">The <var>node</var>'s prefix is always dropped.</span>
41
f9b5a818ef99 Another update to the Element/Attribute serialization algorithm to fix recent
travil
parents: 40
diff changeset
   391
                        <li>Append the value of <var>qualified name</var> to <var>markup</var>.
39
1860a8d798cf Cleanup of the Element and Processing Instruction parts of algorithm, plus some
travil
parents: 38
diff changeset
   392
                    </ol>
41
f9b5a818ef99 Another update to the Element/Attribute serialization algorithm to fix recent
travil
parents: 40
diff changeset
   393
                    <li>Otherwise, <var>inherited ns</var> is not equal to <var>ns</var> (the <var>node</var>'s
f9b5a818ef99 Another update to the Element/Attribute serialization algorithm to fix recent
travil
parents: 40
diff changeset
   394
                        own namespace is different from the context namespace of its parent). Run these sub-steps:
f9b5a818ef99 Another update to the Element/Attribute serialization algorithm to fix recent
travil
parents: 40
diff changeset
   395
                    <!-- The serialization algorithm must differentiate this node's namespace from it's parent's default
f9b5a818ef99 Another update to the Element/Attribute serialization algorithm to fix recent
travil
parents: 40
diff changeset
   396
                        namespace. There are two ways to do this: (1) [preferred due to assumed minimum length] use a 
f9b5a818ef99 Another update to the Element/Attribute serialization algorithm to fix recent
travil
parents: 40
diff changeset
   397
                        namespace prefix if one is available or (2) use a default namespace declaration. Both cases can 
f9b5a818ef99 Another update to the Element/Attribute serialization algorithm to fix recent
travil
parents: 40
diff changeset
   398
                        run into conflicts with existing attributes on the element and are handled accordingly. -->
38
fb9edcfb8f5f Rewrite of the Element serializing XML serializer algorithm. Should be much closer
travil
parents: 37
diff changeset
   399
                    <ol>
41
f9b5a818ef99 Another update to the Element/Attribute serialization algorithm to fix recent
travil
parents: 40
diff changeset
   400
                        <li>Let <var>prefix</var> be the value of <var>node</var>'s 
f9b5a818ef99 Another update to the Element/Attribute serialization algorithm to fix recent
travil
parents: 40
diff changeset
   401
                            <code><a title="dom-element-prefix" data-spec="DOM4" class="externalDFN">prefix</a></code>
f9b5a818ef99 Another update to the Element/Attribute serialization algorithm to fix recent
travil
parents: 40
diff changeset
   402
                            attribute.
38
fb9edcfb8f5f Rewrite of the Element serializing XML serializer algorithm. Should be much closer
travil
parents: 37
diff changeset
   403
                        <li>Let <var>candidate prefix</var> be a value from <var>map</var> where there exists a key in 
39
1860a8d798cf Cleanup of the Element and Processing Instruction parts of algorithm, plus some
travil
parents: 38
diff changeset
   404
                            <var>map</var> that matches the value of <var>ns</var> or if there is no such key, then let
1860a8d798cf Cleanup of the Element and Processing Instruction parts of algorithm, plus some
travil
parents: 38
diff changeset
   405
                            <var>candidate prefix</var> be <code>null</code>.
1860a8d798cf Cleanup of the Element and Processing Instruction parts of algorithm, plus some
travil
parents: 38
diff changeset
   406
                        <!-- Found a suitable prefix to use, either locally, or inherited through a parent node that 
1860a8d798cf Cleanup of the Element and Processing Instruction parts of algorithm, plus some
travil
parents: 38
diff changeset
   407
                            matches the node's namespaceURI. This prefix will be used in serialization even if the node 
1860a8d798cf Cleanup of the Element and Processing Instruction parts of algorithm, plus some
travil
parents: 38
diff changeset
   408
                            doesn't have a real prefix. -->
42
fa768c710fba Algorithm Polish (variable re-names, prose clean-up and clarifying notes here and there).
travil
parents: 41
diff changeset
   409
                        <li>If <var>candidate prefix</var> is not <code>null</code> (a suitable namespace prefix is defined 
fa768c710fba Algorithm Polish (variable re-names, prose clean-up and clarifying notes here and there).
travil
parents: 41
diff changeset
   410
                            which maps to <var>ns</var>), then:
18
15a9ba955a3a Expanded the XML Serialization algorithm for Elements (and a sligt enhancement
travil
parents: 17
diff changeset
   411
                        <ol>
41
f9b5a818ef99 Another update to the Element/Attribute serialization algorithm to fix recent
travil
parents: 40
diff changeset
   412
                            <li>Let <var>qualified name</var> be the concatenation of <var>candidate prefix</var>, 
42
fa768c710fba Algorithm Polish (variable re-names, prose clean-up and clarifying notes here and there).
travil
parents: 41
diff changeset
   413
                                "<code>:</code>" (U+003A COLON), and <code><a title="dom-element-localname" data-spec="DOM4" 
fa768c710fba Algorithm Polish (variable re-names, prose clean-up and clarifying notes here and there).
travil
parents: 41
diff changeset
   414
                                class="externalDFN">localName</a></code>.
fa768c710fba Algorithm Polish (variable re-names, prose clean-up and clarifying notes here and there).
travil
parents: 41
diff changeset
   415
                                <span class="note">There exists on this <var>node</var> or the <var>node</var>'s ancestry a 
fa768c710fba Algorithm Polish (variable re-names, prose clean-up and clarifying notes here and there).
travil
parents: 41
diff changeset
   416
                                namespace prefix definition that defines the <var>node</var>'s namespace.</span>
fa768c710fba Algorithm Polish (variable re-names, prose clean-up and clarifying notes here and there).
travil
parents: 41
diff changeset
   417
                            <li>If <var>local default namespace</var> is not <code>null</code> (there exists a locally-defined
fa768c710fba Algorithm Polish (variable re-names, prose clean-up and clarifying notes here and there).
travil
parents: 41
diff changeset
   418
                                default namespace declaration attribute), then let <var>inherited ns</var> get the value of
fa768c710fba Algorithm Polish (variable re-names, prose clean-up and clarifying notes here and there).
travil
parents: 41
diff changeset
   419
                                <var>ns</var>.
41
f9b5a818ef99 Another update to the Element/Attribute serialization algorithm to fix recent
travil
parents: 40
diff changeset
   420
                            <li>Append the value of <var>qualified name</var> to <var>markup</var>.
38
fb9edcfb8f5f Rewrite of the Element serializing XML serializer algorithm. Should be much closer
travil
parents: 37
diff changeset
   421
                        </ol>
41
f9b5a818ef99 Another update to the Element/Attribute serialization algorithm to fix recent
travil
parents: 40
diff changeset
   422
                        <!-- Now there's no existing namespace->prefix mapping to override; try to use a prefix: -->
f9b5a818ef99 Another update to the Element/Attribute serialization algorithm to fix recent
travil
parents: 40
diff changeset
   423
                        <li>Otherwise, if <var>prefix</var> is not <code>null</code> and <var>local default namespace</var> is 
f9b5a818ef99 Another update to the Element/Attribute serialization algorithm to fix recent
travil
parents: 40
diff changeset
   424
                            <code>null</code>, then:
39
1860a8d798cf Cleanup of the Element and Processing Instruction parts of algorithm, plus some
travil
parents: 38
diff changeset
   425
                        <ol>
41
f9b5a818ef99 Another update to the Element/Attribute serialization algorithm to fix recent
travil
parents: 40
diff changeset
   426
                            <li>If the <var>element prefixes list</var> contains the value of <var>prefix</var>, then 
f9b5a818ef99 Another update to the Element/Attribute serialization algorithm to fix recent
travil
parents: 40
diff changeset
   427
                                let <var>prefix</var> be the result of 
38
fb9edcfb8f5f Rewrite of the Element serializing XML serializer algorithm. Should be much closer
travil
parents: 37
diff changeset
   428
                                <a title="concept-generate-prefix">generating a prefix</a> providing as input the
fb9edcfb8f5f Rewrite of the Element serializing XML serializer algorithm. Should be much closer
travil
parents: 37
diff changeset
   429
                                <a title="concept-namespace-prefix-map">namespace prefix map</a> <var>map</var>, 
fb9edcfb8f5f Rewrite of the Element serializing XML serializer algorithm. Should be much closer
travil
parents: 37
diff changeset
   430
                                <var>node</var>'s <var>ns</var> string, and the <var>prefix index</var> integer.
41
f9b5a818ef99 Another update to the Element/Attribute serialization algorithm to fix recent
travil
parents: 40
diff changeset
   431
                            <li>Otherwise, append to <var>map</var> a new key <var>ns</var> whose key value is 
f9b5a818ef99 Another update to the Element/Attribute serialization algorithm to fix recent
travil
parents: 40
diff changeset
   432
                                <var>prefix</var>.
f9b5a818ef99 Another update to the Element/Attribute serialization algorithm to fix recent
travil
parents: 40
diff changeset
   433
                            <!-- Prefix is now either real or generated, and added to the map. -->
f9b5a818ef99 Another update to the Element/Attribute serialization algorithm to fix recent
travil
parents: 40
diff changeset
   434
                            <li>Let <var>qualified name</var> be the concatenation
f9b5a818ef99 Another update to the Element/Attribute serialization algorithm to fix recent
travil
parents: 40
diff changeset
   435
                            of <var>prefix</var>, "<code>:</code>" (U+003A COLON), and 
f9b5a818ef99 Another update to the Element/Attribute serialization algorithm to fix recent
travil
parents: 40
diff changeset
   436
                            <code><a title="dom-element-localname" data-spec="DOM4" class="externalDFN">localName</a></code>.
f9b5a818ef99 Another update to the Element/Attribute serialization algorithm to fix recent
travil
parents: 40
diff changeset
   437
                            <li>Append the value of <var>qualified name</var> to <var>markup</var>.
42
fa768c710fba Algorithm Polish (variable re-names, prose clean-up and clarifying notes here and there).
travil
parents: 41
diff changeset
   438
                            <li>Append the following to <var>markup</var>, in order: <span class="note">The following 
fa768c710fba Algorithm Polish (variable re-names, prose clean-up and clarifying notes here and there).
travil
parents: 41
diff changeset
   439
                                serializes the new namespace/prefix association just added to the <var>map</var>.</span>
18
15a9ba955a3a Expanded the XML Serialization algorithm for Elements (and a sligt enhancement
travil
parents: 17
diff changeset
   440
                            <ol>
41
f9b5a818ef99 Another update to the Element/Attribute serialization algorithm to fix recent
travil
parents: 40
diff changeset
   441
                                <li>"<code> </code>" (U+0020 SPACE);
38
fb9edcfb8f5f Rewrite of the Element serializing XML serializer algorithm. Should be much closer
travil
parents: 37
diff changeset
   442
                                <li>the string "<code>xmlns:</code>";
41
f9b5a818ef99 Another update to the Element/Attribute serialization algorithm to fix recent
travil
parents: 40
diff changeset
   443
                                <li>the value of <var>prefix</var>;
18
15a9ba955a3a Expanded the XML Serialization algorithm for Elements (and a sligt enhancement
travil
parents: 17
diff changeset
   444
                                <li>"<code>="</code>" (U+003D EQUALS SIGN, U+0022 QUOTATION MARK);
41
f9b5a818ef99 Another update to the Element/Attribute serialization algorithm to fix recent
travil
parents: 40
diff changeset
   445
                                <li>The result of <a title="concept-serialize-attr-value">serializing an attribute value</a> 
f9b5a818ef99 Another update to the Element/Attribute serialization algorithm to fix recent
travil
parents: 40
diff changeset
   446
                                    given <var>ns</var> as input;
18
15a9ba955a3a Expanded the XML Serialization algorithm for Elements (and a sligt enhancement
travil
parents: 17
diff changeset
   447
                                <li>"<code>"</code>" (U+0022 QUOTATION MARK);
15a9ba955a3a Expanded the XML Serialization algorithm for Elements (and a sligt enhancement
travil
parents: 17
diff changeset
   448
                            </ol>
15a9ba955a3a Expanded the XML Serialization algorithm for Elements (and a sligt enhancement
travil
parents: 17
diff changeset
   449
                        </ol>
41
f9b5a818ef99 Another update to the Element/Attribute serialization algorithm to fix recent
travil
parents: 40
diff changeset
   450
                        <!-- Giving up on the prefix route, try to use a default namespace instead (stomping on an existing
f9b5a818ef99 Another update to the Element/Attribute serialization algorithm to fix recent
travil
parents: 40
diff changeset
   451
                             one if necessary) and dropping the node's prefix -->
f9b5a818ef99 Another update to the Element/Attribute serialization algorithm to fix recent
travil
parents: 40
diff changeset
   452
                        <li>Otherwise, if <var>local default namespace</var> is <code>null</code>, or <var>local default 
f9b5a818ef99 Another update to the Element/Attribute serialization algorithm to fix recent
travil
parents: 40
diff changeset
   453
                            namespace</var> is not <code>null</code> and its value is not equal to <var>ns</var>, then:
f9b5a818ef99 Another update to the Element/Attribute serialization algorithm to fix recent
travil
parents: 40
diff changeset
   454
                        <ol>
f9b5a818ef99 Another update to the Element/Attribute serialization algorithm to fix recent
travil
parents: 40
diff changeset
   455
                            <li>Set the <var>ignore namespace definition attribute</var> flag to <code>true</code>.
f9b5a818ef99 Another update to the Element/Attribute serialization algorithm to fix recent
travil
parents: 40
diff changeset
   456
                            <li>Let <var>qualified name</var> be the <var>node</var>'s <code><a title="dom-element-localname" 
f9b5a818ef99 Another update to the Element/Attribute serialization algorithm to fix recent
travil
parents: 40
diff changeset
   457
                                data-spec="DOM4" class="externalDFN">localName</a></code>.
42
fa768c710fba Algorithm Polish (variable re-names, prose clean-up and clarifying notes here and there).
travil
parents: 41
diff changeset
   458
                            <li>Let the value of <var>inherited ns</var> be <var>ns</var>. <span class="note">The new
fa768c710fba Algorithm Polish (variable re-names, prose clean-up and clarifying notes here and there).
travil
parents: 41
diff changeset
   459
                                default namespace will be used in the serialization to define this <var>node</var>'s 
fa768c710fba Algorithm Polish (variable re-names, prose clean-up and clarifying notes here and there).
travil
parents: 41
diff changeset
   460
                                namespace and act as the context namespace for its children.</span>
41
f9b5a818ef99 Another update to the Element/Attribute serialization algorithm to fix recent
travil
parents: 40
diff changeset
   461
                            <li>Append the value of <var>qualified name</var> to <var>markup</var>.
42
fa768c710fba Algorithm Polish (variable re-names, prose clean-up and clarifying notes here and there).
travil
parents: 41
diff changeset
   462
                            <li>Append the following to <var>markup</var>, in order: <span class="note">The following 
fa768c710fba Algorithm Polish (variable re-names, prose clean-up and clarifying notes here and there).
travil
parents: 41
diff changeset
   463
                                serializes the new (or replacement) default namespace definition.</span>
41
f9b5a818ef99 Another update to the Element/Attribute serialization algorithm to fix recent
travil
parents: 40
diff changeset
   464
                            <ol>
f9b5a818ef99 Another update to the Element/Attribute serialization algorithm to fix recent
travil
parents: 40
diff changeset
   465
                                <li>"<code> </code>" (U+0020 SPACE);
f9b5a818ef99 Another update to the Element/Attribute serialization algorithm to fix recent
travil
parents: 40
diff changeset
   466
                                <li>the string "<code>xmlns</code>";
f9b5a818ef99 Another update to the Element/Attribute serialization algorithm to fix recent
travil
parents: 40
diff changeset
   467
                                <li>"<code>="</code>" (U+003D EQUALS SIGN, U+0022 QUOTATION MARK);
f9b5a818ef99 Another update to the Element/Attribute serialization algorithm to fix recent
travil
parents: 40
diff changeset
   468
                                <li>The result of <a title="concept-serialize-attr-value">serializing an attribute value</a> 
f9b5a818ef99 Another update to the Element/Attribute serialization algorithm to fix recent
travil
parents: 40
diff changeset
   469
                                    given <var>ns</var> as input;
f9b5a818ef99 Another update to the Element/Attribute serialization algorithm to fix recent
travil
parents: 40
diff changeset
   470
                                <li>"<code>"</code>" (U+0022 QUOTATION MARK);
f9b5a818ef99 Another update to the Element/Attribute serialization algorithm to fix recent
travil
parents: 40
diff changeset
   471
                            </ol>
f9b5a818ef99 Another update to the Element/Attribute serialization algorithm to fix recent
travil
parents: 40
diff changeset
   472
                        </ol>
f9b5a818ef99 Another update to the Element/Attribute serialization algorithm to fix recent
travil
parents: 40
diff changeset
   473
                        <!-- Finally, regardless of prefix, the node has a local default namespace that matches 'ns'.
f9b5a818ef99 Another update to the Element/Attribute serialization algorithm to fix recent
travil
parents: 40
diff changeset
   474
                            So, we'll just use that and drop the prefix -->
42
fa768c710fba Algorithm Polish (variable re-names, prose clean-up and clarifying notes here and there).
travil
parents: 41
diff changeset
   475
                        <li>Otherwise, the <var>node</var> has a <var>local default namespace</var> that matches 
fa768c710fba Algorithm Polish (variable re-names, prose clean-up and clarifying notes here and there).
travil
parents: 41
diff changeset
   476
                            <var>ns</var>. Let <var>qualified name</var> be the <var>node</var>'s
fa768c710fba Algorithm Polish (variable re-names, prose clean-up and clarifying notes here and there).
travil
parents: 41
diff changeset
   477
                            <code><a title="dom-element-localname" data-spec="DOM4" class="externalDFN">localName</a></code>,
fa768c710fba Algorithm Polish (variable re-names, prose clean-up and clarifying notes here and there).
travil
parents: 41
diff changeset
   478
                            let the value of <var>inherited ns</var> be <var>ns</var>, and append the value of 
fa768c710fba Algorithm Polish (variable re-names, prose clean-up and clarifying notes here and there).
travil
parents: 41
diff changeset
   479
                            <var>qualified name</var> to <var>markup</var>.
38
fb9edcfb8f5f Rewrite of the Element serializing XML serializer algorithm. Should be much closer
travil
parents: 37
diff changeset
   480
                    </ol>
41
f9b5a818ef99 Another update to the Element/Attribute serialization algorithm to fix recent
travil
parents: 40
diff changeset
   481
                    <li>Append to <var>markup</var> the result of the
38
fb9edcfb8f5f Rewrite of the Element serializing XML serializer algorithm. Should be much closer
travil
parents: 37
diff changeset
   482
                        <a title="concept-serialize-xml-attributes">XML serialization of <var>node</var>'s 
39
1860a8d798cf Cleanup of the Element and Processing Instruction parts of algorithm, plus some
travil
parents: 38
diff changeset
   483
                        attributes</a> given the
41
f9b5a818ef99 Another update to the Element/Attribute serialization algorithm to fix recent
travil
parents: 40
diff changeset
   484
                        <a title="concept-namespace-prefix-map">namespace prefix map</a> <var>map</var>,
f9b5a818ef99 Another update to the Element/Attribute serialization algorithm to fix recent
travil
parents: 40
diff changeset
   485
                        the <a title="concept-generated-prefix">generated prefix index</a> <var>prefix index</var>, the 
42
fa768c710fba Algorithm Polish (variable re-names, prose clean-up and clarifying notes here and there).
travil
parents: 41
diff changeset
   486
                        flag <var>ignore namespace definition attribute</var> and the value of <var>duplicate 
fa768c710fba Algorithm Polish (variable re-names, prose clean-up and clarifying notes here and there).
travil
parents: 41
diff changeset
   487
                        prefix definition</var>.
38
fb9edcfb8f5f Rewrite of the Element serializing XML serializer algorithm. Should be much closer
travil
parents: 37
diff changeset
   488
                    <li>If <var>ns</var> is the <a title="html-ns">HTML namespace</a>,
18
15a9ba955a3a Expanded the XML Serialization algorithm for Elements (and a sligt enhancement
travil
parents: 17
diff changeset
   489
                        and the <var>node</var>'s list of 
15a9ba955a3a Expanded the XML Serialization algorithm for Elements (and a sligt enhancement
travil
parents: 17
diff changeset
   490
                        <a title="concept-tree-child" data-spec="DOM4" class="externalDFN">children</a>
15a9ba955a3a Expanded the XML Serialization algorithm for Elements (and a sligt enhancement
travil
parents: 17
diff changeset
   491
                        is empty, and the <var>node</var>'s
38
fb9edcfb8f5f Rewrite of the Element serializing XML serializer algorithm. Should be much closer
travil
parents: 37
diff changeset
   492
                        <code><a title="dom-element-localname" data-spec="DOM4" class="externalDFN">localName</a></code>
20
a00491801887 Fixed list of void elements and link to HTML5.
travil
parents: 19
diff changeset
   493
                        matches any one of the following 
a00491801887 Fixed list of void elements and link to HTML5.
travil
parents: 19
diff changeset
   494
                        <a title="void-elements" data-spec="HTML5" class="externalDFN">void elements</a>:
a00491801887 Fixed list of void elements and link to HTML5.
travil
parents: 19
diff changeset
   495
                        "<code>area</code>",
a00491801887 Fixed list of void elements and link to HTML5.
travil
parents: 19
diff changeset
   496
                        "<code>base</code>",
46
dbaee43f1d5b Fix bug 25029: Sync up the void element list with latest HTML5.1 list
travil
parents: 45
diff changeset
   497
                        "<code>basefont</code>",
dbaee43f1d5b Fix bug 25029: Sync up the void element list with latest HTML5.1 list
travil
parents: 45
diff changeset
   498
                        "<code>bgsound</code>",
20
a00491801887 Fixed list of void elements and link to HTML5.
travil
parents: 19
diff changeset
   499
                        "<code>br</code>",
a00491801887 Fixed list of void elements and link to HTML5.
travil
parents: 19
diff changeset
   500
                        "<code>col</code>",
a00491801887 Fixed list of void elements and link to HTML5.
travil
parents: 19
diff changeset
   501
                        "<code>embed</code>",
46
dbaee43f1d5b Fix bug 25029: Sync up the void element list with latest HTML5.1 list
travil
parents: 45
diff changeset
   502
                        "<code>frame</code>",
20
a00491801887 Fixed list of void elements and link to HTML5.
travil
parents: 19
diff changeset
   503
                        "<code>hr</code>",
a00491801887 Fixed list of void elements and link to HTML5.
travil
parents: 19
diff changeset
   504
                        "<code>img</code>",
a00491801887 Fixed list of void elements and link to HTML5.
travil
parents: 19
diff changeset
   505
                        "<code>input</code>",
a00491801887 Fixed list of void elements and link to HTML5.
travil
parents: 19
diff changeset
   506
                        "<code>keygen</code>",
a00491801887 Fixed list of void elements and link to HTML5.
travil
parents: 19
diff changeset
   507
                        "<code>link</code>",
a00491801887 Fixed list of void elements and link to HTML5.
travil
parents: 19
diff changeset
   508
                        "<code>menuitem</code>",
a00491801887 Fixed list of void elements and link to HTML5.
travil
parents: 19
diff changeset
   509
                        "<code>meta</code>",
a00491801887 Fixed list of void elements and link to HTML5.
travil
parents: 19
diff changeset
   510
                        "<code>param</code>",
a00491801887 Fixed list of void elements and link to HTML5.
travil
parents: 19
diff changeset
   511
                        "<code>source</code>",
a00491801887 Fixed list of void elements and link to HTML5.
travil
parents: 19
diff changeset
   512
                        "<code>track</code>",
a00491801887 Fixed list of void elements and link to HTML5.
travil
parents: 19
diff changeset
   513
                        "<code>wbr</code>";
18
15a9ba955a3a Expanded the XML Serialization algorithm for Elements (and a sligt enhancement
travil
parents: 17
diff changeset
   514
                        then append the following to <var>markup</var>, in order:
15a9ba955a3a Expanded the XML Serialization algorithm for Elements (and a sligt enhancement
travil
parents: 17
diff changeset
   515
                        <ol>
15a9ba955a3a Expanded the XML Serialization algorithm for Elements (and a sligt enhancement
travil
parents: 17
diff changeset
   516
                            <li>"<code> </code>" (U+0020 SPACE);
15a9ba955a3a Expanded the XML Serialization algorithm for Elements (and a sligt enhancement
travil
parents: 17
diff changeset
   517
                            <li>"<code>/</code>" (U+002F SOLIDUS);
15a9ba955a3a Expanded the XML Serialization algorithm for Elements (and a sligt enhancement
travil
parents: 17
diff changeset
   518
                        </ol>
15a9ba955a3a Expanded the XML Serialization algorithm for Elements (and a sligt enhancement
travil
parents: 17
diff changeset
   519
                        and set the <var>skip end tag</var> flag to <code>true</code>.
38
fb9edcfb8f5f Rewrite of the Element serializing XML serializer algorithm. Should be much closer
travil
parents: 37
diff changeset
   520
                    <li>If <var>ns</var> is not the <a title="html-ns">HTML namespace</a>,
18
15a9ba955a3a Expanded the XML Serialization algorithm for Elements (and a sligt enhancement
travil
parents: 17
diff changeset
   521
                        and the <var>node</var>'s list of 
15a9ba955a3a Expanded the XML Serialization algorithm for Elements (and a sligt enhancement
travil
parents: 17
diff changeset
   522
                        <a title="concept-tree-child" data-spec="DOM4" class="externalDFN">children</a>
15a9ba955a3a Expanded the XML Serialization algorithm for Elements (and a sligt enhancement
travil
parents: 17
diff changeset
   523
                        is empty, then append "<code>/</code>" (U+002F SOLIDUS) to <var>markup</var>
15a9ba955a3a Expanded the XML Serialization algorithm for Elements (and a sligt enhancement
travil
parents: 17
diff changeset
   524
                        and set the <var>skip end tag</var> flag to <code>true</code>.
15a9ba955a3a Expanded the XML Serialization algorithm for Elements (and a sligt enhancement
travil
parents: 17
diff changeset
   525
                    <li>Append "<code>&gt;</code>" (U+003E GREATER-THAN SIGN) to <var>markup</var>.
15a9ba955a3a Expanded the XML Serialization algorithm for Elements (and a sligt enhancement
travil
parents: 17
diff changeset
   526
                    <li>If the value of <var>skip end tag</var> is <code>true</code>, then return 
15a9ba955a3a Expanded the XML Serialization algorithm for Elements (and a sligt enhancement
travil
parents: 17
diff changeset
   527
                        the value of <var>markup</var> and skip the remaining steps. The 
15a9ba955a3a Expanded the XML Serialization algorithm for Elements (and a sligt enhancement
travil
parents: 17
diff changeset
   528
                        <var>node</var> is a leaf-node.
49
bf16edd32039 Fix bug 25181: Enable the innerHTML and outerHTML getter calls to invoke the serialize steps directly
travil
parents: 47
diff changeset
   529
                    <li>Append to <var>markup</var> the result of running the  
bf16edd32039 Fix bug 25181: Enable the innerHTML and outerHTML getter calls to invoke the serialize steps directly
travil
parents: 47
diff changeset
   530
                        <a title="concept-xml-serialization-algorithm">XML serialization algorithm</a> on each 
bf16edd32039 Fix bug 25181: Enable the innerHTML and outerHTML getter calls to invoke the serialize steps directly
travil
parents: 47
diff changeset
   531
                        of <var>node</var>'s
18
15a9ba955a3a Expanded the XML Serialization algorithm for Elements (and a sligt enhancement
travil
parents: 17
diff changeset
   532
                        <a title="concept-tree-child" data-spec="DOM4" class="externalDFN">children</a>,
49
bf16edd32039 Fix bug 25181: Enable the innerHTML and outerHTML getter calls to invoke the serialize steps directly
travil
parents: 47
diff changeset
   533
                        in order, providing the value of <var>inherited ns</var> for the 
bf16edd32039 Fix bug 25181: Enable the innerHTML and outerHTML getter calls to invoke the serialize steps directly
travil
parents: 47
diff changeset
   534
                        <a title="concept-context-namespace">context namespace</a>,
38
fb9edcfb8f5f Rewrite of the Element serializing XML serializer algorithm. Should be much closer
travil
parents: 37
diff changeset
   535
                        <var>map</var> for the <a title="concept-namespace-prefix-map">namespace prefix map</a>,
49
bf16edd32039 Fix bug 25181: Enable the innerHTML and outerHTML getter calls to invoke the serialize steps directly
travil
parents: 47
diff changeset
   536
                        <var>prefix index</var> for the 
bf16edd32039 Fix bug 25181: Enable the innerHTML and outerHTML getter calls to invoke the serialize steps directly
travil
parents: 47
diff changeset
   537
                        <a title="concept-generated-prefix">generated namespace prefix index</a>, and the value
bf16edd32039 Fix bug 25181: Enable the innerHTML and outerHTML getter calls to invoke the serialize steps directly
travil
parents: 47
diff changeset
   538
                        of the <var>strict validation</var> flag.
36
393c42a44e7f Fix Bug 25062, and some cleanup of the Element serialization algorithm
travil@microsoft.com
parents: 35
diff changeset
   539
                    <li>Append the following to <var>markup</var>, in order:
18
15a9ba955a3a Expanded the XML Serialization algorithm for Elements (and a sligt enhancement
travil
parents: 17
diff changeset
   540
                        <ol>
37
c80b719c8211 Correction to the namespace prefix matching sub-steps--they must only consider real XMLNS attributes.
travil@microsoft.com
parents: 36
diff changeset
   541
                            <li>"<code>&lt;/</code>" (U+003C LESS-THAN SIGN, U+002F SOLIDUS);
c80b719c8211 Correction to the namespace prefix matching sub-steps--they must only consider real XMLNS attributes.
travil@microsoft.com
parents: 36
diff changeset
   542
                            <li>The value of <var>qualified name</var>;
c80b719c8211 Correction to the namespace prefix matching sub-steps--they must only consider real XMLNS attributes.
travil@microsoft.com
parents: 36
diff changeset
   543
                            <li>"<code>&gt;</code>" (U+003E GREATER-THAN SIGN).
18
15a9ba955a3a Expanded the XML Serialization algorithm for Elements (and a sligt enhancement
travil
parents: 17
diff changeset
   544
                        </ol>
15a9ba955a3a Expanded the XML Serialization algorithm for Elements (and a sligt enhancement
travil
parents: 17
diff changeset
   545
                    <li>Return the value of <var>markup</var>.
1
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   546
                </ol>
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   547
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   548
            <dt><code><a title="document" data-spec="DOM4" class="externalDFN">Document</a></code>
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   549
            <dd>
21
75b83ca5f00c Fix Document XML serialization.
travil
parents: 20
diff changeset
   550
                <p>Return the result of concatenating the following, in order:
75b83ca5f00c Fix Document XML serialization.
travil
parents: 20
diff changeset
   551
                <ol>
75b83ca5f00c Fix Document XML serialization.
travil
parents: 20
diff changeset
   552
                    <li>The string produced by running the steps to 
34
f5458f389274 Applied consistent quoting around title attributes and lowercased all refs to
tleithea
parents: 33
diff changeset
   553
                        <a title="concept-serialize-doctype">produce a DocumentType serialization</a>
21
75b83ca5f00c Fix Document XML serialization.
travil
parents: 20
diff changeset
   554
                        of <var>node</var>'s 
34
f5458f389274 Applied consistent quoting around title attributes and lowercased all refs to
tleithea
parents: 33
diff changeset
   555
                        <a title="dom-document-doctype" data-spec="HTML5" class="externalDFN">doctype</a>
21
75b83ca5f00c Fix Document XML serialization.
travil
parents: 20
diff changeset
   556
                        attribute;
49
bf16edd32039 Fix bug 25181: Enable the innerHTML and outerHTML getter calls to invoke the serialize steps directly
travil
parents: 47
diff changeset
   557
                    <li>The string produced by running the <a title="concept-xml-serialization-algorithm">XML 
bf16edd32039 Fix bug 25181: Enable the innerHTML and outerHTML getter calls to invoke the serialize steps directly
travil
parents: 47
diff changeset
   558
                        serialization algorithm</a> on <var>node</var>'s 
34
f5458f389274 Applied consistent quoting around title attributes and lowercased all refs to
tleithea
parents: 33
diff changeset
   559
                        <a title="dom-document-documentelement" data-spec="HTML5" class="externalDFN">documentElement</a>
49
bf16edd32039 Fix bug 25181: Enable the innerHTML and outerHTML getter calls to invoke the serialize steps directly
travil
parents: 47
diff changeset
   560
                        attribute, given <code>null</code> as the <a title="concept-context-namespace">context 
bf16edd32039 Fix bug 25181: Enable the innerHTML and outerHTML getter calls to invoke the serialize steps directly
travil
parents: 47
diff changeset
   561
                        namespace</a>, 
42
fa768c710fba Algorithm Polish (variable re-names, prose clean-up and clarifying notes here and there).
travil
parents: 41
diff changeset
   562
                        <a title="concept-namespace-prefix-map">namespace prefix map</a> <var>prefix map</var>,
49
bf16edd32039 Fix bug 25181: Enable the innerHTML and outerHTML getter calls to invoke the serialize steps directly
travil
parents: 47
diff changeset
   563
                        a reference to the <a title="concept-generated-prefix">generated namespace 
bf16edd32039 Fix bug 25181: Enable the innerHTML and outerHTML getter calls to invoke the serialize steps directly
travil
parents: 47
diff changeset
   564
                        prefix index</a> <var>prefix index</var>, and flag <var>strict validation</var>. 
21
75b83ca5f00c Fix Document XML serialization.
travil
parents: 20
diff changeset
   565
                </ol>
1
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   566
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   567
            <dt><code><a title="comment" data-spec="DOM4" class="externalDFN">Comment</a></code>
32
f4430fb3b150 Sync-up to the Living Specification's changes:
travil
parents: 31
diff changeset
   568
            <dd>
f4430fb3b150 Sync-up to the Living Specification's changes:
travil
parents: 31
diff changeset
   569
                <p>Return the concatenation of "<code>&lt;!--</code>", <var>node</var>'s
1
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   570
                <code><a title="dom-characterdata-data" data-spec="DOM4" class="externalDFN">data</a></code>, and
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   571
                "<code>--></code>".
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   572
47
1920f7b853a1 Fix bug 23936: [LC Comment] Source reference to DOM L2 Core
travil
parents: 46
diff changeset
   573
            <!-- Removing CDATA Serialization steps as this interface type is removed from DOM4:
14
edebbe3facb6 Add support for CDATA serializations in DOM (for XML and programmatic creation).
travil
parents: 13
diff changeset
   574
            <dt><code><a title="cdata" data-spec="DOML2" class="externalDFN">CDATASection</a></code>
15
072801890ccd Add support for DOCTYPE serialization on XML docs. Fixed an error with Text in
travil
parents: 14
diff changeset
   575
            <dd><ol>
072801890ccd Add support for DOCTYPE serialization on XML docs. Fixed an error with Text in
travil
parents: 14
diff changeset
   576
                <li>Let <var>markup</var> be the concatenation of "<code>&lt;![CDATA[</code>", 
39
1860a8d798cf Cleanup of the Element and Processing Instruction parts of algorithm, plus some
travil
parents: 38
diff changeset
   577
                    <var>node</var>'s <code><a title="dom-characterdata-data" data-spec="DOM4" 
1860a8d798cf Cleanup of the Element and Processing Instruction parts of algorithm, plus some
travil
parents: 38
diff changeset
   578
                    class="externalDFN">data</a></code>, and "<code>]]></code>".
15
072801890ccd Add support for DOCTYPE serialization on XML docs. Fixed an error with Text in
travil
parents: 14
diff changeset
   579
                <li>Return <var>markup</var>.
072801890ccd Add support for DOCTYPE serialization on XML docs. Fixed an error with Text in
travil
parents: 14
diff changeset
   580
              </ol>
072801890ccd Add support for DOCTYPE serialization on XML docs. Fixed an error with Text in
travil
parents: 14
diff changeset
   581
072801890ccd Add support for DOCTYPE serialization on XML docs. Fixed an error with Text in
travil
parents: 14
diff changeset
   582
              <p class=note>CDATASection objects may be created by the historical 
072801890ccd Add support for DOCTYPE serialization on XML docs. Fixed an error with Text in
travil
parents: 14
diff changeset
   583
            <code>document.createCDATASection</code> API, or as a result of parsing an
072801890ccd Add support for DOCTYPE serialization on XML docs. Fixed an error with Text in
travil
parents: 14
diff changeset
   584
            <a title="xml-document" data-spec="DOM4" class="externalDFN">XML document</a>.
47
1920f7b853a1 Fix bug 23936: [LC Comment] Source reference to DOM L2 Core
travil
parents: 46
diff changeset
   585
            -->
1920f7b853a1 Fix bug 23936: [LC Comment] Source reference to DOM L2 Core
travil
parents: 46
diff changeset
   586
            
1
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   587
            <dt><code><a title="text" data-spec="DOM4" class="externalDFN">Text</a></code>
15
072801890ccd Add support for DOCTYPE serialization on XML docs. Fixed an error with Text in
travil
parents: 14
diff changeset
   588
            <dd><ol>
072801890ccd Add support for DOCTYPE serialization on XML docs. Fixed an error with Text in
travil
parents: 14
diff changeset
   589
                <li>Let <var>markup</var> be <var>node</var>'s
1
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   590
                <code><a title="dom-characterdata-data" data-spec="DOM4" class="externalDFN">data</a></code>.
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   591
15
072801890ccd Add support for DOCTYPE serialization on XML docs. Fixed an error with Text in
travil
parents: 14
diff changeset
   592
                <li>Replace any occurrences of "<code>&amp;</code>" in <var>markup</var> by
072801890ccd Add support for DOCTYPE serialization on XML docs. Fixed an error with Text in
travil
parents: 14
diff changeset
   593
                "<code>&amp;amp;</code>".
14
edebbe3facb6 Add support for CDATA serializations in DOM (for XML and programmatic creation).
travil
parents: 13
diff changeset
   594
                
15
072801890ccd Add support for DOCTYPE serialization on XML docs. Fixed an error with Text in
travil
parents: 14
diff changeset
   595
                <li>Replace any occurrences of "<code>&lt;</code>" in <var>markup</var> by
072801890ccd Add support for DOCTYPE serialization on XML docs. Fixed an error with Text in
travil
parents: 14
diff changeset
   596
                "<code>&amp;lt;</code>".
072801890ccd Add support for DOCTYPE serialization on XML docs. Fixed an error with Text in
travil
parents: 14
diff changeset
   597
                
072801890ccd Add support for DOCTYPE serialization on XML docs. Fixed an error with Text in
travil
parents: 14
diff changeset
   598
                <li>Replace any occurrences of "<code>&gt;</code>" in <var>markup</var> by
072801890ccd Add support for DOCTYPE serialization on XML docs. Fixed an error with Text in
travil
parents: 14
diff changeset
   599
                "<code>&amp;gt;</code>".
072801890ccd Add support for DOCTYPE serialization on XML docs. Fixed an error with Text in
travil
parents: 14
diff changeset
   600
                
072801890ccd Add support for DOCTYPE serialization on XML docs. Fixed an error with Text in
travil
parents: 14
diff changeset
   601
                <li>Return <var>data</var>.
072801890ccd Add support for DOCTYPE serialization on XML docs. Fixed an error with Text in
travil
parents: 14
diff changeset
   602
              </ol>
1
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   603
            <dt><code><a title="documentfragment" data-spec="DOM4" class="externalDFN">DocumentFragment</a></code>
15
072801890ccd Add support for DOCTYPE serialization on XML docs. Fixed an error with Text in
travil
parents: 14
diff changeset
   604
            <dd><ol>
072801890ccd Add support for DOCTYPE serialization on XML docs. Fixed an error with Text in
travil
parents: 14
diff changeset
   605
                <li>Let <var>markup</var> the empty string.
1
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   606
15
072801890ccd Add support for DOCTYPE serialization on XML docs. Fixed an error with Text in
travil
parents: 14
diff changeset
   607
                <li>For each
43
a702e4acefbf Update the DocumentFragment call to the XML Serilizer to provide the necessary
travil
parents: 42
diff changeset
   608
                    <a title="concept-tree-child" data-spec="DOM4" class="externalDFN">child</a> of <var>node</var>, 
49
bf16edd32039 Fix bug 25181: Enable the innerHTML and outerHTML getter calls to invoke the serialize steps directly
travil
parents: 47
diff changeset
   609
                    in order, run the <a title="concept-xml-serialization-algorithm">XML serialization algorithm</a>
bf16edd32039 Fix bug 25181: Enable the innerHTML and outerHTML getter calls to invoke the serialize steps directly
travil
parents: 47
diff changeset
   610
                    on the <var>child</var> given 
43
a702e4acefbf Update the DocumentFragment call to the XML Serilizer to provide the necessary
travil
parents: 42
diff changeset
   611
                    a <a title="concept-context-namespace">context namespace</a> <var>namespace</var>, a
49
bf16edd32039 Fix bug 25181: Enable the innerHTML and outerHTML getter calls to invoke the serialize steps directly
travil
parents: 47
diff changeset
   612
                    <a title="concept-namespace-prefix-map">namespace prefix map</a> <var>prefix map</var>,
43
a702e4acefbf Update the DocumentFragment call to the XML Serilizer to provide the necessary
travil
parents: 42
diff changeset
   613
                    a reference to a <a title="concept-generated-prefix">generated namespace prefix index</a> 
49
bf16edd32039 Fix bug 25181: Enable the innerHTML and outerHTML getter calls to invoke the serialize steps directly
travil
parents: 47
diff changeset
   614
                    <var>prefix index</var>, and flag <var>strict validation</var>. Concatenate the result 
bf16edd32039 Fix bug 25181: Enable the innerHTML and outerHTML getter calls to invoke the serialize steps directly
travil
parents: 47
diff changeset
   615
                    to <var>markup</var>.
15
072801890ccd Add support for DOCTYPE serialization on XML docs. Fixed an error with Text in
travil
parents: 14
diff changeset
   616
                <li>Return <var>markup</var>.
072801890ccd Add support for DOCTYPE serialization on XML docs. Fixed an error with Text in
travil
parents: 14
diff changeset
   617
              </ol>
072801890ccd Add support for DOCTYPE serialization on XML docs. Fixed an error with Text in
travil
parents: 14
diff changeset
   618
            <dt><code><a title="documenttype" data-spec="DOM4" class="externalDFN">DocumentType</a></code>
34
f5458f389274 Applied consistent quoting around title attributes and lowercased all refs to
tleithea
parents: 33
diff changeset
   619
            <dd>Run the steps to <a title="concept-serialize-doctype">produce a DocumentType 
16
809c9f8a41a9 Factored the DOCTYPE serialization algorithm to additionally support HTML docs
travil
parents: 15
diff changeset
   620
                serialization</a> of <var>node</var>
809c9f8a41a9 Factored the DOCTYPE serialization algorithm to additionally support HTML docs
travil
parents: 15
diff changeset
   621
                and return the string this produced.           
15
072801890ccd Add support for DOCTYPE serialization on XML docs. Fixed an error with Text in
travil
parents: 14
diff changeset
   622
            
072801890ccd Add support for DOCTYPE serialization on XML docs. Fixed an error with Text in
travil
parents: 14
diff changeset
   623
            <dt><code><a title="processinginstruction" data-spec="DOM4" class="externalDFN">ProcessingInstruction</a></code>
072801890ccd Add support for DOCTYPE serialization on XML docs. Fixed an error with Text in
travil
parents: 14
diff changeset
   624
            <dd><ol>
39
1860a8d798cf Cleanup of the Element and Processing Instruction parts of algorithm, plus some
travil
parents: 38
diff changeset
   625
                <li>Let <var>markup</var> be the concatenation of the following, in order:
1860a8d798cf Cleanup of the Element and Processing Instruction parts of algorithm, plus some
travil
parents: 38
diff changeset
   626
                <ol>
1860a8d798cf Cleanup of the Element and Processing Instruction parts of algorithm, plus some
travil
parents: 38
diff changeset
   627
                    <li>"<code>&lt;?</code>" (U+003C LESS-THAN SIGN, U+003F QUESTION MARK);
1860a8d798cf Cleanup of the Element and Processing Instruction parts of algorithm, plus some
travil
parents: 38
diff changeset
   628
                    <li>The value of <var>node</var>'s <code><a title="dom-characterdata-target" 
1860a8d798cf Cleanup of the Element and Processing Instruction parts of algorithm, plus some
travil
parents: 38
diff changeset
   629
                        data-spec="DOM4" class="externalDFN">target</a></code>;
1860a8d798cf Cleanup of the Element and Processing Instruction parts of algorithm, plus some
travil
parents: 38
diff changeset
   630
                    <li>"<code> </code>" (U+0020 SPACE);
1860a8d798cf Cleanup of the Element and Processing Instruction parts of algorithm, plus some
travil
parents: 38
diff changeset
   631
                    <li>The value of <var>node</var>'s <code><a title="dom-characterdata-data" 
1860a8d798cf Cleanup of the Element and Processing Instruction parts of algorithm, plus some
travil
parents: 38
diff changeset
   632
                        data-spec="DOM4" class="externalDFN">data</a></code>;
1860a8d798cf Cleanup of the Element and Processing Instruction parts of algorithm, plus some
travil
parents: 38
diff changeset
   633
                    <li>"<code>?></code>" (U+003F QUESTION MARK, U+003E GREATER-THAN SIGN).
1860a8d798cf Cleanup of the Element and Processing Instruction parts of algorithm, plus some
travil
parents: 38
diff changeset
   634
                </ol>
15
072801890ccd Add support for DOCTYPE serialization on XML docs. Fixed an error with Text in
travil
parents: 14
diff changeset
   635
                <li>Return <var>markup</var>.
072801890ccd Add support for DOCTYPE serialization on XML docs. Fixed an error with Text in
travil
parents: 14
diff changeset
   636
              </ol>
1
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   637
        </dl>
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   638
34
f5458f389274 Applied consistent quoting around title attributes and lowercased all refs to
tleithea
parents: 33
diff changeset
   639
        <p>To <dfn title="concept-serialize-doctype">produce a DocumentType serialization</dfn> of a
16
809c9f8a41a9 Factored the DOCTYPE serialization algorithm to additionally support HTML docs
travil
parents: 15
diff changeset
   640
        <a title="node" data-spec="DOM4" class="externalDFN">Node</a> <var>node</var>, the user agent
809c9f8a41a9 Factored the DOCTYPE serialization algorithm to additionally support HTML docs
travil
parents: 15
diff changeset
   641
        must return the result of the following algorithm:</p>
809c9f8a41a9 Factored the DOCTYPE serialization algorithm to additionally support HTML docs
travil
parents: 15
diff changeset
   642
                
809c9f8a41a9 Factored the DOCTYPE serialization algorithm to additionally support HTML docs
travil
parents: 15
diff changeset
   643
        <ol>
809c9f8a41a9 Factored the DOCTYPE serialization algorithm to additionally support HTML docs
travil
parents: 15
diff changeset
   644
            <li>Let <var>markup</var> be an empty string.
809c9f8a41a9 Factored the DOCTYPE serialization algorithm to additionally support HTML docs
travil
parents: 15
diff changeset
   645
            <li>Append the string "<code>&lt;!DOCTYPE</code>" to <var>markup</var>.
809c9f8a41a9 Factored the DOCTYPE serialization algorithm to additionally support HTML docs
travil
parents: 15
diff changeset
   646
            <li>Append "<code> </code>" (U+0020 SPACE) to <var>markup</var>.
809c9f8a41a9 Factored the DOCTYPE serialization algorithm to additionally support HTML docs
travil
parents: 15
diff changeset
   647
            <li>Append the value of the <var>node</var>'s 
809c9f8a41a9 Factored the DOCTYPE serialization algorithm to additionally support HTML docs
travil
parents: 15
diff changeset
   648
                <code><a title="dom-documenttype-name" data-spec="DOM4" class="externalDFN">name</a></code>
809c9f8a41a9 Factored the DOCTYPE serialization algorithm to additionally support HTML docs
travil
parents: 15
diff changeset
   649
                attribute to <var>markup</var>. For a <var>node</var> belonging to an
809c9f8a41a9 Factored the DOCTYPE serialization algorithm to additionally support HTML docs
travil
parents: 15
diff changeset
   650
                <a title="html-document" data-spec="DOM4" class="externalDFN">HTML document</a>,
809c9f8a41a9 Factored the DOCTYPE serialization algorithm to additionally support HTML docs
travil
parents: 15
diff changeset
   651
                the value will be all lowercase.
809c9f8a41a9 Factored the DOCTYPE serialization algorithm to additionally support HTML docs
travil
parents: 15
diff changeset
   652
            <li>If the <var>node</var>'s 
809c9f8a41a9 Factored the DOCTYPE serialization algorithm to additionally support HTML docs
travil
parents: 15
diff changeset
   653
                <code><a title="dom-documenttype-publicid" data-spec="DOM4" class="externalDFN">publicId</a></code>
809c9f8a41a9 Factored the DOCTYPE serialization algorithm to additionally support HTML docs
travil
parents: 15
diff changeset
   654
                is not the empty string then append the following, in order, to <var>markup</var>:
809c9f8a41a9 Factored the DOCTYPE serialization algorithm to additionally support HTML docs
travil
parents: 15
diff changeset
   655
                <ol>
809c9f8a41a9 Factored the DOCTYPE serialization algorithm to additionally support HTML docs
travil
parents: 15
diff changeset
   656
                    <li>"<code> </code>" (U+0020 SPACE);
809c9f8a41a9 Factored the DOCTYPE serialization algorithm to additionally support HTML docs
travil
parents: 15
diff changeset
   657
                    <li>The string "<code>PUBLIC</code>";
809c9f8a41a9 Factored the DOCTYPE serialization algorithm to additionally support HTML docs
travil
parents: 15
diff changeset
   658
                    <li>"<code> </code>" (U+0020 SPACE);
809c9f8a41a9 Factored the DOCTYPE serialization algorithm to additionally support HTML docs
travil
parents: 15
diff changeset
   659
                    <li>"<code>"</code>" (U+0022 QUOTATION MARK);
809c9f8a41a9 Factored the DOCTYPE serialization algorithm to additionally support HTML docs
travil
parents: 15
diff changeset
   660
                    <li>The value of the <var>node</var>'s 
809c9f8a41a9 Factored the DOCTYPE serialization algorithm to additionally support HTML docs
travil
parents: 15
diff changeset
   661
                        <code><a title="dom-documenttype-publicid" data-spec="DOM4" class="externalDFN">publicId</a></code>
809c9f8a41a9 Factored the DOCTYPE serialization algorithm to additionally support HTML docs
travil
parents: 15
diff changeset
   662
                        attribute;
809c9f8a41a9 Factored the DOCTYPE serialization algorithm to additionally support HTML docs
travil
parents: 15
diff changeset
   663
                    <li>"<code>"</code>" (U+0022 QUOTATION MARK);
809c9f8a41a9 Factored the DOCTYPE serialization algorithm to additionally support HTML docs
travil
parents: 15
diff changeset
   664
                </ol>
809c9f8a41a9 Factored the DOCTYPE serialization algorithm to additionally support HTML docs
travil
parents: 15
diff changeset
   665
            </li>
809c9f8a41a9 Factored the DOCTYPE serialization algorithm to additionally support HTML docs
travil
parents: 15
diff changeset
   666
            <li>If the <var>node</var>'s 
809c9f8a41a9 Factored the DOCTYPE serialization algorithm to additionally support HTML docs
travil
parents: 15
diff changeset
   667
                <code><a title="dom-documenttype-systemid" data-spec="DOM4" class="externalDFN">systemId</a></code>
809c9f8a41a9 Factored the DOCTYPE serialization algorithm to additionally support HTML docs
travil
parents: 15
diff changeset
   668
                is not the empty string and the <var>node</var>'s 
809c9f8a41a9 Factored the DOCTYPE serialization algorithm to additionally support HTML docs
travil
parents: 15
diff changeset
   669
                <code><a title="dom-documenttype-publicid" data-spec="DOM4" class="externalDFN">publicId</a></code>
809c9f8a41a9 Factored the DOCTYPE serialization algorithm to additionally support HTML docs
travil
parents: 15
diff changeset
   670
                is set to the empty string, then append the following, in order, to <var>markup</var>:
809c9f8a41a9 Factored the DOCTYPE serialization algorithm to additionally support HTML docs
travil
parents: 15
diff changeset
   671
                <ol>
809c9f8a41a9 Factored the DOCTYPE serialization algorithm to additionally support HTML docs
travil
parents: 15
diff changeset
   672
                    <li>"<code> </code>" (U+0020 SPACE);
809c9f8a41a9 Factored the DOCTYPE serialization algorithm to additionally support HTML docs
travil
parents: 15
diff changeset
   673
                    <li>The string "<code>SYSTEM</code>";
809c9f8a41a9 Factored the DOCTYPE serialization algorithm to additionally support HTML docs
travil
parents: 15
diff changeset
   674
                </ol>
809c9f8a41a9 Factored the DOCTYPE serialization algorithm to additionally support HTML docs
travil
parents: 15
diff changeset
   675
            </li>
809c9f8a41a9 Factored the DOCTYPE serialization algorithm to additionally support HTML docs
travil
parents: 15
diff changeset
   676
            <li>If the <var>node</var>'s 
809c9f8a41a9 Factored the DOCTYPE serialization algorithm to additionally support HTML docs
travil
parents: 15
diff changeset
   677
                <code><a title="dom-documenttype-systemid" data-spec="DOM4" class="externalDFN">systemId</a></code>
809c9f8a41a9 Factored the DOCTYPE serialization algorithm to additionally support HTML docs
travil
parents: 15
diff changeset
   678
                is not the empty string then append the following, in order, to <var>markup</var>:
809c9f8a41a9 Factored the DOCTYPE serialization algorithm to additionally support HTML docs
travil
parents: 15
diff changeset
   679
                <ol>
809c9f8a41a9 Factored the DOCTYPE serialization algorithm to additionally support HTML docs
travil
parents: 15
diff changeset
   680
                    <li>"<code> </code>" (U+0020 SPACE);
809c9f8a41a9 Factored the DOCTYPE serialization algorithm to additionally support HTML docs
travil
parents: 15
diff changeset
   681
                    <li>"<code>"</code>" (U+0022 QUOTATION MARK);
809c9f8a41a9 Factored the DOCTYPE serialization algorithm to additionally support HTML docs
travil
parents: 15
diff changeset
   682
                    <li>The value of the <var>node</var>'s 
809c9f8a41a9 Factored the DOCTYPE serialization algorithm to additionally support HTML docs
travil
parents: 15
diff changeset
   683
                        <code><a title="dom-documenttype-systemid" data-spec="DOM4" class="externalDFN">systemId</a></code>
809c9f8a41a9 Factored the DOCTYPE serialization algorithm to additionally support HTML docs
travil
parents: 15
diff changeset
   684
                        attribute;
809c9f8a41a9 Factored the DOCTYPE serialization algorithm to additionally support HTML docs
travil
parents: 15
diff changeset
   685
                    <li>"<code>"</code>" (U+0022 QUOTATION MARK);
809c9f8a41a9 Factored the DOCTYPE serialization algorithm to additionally support HTML docs
travil
parents: 15
diff changeset
   686
                </ol>
809c9f8a41a9 Factored the DOCTYPE serialization algorithm to additionally support HTML docs
travil
parents: 15
diff changeset
   687
            </li>
47
1920f7b853a1 Fix bug 23936: [LC Comment] Source reference to DOM L2 Core
travil
parents: 46
diff changeset
   688
            <!-- Removing internalSubset serialization steps as this property is not supported by DOM4. Also,
1920f7b853a1 Fix bug 23936: [LC Comment] Source reference to DOM L2 Core
travil
parents: 46
diff changeset
   689
                optional requirements don't help improve interoperability:
16
809c9f8a41a9 Factored the DOCTYPE serialization algorithm to additionally support HTML docs
travil
parents: 15
diff changeset
   690
            <li>Optional: if the <var>node</var> has an (historical) 
809c9f8a41a9 Factored the DOCTYPE serialization algorithm to additionally support HTML docs
travil
parents: 15
diff changeset
   691
                <code><a title="ID-Core-DocType-internalSubset" data-spec="DOM3" class="externalDFN">internalSubset</a></code>
809c9f8a41a9 Factored the DOCTYPE serialization algorithm to additionally support HTML docs
travil
parents: 15
diff changeset
   692
                and the
809c9f8a41a9 Factored the DOCTYPE serialization algorithm to additionally support HTML docs
travil
parents: 15
diff changeset
   693
                <code><a title="ID-Core-DocType-internalSubset" data-spec="DOM3" class="externalDFN">internalSubset</a></code>
809c9f8a41a9 Factored the DOCTYPE serialization algorithm to additionally support HTML docs
travil
parents: 15
diff changeset
   694
                attribute's value is a non-empty string, then append the following,
809c9f8a41a9 Factored the DOCTYPE serialization algorithm to additionally support HTML docs
travil
parents: 15
diff changeset
   695
                in order, to <var>markup</var>:
809c9f8a41a9 Factored the DOCTYPE serialization algorithm to additionally support HTML docs
travil
parents: 15
diff changeset
   696
                <ol>
809c9f8a41a9 Factored the DOCTYPE serialization algorithm to additionally support HTML docs
travil
parents: 15
diff changeset
   697
                    <li>"<code> </code>" (U+0020 SPACE);
809c9f8a41a9 Factored the DOCTYPE serialization algorithm to additionally support HTML docs
travil
parents: 15
diff changeset
   698
                    <li>"<code>[</code>" (U+005B LEFT SQUARE BRACKET);
809c9f8a41a9 Factored the DOCTYPE serialization algorithm to additionally support HTML docs
travil
parents: 15
diff changeset
   699
                    <li>The value of the <var>node</var>'s 
809c9f8a41a9 Factored the DOCTYPE serialization algorithm to additionally support HTML docs
travil
parents: 15
diff changeset
   700
                        <code><a title="ID-Core-DocType-internalSubset" data-spec="DOM3" class="externalDFN">internalSubset</a></code>
809c9f8a41a9 Factored the DOCTYPE serialization algorithm to additionally support HTML docs
travil
parents: 15
diff changeset
   701
                        attribute;
809c9f8a41a9 Factored the DOCTYPE serialization algorithm to additionally support HTML docs
travil
parents: 15
diff changeset
   702
                    <li>"<code>]</code>" (U+005D RIGHT SQUARE BRACKET);
809c9f8a41a9 Factored the DOCTYPE serialization algorithm to additionally support HTML docs
travil
parents: 15
diff changeset
   703
                </ol>
809c9f8a41a9 Factored the DOCTYPE serialization algorithm to additionally support HTML docs
travil
parents: 15
diff changeset
   704
                <p class=note>A <var>node</var> belonging to an
809c9f8a41a9 Factored the DOCTYPE serialization algorithm to additionally support HTML docs
travil
parents: 15
diff changeset
   705
                   <a title="html-document" data-spec="DOM4" class="externalDFN">HTML document</a>
809c9f8a41a9 Factored the DOCTYPE serialization algorithm to additionally support HTML docs
travil
parents: 15
diff changeset
   706
                   will never have an 
809c9f8a41a9 Factored the DOCTYPE serialization algorithm to additionally support HTML docs
travil
parents: 15
diff changeset
   707
                   <code><a title="ID-Core-DocType-internalSubset" data-spec="DOM3" class="externalDFN">internalSubset</a></code>
809c9f8a41a9 Factored the DOCTYPE serialization algorithm to additionally support HTML docs
travil
parents: 15
diff changeset
   708
                   because any <code><a title="ID-Core-DocType-internalSubset" data-spec="DOM3" class="externalDFN">internalSubset</a></code>
809c9f8a41a9 Factored the DOCTYPE serialization algorithm to additionally support HTML docs
travil
parents: 15
diff changeset
   709
                   markup is ignored by the parser.</p>
809c9f8a41a9 Factored the DOCTYPE serialization algorithm to additionally support HTML docs
travil
parents: 15
diff changeset
   710
            </li>
47
1920f7b853a1 Fix bug 23936: [LC Comment] Source reference to DOM L2 Core
travil
parents: 46
diff changeset
   711
            -->
16
809c9f8a41a9 Factored the DOCTYPE serialization algorithm to additionally support HTML docs
travil
parents: 15
diff changeset
   712
            <li>Append "<code>&gt;</code>" (U+003E GREATER-THAN SIGN) to <var>markup</var>.
809c9f8a41a9 Factored the DOCTYPE serialization algorithm to additionally support HTML docs
travil
parents: 15
diff changeset
   713
        </ol>
809c9f8a41a9 Factored the DOCTYPE serialization algorithm to additionally support HTML docs
travil
parents: 15
diff changeset
   714
39
1860a8d798cf Cleanup of the Element and Processing Instruction parts of algorithm, plus some
travil
parents: 38
diff changeset
   715
        <p>To <dfn title="concept-record-namespace-info">record the namespace information</dfn> for an 
38
fb9edcfb8f5f Rewrite of the Element serializing XML serializer algorithm. Should be much closer
travil
parents: 37
diff changeset
   716
            <a title="element" data-spec="DOM4" class="externalDFN">Element</a> <var>element</var>, given a 
41
f9b5a818ef99 Another update to the Element/Attribute serialization algorithm to fix recent
travil
parents: 40
diff changeset
   717
            <a title="concept-namespace-prefix-map">namespace prefix map</a> <var>map</var>, an
42
fa768c710fba Algorithm Polish (variable re-names, prose clean-up and clarifying notes here and there).
travil
parents: 41
diff changeset
   718
            <var>element prefixes list</var> (initially empty), and a <var>duplicate prefix 
fa768c710fba Algorithm Polish (variable re-names, prose clean-up and clarifying notes here and there).
travil
parents: 41
diff changeset
   719
            definition</var> reference, the user agent must run the following steps:
38
fb9edcfb8f5f Rewrite of the Element serializing XML serializer algorithm. Should be much closer
travil
parents: 37
diff changeset
   720
        <ol>
42
fa768c710fba Algorithm Polish (variable re-names, prose clean-up and clarifying notes here and there).
travil
parents: 41
diff changeset
   721
            <li>Let <var>default namespace attr value</var> be <code>null</code>.
38
fb9edcfb8f5f Rewrite of the Element serializing XML serializer algorithm. Should be much closer
travil
parents: 37
diff changeset
   722
            <li>For each <a title="concept-attribute" data-spec="DOM4" class="externalDFN">attribute</a>
fb9edcfb8f5f Rewrite of the Element serializing XML serializer algorithm. Should be much closer
travil
parents: 37
diff changeset
   723
                <var>attr</var> in <var>element</var>'s
fb9edcfb8f5f Rewrite of the Element serializing XML serializer algorithm. Should be much closer
travil
parents: 37
diff changeset
   724
                <a title="concept-element-attribute" data-spec="DOM4" class="externalDFN">attributes</a>,
fb9edcfb8f5f Rewrite of the Element serializing XML serializer algorithm. Should be much closer
travil
parents: 37
diff changeset
   725
                in order:
fb9edcfb8f5f Rewrite of the Element serializing XML serializer algorithm. Should be much closer
travil
parents: 37
diff changeset
   726
            <ol>
39
1860a8d798cf Cleanup of the Element and Processing Instruction parts of algorithm, plus some
travil
parents: 38
diff changeset
   727
                <p class="note">The following conditional steps add namespace prefixes
38
fb9edcfb8f5f Rewrite of the Element serializing XML serializer algorithm. Should be much closer
travil
parents: 37
diff changeset
   728
                    into the <var>element prefixes list</var> and add or replace them in the <var>map</var>. 
fb9edcfb8f5f Rewrite of the Element serializing XML serializer algorithm. Should be much closer
travil
parents: 37
diff changeset
   729
                    Only attributes in the <a title="xmlns-ns">XMLNS namespace</a> are
39
1860a8d798cf Cleanup of the Element and Processing Instruction parts of algorithm, plus some
travil
parents: 38
diff changeset
   730
                    considered (e.g., attributes made to look like namespace declarations via 
1860a8d798cf Cleanup of the Element and Processing Instruction parts of algorithm, plus some
travil
parents: 38
diff changeset
   731
                    <code><a title="dom-element-setattribute" data-spec="DOM4" 
1860a8d798cf Cleanup of the Element and Processing Instruction parts of algorithm, plus some
travil
parents: 38
diff changeset
   732
                    class="externalDFN">setAttribute</a>(<em>"xmlns:pretend-prefix"</em>,
1860a8d798cf Cleanup of the Element and Processing Instruction parts of algorithm, plus some
travil
parents: 38
diff changeset
   733
                    <em>"pretend-namespace"</em>)</code> are not included).</p>
38
fb9edcfb8f5f Rewrite of the Element serializing XML serializer algorithm. Should be much closer
travil
parents: 37
diff changeset
   734
                <li>Let <var>attribute namespace</var> be the <var>attr</var>'s  
fb9edcfb8f5f Rewrite of the Element serializing XML serializer algorithm. Should be much closer
travil
parents: 37
diff changeset
   735
                    <a title="dom-attribute-namespaceuri" data-spec="DOM4" class="externalDFN">namespaceURI</a>
fb9edcfb8f5f Rewrite of the Element serializing XML serializer algorithm. Should be much closer
travil
parents: 37
diff changeset
   736
                    value.
fb9edcfb8f5f Rewrite of the Element serializing XML serializer algorithm. Should be much closer
travil
parents: 37
diff changeset
   737
                <li>Let <var>attribute prefix</var> be the value of <var>attr</var>'s 
fb9edcfb8f5f Rewrite of the Element serializing XML serializer algorithm. Should be much closer
travil
parents: 37
diff changeset
   738
                        <a title="dom-attribute-prefix" data-spec="DOM4" class="externalDFN">prefix</a>.
39
1860a8d798cf Cleanup of the Element and Processing Instruction parts of algorithm, plus some
travil
parents: 38
diff changeset
   739
                <li>If the <var>attribute namespace</var> is the <a title="xmlns-ns">XMLNS namespace</a>, then:
38
fb9edcfb8f5f Rewrite of the Element serializing XML serializer algorithm. Should be much closer
travil
parents: 37
diff changeset
   740
                <ol>
39
1860a8d798cf Cleanup of the Element and Processing Instruction parts of algorithm, plus some
travil
parents: 38
diff changeset
   741
                    <li>If <var>attribute prefix</var> is <code>null</code>, then <var>attr</var> is a 
42
fa768c710fba Algorithm Polish (variable re-names, prose clean-up and clarifying notes here and there).
travil
parents: 41
diff changeset
   742
                        default namespace declaration. Set the <var>default namespace attr value</var> to 
39
1860a8d798cf Cleanup of the Element and Processing Instruction parts of algorithm, plus some
travil
parents: 38
diff changeset
   743
                        <var>attr</var>'s <a title="dom-attribute-value" data-spec="DOM4"
41
f9b5a818ef99 Another update to the Element/Attribute serialization algorithm to fix recent
travil
parents: 40
diff changeset
   744
                        class="externalDFN">value</a> and stop running these steps, returning to the 
39
1860a8d798cf Cleanup of the Element and Processing Instruction parts of algorithm, plus some
travil
parents: 38
diff changeset
   745
                        top of the loop to visit the next attribute.
1860a8d798cf Cleanup of the Element and Processing Instruction parts of algorithm, plus some
travil
parents: 38
diff changeset
   746
                    <li>Otherwise, the <var>attribute prefix</var> is not <code>null</code> and <var>attr</var>
1860a8d798cf Cleanup of the Element and Processing Instruction parts of algorithm, plus some
travil
parents: 38
diff changeset
   747
                        is a namespace prefix definition. Run the following steps:
1860a8d798cf Cleanup of the Element and Processing Instruction parts of algorithm, plus some
travil
parents: 38
diff changeset
   748
                    <ol>
1860a8d798cf Cleanup of the Element and Processing Instruction parts of algorithm, plus some
travil
parents: 38
diff changeset
   749
                        <li>Let <var>prefix definition</var> be the value of <var>attr</var>'s 
1860a8d798cf Cleanup of the Element and Processing Instruction parts of algorithm, plus some
travil
parents: 38
diff changeset
   750
                            <a title="dom-attribute-localname" data-spec="DOM4" class="externalDFN">localName</a>.
1860a8d798cf Cleanup of the Element and Processing Instruction parts of algorithm, plus some
travil
parents: 38
diff changeset
   751
                        <li>Let <var>namespace definition</var> be the value of <var>attr</var>'s 
1860a8d798cf Cleanup of the Element and Processing Instruction parts of algorithm, plus some
travil
parents: 38
diff changeset
   752
                            <a title="dom-attribute-value" data-spec="DOM4" class="externalDFN">value</a>.
1860a8d798cf Cleanup of the Element and Processing Instruction parts of algorithm, plus some
travil
parents: 38
diff changeset
   753
                        <li>If a key matching the value of <var>namespace definition</var> already exists in
41
f9b5a818ef99 Another update to the Element/Attribute serialization algorithm to fix recent
travil
parents: 40
diff changeset
   754
                            <var>map</var>, and the key's value matches <var>prefix definition</var>, then 
42
fa768c710fba Algorithm Polish (variable re-names, prose clean-up and clarifying notes here and there).
travil
parents: 41
diff changeset
   755
                            this is a duplicate namespace prefix definition. Set the value of <var>duplicate 
fa768c710fba Algorithm Polish (variable re-names, prose clean-up and clarifying notes here and there).
travil
parents: 41
diff changeset
   756
                            prefix definition</var> to <var>prefix definition</var>.
41
f9b5a818ef99 Another update to the Element/Attribute serialization algorithm to fix recent
travil
parents: 40
diff changeset
   757
                        <li>Otherwise, if the key matching the value of <var>namespace definition</var> already 
f9b5a818ef99 Another update to the Element/Attribute serialization algorithm to fix recent
travil
parents: 40
diff changeset
   758
                            exists in <var>map</var>, but the key's value does not match <var>prefix definition</var>,
f9b5a818ef99 Another update to the Element/Attribute serialization algorithm to fix recent
travil
parents: 40
diff changeset
   759
                            then update the key's value to be <var>prefix definition</var>.
39
1860a8d798cf Cleanup of the Element and Processing Instruction parts of algorithm, plus some
travil
parents: 38
diff changeset
   760
                        <li>Otherwise, no key matching the value of <var>namespace definition</var> exists;
1860a8d798cf Cleanup of the Element and Processing Instruction parts of algorithm, plus some
travil
parents: 38
diff changeset
   761
                            append to <var>map</var> a new key <var>namespace definition</var>
1860a8d798cf Cleanup of the Element and Processing Instruction parts of algorithm, plus some
travil
parents: 38
diff changeset
   762
                            whose key value is the <var>prefix definition</var>.
1860a8d798cf Cleanup of the Element and Processing Instruction parts of algorithm, plus some
travil
parents: 38
diff changeset
   763
                        <li>Append the value of <var>prefix definition</var> to <var>element prefixes list</var>.
1860a8d798cf Cleanup of the Element and Processing Instruction parts of algorithm, plus some
travil
parents: 38
diff changeset
   764
                    </ol>
38
fb9edcfb8f5f Rewrite of the Element serializing XML serializer algorithm. Should be much closer
travil
parents: 37
diff changeset
   765
                </ol>
fb9edcfb8f5f Rewrite of the Element serializing XML serializer algorithm. Should be much closer
travil
parents: 37
diff changeset
   766
            </ol>
42
fa768c710fba Algorithm Polish (variable re-names, prose clean-up and clarifying notes here and there).
travil
parents: 41
diff changeset
   767
            <li>Return the value of <var>default namespace attr value</var>.
38
fb9edcfb8f5f Rewrite of the Element serializing XML serializer algorithm. Should be much closer
travil
parents: 37
diff changeset
   768
        </ol>
fb9edcfb8f5f Rewrite of the Element serializing XML serializer algorithm. Should be much closer
travil
parents: 37
diff changeset
   769
        
fb9edcfb8f5f Rewrite of the Element serializing XML serializer algorithm. Should be much closer
travil
parents: 37
diff changeset
   770
        <p>To <dfn title="concept-generate-prefix">generate a prefix</dfn> given a 
fb9edcfb8f5f Rewrite of the Element serializing XML serializer algorithm. Should be much closer
travil
parents: 37
diff changeset
   771
            <a title="concept-namespace-prefix-map">namespace prefix map</a> <var>map</var>, a 
42
fa768c710fba Algorithm Polish (variable re-names, prose clean-up and clarifying notes here and there).
travil
parents: 41
diff changeset
   772
            string <var>new namespace</var>, and a reference to a
38
fb9edcfb8f5f Rewrite of the Element serializing XML serializer algorithm. Should be much closer
travil
parents: 37
diff changeset
   773
            <a title="concept-generated-prefix">generated namespace prefix index</a> <var>prefix
fb9edcfb8f5f Rewrite of the Element serializing XML serializer algorithm. Should be much closer
travil
parents: 37
diff changeset
   774
            index</var>, the user agent must run the following steps:
fb9edcfb8f5f Rewrite of the Element serializing XML serializer algorithm. Should be much closer
travil
parents: 37
diff changeset
   775
        <ol>
fb9edcfb8f5f Rewrite of the Element serializing XML serializer algorithm. Should be much closer
travil
parents: 37
diff changeset
   776
            <li>Let <var>generated prefix</var> be the concatenation of the string <code>"ns"</code> and
fb9edcfb8f5f Rewrite of the Element serializing XML serializer algorithm. Should be much closer
travil
parents: 37
diff changeset
   777
                the current numerical value of <var>prefix index</var>.
fb9edcfb8f5f Rewrite of the Element serializing XML serializer algorithm. Should be much closer
travil
parents: 37
diff changeset
   778
            <li>Let the value of <var>prefix index</var> be incremented by one.
fb9edcfb8f5f Rewrite of the Element serializing XML serializer algorithm. Should be much closer
travil
parents: 37
diff changeset
   779
            <li>Append to <var>map</var> a new key <var>new namespace</var> whose key value is the 
fb9edcfb8f5f Rewrite of the Element serializing XML serializer algorithm. Should be much closer
travil
parents: 37
diff changeset
   780
                <var>generated prefix</var>.
fb9edcfb8f5f Rewrite of the Element serializing XML serializer algorithm. Should be much closer
travil
parents: 37
diff changeset
   781
            <li>Return the value of <var>generated prefix</var>.
fb9edcfb8f5f Rewrite of the Element serializing XML serializer algorithm. Should be much closer
travil
parents: 37
diff changeset
   782
        </ol>
16
809c9f8a41a9 Factored the DOCTYPE serialization algorithm to additionally support HTML docs
travil
parents: 15
diff changeset
   783
        
34
f5458f389274 Applied consistent quoting around title attributes and lowercased all refs to
tleithea
parents: 33
diff changeset
   784
        <p>The <dfn title="concept-serialize-xml-attributes">XML serialization of the attributes</dfn>
39
1860a8d798cf Cleanup of the Element and Processing Instruction parts of algorithm, plus some
travil
parents: 38
diff changeset
   785
            of an <a title="concept-element" data-spec="DOM4" class="externalDFN">Element</a>
1860a8d798cf Cleanup of the Element and Processing Instruction parts of algorithm, plus some
travil
parents: 38
diff changeset
   786
            <var>element</var> together with a <a title="concept-namespace-prefix-map">namespace prefix 
41
f9b5a818ef99 Another update to the Element/Attribute serialization algorithm to fix recent
travil
parents: 40
diff changeset
   787
            map</a> <var>map</var>, a <a title="concept-generated-prefix">generated prefix index</a> 
42
fa768c710fba Algorithm Polish (variable re-names, prose clean-up and clarifying notes here and there).
travil
parents: 41
diff changeset
   788
            <var>prefix index</var> reference, a flag <var>ignore namespace definition attribute</var> and a
fa768c710fba Algorithm Polish (variable re-names, prose clean-up and clarifying notes here and there).
travil
parents: 41
diff changeset
   789
            <var>duplicate prefix definition</var> value, is the result of the following algorithm:
1
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   790
        <ol>
18
15a9ba955a3a Expanded the XML Serialization algorithm for Elements (and a sligt enhancement
travil
parents: 17
diff changeset
   791
            <li>Let <var>result</var> be the empty string.
39
1860a8d798cf Cleanup of the Element and Processing Instruction parts of algorithm, plus some
travil
parents: 38
diff changeset
   792
            <li>For each <a title="concept-attribute" data-spec="DOM4" class="externalDFN">attribute</a>
18
15a9ba955a3a Expanded the XML Serialization algorithm for Elements (and a sligt enhancement
travil
parents: 17
diff changeset
   793
                <var>attr</var> in <var>element</var>'s
34
f5458f389274 Applied consistent quoting around title attributes and lowercased all refs to
tleithea
parents: 33
diff changeset
   794
                <a title="concept-element-attribute" data-spec="DOM4" class="externalDFN">attributes</a>,
18
15a9ba955a3a Expanded the XML Serialization algorithm for Elements (and a sligt enhancement
travil
parents: 17
diff changeset
   795
                in order:
39
1860a8d798cf Cleanup of the Element and Processing Instruction parts of algorithm, plus some
travil
parents: 38
diff changeset
   796
            <ol>
1860a8d798cf Cleanup of the Element and Processing Instruction parts of algorithm, plus some
travil
parents: 38
diff changeset
   797
                <li>Let <var>attribute namespace</var> be the <var>attr</var>'s  
1860a8d798cf Cleanup of the Element and Processing Instruction parts of algorithm, plus some
travil
parents: 38
diff changeset
   798
                    <a title="dom-attribute-namespaceuri" data-spec="DOM4" class="externalDFN">namespaceURI</a>
1860a8d798cf Cleanup of the Element and Processing Instruction parts of algorithm, plus some
travil
parents: 38
diff changeset
   799
                    value.
1860a8d798cf Cleanup of the Element and Processing Instruction parts of algorithm, plus some
travil
parents: 38
diff changeset
   800
                <!-- Check for an unregistered attribute namespace, and if so, serialize a definition for it -->
42
fa768c710fba Algorithm Polish (variable re-names, prose clean-up and clarifying notes here and there).
travil
parents: 41
diff changeset
   801
                <li>Let <var>candidate prefix</var> be <code>null</code>.
41
f9b5a818ef99 Another update to the Element/Attribute serialization algorithm to fix recent
travil
parents: 40
diff changeset
   802
                <li>If <var>attribute namespace</var> is not <code>null</code>, then run these sub-steps:
18
15a9ba955a3a Expanded the XML Serialization algorithm for Elements (and a sligt enhancement
travil
parents: 17
diff changeset
   803
                <ol>
42
fa768c710fba Algorithm Polish (variable re-names, prose clean-up and clarifying notes here and there).
travil
parents: 41
diff changeset
   804
                    <li>If the value of <var>attribute namespace</var> is the 
41
f9b5a818ef99 Another update to the Element/Attribute serialization algorithm to fix recent
travil
parents: 40
diff changeset
   805
                        <a title="xmlns-ns">XMLNS namespace</a> and either the <var>attr</var>'s 
42
fa768c710fba Algorithm Polish (variable re-names, prose clean-up and clarifying notes here and there).
travil
parents: 41
diff changeset
   806
                        <a title="dom-attribute-prefix" data-spec="DOM4" class="externalDFN">prefix</a>
fa768c710fba Algorithm Polish (variable re-names, prose clean-up and clarifying notes here and there).
travil
parents: 41
diff changeset
   807
                        is <code>null</code> and the <var>ignore namespace definition 
41
f9b5a818ef99 Another update to the Element/Attribute serialization algorithm to fix recent
travil
parents: 40
diff changeset
   808
                        attribute</var> flag is <code>true</code> or the <var>attr</var>'s 
f9b5a818ef99 Another update to the Element/Attribute serialization algorithm to fix recent
travil
parents: 40
diff changeset
   809
                        <a title="dom-attribute-prefix" data-spec="DOM4" class="externalDFN">prefix</a>
42
fa768c710fba Algorithm Polish (variable re-names, prose clean-up and clarifying notes here and there).
travil
parents: 41
diff changeset
   810
                        is not <code>null</code> and the <var>attr</var>'s 
41
f9b5a818ef99 Another update to the Element/Attribute serialization algorithm to fix recent
travil
parents: 40
diff changeset
   811
                        <a title="concept-attribute-localname" data-spec="DOM4" class="externalDFN">localName</a>
42
fa768c710fba Algorithm Polish (variable re-names, prose clean-up and clarifying notes here and there).
travil
parents: 41
diff changeset
   812
                        matches the value of <var>duplicate prefix definition</var>, then stop running 
fa768c710fba Algorithm Polish (variable re-names, prose clean-up and clarifying notes here and there).
travil
parents: 41
diff changeset
   813
                        these steps and return to the loop to visit the next attribute.
fa768c710fba Algorithm Polish (variable re-names, prose clean-up and clarifying notes here and there).
travil
parents: 41
diff changeset
   814
                    <li>Otherwise, if there exists a key in <var>map</var> that matches the value of <var>attribute 
fa768c710fba Algorithm Polish (variable re-names, prose clean-up and clarifying notes here and there).
travil
parents: 41
diff changeset
   815
                        namespace</var>, then let <var>candidate prefix</var> be that key's value from the 
fa768c710fba Algorithm Polish (variable re-names, prose clean-up and clarifying notes here and there).
travil
parents: 41
diff changeset
   816
                        <var>map</var>.
41
f9b5a818ef99 Another update to the Element/Attribute serialization algorithm to fix recent
travil
parents: 40
diff changeset
   817
                    <li>Otherwise, there is no key matching <var>attribute namespace</var> in <var>map</var> and
f9b5a818ef99 Another update to the Element/Attribute serialization algorithm to fix recent
travil
parents: 40
diff changeset
   818
                        the <var>attribute namespace</var> is not the <a title="xmlns-ns">XMLNS namespace</a>. 
f9b5a818ef99 Another update to the Element/Attribute serialization algorithm to fix recent
travil
parents: 40
diff changeset
   819
                        Run these steps:
39
1860a8d798cf Cleanup of the Element and Processing Instruction parts of algorithm, plus some
travil
parents: 38
diff changeset
   820
                    <ol>
42
fa768c710fba Algorithm Polish (variable re-names, prose clean-up and clarifying notes here and there).
travil
parents: 41
diff changeset
   821
                        <li>Let <var>candidate prefix</var> be the result of 
41
f9b5a818ef99 Another update to the Element/Attribute serialization algorithm to fix recent
travil
parents: 40
diff changeset
   822
                            <a title="concept-generate-prefix">generating a prefix</a> providing <var>map</var>, 
f9b5a818ef99 Another update to the Element/Attribute serialization algorithm to fix recent
travil
parents: 40
diff changeset
   823
                            <var>attribute namespace</var>, and <var>prefix index</var> as input.
f9b5a818ef99 Another update to the Element/Attribute serialization algorithm to fix recent
travil
parents: 40
diff changeset
   824
                        <li>Append the following to <var>result</var>:
f9b5a818ef99 Another update to the Element/Attribute serialization algorithm to fix recent
travil
parents: 40
diff changeset
   825
                        <ol>
f9b5a818ef99 Another update to the Element/Attribute serialization algorithm to fix recent
travil
parents: 40
diff changeset
   826
                            <li>"<code> </code>" (U+0020 SPACE);
f9b5a818ef99 Another update to the Element/Attribute serialization algorithm to fix recent
travil
parents: 40
diff changeset
   827
                            <li>The string "<code>xmlns:</code>";
42
fa768c710fba Algorithm Polish (variable re-names, prose clean-up and clarifying notes here and there).
travil
parents: 41
diff changeset
   828
                            <li>The value of <var>candidate prefix</var>;
41
f9b5a818ef99 Another update to the Element/Attribute serialization algorithm to fix recent
travil
parents: 40
diff changeset
   829
                            <li>"<code>="</code>" (U+003D EQUALS SIGN, U+0022 QUOTATION MARK);
f9b5a818ef99 Another update to the Element/Attribute serialization algorithm to fix recent
travil
parents: 40
diff changeset
   830
                            <li>The result of <a title="concept-serialize-attr-value">serializing an attribute value</a> 
f9b5a818ef99 Another update to the Element/Attribute serialization algorithm to fix recent
travil
parents: 40
diff changeset
   831
                        given <var>attribute namespace</var> as input;
f9b5a818ef99 Another update to the Element/Attribute serialization algorithm to fix recent
travil
parents: 40
diff changeset
   832
                            <li>"<code>"</code>" (U+0022 QUOTATION MARK).
f9b5a818ef99 Another update to the Element/Attribute serialization algorithm to fix recent
travil
parents: 40
diff changeset
   833
                        </ol>
39
1860a8d798cf Cleanup of the Element and Processing Instruction parts of algorithm, plus some
travil
parents: 38
diff changeset
   834
                    </ol>
18
15a9ba955a3a Expanded the XML Serialization algorithm for Elements (and a sligt enhancement
travil
parents: 17
diff changeset
   835
                </ol>
41
f9b5a818ef99 Another update to the Element/Attribute serialization algorithm to fix recent
travil
parents: 40
diff changeset
   836
                <!-- A namespace prefix has been set by this point if it needed to be set -->
39
1860a8d798cf Cleanup of the Element and Processing Instruction parts of algorithm, plus some
travil
parents: 38
diff changeset
   837
                <li>Append a "<code> </code>" (U+0020 SPACE) to <var>result</var>.
42
fa768c710fba Algorithm Polish (variable re-names, prose clean-up and clarifying notes here and there).
travil
parents: 41
diff changeset
   838
                <li>If <var>candidate prefix</var> is not <code>null</code>, then append to <var>result</var>
fa768c710fba Algorithm Polish (variable re-names, prose clean-up and clarifying notes here and there).
travil
parents: 41
diff changeset
   839
                    the concatenation of <var>candidate prefix</var> with "<code>:</code>" (U+003A COLON).
41
f9b5a818ef99 Another update to the Element/Attribute serialization algorithm to fix recent
travil
parents: 40
diff changeset
   840
                <!-- Write out the standard attribute -->
39
1860a8d798cf Cleanup of the Element and Processing Instruction parts of algorithm, plus some
travil
parents: 38
diff changeset
   841
                <li>Append the following strings to <var>result</var>:
1860a8d798cf Cleanup of the Element and Processing Instruction parts of algorithm, plus some
travil
parents: 38
diff changeset
   842
                <ol>
1860a8d798cf Cleanup of the Element and Processing Instruction parts of algorithm, plus some
travil
parents: 38
diff changeset
   843
                    <li>The value of <var>attr</var>'s
1860a8d798cf Cleanup of the Element and Processing Instruction parts of algorithm, plus some
travil
parents: 38
diff changeset
   844
                        <a title="concept-attribute-localname" data-spec="DOM4" class="externalDFN">localName</a>;
1860a8d798cf Cleanup of the Element and Processing Instruction parts of algorithm, plus some
travil
parents: 38
diff changeset
   845
                    <li>"<code>="</code>" (U+003D EQUALS SIGN, U+0022 QUOTATION MARK);
41
f9b5a818ef99 Another update to the Element/Attribute serialization algorithm to fix recent
travil
parents: 40
diff changeset
   846
                    <li>The result of <a title="concept-serialize-attr-value">serializing an attribute value</a> 
f9b5a818ef99 Another update to the Element/Attribute serialization algorithm to fix recent
travil
parents: 40
diff changeset
   847
                        given <var>attr</var>'s
f9b5a818ef99 Another update to the Element/Attribute serialization algorithm to fix recent
travil
parents: 40
diff changeset
   848
                        <a title="concept-attribute-value" data-spec="DOM4" class="externalDFN">value</a> as input;
39
1860a8d798cf Cleanup of the Element and Processing Instruction parts of algorithm, plus some
travil
parents: 38
diff changeset
   849
                    <li>"<code>"</code>" (U+0022 QUOTATION MARK).
1860a8d798cf Cleanup of the Element and Processing Instruction parts of algorithm, plus some
travil
parents: 38
diff changeset
   850
                </ol>
1860a8d798cf Cleanup of the Element and Processing Instruction parts of algorithm, plus some
travil
parents: 38
diff changeset
   851
            </ol>
18
15a9ba955a3a Expanded the XML Serialization algorithm for Elements (and a sligt enhancement
travil
parents: 17
diff changeset
   852
            <li>Return <var>result</var>.
1
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   853
        </ol>
41
f9b5a818ef99 Another update to the Element/Attribute serialization algorithm to fix recent
travil
parents: 40
diff changeset
   854
        
f9b5a818ef99 Another update to the Element/Attribute serialization algorithm to fix recent
travil
parents: 40
diff changeset
   855
        <p>To <dfn title="concept-serialize-attr-value">serialize an attribute value</dfn> given an 
f9b5a818ef99 Another update to the Element/Attribute serialization algorithm to fix recent
travil
parents: 40
diff changeset
   856
            <var>attribute value</var>, the user agent must run the following steps:
f9b5a818ef99 Another update to the Element/Attribute serialization algorithm to fix recent
travil
parents: 40
diff changeset
   857
        <ol>
42
fa768c710fba Algorithm Polish (variable re-names, prose clean-up and clarifying notes here and there).
travil
parents: 41
diff changeset
   858
            <li>If <var>attribute value</var> is <code>null</code>, then return the empty string.
41
f9b5a818ef99 Another update to the Element/Attribute serialization algorithm to fix recent
travil
parents: 40
diff changeset
   859
            <li>Otherwise, <var>attribute value</var> is a string. Return <var>attribute value</var>,
f9b5a818ef99 Another update to the Element/Attribute serialization algorithm to fix recent
travil
parents: 40
diff changeset
   860
                first replacing any occurrences of the following:
f9b5a818ef99 Another update to the Element/Attribute serialization algorithm to fix recent
travil
parents: 40
diff changeset
   861
            <ol>
f9b5a818ef99 Another update to the Element/Attribute serialization algorithm to fix recent
travil
parents: 40
diff changeset
   862
                <li>"<code>&quot;</code>" with "<code>&amp;quot;</code>"
f9b5a818ef99 Another update to the Element/Attribute serialization algorithm to fix recent
travil
parents: 40
diff changeset
   863
                <li>"<code>&amp;</code>" with "<code>&amp;amp;</code>"
f9b5a818ef99 Another update to the Element/Attribute serialization algorithm to fix recent
travil
parents: 40
diff changeset
   864
                <li>"<code>&lt;</code>" with "<code>&amp;lt;</code>"
f9b5a818ef99 Another update to the Element/Attribute serialization algorithm to fix recent
travil
parents: 40
diff changeset
   865
                <li>"<code>&gt;</code>" with "<code>&amp;gt;</code>"
f9b5a818ef99 Another update to the Element/Attribute serialization algorithm to fix recent
travil
parents: 40
diff changeset
   866
            </ol>
f9b5a818ef99 Another update to the Element/Attribute serialization algorithm to fix recent
travil
parents: 40
diff changeset
   867
            <p class="note">This matches behavior present in browsers, and goes above
f9b5a818ef99 Another update to the Element/Attribute serialization algorithm to fix recent
travil
parents: 40
diff changeset
   868
                and beyond the grammar requirement in the XML specification's AttValue
f9b5a818ef99 Another update to the Element/Attribute serialization algorithm to fix recent
travil
parents: 40
diff changeset
   869
                production [[XML10]] by also replacing "<code>&gt;</code>" characters.</p>
f9b5a818ef99 Another update to the Element/Attribute serialization algorithm to fix recent
travil
parents: 40
diff changeset
   870
        </ol>
1
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   871
    </section>
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   872
</section>
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   873
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   874
<section>
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   875
    <h1>The <code>DOMParser</code> interface</h1>
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   876
    
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   877
<pre class=extraidl>enum <span class=idlInterfaceID>SupportedType</span> {
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   878
    "text/html",
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   879
    "text/xml",
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   880
    "application/xml",
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   881
    "application/xhtml+xml",
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   882
    "image/svg+xml"
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   883
};</pre>
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   884
34
f5458f389274 Applied consistent quoting around title attributes and lowercased all refs to
tleithea
parents: 33
diff changeset
   885
    <p>The <dfn title="dom-domparser"><code>DOMParser()</code></dfn> constructor
1
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   886
    must return a new <code>DOMParser</code> object.
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   887
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   888
    <dl class="idl" title="[Constructor] interface DOMParser">
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   889
        <dt>Document parseFromString(DOMString str, SupportedType type)</dt>
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   890
        <dd>
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   891
            <p>The
34
f5458f389274 Applied consistent quoting around title attributes and lowercased all refs to
tleithea
parents: 33
diff changeset
   892
            <dfn title="dom-domparser-parsefromstring"><code>parseFromString(<var>str</var>, <var>type</var>)</code></dfn>
1
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   893
            method must run these steps, depending on <var>type</var>:
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   894
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   895
            <dl class=switch>
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   896
                <dt>"<code>text/html</code>"
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   897
                <dd>
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   898
                <p>Parse <var>str</var> with an
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   899
                <code><a data-spec="HTML5" title="html-parser" class="externalDFN">HTML parser</a></code>, and return the newly
34
f5458f389274 Applied consistent quoting around title attributes and lowercased all refs to
tleithea
parents: 33
diff changeset
   900
                created <a title="concept-document" data-spec="DOM4" class="externalDFN">document</a>.
1
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   901
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   902
                <p>The <a data-spec="HTML5" title="scripting-flag" class="externalDFN">scripting flag</a> must be set to
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   903
                "disabled".
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   904
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   905
                <p class=note><code><a data-spec="HTML5" title="meta" class="externalDFN">meta</a></code> elements are not
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   906
                taken into account for the encoding used, as a Unicode stream is passed into
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   907
                the parser.
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   908
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   909
                <p class=note><code><a data-spec="HTML5" title="script" class="externalDFN">script</a></code> elements get marked
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   910
                unexecutable and the contents of <code><a data-spec="HTML5" title="noscript" class="externalDFN">noscript</a></code>
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   911
                get parsed as markup.
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   912
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   913
                <dt>"<code>text/xml</code>"
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   914
                <dt>"<code>application/xml</code>"
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   915
                <dt>"<code>application/xhtml+xml</code>"
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   916
                <dt>"<code>image/svg+xml</code>"
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   917
                <dd>
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   918
                <ol>
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   919
                    <li>Parse <var>str</var> with a namespace-enabled
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   920
                    <code><a data-spec="HTML5" title="xml-parser" class="externalDFN">XML parser</a></code>.
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   921
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   922
                    <li>If the previous step didn't return an error, return the newly
34
f5458f389274 Applied consistent quoting around title attributes and lowercased all refs to
tleithea
parents: 33
diff changeset
   923
                    created <a title="concept-document" data-spec="DOM4" class="externalDFN">document</a>
1
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   924
                    and terminate these steps.
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   925
23
0890bba5b66a Resolved issue of DOMParser-parsed document properties, and switched DOMParser's
travil
parents: 22
diff changeset
   926
                    <li>Otherwise, throw a 
34
f5458f389274 Applied consistent quoting around title attributes and lowercased all refs to
tleithea
parents: 33
diff changeset
   927
                    <a data-spec="DOM4" title="domexception" class="externalDFN">DOMException</a></code> 
23
0890bba5b66a Resolved issue of DOMParser-parsed document properties, and switched DOMParser's
travil
parents: 22
diff changeset
   928
                    with name <code>SyntaxError</code>.
0890bba5b66a Resolved issue of DOMParser-parsed document properties, and switched DOMParser's
travil
parents: 22
diff changeset
   929
                    
0890bba5b66a Resolved issue of DOMParser-parsed document properties, and switched DOMParser's
travil
parents: 22
diff changeset
   930
                    <p class=note>Some UAs do not throw an exception, but rather return a minimal 
0890bba5b66a Resolved issue of DOMParser-parsed document properties, and switched DOMParser's
travil
parents: 22
diff changeset
   931
                    well-formed XML document that describes the error. In these cases, the error 
0890bba5b66a Resolved issue of DOMParser-parsed document properties, and switched DOMParser's
travil
parents: 22
diff changeset
   932
                    document's root element will be named <code>parsererror</code> and its namespace
0890bba5b66a Resolved issue of DOMParser-parsed document properties, and switched DOMParser's
travil
parents: 22
diff changeset
   933
                    will be set to "<code>http://www.mozilla.org/newlayout/xml/parsererror.xml</code>".
0890bba5b66a Resolved issue of DOMParser-parsed document properties, and switched DOMParser's
travil
parents: 22
diff changeset
   934
                    
0890bba5b66a Resolved issue of DOMParser-parsed document properties, and switched DOMParser's
travil
parents: 22
diff changeset
   935
                    <!--
0890bba5b66a Resolved issue of DOMParser-parsed document properties, and switched DOMParser's
travil
parents: 22
diff changeset
   936
                    It does not make sense to pave the cow paths by standardizing the 
0890bba5b66a Resolved issue of DOMParser-parsed document properties, and switched DOMParser's
travil
parents: 22
diff changeset
   937
                    mozilla error handling approach, when there is clear objection to that approach
0890bba5b66a Resolved issue of DOMParser-parsed document properties, and switched DOMParser's
travil
parents: 22
diff changeset
   938
                    from web developers who expect success to load the document they want, rather
0890bba5b66a Resolved issue of DOMParser-parsed document properties, and switched DOMParser's
travil
parents: 22
diff changeset
   939
                    than an error document. Browsers are reluctant to change behavior due to web
0890bba5b66a Resolved issue of DOMParser-parsed document properties, and switched DOMParser's
travil
parents: 22
diff changeset
   940
                    compatibility, but IE has thrown in these cases for multiple releases now without
0890bba5b66a Resolved issue of DOMParser-parsed document properties, and switched DOMParser's
travil
parents: 22
diff changeset
   941
                    any significant compatibility impact, and thus it seems feasable to spec the 
0890bba5b66a Resolved issue of DOMParser-parsed document properties, and switched DOMParser's
travil
parents: 22
diff changeset
   942
                    simpler and developer-expected behavior here.
0890bba5b66a Resolved issue of DOMParser-parsed document properties, and switched DOMParser's
travil
parents: 22
diff changeset
   943
                    appropriate behavior here.
0890bba5b66a Resolved issue of DOMParser-parsed document properties, and switched DOMParser's
travil
parents: 22
diff changeset
   944
                    
1
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   945
                    <li>Let <var>document</var> be a newly-created
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   946
                    <code><a data-spec="DOM4" title="xmldocument" class="externalDFN">XMLDocument</a></code>.
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   947
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   948
                    <li>
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   949
                    <p>Let <var>root</var> be a new
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   950
                    <code><a title="element" data-spec="DOM4" class="externalDFN">Element</a></code>, with its
34
f5458f389274 Applied consistent quoting around title attributes and lowercased all refs to
tleithea
parents: 33
diff changeset
   951
                    <a title="concept-element-local-name" data-spec="DOM4" class="externalDFN">local name</a>
1
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   952
                    set to "<code>parsererror</code>" and its
34
f5458f389274 Applied consistent quoting around title attributes and lowercased all refs to
tleithea
parents: 33
diff changeset
   953
                    <a title="concept-element-namespace" data-spec="DOM4" class="externalDFN">namespace</a>
1
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   954
                    set to
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   955
                    "<code>http://www.mozilla.org/newlayout/xml/parsererror.xml</code>".
23
0890bba5b66a Resolved issue of DOMParser-parsed document properties, and switched DOMParser's
travil
parents: 22
diff changeset
   956
                    <!-- see https://bugzilla.mozilla.org/show_bug.cgi?id=45566 --><!--
1
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   957
                    <p>At this point user agents may
34
f5458f389274 Applied consistent quoting around title attributes and lowercased all refs to
tleithea
parents: 33
diff changeset
   958
                    <a data-spec="DOM4" title="concept-node-append" class="externalDFN">append</a> nodes
1
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   959
                    to <var>root</var>, for example to describe the nature of the
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   960
                    error.
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   961
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   962
                    <li><a data-spec="DOM4" title="concept-node-append" class="externalDFN">Append</a>
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   963
                    <var>root</var> to <var>document</var>.
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   964
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   965
                    <li>Return <var>document</var>.
23
0890bba5b66a Resolved issue of DOMParser-parsed document properties, and switched DOMParser's
travil
parents: 22
diff changeset
   966
                    -->
1
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   967
                </ol>
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   968
            </dl>
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   969
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   970
            <p>In any case, the returned
34
f5458f389274 Applied consistent quoting around title attributes and lowercased all refs to
tleithea
parents: 33
diff changeset
   971
            <a title="concept-document" data-spec="DOM4" class="externalDFN">document</a>'s
f5458f389274 Applied consistent quoting around title attributes and lowercased all refs to
tleithea
parents: 33
diff changeset
   972
            <a title="concept-document"-content-type data-spec="DOM4" class="externalDFN">content type</a>
23
0890bba5b66a Resolved issue of DOMParser-parsed document properties, and switched DOMParser's
travil
parents: 22
diff changeset
   973
            must be the <var>type</var> argument. Additionally, the 
34
f5458f389274 Applied consistent quoting around title attributes and lowercased all refs to
tleithea
parents: 33
diff changeset
   974
            <a title="concept-document" data-spec="DOM4" class="externalDFN">document</a> must have a
f5458f389274 Applied consistent quoting around title attributes and lowercased all refs to
tleithea
parents: 33
diff changeset
   975
            <a title="concept-document"-url data-spec="DOM4" class="externalDFN">URL</a> value equal to 
23
0890bba5b66a Resolved issue of DOMParser-parsed document properties, and switched DOMParser's
travil
parents: 22
diff changeset
   976
            the URL of the 
34
f5458f389274 Applied consistent quoting around title attributes and lowercased all refs to
tleithea
parents: 33
diff changeset
   977
            <a title="active-document" data-spec="HTML5" class="externalDFN">active document</a>, a 
f5458f389274 Applied consistent quoting around title attributes and lowercased all refs to
tleithea
parents: 33
diff changeset
   978
            <a title="location" data-spec="HTML5" class="externalDFN">location</a> value of <code>null</code>.
1
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   979
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   980
            <p class=note>The returned
34
f5458f389274 Applied consistent quoting around title attributes and lowercased all refs to
tleithea
parents: 33
diff changeset
   981
            <a title="concept-document" data-spec="DOM4" class="externalDFN">document</a>'s
f5458f389274 Applied consistent quoting around title attributes and lowercased all refs to
tleithea
parents: 33
diff changeset
   982
            <a title="concept-document"-encoding data-spec="DOM4" class="externalDFN">encoding</a> is
1
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   983
            the default, UTF-8.
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   984
        </dd>
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   985
    </dl>
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   986
</section>
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   987
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   988
<section>
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   989
    <h1>The <code>XMLSerializer</code> interface</h1>
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   990
34
f5458f389274 Applied consistent quoting around title attributes and lowercased all refs to
tleithea
parents: 33
diff changeset
   991
    <p>The <dfn title="dom-xmlserializer"><code>XMLSerializer()</code></dfn>
1
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   992
    constructor must return a new <code>XMLSerializer</code> object.
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   993
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   994
    <dl class="idl" title="[Constructor] interface XMLSerializer">
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
   995
        <dt>DOMString serializeToString(Node root)</dt>
0
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
   996
17
b1c206041ab9 Small consistency fix plus validation error fix.
travil
parents: 16
diff changeset
   997
        <dd>The <code>serializeToString(<var>root</var>)</code>
49
bf16edd32039 Fix bug 25181: Enable the innerHTML and outerHTML getter calls to invoke the serialize steps directly
travil
parents: 47
diff changeset
   998
        method must <a title="concept-serialize-xml">produce an XML serialization</a> of <var>root</var> passing 
bf16edd32039 Fix bug 25181: Enable the innerHTML and outerHTML getter calls to invoke the serialize steps directly
travil
parents: 47
diff changeset
   999
        a value of <code>false</code> for the <a title="concept-strict-validation">strict validation</a> parameter, and return the result.</dd>
1
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
  1000
    </dl>
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
  1001
</section>
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
  1002
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
  1003
<section>
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
  1004
    <h1>Extensions to the <code><a title="element" data-spec="DOM4" class="externalDFN">Element</a></code> interface</h1>
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
  1005
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
  1006
    <dl class="idl" title="partial interface Element">
11
ed0d76e9894d Processing WHATWG checkin:
travil
parents: 10
diff changeset
  1007
        <dt>[TreatNullAs=EmptyString] attribute DOMString innerHTML</dt>
1
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
  1008
        <dd>
34
f5458f389274 Applied consistent quoting around title attributes and lowercased all refs to
tleithea
parents: 33
diff changeset
  1009
            <p>The <dfn title="dom-element-innerhtml"><code>innerHTML</code></dfn> IDL
1
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
  1010
            attribute represents the markup of the
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
  1011
            <code><a title="element" data-spec="DOM4" class="externalDFN">Element</a></code>'s contents.
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
  1012
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
  1013
            <dl class=domintro>
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
  1014
                <!--doc.ih
34
f5458f389274 Applied consistent quoting around title attributes and lowercased all refs to
tleithea
parents: 33
diff changeset
  1015
                <dt><var>document</var> . <code title="dom-document-innerhtml">innerHTML</code> [ = <var>value</var> ]
1
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
  1016
                <dd>
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
  1017
                <p>Returns a fragment of HTML or XML that represents the
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
  1018
                <code><a title="document" data-spec="DOM4" class="externalDFN">Document</a></code>.
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
  1019
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
  1020
                <p>Can be set, to replace the
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
  1021
                <code><a title="document" data-spec="DOM4" class="externalDFN">Document</a></code>'s contents with the result of
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
  1022
                parsing the given string.
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
  1023
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
  1024
                <p>In the case of an <a title="xml-document" data-spec="DOM4" class="externalDFN">XML document</a>,
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
  1025
                will throw an
34
f5458f389274 Applied consistent quoting around title attributes and lowercased all refs to
tleithea
parents: 33
diff changeset
  1026
                <code><a data-spec="DOM4" title="domexception" class="externalDFN">DOMException</a></code> with name <code>InvalidStateError</code>
1
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
  1027
                if the <code><a title="document" data-spec="DOM4" class="externalDFN">Document</a></code> cannot be serialized
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
  1028
                to XML, and a
34
f5458f389274 Applied consistent quoting around title attributes and lowercased all refs to
tleithea
parents: 33
diff changeset
  1029
                <code><a data-spec="DOM4" title="domexception" class="externalDFN">DOMException</a></code> with name <code>SyntaxError</code>
1
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
  1030
                if the given string is not well-formed.
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
  1031
                -->
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
  1032
34
f5458f389274 Applied consistent quoting around title attributes and lowercased all refs to
tleithea
parents: 33
diff changeset
  1033
                <dt><var>element</var> . <code title="dom-element-innerhtml">innerHTML</code> [ = <var>value</var> ]
1
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
  1034
                <dd>
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
  1035
                <p>Returns a fragment of HTML or XML that represents the element's
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
  1036
                contents.
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
  1037
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
  1038
                <p>Can be set, to replace the contents of the element with nodes
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
  1039
                parsed from the given string.
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
  1040
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
  1041
                <p>In the case of an <a title="xml-document" data-spec="DOM4" class="externalDFN">XML document</a>,
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
  1042
                will throw a
34
f5458f389274 Applied consistent quoting around title attributes and lowercased all refs to
tleithea
parents: 33
diff changeset
  1043
                <code><a data-spec="DOM4" title="domexception" class="externalDFN">DOMException</a></code> with name <code>InvalidStateError</code>
1
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
  1044
                if the <code><a title="element" data-spec="DOM4" class="externalDFN">Element</a></code> cannot be serialized
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
  1045
                to XML, and a
34
f5458f389274 Applied consistent quoting around title attributes and lowercased all refs to
tleithea
parents: 33
diff changeset
  1046
                <code><a data-spec="DOM4" title="domexception" class="externalDFN">DOMException</a></code> with name <code>SyntaxError</code>
1
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
  1047
                if the given string is not well-formed.
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
  1048
            </dl>
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
  1049
49
bf16edd32039 Fix bug 25181: Enable the innerHTML and outerHTML getter calls to invoke the serialize steps directly
travil
parents: 47
diff changeset
  1050
            <p>On getting, return the result of invoking the 
bf16edd32039 Fix bug 25181: Enable the innerHTML and outerHTML getter calls to invoke the serialize steps directly
travil
parents: 47
diff changeset
  1051
                <a title="concept-fragment-serializing-algorithm">fragment serializing algorithm</a> on the 
bf16edd32039 Fix bug 25181: Enable the innerHTML and outerHTML getter calls to invoke the serialize steps directly
travil
parents: 47
diff changeset
  1052
                <a title="context object">context object</a> providing <code>true</code> for the 
bf16edd32039 Fix bug 25181: Enable the innerHTML and outerHTML getter calls to invoke the serialize steps directly
travil
parents: 47
diff changeset
  1053
                <a title="concept-strict-validation">strict validation</a> flag (this might throw an exception 
bf16edd32039 Fix bug 25181: Enable the innerHTML and outerHTML getter calls to invoke the serialize steps directly
travil
parents: 47
diff changeset
  1054
                instead of returning a string).
1
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
  1055
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
  1056
            <p>On setting, these steps must be run:
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
  1057
            <ol>
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
  1058
                <li>Let <var>fragment</var> be the result of invoking the
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
  1059
                <a title="concept-parse-fragment">fragment parsing algorithm</a> with
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
  1060
                the new value as <var>markup</var>, and the
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
  1061
                <a title="context object">context object</a> as the <var>context element</var>.
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
  1062
34
f5458f389274 Applied consistent quoting around title attributes and lowercased all refs to
tleithea
parents: 33
diff changeset
  1063
                <li><a data-spec="DOM4" title="concept-node-replace-all" class="externalDFN">Replace all</a>
1
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
  1064
                with <var>fragment</var> within the <a title="context object">context object</a>.
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
  1065
            </ol>
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
  1066
        </dd>
0
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
  1067
1
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
  1068
        <!-- outerHTML -->
11
ed0d76e9894d Processing WHATWG checkin:
travil
parents: 10
diff changeset
  1069
        <dt>[TreatNullAs=EmptyString] attribute DOMString outerHTML</dt>
1
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
  1070
        <dd>
34
f5458f389274 Applied consistent quoting around title attributes and lowercased all refs to
tleithea
parents: 33
diff changeset
  1071
            <p>The <dfn title="dom-element-outerhtml"><code>outerHTML</code></dfn> IDL
1
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
  1072
            attribute represents the markup of the
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
  1073
            <code><a title="element" data-spec="DOM4" class="externalDFN">Element</a></code> and its contents.
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
  1074
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
  1075
            <dl class=domintro>
34
f5458f389274 Applied consistent quoting around title attributes and lowercased all refs to
tleithea
parents: 33
diff changeset
  1076
              <dt><var>element</var> . <code title="dom-element-outerhtml">outerHTML</code> [ = <var>value</var> ]
1
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
  1077
              <dd>
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
  1078
                <p>Returns a fragment of HTML or XML that represents the element and its
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
  1079
                contents.
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
  1080
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
  1081
                <p>Can be set, to replace the element with nodes parsed from the given
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
  1082
                string.
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
  1083
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
  1084
                <p>In the case of an <a title="xml-document" data-spec="DOM4" class="externalDFN">XML document</a>,
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
  1085
                will throw a
34
f5458f389274 Applied consistent quoting around title attributes and lowercased all refs to
tleithea
parents: 33
diff changeset
  1086
                <code><a data-spec="DOM4" title="domexception" class="externalDFN">DOMException</a></code> with name <code>InvalidStateError</code>
1
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
  1087
                if the element cannot be serialized to XML, and a
34
f5458f389274 Applied consistent quoting around title attributes and lowercased all refs to
tleithea
parents: 33
diff changeset
  1088
                <code><a data-spec="DOM4" title="domexception" class="externalDFN">DOMException</a></code> with name <code>SyntaxError</code>
1
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
  1089
                if the given string is not well-formed.
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
  1090
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
  1091
                <p>Throws a
34
f5458f389274 Applied consistent quoting around title attributes and lowercased all refs to
tleithea
parents: 33
diff changeset
  1092
                <code><a data-spec="DOM4" title="domexception" class="externalDFN">DOMException</a></code> with name <code>NoModificationAllowedError</code>
1
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
  1093
                if the parent of the element is the
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
  1094
                <code><a title="document" data-spec="DOM4" class="externalDFN">Document</a></code> node.
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
  1095
            </dl>
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
  1096
49
bf16edd32039 Fix bug 25181: Enable the innerHTML and outerHTML getter calls to invoke the serialize steps directly
travil
parents: 47
diff changeset
  1097
            <p>On getting, return the result of invoking the 
bf16edd32039 Fix bug 25181: Enable the innerHTML and outerHTML getter calls to invoke the serialize steps directly
travil
parents: 47
diff changeset
  1098
                <a title="concept-fragment-serializing-algorithm">fragment serializing algorithm</a> on a 
bf16edd32039 Fix bug 25181: Enable the innerHTML and outerHTML getter calls to invoke the serialize steps directly
travil
parents: 47
diff changeset
  1099
                fictional node whose only child is the <a title="context object">context object</a>
bf16edd32039 Fix bug 25181: Enable the innerHTML and outerHTML getter calls to invoke the serialize steps directly
travil
parents: 47
diff changeset
  1100
                <a title="context object">context object</a> providing <code>true</code> for the 
bf16edd32039 Fix bug 25181: Enable the innerHTML and outerHTML getter calls to invoke the serialize steps directly
travil
parents: 47
diff changeset
  1101
                <a title="concept-strict-validation">strict validation</a> flag (this might throw an exception 
bf16edd32039 Fix bug 25181: Enable the innerHTML and outerHTML getter calls to invoke the serialize steps directly
travil
parents: 47
diff changeset
  1102
                instead of returning a string).
1
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
  1103
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
  1104
            <p>On setting, the following steps must be run:
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
  1105
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
  1106
            <ol>
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
  1107
                <li>Let <var>parent</var> be the <a title="context object">context object</a>'s
34
f5458f389274 Applied consistent quoting around title attributes and lowercased all refs to
tleithea
parents: 33
diff changeset
  1108
                <a data-spec="DOM4" title="concept-tree-parent" class="externalDFN">parent</a>.
1
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
  1109
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
  1110
                <li>If <var>parent</var> is null, terminate these steps. There would be no
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
  1111
                way to obtain a reference to the nodes created even if the remaining steps
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
  1112
                were run.
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
  1113
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
  1114
                <li>If <var>parent</var> is a
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
  1115
                <code><a title="document" data-spec="DOM4" class="externalDFN">Document</a></code>, throw a
34
f5458f389274 Applied consistent quoting around title attributes and lowercased all refs to
tleithea
parents: 33
diff changeset
  1116
                <code><a data-spec="DOM4" title="domexception" class="externalDFN">DOMException</a></code> with name <code>NoModificationAllowedError</code>
1
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
  1117
                exception and terminate these steps.
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
  1118
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
  1119
                <li>If <var>parent</var> is a
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
  1120
                <code><a title="documentfragment" data-spec="DOM4" class="externalDFN">DocumentFragment</a></code>, let
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
  1121
                <var>parent</var> be a new
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
  1122
                <code><a title="element" data-spec="DOM4" class="externalDFN">Element</a></code> with
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
  1123
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
  1124
                <ul>
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
  1125
                    <li><code>body</code> as its
34
f5458f389274 Applied consistent quoting around title attributes and lowercased all refs to
tleithea
parents: 33
diff changeset
  1126
                    <a data-spec="DOM4" title="concept-element-local-name" class="externalDFN">local name</a>,
1
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
  1127
44
a596d4112693 Locally linked all [remaining] occurances of HTML namespace references
travil
parents: 43
diff changeset
  1128
                    <li>the <a title="html-ns">HTML namespace</a> as its
1
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
  1129
                    <a data-spec="DOM4" title="concept-element-namespace" class="externalDFN">namespace</a>, and
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
  1130
                    <li>the <a title="context object">context object</a>'s
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
  1131
                    <a title="concept-node-document" data-spec="DOM4" class="externalDFN">node document</a>
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
  1132
                    as its
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
  1133
                    <a title="concept-node-document" data-spec="DOM4" class="externalDFN">node document</a>.
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
  1134
                </ul>
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
  1135
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
  1136
                <li>Let <var>fragment</var> be the result of invoking the
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
  1137
                <a title="concept-parse-fragment">fragment parsing algorithm</a> with
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
  1138
                the new value as <var>markup</var>, and <var>parent</var> as
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
  1139
                the <var>context element</var>.
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
  1140
34
f5458f389274 Applied consistent quoting around title attributes and lowercased all refs to
tleithea
parents: 33
diff changeset
  1141
                <li><a data-spec="DOM4" title="concept-node-replace" class="externalDFN">Replace</a>
1
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
  1142
                the <a title="context object">context object</a> with <var>fragment</var> within
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
  1143
                the <a title="context object">context object</a>'s
34
f5458f389274 Applied consistent quoting around title attributes and lowercased all refs to
tleithea
parents: 33
diff changeset
  1144
                <a data-spec="DOM4" title="concept-tree-parent" class="externalDFN">parent</a>.
1
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
  1145
            </ol>
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
  1146
        </dd>
0
f39b5b437d3d The beginning.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents:
diff changeset
  1147
1
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
  1148
        <!-- insertAdjacentHTML -->
9
da5f2328b74a Processing WHATWG checkin:
travil
parents: 8
diff changeset
  1149
        <dt>void insertAdjacentHTML(DOMString position, DOMString text)</dt>
1
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
  1150
        <dd>
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
  1151
             <dl class=domintro>
34
f5458f389274 Applied consistent quoting around title attributes and lowercased all refs to
tleithea
parents: 33
diff changeset
  1152
                  <dt><var>element</var> . <code title="dom-element-insertadjacenthtml">insertAdjacentHTML</code>(<var>position</var>, <var>text</var>)
1
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
  1153
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
  1154
                  <dd>
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
  1155
                    <p>Parses the given string <var>text</var> as HTML or XML and inserts
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
  1156
                    the resulting nodes into the tree in the position given by the
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
  1157
                    <var>position</var> argument, as follows:
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
  1158
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
  1159
                    <dl>
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
  1160
                      <dt>"beforebegin"
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
  1161
                      <dd>Before the element itself.
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
  1162
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
  1163
                      <dt>"afterbegin"
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
  1164
                      <dd>Just inside the element, before its first child.
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
  1165
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
  1166
                      <dt>"beforeend"
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
  1167
                      <dd>Just inside the element, after its last child.
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
  1168
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
  1169
                      <dt>"afterend"
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
  1170
                      <dd>After the element itself.
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
  1171
                    </dl>
5cb52744fe44 Conversion to ReSpec and W3C editor's draft template.
travil@travil1.wingroup.windeploy.ntdev.microsoft.com
parents: 0
diff changeset
  1172
9
da5f2328b74a Processing WHATWG checkin:
travil
parents: 8
diff changeset
  1173
                    <p>Throws a <code>SyntaxError</code> exception if the arguments have invalid values (e.g., in the case of an