diff --git a/complete.html b/complete.html index 2f7675500b3..e56925adfc3 100644 --- a/complete.html +++ b/complete.html @@ -387,8 +387,7 @@

Living Standard — Last Updated 4 December 20122.8.4 DOMElementMap
  • 2.8.5 Transferable objects
  • 2.8.6 Safe passing of structured data
  • -
  • 2.8.7 DOM feature strings
  • -
  • 2.8.8 Garbage collection
  • +
  • 2.8.7 Garbage collection
  • 2.9 Namespaces
  • 3 Semantics, structure, and APIs of HTML documents
      @@ -1398,7 +1397,7 @@

      1.1 Where does this specification fit?< relative to other specifications can be best summed up as follows:

      -

      It consists of everything else, above such core technologies as HTTP, URI/IRIs, DOM Core, XML, Unicode, and ECMAScript; below presentation-layer technologies like CSS, XBL, and the NPAPI; and to the side of technologies like Geolocation, SVG, MathML, and XHR.

      +

      It consists of everything else, above such core technologies as HTTP, URI/IRIs, DOM, XML, Unicode, and ECMAScript; below presentation-layer technologies like CSS, XBL, and the NPAPI; and to the side of technologies like Geolocation, SVG, MathML, and XHR.

      @@ -1679,23 +1678,21 @@

      1.4 Audience

      This section is non-normative.

      -

      This specification is intended for authors of documents and - scripts that use the features defined in this specification, implementors of tools that operate on pages that use - the features defined in this specification, and individuals wishing - to establish the correctness of documents or implementations with - respect to the requirements of this specification.

      +

      This specification is intended for authors of documents and scripts that use the features + defined in this specification, implementors of tools that operate on pages that + use the features defined in this specification, and individuals wishing to establish the + correctness of documents or implementations with respect to the requirements of this + specification.

      -

      This document is probably not suited to readers who do not - already have at least a passing familiarity with Web technologies, - as in places it sacrifices clarity for precision, and brevity for - completeness. More approachable tutorials and authoring guides can - provide a gentler introduction to the topic.

      +

      This document is probably not suited to readers who do not already have at least a passing + familiarity with Web technologies, as in places it sacrifices clarity for precision, and brevity + for completeness. More approachable tutorials and authoring guides can provide a gentler + introduction to the topic.

      -

      In particular, familiarity with the basics of DOM Core and DOM - Events is necessary for a complete understanding of some of the more - technical parts of this specification. An understanding of Web IDL, - HTTP, XML, Unicode, character encodings, JavaScript, and CSS will - also be helpful in places but is not essential.

      +

      In particular, familiarity with the basics of DOM is necessary for a complete understanding of + some of the more technical parts of this specification. An understanding of Web IDL, HTTP, XML, + Unicode, character encodings, JavaScript, and CSS will also be helpful in places but is not + essential.

      1.5 Scope

      @@ -3199,67 +3196,53 @@

      2.1 Terminology

      -

      This specification refers to both HTML and XML attributes and IDL - attributes, often in the same context. When it is not clear which is - being referred to, they are referred to as content - attributes for HTML and XML attributes, and IDL - attributes for those defined on IDL interfaces. Similarly, the - term "properties" is used for both JavaScript object properties and - CSS properties. When these are ambiguous they are qualified as object properties and CSS - properties respectively.

      - -

      Generally, when the specification states that a feature applies - to the HTML syntax or the XHTML syntax, it - also includes the other. When a feature specifically only applies to - one of the two languages, it is called out by explicitly stating - that it does not apply to the other format, as in "for HTML, - ... (this does not apply to XHTML)".

      - -

      This specification uses the term document to - refer to any use of HTML, ranging from short static documents to - long essays or reports with rich multimedia, as well as to - fully-fledged interactive applications. The term is used to refer - both to Document objects and their descendant DOM - trees, and to serialized byte streams using the HTML syntax or XHTML syntax, depending on context.

      - -

      In the context of the DOM structures, the terms HTML document and XML - document are used as defined in the DOM Core specification, - and refer specifically to two different modes that - Document objects can find themselves in. [DOMCORE] (Such uses are always hyperlinked - to their definition.)

      - -

      In the context of byte streams, the term HTML document refers to - resources labeled as text/html, and the term XML - document refers to resources labeled with an XML MIME - type.

      - -

      The term XHTML document is used to refer to both - Documents in the XML - document mode that contains element nodes in the HTML - namespace, and byte streams labeled with an XML MIME - type that contain elements from the HTML - namespace, depending on context.

      - -

      For simplicity, terms such as shown, displayed, and visible might - sometimes be used when referring to the way a document is rendered - to the user. These terms are not meant to imply a visual medium; - they must be considered to apply to other media in equivalent - ways.

      +

      This specification refers to both HTML and XML attributes and IDL attributes, often in the same + context. When it is not clear which is being referred to, they are referred to as content attributes for HTML and XML attributes, and IDL + attributes for those defined on IDL interfaces. Similarly, the term "properties" is used for + both JavaScript object properties and CSS properties. When these are ambiguous they are qualified + as object properties and CSS properties respectively.

      + +

      Generally, when the specification states that a feature applies to the HTML syntax + or the XHTML syntax, it also includes the other. When a feature specifically only + applies to one of the two languages, it is called out by explicitly stating that it does not apply + to the other format, as in "for HTML, ... (this does not apply to XHTML)".

      + +

      This specification uses the term document to refer to any use of HTML, + ranging from short static documents to long essays or reports with rich multimedia, as well as to + fully-fledged interactive applications. The term is used to refer both to Document + objects and their descendant DOM trees, and to serialized byte streams using the HTML syntax or XHTML syntax, depending + on context.

      + +

      In the context of the DOM structures, the terms HTML + document and XML document are used as defined in the DOM + specification, and refer specifically to two different modes that Document objects + can find themselves in. [DOM] (Such uses are always hyperlinked to their + definition.)

      + +

      In the context of byte streams, the term HTML document refers to resources labeled as + text/html, and the term XML document refers to resources labeled with an XML + MIME type.

      + +

      The term XHTML document is used to refer to both Documents in the XML document mode that contains element nodes in the HTML + namespace, and byte streams labeled with an XML MIME type that contain + elements from the HTML namespace, depending on context.

      + +

      For simplicity, terms such as shown, displayed, and + visible might sometimes be used when referring to the way a document is + rendered to the user. These terms are not meant to imply a visual medium; they must be considered + to apply to other media in equivalent ways.

      -

      When an algorithm B says to return to another algorithm A, it - implies that A called B. Upon returning to A, the implementation - must continue from where it left off in calling B.

      +

      When an algorithm B says to return to another algorithm A, it implies that A called B. Upon + returning to A, the implementation must continue from where it left off in calling B.

      -

      The term "transparent black" refers to the color with red, green, - blue, and alpha channels all set to zero.

      +

      The term "transparent black" refers to the color with red, green, blue, and alpha channels all + set to zero.

      2.1.1 Resources

      @@ -3409,27 +3392,23 @@

      2.1.3 DOM trees

      2.1.4 Scripting

      -

      The construction "a Foo object", where - Foo is actually an interface, is sometimes used instead - of the more accurate "an object implementing the interface +

      The construction "a Foo object", where Foo is actually an interface, + is sometimes used instead of the more accurate "an object implementing the interface Foo".

      -

      An IDL attribute is said to be getting when - its value is being retrieved (e.g. by author script), and is said to - be setting when a new value is assigned to - it.

      +

      An IDL attribute is said to be getting when its value is being retrieved + (e.g. by author script), and is said to be setting when a new value is + assigned to it.

      -

      If a DOM object is said to be live, then the - attributes and methods on that object must - operate on the actual underlying data, not a snapshot of the +

      If a DOM object is said to be live, then the attributes and methods on that object + must operate on the actual underlying data, not a snapshot of the data.

      In the contexts of events, the terms fire and dispatch are used as defined in the - DOM Core specification: firing an event means to create and - dispatch it, and dispatching an event means to follow the steps that propagate + DOM specification: firing an event means to create and dispatch it, and dispatching an event means to follow the steps that propagate the event through the tree. The term trusted event is used to refer to events whose isTrusted attribute is - initialized to true. [DOMCORE]

      + initialized to true. [DOM]

      2.1.5 Plugins

      @@ -4026,19 +4005,15 @@

      2.2.2 Dependencies

      -

      The Document Object Model (DOM) is a representation — a - model — of a document and its content. The DOM is not just - an API; the conformance criteria of HTML implementations are - defined, in this specification, in terms of operations on the DOM. - [DOMCORE]

      +

      The Document Object Model (DOM) is a representation — a model — of a document and + its content. The DOM is not just an API; the conformance criteria of HTML implementations are + defined, in this specification, in terms of operations on the DOM. [DOM]

      -

      Implementations must support DOM Core and the events defined in - DOM Events, because this specification is defined in terms of the - DOM, and some of the features are defined as extensions to the DOM - Core interfaces. [DOMCORE] [DOMEVENTS]

      +

      Implementations must support DOM and the events defined in DOM Events, because this + specification is defined in terms of the DOM, and some of the features are defined as extensions + to the DOM interfaces. [DOM] [DOMEVENTS]

      -

      In particular, the following features are defined in the DOM - Core specification: [DOMCORE]

      +

      In particular, the following features are defined in the DOM specification: [DOM]

      • Attr interface
      • Comment interface
      • @@ -4084,6 +4059,7 @@

        2.2.2 Dependencies

      • isTrusted attribute
      • The type of an event
      • The concept of an event listener and the event listeners associated with an EventTarget
      • +
      • The concept of a regular event parent and a cross-boundary event parent
      • The encoding (herein the character encoding) and content type of a Document
      • The distinction between XML documents and HTML documents
      • @@ -4098,10 +4074,8 @@

        2.2.2 Dependencies

      • The MutationObserver scripting environment concept
      • The invoke MutationObserver objects algorithm
      • -

      The term throw in this specification is used as - defined in the DOM Core specification. The following - DOMException types are defined in the DOM Core - specification: [DOMCORE]

      +

      The term throw in this specification is used as defined in the DOM specification. + The following DOMException types are defined in the DOM specification: [DOM]

      1. IndexSizeError
      2. HierarchyRequestError
      3. @@ -4124,20 +4098,15 @@

        2.2.2 Dependencies

      4. TimeoutError
      5. InvalidNodeTypeError
      6. DataCloneError
      7. -

      For example, to throw a - TimeoutError exception, a user agent would - construct a DOMException object whose type was the - string "TimeoutError" (and whose code was - the number 23, for legacy reasons) and actually throw that object - as an exception.

      +

    For example, to throw a TimeoutError exception, a user + agent would construct a DOMException object whose type was the string "TimeoutError" (and whose code was the number 23, for legacy reasons) and + actually throw that object as an exception.

    -

    The URL associated - with a Document, as defined in the DOM Core - specification, is referred to in this specification as the - document's address.

    +

    The URL associated with a Document, as + defined in the DOM specification, is referred to in this specification as the document's + address.

    -

    The following features are defined in the DOM Events - specification: [DOMEVENTS]

    +

    The following features are defined in the DOM Events specification: [DOMEVENTS]

    To prepare a script, the user agent must act as + follows:

    1. -

      If the script element is marked as having - "already started", then the user agent must abort - these steps at this point. The script is not executed.

      +

      If the script element is marked as having "already started", then + the user agent must abort these steps at this point. The script is not executed.

    2. -

      If the element has its "parser-inserted" flag set, - then set was-parser-inserted to true and unset - the element's "parser-inserted" flag. Otherwise, set - was-parser-inserted to false.

      +

      If the element has its "parser-inserted" flag set, then set was-parser-inserted to true and unset the element's + "parser-inserted" flag. Otherwise, set was-parser-inserted to + false.

      -

      This is done so that if parser-inserted - script elements fail to run when the parser tries to - run them, e.g. because they are empty or specify an unsupported - scripting language, another script can later mutate them and cause - them to run again.

      +

      This is done so that if parser-inserted script elements fail to run + when the parser tries to run them, e.g. because they are empty or specify an unsupported + scripting language, another script can later mutate them and cause them to run again.

      @@ -16242,33 +16129,28 @@

      4.3.1 The -

      If was-parser-inserted is true and the - element does not have an async attribute, then set the - element's "force-async" flag to true.

      +

      If was-parser-inserted is true and the element does not have an async attribute, then set the element's + "force-async" flag to true.

      -

      This is done so that if a parser-inserted - script element fails to run when the parser tries to - run it, but it is later executed after a script dynamically - updates it, it will execute asynchronously even if the - async attribute isn't - set.

      +

      This is done so that if a parser-inserted script element fails to + run when the parser tries to run it, but it is later executed after a script dynamically updates + it, it will execute asynchronously even if the async + attribute isn't set.

    3. -

      If the element has no src - attribute, and its child nodes, if any, consist only of comment - nodes and empty Text nodes, then the user agent must - abort these steps at this point. The script is not executed.

      +

      If the element has no src attribute, and its child + nodes, if any, consist only of comment nodes and empty Text nodes, then the user + agent must abort these steps at this point. The script is not executed.

    4. -

      If the element is not in a Document, - then the user agent must abort these steps at this point. The - script is not executed.

      +

      If the element is not in a Document, then the user agent must abort + these steps at this point. The script is not executed.

    5. @@ -16276,123 +16158,116 @@

      4.3.1 The If either:

      -
      • the script element has a type attribute and its value is - the empty string, or
      • +
        • the script element has a type attribute + and its value is the empty string, or
        • -
        • the script element has no type attribute but it has a language attribute and - that attribute's value is the empty string, or
        • +
        • the script element has no type attribute + but it has a language attribute and that + attribute's value is the empty string, or
        • -
        • the script element has neither a type attribute nor a language attribute, then
        • +
        • the script element has neither a type + attribute nor a language attribute, then
        • -

        ...let the script block's type for this - script element be "text/javascript".

        +

      ...let the script block's type for this script element be "text/javascript".

      -

      Otherwise, if the script element has a type attribute, let the - script block's type for this script element be - the value of that attribute with any leading or trailing sequences - of space characters - removed.

      +

      Otherwise, if the script element has a type attribute, let the script block's type for this + script element be the value of that attribute with any leading or trailing + sequences of space characters removed.

      -

      Otherwise, the element has a non-empty language attribute; let - the script block's type for this script - element be the concatenation of the string "text/" followed by the value of the language attribute.

      +

      Otherwise, the element has a non-empty language + attribute; let the script block's type for this script element be the + concatenation of the string "text/" followed by the value of the language attribute.

      The language attribute is never - conforming, and is always ignored if there is a type attribute present.

      + conforming, and is always ignored if there is a type + attribute present.

    6. -

      If the user agent does not support the scripting - language given by the script block's type for - this script element, then the user agent must abort +

      If the user agent does not support the scripting language given by the + script block's type for this script element, then the user agent must abort these steps at this point. The script is not executed.

    7. -

      If was-parser-inserted is true, then flag - the element as "parser-inserted" again, and set the - element's "force-async" flag to false.

      +

      If was-parser-inserted is true, then flag the element as + "parser-inserted" again, and set the element's "force-async" flag to + false.

    8. -

      The user agent must set the element's "already - started" flag.

      +

      The user agent must set the element's "already started" flag.

      -

      The state of the element at this moment is later used to - determine the script source.

      +

      The state of the element at this moment is later used to determine the script source.

    9. -

      If the element is flagged as "parser-inserted", - but the element's Document is not the - Document of the parser that created the element, then - abort these steps.

      +

      If the element is flagged as "parser-inserted", but the element's + Document is not the Document of the parser that created the element, + then abort these steps.

    10. -

      If scripting is - disabled for the script element, then the user - agent must abort these steps at this point. The script is not +

      If scripting is disabled for the script + element, then the user agent must abort these steps at this point. The script is not executed.

      -

      The definition of scripting is disabled means - that, amongst others, the following scripts will not execute: - scripts in XMLHttpRequest's responseXML - documents, scripts in DOMParser-created documents, - scripts in documents created by XSLTProcessor's transformToDocument - feature, and scripts that are first inserted by a script into a - Document that was created using the createDocument() - API. [XHR] [DOMPARSING] [DOMCORE]

      +

      The definition of scripting is disabled + means that, amongst others, the following scripts will not execute: scripts in + XMLHttpRequest's responseXML + documents, scripts in DOMParser-created documents, scripts in documents created by + XSLTProcessor's transformToDocument feature, and scripts + that are first inserted by a script into a Document that was created using the + createDocument() API. [XHR] [DOMPARSING] [DOM]

    11. -

      If the script element has an event attribute and a for attribute, then run these - substeps:

      +

      If the script element has an event + attribute and a for attribute, then run these substeps:

      -
      1. Let for be the value of the for attribute.

      2. +
        1. Let for be the value of the for + attribute.

        2. Let event be the value of the event attribute.

        3. -
        4. Strip leading and trailing whitespace from - event and for.

        5. +
        6. Strip leading and trailing whitespace from event and + for.

        7. -
        8. If for is not an ASCII - case-insensitive match for the string "window", then the user agent must abort these - steps at this point. The script is not executed.

        9. +
        10. If for is not an ASCII case-insensitive match for the + string "window", then the user agent must abort these steps at this + point. The script is not executed.

        11. -
        12. If event is not an ASCII - case-insensitive match for either the string "onload" or the string "onload()", then the user agent must abort these - steps at this point. The script is not executed.

        13. +
        14. If event is not an ASCII case-insensitive match for + either the string "onload" or the string "onload()", then the user agent must abort these steps at this point. The script + is not executed.

      3. -

        If the script element has a charset attribute, then let - the script block's character encoding for this +

        If the script element has a charset + attribute, then let the script block's character encoding for this script element be the encoding given by the charset attribute.

        -

        Otherwise, let the script block's fallback character - encoding for this script element be the same as - the encoding of the - document itself.

        +

        Otherwise, let the script block's fallback character encoding for this + script element be the same as the + encoding of the document itself.

        Only one of these two pieces of state is set.

        @@ -16400,8 +16275,8 @@

        4.3.1 The -

        If the element has a src - content attribute, run these substeps:

        +

        If the element has a src content attribute, run these + substeps:

        1. Let src be the value of the element's src attribute.

        2. @@ -16446,187 +16321,152 @@

          4.3.1 The - +
        3. -

          Then, the first of the following options that describes the - situation must be followed:

          +

          Then, the first of the following options that describes the situation must be followed:

          -
          If the element has a src attribute, and the element has - a defer attribute, and the - element has been flagged as "parser-inserted", and - the element does not have an async attribute
          +
          If the element has a src + attribute, and the element has a defer attribute, and + the element has been flagged as "parser-inserted", and the element does not have + an async attribute
          -

          The element must be added to the end of the list of - scripts that will execute when the document has finished - parsing associated with the Document of the - parser that created the element.

          +

          The element must be added to the end of the list of scripts that will execute when the + document has finished parsing associated with the Document of the parser + that created the element.

          -

          The task that the - networking task source places on the task - queue once the fetching - algorithm has completed must set the element's - "ready to be parser-executed" flag. The parser will - handle executing the script.

          +

          The task that the networking task source + places on the task queue once the fetching algorithm + has completed must set the element's "ready to be parser-executed" flag. The + parser will handle executing the script.

          -
          If the element has a - src attribute, and the - element has been flagged as "parser-inserted", and - the element does not have an async attribute
          +
          If the element has a src attribute, and the element has been flagged as + "parser-inserted", and the element does not have an async attribute
          -

          The element is the pending parsing-blocking - script of the Document of the parser that - created the element. (There can only be one such script per - Document at a time.)

          +

          The element is the pending parsing-blocking script of the + Document of the parser that created the element. (There can only be one such + script per Document at a time.)

          -

          The task that the - networking task source places on the task - queue once the fetching - algorithm has completed must set the element's - "ready to be parser-executed" flag. The parser will - handle executing the script.

          +

          The task that the networking task source + places on the task queue once the fetching algorithm + has completed must set the element's "ready to be parser-executed" flag. The + parser will handle executing the script.

          -
          If the element does not - have a src attribute, and - the element has been flagged as "parser-inserted", - and either the parser that created the script is an - XML parser or it's an HTML parser whose - script nesting level is not greater than one, and the - Document of the HTML parser or - XML parser that created the script - element has a style sheet that is blocking - scripts
          +
          If the element does not have a src attribute, and the element has been flagged as + "parser-inserted", and either the parser that created the script is + an XML parser or it's an HTML parser whose script nesting + level is not greater than one, and the Document of the HTML + parser or XML parser that created the script element has + a style sheet that is blocking scripts
          -

          The element is the pending parsing-blocking - script of the Document of the parser that - created the element. (There can only be one such script per - Document at a time.)

          +

          The element is the pending parsing-blocking script of the + Document of the parser that created the element. (There can only be one such + script per Document at a time.)

          -

          Set the element's "ready to be parser-executed" - flag. The parser will handle executing the script.

          +

          Set the element's "ready to be parser-executed" flag. The parser will handle + executing the script.

          -
          If the element has a src attribute, does not have an - async attribute, and does - not have the "force-async" flag set
          +
          If the element has a src attribute, does not have an async attribute, and does not have the + "force-async" flag set
          -

          The element must be added to the end of the list of - scripts that will execute in order as soon as possible - associated with the Document of the - script element at the time the prepare a - script algorithm started.

          - -

          The task that the - networking task source places on the task - queue once the fetching - algorithm has completed must run the following steps:

          - -
          1. If the element is not now the first element in the - list of scripts that will execute in order as soon as - possible to which it was added above, then mark the - element as ready but abort these steps without executing the - script yet.

          2. - -
          3. Execution: Execute the script block - corresponding to the first script element in this list of - scripts that will execute in order as soon as +

            The element must be added to the end of the list of scripts that will execute in order + as soon as possible associated with the Document of the script + element at the time the prepare a script algorithm started.

            + +

            The task that the networking task source + places on the task queue once the fetching algorithm + has completed must run the following steps:

            + +
            1. If the element is not now the first element in the list of scripts that will + execute in order as soon as possible to which it was added above, then mark the + element as ready but abort these steps without executing the script yet.

            2. + +
            3. Execution: Execute the script block corresponding to the first + script element in this list of scripts that will execute in order as soon as possible.

            4. -
            5. Remove the first element from this list of scripts - that will execute in order as soon as possible.

            6. +
            7. Remove the first element from this list of scripts that will execute in order as + soon as possible.

            8. -
            9. If this list of scripts that will execute in order - as soon as possible is still not empty and the first - entry has already been marked as ready, then jump back to the +

            10. If this list of scripts that will execute in order as soon as possible is + still not empty and the first entry has already been marked as ready, then jump back to the step labeled execution.

          -
          If the element has a src attribute
          +
          If the element has a src + attribute
          -

          The element must be added to the set of scripts that - will execute as soon as possible of the - Document of the script element at the - time the prepare a script algorithm started.

          +

          The element must be added to the set of scripts that will execute as soon as + possible of the Document of the script element at the time the + prepare a script algorithm started.

          -

          The task that the - networking task source places on the task - queue once the fetching - algorithm has completed must execute the script - block and then remove the element from the set of - scripts that will execute as soon as possible.

          +

          The task that the networking task source + places on the task queue once the fetching algorithm + has completed must execute the script block and then remove the element from the + set of scripts that will execute as soon as possible.

          Otherwise
          -
          The user agent must immediately execute the script - block, even if other scripts are already executing.
          +
          The user agent must immediately execute the script block, even if other + scripts are already executing.
        4. -

        Fetching an external script must delay the load - event of the element's document until the task that is queued by the networking task source once - the resource has been fetched (defined - above) has been run.

        - -

        The pending parsing-blocking script of a - Document is used by the Document's - parser(s).

        - -

        If a script element that blocks a - parser gets moved to another Document before it would - normally have stopped blocking that parser, it nonetheless continues - blocking that parser until the condition that causes it to be - blocking the parser no longer applies (e.g. if the script is a - pending parsing-blocking script because there was - a style sheet that is blocking scripts when it was - parsed, but then the script is moved to another - Document before the style sheet loads, the script still - blocks the parser until the style sheets are all loaded, at which - time the script executes and the parser is unblocked).

        - - - -

        When the user agent is required to execute a script block, it must run the following - steps:

        +

      Fetching an external script must delay the load event of the element's document + until the task that is queued + by the networking task source once the resource has been fetched (defined above) has been run.

      + +

      The pending parsing-blocking script of a Document is used by the + Document's parser(s).

      + +

      If a script element that blocks a parser gets moved to another + Document before it would normally have stopped blocking that parser, it nonetheless + continues blocking that parser until the condition that causes it to be blocking the parser no + longer applies (e.g. if the script is a pending parsing-blocking script because there + was a style sheet that is blocking scripts when it was parsed, but then the script is + moved to another Document before the style sheet loads, the script still blocks the + parser until the style sheets are all loaded, at which time the script executes and the parser is + unblocked).

      + + + +

      When the user agent is required to execute a script + block, it must run the following steps:

      1. -

        If the element is flagged as "parser-inserted", - but the element's Document is not the - Document of the parser that created the element, then - abort these steps.

        +

        If the element is flagged as "parser-inserted", but the element's + Document is not the Document of the parser that created the element, + then abort these steps.

      2. @@ -16634,58 +16474,48 @@

        4.3.1 The Jump to the appropriate set of steps from the list below:

        -
        If the load resulted in an error (for example a DNS error, or - an HTTP 404 error)
        +
        If the load resulted in an error (for example a DNS error, or an HTTP 404 error)
        -

        Executing the script block must just consist of firing a simple event named - error at the element.

        +

        Executing the script block must just consist of firing + a simple event named error at the element.

        If the load was successful
        -

        Executing the script block must consist of running the - following steps. For the purposes of these steps, the script is - considered to be from an external file if, while the - prepare a script algorithm above was running for - this script, the script element had a src attribute specified.

        +

        Executing the script block must consist of running the following steps. For the purposes of + these steps, the script is considered to be from an external file if, while the + prepare a script algorithm above was running for this script, the + script element had a src attribute + specified.

        1. -

          Initialize the script block's source - as follows:

          +

          Initialize the script block's source as follows:

          -
          If the script is from an external file and the - script block's type is a text-based language
          +
          If the script is from an external file and the script block's type is a + text-based language
          -

          The contents of that file, interpreted as a Unicode - string, are the script source.

          +

          The contents of that file, interpreted as a Unicode string, are the script source.

          -

          To obtain the Unicode string, the user agent run the - following steps:

          +

          To obtain the Unicode string, the user agent run the following steps:

          -
          1. If the resource's Content - Type metadata, if any, specifies a character - encoding, and the user agent supports that encoding, then - let character encoding be that - encoding, and jump to the bottom step in this series of - steps.

          2. +
            1. If the resource's Content Type metadata, if any, + specifies a character encoding, and the user agent supports that encoding, then let character encoding be that encoding, and jump to the bottom step in this + series of steps.

            2. -
            3. If the algorithm above set the script block's - character encoding, then let character - encoding be that encoding, and jump to the bottom - step in this series of steps.

            4. +
            5. If the algorithm above set the script block's character encoding, then + let character encoding be that encoding, and jump to the bottom step + in this series of steps.

            6. -
            7. For each of the rows in the following table, - starting with the first one and going down, if the file has - as many or more bytes available than the number of bytes in - the first column, and the first bytes of the file match the - bytes given in the first column, then set character encoding to the encoding given in - the cell in the second column of that row, and jump to the - bottom step in this series of steps:

              +
            8. For each of the rows in the following table, starting with the first one and going + down, if the file has as many or more bytes available than the number of bytes in the + first column, and the first bytes of the file match the bytes given in the first column, + then set character encoding to the encoding given in the cell in the + second column of that row, and jump to the bottom step in this series of steps:

              Bytes in Hexadecimal @@ -16708,53 +16538,47 @@

              4.3.1 The DD 73 66 73

              UTF-EBCDIC --> -

              This step looks for Unicode Byte Order - Marks (BOMs).

              +

              This step looks for Unicode Byte Order Marks (BOMs).

            9. -
            10. Let character encoding be - the script block's fallback character - encoding.

            11. +
            12. Let character encoding be the script block's fallback + character encoding.

            13. -
            14. Convert the file to Unicode using character - encoding, following the rules for doing so given by - the specification for the script block's +

            15. Convert the file to Unicode using character encoding, following the + rules for doing so given by the specification for the script block's type.

          -
          If the script is from an external file and the - script block's type is an XML-based language
          +
          If the script is from an external file and the script block's type is an + XML-based language
          -

          The external file is the script source. When it is later - executed, it must be interpreted in a manner consistent with - the specification defining the language given by the - script block's type.

          +

          The external file is the script source. When it is later executed, it must be + interpreted in a manner consistent with the specification defining the language given by + the script block's type.

          -
          If the script is inline and the script block's - type is a text-based language
          +
          If the script is inline and the script block's type is a text-based + language
          -

          The value of the text IDL attribute at the - time the element's "already started" flag was - last set is the script source.

          +

          The value of the text IDL attribute at the time + the element's "already started" flag was last set is the script source.

          -
          If the script is inline and the script block's - type is an XML-based language
          +
          If the script is inline and the script block's type is an XML-based + language
          -

          The child nodes of the script element at the - time the element's "already started" flag was - last set are the script source.

          +

          The child nodes of the script element at the time the element's + "already started" flag was last set are the script source.

          @@ -16762,9 +16586,8 @@

          4.3.1 The -

          Fire a simple event named beforescriptexecute - that bubbles and is cancelable at the script - element.

          +

          Fire a simple event named beforescriptexecute that bubbles and is cancelable + at the script element.

          If the event is canceled, then abort these steps.

          @@ -16773,8 +16596,8 @@

          4.3.1 The

          If the script is from an external file, then increment the - ignore-destructive-writes counter of the - script element's Document. Let neutralized doc be that + ignore-destructive-writes counter of the script element's + Document. Let neutralized doc be that Document.

        2. @@ -16796,18 +16619,16 @@

          4.3.1 The -

          Create a - script from the script element node, using - the script block's source, the URL - from which the script was obtained, and the script - block's type.

          +

          Create a script from the + script element node, using the script block's source, the + URL from which the script was obtained, and the script block's + type.

          If the script came from a resource that was fetched in the steps above, and the resource was CORS-cross-origin, then pass the muted errors flag to the create a script from a node algorithm.

          -

          This is where the script is compiled and - actually executed.

          +

          This is where the script is compiled and actually executed.

          @@ -16820,28 +16641,24 @@

          4.3.1 The -

          Decrement the ignore-destructive-writes - counter of neutralized doc, if it - was incremented in the earlier step.

          +

          Decrement the ignore-destructive-writes counter of neutralized + doc, if it was incremented in the earlier step.

        3. -

          Fire a simple event named afterscriptexecute - that bubbles (but is not cancelable) at the - script element.

          +

          Fire a simple event named afterscriptexecute that bubbles (but is not + cancelable) at the script element.

        4. -

          If the script is from an external file, fire a simple - event named load at the - script element.

          +

          If the script is from an external file, fire a simple event named load at the script element.

          -

          Otherwise, the script is internal; queue a - task to fire a simple event named load at the script +

          Otherwise, the script is internal; queue a task to fire a simple + event named load at the script element.

        5. @@ -16850,25 +16667,21 @@

          4.3.1 The -

        The IDL attributes src, type, charset, defer, each must - reflect the respective content attributes of the same - name.

        +

      The IDL attributes src, type, charset, defer, each must reflect the respective + content attributes of the same name.

      The crossOrigin IDL attribute must reflect the crossorigin content attribute.

      -

      The async IDL - attribute controls whether the element will execute asynchronously - or not. If the element's "force-async" flag is set, - then, on getting, the async - IDL attribute must return true, and on setting, the - "force-async" flag must first be unset, and then the - content attribute must be removed if the IDL attribute's new value - is false, and must be set to the empty string if the IDL attribute's - new value is true. If the element's "force-async" flag - is not set, the IDL attribute must reflect the - async content attribute.

      +

      The async IDL attribute controls whether the + element will execute asynchronously or not. If the element's "force-async" flag is + set, then, on getting, the async IDL attribute must return + true, and on setting, the "force-async" flag must first be unset, and then the + content attribute must be removed if the IDL attribute's new value is false, and must be set to + the empty string if the IDL attribute's new value is true. If the element's + "force-async" flag is not set, the IDL attribute must reflect + the async content attribute.

      @@ -16877,35 +16690,32 @@

      4.3.1 The -

      Returns the contents of the element, ignoring child nodes that - aren't Text nodes.

      +

      Returns the contents of the element, ignoring child nodes that aren't Text + nodes.

      -

      Can be set, to replace the element's children with the given - value.

      +

      Can be set, to replace the element's children with the given value.

      The IDL attribute text must return a - concatenation of the contents of all the Text nodes - that are children of the script element (ignoring any - other nodes such as comments or elements), in tree order. On - setting, it must act the same way as the textContent - IDL attribute.

      + concatenation of the contents of all the Text nodes that are children of the + script element (ignoring any other nodes such as comments or elements), in tree + order. On setting, it must act the same way as the textContent IDL attribute.

      -

      When inserted using the document.write() method, - script elements execute (typically synchronously), but - when inserted using innerHTML and outerHTML attributes, they do not - execute at all.

      +

      When inserted using the document.write() + method, script elements execute (typically synchronously), but when inserted using + innerHTML and outerHTML + attributes, they do not execute at all.

      -

      In this example, two script elements are used. One - embeds an external script, and the other includes some data.

      +

      In this example, two script elements are used. One embeds an external script, and + the other includes some data.

      <script src="game-engine.js"></script>
       <script type="text/x-game-map">
      @@ -16915,22 +16725,19 @@ 

      4.3.1 The -

      The data in this case might be used by the script to generate - the map of a video game. The data doesn't have to be used that way, - though; maybe the map data is actually embedded in other parts of - the page's markup, and the data block here is just used by the - site's search engine to help users who are looking for particular - features in their game maps.

      +

      The data in this case might be used by the script to generate the map of a video game. The + data doesn't have to be used that way, though; maybe the map data is actually embedded in other + parts of the page's markup, and the data block here is just used by the site's search engine to + help users who are looking for particular features in their game maps.

      -

      The following sample shows how a script element can be used to - define a function that is then used by other parts of the - document. It also shows how a script element can be - used to invoke script while the document is being parsed, in this - case to initialize the form's output.

      +

      The following sample shows how a script element can be used to define a function that is then + used by other parts of the document. It also shows how a script element can be used + to invoke script while the document is being parsed, in this case to initialize the form's + output.

      <script>
        function calculate(form) {
      @@ -22502,15 +22309,13 @@ 

      4.6.21 The rubyGlobal attributes
      DOM interface:
      Uses HTMLElement.
      -

      The ruby element allows one or more spans of - phrasing content to be marked with ruby annotations. Ruby - annotations are short runs of text presented alongside base text, - primarily used in East Asian typography as a guide for - pronunciation or to include other annotations. In Japanese, this - form of typography is also known as furigana.

      +

      The ruby element allows one or more spans of phrasing content to be marked with + ruby annotations. Ruby annotations are short runs of text presented alongside base text, primarily + used in East Asian typography as a guide for pronunciation or to include other annotations. In + Japanese, this form of typography is also known as furigana.

      -

      The content model of ruby elements consists of one - or more of the following sequences:

      +

      The content model of ruby elements consists of one or more of the following + sequences:

      1. One or the other of the following:
        • Phrasing content, but with no ruby elements and with no ruby element descendants @@ -22518,16 +22323,14 @@

          4.6.21 The ruby
        • One or the other of the following:
          • One or more rt elements
          • An rp element followed by one or more rt elements, each of which is itself followed by an rp element -

      The ruby and rt elements can be used - for a variety of kinds of annotations, including in particular those - described below. For more details on Japanese Ruby in particular, - and how to render Ruby for Japanese, see Requirements for - Japanese Text Layout. [JLREQ]

      +

    The ruby and rt elements can be used for a variety of kinds of + annotations, including in particular those described below. For more details on Japanese Ruby in + particular, and how to render Ruby for Japanese, see Requirements for Japanese Text + Layout. [JLREQ]

    -

    At the time of writing, CSS does not yet provide a - way to fully control the rendering of the HTML ruby - element. It is hoped that CSS will be extended to support the styles - described below in due course.

    +

    At the time of writing, CSS does not yet provide a way to fully control the + rendering of the HTML ruby element. It is hoped that CSS will be extended to support + the styles described below in due course.

    @@ -22556,11 +22359,10 @@

    4.6.21 The ruby -

    This is similar to the previous case: each ideographic - character in the compound word (the base text) has its reading - given in hiragana or katakana characters (the ruby annotation). - The difference is that the base text segments form a compound word - rather than being separate from each other. +

    This is similar to the previous case: each ideographic character in the compound word (the + base text) has its reading given in hiragana or katakana characters (the ruby annotation). The + difference is that the base text segments form a compound word rather than being separate from + each other.

    <ruby>B<rt>annotation</rt>B<rt>annotation</ruby>
    @@ -22581,11 +22383,9 @@

    4.6.21 The ruby -

    This is semantically identical to the previous case (each - individual ideographic character in the base compound word has its - reading given in an annotation in hiragana or katakana - characters), but the rendering is the more complicated Jukugo Ruby - rendering. +

    This is semantically identical to the previous case (each individual ideographic character in + the base compound word has its reading given in an annotation in hiragana or katakana + characters), but the rendering is the more complicated Jukugo Ruby rendering.

    This is the same example as above for mono-ruby for compound words. The different rendering is expected to be achieved using different styling (e.g. in CSS), and is not shown here.

    @@ -22596,9 +22396,8 @@

    4.6.21 The ruby

    -

    For more details on Jukugo - Ruby rendering, see Appendix F in the Requirements for - Japanese Text Layout. [JLREQ]

    +

    For more details on Jukugo Ruby rendering, see + Appendix F in the Requirements for Japanese Text Layout. [JLREQ]

    @@ -22607,9 +22406,8 @@

    4.6.21 The ruby -

    The annotation describes the meaning of the base text, rather - than (or in addition to) the pronunciation. As such, both the base - text and the annotation can be multiple characters long. +

    The annotation describes the meaning of the base text, rather than (or in addition to) the + pronunciation. As such, both the base text and the annotation can be multiple characters long.

    <ruby>BASE<rt>annotation</ruby>
    @@ -22632,11 +22430,10 @@

    4.6.21 The ruby -

    A phonetic reading that corresponds to multiple base - characters, because a one-to-one mapping would be difficult. (In - English, the words "Colonel" and "Lieutenant" are examples of - words where a direct mapping of pronunciation to individual - letters is, in some dialects, rather unclear.) +

    A phonetic reading that corresponds to multiple base characters, because a one-to-one mapping + would be difficult. (In English, the words "Colonel" and "Lieutenant" are examples of words + where a direct mapping of pronunciation to individual letters is, in some dialects, rather + unclear.)

    In this example, the name of a species of flowers has a phonetic reading provided using group ruby: @@ -22674,48 +22471,38 @@

    4.6.21 The ruby -

    Within a ruby element that does not have a - ruby element ancestor, content is segmented and - segments are placed into three categories: base text segments, - annotation segments, and ignored segments. Ignored segments do not - form part of the document's semantics (they consist of some - inter-element whitespace and rp elements, - the latter of which are used for legacy user agents that do not - support ruby at all). Base text segments can overlap (with a limit - of two segments overlapping any one position in the DOM, and with - any segment having an earlier start point than an overlapping - segment also having an equal or later end point, and any segment - have a later end point than an overlapping segment also having an - equal or earlier start point). Annotation - segments correspond to rt elements. Each annotation - segment can be associated with a base text segment, and each base - text segment can have annotation segments associated with it. (In a - conforming document, each base text segment is associated with at - least one annotation segment, and each annotation segment is - associated with one base text segment.) A ruby element - represents the union of the segments of base text it - contains, along with the mapping from those base text segments to - annotation segments. Segments are described in terms of DOM ranges; - annotation segment ranges always consist of exactly one element. [DOMCORE]

    - -

    At any particular time, the segmentation and categorisation of - content of a ruby element is the result that would be - obtained from running the following algorithm:

    - -
    1. Let base text segments be an empty list - of base text segments, each potentially with a list of base text - subsegments.

    2. - -
    3. Let annotation segments be an empty list - of annotation segments, each potentially being associated with a - base text segment or subsegment.

    4. - -
    5. Let root be the ruby - element for which the algorithm is being run.

    6. - -
    7. If root has a ruby element - ancestor, then jump to the step labeled end.

    8. +

      Within a ruby element that does not have a ruby element ancestor, + content is segmented and segments are placed into three categories: base text segments, annotation + segments, and ignored segments. Ignored segments do not form part of the document's semantics + (they consist of some inter-element whitespace and rp elements, the + latter of which are used for legacy user agents that do not support ruby at all). Base text + segments can overlap (with a limit of two segments overlapping any one position in the DOM, and + with any segment having an earlier start point than an overlapping segment also having an equal or + later end point, and any segment have a later end point than an overlapping segment also having an + equal or earlier start point). Annotation segments correspond to rt elements. Each annotation + segment can be associated with a base text segment, and each base text segment can have annotation + segments associated with it. (In a conforming document, each base text segment is associated with + at least one annotation segment, and each annotation segment is associated with one base text + segment.) A ruby element represents the union of the segments of base + text it contains, along with the mapping from those base text segments to annotation segments. + Segments are described in terms of DOM ranges; annotation segment ranges always consist of exactly + one element. [DOM]

      + +

      At any particular time, the segmentation and categorisation of content of a ruby + element is the result that would be obtained from running the following algorithm:

      + +
      1. Let base text segments be an empty list of base text segments, each + potentially with a list of base text subsegments.

      2. + +
      3. Let annotation segments be an empty list of annotation segments, each + potentially being associated with a base text segment or subsegment.

      4. + +
      5. Let root be the ruby element for which the algorithm is + being run.

      6. + +
      7. If root has a ruby element ancestor, then jump to the + step labeled end.

      8. Let current parent be root.

      9. @@ -22728,165 +22515,153 @@

        4.6.21 The ruby

        Let current base text be null. - + -

      10. Start mode: If index is equal to - or greater than the number of child nodes in current - parent, then jump to the step labeled end mode.

        +
      11. Start mode: If index is equal to or greater than the number of + child nodes in current parent, then jump to the step labeled end + mode.

        -
      12. If the indexth node in current parent is an rt or - rp element, jump to the step labeled annotation +

      13. If the indexth node in current parent is an + rt or rp element, jump to the step labeled annotation mode.

      14. - +
      15. Set start index to the value of index.

      16. -
      17. Base mode: If the indexth node in - current parent is a ruby element, - and if current parent is the same element as - root, then push a ruby level and - then jump to the step labeled start mode.

      18. +
      19. Base mode: If the indexth node in current + parent is a ruby element, and if current parent is the + same element as root, then push a ruby level and then jump to + the step labeled start mode.

      20. -
      21. If the indexth node in current parent is an rt or - rp element, then set the current base - text and then jump to the step labeled annotation - mode.

      22. +
      23. If the indexth node in current parent is an + rt or rp element, then set the current base text and then + jump to the step labeled annotation mode.

      24. Increment index by one.

      25. -
      26. Base mode post-increment: If index is equal to or greater than the number of - child nodes in current parent, then jump to the - step labeled end mode.

      27. +
      28. Base mode post-increment: If index is equal to or greater than + the number of child nodes in current parent, then jump to the step labeled + end mode.

      29. Jump back to the step labeled base mode.

      30. -
      31. Annotation mode: If the indexth - node in current parent is an rt - element, then push a ruby annotation and jump to the - step labeled annotation mode increment.

      32. +
      33. Annotation mode: If the indexth node in current + parent is an rt element, then push a ruby annotation and jump to + the step labeled annotation mode increment.

      34. -
      35. If the indexth node in current parent is an rp element, jump - to the step labeled annotation mode increment.

      36. +
      37. If the indexth node in current parent is an + rp element, jump to the step labeled annotation mode increment.

      38. -
      39. If the indexth node in current parent is not a Text node, or - is a Text node that is not inter-element - whitespace, then jump to the step labeled base - mode.

      40. +
      41. If the indexth node in current parent is not a + Text node, or is a Text node that is not inter-element + whitespace, then jump to the step labeled base mode.

      42. -
      43. Annotation mode increment: Let lookahead index be index plus - one.

      44. +
      45. Annotation mode increment: Let lookahead index be index plus one.

      46. -
      47. Annotation mode white-space skipper: If lookahead index is equal to the number of child - nodes in current parent then jump to the step +

      48. Annotation mode white-space skipper: If lookahead index is + equal to the number of child nodes in current parent then jump to the step labeled end mode.

      49. -
      50. If the lookahead indexth node in current parent is an rt element or an - rp element, then set index to lookahead index and jump to the step labeled - annotation mode.

      51. +
      52. If the lookahead indexth node in current parent is + an rt element or an rp element, then set index to + lookahead index and jump to the step labeled annotation mode.

      53. -
      54. If the lookahead indexth node in current parent is not a Text node, or - is a Text node that is not inter-element - whitespace, then jump to the step labeled base mode - (without further incrementing index, so the - inter-element whitespace seen so far becomes part of - the next base text segment).

      55. +
      56. If the lookahead indexth node in current parent is + not a Text node, or is a Text node that is not inter-element + whitespace, then jump to the step labeled base mode (without further incrementing + index, so the inter-element whitespace seen so far becomes part + of the next base text segment).

      57. -
      58. Increment lookahead index by - one.

      59. +
      60. Increment lookahead index by one.

      61. -
      62. Jump to the step labeled annotation mode white-space - skipper.

      63. +
      64. Jump to the step labeled annotation mode white-space skipper.

      65. -
      66. End mode: If current parent is - not the same element as root, then pop a - ruby level and jump to the step labeled base mode +

      67. End mode: If current parent is not the same element as root, then pop a ruby level and jump to the step labeled base mode post-increment.

      68. -
      69. End: Return base text segments - and annotation segments. Any content of the - ruby element not described by segments in either of - thost lists is implicitly in an ignored segment.

      70. +
      71. End: Return base text segments and annotation + segments. Any content of the ruby element not described by segments in either + of thost lists is implicitly in an ignored segment.

      72. -

      When the steps above say to set the current base text, - it means to run the following steps at that point in the - algorithm:

      +

    When the steps above say to set the current base text, it means to run the following + steps at that point in the algorithm:

    -
    1. Let text range a DOM range whose start is the boundary point (current parent, start index) and - whose end is the boundary point (current parent, index).

    2. +
      1. Let text range a DOM range whose start is the boundary + point (current parent, start index) and whose + end is the boundary + point (current parent, index).

      2. -
      3. Let new text segment be a base text - segment described by the range annotation - range.

        +
      4. Let new text segment be a base text segment described by the range + annotation range.

        -
      5. Add new text segment to base text segments.

      6. +
      7. Add new text segment to base text + segments.

      8. -
      9. Let current base text be new text segment.

      10. +
      11. Let current base text be new text + segment.

      12. Let start index be null.

      13. -

      When the steps above say to push a ruby level, it - means to run the following steps at that point in the algorithm:

      +

    When the steps above say to push a ruby level, it means to run the following steps + at that point in the algorithm:

    -
    1. Let current parent be the indexth node in current - parent.

    2. +
      1. Let current parent be the indexth node in current parent.

      2. Let index be 0.

      3. -
      4. Set saved start index to the value of - start index.

      5. +
      6. Set saved start index to the value of start + index.

      7. Let start index be null.

      8. -

      When the steps above say to pop a ruby level, it means - to run the following steps at that point in the algorithm:

      +

    When the steps above say to pop a ruby level, it means to run the following steps at + that point in the algorithm:

    -
    1. Let index be the position of current parent in root.

    2. +
      1. Let index be the position of current parent in + root.

      2. Let current parent be root.

      3. Increment index by one.

      4. -
      5. Set start index to the value of - saved start index.

      6. +
      7. Set start index to the value of saved start + index.

      8. Let saved start index be null.

      9. -

      When the steps above say to push a ruby annotation, it - means to run the following steps at that point in the algorithm:

      +

    When the steps above say to push a ruby annotation, it means to run the following + steps at that point in the algorithm:

    -
    1. Let rt be the rt element - that is the indexth node of current parent.

    2. +
      1. Let rt be the rt element that is the indexth node of current parent.

      2. -
      3. Let annotation range a DOM range whose - start is the boundary point (current parent, index) and whose - end is the boundary point (current parent, index plus one) - (i.e. that contains only rt).

      4. +
      5. Let annotation range a DOM range whose start is the boundary + point (current parent, index) and whose end is the boundary point + (current parent, index plus one) (i.e. that contains only + rt).

      6. -
      7. Let new annotation segment be an - annotation segment described by the range annotation - range.

      8. +
      9. Let new annotation segment be an annotation segment described by the + range annotation range.

      10. -
      11. If current base text is not null, - associate new annotation segment with current base text.

      12. +
      13. If current base text is not null, associate new + annotation segment with current base text.

      14. -
      15. Add new annotation segment to annotation segments.

      16. +
      17. Add new annotation segment to annotation + segments.

      -

      In this example, each ideograph in the Japanese text 漢字 is annotated with its - reading in hiragana.

      +

      In this example, each ideograph in the Japanese text 漢字 is annotated with its reading in hiragana.

      ...
       <ruby>漢<rt>かん</rt>字<rt>じ</rt></ruby>
      @@ -22902,9 +22677,7 @@ 

      4.6.21 The ruby -

      In this example, each ideograph in the traditional Chinese text - 漢字 is annotated - with its bopomofo reading.

      +

      In this example, each ideograph in the traditional Chinese text 漢字 is annotated with its bopomofo reading.

      <ruby>漢<rt>ㄏㄢˋ</rt>字<rt>ㄗˋ</rt></ruby>
      @@ -22918,9 +22691,7 @@

      4.6.21 The ruby -

      In this example, each ideograph in the simplified Chinese text - 汉字 is annotated - with its pinyin reading.

      +

      In this example, each ideograph in the simplified Chinese text 汉字 is annotated with its pinyin reading.

      ...<ruby>汉<rt>hàn</rt>字<rt>zì</rt></ruby>...
      @@ -22934,11 +22705,10 @@

      4.6.21 The ruby -

      In this more contrived example, the acronym "HTML" has four - annotations: one for the whole acronym, briefly describing what it - is, one for the letters "HT" expanding them to "Hypertext", one for - the letter "M" expanding it to "Markup", and one for the letter "L" - expanding it to "Language".

      +

      In this more contrived example, the acronym "HTML" has four annotations: one for the whole + acronym, briefly describing what it is, one for the letters "HT" expanding them to "Hypertext", + one for the letter "M" expanding it to "Markup", and one for the letter "L" expanding it to + "Language".

      <ruby>
        <ruby>HT<rt>Hypertext</rt>M<rt>Markup</rt>L<rt>Language</rt></ruby>
      @@ -24841,21 +24611,17 @@ 

      4.8.1 The img<
    3. The img element is completely available.

      Otherwise, the attribute must return false.

      -

      The value of complete can thus change while a - script is executing.

      +

      The value of complete can thus change while + a script is executing.

      -

      Three constructors are provided for creating - HTMLImageElement objects (in addition to the factory - methods from DOM Core such as createElement()): Image(), Image(width), and Image(width, height). When invoked as constructors, - these must return a new HTMLImageElement object (a new - img element). If the width argument - is present, the new object's width content attribute must be set to - width. If the height - argument is also present, the new object's height content attribute must be set - to height. The element's document must be the - active document of the browsing context of - the Window object on which the interface object of the - invoked constructor is found.

      +

      Three constructors are provided for creating HTMLImageElement objects (in addition + to the factory methods from DOM such as createElement()): Image(), Image(width), and Image(width, height). When invoked as constructors, + these must return a new HTMLImageElement object (a new img element). If + the width argument is present, the new object's width content attribute must be set to width. If + the height argument is also present, the new object's height content attribute must be set to height. + The element's document must be the active document of the browsing + context of the Window object on which the interface object of the invoked + constructor is found.

    4. @@ -26480,6 +26246,9 @@

      4.8.2 The iframe +
    5. The nested browsing context's Window object's + cross-boundary event parent is the browsing context container. [DOM]

    6. +

      If the attribute is not specified, or if the origin conditions listed above are not met, then the user agent should render the nested browsing context in a manner that is clearly distinguishable as a separate browsing context, and the @@ -28085,19 +27854,15 @@

      4.8.7 The
      -

      Two constructors are provided for creating - HTMLAudioElement objects (in addition to the factory - methods from DOM Core such as createElement()): Audio() and Audio(src). When invoked as constructors, - these must return a new HTMLAudioElement object (a new - audio element). The element must have its preload attribute set to the - literal value "auto". If the src argument is present, the object created must have - its src content attribute set to - the provided value, and the user agent must invoke the object's - resource selection - algorithm before returning. The element's document must be - the active document of the browsing - context of the Window object on which the - interface object of the invoked constructor is found.

      +

      Two constructors are provided for creating HTMLAudioElement objects (in addition + to the factory methods from DOM such as createElement()): Audio() and Audio(src). When invoked as constructors, these must return a new + HTMLAudioElement object (a new audio element). The element must have its + preload attribute set to the literal value "auto". If the src argument is present, + the object created must have its src content attribute set to + the provided value, and the user agent must invoke the object's resource selection algorithm before returning. The + element's document must be the active document of the browsing context + of the Window object on which the interface object of the invoked constructor is + found.

      @@ -34692,7 +34457,7 @@

      4.8.11 The fallback content. (Focus has no effect on mouse interaction events.) - [DOMEVENTS]

      + [DOMEVENTS]


      The canvas element has two attributes to control the size of the coordinate space: width and height. These attributes, when specified, must have @@ -52452,67 +52217,52 @@

      4.10.12 The option
      -

      The disabled - IDL attribute must reflect the content attribute of the - same name. The defaultSelected - IDL attribute must reflect the selected content attribute.

      - -

      The label IDL - attribute, on getting, must return the element's label. On setting, the element's - label content attribute must - be set to the new value.

      - -

      The value IDL - attribute, on getting, must return the element's value. On setting, the element's - value content attribute must - be set to the new value.

      - -

      The selected - IDL attribute, on getting, must return true if the element's selectedness is true, and - false otherwise. On setting, it must set the element's selectedness to the new - value, and then cause the element to ask for a reset.

      - -

      The index IDL - attribute must return the element's index.

      - -

      The text IDL - attribute, on getting, must return the value of the - textContent IDL attribute on the element, with leading and trailing - whitespace stripped, and with any sequences of two or more - space characters replaced by a - single U+0020 SPACE character. On setting, it must act as if the - textContent IDL attribute on the element had been set - to the new value.

      - -

      The form IDL - attribute's behavior depends on whether the option - element is in a select element or not. If the - option has a select element as its parent, - or has an optgroup element as its parent and that - optgroup element has a select element as - its parent, then the form IDL - attribute must return the same value as the form IDL attribute on that - select element. Otherwise, it must return null.

      - -

      Several constructors are provided for creating - HTMLOptionElement objects (in addition to the factory - methods from DOM Core such as createElement()): Option(), Option(text), Option(text, value), Option(text, value, defaultSelected), and Option(text, value, defaultSelected, selected). When invoked as constructors, - these must return a new HTMLOptionElement object (a new - option element). If the text - argument is present, the new object must have as its only child a - Text node whose data is the value of that argument. If - the value argument is present, the new object - must have a value attribute - set with the value of the argument as its value. If the defaultSelected argument is present and true, the new - object must have a selected attribute set with no - value. If the selected argument is present and - true, the new object must have its selectedness set to true; - otherwise the fourth argument is absent or false, and the selectedness must be set - to false, even if the defaultSelected argument - is present and true. The element's document must be the active - document of the browsing context of the - Window object on which the interface object of the - invoked constructor is found.

      +

      The disabled IDL attribute must + reflect the content attribute of the same name. The defaultSelected IDL attribute must + reflect the selected content attribute.

      + +

      The label IDL attribute, on getting, must + return the element's label. On setting, the element's + label content attribute must be set to the new value.

      + +

      The value IDL attribute, on getting, must + return the element's value. On setting, the element's + value content attribute must be set to the new value.

      + +

      The selected IDL attribute, on getting, + must return true if the element's selectedness is + true, and false otherwise. On setting, it must set the element's selectedness to the new value, and then cause the + element to ask for a reset.

      + +

      The index IDL attribute must return the + element's index.

      + +

      The text IDL attribute, on getting, must return + the value of the textContent IDL attribute on the element, with leading and trailing whitespace stripped, and with any + sequences of two or more space characters replaced by a + single U+0020 SPACE character. On setting, it must act as if the textContent IDL + attribute on the element had been set to the new value.

      + +

      The form IDL attribute's behavior depends on + whether the option element is in a select element or not. If the + option has a select element as its parent, or has an + optgroup element as its parent and that optgroup element has a + select element as its parent, then the form IDL + attribute must return the same value as the form IDL attribute + on that select element. Otherwise, it must return null.

      + +

      Several constructors are provided for creating HTMLOptionElement objects (in + addition to the factory methods from DOM such as createElement()): Option(), Option(text), Option(text, value), Option(text, value, defaultSelected), and Option(text, value, defaultSelected, selected). When invoked as constructors, these must return a new + HTMLOptionElement object (a new option element). If the text argument is present, the new object must have as its only child a + Text node whose data is the value of that argument. If the value + argument is present, the new object must have a value + attribute set with the value of the argument as its value. If the defaultSelected argument is present and true, the new object must have a selected attribute set with no value. If the selected argument is present and true, the new object must have its selectedness set to true; otherwise the fourth argument + is absent or false, and the selectedness must be + set to false, even if the defaultSelected argument is present and true. The + element's document must be the active document of the browsing context + of the Window object on which the interface object of the invoked constructor is + found.

      @@ -69441,7 +69191,7 @@

      6.6.3 Page load

      When faced with displaying an XML file inline, user agents must first create a Document object, following the requirements of the XML and Namespaces in XML - recommendations, RFC 3023, DOM Core, and other relevant specifications. [XML] [XMLNS] [RFC3023] [DOMCORE]

      + recommendations, RFC 3023, DOM, and other relevant specifications. [XML] [XMLNS] [RFC3023] [DOM]

      The actual HTTP headers and other metadata, not the headers as mutated or implied by the algorithms given in this specification, are the ones that must be used when determining the @@ -73421,6 +73171,7 @@

      7.1.4.3 Generic task source tasks queued with the user interaction task source. [DOMEVENTS]

      + @@ -73599,104 +73350,86 @@
      7.1.6.1 Event handlers< -

      Many objects can have event handlers specified. These - act as non-capture event listeners for the object on which they are - specified. [DOMCORE]

      +

      Many objects can have event handlers specified. These act as non-capture event + listeners for the object on which they are specified. [DOM]

      -

      An event handler can either - have the value null or be set to a callback object. This is defined - using the EventHandler callback interface type. Initially, event handlers must be set to - null.

      +

      An event handler can either have the value null or be set + to a callback object. This is defined using the EventHandler callback interface type. + Initially, event handlers must be set to null.

      Event handlers are exposed in one of two ways.

      -

      The first way, common to all event handlers, is as an event handler IDL - attribute.

      +

      The first way, common to all event handlers, is as an event handler IDL attribute.

      -

      The second way is as an event handler content attribute. Event handlers - on HTML elements and some of the event handlers on +

      The second way is as an event handler content + attribute. Event handlers on HTML elements and some of the event handlers on Window objects are exposed in this way.

      -

      Event handler IDL attributes, on setting, must set the - corresponding event handler to their new value, and on - getting, must return whatever the current value of the corresponding +


      Event handler IDL attributes, on setting, must set the corresponding event handler + to their new value, and on getting, must return whatever the current value of the corresponding event handler is (possibly null).

      -

      If an event handler - IDL attribute exposes an event - handler of an object that doesn't exist, it must always +

      If an event handler IDL attribute exposes an + event handler of an object that doesn't exist, it must always return null on getting and must do nothing on setting.

      -

      This can happen in particular for event handler IDL attribute on - body elements that do not have corresponding +

      This can happen in particular for event + handler IDL attribute on body elements that do not have corresponding Window objects.

      -

      Certain event handler IDL attributes have additional - requirements, in particular the onmessage attribute of +

      Certain event handler IDL attributes have additional requirements, in particular + the onmessage attribute of MessagePort objects.

      -

      On getting, event handler IDL attributes must return - the value of their corresponding event handlers, except when the - value is an internal error - value, in which case the user agent must set the corresponding - event handler to null, and then throw an exception corresponding to - the error condition.

      +

      On getting, event handler IDL attributes must return the value of their + corresponding event handlers, except when the value is an internal error value, in which case the user agent must set + the corresponding event handler to null, and then throw an exception corresponding to the error + condition.


      -

      Event handler content attributes, when specified, must - contain valid JavaScript code which, when parsed, would match the - FunctionBody production after automatic +

      Event handler content attributes, when specified, must contain valid JavaScript code + which, when parsed, would match the FunctionBody production after automatic semicolon insertion. [ECMA262]

      -

      When an event - handler content attribute is set, if the element is owned by - a Document that is in a browsing context, - and scripting is enabled for - that browsing context, the user agent must run the - following steps to create a script after setting the content - attribute to its new value:

      - -
      1. Set the corresponding event - handler to null.

      2. - -
      3. Set up a script execution environment for - JavaScript.

      4. +

        When an event handler content attribute + is set, if the element is owned by a Document that is in a browsing + context, and scripting is enabled for that + browsing context, the user agent must run the following steps to create a script after setting the content attribute to its new value:

        + +
        1. Set the corresponding event handler to null.

        2. + +
        3. Set up a script execution environment for JavaScript.

        4. -
        5. Let body be the event handler content - attribute's new value.

        6. +
        7. Let body be the event + handler content attribute's new value.

        8. -

          If body is not parsable as - FunctionBody or if parsing detects an early error - then set the event handler content attribute to an - error as defined below, and abort these steps.

          +

          If body is not parsable as FunctionBody or if parsing detects an + early error then set the event handler content attribute to an error as + defined below, and abort these steps.

          -

          FunctionBody is defined in ECMAScript - edition 5 section 13 Function Definition. Early error is - defined in ECMAScript edition 5 section 16 Errors. [ECMA262]

          +

          FunctionBody is defined in ECMAScript edition 5 section 13 Function + Definition. Early error is defined in ECMAScript edition 5 section 16 Errors. [ECMA262]

        9. -

          If body begins with a Directive Prologue - that contains a Use Strict Directive then let strict be true, otherwise let strict be false.

          +

          If body begins with a Directive Prologue that contains a Use Strict + Directive then let strict be true, otherwise let strict + be false.

          -

          The terms "Directive Prologue" and "Use Strict - Directive" are defined in ECMAScript edition 5 section 14.1 - Directive Prologues and the Use Strict Directive. [ECMA262]

          +

          The terms "Directive Prologue" and "Use Strict Directive" are defined in + ECMAScript edition 5 section 14.1 Directive Prologues and the Use Strict Directive. [ECMA262]

        10. @@ -73704,31 +73437,27 @@
          7.1.6.1 Event handlers< currently this is unnecessary: http://www.w3.org/Bugs/Public/show_bug.cgi?id=11977#c4
        11. -

          If strict is true, and anything in body is a SyntaxError according to the - Strict Mode Restrictions, then set the event handler content - attribute to an error as defined below, and abort these - steps.

          +

          If strict is true, and anything in body is a + SyntaxError according to the Strict Mode Restrictions, then set the event + handler content attribute to an error as defined below, and abort these steps.

          -

          The Strict Mode Restrictions are those listed in - ECMAScript edition 5 section 13.1 Strict Mode Restrictions. [ECMA262]

          +

          The Strict Mode Restrictions are those listed in ECMAScript edition 5 section + 13.1 Strict Mode Restrictions. [ECMA262]

        12. -->
        13. -

          Using the script execution environment created above, create a - function object (as defined in ECMAScript edition 5 section 13.2 - Creating Function Objects), with:

          +

          Using the script execution environment created above, create a function object (as defined in + ECMAScript edition 5 section 13.2 Creating Function Objects), with:

          Parameter list FormalParameterList
          -
          If the attribute is the onerror attribute of the - Window object
          +
          If the attribute is the onerror attribute of + the Window object
          Let the function have four arguments, named event, source, lineno, and column.
          @@ -73747,18 +73476,17 @@
          7.1.6.1 Event handlers<
          -
          1. Let Scope be the result of - NewObjectEnvironment(the element's Document, the - global environment).
          2. +
            1. Let Scope be the result of NewObjectEnvironment(the element's + Document, the global environment).
            2. -
            3. If the element has a form owner, let Scope be the result of NewObjectEnvironment(the - element's form owner, Scope).
            4. +
            5. If the element has a form owner, let Scope be the result + of NewObjectEnvironment(the element's form owner, Scope).
            6. -
            7. Let Scope be the result of - NewObjectEnvironment(the element's object, Scope).
            8. +
            9. Let Scope be the result of NewObjectEnvironment(the element's object, + Scope).
            10. -

            NewObjectEnvironment() is defined in ECMAScript - edition 5 section 10.2.2.3 NewObjectEnvironment (O, E). [ECMA262]

            +

          NewObjectEnvironment() is defined in ECMAScript edition 5 section 10.2.2.3 + NewObjectEnvironment (O, E). [ECMA262]

          @@ -73766,35 +73494,29 @@
          7.1.6.1 Event handlers<
          The value of strict.
          -

          Let this new function be the only entry in the script's - list of code entry-points.

          +

          Let this new function be the only entry in the script's list of code + entry-points.

        14. -
        15. Set up the script's global object, the - script's browsing context, the script's - document, the script's referrer source, the - script's URL character encoding, and the - script's base URL from the script settings - determined from the node on which the attribute is being +

        16. Set up the script's global object, the script's browsing + context, the script's document, the script's referrer source, + the script's URL character encoding, and the script's base URL from + the script settings determined from the node on which the attribute is being set.

        17. -
        18. Set the corresponding event - handler to the aforementioned function.

        19. - -

        When a user agent is required, by the steps above, to set - the event handler content attribute to an error, the user - agent must set the corresponding event - handler to an internal - error value representing the error condition, keeping track of - the URL of the resource where the event handler content attribute - was set, and the relevant line number inside that resource where the - error occurred.

        - -

        When an event handler content attribute is removed, the user - agent must set the corresponding event - handler to null.

        +
      5. Set the corresponding event handler to the + aforementioned function.

      6. + +

      When a user agent is required, by the steps above, to set the event handler content + attribute to an error, the user agent must set the corresponding event handler to an internal error value + representing the error condition, keeping track of the URL of the resource where the + event handler content attribute was set, and + the relevant line number inside that resource where the error occurred.

      + +

      When an event handler content attribute is removed, the user agent must set the corresponding + event handler to null.

      -

      When an event handler H of an element or object T - implementing the EventTarget interface is first set to - a non-null value, the user agent must append an event listener to the list of - event listeners - associated with T with type set to the - event handler event type corresponding to H, capture set to false, and listener - set to the event handler processing algorithm defined - below. [DOMCORE]

      - -

      The listener is emphatically not the - event handler itself. Every - event handler ends up registering the same listener, the - algorithm defined below, which takes care of invoking the right - callback, and processing the callback's return value.

      - -

      This only happens the first time the event handler's value is set. Since - listeners are called in the order they were registered, the order of - event listeners for a particular event type will always be first the - event listeners registered with addEventListener() - before the first time the event - handler was set to a non-null value, then the callback to - which it is currently set, if any, and finally the event listeners - registered with addEventListener() - after the first time the event - handler was set to a non-null value.

      +

      When an event handler H of an element + or object T implementing the EventTarget interface is first set + to a non-null value, the user agent must append an event + listener to the list of event listeners + associated with T with type set to the event handler event + type corresponding to H, capture set to false, and + listener set to the event handler processing algorithm defined below. [DOM]

      + +

      The listener is emphatically not the event handler itself. Every event handler ends up registering the same + listener, the algorithm defined below, which takes care of invoking the right callback, and + processing the callback's return value.

      + +

      This only happens the first time the event + handler's value is set. Since listeners are called in the order they were registered, the + order of event listeners for a particular event type will always be first the event listeners + registered with addEventListener() before + the first time the event handler was set to a non-null value, + then the callback to which it is currently set, if any, and finally the event listeners registered + with addEventListener() after the + first time the event handler was set to a non-null value.

      -

      This example demonstrates the order in which event listeners are - invoked. If the button in this example is clicked by the user, the - page will show four alerts, with the text "ONE", "TWO", "THREE", - and "FOUR" respectively.

      +

      This example demonstrates the order in which event listeners are invoked. If the button in + this example is clicked by the user, the page will show four alerts, with the text "ONE", "TWO", + "THREE", and "FOUR" respectively.

      <button id="test">Start Demo</button>
       <script>
      @@ -73862,15 +73577,13 @@ 
      7.1.6.1 Event handlers<
      -

      The interfaces implemented by the event object do - not influence whether an event - handler is triggered or not.

      +

      The interfaces implemented by the event object do not influence whether an event handler is triggered or not.

      -

      The event handler processing algorithm for an - event handler H and an Event object E is as follows:

      +

      The event handler processing algorithm for an event + handler H and an Event object E is as + follows:

      -
      1. If H's value is null, then abort these - steps.

      2. +
        1. If H's value is null, then abort these steps.

        2. If H's value is an internal error value, then set the event handler to null and then @@ -73880,14 +73593,11 @@

          7.1.6.1 Event handlers< handlers">event handler of the Window object of that Document, and abort these steps.
        3. -
        4. Let callback be H's - value, the callback that the event - handler was last set to.

        5. +
        6. Let callback be H's value, the callback that the + event handler was last set to.

        7. -
        8. Invoke callback with one - argument, the value of which is the Event object E, with the callback this value set to - E's currentTarget. Let the - return value be return value. [WEBIDL]

        9. +
        10. Invoke callback with one argument, the value of which is the + Event object E, with the callback this value set to E's currentTarget. Let the return value be return value. [WEBIDL]

        11. @@ -73895,21 +73605,19 @@
          7.1.6.1 Event handlers<
          If the event type is mouseover
          -

          If return value is a boolean with the - value true, then cancel the event.

          +

          If return value is a boolean with the value true, then cancel the + event.

          -
          If the Event object E is a - BeforeUnloadEvent object
          +
          If the Event object E is a BeforeUnloadEvent + object
          -

          If return value is a string, and the - Event object E's returnValue - attribute's value is the empty string, then set the returnValue - attribute's value to return value.

          +

          If return value is a string, and the Event object E's returnValue + attribute's value is the empty string, then set the returnValue attribute's value to return value.

          Otherwise
          -

          If return value is a boolean with the - value false, then cancel the event.

          +

          If return value is a boolean with the value false, then cancel the + event.

          @@ -73917,16 +73625,14 @@
          7.1.6.1 Event handlers<
      -

      The EventHandler interface represents a callback - used for event handlers. It is represented in Web IDL as - follows:

      +

      The EventHandler interface represents a callback used for event handlers. It is + represented in Web IDL as follows:

      [TreatNonCallableAsNull]
       callback EventHandlerNonNull = any (Event event);
       typedef EventHandlerNonNull? EventHandler;
      -

      In JavaScript, any Function object - implements this interface.

      +

      In JavaScript, any Function object implements this interface.

      @@ -73934,19 +73640,17 @@
      7.1.6.1 Event handlers<
      <body onload="alert(this)" onclick="alert(this)">
      -

      ...leads to an alert saying "[object Window]" when the document is loaded, - and an alert saying "[object HTMLBodyElement]" whenever the user - clicks something in the page.

      +

      ...leads to an alert saying "[object Window]" when the document is + loaded, and an alert saying "[object HTMLBodyElement]" whenever the + user clicks something in the page.

      -

      The return value of the function affects whether the - event is canceled or not: as described - above, if the return value is false, the event is canceled - (except for mouseover events, - where the return value has to be true to cancel the event). With - beforeunload events, the - value is instead used to determine the message to show the user.

      +

      The return value of the function affects whether the event is canceled or not: + as described above, if the return value is false, the event is canceled + (except for mouseover events, where the return value has to + be true to cancel the event). With beforeunload events, + the value is instead used to determine the message to show the user.

      For historical reasons, the onerror handler has different arguments:

      @@ -73960,12 +73664,10 @@
      7.1.6.1 Event handlers<
      7.1.6.2 Event handlers on elements, Document objects, and Window objects
      -

      The following are the event handlers (and their - corresponding event handler - event types) that must be supported - by all HTML elements, as both content attributes and - IDL attributes, and on Document and Window - objects, as IDL attributes.

      +

      The following are the event handlers (and their corresponding event handler event types) that must be + supported by all HTML elements, as both content attributes and IDL attributes, and on + Document and Window objects, as IDL attributes.

      Event handler Event handler event type
      onabort abort @@ -74122,12 +73824,15 @@
      7.1.6.3 Event firing
      7.1.6.4 Events and the Window object
      -

      When an event is dispatched at a DOM node in a - Document in a browsing context, if the - event is not a load event, the user - agent must act as if, for the purposes of event dispatching, the - Window object is the parent of the - Document object. [DOMCORE]

      +

      When an event is dispatched at a DOM node in a Document in a browsing + context, if the event is not a load event, the user agent + must act as if, for the purposes of event dispatching, + the Window object is the parent of the Document object. [DOM]

      + + @@ -82211,9 +81916,9 @@

      9.3 APIs available to WorkerUtils implements WindowBase64; -

      The DOM APIs — specifically, all the interfaces defind in the DOM Core specification - other than exceptions — must not be exposed if the - JavaScript global environment is a worker environment. [DOMCORE]

      +

      The DOM APIs — specifically, all the interfaces defind in the DOM specification other + than exceptions — must not be exposed if the JavaScript + global environment is a worker environment. [DOMCORE]

      9.3.1 Importing scripts and libraries

      @@ -90625,7 +90330,7 @@

      12.2.5 Tree construction<

      DOM mutation events must not fire for changes caused by the UA parsing the document. This includes the parsing of any content inserted using document.write() and document.writeln() calls. [DOMEVENTS]

      -

      However, mutation observers do fire, as required by the DOM Core specification.

      +

      However, mutation observers do fire, as required by the DOM specification.

      Not all of the tag names mentioned below are conformant tag names in this specification; many are included to @@ -95322,42 +95027,37 @@

      13.1 Writing XHTML docum

      13.2 Parsing XHTML documents

      -

      This section describes the relationship between XML and the DOM, - with a particular emphasis on how this interacts with HTML.

      +

      This section describes the relationship between XML and the DOM, with a particular emphasis on + how this interacts with HTML.

      -

      An XML parser, for the purposes of this specification, - is a construct that follows the rules given in the XML specification - to map a string of bytes or characters into a Document - object.

      +

      An XML parser, for the purposes of this specification, is a construct that follows + the rules given in the XML specification to map a string of bytes or characters into a + Document object.

      -

      An XML parser is either associated with a - Document object when it is created, or creates one - implicitly.

      +

      An XML parser is either associated with a Document object when it is + created, or creates one implicitly.

      This Document must then be populated with DOM nodes that represent the tree structure of the input passed to the parser, as defined by the XML specification, the Namespaces - in XML specification, and the DOM Core specification. DOM mutation events must not fire for the + in XML specification, and the DOM specification. DOM mutation events must not fire for the operations that the XML parser performs on the Document's tree, but the user agent must act as if elements and attributes were individually appended and set respectively so as to trigger rules in this specification regarding what happens when an element is inserted - into a document or has its attributes set, and the DOM Core specification's requirements regarding - mutation observers mean that mutation observers are fired (unlike mutation events). [XML] [XMLNS] [DOMCORE] [DOMEVENTS]

      + into a document or has its attributes set, and the DOM specification's requirements regarding + mutation observers mean that mutation observers are fired (unlike mutation events). [XML] [XMLNS] [DOM] [DOMEVENTS]

      -

      Between the time an element's start tag is parsed and the time - either the element's end tag is parsed or the parser detects a - well-formedness error, the user agent must act as if the element was - in a stack of open elements.

      +

      Between the time an element's start tag is parsed and the time either the element's end tag is + parsed or the parser detects a well-formedness error, the user agent must act as if the element + was in a stack of open elements.

      -

      This is used by the object element to - avoid instantiating plugins before the param element - children have been parsed.

      +

      This is used by the object element to avoid instantiating plugins + before the param element children have been parsed.

      -

      This specification provides the following additional information - that user agents should use when retrieving an external entity: the - public identifiers given in the following list all correspond to the URL given by this - link. (This URL is a DTD containing the entity reference - declarations for the names listed in the named character - references section.)

      +

      This specification provides the following additional information that user agents should use + when retrieving an external entity: the public identifiers given in the following list all + correspond to the URL given by this link. (This + URL is a DTD containing the entity reference declarations for the names listed in the named + character references section.)

      • -//W3C//DTD XHTML 1.0 Transitional//EN
      • -//W3C//DTD XHTML 1.1//EN
      • @@ -95539,23 +95239,19 @@

        13.4 Parsing XHTML fragm
      • -

        If there is a context element, - feed the parser just created the string corresponding - to the start tag of that element, declaring all the namespace - prefixes that are in scope on that element in the DOM, as well as - declaring the default namespace (if any) that is in scope on that - element in the DOM.

        +

        If there is a context element, feed the + parser just created the string corresponding to the start tag of that element, declaring + all the namespace prefixes that are in scope on that element in the DOM, as well as declaring + the default namespace (if any) that is in scope on that element in the DOM.

        -

        A namespace prefix is in scope if the DOM Core lookupNamespaceURI() method on the element would - return a non-null value for that prefix.

        +

        A namespace prefix is in scope if the DOM lookupNamespaceURI() method + on the element would return a non-null value for that prefix.

        -

        The default namespace is the namespace for which the DOM Core - isDefaultNamespace() method on the element - would return true.

        +

        The default namespace is the namespace for which the DOM isDefaultNamespace() method on the element would return true.

        -

        If there is a context element, no DOCTYPE is passed to the parser, and therefore no - external subset is referenced, and therefore no entities will be - recognized.

        +

        If there is a context element, no + DOCTYPE is passed to the parser, and therefore no external subset is + referenced, and therefore no entities will be recognized.

      • @@ -98676,7 +98372,7 @@

        15.2 Non-conforming feat
        event on script elements
        for on script elements
        -

        Use DOM Events mechanisms to register event listeners. [DOMCORE]

        +

        Use DOM Events mechanisms to register event listeners. [DOM]

        datapagesize on table elements

        Unnecessary. Omit it altogether.

        @@ -103917,14 +103613,14 @@

        References

        [DASH]
        Dynamic adaptive streaming over HTTP (DASH). ISO.
        -
        [DOMCORE]
        -
        Web DOM Core, A. van Kesteren. WHATWG.
        +
        [DOM]
        +
        DOM, A. van Kesteren, A. Gregor, Ms2ger. WHATWG.
        [DOMEVENTS]
        Document Object Model (DOM) Level 3 Events Specification, T. Leithead, J. Rossi, D. Schepers, B. Höhrmann, P. Le Hégaret, T. Pixley. W3C.
        [DOMPARSING]
        -
        DOM Parsing and Serialization, Ms2ger. html5.org.
        +
        DOM Parsing and Serialization, Ms2ger. WHATWG.
        [DOT]
        (Non-normative) The DOT Language. Graphviz.
        @@ -103939,7 +103635,7 @@

        References

        (Non-normative) ECMAScript for XML (E4X) Specification. ECMA.
        [EDITING]
        -
        HTML Editing APIs, A. Gregor.
        +
        HTML Editing APIs, A. Gregor. W3C Editing APIs CG.
        [EUCKR]
        Hangul Unix Environment. Korea Industrial Standards Association. Ref. No. KS C 5861-1992.
        diff --git a/index b/index index 2f7675500b3..e56925adfc3 100644 --- a/index +++ b/index @@ -387,8 +387,7 @@
      • 2.8.4 DOMElementMap
      • 2.8.5 Transferable objects
      • 2.8.6 Safe passing of structured data
      • -
      • 2.8.7 DOM feature strings
      • -
      • 2.8.8 Garbage collection
      • +
      • 2.8.7 Garbage collection
      • 2.9 Namespaces
      • 3 Semantics, structure, and APIs of HTML documents
          @@ -1398,7 +1397,7 @@ relative to other specifications can be best summed up as follows:

          -

          It consists of everything else, above such core technologies as HTTP, URI/IRIs, DOM Core, XML, Unicode, and ECMAScript; below presentation-layer technologies like CSS, XBL, and the NPAPI; and to the side of technologies like Geolocation, SVG, MathML, and XHR.

          +

          It consists of everything else, above such core technologies as HTTP, URI/IRIs, DOM, XML, Unicode, and ECMAScript; below presentation-layer technologies like CSS, XBL, and the NPAPI; and to the side of technologies like Geolocation, SVG, MathML, and XHR.

          @@ -1679,23 +1678,21 @@

          This section is non-normative.

          -

          This specification is intended for authors of documents and - scripts that use the features defined in this specification, implementors of tools that operate on pages that use - the features defined in this specification, and individuals wishing - to establish the correctness of documents or implementations with - respect to the requirements of this specification.

          +

          This specification is intended for authors of documents and scripts that use the features + defined in this specification, implementors of tools that operate on pages that + use the features defined in this specification, and individuals wishing to establish the + correctness of documents or implementations with respect to the requirements of this + specification.

          -

          This document is probably not suited to readers who do not - already have at least a passing familiarity with Web technologies, - as in places it sacrifices clarity for precision, and brevity for - completeness. More approachable tutorials and authoring guides can - provide a gentler introduction to the topic.

          +

          This document is probably not suited to readers who do not already have at least a passing + familiarity with Web technologies, as in places it sacrifices clarity for precision, and brevity + for completeness. More approachable tutorials and authoring guides can provide a gentler + introduction to the topic.

          -

          In particular, familiarity with the basics of DOM Core and DOM - Events is necessary for a complete understanding of some of the more - technical parts of this specification. An understanding of Web IDL, - HTTP, XML, Unicode, character encodings, JavaScript, and CSS will - also be helpful in places but is not essential.

          +

          In particular, familiarity with the basics of DOM is necessary for a complete understanding of + some of the more technical parts of this specification. An understanding of Web IDL, HTTP, XML, + Unicode, character encodings, JavaScript, and CSS will also be helpful in places but is not + essential.

          1.5 Scope

          @@ -3199,67 +3196,53 @@ a.setAttribute('href', 'http://example.com/'); // change the content attribute d

          2.1 Terminology

          -

          This specification refers to both HTML and XML attributes and IDL - attributes, often in the same context. When it is not clear which is - being referred to, they are referred to as content - attributes for HTML and XML attributes, and IDL - attributes for those defined on IDL interfaces. Similarly, the - term "properties" is used for both JavaScript object properties and - CSS properties. When these are ambiguous they are qualified as object properties and CSS - properties respectively.

          - -

          Generally, when the specification states that a feature applies - to the HTML syntax or the XHTML syntax, it - also includes the other. When a feature specifically only applies to - one of the two languages, it is called out by explicitly stating - that it does not apply to the other format, as in "for HTML, - ... (this does not apply to XHTML)".

          - -

          This specification uses the term document to - refer to any use of HTML, ranging from short static documents to - long essays or reports with rich multimedia, as well as to - fully-fledged interactive applications. The term is used to refer - both to Document objects and their descendant DOM - trees, and to serialized byte streams using the HTML syntax or XHTML syntax, depending on context.

          - -

          In the context of the DOM structures, the terms HTML document and XML - document are used as defined in the DOM Core specification, - and refer specifically to two different modes that - Document objects can find themselves in. [DOMCORE] (Such uses are always hyperlinked - to their definition.)

          - -

          In the context of byte streams, the term HTML document refers to - resources labeled as text/html, and the term XML - document refers to resources labeled with an XML MIME - type.

          - -

          The term XHTML document is used to refer to both - Documents in the XML - document mode that contains element nodes in the HTML - namespace, and byte streams labeled with an XML MIME - type that contain elements from the HTML - namespace, depending on context.

          - -

          For simplicity, terms such as shown, displayed, and visible might - sometimes be used when referring to the way a document is rendered - to the user. These terms are not meant to imply a visual medium; - they must be considered to apply to other media in equivalent - ways.

          +

          This specification refers to both HTML and XML attributes and IDL attributes, often in the same + context. When it is not clear which is being referred to, they are referred to as content attributes for HTML and XML attributes, and IDL + attributes for those defined on IDL interfaces. Similarly, the term "properties" is used for + both JavaScript object properties and CSS properties. When these are ambiguous they are qualified + as object properties and CSS properties respectively.

          + +

          Generally, when the specification states that a feature applies to the HTML syntax + or the XHTML syntax, it also includes the other. When a feature specifically only + applies to one of the two languages, it is called out by explicitly stating that it does not apply + to the other format, as in "for HTML, ... (this does not apply to XHTML)".

          + +

          This specification uses the term document to refer to any use of HTML, + ranging from short static documents to long essays or reports with rich multimedia, as well as to + fully-fledged interactive applications. The term is used to refer both to Document + objects and their descendant DOM trees, and to serialized byte streams using the HTML syntax or XHTML syntax, depending + on context.

          + +

          In the context of the DOM structures, the terms HTML + document and XML document are used as defined in the DOM + specification, and refer specifically to two different modes that Document objects + can find themselves in. [DOM] (Such uses are always hyperlinked to their + definition.)

          + +

          In the context of byte streams, the term HTML document refers to resources labeled as + text/html, and the term XML document refers to resources labeled with an XML + MIME type.

          + +

          The term XHTML document is used to refer to both Documents in the XML document mode that contains element nodes in the HTML + namespace, and byte streams labeled with an XML MIME type that contain + elements from the HTML namespace, depending on context.

          + +

          For simplicity, terms such as shown, displayed, and + visible might sometimes be used when referring to the way a document is + rendered to the user. These terms are not meant to imply a visual medium; they must be considered + to apply to other media in equivalent ways.

          -

          When an algorithm B says to return to another algorithm A, it - implies that A called B. Upon returning to A, the implementation - must continue from where it left off in calling B.

          +

          When an algorithm B says to return to another algorithm A, it implies that A called B. Upon + returning to A, the implementation must continue from where it left off in calling B.

          -

          The term "transparent black" refers to the color with red, green, - blue, and alpha channels all set to zero.

          +

          The term "transparent black" refers to the color with red, green, blue, and alpha channels all + set to zero.

          2.1.1 Resources

          @@ -3409,27 +3392,23 @@ a.setAttribute('href', 'http://example.com/'); // change the content attribute d

          2.1.4 Scripting

          -

          The construction "a Foo object", where - Foo is actually an interface, is sometimes used instead - of the more accurate "an object implementing the interface +

          The construction "a Foo object", where Foo is actually an interface, + is sometimes used instead of the more accurate "an object implementing the interface Foo".

          -

          An IDL attribute is said to be getting when - its value is being retrieved (e.g. by author script), and is said to - be setting when a new value is assigned to - it.

          +

          An IDL attribute is said to be getting when its value is being retrieved + (e.g. by author script), and is said to be setting when a new value is + assigned to it.

          -

          If a DOM object is said to be live, then the - attributes and methods on that object must - operate on the actual underlying data, not a snapshot of the +

          If a DOM object is said to be live, then the attributes and methods on that object + must operate on the actual underlying data, not a snapshot of the data.

          In the contexts of events, the terms fire and dispatch are used as defined in the - DOM Core specification: firing an event means to create and - dispatch it, and dispatching an event means to follow the steps that propagate + DOM specification: firing an event means to create and dispatch it, and dispatching an event means to follow the steps that propagate the event through the tree. The term trusted event is used to refer to events whose isTrusted attribute is - initialized to true. [DOMCORE]

          + initialized to true. [DOM]

          2.1.5 Plugins

          @@ -4026,19 +4005,15 @@ a.setAttribute('href', 'http://example.com/'); // change the content attribute d
          -

          The Document Object Model (DOM) is a representation — a - model — of a document and its content. The DOM is not just - an API; the conformance criteria of HTML implementations are - defined, in this specification, in terms of operations on the DOM. - [DOMCORE]

          +

          The Document Object Model (DOM) is a representation — a model — of a document and + its content. The DOM is not just an API; the conformance criteria of HTML implementations are + defined, in this specification, in terms of operations on the DOM. [DOM]

          -

          Implementations must support DOM Core and the events defined in - DOM Events, because this specification is defined in terms of the - DOM, and some of the features are defined as extensions to the DOM - Core interfaces. [DOMCORE] [DOMEVENTS]

          +

          Implementations must support DOM and the events defined in DOM Events, because this + specification is defined in terms of the DOM, and some of the features are defined as extensions + to the DOM interfaces. [DOM] [DOMEVENTS]

          -

          In particular, the following features are defined in the DOM - Core specification: [DOMCORE]

          +

          In particular, the following features are defined in the DOM specification: [DOM]

          • Attr interface
          • Comment interface
          • @@ -4084,6 +4059,7 @@ a.setAttribute('href', 'http://example.com/'); // change the content attribute d
          • isTrusted attribute
          • The type of an event
          • The concept of an event listener and the event listeners associated with an EventTarget
          • +
          • The concept of a regular event parent and a cross-boundary event parent
          • The encoding (herein the character encoding) and content type of a Document
          • The distinction between XML documents and HTML documents
          • @@ -4098,10 +4074,8 @@ a.setAttribute('href', 'http://example.com/'); // change the content attribute d
          • The MutationObserver scripting environment concept
          • The invoke MutationObserver objects algorithm
          • -

          The term throw in this specification is used as - defined in the DOM Core specification. The following - DOMException types are defined in the DOM Core - specification: [DOMCORE]

          +

      The term throw in this specification is used as defined in the DOM specification. + The following DOMException types are defined in the DOM specification: [DOM]

      1. IndexSizeError
      2. HierarchyRequestError
      3. @@ -4124,20 +4098,15 @@ a.setAttribute('href', 'http://example.com/'); // change the content attribute d
      4. TimeoutError
      5. InvalidNodeTypeError
      6. DataCloneError
      7. -

      For example, to throw a - TimeoutError exception, a user agent would - construct a DOMException object whose type was the - string "TimeoutError" (and whose code was - the number 23, for legacy reasons) and actually throw that object - as an exception.

      +

      For example, to throw a TimeoutError exception, a user + agent would construct a DOMException object whose type was the string "TimeoutError" (and whose code was the number 23, for legacy reasons) and + actually throw that object as an exception.

      -

      The URL associated - with a Document, as defined in the DOM Core - specification, is referred to in this specification as the - document's address.

      +

      The URL associated with a Document, as + defined in the DOM specification, is referred to in this specification as the document's + address.

      -

      The following features are defined in the DOM Events - specification: [DOMEVENTS]

      +

      The following features are defined in the DOM Events specification: [DOMEVENTS]

      -

      The id attribute specifies its - element's unique identifier (ID). [DOMCORE]

      +

      The id attribute specifies its element's unique identifier (ID). [DOM]

      -

      The value must be unique amongst all the IDs in the element's home - subtree and must contain at least one character. The value - must not contain any space - characters.

      +

      The value must be unique amongst all the IDs in the element's + home subtree and must contain at least one character. The value must not contain any + space characters.

      - + -

      An element's unique - identifier can be used for a variety of purposes, most - notably as a way to link to specific parts of a document using - fragment identifiers, as a way to target an element when scripting, - and as a way to style a specific element from CSS.

      +

      An element's unique identifier can be used for a + variety of purposes, most notably as a way to link to specific parts of a document using fragment + identifiers, as a way to target an element when scripting, and as a way to style a specific + element from CSS.

      -

      Identifiers are opaque strings. Particular meanings should not be - derived from the value of the id - attribute.

      +

      Identifiers are opaque strings. Particular meanings should not be derived from the value of the + id attribute.

      @@ -11538,38 +11471,32 @@ Transport Protocol">HTTP</abbr> today.</p>

      The script element allows authors to include dynamic - script and data blocks in their documents. The element does not - represent content for the user.

      - -

      When used to include dynamic scripts, the scripts may either be - embedded inline or may be imported from an external file using the - src attribute. If the language - is not that described by "text/javascript", - then the type attribute must - be present, as described below. Whatever language is used, the - contents of the script element must conform with the +

      The script element allows authors to include dynamic script and data blocks in + their documents. The element does not represent content for the + user.

      + +

      When used to include dynamic scripts, the scripts may either be embedded inline or may be + imported from an external file using the src attribute. If + the language is not that described by "text/javascript", then the type attribute must be present, as described below. Whatever + language is used, the contents of the script element must conform with the requirements of that language's specification.

      -

      When used to include data blocks (as opposed to scripts), the - data must be embedded inline, the format of the data must be given - using the type attribute, the - src attribute must not be - specified, and the contents of the script element must - conform to the requirements defined for the format used.

      - -

      The type - attribute gives the language of the script or format of the data. If - the attribute is present, its value must be a valid MIME - type. The charset parameter must not be - specified. The default, which is used if the attribute is absent, - is "text/javascript".

      - -

      The src - attribute, if specified, gives the address of the external script - resource to use. The value of the attribute must be a valid - non-empty URL potentially surrounded by spaces identifying a - script resource of the type given by the type attribute, if the attribute is - present, or of the type "text/javascript", if - the attribute is absent. A resource is a script resource of a given - type if that type identifies a scripting language and the resource +

      When used to include data blocks (as opposed to scripts), the data must be embedded inline, the + format of the data must be given using the type attribute, + the src attribute must not be specified, and the contents of + the script element must conform to the requirements defined for the format used.

      + +

      The type attribute gives the language of the + script or format of the data. If the attribute is present, its value must be a valid MIME + type. The charset parameter must not be specified. The default, which + is used if the attribute is absent, is "text/javascript".

      + +

      The src attribute, if specified, gives the + address of the external script resource to use. The value of the attribute must be a valid + non-empty URL potentially surrounded by spaces identifying a script resource of the type + given by the type attribute, if the attribute is present, or + of the type "text/javascript", if the attribute is absent. A resource is a + script resource of a given type if that type identifies a scripting language and the resource conforms with the requirements of that language's specification.

      -

      The charset - attribute gives the character encoding of the external script - resource. The attribute must not be specified if the src attribute is not present. If the - attribute is set, its value must be a valid character encoding name, - must be an ASCII case-insensitive match for the - preferred MIME name for that encoding, and must match - the encoding given in the charset parameter of - the Content-Type metadata of the - external file, if any. [IANACHARSET]

      - -

      The async and - defer attributes - are boolean attributes that - indicate how the script should be executed. The defer and async attributes must not be - specified if the src attribute - is not present.

      - -

      There are three possible modes that can be selected using these - attributes. If the async - attribute is present, then the script will be executed - asynchronously, as soon as it is available. If the async attribute is not present but - the defer attribute is - present, then the script is executed when the page has finished - parsing. If neither attribute is present, then the script is - fetched and executed immediately, before the user agent continues +

      The charset attribute gives the character + encoding of the external script resource. The attribute must not be specified if the src attribute is not present. If the attribute is set, its value + must be a valid character encoding name, must be an ASCII case-insensitive match for + the preferred MIME name for that encoding, and must match the encoding given in the + charset parameter of the Content-Type + metadata of the external file, if any. [IANACHARSET]

      + +

      The async and defer attributes are boolean attributes that indicate how the script should be executed. The defer and async attributes + must not be specified if the src attribute is not + present.

      + +

      There are three possible modes that can be selected using these attributes. If the async attribute is present, then the script will be executed + asynchronously, as soon as it is available. If the async + attribute is not present but the defer attribute is + present, then the script is executed when the page has finished parsing. If neither attribute is + present, then the script is fetched and executed immediately, before the user agent continues parsing the page.

      -

      The exact processing details for these attributes - are, for mostly historical reasons, somewhat non-trivial, involving - a number of aspects of HTML. The implementation requirements are - therefore by necessity scattered throughout the specification. The - algorithms below (in this section) describe the core of this - processing, but these algorithms reference and are referenced by the - parsing rules for script start - and end tags in HTML, in foreign content, and in XML, the rules for the document.write() method, the - handling of scripting, etc.

      - -

      The defer attribute may be - specified even if the async - attribute is specified, to cause legacy Web browsers that only - support defer (and not async) to fall back to the defer behavior instead of the - synchronous blocking behavior that is the default.

      +

      The exact processing details for these attributes are, for mostly historical + reasons, somewhat non-trivial, involving a number of aspects of HTML. The implementation + requirements are therefore by necessity scattered throughout the specification. The algorithms + below (in this section) describe the core of this processing, but these algorithms reference and + are referenced by the parsing rules for script start and end tags in HTML, in foreign content, + and in XML, the rules for the document.write() method, the handling of scripting, etc.

      + +

      The defer attribute may be specified even if the async attribute is specified, to cause legacy Web browsers that + only support defer (and not async) to fall back to the defer behavior instead of the synchronous blocking behavior that + is the default.

      The crossorigin attribute is a CORS settings attribute. It controls, for scripts that are obtained from other origins, whether error information will be exposed.

      @@ -16150,53 +16055,40 @@ c-end = "-->"
      -

      A script element has several associated pieces of - state.

      +

      A script element has several associated pieces of state.

      + +

      The first is a flag indicating whether or not the script block has been "already + started". Initially, script elements must have this flag unset (script blocks, + when created, are not "already started"). The cloning + steps for script elements must set the "already started" flag on the copy if + it is set on the element being cloned.

      + +

      The second is a flag indicating whether the element was "parser-inserted". + Initially, script elements must have this flag unset. It is set by the HTML + parser and the XML parser on script elements they insert and + affects the processing of those elements.

      + +

      The third is a flag indicating whether the element will "force-async". Initially, + script elements must have this flag set. It is unset by the HTML parser + and the XML parser on script elements they insert. In addition, whenever + a script element whose "force-async" flag is set has a async content attribute added, the element's + "force-async" flag must be unset.

      + +

      The fourth is a flag indicating whether or not the script block is "ready to be + parser-executed". Initially, script elements must have this flag unset (script + blocks, when created, are not "ready to be parser-executed"). This flag is used only for elements + that are also "parser-inserted", to let the parser know when to execute the + script.

      -

      The first is a flag indicating whether or not the script block - has been "already started". Initially, - script elements must have this flag unset (script - blocks, when created, are not "already started"). The cloning steps for - script elements must set the "already started" flag on - the copy if it is set on the element being cloned.

      - -

      The second is a flag indicating whether the element was - "parser-inserted". Initially, script - elements must have this flag unset. It is set by the HTML - parser and the XML parser on script - elements they insert and affects the processing of those - elements.

      +

      The last few pieces of state are the script block's type, the + script block's character encoding, and the script block's fallback character + encoding. They are determined when the script is prepared, based on the attributes on + the element at that time, and the Document of the script element.

      -

      The third is a flag indicating whether the element will - "force-async". Initially, script elements - must have this flag set. It is unset by the HTML parser - and the XML parser on script elements they - insert. In addition, whenever a script element whose - "force-async" flag is set has a async content attribute added, the - element's "force-async" flag must be unset.

      - -

      The fourth is a flag indicating whether or not the script block is - "ready to be parser-executed". Initially, - script elements must have this flag unset (script - blocks, when created, are not "ready to be parser-executed"). This - flag is used only for elements that are also - "parser-inserted", to let the parser know when to - execute the script.

      - -

      The last few pieces of state are the script block's - type, the script block's character - encoding, and the script block's fallback - character encoding. They are determined when the script - is prepared, based on the attributes on the element at that time, - and the Document of the script - element.

      - -

      When a script element that is not marked as being - "parser-inserted" experiences one of the events listed - in the following list, the user agent must synchronously prepare the script - element:

      +

      When a script element that is not marked as being "parser-inserted" + experiences one of the events listed in the following list, the user agent must synchronously + prepare the script element:

      To prepare a script, the user - agent must act as follows:

      +

      To prepare a script, the user agent must act as + follows:

      1. -

        If the script element is marked as having - "already started", then the user agent must abort - these steps at this point. The script is not executed.

        +

        If the script element is marked as having "already started", then + the user agent must abort these steps at this point. The script is not executed.

      2. -

        If the element has its "parser-inserted" flag set, - then set was-parser-inserted to true and unset - the element's "parser-inserted" flag. Otherwise, set - was-parser-inserted to false.

        +

        If the element has its "parser-inserted" flag set, then set was-parser-inserted to true and unset the element's + "parser-inserted" flag. Otherwise, set was-parser-inserted to + false.

        -

        This is done so that if parser-inserted - script elements fail to run when the parser tries to - run them, e.g. because they are empty or specify an unsupported - scripting language, another script can later mutate them and cause - them to run again.

        +

        This is done so that if parser-inserted script elements fail to run + when the parser tries to run them, e.g. because they are empty or specify an unsupported + scripting language, another script can later mutate them and cause them to run again.

        @@ -16242,33 +16129,28 @@ c-end = "-->"
      3. -

        If was-parser-inserted is true and the - element does not have an async attribute, then set the - element's "force-async" flag to true.

        +

        If was-parser-inserted is true and the element does not have an async attribute, then set the element's + "force-async" flag to true.

        -

        This is done so that if a parser-inserted - script element fails to run when the parser tries to - run it, but it is later executed after a script dynamically - updates it, it will execute asynchronously even if the - async attribute isn't - set.

        +

        This is done so that if a parser-inserted script element fails to + run when the parser tries to run it, but it is later executed after a script dynamically updates + it, it will execute asynchronously even if the async + attribute isn't set.

      4. -

        If the element has no src - attribute, and its child nodes, if any, consist only of comment - nodes and empty Text nodes, then the user agent must - abort these steps at this point. The script is not executed.

        +

        If the element has no src attribute, and its child + nodes, if any, consist only of comment nodes and empty Text nodes, then the user + agent must abort these steps at this point. The script is not executed.

      5. -

        If the element is not in a Document, - then the user agent must abort these steps at this point. The - script is not executed.

        +

        If the element is not in a Document, then the user agent must abort + these steps at this point. The script is not executed.

      6. @@ -16276,123 +16158,116 @@ c-end = "-->"

        If either:

        -
        • the script element has a type attribute and its value is - the empty string, or
        • +
          • the script element has a type attribute + and its value is the empty string, or
          • -
          • the script element has no type attribute but it has a language attribute and - that attribute's value is the empty string, or
          • +
          • the script element has no type attribute + but it has a language attribute and that + attribute's value is the empty string, or
          • -
          • the script element has neither a type attribute nor a language attribute, then
          • +
          • the script element has neither a type + attribute nor a language attribute, then
          • -

          ...let the script block's type for this - script element be "text/javascript".

          +

        ...let the script block's type for this script element be "text/javascript".

        -

        Otherwise, if the script element has a type attribute, let the - script block's type for this script element be - the value of that attribute with any leading or trailing sequences - of space characters - removed.

        +

        Otherwise, if the script element has a type attribute, let the script block's type for this + script element be the value of that attribute with any leading or trailing + sequences of space characters removed.

        -

        Otherwise, the element has a non-empty language attribute; let - the script block's type for this script - element be the concatenation of the string "text/" followed by the value of the language attribute.

        +

        Otherwise, the element has a non-empty language + attribute; let the script block's type for this script element be the + concatenation of the string "text/" followed by the value of the language attribute.

        The language attribute is never - conforming, and is always ignored if there is a type attribute present.

        + conforming, and is always ignored if there is a type + attribute present.

      7. -

        If the user agent does not support the scripting - language given by the script block's type for - this script element, then the user agent must abort +

        If the user agent does not support the scripting language given by the + script block's type for this script element, then the user agent must abort these steps at this point. The script is not executed.

      8. -

        If was-parser-inserted is true, then flag - the element as "parser-inserted" again, and set the - element's "force-async" flag to false.

        +

        If was-parser-inserted is true, then flag the element as + "parser-inserted" again, and set the element's "force-async" flag to + false.

      9. -

        The user agent must set the element's "already - started" flag.

        +

        The user agent must set the element's "already started" flag.

        -

        The state of the element at this moment is later used to - determine the script source.

        +

        The state of the element at this moment is later used to determine the script source.

      10. -

        If the element is flagged as "parser-inserted", - but the element's Document is not the - Document of the parser that created the element, then - abort these steps.

        +

        If the element is flagged as "parser-inserted", but the element's + Document is not the Document of the parser that created the element, + then abort these steps.

      11. -

        If scripting is - disabled for the script element, then the user - agent must abort these steps at this point. The script is not +

        If scripting is disabled for the script + element, then the user agent must abort these steps at this point. The script is not executed.

        -

        The definition of scripting is disabled means - that, amongst others, the following scripts will not execute: - scripts in XMLHttpRequest's responseXML - documents, scripts in DOMParser-created documents, - scripts in documents created by XSLTProcessor's transformToDocument - feature, and scripts that are first inserted by a script into a - Document that was created using the createDocument() - API. [XHR] [DOMPARSING] [DOMCORE]

        +

        The definition of scripting is disabled + means that, amongst others, the following scripts will not execute: scripts in + XMLHttpRequest's responseXML + documents, scripts in DOMParser-created documents, scripts in documents created by + XSLTProcessor's transformToDocument feature, and scripts + that are first inserted by a script into a Document that was created using the + createDocument() API. [XHR] [DOMPARSING] [DOM]

      12. -

        If the script element has an event attribute and a for attribute, then run these - substeps:

        +

        If the script element has an event + attribute and a for attribute, then run these substeps:

        -
        1. Let for be the value of the for attribute.

        2. +
          1. Let for be the value of the for + attribute.

          2. Let event be the value of the event attribute.

          3. -
          4. Strip leading and trailing whitespace from - event and for.

          5. +
          6. Strip leading and trailing whitespace from event and + for.

          7. -
          8. If for is not an ASCII - case-insensitive match for the string "window", then the user agent must abort these - steps at this point. The script is not executed.

          9. +
          10. If for is not an ASCII case-insensitive match for the + string "window", then the user agent must abort these steps at this + point. The script is not executed.

          11. -
          12. If event is not an ASCII - case-insensitive match for either the string "onload" or the string "onload()", then the user agent must abort these - steps at this point. The script is not executed.

          13. +
          14. If event is not an ASCII case-insensitive match for + either the string "onload" or the string "onload()", then the user agent must abort these steps at this point. The script + is not executed.

        3. -

          If the script element has a charset attribute, then let - the script block's character encoding for this +

          If the script element has a charset + attribute, then let the script block's character encoding for this script element be the encoding given by the charset attribute.

          -

          Otherwise, let the script block's fallback character - encoding for this script element be the same as - the encoding of the - document itself.

          +

          Otherwise, let the script block's fallback character encoding for this + script element be the same as the + encoding of the document itself.

          Only one of these two pieces of state is set.

          @@ -16400,8 +16275,8 @@ c-end = "-->"
        4. -

          If the element has a src - content attribute, run these substeps:

          +

          If the element has a src content attribute, run these + substeps:

          1. Let src be the value of the element's src attribute.

          2. @@ -16446,187 +16321,152 @@ c-end = "-->"
        5. - +
        6. -

          Then, the first of the following options that describes the - situation must be followed:

          +

          Then, the first of the following options that describes the situation must be followed:

          -
          If the element has a src attribute, and the element has - a defer attribute, and the - element has been flagged as "parser-inserted", and - the element does not have an async attribute
          +
          If the element has a src + attribute, and the element has a defer attribute, and + the element has been flagged as "parser-inserted", and the element does not have + an async attribute
          -

          The element must be added to the end of the list of - scripts that will execute when the document has finished - parsing associated with the Document of the - parser that created the element.

          +

          The element must be added to the end of the list of scripts that will execute when the + document has finished parsing associated with the Document of the parser + that created the element.

          -

          The task that the - networking task source places on the task - queue once the fetching - algorithm has completed must set the element's - "ready to be parser-executed" flag. The parser will - handle executing the script.

          +

          The task that the networking task source + places on the task queue once the fetching algorithm + has completed must set the element's "ready to be parser-executed" flag. The + parser will handle executing the script.

          -
          If the element has a - src attribute, and the - element has been flagged as "parser-inserted", and - the element does not have an async attribute
          +
          If the element has a src attribute, and the element has been flagged as + "parser-inserted", and the element does not have an async attribute
          -

          The element is the pending parsing-blocking - script of the Document of the parser that - created the element. (There can only be one such script per - Document at a time.)

          +

          The element is the pending parsing-blocking script of the + Document of the parser that created the element. (There can only be one such + script per Document at a time.)

          -

          The task that the - networking task source places on the task - queue once the fetching - algorithm has completed must set the element's - "ready to be parser-executed" flag. The parser will - handle executing the script.

          +

          The task that the networking task source + places on the task queue once the fetching algorithm + has completed must set the element's "ready to be parser-executed" flag. The + parser will handle executing the script.

          -
          If the element does not - have a src attribute, and - the element has been flagged as "parser-inserted", - and either the parser that created the script is an - XML parser or it's an HTML parser whose - script nesting level is not greater than one, and the - Document of the HTML parser or - XML parser that created the script - element has a style sheet that is blocking - scripts
          +
          If the element does not have a src attribute, and the element has been flagged as + "parser-inserted", and either the parser that created the script is + an XML parser or it's an HTML parser whose script nesting + level is not greater than one, and the Document of the HTML + parser or XML parser that created the script element has + a style sheet that is blocking scripts
          -

          The element is the pending parsing-blocking - script of the Document of the parser that - created the element. (There can only be one such script per - Document at a time.)

          +

          The element is the pending parsing-blocking script of the + Document of the parser that created the element. (There can only be one such + script per Document at a time.)

          -

          Set the element's "ready to be parser-executed" - flag. The parser will handle executing the script.

          +

          Set the element's "ready to be parser-executed" flag. The parser will handle + executing the script.

          -
          If the element has a src attribute, does not have an - async attribute, and does - not have the "force-async" flag set
          +
          If the element has a src attribute, does not have an async attribute, and does not have the + "force-async" flag set
          -

          The element must be added to the end of the list of - scripts that will execute in order as soon as possible - associated with the Document of the - script element at the time the prepare a - script algorithm started.

          - -

          The task that the - networking task source places on the task - queue once the fetching - algorithm has completed must run the following steps:

          - -
          1. If the element is not now the first element in the - list of scripts that will execute in order as soon as - possible to which it was added above, then mark the - element as ready but abort these steps without executing the - script yet.

          2. - -
          3. Execution: Execute the script block - corresponding to the first script element in this list of - scripts that will execute in order as soon as +

            The element must be added to the end of the list of scripts that will execute in order + as soon as possible associated with the Document of the script + element at the time the prepare a script algorithm started.

            + +

            The task that the networking task source + places on the task queue once the fetching algorithm + has completed must run the following steps:

            + +
            1. If the element is not now the first element in the list of scripts that will + execute in order as soon as possible to which it was added above, then mark the + element as ready but abort these steps without executing the script yet.

            2. + +
            3. Execution: Execute the script block corresponding to the first + script element in this list of scripts that will execute in order as soon as possible.

            4. -
            5. Remove the first element from this list of scripts - that will execute in order as soon as possible.

            6. +
            7. Remove the first element from this list of scripts that will execute in order as + soon as possible.

            8. -
            9. If this list of scripts that will execute in order - as soon as possible is still not empty and the first - entry has already been marked as ready, then jump back to the +

            10. If this list of scripts that will execute in order as soon as possible is + still not empty and the first entry has already been marked as ready, then jump back to the step labeled execution.

          -
          If the element has a src attribute
          +
          If the element has a src + attribute
          -

          The element must be added to the set of scripts that - will execute as soon as possible of the - Document of the script element at the - time the prepare a script algorithm started.

          +

          The element must be added to the set of scripts that will execute as soon as + possible of the Document of the script element at the time the + prepare a script algorithm started.

          -

          The task that the - networking task source places on the task - queue once the fetching - algorithm has completed must execute the script - block and then remove the element from the set of - scripts that will execute as soon as possible.

          +

          The task that the networking task source + places on the task queue once the fetching algorithm + has completed must execute the script block and then remove the element from the + set of scripts that will execute as soon as possible.

          Otherwise
          -
          The user agent must immediately execute the script - block, even if other scripts are already executing.
          +
          The user agent must immediately execute the script block, even if other + scripts are already executing.
        7. -

        Fetching an external script must delay the load - event of the element's document until the task that is queued by the networking task source once - the resource has been fetched (defined - above) has been run.

        - -

        The pending parsing-blocking script of a - Document is used by the Document's - parser(s).

        - -

        If a script element that blocks a - parser gets moved to another Document before it would - normally have stopped blocking that parser, it nonetheless continues - blocking that parser until the condition that causes it to be - blocking the parser no longer applies (e.g. if the script is a - pending parsing-blocking script because there was - a style sheet that is blocking scripts when it was - parsed, but then the script is moved to another - Document before the style sheet loads, the script still - blocks the parser until the style sheets are all loaded, at which - time the script executes and the parser is unblocked).

        - - - -

        When the user agent is required to execute a script block, it must run the following - steps:

        +

      Fetching an external script must delay the load event of the element's document + until the task that is queued + by the networking task source once the resource has been fetched (defined above) has been run.

      + +

      The pending parsing-blocking script of a Document is used by the + Document's parser(s).

      + +

      If a script element that blocks a parser gets moved to another + Document before it would normally have stopped blocking that parser, it nonetheless + continues blocking that parser until the condition that causes it to be blocking the parser no + longer applies (e.g. if the script is a pending parsing-blocking script because there + was a style sheet that is blocking scripts when it was parsed, but then the script is + moved to another Document before the style sheet loads, the script still blocks the + parser until the style sheets are all loaded, at which time the script executes and the parser is + unblocked).

      + + + +

      When the user agent is required to execute a script + block, it must run the following steps:

      1. -

        If the element is flagged as "parser-inserted", - but the element's Document is not the - Document of the parser that created the element, then - abort these steps.

        +

        If the element is flagged as "parser-inserted", but the element's + Document is not the Document of the parser that created the element, + then abort these steps.

      2. @@ -16634,58 +16474,48 @@ c-end = "-->"

        Jump to the appropriate set of steps from the list below:

        -
        If the load resulted in an error (for example a DNS error, or - an HTTP 404 error)
        +
        If the load resulted in an error (for example a DNS error, or an HTTP 404 error)
        -

        Executing the script block must just consist of firing a simple event named - error at the element.

        +

        Executing the script block must just consist of firing + a simple event named error at the element.

        If the load was successful
        -

        Executing the script block must consist of running the - following steps. For the purposes of these steps, the script is - considered to be from an external file if, while the - prepare a script algorithm above was running for - this script, the script element had a src attribute specified.

        +

        Executing the script block must consist of running the following steps. For the purposes of + these steps, the script is considered to be from an external file if, while the + prepare a script algorithm above was running for this script, the + script element had a src attribute + specified.

        1. -

          Initialize the script block's source - as follows:

          +

          Initialize the script block's source as follows:

          -
          If the script is from an external file and the - script block's type is a text-based language
          +
          If the script is from an external file and the script block's type is a + text-based language
          -

          The contents of that file, interpreted as a Unicode - string, are the script source.

          +

          The contents of that file, interpreted as a Unicode string, are the script source.

          -

          To obtain the Unicode string, the user agent run the - following steps:

          +

          To obtain the Unicode string, the user agent run the following steps:

          -
          1. If the resource's Content - Type metadata, if any, specifies a character - encoding, and the user agent supports that encoding, then - let character encoding be that - encoding, and jump to the bottom step in this series of - steps.

          2. +
            1. If the resource's Content Type metadata, if any, + specifies a character encoding, and the user agent supports that encoding, then let character encoding be that encoding, and jump to the bottom step in this + series of steps.

            2. -
            3. If the algorithm above set the script block's - character encoding, then let character - encoding be that encoding, and jump to the bottom - step in this series of steps.

            4. +
            5. If the algorithm above set the script block's character encoding, then + let character encoding be that encoding, and jump to the bottom step + in this series of steps.

            6. -
            7. For each of the rows in the following table, - starting with the first one and going down, if the file has - as many or more bytes available than the number of bytes in - the first column, and the first bytes of the file match the - bytes given in the first column, then set character encoding to the encoding given in - the cell in the second column of that row, and jump to the - bottom step in this series of steps:

              +
            8. For each of the rows in the following table, starting with the first one and going + down, if the file has as many or more bytes available than the number of bytes in the + first column, and the first bytes of the file match the bytes given in the first column, + then set character encoding to the encoding given in the cell in the + second column of that row, and jump to the bottom step in this series of steps:

              Bytes in Hexadecimal @@ -16708,53 +16538,47 @@ c-end = "-->" DD 73 66 73 UTF-EBCDIC --> -

              This step looks for Unicode Byte Order - Marks (BOMs).

              +

      This step looks for Unicode Byte Order Marks (BOMs).

      -
    7. Let character encoding be - the script block's fallback character - encoding.

    8. +
    9. Let character encoding be the script block's fallback + character encoding.

    10. -
    11. Convert the file to Unicode using character - encoding, following the rules for doing so given by - the specification for the script block's +

    12. Convert the file to Unicode using character encoding, following the + rules for doing so given by the specification for the script block's type.

    -
    If the script is from an external file and the - script block's type is an XML-based language
    +
    If the script is from an external file and the script block's type is an + XML-based language
    -

    The external file is the script source. When it is later - executed, it must be interpreted in a manner consistent with - the specification defining the language given by the - script block's type.

    +

    The external file is the script source. When it is later executed, it must be + interpreted in a manner consistent with the specification defining the language given by + the script block's type.

    -
    If the script is inline and the script block's - type is a text-based language
    +
    If the script is inline and the script block's type is a text-based + language
    -

    The value of the text IDL attribute at the - time the element's "already started" flag was - last set is the script source.

    +

    The value of the text IDL attribute at the time + the element's "already started" flag was last set is the script source.

    -
    If the script is inline and the script block's - type is an XML-based language
    +
    If the script is inline and the script block's type is an XML-based + language
    -

    The child nodes of the script element at the - time the element's "already started" flag was - last set are the script source.

    +

    The child nodes of the script element at the time the element's + "already started" flag was last set are the script source.

    @@ -16762,9 +16586,8 @@ c-end = "-->"
  • -

    Fire a simple event named beforescriptexecute - that bubbles and is cancelable at the script - element.

    +

    Fire a simple event named beforescriptexecute that bubbles and is cancelable + at the script element.

    If the event is canceled, then abort these steps.

    @@ -16773,8 +16596,8 @@ c-end = "-->"
  • If the script is from an external file, then increment the - ignore-destructive-writes counter of the - script element's Document. Let neutralized doc be that + ignore-destructive-writes counter of the script element's + Document. Let neutralized doc be that Document.

  • @@ -16796,18 +16619,16 @@ c-end = "-->"
  • -

    Create a - script from the script element node, using - the script block's source, the URL - from which the script was obtained, and the script - block's type.

    +

    Create a script from the + script element node, using the script block's source, the + URL from which the script was obtained, and the script block's + type.

    If the script came from a resource that was fetched in the steps above, and the resource was CORS-cross-origin, then pass the muted errors flag to the create a script from a node algorithm.

    -

    This is where the script is compiled and - actually executed.

    +

    This is where the script is compiled and actually executed.

  • @@ -16820,28 +16641,24 @@ c-end = "-->"
  • -

    Decrement the ignore-destructive-writes - counter of neutralized doc, if it - was incremented in the earlier step.

    +

    Decrement the ignore-destructive-writes counter of neutralized + doc, if it was incremented in the earlier step.

  • -

    Fire a simple event named afterscriptexecute - that bubbles (but is not cancelable) at the - script element.

    +

    Fire a simple event named afterscriptexecute that bubbles (but is not + cancelable) at the script element.

  • -

    If the script is from an external file, fire a simple - event named load at the - script element.

    +

    If the script is from an external file, fire a simple event named load at the script element.

    -

    Otherwise, the script is internal; queue a - task to fire a simple event named load at the script +

    Otherwise, the script is internal; queue a task to fire a simple + event named load at the script element.

  • @@ -16850,25 +16667,21 @@ c-end = "-->"

  • -

    The IDL attributes src, type, charset, defer, each must - reflect the respective content attributes of the same - name.

    +

    The IDL attributes src, type, charset, defer, each must reflect the respective + content attributes of the same name.

    The crossOrigin IDL attribute must reflect the crossorigin content attribute.

    -

    The async IDL - attribute controls whether the element will execute asynchronously - or not. If the element's "force-async" flag is set, - then, on getting, the async - IDL attribute must return true, and on setting, the - "force-async" flag must first be unset, and then the - content attribute must be removed if the IDL attribute's new value - is false, and must be set to the empty string if the IDL attribute's - new value is true. If the element's "force-async" flag - is not set, the IDL attribute must reflect the - async content attribute.

    +

    The async IDL attribute controls whether the + element will execute asynchronously or not. If the element's "force-async" flag is + set, then, on getting, the async IDL attribute must return + true, and on setting, the "force-async" flag must first be unset, and then the + content attribute must be removed if the IDL attribute's new value is false, and must be set to + the empty string if the IDL attribute's new value is true. If the element's + "force-async" flag is not set, the IDL attribute must reflect + the async content attribute.

    @@ -16877,35 +16690,32 @@ c-end = "-->"
    -

    Returns the contents of the element, ignoring child nodes that - aren't Text nodes.

    +

    Returns the contents of the element, ignoring child nodes that aren't Text + nodes.

    -

    Can be set, to replace the element's children with the given - value.

    +

    Can be set, to replace the element's children with the given value.

    The IDL attribute text must return a - concatenation of the contents of all the Text nodes - that are children of the script element (ignoring any - other nodes such as comments or elements), in tree order. On - setting, it must act the same way as the textContent - IDL attribute.

    + concatenation of the contents of all the Text nodes that are children of the + script element (ignoring any other nodes such as comments or elements), in tree + order. On setting, it must act the same way as the textContent IDL attribute.

    -

    When inserted using the document.write() method, - script elements execute (typically synchronously), but - when inserted using innerHTML and outerHTML attributes, they do not - execute at all.

    +

    When inserted using the document.write() + method, script elements execute (typically synchronously), but when inserted using + innerHTML and outerHTML + attributes, they do not execute at all.

    -

    In this example, two script elements are used. One - embeds an external script, and the other includes some data.

    +

    In this example, two script elements are used. One embeds an external script, and + the other includes some data.

    <script src="game-engine.js"></script>
     <script type="text/x-game-map">
    @@ -16915,22 +16725,19 @@ o............A....e
     .A..AAA...AAAAA...e
     </script>
    -

    The data in this case might be used by the script to generate - the map of a video game. The data doesn't have to be used that way, - though; maybe the map data is actually embedded in other parts of - the page's markup, and the data block here is just used by the - site's search engine to help users who are looking for particular - features in their game maps.

    +

    The data in this case might be used by the script to generate the map of a video game. The + data doesn't have to be used that way, though; maybe the map data is actually embedded in other + parts of the page's markup, and the data block here is just used by the site's search engine to + help users who are looking for particular features in their game maps.

    -

    The following sample shows how a script element can be used to - define a function that is then used by other parts of the - document. It also shows how a script element can be - used to invoke script while the document is being parsed, in this - case to initialize the form's output.

    +

    The following sample shows how a script element can be used to define a function that is then + used by other parts of the document. It also shows how a script element can be used + to invoke script while the document is being parsed, in this case to initialize the form's + output.

    <script>
      function calculate(form) {
    @@ -22502,15 +22309,13 @@ wormhole connection.</mark></p>
    Global attributes
    DOM interface:
    Uses HTMLElement.
    -

    The ruby element allows one or more spans of - phrasing content to be marked with ruby annotations. Ruby - annotations are short runs of text presented alongside base text, - primarily used in East Asian typography as a guide for - pronunciation or to include other annotations. In Japanese, this - form of typography is also known as furigana.

    +

    The ruby element allows one or more spans of phrasing content to be marked with + ruby annotations. Ruby annotations are short runs of text presented alongside base text, primarily + used in East Asian typography as a guide for pronunciation or to include other annotations. In + Japanese, this form of typography is also known as furigana.

    -

    The content model of ruby elements consists of one - or more of the following sequences:

    +

    The content model of ruby elements consists of one or more of the following + sequences:

    1. One or the other of the following:
      • Phrasing content, but with no ruby elements and with no ruby element descendants @@ -22518,16 +22323,14 @@ wormhole connection.</mark></p>
    2. One or the other of the following:
      • One or more rt elements
      • An rp element followed by one or more rt elements, each of which is itself followed by an rp element -

    The ruby and rt elements can be used - for a variety of kinds of annotations, including in particular those - described below. For more details on Japanese Ruby in particular, - and how to render Ruby for Japanese, see Requirements for - Japanese Text Layout. [JLREQ]

    +

    The ruby and rt elements can be used for a variety of kinds of + annotations, including in particular those described below. For more details on Japanese Ruby in + particular, and how to render Ruby for Japanese, see Requirements for Japanese Text + Layout. [JLREQ]

    -

    At the time of writing, CSS does not yet provide a - way to fully control the rendering of the HTML ruby - element. It is hoped that CSS will be extended to support the styles - described below in due course.

    +

    At the time of writing, CSS does not yet provide a way to fully control the + rendering of the HTML ruby element. It is hoped that CSS will be extended to support + the styles described below in due course.

    @@ -22556,11 +22359,10 @@ wormhole connection.</mark></p>
    -

    This is similar to the previous case: each ideographic - character in the compound word (the base text) has its reading - given in hiragana or katakana characters (the ruby annotation). - The difference is that the base text segments form a compound word - rather than being separate from each other. +

    This is similar to the previous case: each ideographic character in the compound word (the + base text) has its reading given in hiragana or katakana characters (the ruby annotation). The + difference is that the base text segments form a compound word rather than being separate from + each other.

    <ruby>B<rt>annotation</rt>B<rt>annotation</ruby>
    @@ -22581,11 +22383,9 @@ wormhole connection.</mark></p>
    -

    This is semantically identical to the previous case (each - individual ideographic character in the base compound word has its - reading given in an annotation in hiragana or katakana - characters), but the rendering is the more complicated Jukugo Ruby - rendering. +

    This is semantically identical to the previous case (each individual ideographic character in + the base compound word has its reading given in an annotation in hiragana or katakana + characters), but the rendering is the more complicated Jukugo Ruby rendering.

    This is the same example as above for mono-ruby for compound words. The different rendering is expected to be achieved using different styling (e.g. in CSS), and is not shown here.

    @@ -22596,9 +22396,8 @@ wormhole connection.</mark></p> -->
    -

    For more details on Jukugo - Ruby rendering, see Appendix F in the Requirements for - Japanese Text Layout. [JLREQ]

    +

    For more details on Jukugo Ruby rendering, see + Appendix F in the Requirements for Japanese Text Layout. [JLREQ]

    @@ -22607,9 +22406,8 @@ wormhole connection.</mark></p>
    -

    The annotation describes the meaning of the base text, rather - than (or in addition to) the pronunciation. As such, both the base - text and the annotation can be multiple characters long. +

    The annotation describes the meaning of the base text, rather than (or in addition to) the + pronunciation. As such, both the base text and the annotation can be multiple characters long.

    <ruby>BASE<rt>annotation</ruby>
    @@ -22632,11 +22430,10 @@ wormhole connection.</mark></p>
    -

    A phonetic reading that corresponds to multiple base - characters, because a one-to-one mapping would be difficult. (In - English, the words "Colonel" and "Lieutenant" are examples of - words where a direct mapping of pronunciation to individual - letters is, in some dialects, rather unclear.) +

    A phonetic reading that corresponds to multiple base characters, because a one-to-one mapping + would be difficult. (In English, the words "Colonel" and "Lieutenant" are examples of words + where a direct mapping of pronunciation to individual letters is, in some dialects, rather + unclear.)

    In this example, the name of a species of flowers has a phonetic reading provided using group ruby: @@ -22674,48 +22471,38 @@ wormhole connection.</mark></p>

    -

    Within a ruby element that does not have a - ruby element ancestor, content is segmented and - segments are placed into three categories: base text segments, - annotation segments, and ignored segments. Ignored segments do not - form part of the document's semantics (they consist of some - inter-element whitespace and rp elements, - the latter of which are used for legacy user agents that do not - support ruby at all). Base text segments can overlap (with a limit - of two segments overlapping any one position in the DOM, and with - any segment having an earlier start point than an overlapping - segment also having an equal or later end point, and any segment - have a later end point than an overlapping segment also having an - equal or earlier start point). Annotation - segments correspond to rt elements. Each annotation - segment can be associated with a base text segment, and each base - text segment can have annotation segments associated with it. (In a - conforming document, each base text segment is associated with at - least one annotation segment, and each annotation segment is - associated with one base text segment.) A ruby element - represents the union of the segments of base text it - contains, along with the mapping from those base text segments to - annotation segments. Segments are described in terms of DOM ranges; - annotation segment ranges always consist of exactly one element. [DOMCORE]

    - -

    At any particular time, the segmentation and categorisation of - content of a ruby element is the result that would be - obtained from running the following algorithm:

    - -
    1. Let base text segments be an empty list - of base text segments, each potentially with a list of base text - subsegments.

    2. - -
    3. Let annotation segments be an empty list - of annotation segments, each potentially being associated with a - base text segment or subsegment.

    4. - -
    5. Let root be the ruby - element for which the algorithm is being run.

    6. - -
    7. If root has a ruby element - ancestor, then jump to the step labeled end.

    8. +

      Within a ruby element that does not have a ruby element ancestor, + content is segmented and segments are placed into three categories: base text segments, annotation + segments, and ignored segments. Ignored segments do not form part of the document's semantics + (they consist of some inter-element whitespace and rp elements, the + latter of which are used for legacy user agents that do not support ruby at all). Base text + segments can overlap (with a limit of two segments overlapping any one position in the DOM, and + with any segment having an earlier start point than an overlapping segment also having an equal or + later end point, and any segment have a later end point than an overlapping segment also having an + equal or earlier start point). Annotation segments correspond to rt elements. Each annotation + segment can be associated with a base text segment, and each base text segment can have annotation + segments associated with it. (In a conforming document, each base text segment is associated with + at least one annotation segment, and each annotation segment is associated with one base text + segment.) A ruby element represents the union of the segments of base + text it contains, along with the mapping from those base text segments to annotation segments. + Segments are described in terms of DOM ranges; annotation segment ranges always consist of exactly + one element. [DOM]

      + +

      At any particular time, the segmentation and categorisation of content of a ruby + element is the result that would be obtained from running the following algorithm:

      + +
      1. Let base text segments be an empty list of base text segments, each + potentially with a list of base text subsegments.

      2. + +
      3. Let annotation segments be an empty list of annotation segments, each + potentially being associated with a base text segment or subsegment.

      4. + +
      5. Let root be the ruby element for which the algorithm is + being run.

      6. + +
      7. If root has a ruby element ancestor, then jump to the + step labeled end.

      8. Let current parent be root.

      9. @@ -22728,165 +22515,153 @@ wormhole connection.</mark></p>
      10. Let current base text be null.

      11. - + -
      12. Start mode: If index is equal to - or greater than the number of child nodes in current - parent, then jump to the step labeled end mode.

        +
      13. Start mode: If index is equal to or greater than the number of + child nodes in current parent, then jump to the step labeled end + mode.

        -
      14. If the indexth node in current parent is an rt or - rp element, jump to the step labeled annotation +

      15. If the indexth node in current parent is an + rt or rp element, jump to the step labeled annotation mode.

      16. - +
      17. Set start index to the value of index.

      18. -
      19. Base mode: If the indexth node in - current parent is a ruby element, - and if current parent is the same element as - root, then push a ruby level and - then jump to the step labeled start mode.

      20. +
      21. Base mode: If the indexth node in current + parent is a ruby element, and if current parent is the + same element as root, then push a ruby level and then jump to + the step labeled start mode.

      22. -
      23. If the indexth node in current parent is an rt or - rp element, then set the current base - text and then jump to the step labeled annotation - mode.

      24. +
      25. If the indexth node in current parent is an + rt or rp element, then set the current base text and then + jump to the step labeled annotation mode.

      26. Increment index by one.

      27. -
      28. Base mode post-increment: If index is equal to or greater than the number of - child nodes in current parent, then jump to the - step labeled end mode.

      29. +
      30. Base mode post-increment: If index is equal to or greater than + the number of child nodes in current parent, then jump to the step labeled + end mode.

      31. Jump back to the step labeled base mode.

      32. -
      33. Annotation mode: If the indexth - node in current parent is an rt - element, then push a ruby annotation and jump to the - step labeled annotation mode increment.

      34. +
      35. Annotation mode: If the indexth node in current + parent is an rt element, then push a ruby annotation and jump to + the step labeled annotation mode increment.

      36. -
      37. If the indexth node in current parent is an rp element, jump - to the step labeled annotation mode increment.

      38. +
      39. If the indexth node in current parent is an + rp element, jump to the step labeled annotation mode increment.

      40. -
      41. If the indexth node in current parent is not a Text node, or - is a Text node that is not inter-element - whitespace, then jump to the step labeled base - mode.

      42. +
      43. If the indexth node in current parent is not a + Text node, or is a Text node that is not inter-element + whitespace, then jump to the step labeled base mode.

      44. -
      45. Annotation mode increment: Let lookahead index be index plus - one.

      46. +
      47. Annotation mode increment: Let lookahead index be index plus one.

      48. -
      49. Annotation mode white-space skipper: If lookahead index is equal to the number of child - nodes in current parent then jump to the step +

      50. Annotation mode white-space skipper: If lookahead index is + equal to the number of child nodes in current parent then jump to the step labeled end mode.

      51. -
      52. If the lookahead indexth node in current parent is an rt element or an - rp element, then set index to lookahead index and jump to the step labeled - annotation mode.

      53. +
      54. If the lookahead indexth node in current parent is + an rt element or an rp element, then set index to + lookahead index and jump to the step labeled annotation mode.

      55. -
      56. If the lookahead indexth node in current parent is not a Text node, or - is a Text node that is not inter-element - whitespace, then jump to the step labeled base mode - (without further incrementing index, so the - inter-element whitespace seen so far becomes part of - the next base text segment).

      57. +
      58. If the lookahead indexth node in current parent is + not a Text node, or is a Text node that is not inter-element + whitespace, then jump to the step labeled base mode (without further incrementing + index, so the inter-element whitespace seen so far becomes part + of the next base text segment).

      59. -
      60. Increment lookahead index by - one.

      61. +
      62. Increment lookahead index by one.

      63. -
      64. Jump to the step labeled annotation mode white-space - skipper.

      65. +
      66. Jump to the step labeled annotation mode white-space skipper.

      67. -
      68. End mode: If current parent is - not the same element as root, then pop a - ruby level and jump to the step labeled base mode +

      69. End mode: If current parent is not the same element as root, then pop a ruby level and jump to the step labeled base mode post-increment.

      70. -
      71. End: Return base text segments - and annotation segments. Any content of the - ruby element not described by segments in either of - thost lists is implicitly in an ignored segment.

      72. +
      73. End: Return base text segments and annotation + segments. Any content of the ruby element not described by segments in either + of thost lists is implicitly in an ignored segment.

      74. -

      When the steps above say to set the current base text, - it means to run the following steps at that point in the - algorithm:

      +

    When the steps above say to set the current base text, it means to run the following + steps at that point in the algorithm:

    -
    1. Let text range a DOM range whose start is the boundary point (current parent, start index) and - whose end is the boundary point (current parent, index).

    2. +
      1. Let text range a DOM range whose start is the boundary + point (current parent, start index) and whose + end is the boundary + point (current parent, index).

      2. -
      3. Let new text segment be a base text - segment described by the range annotation - range.

        +
      4. Let new text segment be a base text segment described by the range + annotation range.

        -
      5. Add new text segment to base text segments.

      6. +
      7. Add new text segment to base text + segments.

      8. -
      9. Let current base text be new text segment.

      10. +
      11. Let current base text be new text + segment.

      12. Let start index be null.

      13. -

      When the steps above say to push a ruby level, it - means to run the following steps at that point in the algorithm:

      +

    When the steps above say to push a ruby level, it means to run the following steps + at that point in the algorithm:

    -
    1. Let current parent be the indexth node in current - parent.

    2. +
      1. Let current parent be the indexth node in current parent.

      2. Let index be 0.

      3. -
      4. Set saved start index to the value of - start index.

      5. +
      6. Set saved start index to the value of start + index.

      7. Let start index be null.

      8. -

      When the steps above say to pop a ruby level, it means - to run the following steps at that point in the algorithm:

      +

    When the steps above say to pop a ruby level, it means to run the following steps at + that point in the algorithm:

    -
    1. Let index be the position of current parent in root.

    2. +
      1. Let index be the position of current parent in + root.

      2. Let current parent be root.

      3. Increment index by one.

      4. -
      5. Set start index to the value of - saved start index.

      6. +
      7. Set start index to the value of saved start + index.

      8. Let saved start index be null.

      9. -

      When the steps above say to push a ruby annotation, it - means to run the following steps at that point in the algorithm:

      +

    When the steps above say to push a ruby annotation, it means to run the following + steps at that point in the algorithm:

    -
    1. Let rt be the rt element - that is the indexth node of current parent.

    2. +
      1. Let rt be the rt element that is the indexth node of current parent.

      2. -
      3. Let annotation range a DOM range whose - start is the boundary point (current parent, index) and whose - end is the boundary point (current parent, index plus one) - (i.e. that contains only rt).

      4. +
      5. Let annotation range a DOM range whose start is the boundary + point (current parent, index) and whose end is the boundary point + (current parent, index plus one) (i.e. that contains only + rt).

      6. -
      7. Let new annotation segment be an - annotation segment described by the range annotation - range.

      8. +
      9. Let new annotation segment be an annotation segment described by the + range annotation range.

      10. -
      11. If current base text is not null, - associate new annotation segment with current base text.

      12. +
      13. If current base text is not null, associate new + annotation segment with current base text.

      14. -
      15. Add new annotation segment to annotation segments.

      16. +
      17. Add new annotation segment to annotation + segments.

      -

      In this example, each ideograph in the Japanese text 漢字 is annotated with its - reading in hiragana.

      +

      In this example, each ideograph in the Japanese text 漢字 is annotated with its reading in hiragana.

      ...
       <ruby>漢<rt>かん</rt>字<rt>じ</rt></ruby>
      @@ -22902,9 +22677,7 @@ wormhole connection.</mark></p>
      -

      In this example, each ideograph in the traditional Chinese text - 漢字 is annotated - with its bopomofo reading.

      +

      In this example, each ideograph in the traditional Chinese text 漢字 is annotated with its bopomofo reading.

      <ruby>漢<rt>ㄏㄢˋ</rt>字<rt>ㄗˋ</rt></ruby>
      @@ -22918,9 +22691,7 @@ wormhole connection.</mark></p> -

      In this example, each ideograph in the simplified Chinese text - 汉字 is annotated - with its pinyin reading.

      +

      In this example, each ideograph in the simplified Chinese text 汉字 is annotated with its pinyin reading.

      ...<ruby>汉<rt>hàn</rt>字<rt>zì</rt></ruby>...
      @@ -22934,11 +22705,10 @@ wormhole connection.</mark></p>
      -

      In this more contrived example, the acronym "HTML" has four - annotations: one for the whole acronym, briefly describing what it - is, one for the letters "HT" expanding them to "Hypertext", one for - the letter "M" expanding it to "Markup", and one for the letter "L" - expanding it to "Language".

      +

      In this more contrived example, the acronym "HTML" has four annotations: one for the whole + acronym, briefly describing what it is, one for the letters "HT" expanding them to "Hypertext", + one for the letter "M" expanding it to "Markup", and one for the letter "L" expanding it to + "Language".

      <ruby>
        <ruby>HT<rt>Hypertext</rt>M<rt>Markup</rt>L<rt>Language</rt></ruby>
      @@ -24841,21 +24611,17 @@ interface HTMLImageElement : The img element is completely available.
         

      Otherwise, the attribute must return false.

      -

      The value of complete can thus change while a - script is executing.

      +

      The value of complete can thus change while + a script is executing.

      -

      Three constructors are provided for creating - HTMLImageElement objects (in addition to the factory - methods from DOM Core such as createElement()): Image(), Image(width), and Image(width, height). When invoked as constructors, - these must return a new HTMLImageElement object (a new - img element). If the width argument - is present, the new object's width content attribute must be set to - width. If the height - argument is also present, the new object's height content attribute must be set - to height. The element's document must be the - active document of the browsing context of - the Window object on which the interface object of the - invoked constructor is found.

      +

      Three constructors are provided for creating HTMLImageElement objects (in addition + to the factory methods from DOM such as createElement()): Image(), Image(width), and Image(width, height). When invoked as constructors, + these must return a new HTMLImageElement object (a new img element). If + the width argument is present, the new object's width content attribute must be set to width. If + the height argument is also present, the new object's height content attribute must be set to height. + The element's document must be the active document of the browsing + context of the Window object on which the interface object of the invoked + constructor is found.

      @@ -26480,6 +26246,9 @@ href="?audio">audio</a> test instead.)</p> +
    3. The nested browsing context's Window object's + cross-boundary event parent is the browsing context container. [DOM]

    4. +

      If the attribute is not specified, or if the origin conditions listed above are not met, then the user agent should render the nested browsing context in a manner that is clearly distinguishable as a separate browsing context, and the @@ -28085,19 +27854,15 @@ interface HTMLAudioElement :

      -

      Two constructors are provided for creating - HTMLAudioElement objects (in addition to the factory - methods from DOM Core such as createElement()): Audio() and Audio(src). When invoked as constructors, - these must return a new HTMLAudioElement object (a new - audio element). The element must have its preload attribute set to the - literal value "auto". If the src argument is present, the object created must have - its src content attribute set to - the provided value, and the user agent must invoke the object's - resource selection - algorithm before returning. The element's document must be - the active document of the browsing - context of the Window object on which the - interface object of the invoked constructor is found.

      +

      Two constructors are provided for creating HTMLAudioElement objects (in addition + to the factory methods from DOM such as createElement()): Audio() and Audio(src). When invoked as constructors, these must return a new + HTMLAudioElement object (a new audio element). The element must have its + preload attribute set to the literal value "auto". If the src argument is present, + the object created must have its src content attribute set to + the provided value, and the user agent must invoke the object's resource selection algorithm before returning. The + element's document must be the active document of the browsing context + of the Window object on which the interface object of the invoked constructor is + found.

      @@ -34692,7 +34457,7 @@ interface HTMLCanvasElement : fallback content. (Focus has no effect on mouse interaction events.) - [DOMEVENTS]

      + [DOMEVENTS]


      The canvas element has two attributes to control the size of the coordinate space: width and height. These attributes, when specified, must have @@ -52452,67 +52217,52 @@ interface HTMLOptionElement :

      -

      The disabled - IDL attribute must reflect the content attribute of the - same name. The defaultSelected - IDL attribute must reflect the selected content attribute.

      - -

      The label IDL - attribute, on getting, must return the element's label. On setting, the element's - label content attribute must - be set to the new value.

      - -

      The value IDL - attribute, on getting, must return the element's value. On setting, the element's - value content attribute must - be set to the new value.

      - -

      The selected - IDL attribute, on getting, must return true if the element's selectedness is true, and - false otherwise. On setting, it must set the element's selectedness to the new - value, and then cause the element to ask for a reset.

      - -

      The index IDL - attribute must return the element's index.

      - -

      The text IDL - attribute, on getting, must return the value of the - textContent IDL attribute on the element, with leading and trailing - whitespace stripped, and with any sequences of two or more - space characters replaced by a - single U+0020 SPACE character. On setting, it must act as if the - textContent IDL attribute on the element had been set - to the new value.

      - -

      The form IDL - attribute's behavior depends on whether the option - element is in a select element or not. If the - option has a select element as its parent, - or has an optgroup element as its parent and that - optgroup element has a select element as - its parent, then the form IDL - attribute must return the same value as the form IDL attribute on that - select element. Otherwise, it must return null.

      - -

      Several constructors are provided for creating - HTMLOptionElement objects (in addition to the factory - methods from DOM Core such as createElement()): Option(), Option(text), Option(text, value), Option(text, value, defaultSelected), and Option(text, value, defaultSelected, selected). When invoked as constructors, - these must return a new HTMLOptionElement object (a new - option element). If the text - argument is present, the new object must have as its only child a - Text node whose data is the value of that argument. If - the value argument is present, the new object - must have a value attribute - set with the value of the argument as its value. If the defaultSelected argument is present and true, the new - object must have a selected attribute set with no - value. If the selected argument is present and - true, the new object must have its selectedness set to true; - otherwise the fourth argument is absent or false, and the selectedness must be set - to false, even if the defaultSelected argument - is present and true. The element's document must be the active - document of the browsing context of the - Window object on which the interface object of the - invoked constructor is found.

      +

      The disabled IDL attribute must + reflect the content attribute of the same name. The defaultSelected IDL attribute must + reflect the selected content attribute.

      + +

      The label IDL attribute, on getting, must + return the element's label. On setting, the element's + label content attribute must be set to the new value.

      + +

      The value IDL attribute, on getting, must + return the element's value. On setting, the element's + value content attribute must be set to the new value.

      + +

      The selected IDL attribute, on getting, + must return true if the element's selectedness is + true, and false otherwise. On setting, it must set the element's selectedness to the new value, and then cause the + element to ask for a reset.

      + +

      The index IDL attribute must return the + element's index.

      + +

      The text IDL attribute, on getting, must return + the value of the textContent IDL attribute on the element, with leading and trailing whitespace stripped, and with any + sequences of two or more space characters replaced by a + single U+0020 SPACE character. On setting, it must act as if the textContent IDL + attribute on the element had been set to the new value.

      + +

      The form IDL attribute's behavior depends on + whether the option element is in a select element or not. If the + option has a select element as its parent, or has an + optgroup element as its parent and that optgroup element has a + select element as its parent, then the form IDL + attribute must return the same value as the form IDL attribute + on that select element. Otherwise, it must return null.

      + +

      Several constructors are provided for creating HTMLOptionElement objects (in + addition to the factory methods from DOM such as createElement()): Option(), Option(text), Option(text, value), Option(text, value, defaultSelected), and Option(text, value, defaultSelected, selected). When invoked as constructors, these must return a new + HTMLOptionElement object (a new option element). If the text argument is present, the new object must have as its only child a + Text node whose data is the value of that argument. If the value + argument is present, the new object must have a value + attribute set with the value of the argument as its value. If the defaultSelected argument is present and true, the new object must have a selected attribute set with no value. If the selected argument is present and true, the new object must have its selectedness set to true; otherwise the fourth argument + is absent or false, and the selectedness must be + set to false, even if the defaultSelected argument is present and true. The + element's document must be the active document of the browsing context + of the Window object on which the interface object of the invoked constructor is + found.

      @@ -69441,7 +69191,7 @@ State: <OUTPUT NAME=I>1</OUTPUT> <INPUT VALUE="Increment" TYPE=BU

      When faced with displaying an XML file inline, user agents must first create a Document object, following the requirements of the XML and Namespaces in XML - recommendations, RFC 3023, DOM Core, and other relevant specifications. [XML] [XMLNS] [RFC3023] [DOMCORE]

      + recommendations, RFC 3023, DOM, and other relevant specifications. [XML] [XMLNS] [RFC3023] [DOM]

      The actual HTTP headers and other metadata, not the headers as mutated or implied by the algorithms given in this specification, are the ones that must be used when determining the @@ -73421,6 +73171,7 @@ interface NavigatorOnLine { tasks queued with the user interaction task source. [DOMEVENTS]

      + @@ -73599,104 +73350,86 @@ interface NavigatorOnLine { -

      Many objects can have event handlers specified. These - act as non-capture event listeners for the object on which they are - specified. [DOMCORE]

      +

      Many objects can have event handlers specified. These act as non-capture event + listeners for the object on which they are specified. [DOM]

      -

      An event handler can either - have the value null or be set to a callback object. This is defined - using the EventHandler callback interface type. Initially, event handlers must be set to - null.

      +

      An event handler can either have the value null or be set + to a callback object. This is defined using the EventHandler callback interface type. + Initially, event handlers must be set to null.

      Event handlers are exposed in one of two ways.

      -

      The first way, common to all event handlers, is as an event handler IDL - attribute.

      +

      The first way, common to all event handlers, is as an event handler IDL attribute.

      -

      The second way is as an event handler content attribute. Event handlers - on HTML elements and some of the event handlers on +

      The second way is as an event handler content + attribute. Event handlers on HTML elements and some of the event handlers on Window objects are exposed in this way.

      -

      Event handler IDL attributes, on setting, must set the - corresponding event handler to their new value, and on - getting, must return whatever the current value of the corresponding +


      Event handler IDL attributes, on setting, must set the corresponding event handler + to their new value, and on getting, must return whatever the current value of the corresponding event handler is (possibly null).

      -

      If an event handler - IDL attribute exposes an event - handler of an object that doesn't exist, it must always +

      If an event handler IDL attribute exposes an + event handler of an object that doesn't exist, it must always return null on getting and must do nothing on setting.

      -

      This can happen in particular for event handler IDL attribute on - body elements that do not have corresponding +

      This can happen in particular for event + handler IDL attribute on body elements that do not have corresponding Window objects.

      -

      Certain event handler IDL attributes have additional - requirements, in particular the onmessage attribute of +

      Certain event handler IDL attributes have additional requirements, in particular + the onmessage attribute of MessagePort objects.

      -

      On getting, event handler IDL attributes must return - the value of their corresponding event handlers, except when the - value is an internal error - value, in which case the user agent must set the corresponding - event handler to null, and then throw an exception corresponding to - the error condition.

      +

      On getting, event handler IDL attributes must return the value of their + corresponding event handlers, except when the value is an internal error value, in which case the user agent must set + the corresponding event handler to null, and then throw an exception corresponding to the error + condition.


      -

      Event handler content attributes, when specified, must - contain valid JavaScript code which, when parsed, would match the - FunctionBody production after automatic +

      Event handler content attributes, when specified, must contain valid JavaScript code + which, when parsed, would match the FunctionBody production after automatic semicolon insertion. [ECMA262]

      -

      When an event - handler content attribute is set, if the element is owned by - a Document that is in a browsing context, - and scripting is enabled for - that browsing context, the user agent must run the - following steps to create a script after setting the content - attribute to its new value:

      - -
      1. Set the corresponding event - handler to null.

      2. - -
      3. Set up a script execution environment for - JavaScript.

      4. +

        When an event handler content attribute + is set, if the element is owned by a Document that is in a browsing + context, and scripting is enabled for that + browsing context, the user agent must run the following steps to create a script after setting the content attribute to its new value:

        + +
        1. Set the corresponding event handler to null.

        2. + +
        3. Set up a script execution environment for JavaScript.

        4. -
        5. Let body be the event handler content - attribute's new value.

        6. +
        7. Let body be the event + handler content attribute's new value.

        8. -

          If body is not parsable as - FunctionBody or if parsing detects an early error - then set the event handler content attribute to an - error as defined below, and abort these steps.

          +

          If body is not parsable as FunctionBody or if parsing detects an + early error then set the event handler content attribute to an error as + defined below, and abort these steps.

          -

          FunctionBody is defined in ECMAScript - edition 5 section 13 Function Definition. Early error is - defined in ECMAScript edition 5 section 16 Errors. [ECMA262]

          +

          FunctionBody is defined in ECMAScript edition 5 section 13 Function + Definition. Early error is defined in ECMAScript edition 5 section 16 Errors. [ECMA262]

        9. -

          If body begins with a Directive Prologue - that contains a Use Strict Directive then let strict be true, otherwise let strict be false.

          +

          If body begins with a Directive Prologue that contains a Use Strict + Directive then let strict be true, otherwise let strict + be false.

          -

          The terms "Directive Prologue" and "Use Strict - Directive" are defined in ECMAScript edition 5 section 14.1 - Directive Prologues and the Use Strict Directive. [ECMA262]

          +

          The terms "Directive Prologue" and "Use Strict Directive" are defined in + ECMAScript edition 5 section 14.1 Directive Prologues and the Use Strict Directive. [ECMA262]

        10. @@ -73704,31 +73437,27 @@ interface NavigatorOnLine { currently this is unnecessary: http://www.w3.org/Bugs/Public/show_bug.cgi?id=11977#c4
        11. -

          If strict is true, and anything in body is a SyntaxError according to the - Strict Mode Restrictions, then set the event handler content - attribute to an error as defined below, and abort these - steps.

          +

          If strict is true, and anything in body is a + SyntaxError according to the Strict Mode Restrictions, then set the event + handler content attribute to an error as defined below, and abort these steps.

          -

          The Strict Mode Restrictions are those listed in - ECMAScript edition 5 section 13.1 Strict Mode Restrictions. [ECMA262]

          +

          The Strict Mode Restrictions are those listed in ECMAScript edition 5 section + 13.1 Strict Mode Restrictions. [ECMA262]

        12. -->
        13. -

          Using the script execution environment created above, create a - function object (as defined in ECMAScript edition 5 section 13.2 - Creating Function Objects), with:

          +

          Using the script execution environment created above, create a function object (as defined in + ECMAScript edition 5 section 13.2 Creating Function Objects), with:

          Parameter list FormalParameterList
          -
          If the attribute is the onerror attribute of the - Window object
          +
          If the attribute is the onerror attribute of + the Window object
          Let the function have four arguments, named event, source, lineno, and column.
          @@ -73747,18 +73476,17 @@ currently this is unnecessary: http://www.w3.org/Bugs/Public/show_bug.cgi?id=119
          -
          1. Let Scope be the result of - NewObjectEnvironment(the element's Document, the - global environment).
          2. +
            1. Let Scope be the result of NewObjectEnvironment(the element's + Document, the global environment).
            2. -
            3. If the element has a form owner, let Scope be the result of NewObjectEnvironment(the - element's form owner, Scope).
            4. +
            5. If the element has a form owner, let Scope be the result + of NewObjectEnvironment(the element's form owner, Scope).
            6. -
            7. Let Scope be the result of - NewObjectEnvironment(the element's object, Scope).
            8. +
            9. Let Scope be the result of NewObjectEnvironment(the element's object, + Scope).
            10. -

            NewObjectEnvironment() is defined in ECMAScript - edition 5 section 10.2.2.3 NewObjectEnvironment (O, E). [ECMA262]

            +

          NewObjectEnvironment() is defined in ECMAScript edition 5 section 10.2.2.3 + NewObjectEnvironment (O, E). [ECMA262]

          @@ -73766,35 +73494,29 @@ currently this is unnecessary: http://www.w3.org/Bugs/Public/show_bug.cgi?id=119
          The value of strict.
          -

          Let this new function be the only entry in the script's - list of code entry-points.

          +

          Let this new function be the only entry in the script's list of code + entry-points.

        14. -
        15. Set up the script's global object, the - script's browsing context, the script's - document, the script's referrer source, the - script's URL character encoding, and the - script's base URL from the script settings - determined from the node on which the attribute is being +

        16. Set up the script's global object, the script's browsing + context, the script's document, the script's referrer source, + the script's URL character encoding, and the script's base URL from + the script settings determined from the node on which the attribute is being set.

        17. -
        18. Set the corresponding event - handler to the aforementioned function.

        19. - -

        When a user agent is required, by the steps above, to set - the event handler content attribute to an error, the user - agent must set the corresponding event - handler to an internal - error value representing the error condition, keeping track of - the URL of the resource where the event handler content attribute - was set, and the relevant line number inside that resource where the - error occurred.

        - -

        When an event handler content attribute is removed, the user - agent must set the corresponding event - handler to null.

        +
      5. Set the corresponding event handler to the + aforementioned function.

      6. + +

      When a user agent is required, by the steps above, to set the event handler content + attribute to an error, the user agent must set the corresponding event handler to an internal error value + representing the error condition, keeping track of the URL of the resource where the + event handler content attribute was set, and + the relevant line number inside that resource where the error occurred.

      + +

      When an event handler content attribute is removed, the user agent must set the corresponding + event handler to null.

      -

      When an event handler H of an element or object T - implementing the EventTarget interface is first set to - a non-null value, the user agent must append an event listener to the list of - event listeners - associated with T with type set to the - event handler event type corresponding to H, capture set to false, and listener - set to the event handler processing algorithm defined - below. [DOMCORE]

      - -

      The listener is emphatically not the - event handler itself. Every - event handler ends up registering the same listener, the - algorithm defined below, which takes care of invoking the right - callback, and processing the callback's return value.

      - -

      This only happens the first time the event handler's value is set. Since - listeners are called in the order they were registered, the order of - event listeners for a particular event type will always be first the - event listeners registered with addEventListener() - before the first time the event - handler was set to a non-null value, then the callback to - which it is currently set, if any, and finally the event listeners - registered with addEventListener() - after the first time the event - handler was set to a non-null value.

      +

      When an event handler H of an element + or object T implementing the EventTarget interface is first set + to a non-null value, the user agent must append an event + listener to the list of event listeners + associated with T with type set to the event handler event + type corresponding to H, capture set to false, and + listener set to the event handler processing algorithm defined below. [DOM]

      + +

      The listener is emphatically not the event handler itself. Every event handler ends up registering the same + listener, the algorithm defined below, which takes care of invoking the right callback, and + processing the callback's return value.

      + +

      This only happens the first time the event + handler's value is set. Since listeners are called in the order they were registered, the + order of event listeners for a particular event type will always be first the event listeners + registered with addEventListener() before + the first time the event handler was set to a non-null value, + then the callback to which it is currently set, if any, and finally the event listeners registered + with addEventListener() after the + first time the event handler was set to a non-null value.

      -

      This example demonstrates the order in which event listeners are - invoked. If the button in this example is clicked by the user, the - page will show four alerts, with the text "ONE", "TWO", "THREE", - and "FOUR" respectively.

      +

      This example demonstrates the order in which event listeners are invoked. If the button in + this example is clicked by the user, the page will show four alerts, with the text "ONE", "TWO", + "THREE", and "FOUR" respectively.

      <button id="test">Start Demo</button>
       <script>
      @@ -73862,15 +73577,13 @@ currently this is unnecessary: http://www.w3.org/Bugs/Public/show_bug.cgi?id=119
       
         
      -

      The interfaces implemented by the event object do - not influence whether an event - handler is triggered or not.

      +

      The interfaces implemented by the event object do not influence whether an event handler is triggered or not.

      -

      The event handler processing algorithm for an - event handler H and an Event object E is as follows:

      +

      The event handler processing algorithm for an event + handler H and an Event object E is as + follows:

      -
      1. If H's value is null, then abort these - steps.

      2. +
        1. If H's value is null, then abort these steps.

        2. If H's value is an internal error value, then set the event handler to null and then @@ -73880,14 +73593,11 @@ currently this is unnecessary: http://www.w3.org/Bugs/Public/show_bug.cgi?id=119 handlers">event handler of the Window object of that Document, and abort these steps.

        3. -
        4. Let callback be H's - value, the callback that the event - handler was last set to.

        5. +
        6. Let callback be H's value, the callback that the + event handler was last set to.

        7. -
        8. Invoke callback with one - argument, the value of which is the Event object E, with the callback this value set to - E's currentTarget. Let the - return value be return value. [WEBIDL]

        9. +
        10. Invoke callback with one argument, the value of which is the + Event object E, with the callback this value set to E's currentTarget. Let the return value be return value. [WEBIDL]

        11. @@ -73895,21 +73605,19 @@ currently this is unnecessary: http://www.w3.org/Bugs/Public/show_bug.cgi?id=119
          If the event type is mouseover
          -

          If return value is a boolean with the - value true, then cancel the event.

          +

          If return value is a boolean with the value true, then cancel the + event.

          -
          If the Event object E is a - BeforeUnloadEvent object
          +
          If the Event object E is a BeforeUnloadEvent + object
          -

          If return value is a string, and the - Event object E's returnValue - attribute's value is the empty string, then set the returnValue - attribute's value to return value.

          +

          If return value is a string, and the Event object E's returnValue + attribute's value is the empty string, then set the returnValue attribute's value to return value.

          Otherwise
          -

          If return value is a boolean with the - value false, then cancel the event.

          +

          If return value is a boolean with the value false, then cancel the + event.

          @@ -73917,16 +73625,14 @@ currently this is unnecessary: http://www.w3.org/Bugs/Public/show_bug.cgi?id=119
      -

      The EventHandler interface represents a callback - used for event handlers. It is represented in Web IDL as - follows:

      +

      The EventHandler interface represents a callback used for event handlers. It is + represented in Web IDL as follows:

      [TreatNonCallableAsNull]
       callback EventHandlerNonNull = any (Event event);
       typedef EventHandlerNonNull? EventHandler;
      -

      In JavaScript, any Function object - implements this interface.

      +

      In JavaScript, any Function object implements this interface.

      @@ -73934,19 +73640,17 @@ typedef EventHandlerNonNull? <body onload="alert(this)" onclick="alert(this)">
      -

      ...leads to an alert saying "[object Window]" when the document is loaded, - and an alert saying "[object HTMLBodyElement]" whenever the user - clicks something in the page.

      +

      ...leads to an alert saying "[object Window]" when the document is + loaded, and an alert saying "[object HTMLBodyElement]" whenever the + user clicks something in the page.

      -

      The return value of the function affects whether the - event is canceled or not: as described - above, if the return value is false, the event is canceled - (except for mouseover events, - where the return value has to be true to cancel the event). With - beforeunload events, the - value is instead used to determine the message to show the user.

      +

      The return value of the function affects whether the event is canceled or not: + as described above, if the return value is false, the event is canceled + (except for mouseover events, where the return value has to + be true to cancel the event). With beforeunload events, + the value is instead used to determine the message to show the user.

      For historical reasons, the onerror handler has different arguments:

      @@ -73960,12 +73664,10 @@ typedef OnErrorEventHandlerNonNull? 7.1.6.2 Event handlers on elements, Document objects, and Window objects

    -

    The following are the event handlers (and their - corresponding event handler - event types) that must be supported - by all HTML elements, as both content attributes and - IDL attributes, and on Document and Window - objects, as IDL attributes.

    +

    The following are the event handlers (and their corresponding event handler event types) that must be + supported by all HTML elements, as both content attributes and IDL attributes, and on + Document and Window objects, as IDL attributes.

    Event handler Event handler event type
    onabort abort @@ -74122,12 +73824,15 @@ typedef OnErrorEventHandlerNonNull? 7.1.6.4 Events and the Window object -

    When an event is dispatched at a DOM node in a - Document in a browsing context, if the - event is not a load event, the user - agent must act as if, for the purposes of event dispatching, the - Window object is the parent of the - Document object. [DOMCORE]

    +

    When an event is dispatched at a DOM node in a Document in a browsing + context, if the event is not a load event, the user agent + must act as if, for the purposes of event dispatching, + the Window object is the parent of the Document object. [DOM]

    + + @@ -82211,9 +81916,9 @@ interface WorkerUtils { WorkerUtils implements WindowBase64; -

    The DOM APIs — specifically, all the interfaces defind in the DOM Core specification - other than exceptions — must not be exposed if the - JavaScript global environment is a worker environment. [DOMCORE]

    +

    The DOM APIs — specifically, all the interfaces defind in the DOM specification other + than exceptions — must not be exposed if the JavaScript + global environment is a worker environment. [DOMCORE]

    9.3.1 Importing scripts and libraries

    @@ -90625,7 +90330,7 @@ document.body.appendChild(text);

    DOM mutation events must not fire for changes caused by the UA parsing the document. This includes the parsing of any content inserted using document.write() and document.writeln() calls. [DOMEVENTS]

    -

    However, mutation observers do fire, as required by the DOM Core specification.

    +

    However, mutation observers do fire, as required by the DOM specification.

    Not all of the tag names mentioned below are conformant tag names in this specification; many are included to @@ -95322,42 +95027,37 @@ document.body.appendChild(text);

    13.2 Parsing XHTML documents

    -

    This section describes the relationship between XML and the DOM, - with a particular emphasis on how this interacts with HTML.

    +

    This section describes the relationship between XML and the DOM, with a particular emphasis on + how this interacts with HTML.

    -

    An XML parser, for the purposes of this specification, - is a construct that follows the rules given in the XML specification - to map a string of bytes or characters into a Document - object.

    +

    An XML parser, for the purposes of this specification, is a construct that follows + the rules given in the XML specification to map a string of bytes or characters into a + Document object.

    -

    An XML parser is either associated with a - Document object when it is created, or creates one - implicitly.

    +

    An XML parser is either associated with a Document object when it is + created, or creates one implicitly.

    This Document must then be populated with DOM nodes that represent the tree structure of the input passed to the parser, as defined by the XML specification, the Namespaces - in XML specification, and the DOM Core specification. DOM mutation events must not fire for the + in XML specification, and the DOM specification. DOM mutation events must not fire for the operations that the XML parser performs on the Document's tree, but the user agent must act as if elements and attributes were individually appended and set respectively so as to trigger rules in this specification regarding what happens when an element is inserted - into a document or has its attributes set, and the DOM Core specification's requirements regarding - mutation observers mean that mutation observers are fired (unlike mutation events). [XML] [XMLNS] [DOMCORE] [DOMEVENTS]

    + into a document or has its attributes set, and the DOM specification's requirements regarding + mutation observers mean that mutation observers are fired (unlike mutation events). [XML] [XMLNS] [DOM] [DOMEVENTS]

    -

    Between the time an element's start tag is parsed and the time - either the element's end tag is parsed or the parser detects a - well-formedness error, the user agent must act as if the element was - in a stack of open elements.

    +

    Between the time an element's start tag is parsed and the time either the element's end tag is + parsed or the parser detects a well-formedness error, the user agent must act as if the element + was in a stack of open elements.

    -

    This is used by the object element to - avoid instantiating plugins before the param element - children have been parsed.

    +

    This is used by the object element to avoid instantiating plugins + before the param element children have been parsed.

    -

    This specification provides the following additional information - that user agents should use when retrieving an external entity: the - public identifiers given in the following list all correspond to the URL given by this - link. (This URL is a DTD containing the entity reference - declarations for the names listed in the named character - references section.)

    +

    This specification provides the following additional information that user agents should use + when retrieving an external entity: the public identifiers given in the following list all + correspond to the URL given by this link. (This + URL is a DTD containing the entity reference declarations for the names listed in the named + character references section.)

    • -//W3C//DTD XHTML 1.0 Transitional//EN
    • -//W3C//DTD XHTML 1.1//EN
    • @@ -95539,23 +95239,19 @@ document.body.appendChild(text);
    • -

      If there is a context element, - feed the parser just created the string corresponding - to the start tag of that element, declaring all the namespace - prefixes that are in scope on that element in the DOM, as well as - declaring the default namespace (if any) that is in scope on that - element in the DOM.

      +

      If there is a context element, feed the + parser just created the string corresponding to the start tag of that element, declaring + all the namespace prefixes that are in scope on that element in the DOM, as well as declaring + the default namespace (if any) that is in scope on that element in the DOM.

      -

      A namespace prefix is in scope if the DOM Core lookupNamespaceURI() method on the element would - return a non-null value for that prefix.

      +

      A namespace prefix is in scope if the DOM lookupNamespaceURI() method + on the element would return a non-null value for that prefix.

      -

      The default namespace is the namespace for which the DOM Core - isDefaultNamespace() method on the element - would return true.

      +

      The default namespace is the namespace for which the DOM isDefaultNamespace() method on the element would return true.

      -

      If there is a context element, no DOCTYPE is passed to the parser, and therefore no - external subset is referenced, and therefore no entities will be - recognized.

      +

      If there is a context element, no + DOCTYPE is passed to the parser, and therefore no external subset is + referenced, and therefore no entities will be recognized.

    • @@ -98676,7 +98372,7 @@ if (s = prompt('What is your name?')) {
      event on script elements
      for on script elements
      -

      Use DOM Events mechanisms to register event listeners. [DOMCORE]

      +

      Use DOM Events mechanisms to register event listeners. [DOM]

      datapagesize on table elements

      Unnecessary. Omit it altogether.

      @@ -103917,14 +103613,14 @@ if (s = prompt('What is your name?')) {
      [DASH]
      Dynamic adaptive streaming over HTTP (DASH). ISO.
      -
      [DOMCORE]
      -
      Web DOM Core, A. van Kesteren. WHATWG.
      +
      [DOM]
      +
      DOM, A. van Kesteren, A. Gregor, Ms2ger. WHATWG.
      [DOMEVENTS]
      Document Object Model (DOM) Level 3 Events Specification, T. Leithead, J. Rossi, D. Schepers, B. Höhrmann, P. Le Hégaret, T. Pixley. W3C.
      [DOMPARSING]
      -
      DOM Parsing and Serialization, Ms2ger. html5.org.
      +
      DOM Parsing and Serialization, Ms2ger. WHATWG.
      [DOT]
      (Non-normative) The DOT Language. Graphviz.
      @@ -103939,7 +103635,7 @@ if (s = prompt('What is your name?')) {
      (Non-normative) ECMAScript for XML (E4X) Specification. ECMA.
      [EDITING]
      -
      HTML Editing APIs, A. Gregor.
      +
      HTML Editing APIs, A. Gregor. W3C Editing APIs CG.
      [EUCKR]
      Hangul Unix Environment. Korea Industrial Standards Association. Ref. No. KS C 5861-1992.
      diff --git a/source b/source index a58a5e2a0fd..88ca4b6c2dc 100644 --- a/source +++ b/source @@ -24,10 +24,10 @@ interface ArrayBuffer { }; // TypedArray interface ArrayBufferView { }; // TypedArray interface Uint8ClampedArray { }; // TypedArray - interface XMLDocument { }; // DOM Core - interface HTMLCollection { }; // DOM Core - interface DOMTokenList { }; // DOM Core - interface DOMSettableTokenList { attribute any value; }; // DOM Core + interface XMLDocument { }; // DOM + interface HTMLCollection { }; // DOM + interface DOMTokenList { }; // DOM + interface DOMSettableTokenList { attribute any value; }; // DOM interface SVGMatrix { }; // SVG @@ -73,7 +73,7 @@ relative to other specifications can be best summed up as follows:

      -

      It consists of everything else, above such core technologies as HTTP, URI/IRIs, DOM Core, XML, Unicode, and ECMAScript; below presentation-layer technologies like CSS, XBL, and the NPAPI; and to the side of technologies like Geolocation, SVG, MathML, and XHR.

      +

      It consists of everything else, above such core technologies as HTTP, URI/IRIs, DOM, XML, Unicode, and ECMAScript; below presentation-layer technologies like CSS, XBL, and the NPAPI; and to the side of technologies like Geolocation, SVG, MathML, and XHR.

      @@ -404,24 +404,21 @@

      This section is non-normative.

      -

      This specification is intended for authors of documents and - scripts that use the features defined in this specification, implementors of tools that operate on pages that use - the features defined in this specification, and individuals wishing - to establish the correctness of documents or implementations with - respect to the requirements of this specification.

      +

      This specification is intended for authors of documents and scripts that use the features + defined in this specification, implementors of tools that operate on pages that + use the features defined in this specification, and individuals wishing to establish the + correctness of documents or implementations with respect to the requirements of this + specification.

      -

      This document is probably not suited to readers who do not - already have at least a passing familiarity with Web technologies, - as in places it sacrifices clarity for precision, and brevity for - completeness. More approachable tutorials and authoring guides can - provide a gentler introduction to the topic.

      +

      This document is probably not suited to readers who do not already have at least a passing + familiarity with Web technologies, as in places it sacrifices clarity for precision, and brevity + for completeness. More approachable tutorials and authoring guides can provide a gentler + introduction to the topic.

      -

      In particular, familiarity with the basics of DOM Core and DOM - Events is necessary for a complete understanding of some of the more - technical parts of this specification. An understanding of Web IDL, - HTTP, XML, Unicode, character encodings, JavaScript, and CSS will - also be helpful in places but is not essential.

      +

      In particular, familiarity with the basics of DOM is necessary for a complete understanding of + some of the more technical parts of this specification. An understanding of Web IDL, HTTP, XML, + Unicode, character encodings, JavaScript, and CSS will also be helpful in places but is not + essential.

      Scope

      @@ -2021,72 +2018,57 @@ a.setAttribute('href', 'http://example.com/'); // change the content attribute d

      Terminology

      -

      This specification refers to both HTML and XML attributes and IDL - attributes, often in the same context. When it is not clear which is - being referred to, they are referred to as content - attributes for HTML and XML attributes, and IDL - attributes for those defined on IDL interfaces. Similarly, the - term "properties" is used for both JavaScript object properties and - CSS properties. When these are ambiguous they are qualified as object properties and CSS - properties respectively.

      - -

      Generally, when the specification states that a feature applies - to the HTML syntax or the XHTML syntax, it - also includes the other. When a feature specifically only applies to - one of the two languages, it is called out by explicitly stating - that it does not apply to the other format, as in "for HTML, - ... (this does not apply to XHTML)".

      - -

      This specification uses the term document to - refer to any use of HTML, ranging from short static documents to - long essays or reports with rich multimedia, as well as to - fully-fledged interactive applications. The term is used to refer - both to Document objects and their descendant DOM - trees, and to serialized byte streams using the HTML syntax or XHTML syntax, depending on context.

      - -

      In the context of the DOM structures, the terms HTML document and XML - document are used as defined in the DOM Core specification, - and refer specifically to two different modes that - Document objects can find themselves in. [DOMCORE] (Such uses are always hyperlinked - to their definition.)

      - -

      In the context of byte streams, the term HTML document refers to - resources labeled as text/html, and the term XML - document refers to resources labeled with an XML MIME - type.

      - -

      The term XHTML document is used to refer to both - Documents in the XML - document mode that contains element nodes in the HTML - namespace, and byte streams labeled with an XML MIME - type that contain elements from the HTML - namespace, depending on context.

      +

      This specification refers to both HTML and XML attributes and IDL attributes, often in the same + context. When it is not clear which is being referred to, they are referred to as content attributes for HTML and XML attributes, and IDL + attributes for those defined on IDL interfaces. Similarly, the term "properties" is used for + both JavaScript object properties and CSS properties. When these are ambiguous they are qualified + as object properties and CSS properties respectively.

      + +

      Generally, when the specification states that a feature applies to the HTML syntax + or the XHTML syntax, it also includes the other. When a feature specifically only + applies to one of the two languages, it is called out by explicitly stating that it does not apply + to the other format, as in "for HTML, ... (this does not apply to XHTML)".

      + +

      This specification uses the term document to refer to any use of HTML, + ranging from short static documents to long essays or reports with rich multimedia, as well as to + fully-fledged interactive applications. The term is used to refer both to Document + objects and their descendant DOM trees, and to serialized byte streams using the HTML syntax or XHTML syntax, depending + on context.

      + +

      In the context of the DOM structures, the terms HTML + document and XML document are used as defined in the DOM + specification, and refer specifically to two different modes that Document objects + can find themselves in. [DOM] (Such uses are always hyperlinked to their + definition.)

      + +

      In the context of byte streams, the term HTML document refers to resources labeled as + text/html, and the term XML document refers to resources labeled with an XML + MIME type.

      + +

      The term XHTML document is used to refer to both Documents in the XML document mode that contains element nodes in the HTML + namespace, and byte streams labeled with an XML MIME type that contain + elements from the HTML namespace, depending on context.


      -

      For simplicity, terms such as shown, displayed, and visible might - sometimes be used when referring to the way a document is rendered - to the user. These terms are not meant to imply a visual medium; - they must be considered to apply to other media in equivalent - ways.

      +

      For simplicity, terms such as shown, displayed, and + visible might sometimes be used when referring to the way a document is + rendered to the user. These terms are not meant to imply a visual medium; they must be considered + to apply to other media in equivalent ways.

      -

      When an algorithm B says to return to another algorithm A, it - implies that A called B. Upon returning to A, the implementation - must continue from where it left off in calling B.

      +

      When an algorithm B says to return to another algorithm A, it implies that A called B. Upon + returning to A, the implementation must continue from where it left off in calling B.

      -

      The term "transparent black" refers to the color with red, green, - blue, and alpha channels all set to zero.

      +

      The term "transparent black" refers to the color with red, green, blue, and alpha channels all + set to zero.

      Resources

      @@ -2249,28 +2231,25 @@ a.setAttribute('href', 'http://example.com/'); // change the content attribute d

      Scripting

      -

      The construction "a Foo object", where - Foo is actually an interface, is sometimes used instead - of the more accurate "an object implementing the interface +

      The construction "a Foo object", where Foo is actually an interface, + is sometimes used instead of the more accurate "an object implementing the interface Foo".

      -

      An IDL attribute is said to be getting when - its value is being retrieved (e.g. by author script), and is said to - be setting when a new value is assigned to - it.

      +

      An IDL attribute is said to be getting when its value is being retrieved + (e.g. by author script), and is said to be setting when a new value is + assigned to it.

      -

      If a DOM object is said to be live, then the - attributes and methods on that object must - operate on the actual underlying data, not a snapshot of the +

      If a DOM object is said to be live, then the attributes and methods on that object + must operate on the actual underlying data, not a snapshot of the data.

      In the contexts of events, the terms fire and dispatch are used as defined in the - DOM Core specification: firing an event means to create and - dispatch it, and firing an event means to create and dispatch it, and dispatching an event means to follow the steps that propagate the event through the tree. The term trusted event is used to refer to events whose isTrusted attribute is - initialized to true. [DOMCORE]

      + initialized to true. [DOM]

      Plugins

      @@ -2909,20 +2888,17 @@ a.setAttribute('href', 'http://example.com/'); // change the content attribute d
      -

      The Document Object Model (DOM) is a representation — a - model — of a document and its content. The DOM is not just - an API; the conformance criteria of HTML implementations are - defined, in this specification, in terms of operations on the DOM. - [DOMCORE]

      +

      The Document Object Model (DOM) is a representation — a model — of a document and + its content. The DOM is not just an API; the conformance criteria of HTML implementations are + defined, in this specification, in terms of operations on the DOM. [DOM]

      -

      Implementations must support DOM Core and the events defined in - DOM Events, because this specification is defined in terms of the - DOM, and some of the features are defined as extensions to the DOM - Core interfaces. [DOMCORE] [DOMEVENTS]

      +

      Implementations must support DOM and the events defined in DOM Events, because this + specification is defined in terms of the DOM, and some of the features are defined as extensions + to the DOM interfaces. [DOM] [DOMEVENTS]

      -

      In particular, the following features are defined in the DOM - Core specification: [DOMCORE]

      +

      In particular, the following features are defined in the DOM specification: [DOM]

        @@ -2970,6 +2946,7 @@ a.setAttribute('href', 'http://example.com/'); // change the content attribute d
      • isTrusted attribute
      • The type of an event
      • The concept of an event listener and the event listeners associated with an EventTarget
      • +
      • The concept of a regular event parent and a cross-boundary event parent
      • The encoding (herein the character encoding) and content type of a Document
      • The distinction between XML documents and HTML documents
      • @@ -2986,10 +2963,9 @@ a.setAttribute('href', 'http://example.com/'); // change the content attribute d
      -

      The term throw in this specification is used as - defined in the DOM Core specification. The following - DOMException types are defined in the DOM Core - specification: [DOMCORE]

      +

      The term throw in this specification is used as defined in the DOM specification. + The following DOMException types are defined in the DOM specification: [DOM]

      1. IndexSizeError
      2. @@ -3015,20 +2991,17 @@ a.setAttribute('href', 'http://example.com/'); // change the content attribute d
      3. DataCloneError
      -

      For example, to throw a - TimeoutError exception, a user agent would - construct a DOMException object whose type was the - string "TimeoutError" (and whose code was - the number 23, for legacy reasons) and actually throw that object - as an exception.

      +

      For example, to throw a TimeoutError exception, a user + agent would construct a DOMException object whose type was the string "TimeoutError" (and whose code was the number 23, for legacy reasons) and + actually throw that object as an exception.

      -

      The URL associated - with a Document, as defined in the DOM Core - specification, is referred to in this specification as the - document's address.

      +

      The URL associated with a Document, as + defined in the DOM specification, is referred to in this specification as the document's + address.

      -

      The following features are defined in the DOM Events - specification: [DOMEVENTS]

      +

      The following features are defined in the DOM Events specification: [DOMEVENTS]

        @@ -7311,7 +7284,7 @@ a.setAttribute('href', 'http://example.com/'); // change the content attribute d affected by a base URL change.

        The following are base URL change steps, which run when an element is - affected by a base URL change (as defined by the DOM Core specification):

        + affected by a base URL change (as defined by the DOM specification):

        @@ -9002,8 +8975,8 @@ http://software.hixie.ch/utilities/js/live-dom-viewer/?%3C%21DOCTYPE%20html%3E.. node of reference. Otherwise, let parent be the select element on which the HTMLOptionsCollection is rooted.

        -
      • Act as if the DOM Core insertBefore() method - was invoked on the parent node, with element as the first +

      • Act as if the DOM insertBefore() method was + invoked on the parent node, with element as the first argument and reference as the second argument.

        @@ -9503,31 +9476,6 @@ interface Transferable { }; -

        DOM feature strings

        - -

        DOM3 Core defines mechanisms for checking for interface support, - and for obtaining implementations of interfaces, using feature - strings. [DOMCORE]

        - -

        Authors are strongly discouraged from using these, as they are - notoriously unreliable and imprecise. Authors are encouraged to rely - on explicit feature testing or the graceful degradation behavior - intrinsic to some of the features in this specification.

        - -
        - -

        For historical reasons, user agents should return the true value - when the hasFeature(feature, version) - method of the DOMImplementation interface is invoked - with feature set to either "HTML" or "XHTML" and version set to either "1.0" or - "2.0".

        - -
        -
        @@ -9587,62 +9535,48 @@ interface Transferable { };

        Documents

        -

        Every XML and HTML document in an HTML UA is represented by a - Document object. [DOMCORE]

        - -

        The document's address is an absolute URL - that is initially set when the Document is created but - that can change during the lifetime of the Document, - for example when the user navigates to - a fragment identifier on the - page or when the pushState() method is called - with a new URL.

        +

        Every XML and HTML document in an HTML UA is represented by a Document object. [DOM]

        + +

        The document's address is an absolute URL that is initially set when + the Document is created but that can change during the lifetime of the + Document, for example when the user navigates to a + fragment identifier on the page or when the pushState() method is called with a new URL.

        -

        Interactive user agents typically expose - the document's address in their user interface. This is - the primary mechanism by which a user can tell if a site is +

        Interactive user agents typically expose the document's address in + their user interface. This is the primary mechanism by which a user can tell if a site is attempting to impersonate another.

        -

        When a Document is created by a script using the createDocument() - or createHTMLDocument() - APIs, the document's address is the same as the - document's address of the script's document, and - the Document is both ready for post-load - tasks and completely loaded immediately.

        - -

        Each Document object has a reload override - flag that is originally unset. The flag is set by the document.open() and document.write() methods in certain - situations. When the flag is set, the Document also has - a reload override buffer which is a Unicode string that - is used as the source of the document when it is reloaded.

        - -

        When the user agent is to perform an overridden - reload, it must act as follows:

        +

        When a Document is created by a script using + the createDocument() or createHTMLDocument() APIs, the + document's address is the same as the document's address of the script's + document, and the Document is both ready for post-load tasks and + completely loaded immediately.

        + +

        Each Document object has a reload override flag that is originally + unset. The flag is set by the document.open() and document.write() methods in certain situations. When the flag is + set, the Document also has a reload override buffer which is a Unicode + string that is used as the source of the document when it is reloaded.

        + +

        When the user agent is to perform an overridden reload, it must act as follows:

          -
        1. Let source be the value of the - browsing context's active document's - reload override buffer.

        2. +
        3. Let source be the value of the browsing context's + active document's reload override buffer.

        4. -
        5. Navigate the - browsing context to a resource whose source is source, with replacement enabled. When - the navigate algorithm creates a Document - object for this purpose, set that Document's - reload override flag and set its reload override - buffer to source.

        6. +
        7. Navigate the browsing context + to a resource whose source is source, with replacement enabled. + When the navigate algorithm creates a Document object for this purpose, + set that Document's reload override flag and set its reload + override buffer to source.

        @@ -9650,9 +9584,8 @@ interface Transferable { };

        The Document object

        -

        The DOM Core specification defines a Document interface, which this specification - extends significantly:

        +

        The DOM specification defines a Document interface, which + this specification extends significantly:

        [OverrideBuiltins]
         partial /*sealed*/ interface Document {
        @@ -11147,30 +11080,25 @@ interface HTMLUnknownElement : HTMLElement { };
        The id attribute
        -

        The id attribute specifies its - element's unique identifier (ID). [DOMCORE]

        +

        The id attribute specifies its element's unique identifier (ID). [DOM]

        -

        The value must be unique amongst all the IDs in the element's home - subtree and must contain at least one character. The value - must not contain any space - characters.

        +

        The value must be unique amongst all the IDs in the element's + home subtree and must contain at least one character. The value must not contain any + space characters.

        - + -

        An element's unique - identifier can be used for a variety of purposes, most - notably as a way to link to specific parts of a document using - fragment identifiers, as a way to target an element when scripting, - and as a way to style a specific element from CSS.

        +

        An element's unique identifier can be used for a + variety of purposes, most notably as a way to link to specific parts of a document using fragment + identifiers, as a way to target an element when scripting, and as a way to style a specific + element from CSS.

        -

        Identifiers are opaque strings. Particular meanings should not be - derived from the value of the id - attribute.

        +

        Identifiers are opaque strings. Particular meanings should not be derived from the value of the + id attribute.

        @@ -11767,44 +11695,37 @@ Transport Protocol">HTTP</abbr> today.</p> "
      -

      The script element allows authors to include dynamic - script and data blocks in their documents. The element does not - represent content for the user.

      - -

      When used to include dynamic scripts, the scripts may either be - embedded inline or may be imported from an external file using the - src attribute. If the language - is not that described by "text/javascript", - then the type attribute must - be present, as described below. Whatever language is used, the - contents of the script element must conform with the +

      The script element allows authors to include dynamic script and data blocks in + their documents. The element does not represent content for the + user.

      + +

      When used to include dynamic scripts, the scripts may either be embedded inline or may be + imported from an external file using the src attribute. If + the language is not that described by "text/javascript", then the type attribute must be present, as described below. Whatever + language is used, the contents of the script element must conform with the requirements of that language's specification.

      -

      When used to include data blocks (as opposed to scripts), the - data must be embedded inline, the format of the data must be given - using the type attribute, the - src attribute must not be - specified, and the contents of the script element must - conform to the requirements defined for the format used.

      - -

      The type - attribute gives the language of the script or format of the data. If - the attribute is present, its value must be a valid MIME - type. The charset parameter must not be - specified. The default, which is used if the attribute is absent, - is "text/javascript".

      - -

      The src - attribute, if specified, gives the address of the external script - resource to use. The value of the attribute must be a valid - non-empty URL potentially surrounded by spaces identifying a - script resource of the type given by the type attribute, if the attribute is - present, or of the type "text/javascript", if - the attribute is absent. A resource is a script resource of a given - type if that type identifies a scripting language and the resource +

      When used to include data blocks (as opposed to scripts), the data must be embedded inline, the + format of the data must be given using the type attribute, + the src attribute must not be specified, and the contents of + the script element must conform to the requirements defined for the format used.

      + +

      The type attribute gives the language of the + script or format of the data. If the attribute is present, its value must be a valid MIME + type. The charset parameter must not be specified. The default, which + is used if the attribute is absent, is "text/javascript".

      + +

      The src attribute, if specified, gives the + address of the external script resource to use. The value of the attribute must be a valid + non-empty URL potentially surrounded by spaces identifying a script resource of the type + given by the type attribute, if the attribute is present, or + of the type "text/javascript", if the attribute is absent. A resource is a + script resource of a given type if that type identifies a scripting language and the resource conforms with the requirements of that language's specification.

      -

      The charset - attribute gives the character encoding of the external script - resource. The attribute must not be specified if the src attribute is not present. If the - attribute is set, its value must be a valid character encoding name, - must be an ASCII case-insensitive match for the - preferred MIME name for that encoding, and must match - the encoding given in the charset parameter of - the Content-Type metadata of the - external file, if any. [IANACHARSET]

      +

      The charset attribute gives the character + encoding of the external script resource. The attribute must not be specified if the src attribute is not present. If the attribute is set, its value + must be a valid character encoding name, must be an ASCII case-insensitive match for + the preferred MIME name for that encoding, and must match the encoding given in the + charset parameter of the Content-Type + metadata of the external file, if any. [IANACHARSET]

      + +

      The async and defer attributes are boolean attributes that indicate how the script should be executed. The defer and async attributes + must not be specified if the src attribute is not + present.

      -

      The async and - defer attributes - are boolean attributes that - indicate how the script should be executed. The defer and async attributes must not be - specified if the src attribute - is not present.

      - -

      There are three possible modes that can be selected using these - attributes. If the async - attribute is present, then the script will be executed - asynchronously, as soon as it is available. If the async attribute is not present but - the defer attribute is - present, then the script is executed when the page has finished - parsing. If neither attribute is present, then the script is - fetched and executed immediately, before the user agent continues +

      There are three possible modes that can be selected using these attributes. If the async attribute is present, then the script will be executed + asynchronously, as soon as it is available. If the async + attribute is not present but the defer attribute is + present, then the script is executed when the page has finished parsing. If neither attribute is + present, then the script is fetched and executed immediately, before the user agent continues parsing the page.

      -

      The exact processing details for these attributes - are, for mostly historical reasons, somewhat non-trivial, involving - a number of aspects of HTML. The implementation requirements are - therefore by necessity scattered throughout the specification. The - algorithms below (in this section) describe the core of this - processing, but these algorithms reference and are referenced by the - parsing rules for script start - and end tags in HTML, in foreign content, and in XML, the rules for the document.write() method, the - handling of scripting, etc.

      - -

      The defer attribute may be - specified even if the async - attribute is specified, to cause legacy Web browsers that only - support defer (and not The exact processing details for these attributes are, for mostly historical + reasons, somewhat non-trivial, involving a number of aspects of HTML. The implementation + requirements are therefore by necessity scattered throughout the specification. The algorithms + below (in this section) describe the core of this processing, but these algorithms reference and + are referenced by the parsing rules for script start and end tags in HTML, in foreign content, + and in XML, the rules for the document.write() method, the handling of scripting, etc.

      + +

      The defer attribute may be specified even if the async attribute is specified, to cause legacy Web browsers that + only support defer (and not async) to fall back to the defer behavior instead of the - synchronous blocking behavior that is the default.

      + title="attr-script-defer">defer
      behavior instead of the synchronous blocking behavior that + is the default.

      The crossorigin attribute is a CORS settings attribute. It controls, for scripts that are obtained from other

      -

      A script element has several associated pieces of - state.

      +

      A script element has several associated pieces of state.

      -

      The first is a flag indicating whether or not the script block - has been "already started". Initially, - script elements must have this flag unset (script - blocks, when created, are not "already started"). The cloning steps for - script elements must set the "already started" flag on - the copy if it is set on the element being cloned.

      - -

      The second is a flag indicating whether the element was - "parser-inserted". Initially, script - elements must have this flag unset. It is set by the HTML - parser and the XML parser on script - elements they insert and affects the processing of those - elements.

      +

      The first is a flag indicating whether or not the script block has been "already + started". Initially, script elements must have this flag unset (script blocks, + when created, are not "already started"). The cloning + steps for script elements must set the "already started" flag on the copy if + it is set on the element being cloned.

      -

      The third is a flag indicating whether the element will - "force-async". Initially, script elements - must have this flag set. It is unset by the HTML parser - and the XML parser on script elements they - insert. In addition, whenever a script element whose - "force-async" flag is set has a async content attribute added, the - element's "force-async" flag must be unset.

      - -

      The fourth is a flag indicating whether or not the script block is - "ready to be parser-executed". Initially, - script elements must have this flag unset (script - blocks, when created, are not "ready to be parser-executed"). This - flag is used only for elements that are also - "parser-inserted", to let the parser know when to - execute the script.

      - -

      The last few pieces of state are the script block's - type, the script block's character - encoding, and the script block's fallback - character encoding. They are determined when the script - is prepared, based on the attributes on the element at that time, - and the Document of the script - element.

      +

      The second is a flag indicating whether the element was "parser-inserted". + Initially, script elements must have this flag unset. It is set by the HTML + parser and the XML parser on script elements they insert and + affects the processing of those elements.

      -

      When a script element that is not marked as being - "parser-inserted" experiences one of the events listed - in the following list, the user agent must synchronously prepare the script - element:

      +

      The third is a flag indicating whether the element will "force-async". Initially, + script elements must have this flag set. It is unset by the HTML parser + and the XML parser on script elements they insert. In addition, whenever + a script element whose "force-async" flag is set has a async content attribute added, the element's + "force-async" flag must be unset.

      + +

      The fourth is a flag indicating whether or not the script block is "ready to be + parser-executed". Initially, script elements must have this flag unset (script + blocks, when created, are not "ready to be parser-executed"). This flag is used only for elements + that are also "parser-inserted", to let the parser know when to execute the + script.

      + +

      The last few pieces of state are the script block's type, the + script block's character encoding, and the script block's fallback character + encoding. They are determined when the script is prepared, based on the attributes on + the element at that time, and the Document of the script element.

      + +

      When a script element that is not marked as being "parser-inserted" + experiences one of the events listed in the following list, the user agent must synchronously + prepare the script element:

        @@ -17067,38 +16951,34 @@ c-end = "-->" script element, after any script elements inserted at that time. -
      • The script element is in a - Document and has a src attribute set where previously - the element had no such attribute.
      • +
      • The script element is in a Document and has a src attribute set where previously the element had no such + attribute.
      -

      To prepare a script, the user - agent must act as follows:

      +

      To prepare a script, the user agent must act as + follows:

      1. -

        If the script element is marked as having - "already started", then the user agent must abort - these steps at this point. The script is not executed.

        +

        If the script element is marked as having "already started", then + the user agent must abort these steps at this point. The script is not executed.

      2. -

        If the element has its "parser-inserted" flag set, - then set was-parser-inserted to true and unset - the element's "parser-inserted" flag. Otherwise, set - was-parser-inserted to false.

        +

        If the element has its "parser-inserted" flag set, then set was-parser-inserted to true and unset the element's + "parser-inserted" flag. Otherwise, set was-parser-inserted to + false.

        -

        This is done so that if parser-inserted - script elements fail to run when the parser tries to - run them, e.g. because they are empty or specify an unsupported - scripting language, another script can later mutate them and cause - them to run again.

        +

        This is done so that if parser-inserted script elements fail to run + when the parser tries to run them, e.g. because they are empty or specify an unsupported + scripting language, another script can later mutate them and cause them to run again.

        @@ -17106,34 +16986,29 @@ c-end = "-->"
      3. -

        If was-parser-inserted is true and the - element does not have an async attribute, then set the - element's "force-async" flag to true.

        +

        If was-parser-inserted is true and the element does not have an async attribute, then set the element's + "force-async" flag to true.

        -

        This is done so that if a parser-inserted - script element fails to run when the parser tries to - run it, but it is later executed after a script dynamically - updates it, it will execute asynchronously even if the - async attribute isn't - set.

        +

        This is done so that if a parser-inserted script element fails to + run when the parser tries to run it, but it is later executed after a script dynamically updates + it, it will execute asynchronously even if the async + attribute isn't set.

      4. -

        If the element has no src - attribute, and its child nodes, if any, consist only of comment - nodes and empty Text nodes, then the user agent must - abort these steps at this point. The script is not executed.

        +

        If the element has no src attribute, and its child + nodes, if any, consist only of comment nodes and empty Text nodes, then the user + agent must abort these steps at this point. The script is not executed.

      5. -

        If the element is not in a Document, - then the user agent must abort these steps at this point. The - script is not executed.

        +

        If the element is not in a Document, then the user agent must abort + these steps at this point. The script is not executed.

      6. @@ -17143,140 +17018,116 @@ c-end = "-->"
          -
        • the script element has a type attribute and its value is - the empty string, or
        • +
        • the script element has a type attribute + and its value is the empty string, or
        • -
        • the script element has no type attribute but it has a language attribute and - that attribute's value is the empty string, or
        • +
        • the script element has no type attribute + but it has a language attribute and that + attribute's value is the empty string, or
        • -
        • the script element has neither a type attribute nor a language attribute, then
        • +
        • the script element has neither a type + attribute nor a language attribute, then
        -

        ...let the script block's type for this - script element be "...let the script block's type for this script element be "text/javascript".

        Otherwise, if the script element has a type attribute, let the - script block's type for this script element be - the value of that attribute with any leading or trailing sequences - of space characters - removed.

        + title="attr-script-type">type
        attribute, let the script block's type for this + script element be the value of that attribute with any leading or trailing + sequences of space characters removed.

        -

        Otherwise, the element has a non-empty language attribute; let - the script block's type for this script - element be the concatenation of the string "text/" followed by the value of the language attribute.

        +

        Otherwise, the element has a non-empty language + attribute; let the script block's type for this script element be the + concatenation of the string "text/" followed by the value of the language attribute.

        -

        The language attribute is never - conforming, and is always ignored if there is a type attribute present.

        +

        The language attribute is never + conforming, and is always ignored if there is a type + attribute present.

      7. -

        If the user agent does not support the scripting - language given by the script block's type for - this script element, then the user agent must abort +

        If the user agent does not support the scripting language given by the + script block's type for this script element, then the user agent must abort these steps at this point. The script is not executed.

      8. -

        If was-parser-inserted is true, then flag - the element as "parser-inserted" again, and set the - element's "force-async" flag to false.

        +

        If was-parser-inserted is true, then flag the element as + "parser-inserted" again, and set the element's "force-async" flag to + false.

      9. -

        The user agent must set the element's "already - started" flag.

        +

        The user agent must set the element's "already started" flag.

        The state of the element at this moment is later used to - determine the script source.

        + href="#establish-script-block-source">is later used to determine the script source.

      10. -

        If the element is flagged as "parser-inserted", - but the element's Document is not the - Document of the parser that created the element, then - abort these steps.

        +

        If the element is flagged as "parser-inserted", but the element's + Document is not the Document of the parser that created the element, + then abort these steps.

      11. -

        If scripting is - disabled for the script element, then the user - agent must abort these steps at this point. The script is not +

        If scripting is disabled for the script + element, then the user agent must abort these steps at this point. The script is not executed.

        -

        The definition of scripting is disabled means - that, amongst others, the following scripts will not execute: - scripts in XMLHttpRequest's responseXML - documents, scripts in DOMParser-created documents, - scripts in documents created by XSLTProcessor's transformToDocument - feature, and scripts that are first inserted by a script into a - Document that was created using the createDocument() - API. [XHR] [DOMPARSING] [DOMCORE]

        +

        The definition of scripting is disabled + means that, amongst others, the following scripts will not execute: scripts in + XMLHttpRequest's responseXML + documents, scripts in DOMParser-created documents, scripts in documents created by + XSLTProcessor's transformToDocument feature, and scripts + that are first inserted by a script into a Document that was created using the + createDocument() API. [XHR] [DOMPARSING] [DOM]

      12. -

        If the script element has an event attribute and a for attribute, then run these - substeps:

        +

        If the script element has an event + attribute and a for attribute, then run these substeps:

          -
        1. Let for be the value of the for attribute.

        2. +
        3. Let for be the value of the for + attribute.

        4. Let event be the value of the event attribute.

        5. -
        6. Strip leading and trailing whitespace from - event and for.

        7. +
        8. Strip leading and trailing whitespace from event and + for.

        9. -
        10. If for is not an ASCII - case-insensitive match for the string "window", then the user agent must abort these - steps at this point. The script is not executed.

        11. +
        12. If for is not an ASCII case-insensitive match for the + string "window", then the user agent must abort these steps at this + point. The script is not executed.

        13. -
        14. If event is not an ASCII - case-insensitive match for either the string "onload" or the string "onload()", then the user agent must abort these - steps at this point. The script is not executed.

        15. +
        16. If event is not an ASCII case-insensitive match for + either the string "onload" or the string "onload()", then the user agent must abort these steps at this point. The script + is not executed.

        @@ -17284,16 +17135,14 @@ c-end = "-->"
      13. -

        If the script element has a charset attribute, then let - the script block's character encoding for this +

        If the script element has a charset + attribute, then let the script block's character encoding for this script element be the encoding given by the charset attribute.

        -

        Otherwise, let the script block's fallback character - encoding for this script element be the same as - the encoding of the - document itself.

        +

        Otherwise, let the script block's fallback character encoding for this + script element be the same as the + encoding of the document itself.

        Only one of these two pieces of state is set.

        @@ -17301,8 +17150,8 @@ c-end = "-->"
      14. -

        If the element has a src - content attribute, run these substeps:

        +

        If the element has a src content attribute, run these + substeps:

          @@ -17356,124 +17205,102 @@ c-end = "-->" - +
        1. -

          Then, the first of the following options that describes the - situation must be followed:

          +

          Then, the first of the following options that describes the situation must be followed:

          -
          If the element has a src attribute, and the element has - a defer attribute, and the - element has been flagged as "parser-inserted", and - the element does not have an async attribute
          +
          If the element has a src + attribute, and the element has a defer attribute, and + the element has been flagged as "parser-inserted", and the element does not have + an async attribute
          -

          The element must be added to the end of the list of - scripts that will execute when the document has finished - parsing associated with the Document of the - parser that created the element.

          +

          The element must be added to the end of the list of scripts that will execute when the + document has finished parsing associated with the Document of the parser + that created the element.

          -

          The task that the - networking task source places on the task - queue once the fetching - algorithm has completed must set the element's - "ready to be parser-executed" flag. The parser will - handle executing the script.

          +

          The task that the networking task source + places on the task queue once the fetching algorithm + has completed must set the element's "ready to be parser-executed" flag. The + parser will handle executing the script.

          -
          If the element has a - src attribute, and the - element has been flagged as "parser-inserted", and - the element does not have an If the element has a src attribute, and the element has been flagged as + "parser-inserted", and the element does not have an async attribute
          -

          The element is the pending parsing-blocking - script of the Document of the parser that - created the element. (There can only be one such script per - Document at a time.)

          +

          The element is the pending parsing-blocking script of the + Document of the parser that created the element. (There can only be one such + script per Document at a time.)

          -

          The task that the - networking task source places on the task - queue once the fetching - algorithm has completed must set the element's - "ready to be parser-executed" flag. The parser will - handle executing the script.

          +

          The task that the networking task source + places on the task queue once the fetching algorithm + has completed must set the element's "ready to be parser-executed" flag. The + parser will handle executing the script.

          -
          If the element does not - have a src attribute, and - the element has been flagged as "parser-inserted", - and either the parser that created the script is an - XML parser or it's an HTML parser whose - script nesting level is not greater than one, and the - Document of the HTML parser or - XML parser that created the script - element has a style sheet that is blocking - scripts
          +
          If the element does not have a src attribute, and the element has been flagged as + "parser-inserted", and either the parser that created the script is + an XML parser or it's an HTML parser whose script nesting + level is not greater than one, and the Document of the HTML + parser or XML parser that created the script element has + a style sheet that is blocking scripts
          -

          The element is the pending parsing-blocking - script of the Document of the parser that - created the element. (There can only be one such script per - Document at a time.)

          +

          The element is the pending parsing-blocking script of the + Document of the parser that created the element. (There can only be one such + script per Document at a time.)

          -

          Set the element's "ready to be parser-executed" - flag. The parser will handle executing the script.

          +

          Set the element's "ready to be parser-executed" flag. The parser will handle + executing the script.

          If the element has a src attribute, does not have an - async attribute, and does - not have the "force-async" flag set
          + title="attr-script-src">src
          attribute, does not have an async attribute, and does not have the + "force-async" flag set
          -

          The element must be added to the end of the list of - scripts that will execute in order as soon as possible - associated with the Document of the - script element at the time the prepare a - script algorithm started.

          +

          The element must be added to the end of the list of scripts that will execute in order + as soon as possible associated with the Document of the script + element at the time the prepare a script algorithm started.

          -

          The task that the - networking task source places on the task - queue once the fetching - algorithm has completed must run the following steps:

          +

          The task that the networking task source + places on the task queue once the fetching algorithm + has completed must run the following steps:

            -
          1. If the element is not now the first element in the - list of scripts that will execute in order as soon as - possible to which it was added above, then mark the - element as ready but abort these steps without executing the - script yet.

          2. +
          3. If the element is not now the first element in the list of scripts that will + execute in order as soon as possible to which it was added above, then mark the + element as ready but abort these steps without executing the script yet.

          4. -
          5. Execution: Execute the script block - corresponding to the first script element in this list of - scripts that will execute in order as soon as +

          6. Execution: Execute the script block corresponding to the first + script element in this list of scripts that will execute in order as soon as possible.

          7. -
          8. Remove the first element from this list of scripts - that will execute in order as soon as possible.

          9. +
          10. Remove the first element from this list of scripts that will execute in order as + soon as possible.

          11. -
          12. If this list of scripts that will execute in order - as soon as possible is still not empty and the first - entry has already been marked as ready, then jump back to the +

          13. If this list of scripts that will execute in order as soon as possible is + still not empty and the first entry has already been marked as ready, then jump back to the step labeled execution.

          @@ -17481,30 +17308,27 @@ c-end = "-->"
          -
          If the element has a src attribute
          +
          If the element has a src + attribute
          -

          The element must be added to the set of scripts that - will execute as soon as possible of the - Document of the script element at the - time the prepare a script algorithm started.

          +

          The element must be added to the set of scripts that will execute as soon as + possible of the Document of the script element at the time the + prepare a script algorithm started.

          -

          The task that the - networking task source places on the task - queue once the fetching - algorithm has completed must execute the script - block and then remove the element from the set of - scripts that will execute as soon as possible.

          +

          The task that the networking task source + places on the task queue once the fetching algorithm + has completed must execute the script block and then remove the element from the + set of scripts that will execute as soon as possible.

          Otherwise
          -
          The user agent must immediately execute the script - block, even if other scripts are already executing.
          +
          The user agent must immediately execute the script block, even if other + scripts are already executing.
          @@ -17513,49 +17337,39 @@ c-end = "-->"
        -

        Fetching an external script must delay the load - event of the element's document until the task that is queued by the networking task source once - the resource has been fetched (defined - above) has been run.

        - -

        The pending parsing-blocking script of a - Document is used by the Document's - parser(s).

        - -

        If a script element that blocks a - parser gets moved to another Document before it would - normally have stopped blocking that parser, it nonetheless continues - blocking that parser until the condition that causes it to be - blocking the parser no longer applies (e.g. if the script is a - pending parsing-blocking script because there was - a style sheet that is blocking scripts when it was - parsed, but then the script is moved to another - Document before the style sheet loads, the script still - blocks the parser until the style sheets are all loaded, at which - time the script executes and the parser is unblocked).

        - - - -

        When the user agent is required to execute a script block, it must run the following - steps:

        +

        Fetching an external script must delay the load event of the element's document + until the task that is queued + by the networking task source once the resource has been fetched (defined above) has been run.

        + +

        The pending parsing-blocking script of a Document is used by the + Document's parser(s).

        + +

        If a script element that blocks a parser gets moved to another + Document before it would normally have stopped blocking that parser, it nonetheless + continues blocking that parser until the condition that causes it to be blocking the parser no + longer applies (e.g. if the script is a pending parsing-blocking script because there + was a style sheet that is blocking scripts when it was parsed, but then the script is + moved to another Document before the style sheet loads, the script still blocks the + parser until the style sheets are all loaded, at which time the script executes and the parser is + unblocked).

        + + + +

        When the user agent is required to execute a script + block, it must run the following steps:

        1. -

          If the element is flagged as "parser-inserted", - but the element's Document is not the - Document of the parser that created the element, then - abort these steps.

          +

          If the element is flagged as "parser-inserted", but the element's + Document is not the Document of the parser that created the element, + then abort these steps.

        2. @@ -17565,67 +17379,55 @@ c-end = "-->"
          -
          If the load resulted in an error (for example a DNS error, or - an HTTP 404 error)
          +
          If the load resulted in an error (for example a DNS error, or an HTTP 404 error)
          -

          Executing the script block must just consist of firing a simple event named - error at the element.

          +

          Executing the script block must just consist of firing + a simple event named error at the element.

          If the load was successful
          -

          Executing the script block must consist of running the - following steps. For the purposes of these steps, the script is - considered to be from an external file if, while the - prepare a script algorithm above was running for - this script, the script element had a src attribute specified.

          +

          Executing the script block must consist of running the following steps. For the purposes of + these steps, the script is considered to be from an external file if, while the + prepare a script algorithm above was running for this script, the + script element had a src attribute + specified.

          1. -

            Initialize the script block's source - as follows:

            +

            Initialize the script block's source as follows:

            -
            If the script is from an external file and the - script block's type is a text-based language
            +
            If the script is from an external file and the script block's type is a + text-based language
            -

            The contents of that file, interpreted as a Unicode - string, are the script source.

            +

            The contents of that file, interpreted as a Unicode string, are the script source.

            -

            To obtain the Unicode string, the user agent run the - following steps:

            +

            To obtain the Unicode string, the user agent run the following steps:

              -
            1. If the resource's Content - Type metadata, if any, specifies a character - encoding, and the user agent supports that encoding, then - let character encoding be that - encoding, and jump to the bottom step in this series of - steps.

            2. - -
            3. If the algorithm above set the script block's - character encoding, then let character - encoding be that encoding, and jump to the bottom - step in this series of steps.

            4. - -
            5. For each of the rows in the following table, - starting with the first one and going down, if the file has - as many or more bytes available than the number of bytes in - the first column, and the first bytes of the file match the - bytes given in the first column, then set character encoding to the encoding given in - the cell in the second column of that row, and jump to the - bottom step in this series of steps:

              +
            6. If the resource's Content Type metadata, if any, + specifies a character encoding, and the user agent supports that encoding, then let character encoding be that encoding, and jump to the bottom step in this + series of steps.

            7. + +
            8. If the algorithm above set the script block's character encoding, then + let character encoding be that encoding, and jump to the bottom step + in this series of steps.

            9. + +
            10. For each of the rows in the following table, starting with the first one and going + down, if the file has as many or more bytes available than the number of bytes in the + first column, and the first bytes of the file match the bytes given in the first column, + then set character encoding to the encoding given in the cell in the + second column of that row, and jump to the bottom step in this series of steps:

              @@ -17658,56 +17460,49 @@ c-end = "-->" -->
              -

              This step looks for Unicode Byte Order - Marks (BOMs).

              +

              This step looks for Unicode Byte Order Marks (BOMs).

            11. -
            12. Let character encoding be - the script block's fallback character - encoding.

            13. +
            14. Let character encoding be the script block's fallback + character encoding.

            15. -
            16. Convert the file to Unicode using character - encoding, following the rules for doing so given by - the specification for the script block's +

            17. Convert the file to Unicode using character encoding, following the + rules for doing so given by the specification for the script block's type.

            -
            If the script is from an external file and the - script block's type is an XML-based language
            +
            If the script is from an external file and the script block's type is an + XML-based language
            -

            The external file is the script source. When it is later - executed, it must be interpreted in a manner consistent with - the specification defining the language given by the - script block's type.

            +

            The external file is the script source. When it is later executed, it must be + interpreted in a manner consistent with the specification defining the language given by + the script block's type.

            -
            If the script is inline and the script block's - type is a text-based language
            +
            If the script is inline and the script block's type is a text-based + language
            -

            The value of the text IDL attribute at the - time the element's "already started" flag was - last set is the script source.

            +

            The value of the text IDL attribute at the time + the element's "already started" flag was last set is the script source.

            -
            If the script is inline and the script block's - type is an XML-based language
            +
            If the script is inline and the script block's type is an XML-based + language
            -

            The child nodes of the script element at the - time the element's "already started" flag was - last set are the script source.

            +

            The child nodes of the script element at the time the element's + "already started" flag was last set are the script source.

            @@ -17718,9 +17513,8 @@ c-end = "-->"
          2. Fire a simple event named beforescriptexecute - that bubbles and is cancelable at the script - element.

            + title="event-beforescriptexecute">beforescriptexecute that bubbles and is cancelable + at the script element.

            If the event is canceled, then abort these steps.

            @@ -17729,9 +17523,8 @@ c-end = "-->"
          3. If the script is from an external file, then increment the - ignore-destructive-writes counter of the - script element's Document. Let neutralized doc be that + ignore-destructive-writes counter of the script element's + Document. Let neutralized doc be that Document.

          4. @@ -17755,19 +17548,17 @@ c-end = "-->"
          5. -

            Create a - script from the script element node, using - the script block's source, the URL - from which the script was obtained, and the script - block's type.

            +

            Create a script from the + script element node, using the script block's source, the + URL from which the script was obtained, and the script block's + type.

            If the script came from a resource that was fetched in the steps above, and the resource was CORS-cross-origin, then pass the muted errors flag to the create a script from a node algorithm.

            -

            This is where the script is compiled and - actually executed.

            +

            This is where the script is compiled and actually executed.

          6. @@ -17781,30 +17572,26 @@ c-end = "-->"
          7. -

            Decrement the ignore-destructive-writes - counter of neutralized doc, if it - was incremented in the earlier step.

            +

            Decrement the ignore-destructive-writes counter of neutralized + doc, if it was incremented in the earlier step.

          8. Fire a simple event named afterscriptexecute - that bubbles (but is not cancelable) at the - script element.

            + title="event-afterscriptexecute">afterscriptexecute that bubbles (but is not + cancelable) at the script element.

          9. -

            If the script is from an external file, fire a simple - event named load at the - script element.

            +

            If the script is from an external file, fire a simple event named load at the script element.

            -

            Otherwise, the script is internal; queue a - task to fire a simple event named load at the script +

            Otherwise, the script is internal; queue a task to fire a simple + event named load at the script element.

          10. @@ -17819,29 +17606,24 @@ c-end = "-->"
          -

          The IDL attributes src, The IDL attributes src, type, charset, defer, each must - reflect the respective content attributes of the same - name.

          + title="dom-script-defer">defer, each must reflect the respective + content attributes of the same name.

          The crossOrigin IDL attribute must reflect the crossorigin content attribute.

          -

          The async IDL - attribute controls whether the element will execute asynchronously - or not. If the element's "force-async" flag is set, - then, on getting, the async - IDL attribute must return true, and on setting, the - "force-async" flag must first be unset, and then the - content attribute must be removed if the IDL attribute's new value - is false, and must be set to the empty string if the IDL attribute's - new value is true. If the element's "force-async" flag - is not set, the IDL attribute must reflect the - async content attribute.

          +

          The async IDL attribute controls whether the + element will execute asynchronously or not. If the element's "force-async" flag is + set, then, on getting, the async IDL attribute must return + true, and on setting, the "force-async" flag must first be unset, and then the + content attribute must be removed if the IDL attribute's new value is false, and must be set to + the empty string if the IDL attribute's new value is true. If the element's + "force-async" flag is not set, the IDL attribute must reflect + the async content attribute.

      @@ -17852,11 +17634,10 @@ c-end = "-->"
      -

      Returns the contents of the element, ignoring child nodes that - aren't Text nodes.

      +

      Returns the contents of the element, ignoring child nodes that aren't Text + nodes.

      -

      Can be set, to replace the element's children with the given - value.

      +

      Can be set, to replace the element's children with the given value.

      @@ -17864,29 +17645,23 @@ c-end = "-->"
      -

      The IDL attribute text must return a - concatenation of the contents of all the Text nodes - that are children of the script element (ignoring any - other nodes such as comments or elements), in tree order. On - setting, it must act the same way as the textContent - IDL attribute.

      +

      The IDL attribute text must return a + concatenation of the contents of all the Text nodes that are children of the + script element (ignoring any other nodes such as comments or elements), in tree + order. On setting, it must act the same way as the textContent IDL attribute.

      -

      When inserted using the document.write() method, - script elements execute (typically synchronously), but - when inserted using innerHTML and outerHTML attributes, they do not - execute at all.

      +

      When inserted using the document.write() + method, script elements execute (typically synchronously), but when inserted using + innerHTML and outerHTML + attributes, they do not execute at all.

      -

      In this example, two script elements are used. One - embeds an external script, and the other includes some data.

      +

      In this example, two script elements are used. One embeds an external script, and + the other includes some data.

      <script src="game-engine.js"></script>
       <script type="text/x-game-map">
      @@ -17896,22 +17671,19 @@ o............A....e
       .A..AAA...AAAAA...e
       </script>
      -

      The data in this case might be used by the script to generate - the map of a video game. The data doesn't have to be used that way, - though; maybe the map data is actually embedded in other parts of - the page's markup, and the data block here is just used by the - site's search engine to help users who are looking for particular - features in their game maps.

      +

      The data in this case might be used by the script to generate the map of a video game. The + data doesn't have to be used that way, though; maybe the map data is actually embedded in other + parts of the page's markup, and the data block here is just used by the site's search engine to + help users who are looking for particular features in their game maps.

      -

      The following sample shows how a script element can be used to - define a function that is then used by other parts of the - document. It also shows how a script element can be - used to invoke script while the document is being parsed, in this - case to initialize the form's output.

      +

      The following sample shows how a script element can be used to define a function that is then + used by other parts of the document. It also shows how a script element can be used + to invoke script while the document is being parsed, in this case to initialize the form's + output.

      <script>
        function calculate(form) {
      @@ -23869,15 +23641,13 @@ wormhole connection.</mark></p>
      Uses HTMLElement.
      -

      The ruby element allows one or more spans of - phrasing content to be marked with ruby annotations. Ruby - annotations are short runs of text presented alongside base text, - primarily used in East Asian typography as a guide for - pronunciation or to include other annotations. In Japanese, this - form of typography is also known as furigana.

      +

      The ruby element allows one or more spans of phrasing content to be marked with + ruby annotations. Ruby annotations are short runs of text presented alongside base text, primarily + used in East Asian typography as a guide for pronunciation or to include other annotations. In + Japanese, this form of typography is also known as furigana.

      -

      The content model of ruby elements consists of one - or more of the following sequences:

      +

      The content model of ruby elements consists of one or more of the following + sequences:

      1. One or the other of the following: @@ -23894,16 +23664,14 @@ wormhole connection.</mark></p> -

        The ruby and rt elements can be used - for a variety of kinds of annotations, including in particular those - described below. For more details on Japanese Ruby in particular, - and how to render Ruby for Japanese, see Requirements for - Japanese Text Layout. [JLREQ]

        +

        The ruby and rt elements can be used for a variety of kinds of + annotations, including in particular those described below. For more details on Japanese Ruby in + particular, and how to render Ruby for Japanese, see Requirements for Japanese Text + Layout. [JLREQ]

        -

        At the time of writing, CSS does not yet provide a - way to fully control the rendering of the HTML ruby - element. It is hoped that CSS will be extended to support the styles - described below in due course.

        +

        At the time of writing, CSS does not yet provide a way to fully control the + rendering of the HTML ruby element. It is hoped that CSS will be extended to support + the styles described below in due course.

        @@ -23934,11 +23702,10 @@ wormhole connection.</mark></p>
        -

        This is similar to the previous case: each ideographic - character in the compound word (the base text) has its reading - given in hiragana or katakana characters (the ruby annotation). - The difference is that the base text segments form a compound word - rather than being separate from each other. +

        This is similar to the previous case: each ideographic character in the compound word (the + base text) has its reading given in hiragana or katakana characters (the ruby annotation). The + difference is that the base text segments form a compound word rather than being separate from + each other.

        <ruby>B<rt>annotation</rt>B<rt>annotation</ruby>
        @@ -23959,11 +23726,9 @@ wormhole connection.</mark></p>
        -

        This is semantically identical to the previous case (each - individual ideographic character in the base compound word has its - reading given in an annotation in hiragana or katakana - characters), but the rendering is the more complicated Jukugo Ruby - rendering. +

        This is semantically identical to the previous case (each individual ideographic character in + the base compound word has its reading given in an annotation in hiragana or katakana + characters), but the rendering is the more complicated Jukugo Ruby rendering.

        This is the same example as above for mono-ruby for compound words. The different rendering is expected to be achieved using different styling (e.g. in CSS), and is not shown here.

        @@ -23975,9 +23740,9 @@ wormhole connection.</mark></p>

        For more details on Jukugo - Ruby rendering, see Appendix F in the Requirements for - Japanese Text Layout. [JLREQ]

        + href="http://www.w3.org/TR/jlreq/#positioning_of_jukugoruby">Jukugo Ruby rendering, see + Appendix F in the Requirements for Japanese Text Layout. [JLREQ]

        @@ -23986,9 +23751,8 @@ wormhole connection.</mark></p>
        -

        The annotation describes the meaning of the base text, rather - than (or in addition to) the pronunciation. As such, both the base - text and the annotation can be multiple characters long. +

        The annotation describes the meaning of the base text, rather than (or in addition to) the + pronunciation. As such, both the base text and the annotation can be multiple characters long.

        <ruby>BASE<rt>annotation</ruby>
        @@ -24013,11 +23777,10 @@ wormhole connection.</mark></p>
        -

        A phonetic reading that corresponds to multiple base - characters, because a one-to-one mapping would be difficult. (In - English, the words "Colonel" and "Lieutenant" are examples of - words where a direct mapping of pronunciation to individual - letters is, in some dialects, rather unclear.) +

        A phonetic reading that corresponds to multiple base characters, because a one-to-one mapping + would be difficult. (In English, the words "Colonel" and "Lieutenant" are examples of words + where a direct mapping of pronunciation to individual letters is, in some dialects, rather + unclear.)

        In this example, the name of a species of flowers has a phonetic reading provided using group ruby: @@ -24060,54 +23823,42 @@ wormhole connection.</mark></p>


        -

        Within a ruby element that does not have a - ruby element ancestor, content is segmented and - segments are placed into three categories: base text segments, - annotation segments, and ignored segments. Ignored segments do not - form part of the document's semantics (they consist of some - inter-element whitespace and rp elements, - the latter of which are used for legacy user agents that do not - support ruby at all). Base text segments can overlap (with a limit - of two segments overlapping any one position in the DOM, and with - any segment having an earlier start point than an overlapping - segment also having an equal or later end point, and any segment - have a later end point than an overlapping segment also having an - equal or earlier start point). Annotation - segments correspond to rt elements. Each annotation - segment can be associated with a base text segment, and each base - text segment can have annotation segments associated with it. (In a - conforming document, each base text segment is associated with at - least one annotation segment, and each annotation segment is - associated with one base text segment.) A ruby element - represents the union of the segments of base text it - contains, along with the mapping from those base text segments to - annotation segments. Segments are described in terms of DOM ranges; - annotation segment ranges always consist of exactly one element. [DOMCORE]

        - -

        At any particular time, the segmentation and categorisation of - content of a ruby element is the result that would be - obtained from running the following algorithm:

        +

        Within a ruby element that does not have a ruby element ancestor, + content is segmented and segments are placed into three categories: base text segments, annotation + segments, and ignored segments. Ignored segments do not form part of the document's semantics + (they consist of some inter-element whitespace and rp elements, the + latter of which are used for legacy user agents that do not support ruby at all). Base text + segments can overlap (with a limit of two segments overlapping any one position in the DOM, and + with any segment having an earlier start point than an overlapping segment also having an equal or + later end point, and any segment have a later end point than an overlapping segment also having an + equal or earlier start point). Annotation segments correspond to rt elements. Each annotation + segment can be associated with a base text segment, and each base text segment can have annotation + segments associated with it. (In a conforming document, each base text segment is associated with + at least one annotation segment, and each annotation segment is associated with one base text + segment.) A ruby element represents the union of the segments of base + text it contains, along with the mapping from those base text segments to annotation segments. + Segments are described in terms of DOM ranges; annotation segment ranges always consist of exactly + one element. [DOM]

        + +

        At any particular time, the segmentation and categorisation of content of a ruby + element is the result that would be obtained from running the following algorithm:

          -
        1. Let base text segments be an empty list - of base text segments, each potentially with a list of base text - subsegments.

        2. +
        3. Let base text segments be an empty list of base text segments, each + potentially with a list of base text subsegments.

        4. -
        5. Let annotation segments be an empty list - of annotation segments, each potentially being associated with a - base text segment or subsegment.

        6. +
        7. Let annotation segments be an empty list of annotation segments, each + potentially being associated with a base text segment or subsegment.

        8. -
        9. Let root be the ruby - element for which the algorithm is being run.

        10. +
        11. Let root be the ruby element for which the algorithm is + being run.

        12. -
        13. If root has a ruby element - ancestor, then jump to the step labeled end.

        14. +
        15. If root has a ruby element ancestor, then jump to the + step labeled end.

        16. -
        17. Let current parent be root.

        18. +
        19. Let current parent be root.

        20. Let index be 0.

        21. @@ -24118,205 +23869,173 @@ wormhole connection.</mark></p>
        22. Let current base text be null.

        23. - + -
        24. Start mode: If index is equal to - or greater than the number of child nodes in current - parent, then jump to the step labeled end mode.

          +
        25. Start mode: If index is equal to or greater than the number of + child nodes in current parent, then jump to the step labeled end + mode.

          -
        26. If the indexth node in current parent is an rt or - rp element, jump to the step labeled annotation +

        27. If the indexth node in current parent is an + rt or rp element, jump to the step labeled annotation mode.

        28. - + -
        29. Set start index to the value of index.

        30. - -
        31. Base mode: If the indexth node in - current parent is a ruby element, - and if current parent is the same element as - root, then push a ruby level and - then jump to the step labeled start mode.

        32. - -
        33. If the indexth node in current parent is an rt or - rp element, then set the current base - text and then jump to the step labeled annotation - mode.

        34. +
        35. Set start index to the value of index.

        36. + +
        37. Base mode: If the indexth node in current + parent is a ruby element, and if current parent is the + same element as root, then push a ruby level and then jump to + the step labeled start mode.

        38. + +
        39. If the indexth node in current parent is an + rt or rp element, then set the current base text and then + jump to the step labeled annotation mode.

        40. Increment index by one.

        41. -
        42. Base mode post-increment: If index is equal to or greater than the number of - child nodes in current parent, then jump to the - step labeled end mode.

        43. +
        44. Base mode post-increment: If index is equal to or greater than + the number of child nodes in current parent, then jump to the step labeled + end mode.

        45. Jump back to the step labeled base mode.

        46. -
        47. Annotation mode: If the indexth - node in current parent is an rt - element, then push a ruby annotation and jump to the - step labeled annotation mode increment.

        48. +
        49. Annotation mode: If the indexth node in current + parent is an rt element, then push a ruby annotation and jump to + the step labeled annotation mode increment.

        50. -
        51. If the indexth node in current parent is an rp element, jump - to the step labeled annotation mode increment.

        52. +
        53. If the indexth node in current parent is an + rp element, jump to the step labeled annotation mode increment.

        54. -
        55. If the indexth node in current parent is not a Text node, or - is a Text node that is not inter-element - whitespace, then jump to the step labeled base - mode.

        56. +
        57. If the indexth node in current parent is not a + Text node, or is a Text node that is not inter-element + whitespace, then jump to the step labeled base mode.

        58. -
        59. Annotation mode increment: Let lookahead index be index plus - one.

        60. +
        61. Annotation mode increment: Let lookahead index be index plus one.

        62. -
        63. Annotation mode white-space skipper: If lookahead index is equal to the number of child - nodes in current parent then jump to the step +

        64. Annotation mode white-space skipper: If lookahead index is + equal to the number of child nodes in current parent then jump to the step labeled end mode.

        65. -
        66. If the lookahead indexth node in current parent is an rt element or an - rp element, then set index to lookahead index and jump to the step labeled - annotation mode.

        67. - -
        68. If the lookahead indexth node in current parent is not a Text node, or - is a Text node that is not inter-element - whitespace, then jump to the step labeled base mode - (without further incrementing index, so the - inter-element whitespace seen so far becomes part of - the next base text segment).

        69. - -
        70. Increment lookahead index by - one.

        71. +
        72. If the lookahead indexth node in current parent is + an rt element or an rp element, then set index to + lookahead index and jump to the step labeled annotation mode.

        73. + +
        74. If the lookahead indexth node in current parent is + not a Text node, or is a Text node that is not inter-element + whitespace, then jump to the step labeled base mode (without further incrementing + index, so the inter-element whitespace seen so far becomes part + of the next base text segment).

        75. -
        76. Jump to the step labeled annotation mode white-space - skipper.

        77. +
        78. Increment lookahead index by one.

        79. +
        80. Jump to the step labeled annotation mode white-space skipper.

        81. -
        82. End mode: If current parent is - not the same element as root, then pop a - ruby level and jump to the step labeled base mode + +

        83. End mode: If current parent is not the same element as root, then pop a ruby level and jump to the step labeled base mode post-increment.

        84. -
        85. End: Return base text segments - and annotation segments. Any content of the - ruby element not described by segments in either of - thost lists is implicitly in an ignored segment.

        86. +
        87. End: Return base text segments and annotation + segments. Any content of the ruby element not described by segments in either + of thost lists is implicitly in an ignored segment.

        -

        When the steps above say to set the current base text, - it means to run the following steps at that point in the - algorithm:

        +

        When the steps above say to set the current base text, it means to run the following + steps at that point in the algorithm:

        1. Let text range a DOM range whose start is the boundary point (current parent, start index) and - whose end is the boundary point (current parent, index).

        2. + title="concept-range-start">start is the boundary + point (current parent, start index) and whose + end is the boundary + point (current parent, index).

          -
        3. Let new text segment be a base text - segment described by the range annotation - range.

          +
        4. Let new text segment be a base text segment described by the range + annotation range.

          -
        5. Add new text segment to base text segments.

        6. +
        7. Add new text segment to base text + segments.

        8. -
        9. Let current base text be new text segment.

        10. +
        11. Let current base text be new text + segment.

        12. Let start index be null.

        -

        When the steps above say to push a ruby level, it - means to run the following steps at that point in the algorithm:

        +

        When the steps above say to push a ruby level, it means to run the following steps + at that point in the algorithm:

          -
        1. Let current parent be the indexth node in current - parent.

        2. +
        3. Let current parent be the indexth node in current parent.

        4. Let index be 0.

        5. -
        6. Set saved start index to the value of - start index.

        7. +
        8. Set saved start index to the value of start + index.

        9. Let start index be null.

        -

        When the steps above say to pop a ruby level, it means - to run the following steps at that point in the algorithm:

        +

        When the steps above say to pop a ruby level, it means to run the following steps at + that point in the algorithm:

          -
        1. Let index be the position of current parent in root.

        2. +
        3. Let index be the position of current parent in + root.

        4. -
        5. Let current parent be root.

        6. +
        7. Let current parent be root.

        8. Increment index by one.

        9. -
        10. Set start index to the value of - saved start index.

        11. +
        12. Set start index to the value of saved start + index.

        13. Let saved start index be null.

        -

        When the steps above say to push a ruby annotation, it - means to run the following steps at that point in the algorithm:

        +

        When the steps above say to push a ruby annotation, it means to run the following + steps at that point in the algorithm:

          -
        1. Let rt be the rt element - that is the indexth node of current parent.

        2. +
        3. Let rt be the rt element that is the indexth node of current parent.

        4. -
        5. Let annotation range a DOM range whose - start is the boundary point (current parent, index) and whose - end is the boundary point (current parent, index plus one) - (i.e. that contains only rt).

        6. +
        7. Let annotation range a DOM range whose start is the boundary + point (current parent, index) and whose end is the boundary point + (current parent, index plus one) (i.e. that contains only + rt).

        8. -
        9. Let new annotation segment be an - annotation segment described by the range annotation - range.

        10. +
        11. Let new annotation segment be an annotation segment described by the + range annotation range.

        12. -
        13. If current base text is not null, - associate new annotation segment with current base text.

        14. +
        15. If current base text is not null, associate new + annotation segment with current base text.

        16. -
        17. Add new annotation segment to annotation segments.

        18. +
        19. Add new annotation segment to annotation + segments.

        @@ -24325,9 +24044,8 @@ wormhole connection.</mark></p> -

        In this example, each ideograph in the Japanese text 漢字 is annotated with its - reading in hiragana.

        +

        In this example, each ideograph in the Japanese text 漢字 is annotated with its reading in hiragana.

        ...
         <ruby>漢<rt>かん</rt>字<rt>じ</rt></ruby>
        @@ -24344,9 +24062,8 @@ wormhole connection.</mark></p>
        -

        In this example, each ideograph in the traditional Chinese text - 漢字 is annotated - with its bopomofo reading.

        +

        In this example, each ideograph in the traditional Chinese text 漢字 is annotated with its bopomofo reading.

        <ruby>漢<rt>ㄏㄢˋ</rt>字<rt>ㄗˋ</rt></ruby>
        @@ -24361,9 +24078,8 @@ wormhole connection.</mark></p> -

        In this example, each ideograph in the simplified Chinese text - 汉字 is annotated - with its pinyin reading.

        +

        In this example, each ideograph in the simplified Chinese text 汉字 is annotated with its pinyin reading.

        ...<ruby>汉<rt>hàn</rt>字<rt>zì</rt></ruby>...
        @@ -24378,11 +24094,10 @@ wormhole connection.</mark></p>
        -

        In this more contrived example, the acronym "HTML" has four - annotations: one for the whole acronym, briefly describing what it - is, one for the letters "HT" expanding them to "Hypertext", one for - the letter "M" expanding it to "Markup", and one for the letter "L" - expanding it to "Language".

        +

        In this more contrived example, the acronym "HTML" has four annotations: one for the whole + acronym, briefly describing what it is, one for the letters "HT" expanding them to "Hypertext", + one for the letter "M" expanding it to "Markup", and one for the letter "L" expanding it to + "Language".

        <ruby>
          <ruby>HT<rt>Hypertext</rt>M<rt>Markup</rt>L<rt>Language</rt></ruby>
        @@ -26536,30 +26251,22 @@ interface HTMLImageElement : HTMLElement {
           

    Otherwise, the attribute must return false.

    -

    The value of complete can thus change while a - script is executing.

    - -

    Three constructors are provided for creating - HTMLImageElement objects (in addition to the factory - methods from DOM Core such as createElement()): Image(), Image(width), and Image(width, height). When invoked as constructors, - these must return a new HTMLImageElement object (a new - img element). If the width argument - is present, the new object's width content attribute must be set to - width. If the height - argument is also present, the new object's height content attribute must be set - to height. The element's document must be the - active document of the browsing context of - the Window object on which the interface object of the - invoked constructor is found.

    +

    The value of complete can thus change while + a script is executing.

    + +

    Three constructors are provided for creating HTMLImageElement objects (in addition + to the factory methods from DOM such as createElement()): Image(), Image(width), and Image(width, height). When invoked as constructors, + these must return a new HTMLImageElement object (a new img element). If + the width argument is present, the new object's width content attribute must be set to width. If + the height argument is also present, the new object's height content attribute must be set to height. + The element's document must be the active document of the browsing + context of the Window object on which the interface object of the invoked + constructor is found.

    @@ -28325,6 +28032,10 @@ href="?audio">audio</a> test instead.)</p> +
  • The nested browsing context's Window object's + cross-boundary event parent is the browsing context container. [DOM]

  • +

    If the attribute is not specified, or if the origin conditions listed above are @@ -30133,26 +29844,19 @@ interface HTMLAudioElement : HTMLMediaElement {};

    -

    Two constructors are provided for creating - HTMLAudioElement objects (in addition to the factory - methods from DOM Core such as createElement()): Audio() and Audio(src). When invoked as constructors, - these must return a new HTMLAudioElement object (a new - audio element). The element must have its preload attribute set to the - literal value "auto". If the src argument is present, the object created must have - its src content attribute set to - the provided value, and the user agent must invoke the object's - resource selection - algorithm before returning. The element's document must be - the active document of the browsing - context of the Window object on which the - interface object of the invoked constructor is found.

    +

    Two constructors are provided for creating HTMLAudioElement objects (in addition + to the factory methods from DOM such as createElement()): Audio() and Audio(src). When invoked as constructors, these must return a new + HTMLAudioElement object (a new audio element). The element must have its + preload attribute set to the literal value "auto". If the src argument is present, + the object created must have its src content attribute set to + the provided value, and the user agent must invoke the object's resource selection algorithm before returning. The + element's document must be the active document of the browsing context + of the Window object on which the interface object of the invoked constructor is + found.

    @@ -40453,7 +40157,7 @@ interface HTMLCanvasElement : HTMLElement { though the element itself is not visible). This allows authors to make an interactive canvas keyboard-accessible: authors should have a one-to-one mapping of interactive regions to focusable elements in the fallback content. (Focus has no effect on mouse interaction events.) - [DOMEVENTS]

    + [DOMEVENTS]


    @@ -61205,92 +60909,66 @@ interface HTMLOptionElement : HTMLElement {
    -

    The disabled - IDL attribute must reflect the content attribute of the - same name. The defaultSelected - IDL attribute must reflect the selected content attribute.

    - -

    The label IDL - attribute, on getting, must return the element's label. On setting, the element's - label content attribute must - be set to the new value.

    - -

    The value IDL - attribute, on getting, must return the element's value. On setting, the element's - value content attribute must - be set to the new value.

    - -

    The selected - IDL attribute, on getting, must return true if the element's selectedness is true, and - false otherwise. On setting, it must set the element's selectedness to the new - value, and then cause the element to ask for a reset.

    - -

    The index IDL - attribute must return the element's index.

    - -

    The text IDL - attribute, on getting, must return the value of the - textContent IDL attribute on the element, with leading and trailing - whitespace stripped, and with any sequences of two or more - space characters replaced by a - single U+0020 SPACE character. On setting, it must act as if the - textContent IDL attribute on the element had been set - to the new value.

    - -

    The form IDL - attribute's behavior depends on whether the option - element is in a select element or not. If the - option has a select element as its parent, - or has an optgroup element as its parent and that - optgroup element has a select element as - its parent, then the form IDL - attribute must return the same value as the form IDL attribute on that - select element. Otherwise, it must return null.

    - -

    Several constructors are provided for creating - HTMLOptionElement objects (in addition to the factory - methods from DOM Core such as createElement()): Option(), Option(text), Option(text, value), Option(text, value, defaultSelected), and Option(text, value, defaultSelected, selected). When invoked as constructors, - these must return a new HTMLOptionElement object (a new - option element). If the text - argument is present, the new object must have as its only child a - Text node whose data is the value of that argument. If - the value argument is present, the new object - must have a value attribute - set with the value of the argument as its value. If the defaultSelected argument is present and true, the new - object must have a selected attribute set with no - value. If the selected argument is present and - true, the new object must have its selectedness set to true; - otherwise the fourth argument is absent or false, and the selectedness must be set - to false, even if the defaultSelected argument - is present and true. The element's document must be the active - document of the browsing context of the - Window object on which the interface object of the - invoked constructor is found.

    +

    The disabled IDL attribute must + reflect the content attribute of the same name. The defaultSelected IDL attribute must + reflect the selected content attribute.

    + +

    The label IDL attribute, on getting, must + return the element's label. On setting, the element's + label content attribute must be set to the new value.

    + +

    The value IDL attribute, on getting, must + return the element's value. On setting, the element's + value content attribute must be set to the new value.

    + +

    The selected IDL attribute, on getting, + must return true if the element's selectedness is + true, and false otherwise. On setting, it must set the element's selectedness to the new value, and then cause the + element to ask for a reset.

    + +

    The index IDL attribute must return the + element's index.

    + +

    The text IDL attribute, on getting, must return + the value of the textContent IDL attribute on the element, with leading and trailing whitespace stripped, and with any + sequences of two or more space characters replaced by a + single U+0020 SPACE character. On setting, it must act as if the textContent IDL + attribute on the element had been set to the new value.

    + +

    The form IDL attribute's behavior depends on + whether the option element is in a select element or not. If the + option has a select element as its parent, or has an + optgroup element as its parent and that optgroup element has a + select element as its parent, then the form IDL + attribute must return the same value as the form IDL attribute + on that select element. Otherwise, it must return null.

    + +

    Several constructors are provided for creating HTMLOptionElement objects (in + addition to the factory methods from DOM such as createElement()): Option(), Option(text), Option(text, value), Option(text, value, defaultSelected), and Option(text, value, defaultSelected, selected). When invoked as constructors, these must return a new + HTMLOptionElement object (a new option element). If the text argument is present, the new object must have as its only child a + Text node whose data is the value of that argument. If the value + argument is present, the new object must have a value + attribute set with the value of the argument as its value. If the defaultSelected argument is present and true, the new object must have a selected attribute set with no value. If the selected argument is present and true, the new object must have its selectedness set to true; otherwise the fourth argument + is absent or false, and the selectedness must be + set to false, even if the defaultSelected argument is present and true. The + element's document must be the active document of the browsing context + of the Window object on which the interface object of the invoked constructor is + found.

    @@ -81232,9 +80910,9 @@ State: <OUTPUT NAME=I>1</OUTPUT> <INPUT VALUE="Increment" TYPE=BUTTON O

    When faced with displaying an XML file inline, user agents must first create a Document object, following the requirements of the XML and Namespaces in XML - recommendations, RFC 3023, DOM Core, and other relevant specifications. [XML] [XMLNS] [RFC3023] [DOMCORE]

    + recommendations, RFC 3023, DOM, and other relevant specifications. [XML] [XMLNS] [RFC3023] [DOM]

    The actual HTTP headers and other metadata, not the headers as mutated or implied by the algorithms given in this specification, are the ones that must be used when determining the @@ -85907,6 +85585,7 @@ interface NavigatorOnLine { tasks queued with the user interaction task source. [DOMEVENTS]

    + @@ -86109,117 +85788,95 @@ interface NavigatorOnLine { -

    Many objects can have event handlers specified. These - act as non-capture event listeners for the object on which they are - specified. [DOMCORE]

    +

    Many objects can have event handlers specified. These act as non-capture event + listeners for the object on which they are specified. [DOM]

    -

    An event handler can either - have the value null or be set to a callback object. This is defined - using the EventHandler callback interface type. Initially, event handlers must be set to - null.

    +

    An event handler can either have the value null or be set + to a callback object. This is defined using the EventHandler callback interface type. + Initially, event handlers must be set to null.

    Event handlers are exposed in one of two ways.

    -

    The first way, common to all event handlers, is as an event handler IDL - attribute.

    +

    The first way, common to all event handlers, is as an event handler IDL attribute.

    -

    The second way is as an event handler content attribute. Event handlers - on HTML elements and some of the event handlers on +

    The second way is as an event handler content + attribute. Event handlers on HTML elements and some of the event handlers on Window objects are exposed in this way.


    -

    Event handler IDL attributes, on setting, must set the - corresponding event handler to their new value, and on - getting, must return whatever the current value of the corresponding +

    Event handler IDL attributes, on setting, must set the corresponding event handler + to their new value, and on getting, must return whatever the current value of the corresponding event handler is (possibly null).

    -

    If an event handler - IDL attribute exposes an event - handler of an object that doesn't exist, it must always +

    If an event handler IDL attribute exposes an + event handler of an object that doesn't exist, it must always return null on getting and must do nothing on setting.

    -

    This can happen in particular for event handler IDL attribute on - body elements that do not have corresponding +

    This can happen in particular for event + handler IDL attribute on body elements that do not have corresponding Window objects.

    -

    Certain event handler IDL attributes have additional - requirements, in particular the onmessage attribute of +

    Certain event handler IDL attributes have additional requirements, in particular + the onmessage attribute of MessagePort objects.

    -

    On getting, event handler IDL attributes must return - the value of their corresponding event handlers, except when the - value is an internal error - value, in which case the user agent must set the corresponding - event handler to null, and then throw an exception corresponding to - the error condition.

    +

    On getting, event handler IDL attributes must return the value of their + corresponding event handlers, except when the value is an internal error value, in which case the user agent must set + the corresponding event handler to null, and then throw an exception corresponding to the error + condition.


    -

    Event handler content attributes, when specified, must - contain valid JavaScript code which, when parsed, would match the - FunctionBody production after automatic +

    Event handler content attributes, when specified, must contain valid JavaScript code + which, when parsed, would match the FunctionBody production after automatic semicolon insertion. [ECMA262]

    -

    When an event - handler content attribute is set, if the element is owned by - a Document that is in a browsing context, - and scripting is enabled for - that browsing context, the user agent must run the - following steps to create a script after setting the content - attribute to its new value:

    +

    When an event handler content attribute + is set, if the element is owned by a Document that is in a browsing + context, and scripting is enabled for that + browsing context, the user agent must run the following steps to create a script after setting the content attribute to its new value:

      -
    1. Set the corresponding event - handler to null.

    2. +
    3. Set the corresponding event handler to null.

    4. -
    5. Set up a script execution environment for - JavaScript.

    6. +
    7. Set up a script execution environment for JavaScript.

    8. -
    9. Let body be the event handler content - attribute's new value.

    10. +
    11. Let body be the event + handler content attribute's new value.

    12. -

      If body is not parsable as - FunctionBody or if parsing detects an early error - then set the event handler content attribute to an - error as defined below, and abort these steps.

      +

      If body is not parsable as FunctionBody or if parsing detects an + early error then set the event handler content attribute to an error as + defined below, and abort these steps.

      -

      FunctionBody is defined in ECMAScript - edition 5 section 13 Function Definition. Early error is - defined in ECMAScript edition 5 section 16 Errors. FunctionBody is defined in ECMAScript edition 5 section 13 Function + Definition. Early error is defined in ECMAScript edition 5 section 16 Errors. [ECMA262]

    13. -

      If body begins with a Directive Prologue - that contains a Use Strict Directive then let strict be true, otherwise let strict be false.

      +

      If body begins with a Directive Prologue that contains a Use Strict + Directive then let strict be true, otherwise let strict + be false.

      -

      The terms "Directive Prologue" and "Use Strict - Directive" are defined in ECMAScript edition 5 section 14.1 - Directive Prologues and the Use Strict Directive. The terms "Directive Prologue" and "Use Strict Directive" are defined in + ECMAScript edition 5 section 14.1 Directive Prologues and the Use Strict Directive. [ECMA262]

    14. @@ -86228,24 +85885,20 @@ interface NavigatorOnLine { currently this is unnecessary: http://www.w3.org/Bugs/Public/show_bug.cgi?id=11977#c4
    15. -

      If strict is true, and anything in body is a SyntaxError according to the - Strict Mode Restrictions, then set the event handler content - attribute to an error as defined below, and abort these - steps.

      +

      If strict is true, and anything in body is a + SyntaxError according to the Strict Mode Restrictions, then set the event + handler content attribute to an error as defined below, and abort these steps.

      -

      The Strict Mode Restrictions are those listed in - ECMAScript edition 5 section 13.1 Strict Mode Restrictions. [ECMA262]

      +

      The Strict Mode Restrictions are those listed in ECMAScript edition 5 section + 13.1 Strict Mode Restrictions. [ECMA262]

    16. -->
    17. -

      Using the script execution environment created above, create a - function object (as defined in ECMAScript edition 5 section 13.2 - Creating Function Objects), with:

      +

      Using the script execution environment created above, create a function object (as defined in + ECMAScript edition 5 section 13.2 Creating Function Objects), with:

      @@ -86255,20 +85908,16 @@ currently this is unnecessary: http://www.w3.org/Bugs/Public/show_bug.cgi?id=119
      -
      If the attribute is the onerror attribute of the - Window object
      +
      If the attribute is the onerror attribute of + the Window object
      -
      Let the function have four arguments, named event, source, lineno, and column.
      +
      Let the function have four arguments, named event, source, lineno, and column.
      Otherwise
      -
      Let the function have a single argument called event.
      +
      Let the function have a single argument called event.
      @@ -86284,24 +85933,20 @@ currently this is unnecessary: http://www.w3.org/Bugs/Public/show_bug.cgi?id=119
        -
      1. Let Scope be the result of - NewObjectEnvironment(the element's Document, the - global environment).
      2. +
      3. Let Scope be the result of NewObjectEnvironment(the element's + Document, the global environment).
      4. -
      5. If the element has a form owner, let Scope be the result of NewObjectEnvironment(the - element's form owner, If the element has a form owner, let Scope be the result + of NewObjectEnvironment(the element's form owner, Scope).
      6. -
      7. Let Scope be the result of - NewObjectEnvironment(the element's object, Scope).
      8. +
      9. Let Scope be the result of NewObjectEnvironment(the element's object, + Scope).
      -

      NewObjectEnvironment() is defined in ECMAScript - edition 5 section 10.2.2.3 NewObjectEnvironment (O, E). [ECMA262]

      +

      NewObjectEnvironment() is defined in ECMAScript edition 5 section 10.2.2.3 + NewObjectEnvironment (O, E). [ECMA262]

      @@ -86311,37 +85956,31 @@ currently this is unnecessary: http://www.w3.org/Bugs/Public/show_bug.cgi?id=119
      -

      Let this new function be the only entry in the script's - list of code entry-points.

      +

      Let this new function be the only entry in the script's list of code + entry-points.

    18. -
    19. Set up the script's global object, the - script's browsing context, the script's - document, the script's referrer source, the - script's URL character encoding, and the - script's base URL from the script settings - determined from the node on which the attribute is being +

    20. Set up the script's global object, the script's browsing + context, the script's document, the script's referrer source, + the script's URL character encoding, and the script's base URL from + the script settings determined from the node on which the attribute is being set.

    21. -
    22. Set the corresponding event - handler to the aforementioned function.

    23. +
    24. Set the corresponding event handler to the + aforementioned function.

    -

    When a user agent is required, by the steps above, to set - the event handler content attribute to an error, the user - agent must set the corresponding event - handler to an internal - error value representing the error condition, keeping track of - the URL of the resource where the event handler content attribute - was set, and the relevant line number inside that resource where the - error occurred.

    - -

    When an event handler content attribute is removed, the user - agent must set the corresponding event - handler to null.

    +

    When a user agent is required, by the steps above, to set the event handler content + attribute to an error, the user agent must set the corresponding event handler to an internal error value + representing the error condition, keeping track of the URL of the resource where the + event handler content attribute was set, and + the relevant line number inside that resource where the error occurred.

    + +

    When an event handler content attribute is removed, the user agent must set the corresponding + event handler to null.

    @@ -86362,46 +85999,36 @@ currently this is unnecessary: http://www.w3.org/Bugs/Public/show_bug.cgi?id=119
    -

    When an event handler H of an element or object T - implementing the EventTarget interface is first set to - a non-null value, the user agent must append an event listener to the list of - event listeners - associated with T with type set to the - event handler event type corresponding to H, capture set to false, and listener - set to the event handler processing algorithm defined - below. [DOMCORE]

    - -

    The listener is emphatically not the - event handler itself. Every - event handler ends up registering the same listener, the - algorithm defined below, which takes care of invoking the right - callback, and processing the callback's return value.

    - -

    This only happens the first time the event handler's value is set. Since - listeners are called in the order they were registered, the order of - event listeners for a particular event type will always be first the - event listeners registered with addEventListener() - before the first time the event - handler was set to a non-null value, then the callback to - which it is currently set, if any, and finally the event listeners - registered with addEventListener() - after the first time the event - handler was set to a non-null value.

    +

    When an event handler H of an element + or object T implementing the EventTarget interface is first set + to a non-null value, the user agent must append an event + listener to the list of event listeners + associated with T with type set to the event handler event + type corresponding to H, capture set to false, and + listener set to the event handler processing algorithm defined below. [DOM]

    + +

    The listener is emphatically not the event handler itself. Every event handler ends up registering the same + listener, the algorithm defined below, which takes care of invoking the right callback, and + processing the callback's return value.

    + +

    This only happens the first time the event + handler's value is set. Since listeners are called in the order they were registered, the + order of event listeners for a particular event type will always be first the event listeners + registered with addEventListener() before + the first time the event handler was set to a non-null value, + then the callback to which it is currently set, if any, and finally the event listeners registered + with addEventListener() after the + first time the event handler was set to a non-null value.

    -

    This example demonstrates the order in which event listeners are - invoked. If the button in this example is clicked by the user, the - page will show four alerts, with the text "ONE", "TWO", "THREE", - and "FOUR" respectively.

    +

    This example demonstrates the order in which event listeners are invoked. If the button in + this example is clicked by the user, the page will show four alerts, with the text "ONE", "TWO", + "THREE", and "FOUR" respectively.

    <button id="test">Start Demo</button>
     <script>
    @@ -86417,19 +86044,16 @@ currently this is unnecessary: http://www.w3.org/Bugs/Public/show_bug.cgi?id=119
     
       
    -

    The interfaces implemented by the event object do - not influence whether an event - handler is triggered or not.

    +

    The interfaces implemented by the event object do not influence whether an event handler is triggered or not.

    -

    The event handler processing algorithm for an - event handler H and an Event object E is as follows:

    +

    The event handler processing algorithm for an event + handler H and an Event object E is as + follows:

      -
    1. If H's value is null, then abort these - steps.

    2. +
    3. If H's value is null, then abort these steps.

    4. If H's value is an internal error value, then set the event handler to null and then @@ -86439,18 +86063,14 @@ currently this is unnecessary: http://www.w3.org/Bugs/Public/show_bug.cgi?id=119 handlers">event handler of the Window object of that Document, and abort these steps.

    5. -
    6. Let callback be H's - value, the callback that the event - handler was last set to.

    7. +
    8. Let callback be H's value, the callback that the + event handler was last set to.

    9. -
    10. Invoke callback with one - argument, the value of which is the Event object E, with the callback this value set to - E's currentTarget. Let the - return value be return value. [WEBIDL]

    11. +
    12. Invoke callback with one argument, the value of which is the + Event object E, with the callback this value set to E's currentTarget. Let the return value be return value. [WEBIDL]

    13. @@ -86458,26 +86078,24 @@ currently this is unnecessary: http://www.w3.org/Bugs/Public/show_bug.cgi?id=119
      -
      If the event type is mouseover
      +
      If the event type is mouseover
      -

      If return value is a boolean with the - value true, then cancel the event.

      +

      If return value is a boolean with the value true, then cancel the + event.

      -
      If the Event object E is a - BeforeUnloadEvent object
      +
      If the Event object E is a BeforeUnloadEvent + object
      -

      If return value is a string, and the - Event object E's returnValue +

      If return value is a string, and the Event object E's returnValue attribute's value is the empty string, then set the returnValue - attribute's value to return value.

      + title="dom-BeforeUnloadEvent-returnValue">returnValue attribute's value to return value.

      Otherwise
      -

      If return value is a boolean with the - value false, then cancel the event.

      +

      If return value is a boolean with the value false, then cancel the + event.

      @@ -86491,16 +86109,14 @@ currently this is unnecessary: http://www.w3.org/Bugs/Public/show_bug.cgi?id=119
      -

      The EventHandler interface represents a callback - used for event handlers. It is represented in Web IDL as - follows:

      +

      The EventHandler interface represents a callback used for event handlers. It is + represented in Web IDL as follows:

      [TreatNonCallableAsNull]
       callback EventHandlerNonNull = any (Event event);
       typedef EventHandlerNonNull? EventHandler;
      -

      In JavaScript, any Function object - implements this interface.

      +

      In JavaScript, any Function object implements this interface.

      @@ -86508,24 +86124,19 @@ typedef EventHandlerNonNull? EventHandler;
    <body onload="alert(this)" onclick="alert(this)">
    -

    ...leads to an alert saying "[object Window]" when the document is loaded, - and an alert saying "[object HTMLBodyElement]" whenever the user - clicks something in the page.

    +

    ...leads to an alert saying "[object Window]" when the document is + loaded, and an alert saying "[object HTMLBodyElement]" whenever the + user clicks something in the page.

    -

    The return value of the function affects whether the - event is canceled or not: as described - above, if the return value is false, the event is canceled - (except for mouseover events, - where the return value has to be true to cancel the event). With - beforeunload events, the - value is instead used to determine the message to show the user.

    +

    The return value of the function affects whether the event is canceled or not: + as described above, if the return value is false, the event is canceled + (except for mouseover events, where the return value has to + be true to cancel the event). With beforeunload events, + the value is instead used to determine the message to show the user.

    -

    For historical reasons, the onerror handler has different +

    For historical reasons, the onerror handler has different arguments:

    [TreatNonCallableAsNull]
    @@ -86537,12 +86148,10 @@ typedef OnErrorEventHandlerNonNull? OnErrorEventHandler;
     
       
    Event handlers on elements, Document objects, and Window objects
    -

    The following are the event handlers (and their - corresponding event handler - event types) that must be supported - by all HTML elements, as both content attributes and - IDL attributes, and on Document and Window - objects, as IDL attributes.

    +

    The following are the event handlers (and their corresponding event handler event types) that must be + supported by all HTML elements, as both content attributes and IDL attributes, and on + Document and Window objects, as IDL attributes.

    @@ -86736,14 +86345,16 @@ typedef OnErrorEventHandlerNonNull? OnErrorEventHandler;
    Events and the Window object
    -

    When an event is dispatched at a DOM node in a - Document in a browsing context, if the - event is not a load event, the user - agent must act as if, for the purposes of event dispatching, the - Window object is the parent of the - Document object. [DOMCORE]

    +

    When an event is dispatched at a DOM node in a Document in a browsing + context, if the event is not a load event, the user agent + must act as if, for the purposes of event dispatching, + the Window object is the parent of the Document object. [DOM]

    + + @@ -95429,9 +95040,9 @@ interface WorkerUtils { href="#refsHTML">[HTML]

    -

    The DOM APIs — specifically, all the interfaces defind in the DOM Core specification - other than exceptions — must not be exposed if the - JavaScript global environment is a worker environment. The DOM APIs — specifically, all the interfaces defind in the DOM specification other + than exceptions — must not be exposed if the JavaScript + global environment is a worker environment. [DOMCORE]

    @@ -105237,7 +104848,7 @@ document.body.appendChild(text); title="dom-document-writeln">document.writeln() calls. [DOMEVENTS]

    -

    However, mutation observers do fire, as required by the DOM Core specification.

    +

    However, mutation observers do fire, as required by the DOM specification.

    Not all of the tag names mentioned below are conformant tag names in this specification; many are included to @@ -110467,45 +110078,39 @@ document.body.appendChild(text);

    Parsing XHTML documents

    -

    This section describes the relationship between XML and the DOM, - with a particular emphasis on how this interacts with HTML.

    +

    This section describes the relationship between XML and the DOM, with a particular emphasis on + how this interacts with HTML.

    -

    An XML parser, for the purposes of this specification, - is a construct that follows the rules given in the XML specification - to map a string of bytes or characters into a Document - object.

    +

    An XML parser, for the purposes of this specification, is a construct that follows + the rules given in the XML specification to map a string of bytes or characters into a + Document object.

    -

    An XML parser is either associated with a - Document object when it is created, or creates one - implicitly.

    +

    An XML parser is either associated with a Document object when it is + created, or creates one implicitly.

    This Document must then be populated with DOM nodes that represent the tree structure of the input passed to the parser, as defined by the XML specification, the Namespaces - in XML specification, and the DOM Core specification. DOM mutation events must not fire for the + in XML specification, and the DOM specification. DOM mutation events must not fire for the operations that the XML parser performs on the Document's tree, but the user agent must act as if elements and attributes were individually appended and set respectively so as to trigger rules in this specification regarding what happens when an element is inserted - into a document or has its attributes set, and the DOM Core specification's requirements regarding + into a document or has its attributes set, and the DOM specification's requirements regarding mutation observers mean that mutation observers are fired (unlike mutation events). [XML] [XMLNS] [DOMCORE] [XML] [XMLNS] [DOM] [DOMEVENTS]

    -

    Between the time an element's start tag is parsed and the time - either the element's end tag is parsed or the parser detects a - well-formedness error, the user agent must act as if the element was - in a stack of open elements.

    +

    Between the time an element's start tag is parsed and the time either the element's end tag is + parsed or the parser detects a well-formedness error, the user agent must act as if the element + was in a stack of open elements.

    -

    This is used by the object element to - avoid instantiating plugins before the param element - children have been parsed.

    +

    This is used by the object element to avoid instantiating plugins + before the param element children have been parsed.

    -

    This specification provides the following additional information - that user agents should use when retrieving an external entity: the - public identifiers given in the following list all correspond to the URL given by this - link. (This URL is a DTD containing the entity reference - declarations for the names listed in the named character - references section.)

    +

    This specification provides the following additional information that user agents should use + when retrieving an external entity: the public identifiers given in the following list all + correspond to the URL given by this link. (This + URL is a DTD containing the entity reference declarations for the names listed in the named + character references section.)

    • -//W3C//DTD XHTML 1.0 Transitional//EN
    • @@ -110711,27 +110316,20 @@ document.body.appendChild(text);
    • -

      If there is a context element, - feed the parser just created the string corresponding - to the start tag of that element, declaring all the namespace - prefixes that are in scope on that element in the DOM, as well as - declaring the default namespace (if any) that is in scope on that - element in the DOM.

      +

      If there is a context element, feed the + parser just created the string corresponding to the start tag of that element, declaring + all the namespace prefixes that are in scope on that element in the DOM, as well as declaring + the default namespace (if any) that is in scope on that element in the DOM.

      -

      A namespace prefix is in scope if the DOM Core lookupNamespaceURI() method on the element would - return a non-null value for that prefix.

      +

      A namespace prefix is in scope if the DOM lookupNamespaceURI() method + on the element would return a non-null value for that prefix.

      -

      The default namespace is the namespace for which the DOM Core - isDefaultNamespace() method on the element - would return true.

      +

      The default namespace is the namespace for which the DOM isDefaultNamespace() method on the element would return true.

      -

      If there is a context element, no DOCTYPE is passed to the parser, and therefore no - external subset is referenced, and therefore no entities will be - recognized.

      +

      If there is a context element, no + DOCTYPE is passed to the parser, and therefore no external subset is + referenced, and therefore no entities will be recognized.

    • @@ -115308,7 +114906,7 @@ if (s = prompt('What is your name?')) {
      event on script elements
      for on script elements
      -

      Use DOM Events mechanisms to register event listeners. [DOMCORE]

      +

      Use DOM Events mechanisms to register event listeners. [DOM]

      datapagesize on table elements

      Unnecessary. Omit it altogether.

      @@ -121694,14 +121292,14 @@ if (s = prompt('What is your name?')) {
      [DASH]
      Dynamic adaptive streaming over HTTP (DASH). ISO.
      -
      [DOMCORE]
      -
      Web DOM Core, A. van Kesteren. WHATWG.
      +
      [DOM]
      +
      DOM, A. van Kesteren, A. Gregor, Ms2ger. WHATWG.
      [DOMEVENTS]
      Document Object Model (DOM) Level 3 Events Specification, T. Leithead, J. Rossi, D. Schepers, B. Höhrmann, P. Le Hégaret, T. Pixley. W3C.
      [DOMPARSING]
      -
      DOM Parsing and Serialization, Ms2ger. html5.org.
      +
      DOM Parsing and Serialization, Ms2ger. WHATWG.
      [DOT]
      (Non-normative) The DOT Language. Graphviz.
      @@ -121717,7 +121315,7 @@ if (s = prompt('What is your name?')) {
      (Non-normative) ECMAScript for XML (E4X) Specification. ECMA.
      [EDITING]
      -
      HTML Editing APIs, A. Gregor.
      +
      HTML Editing APIs, A. Gregor. W3C Editing APIs CG.
      [EUCKR]
      Hangul Unix Environment. Korea Industrial Standards Association. Ref. No. KS C 5861-1992.