From 196fbb1ac9c212b7b1e099d2aa5eadf74fe9b8ee Mon Sep 17 00:00:00 2001 From: Ian Hickson Date: Tue, 24 Oct 2006 23:43:46 +0000 Subject: [PATCH] define document.innerHTML, do cleanup from the fallout that causes git-svn-id: http://svn.whatwg.org/webapps@188 340c8d12-0b0e-0410-8428-c7bf67bfef74 --- index | 266 ++++++++++++++++++++++++++++++++------------------------- source | 136 ++++++++++++++++++++++------- 2 files changed, 252 insertions(+), 150 deletions(-) diff --git a/index b/index index 677ce196443..0e3d829fa54 100644 --- a/index +++ b/index @@ -590,17 +590,14 @@
  • 4.1. Navigating across documents
  • 4.2. Scripting @@ -2295,7 +2292,7 @@ http://software.hixie.ch/utilities/js/live-dom-viewer/?%3C%21DOCTYPE%20html%3E.. NodeList getElementsByClassName(in DOMString[] classNames); // Dynamic markup insertion - attribute DOMString innerHTML; + attribute DOMString innerHTML; void open(); void open(in DOMString type); void open(in DOMString type, in DOMString replace); @@ -2576,8 +2573,9 @@ http://software.hixie.ch/utilities/js/live-dom-viewer/?%3C%21DOCTYPE%20html%3E..

    The document.write() family of methods and - the innerHTML family of DOM attributes enable script - authors to dynamically insert markup into the document. + the innerHTML + family of DOM attributes enable script authors to dynamically insert + markup into the document.

    Because these APIs interact with the parser, their behaviour varies depending on whether they are used with HTML (and the document.write() - document.innerHTML - - element.innerHTML + innerHTML @@ -2605,12 +2599,8 @@ http://software.hixie.ch/utilities/js/live-dom-viewer/?%3C%21DOCTYPE%20html%3E.. document.write() in HTML - document.innerHTML in - HTML - - element.innerHTML in HTML + innerHTML in HTML In XML documents @@ -2618,12 +2608,7 @@ http://software.hixie.ch/utilities/js/live-dom-viewer/?%3C%21DOCTYPE%20html%3E.. document.write() in XML - document.innerHTML in - XML - - element.innerHTML in - XML + innerHTML in XML

    Regardless of the parsing mode, the Finally, the method must return.

    -

    In HTML, the In HTML, the innerHTML DOM attribute of all - HTMLElement nodes returns a - serialisation of the element's children using the HTML - syntax. On setting, it replaces the element's - children with new nodes that result from parsing the given value. + HTMLElement and HTMLDocument nodes returns a serialisation + of the node's children using the HTML syntax. + On setting, it replaces the node's children with new nodes that result + from parsing the given value. The formal definitions follow.

    On getting, the innerHTML DOM attribute must return the + href="#innerhtml0">innerHTML DOM attribute must return the result of running the following algorithm:

      @@ -2836,7 +2823,7 @@ http://software.hixie.ch/utilities/js/live-dom-viewer/?%3C%21DOCTYPE%20html%3E.. factors such as the order that the attributes were given in the original markup, the sort order must be stable, such that consecutive calls to innerHTML serialise an element's + href="#innerhtml0">innerHTML serialise an element's attributes in the same order.

      Append a U+003E GREATER-THAN SIGN (>) @@ -2860,7 +2847,7 @@ http://software.hixie.ch/utilities/js/live-dom-viewer/?%3C%21DOCTYPE%20html%3E.. it, add event-source -->

      Otherwise, append the value of the child element's innerHTML DOM attribute (thus recursing + href="#innerhtml0">innerHTML DOM attribute (thus recursing into this algorithm for that element), followed by a U+003C LESS-THAN SIGN (<) character, a U+002F SOLIDUS (/) character, the element's tag name again (which is @@ -2909,7 +2896,7 @@ http://software.hixie.ch/utilities/js/live-dom-viewer/?%3C%21DOCTYPE%20html%3E..

      Other nodes types (e.g. Attr) cannot occur as children of elements in HTML documents. If they do, the innerHTML + title=dom-innerHTML-HTML>innerHTML attribute must raise an INVALID_STATE_ERR exception.

    1. @@ -2933,10 +2920,10 @@ http://software.hixie.ch/utilities/js/live-dom-viewer/?%3C%21DOCTYPE%20html%3E..

      If the element's contents are not conformant, it is possible that the roundtripping through innerHTML will not work. For instance, if the - element is a textarea element to which a innerHTML will not work. For instance, if + the element is a textarea element to which a Comment node has been appended, then assigning innerHTML to + title=dom-innerHTML-HTML>innerHTML to itself will result in the comment being displayed in the text field. Similarly, if, as a result of DOM manipulation, the element contains a comment that contains the literal string "-->", @@ -2947,33 +2934,65 @@ http://software.hixie.ch/utilities/js/live-dom-viewer/?%3C%21DOCTYPE%20html%3E.. text string "</", or even worse, "</script>". -

      On setting, the innerHTML DOM attribute must run the - following algorithm: +

      On setting, if the node is a document, the innerHTML DOM + attribute must run the following algorithm: + +

        +
      1. +

        The user agent must remove the children nodes of the + Document whose innerHTML attribute is being set.

        + +
      2. +

        The user agent must create a new HTML parser, in + its initial state, and associate it with the Document node.

        + +
      3. +

        The user agent must place into the input stream + for the HTML parser just created the string being + assigned into the innerHTML attribute.

        + +
      4. +

        The user agent must start the parser and let it run until it has + consumed all the characters just inserted into the input stream. (The + Document node will have been populated with elements and a + load event will have fired on its body element.)

        +
      + +

      Otherwise, if the node is an element, then setting the innerHTML DOM + attribute must cause the following algorithm to run instead:

      1. -

        The user agent must create a new HTML parser.

        +

        The user agent must create a new Document node.

        -

        Parts marked HTML parser, and + associate it with the just created Document node.

        + +

        Parts marked innerHTML case in algorithms in the parser section are parts that only occur if the parser was created for the purposes of handling the setting of an element's innerHTML + title=dom-innerHTML-HTML>innerHTML attribute. The algorithms have been annotated with such markings for informational purposes only; such markings have no normative weight. If it is possible for a condition described as an innerHTML case to occur even when + href="#innerhtml1">innerHTML case to occur even when the parser wasn't created for the purposes of handling an element's - innerHTML - attribute, then that is an error in the specification.

        + innerHTML attribute, then that is an error + in the specification.

      2. The user agent must set the HTML parser's tokenisation stage's content model flag according to the name of the element whose innerHTML attribute is being set, as + href="#innerhtml0">innerHTML attribute is being set, as follows:

        @@ -3011,6 +3030,11 @@ http://software.hixie.ch/utilities/js/live-dom-viewer/?%3C%21DOCTYPE%20html%3E..

        Let root be a new html element with no attributes.

        +
      3. +

        The user agent must append the element root to the + Document node created above.

        + +
      4. The user agent must set up the parser's stack of open elements so that it contains just the single element root.

        @@ -3023,7 +3047,7 @@ http://software.hixie.ch/utilities/js/live-dom-viewer/?%3C%21DOCTYPE%20html%3E..

        The user agent must set the parser's form element pointer to the nearest node to the element whose innerHTML attribute is being set that is a + href="#innerhtml0">innerHTML attribute is being set that is a form element (going straight up the ancestor chain, and including the element itself, if it is a form element), or, if there is no such form element, to null.

        @@ -3032,7 +3056,7 @@ http://software.hixie.ch/utilities/js/live-dom-viewer/?%3C%21DOCTYPE%20html%3E..

        The user agent must place into the input stream for the HTML parser just created the string being assigned into the innerHTML attribute.

        + href="#innerhtml0">innerHTML attribute.

      5. The user agent must start the parser and let it run until it has @@ -3040,13 +3064,13 @@ http://software.hixie.ch/utilities/js/live-dom-viewer/?%3C%21DOCTYPE%20html%3E..

      6. The user agent must remove the children of the element whose innerHTML + title=dom-innerHTML-HTML>innerHTML attribute is being set.

      7. The user agent must move all the child nodes of the root element to the element whose innerHTML + title=dom-innerHTML-HTML>innerHTML attribute is being set, preserving their order.

      ...innerHTML... @@ -11346,28 +11371,33 @@ XXX selection ranges -->

      Must define the interaction of this with document.write() pages and navigating to javascript: URIs. -

      4.1.0.1. Page load processing - model for HTML files
      +

      4.1.1. Page load processing model + for HTML files

      When an HTML page (as opposed to an XML page) is loaded in a browsing context, the user agent must begin to parse the stream of bytes as described in the parsing section. +

      create a Document node, create a parser, associate them + together, run the parser while pushing bytes into the end of the input + stream, push an explicit EOF when you have no more bytes, and require the + parser to wait for an explicit EOF in this case (or some equivalent) +

      This will usually eventually cause a load event to be fired.

      This needs to say that a parser is created, etc. -

      4.1.0.2. Page load processing - model for XML files
      +

      4.1.2. Page load processing + model for XML files

      Must make sure we don't step on the toes of other specifications. -

      4.1.0.3. Page load processing - model for text files
      +

      4.1.3. Page load processing + model for text files

      Must make sure we don't step on the toes of other specifications. This section should be referred to by the document.open() @@ -20650,21 +20680,21 @@ function receiver(e) { +

      This isn't quite right. For some entities, UAs require a + semicolon, for others they don't. We probably need to do the same for + backwards compatibility. If we do that we might be able to add more + entities, e.g. for mathematics. Probably the way to mark whether or not an + entity requires a semicolon is with an additional column in the entity table lower down. +

      9.2.4. Tree construction

      The input to the tree construction stage is a sequence of tokens from the tokenisation stage. The tree construction - stage must create a DOM Document object immediately upon - being invoked. This is the only formal "output" of this stage; most of the - real "output" consists of dynamically modifying or extending that - document's DOM tree. - -

      The Document object must initially have null doctype and documentElement - attributes, and its other attributes must be set such that the - implementation is in conformance with DOM3 Core. [DOM3CORE] + stage is associated with a DOM Document object when a parser + is created. The "output" of this stage consists of dynamically modifying + or extending that document's DOM tree.

      Tree construction passes through several phases. Initially, UAs must act according to the steps described as being those of document.writeln() calls. - [DOM3EVENTS] + [DOM3EVENTS]

      +

      Not all of the tag names mentioned below are conformant tag names in this specification; many are included to handle legacy content. @@ -20869,12 +20901,12 @@ function receiver(e) { the html root element node created in the last phase before switching to this phase (or, in the innerHTML case, the innerHTML case, the html element created to represent the element whose innerHTML attribute is being set). That's the - topmost node of the stack. It never gets popped off the stack. (This stack - grows downwards.) + href="#innerhtml0">innerHTML attribute is being set). That's + the topmost node of the stack. It never gets popped off the stack. (This + stack grows downwards.)

      The current node is the bottommost node in this stack. @@ -21198,17 +21230,17 @@ function receiver(e) {

    2. If node is the first node in the stack of open elements, then set last to true. If the element whose - innerHTML + innerHTML attribute is being set is neither a td element nor a th element, then set node to the element whose innerHTML attribute is being set. (innerHTML case) + href="#innerhtml0">innerHTML attribute is being set. (innerHTML case)
    3. If node is a select element, then switch the insertion mode to "in select" and - abort these steps. (innerHTML + abort these steps. (innerHTML case)
    4. If node is a td or th @@ -21235,7 +21267,7 @@ function receiver(e) { switch the insertion mode to "in column group" and abort these steps. (innerHTML case) + href="#innerhtml1">innerHTML case)
    5. If node is a table element, then switch the insertion mode to "in body" ("in body"! not "in head"!) and - abort these steps. (innerHTML + abort these steps. (innerHTML case)
    6. If node is a If node is a frameset element, then switch the insertion mode to "in frameset" - and abort these steps. (innerHTML + and abort these steps. (innerHTML case)
    7. If node is an insertion mode to "after head". In either case, abort these steps. (innerHTML case)
    8. + href="#innerhtml1">innerHTML case)
    9. If last is true, then set the insertion mode to "in body" and abort these steps. (innerHTML case) + href="#innerhtml1">innerHTML case)
    10. Let node now be the node before node in the stack of open elements. @@ -21358,8 +21390,8 @@ simplified explanation instead:

      If there's more than one node on the stack of open elements, or, if the parser was not originally created in order to handle the setting of an element's innerHTML - attribute (innerHTML case) and + title=dom-innerHTML-HTML>innerHTML + attribute (innerHTML case) and the second node on the stack of open elements is not a body node, this is a parse error.

      @@ -21499,7 +21531,7 @@ simplified explanation instead:

      Append the new element to the node pointed to by the head element pointer, - or, if that is null (innerHTML + or, if that is null (innerHTML case), to the current node.

      Switch the tokeniser's content model flag @@ -21526,7 +21558,7 @@ simplified explanation instead:

      Append the new element to the node pointed to by the head element pointer, - or, if that is null (innerHTML + or, if that is null (innerHTML case), to the current node.

      Switch the tokeniser's content model flag @@ -21582,21 +21614,21 @@ simplified explanation instead: ignore it.

      If the parser was originally created in order to handle the - setting of an element's innerHTML attribute, then mark the + setting of a node's innerHTML attribute, then mark the script element as "already executed", and skip the rest of the processing described for this token (including the part below where "scripts that will execute as soon as the parser resumes" are executed). (innerHTML case)

      + href="#innerhtml1">innerHTML case)

      Marking the script element as "already executed" prevents it from executing when it is inserted into the document a few paragraphs below. Scripts missing their end tags and scripts that were inserted using innerHTML + title=dom-innerHTML-HTML>innerHTML aren't executed.

      Let the old insertion point have the same @@ -21687,7 +21719,7 @@ simplified explanation instead:

      Append the new element to the node pointed to by the head element pointer, - or, if that is null (innerHTML + or, if that is null (innerHTML case), to the current node.

      Need to cope with second and subsequent is not a body element, or, if the stack of open elements has only one node on it, then ignore the token. (innerHTML case)

      + href="#innerhtml1">innerHTML case)

      Otherwise, for each attribute on the token, check to see if the attribute is already present on the If the second element in the stack of open elements is not a body element, this is a parse error. Ignore the - token. (innerHTML case)

      + token. (innerHTML case)

      Otherwise:

      @@ -21879,7 +21911,7 @@ simplified explanation instead: that token wasn't ignored, reprocess the current token.

      The fake end tag token here can only be ignored in the - innerHTML case.

      + innerHTML case.

      A start tag whose tag name is one of: "address", "blockquote", "center", "dir", "div", "dl", "fieldset", "listing", "menu", "ol", @@ -22800,7 +22832,7 @@ Put the following into the MathML namespace if parsed: ignored, reprocess the current token.

      The fake end tag token here can only be ignored in the - innerHTML case.

      + innerHTML case.

      An end tag whose tag name is "table" @@ -22809,7 +22841,7 @@ Put the following into the MathML namespace if parsed: href="#have-an0" title="has an element in table scope">have an element in table scope with the same tag name as the token, this is a parse error. Ignore the token. (innerHTML case)

      + href="#innerhtml1">innerHTML case)

      Otherwise:

      @@ -22864,7 +22896,7 @@ Put the following into the MathML namespace if parsed:

      The current node being an html element after this process is - an innerHTML case.

      + an innerHTML case.

      If the insertion mode is "in @@ -22879,7 +22911,7 @@ Put the following into the MathML namespace if parsed: href="#have-an0" title="has an element in table scope">have an element in table scope with the same tag name as the token, this is a parse error. Ignore the token. (innerHTML case)

      + href="#innerhtml1">innerHTML case)

      Otherwise:

      @@ -22909,7 +22941,7 @@ Put the following into the MathML namespace if parsed: ignored, reprocess the current token.

      The fake end tag token here can only be ignored in the - innerHTML case.

      + innerHTML case.

      An end tag whose tag name is one of: "body", "col", "colgroup", "html", "tbody", "td", "tfoot", "th", "thead", "tr" @@ -22961,7 +22993,7 @@ Put the following into the MathML namespace if parsed:

      If the current node is the root html element, then this is a parse error, ignore the token. (innerHTML case)

      + href="#innerhtml1">innerHTML case)

      Otherwise, pop the current node (which will be a colgroup element) from the

      The fake end tag token here can only be ignored in the - innerHTML case.

      + innerHTML case.

      If the insertion @@ -23036,7 +23068,7 @@ Put the following into the MathML namespace if parsed: tbody, thead, or tfoot element in table scope, this is a parse error. Ignore the token. (innerHTML case)

      + href="#innerhtml1">innerHTML case)

      Otherwise:

      @@ -23072,7 +23104,7 @@ Put the following into the MathML namespace if parsed:

      The current node being an html element after this process is - an innerHTML case.

      + an innerHTML case.

      If the insertion mode is "in row" @@ -23100,7 +23132,7 @@ Put the following into the MathML namespace if parsed: href="#have-an0" title="has an element in table scope">have an element in table scope with the same tag name as the token, this is a parse error. Ignore the token. (innerHTML case)

      + href="#innerhtml1">innerHTML case)

      Otherwise:

      @@ -23123,7 +23155,7 @@ Put the following into the MathML namespace if parsed: if that token wasn't ignored, reprocess the current token.

      The fake end tag token here can only be ignored in the - innerHTML case.

      + innerHTML case.

      An end tag whose tag name is one of: "tbody", "tfoot", "thead" @@ -23160,7 +23192,7 @@ Put the following into the MathML namespace if parsed:

      The current node being an html element after this process is - an innerHTML case.

      + an innerHTML case.

      If the insertion mode is "in cell" @@ -23204,7 +23236,7 @@ Put the following into the MathML namespace if parsed: not have a td or th element in table scope, then this is a parse error; ignore - the token. (innerHTML case)

      + the token. (innerHTML case)

      Otherwise, close the cell (see below) and reprocess the current token.

      @@ -23223,7 +23255,7 @@ Put the following into the MathML namespace if parsed: href="#have-an0" title="has an element in table scope">have an element in table scope with the same tag name as that of the token (which can only happen for "tbody", "tfoot" and "thead", or, - in the innerHTML case), then + in the innerHTML case), then this is a parse error and the token must be ignored.

      @@ -23324,7 +23356,7 @@ Put the following into the MathML namespace if parsed: href="#have-an0" title="has an element in table scope">have an element in table scope with the same tag name as the token, this is a parse error. Ignore the token. (innerHTML case)

      + href="#innerhtml1">innerHTML case)

      Otherwise:

      @@ -23388,10 +23420,10 @@ Put the following into the MathML namespace if parsed:

      If the parser was originally created in order to handle the setting of an element's innerHTML attribute, this is a innerHTML attribute, this is a parse error; ignore the token. (The element will be an html element in this case.) - (innerHTML case)

      + (innerHTML case)

      Otherwise, switch to the trailing end phase.

      @@ -23441,15 +23473,15 @@ Put the following into the MathML namespace if parsed:

      If the current node is the root html element, then this is a parse error; ignore the token. (innerHTML case)

      + href="#innerhtml1">innerHTML case)

      Otherwise, pop the current node from the stack of open elements.

      If the parser was not originally created in order to handle the setting of an element's innerHTML attribute (innerHTML case), and the innerHTML attribute (innerHTML case), and the current node is no longer a frameset element, then change the insertion mode to "getElementsByClassName(in DOMString[] classNames); // Dynamic markup insertion - attribute DOMString innerHTML; + attribute DOMString innerHTML; void open(); void open(in DOMString type); void open(in DOMString type, in DOMString replace); @@ -1619,9 +1619,10 @@ http://software.hixie.ch/utilities/js/live-dom-viewer/?%3C%21DOCTYPE%20html%3E..

      Dynamic markup insertion

      The document.write() - family of methods and the innerHTML family of - DOM attributes enable script authors to dynamically insert markup - into the document.

      + family of methods and the innerHTML family of DOM attributes + enable script authors to dynamically insert markup into the + document.

      Because these APIs interact with the parser, their behaviour varies depending on whether they are used with HTML (and the @@ -1634,22 +1635,19 @@ http://software.hixie.ch/utilities/js/live-dom-viewer/?%3C%21DOCTYPE%20html%3E.. document.write() - document.innerHTML - element.innerHTML + innerHTML In HTML documents document.write() in HTML - document.innerHTML in HTML - element.innerHTML in HTML + innerHTML in HTML In XML documents document.write() in XML - document.innerHTML in XML - element.innerHTML in XML + innerHTML in XML @@ -1835,11 +1833,12 @@ http://software.hixie.ch/utilities/js/live-dom-viewer/?%3C%21DOCTYPE%20html%3E..

      In HTML, the innerHTML DOM - attribute of all HTMLElement nodes returns a - serialisation of the element's children using the HTML - syntax. On setting, it replaces the - element's children with new nodes that result from parsing the given - value.

      + attribute of all HTMLElement and + HTMLDocument nodes returns a serialisation of the + node's children using the HTML syntax. On setting, it replaces the node's children with new nodes that + result from parsing the given value. The formal definitions + follow.

      On getting, the innerHTML DOM attribute must return the result of running the following @@ -2009,14 +2008,64 @@ http://software.hixie.ch/utilities/js/live-dom-viewer/?%3C%21DOCTYPE%20html%3E.. node with the text string "</", or even worse, "</script>".

      -

      On setting, the innerHTML - DOM attribute must run the following algorithm:

      +

      On setting, if the node is a document, the innerHTML DOM attribute must run + the following algorithm:

      + +
        + +
      1. + +

        The user agent must remove the children nodes of the + Document whose innerHTML attribute is being + set.

        + +
      2. + +
      3. + +

        The user agent must create a new HTML parser, in + its initial state, and associate it with the + Document node.

        + +
      4. + +
      5. + +

        The user agent must place into the input stream for the + HTML parser just created the string being assigned + into the innerHTML + attribute.

        + +
      6. + +
      7. + +

        The user agent must start the parser and let it run until it + has consumed all the characters just inserted into the input + stream. (The Document node will have been populated + with elements and a load event + will have fired on its body + element.)

        + +
      8. + +
      + +

      Otherwise, if the node is an element, then setting the innerHTML DOM attribute must cause + the following algorithm to run instead:

      1. -

        The user agent must create a new HTML parser.

        +

        The user agent must create a new Document + node.

        + +

        The user agent must create a new HTML parser, and + associate it with the just created Document node.

        Parts marked innerHTML case in algorithms in the @@ -2085,6 +2134,17 @@ http://software.hixie.ch/utilities/js/live-dom-viewer/?%3C%21DOCTYPE%20html%3E..

        Let root be a new html element with no attributes.

        +
      2. + +
      3. + +

        The user agent must append the element root + to the Document node created above.

        + +
      4. + +
      5. +

        The user agent must set up the parser's stack of open elements so that it contains just the single element root.

        @@ -2167,6 +2227,7 @@ http://software.hixie.ch/utilities/js/live-dom-viewer/?%3C%21DOCTYPE%20html%3E..

        ...innerHTML...

        @@ -9913,13 +9974,19 @@ XXX selection ranges --> document.write() pages and navigating to javascript: URIs.

        -
        Page load processing model for HTML files
        +

        Page load processing model for HTML files

        When an HTML page (as opposed to an XML page) is loaded in a browsing context, the user agent must begin to parse the stream of bytes as described in the parsing section.

        +

        create a Document node, create a parser, + associate them together, run the parser while pushing bytes into the + end of the input stream, push an explicit EOF when you have no more + bytes, and require the parser to wait for an explicit EOF in this + case (or some equivalent)

        +

        This will usually eventually cause a load event to be fired.

        @@ -9927,13 +9994,13 @@ XXX selection ranges --> etc.

        -
        Page load processing model for XML files
        +

        Page load processing model for XML files

        Must make sure we don't step on the toes of other specifications.

        -
        Page load processing model for text files
        +

        Page load processing model for text files

        Must make sure we don't step on the toes of other specifications. This section should be referred to by the @@ -19169,21 +19236,22 @@ function receiver(e) { +

        This isn't quite right. For some entities, UAs + require a semicolon, for others they don't. We probably need to do + the same for backwards compatibility. If we do that we might be able + to add more entities, e.g. for mathematics. Probably the way to mark + whether or not an entity requires a semicolon is with an additional + column in the entity table lower + down.

        +

        Tree construction

        The input to the tree construction stage is a sequence of tokens from the tokenisation stage. The tree construction - stage must create a DOM Document object immediately - upon being invoked. This is the only formal "output" of this stage; - most of the real "output" consists of dynamically modifying or - extending that document's DOM tree.

        - -

        The Document object must initially have null doctype and documentElement - attributes, and its other attributes must be set such that the - implementation is in conformance with DOM3 Core. [DOM3CORE]

        + stage is associated with a DOM Document object when a + parser is created. The "output" of this stage consists of + dynamically modifying or extending that document's DOM tree.

        Tree construction passes through several phases. Initially, UAs must act according to the steps described as being those of @@ -19205,7 +19273,8 @@ function receiver(e) { includes the parsing of any content inserted using document.write() and document.writeln() calls. [DOM3EVENTS]

        + XXX xref --> [DOM3EVENTS]

        Not all of the tag names mentioned below are conformant tag names in this specification; many are included to @@ -19220,6 +19289,7 @@ function receiver(e) { concerns will likely force user agents to impose nesting depths.

        +
        The initial phase

        Initially, the tree construction stage must handle each token @@ -20097,7 +20167,7 @@ simplified explanation instead: script element's end tag, so ignore it.

        If the parser was originally created in order to handle the - setting of an element's innerHTML attribute, then mark the script element as "already executed", and skip the rest of the processing