diff --git a/sections/acknowledgements.include b/sections/acknowledgements.include index 1690391480..fcf73dc652 100644 --- a/sections/acknowledgements.include +++ b/sections/acknowledgements.include @@ -1,21 +1,21 @@

Acknowledgements

- Thanks to Tim Berners-Lee for inventing HTML, without which none of this would exist, Dan Connolly, - the many who worked to standardise HTML over the last couple of decades or so, and the many more who - worked on ideas subsequently incorporated into HTML. + Thanks to Tim Berners-Lee for inventing HTML, without which none of this would exist, Dan + Connolly, the many who worked to standardise HTML over the last couple of decades or so, and the + many more who worked on ideas subsequently incorporated into HTML. - For inestimable work, and the drive to keep HTML up to date, particular thanks are due to Ian Hickson, - and the other editors of the WHATWG: Anne van Kesteren, Domenic Denicola, Philip Jägenstedt, - Simon Pieters. + For inestimable work, and the drive to keep HTML up to date, particular thanks are due to Ian + Hickson, and the other editors of the WHATWG: Anne van Kesteren, Domenic Denicola, Philip + Jägenstedt, Simon Pieters. Thanks to the participants of the Responsive Images Community Group - and the WHATWG for helping to develop the <{picture}> element, the <{img/srcset}> attribute, - and the <{source/sizes}> attribute. Special thanks to Bruce Lawson for originally suggesting, - Edward O'Connor and Ian Hickson for writing the original srcset specification, and Adrian Bateman - for providing the group with guidance. Contributions also from: David Newton, Ilya Grigorik, - John Schoenick, and Leon de Rijke. + and the WHATWG for helping to develop the <{picture}> element, the <{img/srcset}> attribute, and + the <{source/sizes}> attribute. Special thanks to Bruce Lawson for originally suggesting, Edward + O'Connor and Ian Hickson for writing the original srcset specification, and Adrian Bateman for + providing the group with guidance. Contributions also from: David Newton, Ilya Grigorik, John + Schoenick, and Leon de Rijke. With apologies to people who have undeservedly not been named, thanks to @@ -24,7 +24,6 @@

People who have contributed to previous versions of HTML

- Aankhen, Aaron Boodman, Aaron Leventhal, @@ -345,6 +344,9 @@ Ian Kilpatrick, Ido Green, Ignacio Javier, + Igor Oliveira, + Ingvar Stepanyan, + Iurii Kucherov, Ivan Enderlin, Ivo Emanuel Gonçalves, J. King, @@ -833,13 +835,13 @@ Thanks also to everyone who has ever posted about HTML to their blogs, public mailing lists, or forums, including all the contributors to the various - W3C HTML WG lists and the various WHATWG - lists. + W3C HTML WG lists and the + various WHATWG lists. The image of two cute kittens in a basket used in the context menu example is based on - a photo - by Alex G. + a photo by + Alex G. (CC BY 2.0) The Blue Robot Player sprite used in the canvas demo is based on @@ -847,15 +849,18 @@ JohnColburn. (CC BY-SA 3.0) - The photograph of robot 148 climbing the tower at the FIRST Robotics Competition 2013 Silicon Valley Regional is based on + The photograph of robot 148 climbing the tower at the FIRST Robotics Competition 2013 Silicon + Valley Regional is based on a work by Lenore Edman. (CC BY 2.0) - The fancy image of the letter O with a child sitting in it reading a book is by Jessie Wilcox Smith and is in the Public Domain. + The fancy image of the letter O with a child sitting in it reading a book is + by Jessie Wilcox Smith and is in the Public + Domain. - Parts of this specification are © Copyright 2004-2014 Apple Inc., Mozilla Foundation, and - Opera Software ASA. You are granted a license to use, reproduce and create derivative works of - this document. + Parts of this specification are © Copyright 2004-2014 Apple Inc., Mozilla Foundation, and Opera + Software ASA. You are granted a license to use, reproduce and create derivative works of this + document.
diff --git a/sections/browsers.include b/sections/browsers.include index f51a6a969b..1dd06d17ad 100644 --- a/sections/browsers.include +++ b/sections/browsers.include @@ -101,7 +101,7 @@ {{Document}} D with an element E that nests another browsing context C inside it, then C is said to be nested through D, and E is said to be the browsing context container of C. - If the browsing context container element E is in the Document D, then P is + If the browsing context container element E is in the Document D, then P is said to be the parent browsing context of C and C is said to be a child browsing context of P. Otherwise, the nested browsing context C has no parent browsing context. @@ -126,8 +126,8 @@
  • - For each child browsing context of d that is nested through an element that is in the Document d, in the tree - order of the elements nesting those browsing + For each child browsing context of d that is nested through an element + that is in the Document d, in the tree order of the elements nesting those browsing contexts, run these substeps:
      @@ -1459,8 +1459,7 @@
    1. Let specified browsing context be the browsing context being closed.
    2. -
    3. Prompt to unload the active - document of the specified browsing context. If the user refused +
    4. Prompt to unload the active document of the specified browsing context. If the user refused to allow the document to be unloaded, then abort these steps.
    5. Unload the active document of the specified browsing context with the recycle parameter set to @@ -2696,8 +2695,7 @@
        -
      1. Prompt to unload the active - document of the specified browsing context. If the user +
      2. Prompt to unload the active document of the specified browsing context. If the user refused to allow the document to be unloaded, then abort these steps.
      3. Unload the active document of the @@ -3151,7 +3149,7 @@ origin.

        It returns the Unicode rather than the ASCII serialization for compatibility with - MessageEvent. + MessageEvent.

        The protocol attribute's getter must run these steps: @@ -4596,7 +4594,7 @@
      4. If hash changed is true, then fire a trusted event with the name hashchange at the browsing - context's Window object, using the HashChangeEvent interface, + context's {{Window}} object, using the {{HashChangeEvent}} interface, with the oldURL attribute initialized to old URL and the newURL attribute initialized to new URL. This event must bubble but not be cancelable and has no default action.
      5. @@ -4651,28 +4649,23 @@
             dictionary PopStateEventInit : EventInit {
        -      any state;
        +      any state = null;
             };
           
        -
        event . state
        -
        - - Returns a copy of the information that was provided to pushState() or replaceState(). - + Returns a copy of the information that was provided to pushState() or + replaceState().
        -
        - The state attribute must return the - value it was initialized to. When the object is created, this attribute must be initialized to - null. It represents the context information for the event, or null, if the state represented is - the initial state of the {{Document}}. + The state attribute must return the value it + was initialized to. It represents the context information for the event, or null, if the state + represented is the initial state of the {{Document}}.
        @@ -4681,53 +4674,37 @@
             [Constructor(DOMString type, optional HashChangeEventInit eventInitDict), Exposed=(Window,Worker)]
             interface HashChangeEvent : Event {
        -      readonly attribute DOMString oldURL;
        -      readonly attribute DOMString newURL;
        +      readonly attribute USVString oldURL;
        +      readonly attribute USVString newURL;
             };
           
             dictionary HashChangeEventInit : EventInit {
        -      DOMString oldURL;
        -      DOMString newURL;
        +      USVString oldURL = "";
        +      USVString newURL = "";
             };
           
        -
        event . oldURL
        -
        - - Returns the URL of the session history entry that was previously - current. - + Returns the URL of the session history entry that was previously + current.
        -
        event . newURL
        -
        - - Returns the URL of the session history entry that is now - current. - + Returns the URL of the session history entry that is now current.
        -
        -
        - The oldURL attribute must return the - value it was initialized to. When the object is created, this attribute must be initialized to - null. It represents context information for the event, specifically the URL of the session - history entry that was traversed from. + value it was initialized to. It represents context information for the event, specifically the URL + of the session history entry that was traversed from. The newURL attribute must return the - value it was initialized to. When the object is created, this attribute must be initialized to - null. It represents context information for the event, specifically the URL of the session - history entry that was traversed to. - -
        + value it was initialized to. It represents context information for the event, specifically the URL + of the session history entry that was traversed to.
        The PageTransitionEvent interface
        @@ -4740,52 +4717,38 @@
             dictionary PageTransitionEventInit : EventInit {
        -      boolean persisted;
        +      boolean persisted = false;
             };
           
        -
        event . persisted
        -
        + For the pageshow event, returns false if the page is newly being loaded (and the + load event will fire). Otherwise, returns true. - For the pageshow event, returns false if the page is - newly being loaded (and the load event will fire). Otherwise, - returns true. - - For the pagehide event, returns false if the page is - going away for the last time. Otherwise, returns true, meaning that (if nothing conspires to - make the page unsalvageable) the page might be reused if the user navigates back to this - page. + For the pagehide event, returns false if the page is going away for the last + time. Otherwise, returns true, meaning that (if nothing conspires to make the page + unsalvageable) the page might be reused if the user navigates back to this page. - Things that can cause the page to be unsalvageable include: - -
          -
        • document.open() -
        • Listening for beforeunload events -
        • Listening for unload events -
        • Having iframes that are not salvageable -
        • Active WebSocket objects -
        • Aborting a Document -
        + Things that can cause the page to be unsalvageable include: +
          +
        • document.open() +
        • Listening for beforeunload events +
        • Listening for unload events +
        • Having iframes that are not salvageable +
        • Active WebSocket objects +
        • Aborting a Document +
        -
        -
        - - The persisted attribute must - return the value it was initialized to. When the object is created, this attribute must be - initialized to false. It represents the context information for the event. - -
        + The persisted attribute must return + the value it was initialized to. It represents the context information for the event.

        Unloading documents

        -
        - A {{Document}} has a salvageable state, which must initially be true, a fired unload flag, which must initially be false, and a page showing flag, which must initially be false. The page showing flag is used to ensure that @@ -4793,11 +4756,12 @@ receive two pagehide events in a row without an intervening pageshow, or vice versa). - Event loops have a termination nesting level - counter, which must initially be zero. + Event loops have a termination nesting level counter, which must initially be + zero. - When a user agent is to prompt to unload a document, it must run the following - steps. + When a user agent is to + prompt to unload a document, it must + run the following steps.
          @@ -4845,14 +4809,12 @@
        1. - If descendants is not an empty list, then for each browsing - context b in descendants run the following - substeps: + If descendants is not an empty list, then for each browsing context + b in descendants run the following substeps:
            -
          1. Prompt to unload the active - document of the browsing context b. If the user +
          2. Prompt to unload the active document of the browsing context b. If the user refused to allow the document to be unloaded, then the user implicitly also refused to allow this document to be unloaded; jump to the step labeled end.
          3. If the salvageable state of the active @@ -4930,8 +4892,7 @@
          4. - If descendants is not an empty list, then for each browsing - context b in descendants run the following + If descendants is not an empty list, then for each browsing context b in descendants run the following substeps:
              @@ -4982,8 +4943,6 @@
            -
        -
        The BeforeUnloadEvent interface
        diff --git a/sections/dom.include b/sections/dom.include
        index 74f87800eb..af0880e968 100644
        --- a/sections/dom.include
        +++ b/sections/dom.include
        @@ -75,6 +75,8 @@
           
             enum DocumentReadyState { "loading", "interactive", "complete" };
         
        +    typedef (HTMLScriptElement or SVGScriptElement) HTMLOrSVGScriptElement;
        +
             [OverrideBuiltins]
             partial /*sealed*/ interface Document {
               // resource metadata management
        @@ -98,7 +100,7 @@
               [SameObject] readonly attribute HTMLCollection forms;
               [SameObject] readonly attribute HTMLCollection scripts;
               NodeList getElementsByName(DOMString elementName);
        -      readonly attribute HTMLScriptElement? currentScript;
        +      readonly attribute HTMLOrSVGScriptElement? currentScript;
         
               // dynamic markup insertion
               Document open(optional DOMString type = "text/html", optional DOMString replace = "");
        @@ -266,27 +268,23 @@
             
           
         
        -  
        - Each document has a current document readiness. When a {{Document}} object - is created, it must have its current document readiness set to the string - "loading" if the document is associated with an HTML parser, an - XML parser, or an XSLT processor, and to the string "complete" - otherwise. Various algorithms during page loading affect this value. When the value is set, the - user agent must fire a simple event named readystatechange at the - {{Document}} object. - - A {{Document}} is said to have an active parser if it is associated with an - HTML parser or an XML parser that has not yet been stopped or - aborted. - - The readyState IDL attribute must, on getting, return the current - document readiness. -
        + Each document has a current document readiness. When a {{Document}} object is created, + it must have its current document readiness set to the string "loading" if the + document is associated with an HTML parser, an XML parser, or an XSLT processor, and + to the string "complete" otherwise. Various algorithms during page loading affect + this value. When the value is set, the user agent must fire a simple event named + readystatechange at the {{Document}} object. + + A {{Document}} is said to have an active parser if it is associated with an + HTML parser or an XML parser that has not yet been stopped or aborted. + + The readyState IDL attribute must, on getting, + return the current document readiness.

        DOM tree accessors

        - The <{html}> element of a document is the document's root element, if there is - one and it's an <{html}> element, or null otherwise. + The <{html}> element of a document is it's document element, if it's an an + <{html}> element, and null otherwise.
        @@ -298,10 +296,8 @@ The <{head}> element of a document is the first <{head}> element that is a child of the <{html}> element, if there is one, or null otherwise. -
        - The head attribute, on getting, must return - the <{head}> element of the document (a <{head}> element or null). -
        + The head attribute, on getting, must return + the <{head}> element of the document (a <{head}> element or null).
        @@ -309,63 +305,52 @@
        document . title [ = value ]
        Returns the document's title, as given by the title element for HTML and - as given by the SVG title element for SVG. + as given by the SVG title element for SVG. Can be set, to update the document's title. If there is no appropriate element to update, the new value is ignored.
        - The title element of a document is the first title element - in the document (in tree order), if there is one, or null otherwise. - -
        - The title attribute must, on getting, run the following algorithm: - - 1. If the root element is an <{svg}> element in the SVG namespace, then let - value be the child text content of the first - title element in the SVG namespace that is a - child of the root element. [[!SVG]] - 2. Otherwise, let value be the child text content of the - title element, in tree order, or - the empty string if the title element is null. - 3. Strip and collapse whitespace in value. - 4. Return value. - - On setting, the steps corresponding to the first matching condition in the following list must - be run: - -
        -
        - If the root element is an <{svg}> element in the SVG namespace - [[!SVG]] -
        -
        - 1. Let element be the first title element in the - SVG namespace that is a child of the root element, if any. If there isn't - one, create a title element in the SVG namespace, insert it as the - first child of the root element, and let element be that element. - [[!SVG]] - 2. Act as if the {{Node/textContent}} IDL attribute of element was set to the - new value being assigned. -
        - -
        If the root element is in the HTML namespace
        -
        - 1. If the title element is null and the <{head}> element - is null, then abort these steps. - 2. If the title element is null, then create a new title - element and append it to the <{head}> element, and let - element be the newly created element; otherwise, let element be - the title element. - 3. Act as if the {{Node/textContent}} IDL attribute of element was set to the - new value being assigned. -
        - -
        Otherwise
        -
        Do nothing.
        -
        -
        + The title element of a document is the first + title element in the document (in tree order), if + there is one, or null otherwise. + + The title attribute must, on getting, run the + following algorithm: + + 1. If the document element is an SVG svg element, then let + value be the child text content of the first + SVG title element that is a child of the document element. [[!SVG]] + 2. Otherwise, let value be the child text content of the + title element, in tree order, or + the empty string if the title element is null. + 3. Strip and collapse whitespace in value. + 4. Return value. + + On setting, the steps corresponding to the first matching condition in the following list must + be run: + + : If the document element is an SVG svg element [[!SVG]] + :: 1. Let element be the first SVG title element that is a child + of the document element, if any. If there isn't one, create a + SVG title element, insert it as the first child of the + document element, and let element be that element. [[!SVG]] + 2. Act as if the {{Node/textContent}} IDL attribute of element was set to the new + value being assigned. + + : If the document element is in the HTML namespace + :: 1. If the title element is null and the <{head}> element + is null, then abort these steps. + 2. If the title element is null, then create a new + title element and append it to the <{head}> + element, and let element be the newly created element; otherwise, let + element be the title element. + 3. Act as if the {{Node/textContent}} IDL attribute of element was set to the + new value being assigned. + + : Otherwise + :: Do nothing.
        @@ -381,28 +366,22 @@ - The <{body}> element of a document is the first child of - the <{html}> element that is either a <{body}> element or a - <{frameset}> element. If there is no such element, it is null. + The <{body}> element of a document is the first child of the <{html}> element that is either a + <{body}> element or a <{frameset}> element. If there is no such element, it is null. -
        - The body attribute, on getting, must return the <{body}> element of - the document (either a <{body}> element, a <{frameset}> element, or null). On - setting, the following algorithm must be run: + The body attribute, on getting, must return the + <{body}> element of the document (either a <{body}> element, a <{frameset}> element, or null). On + setting, the following algorithm must be run: - 1. If the new value is not a <{body}> or <{frameset}> element, then throw a - HierarchyRequestError exception and abort these steps. - 2. Otherwise, if the new value is the same as the <{body}> element, do nothing. Abort these - steps. - 3. Otherwise, if the <{body}> element is not null, then replace that element with the new - value in the DOM, as if the root element's replaceChild() method had been - called with the new value and the incumbent <{body}> element as its two arguments - respectively, then abort these steps. - 4. Otherwise, if there is no root element, throw a HierarchyRequestError exception - and abort these steps. - 5. Otherwise, the <{body}> element is null, but there's a root element. Append the new value - to the root element. -
        + 1. If the new value is not a <{body}> or <{frameset}> element, then throw a + {{HierarchyRequestError}} exception and abort these steps. + 2. Otherwise, if the new value is the same as the <{body}> element, do nothing. Abort these steps. + 3. Otherwise, if the <{body}> element is not null, then replace the <{body}> element + with the new value within the <{body}> element's parent and abort these steps. + 4. Otherwise, if there is no document element, throw a {{HierarchyRequestError}} exception + and abort these steps. + 5. Otherwise, the <{body}> element is null, but there's a document element. Append + the new value to the document element.
        @@ -440,28 +419,26 @@ -
        - The images attribute must return an HTMLCollection rooted - at the {{Document}} node, whose filter matches only <{img}> elements. + The images attribute must return an HTMLCollection rooted + at the {{Document}} node, whose filter matches only <{img}> elements. - The embeds attribute must return an HTMLCollection rooted - at the {{Document}} node, whose filter matches only <{embed}> elements. + The embeds attribute must return an HTMLCollection rooted + at the {{Document}} node, whose filter matches only <{embed}> elements. - The plugins attribute must return the same object as that returned by - the embeds attribute. + The plugins attribute must return the same object as that returned by + the embeds attribute. - The links attribute must return an HTMLCollection rooted at - the {{Document}} node, whose filter matches only <{a}> elements with - <{links/href}> attributes and <{area}> elements with <{links/href}> attributes. + The links attribute must return an HTMLCollection rooted at + the {{Document}} node, whose filter matches only <{a}> elements with + <{links/href}> attributes and <{area}> elements with <{links/href}> attributes. - The forms attribute must return an HTMLCollection rooted at - the {{Document}} node, whose filter matches only <{form}> elements. + The forms attribute must return an HTMLCollection rooted at + the {{Document}} node, whose filter matches only <{form}> elements. - The scripts attribute must return an HTMLCollection rooted - at the {{Document}} node, whose filter matches only <{script}> elements. + The scripts attribute must return an HTMLCollection rooted + at the {{Document}} node, whose filter matches only <{script}> elements. -
        -
        +
        @@ -488,12 +465,13 @@
        document . currentScript
        - Returns the <{script}> element that is currently executing. In the case of reentrant - script execution, returns the one that most recently started executing amongst - those that have not yet finished executing. + Returns the <{script}> element, or the SVG script element, that is + currently executing. In the case of reentrant script execution, returns the one that most + recently started executing amongst those that have not yet finished executing. Returns null if the {{Document}} is not currently executing a script - element (e.g., because the running script is an event handler, or a timeout). + element or SVG script element (e.g., because the running script is an + event handler, or a timeout).
        @@ -1009,7 +987,7 @@
      6. <{main}>
      7. <{map}>
      8. <{mark}>
      9. -
      10. <{math}>
      11. +
      12. MathML math
      13. <{menu}>
      14. <{meter}>
      15. <{nav}>
      16. @@ -1033,7 +1011,7 @@
      17. <{strong}>
      18. <{sub}>
      19. <{sup}>
      20. -
      21. <{svg}>
      22. +
      23. SVG svg
      24. <{table}>
      25. <{template}>
      26. <{textarea}>
      27. @@ -1115,7 +1093,7 @@
      28. <{link}> (if it is allowed in the body)
      29. <{map}>
      30. <{mark}>
      31. -
      32. <{math}>
      33. +
      34. MathML math
      35. <{meter}>
      36. <{noscript}>
      37. <{object}>
      38. @@ -1133,7 +1111,7 @@
      39. <{strong}>
      40. <{sub}>
      41. <{sup}>
      42. -
      43. <{svg}>
      44. +
      45. SVG svg
      46. <{template}>
      47. <{textarea}>
      48. <{time}>
      49. @@ -1179,10 +1157,10 @@
      50. <{embed}>
      51. <{iframe}>
      52. <{img}>
      53. -
      54. <{math}>
      55. +
      56. MathML math
      57. <{object}>
      58. <{picture}>
      59. -
      60. <{svg}>
      61. +
      62. SVG svg
      63. <{video}>
      64. @@ -1288,7 +1266,7 @@
      65. <{main}>
      66. <{map}>
      67. <{mark}>
      68. -
      69. <{math}>
      70. +
      71. MathML math
      72. <{menu}> (if the type attribute is in the toolbar state)
      73. <{meter}>
      74. <{nav}>
      75. @@ -1311,7 +1289,7 @@
      76. <{strong}>
      77. <{sub}>
      78. <{sup}>
      79. -
      80. <{svg}>
      81. +
      82. SVG svg
      83. <{table}>
      84. <{textarea}>
      85. <{time}>
      86. @@ -1445,7 +1423,7 @@ Conformance checkers may warn authors of cases where they have paragraphs that overlap each other (this can happen with <{object}>, <{video}>, <{audio}>, and <{canvas}> elements, and indirectly through elements in other namespaces that allow - HTML to be further embedded therein, like <{svg}> or <{math}>). + HTML to be further embedded therein, like SVG svg or MathML math). A paragraph is also formed explicitly by <{p}> elements. @@ -1712,8 +1690,8 @@ 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 tree and must contain + at least one character. The value must not contain any space characters.

        There are no other restrictions on what form an ID can take; in particular, IDs can consist of @@ -1837,88 +1815,84 @@ to indicate a change in language). It provides an explicit indication to user agents about the language of content, so an appropriate language dictionary can be used and, in the case of screen readers and similar assistive technologies with voice output, the content is pronounced using the - correct voice / language library (where available). The lang attribute is also used for font - selection where different alphabets are mixed.

        - -

        Incorrect or absent <{global/lang}> attributes can produce unexpected results in other circumstances, - as they are also used to determine quotation marks for <{q}> elements, and for styling such + correct voice / language library (where available). The lang attribute is also used for font + selection where different alphabets are mixed.

        + +

        Incorrect or absent <{global/lang}> attributes can produce unexpected results in other circumstances, + as they are also used to determine quotation marks for <{q}> elements, and for styling such as hyphenation, case conversion, and line-breaking, as well as for spell-checking in some editors, etc.

        - -

        Setting of a language using the <{global/lang}> attribute which does not match the - language of the document or document parts will result in some users being unable to understand + +

        Setting of a language using the <{global/lang}> attribute which does not match the + language of the document or document parts will result in some users being unable to understand the content.

        -
        -
        +
        - To determine the language of a node, user agents must look at the nearest ancestor - element (including the element itself if the node is an element) that has a - <{global/lang}> attribute in the XML namespace set or is an HTML element - and has a <{global/lang}> in no namespace attribute set. That attribute specifies the language - of the node (regardless of its value). - - If both the <{global/lang}> attribute in no namespace and the - <{global/lang}> attribute in the XML namespace are set on an element, user - agents must use the <{global/lang}> attribute in the XML namespace, and the - <{global/lang}> attribute in no namespace must be ignored for the purposes of - determining the element's language. - - If neither the node nor any of the node's ancestors, including the root element, - have either attribute set, but there is a pragma-set default language set, then that - is the language of the node. If there is no pragma-set default language set, then - language information from a higher-level protocol (such as HTTP), if any, must be used as the - final fallback language instead. In the absence of any such language information, and in cases - where the higher-level protocol reports multiple languages, the language of the node is unknown, - and the corresponding language tag is the empty string. - -

        - For example, if a document is delivered over HTTP and the Content-Language HTTP - header is specified with a value "en", then for any element in the document - that does not itself have a <{global/lang}> attribute nor any ancestor of that element, the - fallback language for the element will be English. If the value of the - Content-Language header was "de, fr, it" then the language of the - node is unknown. This - article provides some additional guidance on the use of HTTP headers, and <{meta}> - elements for providing language information. -

        + To determine the language of a node, user agents must look at the nearest ancestor + element (including the element itself if the node is an element) that has a <{global/lang}> + attribute in the XML namespace set or is an HTML element and has a <{global/lang}> + in no namespace attribute set. That attribute specifies the language of the node (regardless of + its value). + + If both the <{global/lang}> attribute in no namespace and the <{global/lang}> attribute in the + XML namespace are set on an element, user agents must use the <{global/lang}> attribute in + the XML namespace, and the <{global/lang}> attribute in no namespace must be ignored + for the purposes of determining the element's language. + + If node's inclusive ancestors do not have have either attribute set, but there is a + pragma-set default language set, then that is the language of the node. If there is no + pragma-set default language set, then language information from a higher-level protocol + (such as HTTP), if any, must be used as the final fallback language instead. In the absence of any + such language information, and in cases where the higher-level protocol reports multiple + languages, the language of the node is unknown, and the corresponding language tag is the empty + string. + +

        + For example, if a document is delivered over HTTP and the Content-Language HTTP + header is specified with a value "en", then for any element in the document that + does not itself have a <{global/lang}> attribute nor any ancestor of that element, the fallback + language for the element will be English. If the value of the Content-Language + header was "de, fr, it" then the language of the node is unknown. + This article provides + some additional guidance on the use of HTTP headers, and <{meta}> elements for providing + language information. +

        - If the resulting value is not a recognized language tag, then it must be treated as an unknown - language having the given language tag, distinct from all other languages. For the purposes of - round-tripping or communicating with other services that expect language tags, user agents - should pass unknown language tags through unmodified, and tagged as being BCP 47 language tags, - so that subsequent services do not interpret the data as another type of language description. - [[!BCP47]] - -

        - Thus, for instance, an element with lang="xyzzy" would be matched by the selector - :lang(xyzzy) (e.g., in CSS), but it would not be matched by - :lang(abcde), even though both are equally invalid. Similarly, if a Web browser - and screen reader working in unison communicated about the language of the element, the - browser would tell the screen reader that the language was "xyzzy", even if it knew it was - invalid, just in case the screen reader actually supported a language with that tag after all. - Even if the screen reader supported both BCP 47 and another syntax for encoding language - names, and in that other syntax the string "xyzzy" was a way to denote the Belarusian - language, it would be incorrect for the screen reader to then start treating text as - Belarusian, because "xyzzy" is not how Belarusian is described in BCP 47 codes (BCP 47 uses - the code "be" for Belarusian). -

        + If the resulting value is not a recognized language tag, then it must be treated as an unknown + language having the given language tag, distinct from all other languages. For the purposes of + round-tripping or communicating with other services that expect language tags, user agents should + pass unknown language tags through unmodified, and tagged as being BCP 47 language tags, so that + subsequent services do not interpret the data as another type of language description. [[!BCP47]] + +

        + Thus, for instance, an element with lang="xyzzy" would be matched by the selector + :lang(xyzzy) (e.g., in CSS), but it would not be matched by + :lang(abcde), even though both are equally invalid. Similarly, if a Web browser and + screen reader working in unison communicated about the language of the element, the browser + would tell the screen reader that the language was "xyzzy", even if it knew it was invalid, + just in case the screen reader actually supported a language with that tag after all. Even if + the screen reader supported both BCP 47 and another syntax for encoding language names, and in + that other syntax the string "xyzzy" was a way to denote the Belarusian language, it would be + incorrect for the screen reader to then start treating text as Belarusian, because + "xyzzy" is not how Belarusian is described in BCP 47 codes (BCP 47 uses the code "be" for + Belarusian). +

        - If the resulting value is the empty string, then it must be interpreted as meaning that the - language of the node is explicitly unknown. + If the resulting value is the empty string, then it must be interpreted as meaning that the + language of the node is explicitly unknown. -
        +
        - User agents may use the element's language to determine proper processing or rendering (e.g., in - the selection of appropriate fonts or pronunciations, for dictionary selection, or for the user - interfaces of form controls such as date pickers). + User agents may use the element's language to determine proper processing or rendering (e.g., in + the selection of appropriate fonts or pronunciations, for dictionary selection, or for the user + interfaces of form controls such as date pickers). -
        +
        - The lang IDL attribute must reflect the <{global/lang}> content - attribute in no namespace. -
        + The lang IDL attribute must reflect the + <{global/lang}> content attribute in no namespace.
        The <{global/translate}> attribute
        @@ -1940,7 +1914,7 @@ translate attribute is in the inherit state, or the element is not an HTML element and thus does not have a translate attribute; in either case, the element's translation mode is in the same state as its parent element's, if any, or in the - translate-enabled state, if the element is a root element. + translate-enabled state, if the element is a document element. When an element is in the translate-enabled state, the element's translatable attributes and the values of its Text node children are to be @@ -1984,7 +1958,7 @@
               <!DOCTYPE HTML>
        -      <html> <!-- default on the root element is translate=yes -->
        +      <html> <!-- default on the document element is translate=yes -->
                 <head>
                   <title>The Bee Game</title> <!-- implied translate=yes inherited from ancestors -->
                 </head>
        @@ -2046,7 +2020,7 @@
           
        If the element's <{global/dir}> attribute is in the ltr state
        - If the element is a root element and the <{global/dir}> attribute is not in a defined + If the element is a document element and the <{global/dir}> attribute is not in a defined state (i.e., it is not present or has an invalid value)
        @@ -2075,7 +2049,7 @@ [[!BIDI]] Otherwise, if the element's value is not the empty string, or if the element is a - root element, the directionality of the element is "ltr". + document element, the directionality of the element is "ltr". Otherwise, the directionality of the element is the same as the element's parent element's directionality. @@ -2107,7 +2081,7 @@ If such a character is found and it is of bidirectional character type L, the directionality of the element is "ltr". - Otherwise, if the element is a root element, the directionality of the element + Otherwise, if the element is a document element, the directionality of the element is "ltr". Otherwise, the directionality of the element the same as the element's parent element's @@ -2393,7 +2367,7 @@ DOMStringMap object, associated with the following algorithms, which expose these attributes on their element: - : The algorithm for getting the list of name-value pairs + : The algorithm for getting the list of name-value pairs :: 1. Let list be an empty list of name-value pairs. 2. For each content attribute on the element whose first five characters are the string "<{global/data-}>" and whose remaining characters (if any) do not include any @@ -2407,7 +2381,7 @@ converted to ASCII uppercase. 4. Return list. - : The algorithm for setting names to certain values + : The algorithm for setting names to certain values :: 1. Let name be the name passed to the algorithm. 2. Let value be the value passed to the algorithm. 3. If name contains a U+002D HYPHEN-MINUS character (-) followed by a @@ -2422,7 +2396,7 @@ setAttribute() would have thrown an exception when setting an attribute with the name name, then this must throw the same exception. - : The algorithm for deleting names + : The algorithm for deleting names :: 1. Let name be the name passed to the algorithm. 2. For each uppercase ASCII letter in name, insert a U+002D HYPHEN-MINUS character (-) before the character and replace the character with the same character @@ -2433,7 +2407,7 @@

        This algorithm will only get invoked by the Web IDL specification for names that are given - by the earlier algorithm for getting the list of name-value pairs. [[!WEBIDL]] + by the earlier algorithm for getting the list of name-value pairs. [[!WEBIDL]]

        @@ -3091,7 +3065,7 @@ - math + MathML math Content that represents a mathematical expression. none diff --git a/sections/editing.include b/sections/editing.include index 75f1628166..8161c435bf 100644 --- a/sections/editing.include +++ b/sections/editing.include @@ -159,8 +159,7 @@ {{Document}}, must be marked as inert. An entire Document can be marked as blocked by a modal dialog - subject. While a Document is so marked, every node that is in the - Document, with the exception of the subject element and its + subject. While a Document is so marked, every node that is in the Document, with the exception of the subject element and its descendants, must be marked inert. (The elements excepted by this paragraph can additionally be marked inert through other means; being part of a modal dialog does not "protect" a node from being marked inert.) @@ -834,7 +833,7 @@ -
        If new focus target is the root element of its +
        If new focus target is the document element of its Document
        @@ -1197,11 +1196,10 @@
      87. - If target node is a Document that has a <{body}> element, then let target node be the body element of that {{Document}}. + If target node is a Document that has a <{body}> element, then let target node be the <{body}> element of that {{Document}}. - Otherwise, if target node is a Document that has a - root element, then let target node be the root - element of that {{Document}}. + Otherwise, if target node is a {{Document}} object that has a non-null + document element, then let target node be that document element.
      88. @@ -1219,8 +1217,7 @@
      89. If the event was not canceled, then let target area handle the key - event. This might include running synthetic - click activation steps for target node.
      90. + event. This might include running synthetic click activation steps for target node.
      @@ -1509,7 +1506,7 @@
      Moves the focus to the viewport. Use of this method is discouraged; if you want to focus the - viewport, call the focus() method on the Document's root element. + viewport, call the focus() method on the Document's document element. Do not use this method to hide the focus ring if you find the focus ring unsightly. Instead, use a CSS rule to override the 'outline' property, and provide a different way to show what @@ -1556,12 +1553,13 @@
    6. - If candidate is a Document that has a <{body}> element, then let candidate be the body element of that {{Document}}. - - Otherwise, if candidate is a Document that has a root - element, then let candidate be the root element of that + If candidate is a Document that has a <{body}> element, then let + candidate be the <{body}> element of that {{Document}}. + Otherwise, if candidate is a {{Document}} with a non-null document element, then + let candidate be that document element. + Otherwise, if candidate is a {{Document}}, then let candidate be null.
    7. @@ -1784,11 +1782,11 @@ - The contentEditable IDL attribute, on - getting, must return the string "true" if the content attribute is set to + The contentEditable IDL attribute, + on getting, must return the string "true" if the content attribute is set to the true state, "false" if the content attribute is set to the false state, - and "inherit" otherwise. On setting, if the new value is an ASCII - case-insensitive match for the string "inherit" then the content + and "inherit" otherwise. On setting, if the new value is an + ASCII case-insensitive match for the string "inherit" then the content attribute must be removed, if the new value is an ASCII case-insensitive match for the string "true" then the content attribute must be set to the string "true", if the new value is an ASCII case-insensitive match for @@ -1821,11 +1819,11 @@ The designMode IDL attribute on the - Document object takes two values, "on" and "off". On setting, the new value must be compared in an ASCII - case-insensitive manner to these two values; if it matches the "on" - value, then designMode must be enabled, and if it - matches the "off" value, then designMode must be disabled. Other values must be - ignored. + Document object takes two values, "on" and "off". On + setting, the new value must be compared in an ASCII case-insensitive manner to these two + values; if it matches the "on" value, then designMode must be enabled, + and if it matches the "off" value, then designMode must be disabled. + Other values must be ignored. On getting, if designMode is enabled, the IDL attribute must return the value "on"; otherwise it is disabled, and the @@ -1838,7 +1836,7 @@ When the designMode changes from being disabled to being enabled, the user agent must immediately reset the document's active range's start and end boundary points to be at the start of the Document and then run the - focusing steps for the root element of the {{Document}}, if any. + focusing steps for the document element of the {{Document}}, if non-null.

      Best practices for in-page editors

      @@ -2517,8 +2515,7 @@ the protected mode, return the empty string and abort these steps.
    8. -
    9. Let format be the first argument, converted to ASCII - lowercase.
    10. +
    11. Let format be the first argument, converted to ASCII lowercase.
    12. Let convert-to-URL be false.
    13. @@ -2553,8 +2550,7 @@ not the read/write mode, abort these steps. Nothing happens. -
    14. Let format be the first argument, converted to ASCII - lowercase.
    15. +
    16. Let format be the first argument, converted to ASCII lowercase.
    17. @@ -2588,8 +2584,7 @@ item list whose {{DataTransferItem/kind}} is Plain Unicode string, and abort these steps.
    18. -
    19. Let format be the first argument, converted to ASCII - lowercase.
    20. +
    21. Let format be the first argument, converted to ASCII lowercase.
    22. @@ -3196,8 +3191,7 @@ If the drag initiated outside of the application, the user agent must add items to the drag data store item list as appropriate for the data being dragged, honoring platform conventions where appropriate; however, if the platform conventions do not use MIME types to label dragged data, the user agent must make a - best-effort attempt to map the types to MIME types, and, in any case, all the drag data item type strings must be converted to ASCII - lowercase. + best-effort attempt to map the types to MIME types, and, in any case, all the drag data item type strings must be converted to ASCII lowercase. User agents may also add one or more items representing the selection or dragged element(s) in other forms, e.g., as HTML. diff --git a/sections/iana.include b/sections/iana.include index 24605c2313..dc2a244532 100644 --- a/sections/iana.include +++ b/sections/iana.include @@ -166,9 +166,9 @@ :: Same as for application/xml [[!RFC7303]] : Published specification: :: Labeling a resource with the application/xhtml+xml type asserts that the resource - is an XML document that likely has a root element from the HTML namespace. Thus, the - relevant specifications are the XML specification, the Namespaces in XML specification, and - this specification. [[!XML]] [[!XPTR-XMLNS]] + is an XML document that likely has a document element from the HTML namespace. + Thus, the relevant specifications are the XML specification, the Namespaces in XML + specification, and this specification. [[!XML]] [[!XPTR-XMLNS]] : Applications that use this media type: :: Same as for application/xml [[!RFC7303]] : Additional information: @@ -176,9 +176,8 @@ : Magic number(s): :: Same as for application/xml [[!RFC7303]] : File extension(s): - :: "xhtml" and "xht" - are sometimes used as extensions for XML resources that have a root element from the - HTML namespace. + :: "xhtml" and "xht" are sometimes used as extensions for XML + resources that have a document element from the HTML namespace. : Macintosh file type code(s): :: TEXT : Person & email address to contact for further information: diff --git a/sections/infrastructure.include b/sections/infrastructure.include index 8ea6ca6551..7dd7c83c75 100644 --- a/sections/infrastructure.include +++ b/sections/infrastructure.include @@ -15,40 +15,43 @@ 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.) + 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. + 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 contain 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. + 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 are - used (sometimes) when referring to the way a document is rendered to the user. These terms are + 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. @@ -86,37 +89,37 @@

      What some specifications, in particular the HTTP specification, refer to as a - representation is referred to in this specification as a resource. [[!HTTP]] + representation is referred to in this specification as a resource. + [[!HTTP]] - The term MIME type is used to refer to what is sometimes called an Internet media - type in protocol literature. The term media type in this specification is used to refer - to the type of media intended for presentation, as used by the CSS specifications. [[!RFC2046]] + The term MIME type is used to refer to what is sometimes + called an Internet media type in protocol literature. The term + media type in this specification is used to refer to the + type of media intended for presentation, as used by the CSS specifications. [[!RFC2046]] [[!MEDIAQ]] - A string is a valid MIME type if it matches the media-type rule. In particular, a valid mime type may include - MIME type parameters. [[!HTTP]] + A string is a valid MIME type if it matches the media-type rule. In + particular, a valid MIME type may include MIME type parameters. [[!HTTP]] - A string is a valid MIME type with no parameters if it matches the - media-type rule, but does not - contain any U+003B SEMICOLON characters (;). In other words, if it consists only of a type and - subtype, with no MIME Type parameters. [[!HTTP]] + A string is a valid MIME type with no parameters if it matches the + media-type rule, but does not contain any U+003B SEMICOLON characters (;). In + other words, if it consists only of a type and subtype, with no MIME Type parameters. [[!HTTP]] The term HTML MIME type is used to refer to the MIME type text/html. - A resource's critical subresources are those that the resource needs to have available - to be correctly processed. Which resources are considered critical or not is defined by the - specification that defines the resource's format. - - The term data: URL refers to URLs that use the data: - scheme. [[!RFC2397]] + A resource's critical subresources are + those that the resource needs to have available to be correctly processed. Which resources are + considered critical or not is defined by the specification that defines the resource's format.

      XML

      - To ease migration from HTML to XHTML, user agents conforming to this specification will place elements in - HTML in the http://www.w3.org/1999/xhtml namespace, at least for the purposes of the - DOM and CSS. The term "HTML elements", when used in this specification, refers to any - element in that namespace, and thus refers to both HTML and XHTML elements. + To ease migration from HTML to XHTML, user agents conforming to this specification will place + elements in HTML in the http://www.w3.org/1999/xhtml namespace, at least for the + purposes of the DOM and CSS. The term "HTML elements", + when used in this specification, refers to any element in that namespace, and thus refers to both + HTML and XHTML elements. Except where otherwise stated, all elements defined or mentioned in this specification are in the HTML namespace ("http://www.w3.org/1999/xhtml"), and all attributes defined or @@ -128,8 +131,8 @@ defined above) the HTML namespace. Attribute names are said to be XML-compatible if they match the - Name production defined in XML and they contain no U+003A COLON characters - (:). [[!XML]] + Name production defined in XML and they contain no U+003A COLON + characters (:). [[!XML]] The term XML MIME type is used to refer to the MIME types text/xml, application/xml, and any MIME type whose subtype ends with the four characters @@ -137,38 +140,6 @@

      DOM trees

      - The root element of a {{Document}} object is that {{Document}}'s - first element child, if any. If it does not have one then the {{Document}} has no root - element. - - The term root element, when not referring to a {{Document}} object's root - element, means the furthest ancestor element node of whatever node is being discussed, or the node - itself if it has no ancestors. When the node is a part of the document, then the node's - root element is indeed the document's root element; however, if the node is not currently - part of the document tree, the root element will be an orphaned node. - - When an element's root element is the root element of a Document object, - it is said to be in a {{Document}}. An element is said to have been - inserted into a document when its root element changes and is now the document's - root element. Analogously, an element is said to have been - removed from a document when its root element changes from being the document's - root element to being another element. - - A node's home subtree is the subtree rooted at that node's root element. When a - node is in a Document, its home subtree is that {{Document}}'s tree. - - The {{Document}} of a {{Node}} (such as an element) is the {{Document}} - that the {{Node}}'s {{Node/ownerDocument}} IDL attribute returns. When a - {{Node}} is in a Document then that {{Document}} is - always the {{Node}}'s {{Document}}, and the {{Node}}'s - {{Node/ownerDocument}} IDL attribute thus always returns that {{Document}}. - - The {{Document}} of a content attribute is the {{Document}} of the attribute's - element. - - The term tree order means a pre-order, depth-first traversal of DOM nodes involved - (through the {{Node/parentNode}}/{{Node/childNodes}} relationship). - When it is stated that some element or attribute is ignored, or treated as some other value, or handled as if it was something else, this refers only to the processing of the node after it is in the DOM. A user agent must not mutate the DOM in such situations. @@ -176,19 +147,25 @@ A content attribute is said to change value only if its new value is different than its previous value; setting an attribute to a value it already has does not change it. - When an attribute value, {{Text}} node, or string is described as empty, it means that the length of the text is zero (i.e., not even containing spaces or - control characters). + The term empty, when used for an attribute value, {{Text}} node, or string means that + the length of the text is zero (i.e., not even containing spaces or control characters). + + An element's child text content is the concatenation of the data of all the + {{Text}} nodes that are children of the element (ignoring any other nodes such as comments or + elements), in tree order. - A node A is - inserted into a node B when the + A node A is inserted into a node B when the insertion steps are invoked with A as the argument and A's new parent is B. Similarly, a node A is removed from a node B when the removing steps are invoked with A as the removedNode argument and B as the oldParent argument. - An element's child text content is the concatenation of the data of all the - {{Text}} nodes that are children of the element (ignoring any other nodes such as comments or - elements), in tree order. + A node is inserted into a document + when the insertion steps are invoked with it as the argument and it is now + in a document tree. Analogously, a + node is removed from a document + when the removing steps are invoked with it as the argument and it is now no longer in a + document tree.

      Scripting

      @@ -640,7 +617,6 @@ * Percent decode * set the username * set the password - * The domain to ASCII algorithm * The domain to Unicode algorithm * non-relative flag * Parse errors from the URL parser @@ -929,21 +905,23 @@ * {{createElementNS()}} method * {{getElementById()}} method * {{Element/getElementsByClassName()}} method - * {{insertBefore()}} method * {{appendChild()}} method * {{cloneNode()}} method * {{importNode()}} method - * {{childNodes}} attribute - * {{Element/localName}} attribute - * {{parentNode}} attribute - * {{Element/namespaceURI}} attribute - * {{tagName}} attribute * {{Element/id}} attribute * {{Node/textContent}} attribute - * The insert, append, remove, replace, and - adopt algorithms for nodes - * The insertion steps, removing steps, and adopting steps - hooks + * The tree concept + * The tree order concept + * The root concept + * The inclusive ancestor concept + * The document element concept + * The in a document concept + * The pre-insert, insert, append, + remove, replace, and adopt algorithms + for nodes + * The insertion steps, + removing steps, and + adopting steps hooks * The attribute list concept. * The data of a text node. * {{Event}} interface @@ -1083,13 +1061,13 @@ : Media Source Extensions :: The following terms are defined in the Media Source Extensions specification: [[!MEDIA-SOURCE]] + * {{MediaSource}} interface * Detaching from a media element - * {{MediaSource}} [[!MEDIA-SOURCE]] : Media Capture and Streams :: The following term is defined in the Media Capture and Streams specification: [[!MEDIACAPTURE-STREAMS]] - * {{MediaStream}} [[!MEDIACAPTURE-STREAMS]] + * {{MediaStream}} interface : XMLHttpRequest :: This specification references the XMLHttpRequest specification to describe how the two @@ -1369,7 +1347,84 @@ : Service Workers :: The following terms are defined in Service Workers: [[!SERVICE-WORKERS]] + * client message queue * match service worker registration + * ServiceWorkerContainer + + : Secure Contexts + :: The following term is defined in Secure Contexts: [[!SECURE-CONTEXTS]] + + * Is environment settings object a secure context? + + : MathML + :: While support for MathML as a whole is not required by this specification (though it is + encouraged, at least for Web browsers), certain features depend upon small parts of MathML + being implemented. [[!MATHML]] + + The following features are defined in the MathML specification: + + * MathML annotation-xml element + * MathML math element + * MathML merror element + * MathML mi element + * MathML mn element + * MathML mo element + * MathML ms element + * MathML mtext element + + : SVG + :: While support for SVG as a whole is not required by this specification (though it is + encouraged, at least for Web browsers), certain features depend upon parts of SVG being + implemented. + + Also, the SVG specifications do not reflect implementation reality. Implementations implement + subsets of SVG 1.1 and SVG Tiny 1.2. Although it is hoped that the in-progress SVG 2 + specification is a more realistic target for implementations, until that specification is + ready, user agents that implement SVG must do so with the following willful violations + and additions. [[!SVG11]] [[!SVGTINY12]] [[!SVG2]] + + User agents that implement SVG must not implement the following features from SVG 1.1: + + * The tref element + * The cursor element (use CSS's cursor property instead) + * The font-defining SVG elements: font, glyph, + missing-glyph, hkern, vkern, + font-face, font-face-src, font-face-uri, + font-face-format, and font-face-name (use CSS's + @font-face instead) + * The externalResourcesRequired attribute + * The enable-background property + * The contentScriptType and contentStyleType attributes (use the + type attribute on the SVG script and + style elements instead) + + User agents that implement SVG must implement the following features from SVG Tiny 1.2: + + * The non-scaling-stroke value for the vector-effect property + * The class attribute is allowed on all SVG elements + * The tabindex attribute is allowed on visible SVG elements + * The ARIA accessibility attributes are allowed on all SVG elements + + The following features are defined in the SVG specifications: + + * SVGImageElement interface + * SVGScriptElement interface + * SVGSVGElement interface + * SVG desc element + * SVG foreignObject element + * SVG image element + * SVG script element + * SVG svg element + * SVG title element + * SVG use element + + : Filter Effects + :: The following feature is defined in the Filter Effects specification: + + * <filter-function-list> + +
      + This specification does not require support of any particular network protocol, style sheet language, scripting language, or any of the DOM specifications beyond those required in the @@ -1580,8 +1635,9 @@ If the transformation program outputs an element in no namespace, the processor must, prior to constructing the corresponding DOM element node, change the namespace of the element to the - HTML namespace, ASCII-lowercase the element's local name, and ASCII-lowercase - the names of any non-namespaced attributes on the element. + HTML namespace, ASCII-lowercase the + element's local name, and ASCII-lowercase the + names of any non-namespaced attributes on the element.

      This requirement is a willful violation of the XSLT 1.0 specification, required because @@ -3675,22 +3731,14 @@ if the content attribute's value is the empty string; and on setting, if the content attribute is not present, it must first be added. - If a reflecting IDL attribute is a DOMString attribute whose content attribute is - defined to contain a URL, then on getting, the IDL attribute must parse the - value of the content attribute relative to the element and return the resulting - absolute URL if that was successful, or the empty string otherwise; and on setting, must - set the content attribute to the specified literal value. If the content attribute is absent, - the IDL attribute must return the default value, if the content attribute has one, or else the - empty string. - - If a reflecting IDL attribute is a DOMString attribute whose content attribute is - defined to contain one or more URLs, then on getting, the IDL attribute must split the - content attribute on spaces and return the concatenation of parsing each token URL - to an absolute URL relative to the element, with a single U+0020 SPACE character between - each URL, ignoring any tokens that did not resolve successfully. If the content attribute is - absent, the IDL attribute must return the default value, if the content attribute has one, or - else the empty string. On setting, the IDL attribute must set the content attribute to the - specified literal value. + If a reflecting IDL attribute is a USVString attribute whose content attribute + is defined to contain a URLs, then on getting, if the content attribute is + absent, the IDL attribute must return the empty string. Otherwise, the IDL attribute must + parse the value of the content attribute relative to the element's node document and + if that is successful, return the resulting URL string. If parsing fails, then the value of + the content attribute must be returned instead, converted to a + USVString. On setting, the content attribute must be set to the specified new + value. If a reflecting IDL attribute is a DOMString attribute whose content attribute is an enumerated attribute, and the IDL attribute is limited to only known values, @@ -3708,9 +3756,9 @@ attribute must be removed, and otherwise, the content attribute must be set to the specified new value. - If a reflecting IDL attribute is a DOMString attribute but doesn't fall into any - of the above categories, then the getting and setting must be done in a transparent, - case-preserving manner. + If a reflecting IDL attribute is a DOMString or USVString + attribute but doesn't fall into any of the above categories, then the getting and setting must be + done in a transparent, case-preserving manner. If a reflecting IDL attribute is a boolean attribute, then on getting the IDL attribute must return true if the content attribute is set, and false if it is absent. On @@ -3805,10 +3853,10 @@ the IDL attribute must return null. 4. Otherwise, it must return candidate. - On setting, if the given element has an id attribute, and has the same - home subtree as the element of the attribute being set, and the given element is the - first element in that home subtree whose ID is the value of that id - attribute, then the content attribute must be set to the value of that id + On setting, if the given element has an <{global/id}> attribute, and has the same + tree as the element of the attribute being set, and the given element is the + first element in that tree whose ID is the value of that <{global/id}> + attribute, then the content attribute must be set to the value of that <{global/id}> attribute. Otherwise, the content attribute must be set to the empty string.

      Collections

      @@ -3826,7 +3874,7 @@ function (legacycaller).

      - All HTMLAllCollection objects are rooted at a {{Document}} and have a filter that + All {{HTMLAllCollection}} objects are rooted at a {{Document}} and have a filter that matches all elements, so the elements represented by the collection of an {{HTMLAllCollection}} object consist of all the descendant elements of the root {{Document}}.

      @@ -4121,8 +4169,8 @@ The object's supported property indices are as defined for HTMLCollection objects. - On getting, the length attribute must return the number of nodes - represented by the collection. + On getting, the length attribute + must return the number of nodes represented by the collection. On setting, the behavior depends on whether the new value is equal to, greater than, or less than the number of nodes represented by the collection at that time. If the number is the same, @@ -4136,8 +4184,8 @@ the two numbers (old value minus new value).

      - Setting length never removes or adds any <{optgroup}> elements, and never - adds new children to existing <{optgroup}> elements (though it can remove children from + Setting {{HTMLOptionsCollection/length}} never removes or adds any <{optgroup}> elements, and + never adds new children to existing <{optgroup}> elements (though it can remove children from them).

      @@ -4182,11 +4230,10 @@ 5. If reference is not null, let parent be the parent node of reference. Otherwise, let parent be the <{select}> element on which the HTMLOptionsCollection is rooted. - 6. 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. + 6. Pre-insert element into parent node before reference. - The remove(index) method must act according to the following - algorithm: + The remove(index) method + must act according to the following algorithm: 1. If the number of nodes represented by the collection is zero, abort these steps. 2. If index is not a number greater than or equal to 0 and less than the number of @@ -4194,18 +4241,18 @@ 3. Let element be the indexth element in the collection. 4. Remove element from its parent node. - The selectedIndex IDL attribute must act like the identically named - attribute on the <{select}> element on which the HTMLOptionsCollection is - rooted + The selectedIndex IDL attribute must + act like the identically named attribute on the <{select}> element on which the + {{HTMLOptionsCollection}} is rooted -

      The DOMStringMap interface

      +

      The {{DOMStringMap}} interface

      - The DOMStringMap interface represents a set of name-value pairs. It exposes these - using the scripting language's native mechanisms for property access. + The DOMStringMap interface represents a set of name-value pairs. It exposes + these using the scripting language's native mechanisms for property access. - When a DOMStringMap object is instantiated, it is associated with three algorithms, - one for getting the list of name-value pairs, one for setting names to certain values, and one for - deleting names. + When a {{DOMStringMap}} object is instantiated, it is associated with three algorithms, + one for getting the list of name-value pairs, one for + setting names to certain values, and one for deleting names.
           [OverrideBuiltins]
      @@ -4216,66 +4263,60 @@
           };
         
      - The supported property names on a DOMStringMap object at any instant are the - names of each pair returned from the algorithm for getting the list of name-value pairs at that - instant, in the order returned. + The supported property names on a {{DOMStringMap}} object at any + instant are the names of each pair returned from the algorithm for + getting the list of name-value pairs at that instant, in the order returned. To determine the value of a named property name in a {{DOMStringMap}}, the user agent must return the value component of the name-value pair - whose name component is name in the list returned by the algorithm for getting the list - of name-value pairs. + whose name component is name in the list returned by the algorithm for + getting the list of name-value pairs. - To set the value of a named property name to value value, the - algorithm for setting names to certain values must be run, passing name as the name and - value as the value. + To set the value of a named property name to value + value, the algorithm for setting names to certain values must be run, passing + name as the name and value as the value. - To delete an existing named property name, the algorithm for deleting names - must be run, passing name as the name. + To delete an existing named property name, the algorithm for + deleting names must be run, passing name as the name. -

      - The DOMStringMap interface definition here is only intended for JavaScript - environments. Other language bindings will need to define how DOMStringMap is to be - implemented for those languages. -

      - -
      - The dataset attribute on elements exposes the data-* attributes on the - element. - - Given the following fragment and elements with similar constructions: - -
      <img class="tower" id="tower5" data-x="12" data-y="5" data-ai="robotarget" data-hp="46" data-ability="flames" src="towers/rocket.png" alt="Rocket Tower">
      - - ...one could imagine a function splashDamage() that takes some arguments, the first - of which is the element to process: - -
      -    function splashDamage(node, x, y, damage) {
      -      if (node.classList.contains('tower') && // checking the 'class' attribute
      -          node.dataset.x == x && // reading the 'data-x' attribute
      -          node.dataset.y == y) { // reading the 'data-y' attribute
      -        var hp = parseInt(node.dataset.hp); // reading the 'data-hp' attribute
      -        hp = hp - damage;
      -        if (hp < 0) {
      -          hp = 0;
      -          node.dataset.ai = 'dead'; // setting the 'data-ai' attribute
      -          delete node.dataset.ability; // removing the 'data-ability' attribute
      +  
      + The dataset attribute on elements exposes the data-* attributes on the + element. + + Given the following fragment and elements with similar constructions: + +
      <img class="tower" id="tower5" data-x="12" data-y="5" data-ai="robotarget" data-hp="46" data-ability="flames" src="towers/rocket.png" alt="Rocket Tower">
      + + ...one could imagine a function splashDamage() that takes some arguments, the first + of which is the element to process: + +
      +      function splashDamage(node, x, y, damage) {
      +        if (node.classList.contains('tower') && // checking the 'class' attribute
      +            node.dataset.x == x && // reading the 'data-x' attribute
      +            node.dataset.y == y) { // reading the 'data-y' attribute
      +          var hp = parseInt(node.dataset.hp); // reading the 'data-hp' attribute
      +          hp = hp - damage;
      +          if (hp < 0) {
      +            hp = 0;
      +            node.dataset.ai = 'dead'; // setting the 'data-ai' attribute
      +            delete node.dataset.ability; // removing the 'data-ability' attribute
      +          }
      +          node.dataset.hp = hp; // setting the 'data-hp' attribute
               }
      -        node.dataset.hp = hp; // setting the 'data-hp' attribute
             }
      -    }
      -  
      -
      +
      +
      -

      The DOMElementMap interface

      +

      The {{DOMElementMap}} interface

      - The DOMElementMap interface represents a set of name-element mappings. It exposes - these using the scripting language's native mechanisms for property access. + The DOMElementMap interface represents a set of name-element + mappings. It exposes these using the scripting language's native mechanisms for property access. - When a DOMElementMap object is instantiated, it is associated with three algorithms, - one for getting the list of name-element mappings, one for mapping a name to a certain element, - and one for deleting mappings by name. + When a {{DOMElementMap}} object is instantiated, it is associated with three algorithms, one for + getting the list of name-element mappings, one for mapping a name to a certain element, and one + for deleting mappings by name.
           interface DOMElementMap {
      @@ -4285,12 +4326,12 @@
           };
         
      - The supported property names on a DOMElementMap object at any instant are the - names for each mapping returned from the algorithm for getting the list of name-element mappings - at that instant, in the order returned. + The supported property names on a {{DOMElementMap}} object at any instant are + the names for each mapping returned from the algorithm for getting the list of name-element + mappings at that instant, in the order returned. To determine the value of a named property name in a - DOMElementMap, the user agent must return the element component of the name-element + {{DOMElementMap}}, the user agent must return the element component of the name-element mapping whose name component is name in the list returned by the algorithm for getting the list of name-element mappings. @@ -4302,9 +4343,9 @@ mappings must be run, passing name as the name component of the mapping to be deleted.

      - The DOMElementMap interface definition here is only intended for JavaScript - environments. Other language bindings will need to define how DOMElementMap is to - be implemented for those languages. + The {{DOMElementMap}} interface definition here is only intended for JavaScript environments. + Other language bindings will need to define how {{DOMElementMap}} is to be implemented for those + languages.

      Garbage collection

      @@ -4313,7 +4354,7 @@ object to that object.
      - For example, the window.document attribute on the {{Window}} object means that there is a strong reference + For example, the {{Window/document|window.document}} attribute on the {{Window}} object means that there is a strong reference from a {{Window}} object to its {{Document}} object. Similarly, there is always a strong reference from a {{Document}} to any descendant nodes, and from any node to its owner node document. diff --git a/sections/introduction.include b/sections/introduction.include index 200efc8c8e..373e6f85d6 100644 --- a/sections/introduction.include +++ b/sections/introduction.include @@ -229,7 +229,7 @@ It is compatible with most legacy Web browsers. If a document is transmitted with the text/html MIME type, then it will be processed as an HTML document by Web browsers. This specification defines the latest version of the HTML syntax, - known as "HTML [LEVEL]". + known simply as "HTML". The second concrete syntax is the XHTML syntax, which is an application of XML. When a document is transmitted with an XML MIME type, such as @@ -237,8 +237,8 @@ XML document by Web browsers, to be parsed by an XML processor. Authors are reminded that the processing for XML and HTML differs; in particular, even minor syntax errors will prevent a document labeled as XML from being rendered fully, whereas they would be ignored in the HTML - syntax. This specification defines the latest version of the XHTML syntax, known as "XHTML - [LEVEL]". + syntax. This specification defines the latest version of the XHTML syntax, known simply as + "XHTML". The DOM, the HTML syntax, and the XHTML syntax cannot all represent the same content. For example, namespaces cannot be represented using the HTML syntax, but they are supported in the @@ -559,8 +559,8 @@
    23. - The root element of this tree is the <{html}> element, which is the element always found at - the root of HTML documents. It contains two elements, <{head}> and <{body}>, as well as a + The {{document}} element of this tree is the <{html}> element, which is the element always found + in that position in HTML documents. It contains two elements, <{head}> and <{body}>, as well as a {{Text!!interface}} node between them. There are many more {{Text!!interface}} nodes in the DOM tree than one would initially expect, @@ -598,7 +598,7 @@ var a = document.links[0]; // obtain the first link in the document a.href = 'sample.html'; // change the destination URL of the link a.protocol = 'https'; // change just the scheme part of the URL - a.setAttribute('href', 'https://example.com/'); // change the content attribute directly + a.setAttribute('href', 'http://example.com/'); // change the content attribute directly Since DOM trees are used as the way to represent HTML documents when they are processed and @@ -682,7 +682,7 @@ If the message was just displayed to the user without escaping, a hostile attacker could then craft a URL that contained a script element: -
      https://example.com/message.cgi?say=%3Cscript%3Ealert%28%27Oh%20no%21%27%29%3C/script%3E
      +
      http://example.com/message.cgi?say=%3Cscript%3Ealert%28%27Oh%20no%21%27%29%3C/script%3E
      If the attacker then convinced a victim user to visit this page, a script of the attacker's choosing would run on the page. Such a script could do any number of hostile @@ -696,11 +696,10 @@ There are many constructs that can be used to try to trick a site into executing code. Here are some that authors are encouraged to consider when writing safelist filters: - * When allowing harmless-seeming elements like <{img}>, exercise the principle of - least-privilege and limit the element's attributes to only those that are needed (e.g., via - a safelist). If one allowed all attributes then an attacker could, for instance, use the - onload attribute to run arbitrary - script. + * When allowing harmless-seeming elements like <{img}>, it is important to safelist any + provided attributes as well. If one allowed all attributes then an attacker could, for + instance, use the onload attribute + to run arbitrary script. * When allowing URLs to be provided (e.g., for links), the scheme of each URL also needs to be explicitly safelisted, as there are many schemes that can be abused. The most prominent example is "javascript:", but user agents can implement (and indeed, have @@ -732,7 +731,7 @@ To avoid this, sites that do not expect to be used in frames are encouraged to only enable their interface if they detect that they are not in a frame (e.g., by comparing the - {{Window}} object to the value of the {{Window/top}} attribute). + {{window}} object to the value of the {{Window/top}} attribute).

      Common pitfalls to avoid when using the scripting APIs @@ -744,10 +743,9 @@ the script uninterrupted before doing anything else, such as firing further events or continuing to parse the document. - On the other hand, parsing of HTML files happens in parallel and incrementally, meaning - that the parser can pause at any point to let scripts run. This is generally a good thing, but it - does mean that authors need to be careful to avoid hooking event handlers after the events could - have possibly fired. + On the other hand, parsing of HTML files happens incrementally, meaning that the parser can pause + at any point to let scripts run. This is generally a good thing, but it does mean that authors + need to be careful to avoid hooking event handlers after the events could have possibly fired. There are two techniques for doing this reliably: use event handler content attributes, or create the element and add the event handlers in the same script. The latter is safe because, as @@ -827,8 +825,8 @@ :: While it is possible to use presentational markup in a way that provides users of assistive technologies (ATs) with an acceptable experience (e.g., using ARIA), doing so is significantly more difficult than doing so when using semantically-appropriate markup. Furthermore, - presentational markup does not guarantee accessibility for users of non-AT, non-graphical user - agents (such as text-mode browsers). + even using such techniques doesn't help make pages accessible for non-AT, non-graphical users, + such as users of text-mode browsers. Using media-independent markup, on the other hand, provides an easy way for documents to be authored in such a way that they are "accessible" for more users (e.g., users of text @@ -852,7 +850,7 @@ production environments, but it can be useful for rapid prototyping (where its rules can be directly moved into a separate style sheet later) and for providing specific styles in unusual cases where a separate style sheet would be inconvenient. Similarly, the <{style}> element can - be useful for grouping or for page-specific styles, but in general an external style sheet + be useful in syndication or for page-specific styles, but in general an external style sheet is likely to be more convenient when the styles apply to multiple pages. It is also worth noting that some elements that were previously presentational have been @@ -886,10 +884,11 @@ user agents, any syntax resulting in such behavior is considered invalid. : Errors that can result in infoset coercion :: When a user agent based on XML is connected to an HTML parser, it is possible that certain - invariants that XML enforces, such as comments never containing two consecutive hyphens, will - be violated by an HTML file. Handling this can require that the parser coerce the HTML DOM - into an XML-compatible infoset. Most syntax constructs that require such handling are - considered invalid. + invariants that XML enforces, such as element or attribute names never contain multiple + colons, will be violated by an HTML file. Handling this can require that the parser coerce the + HTML DOM into an XML-compatible infoset. Most syntax constructs that require such handling are + considered invalid. (Comments containing two consecutive hyphens, or ending with a hyphen, are + exceptions that are allowed in the HTML syntax.) : Errors that result in disproportionately poor performance :: Certain syntax constructs can result in disproportionately poor performance. To discourage the use of such constructs, they are typically made non-conforming. @@ -1065,8 +1064,8 @@ harmless features are disallowed.

      - For example, attributes in end tags are currently invalid and ignored. A future change to - the language may make use of this syntax feature and can do so without conflicting with + For example, attributes in end tags are ignored currently, but they are invalid, in case a + future change to the language makes use of that syntax feature without conflicting with already-deployed (and valid!) content.

      @@ -1120,11 +1119,11 @@ confusing combinations are disallowed.

      - For example, <{div}> elements are rendered as block boxes, and <{span}> elements as - inline boxes. Putting a block box in an inline box is unnecessarily confusing; - since either nesting just <{div}> elements, or nesting just <{span}> elements, or nesting - <{span}> elements inside <{div}> elements all serve the same purpose as nesting a <{div}> - element in a <{span}> element, but only the latter involves a block box in an + For example, <{div}> elements are rendered as block boxes, and <{span}> elements as + inline boxes. Putting a block box in an inline box is unnecessarily confusing; + since either nesting just <{div}> elements, or nesting just <{span}> elements, or nesting + <{span}> elements inside <{div}> elements all serve the same purpose as nesting a <{div}> + element in a <{span}> element, but only the latter involves a block box in an inline box, the latter combination is disallowed.

      diff --git a/sections/obsolete.include b/sections/obsolete.include index 0ca18d1380..53194b5a7d 100644 --- a/sections/obsolete.include +++ b/sections/obsolete.include @@ -27,9 +27,9 @@ Authors should not specify the <{a/name}> attribute on <{a}> elements. If the attribute is present, its value must not be the empty string and must neither be equal to the - value of any of the IDs in the element's home subtree other than the element's own + value of any of the IDs in the element's tree other than the element's own <{global/id}>, if any, nor be equal to the value of any of the other <{a/name}> attributes on - <{a}> elements in the element's home subtree. If this attribute is present and the + <{a}> elements in the element's tree. If this attribute is present and the element has an <{global/id}>, then the attribute's value must be equal to the element's <{global/id}>. In earlier versions of the language, this attribute was intended as a way to specify possible targets for fragments in URLs. The <{global/id}> attribute should be used instead. @@ -754,19 +754,7 @@
      Otherwise
      -
      - 1. If the value of the <{frame/src}> attribute is the empty string, let url be - the string "about:blank". - - Otherwise, parse the value of the <{frame/src}> attribute, relative to the - <{frame}> element's node document. - - If that is not successful, then let url be the string - "about:blank". Otherwise, let url be the - resulting URL record. - 2. Navigate the element's child browsing contextto url. - -
      +
      Run the otherwise steps for iframe or frame elements.
      Furthermore, if the active document of the element's child browsing context before diff --git a/sections/rendering.include b/sections/rendering.include index 8360531e01..c0dbf2dbed 100644 --- a/sections/rendering.include +++ b/sections/rendering.include @@ -1466,10 +1466,10 @@ path: includes/cldr.include
           summary {
             display: list-item;
      -      list-style: disclosure-closed;
      +      list-style: disclosure-closed inside;
           }
           details[open] > summary {
      -      list-style: disclosure-open;
      +      list-style-type: disclosure-open;
           }
         
      diff --git a/sections/semantics-common-idioms.include b/sections/semantics-common-idioms.include index eac1dcfadd..9f881d6bdc 100644 --- a/sections/semantics-common-idioms.include +++ b/sections/semantics-common-idioms.include @@ -338,7 +338,7 @@ closing for lunch</span>. For example, the following CSS places a dashed line below elements that have a title attribute.
      -[title] { border-bottom: thin dashed; }
      +      [title] { border-bottom: thin dashed; }
           
      diff --git a/sections/semantics-document-metadata.include b/sections/semantics-document-metadata.include index f45028001a..f8254f47e2 100644 --- a/sections/semantics-document-metadata.include +++ b/sections/semantics-document-metadata.include @@ -893,7 +893,7 @@ 1. Let languages be the list of languages. 2. Let default language be the language of the {{Document}}'s - root element, if any, and if that language is not unknown. + document element, if any, and if that language is not unknown. 3. If there is a default language, and if it is not the same language as any of the languages in languages, append it to languages. 4. Let winning language be the first language in languages for which diff --git a/sections/semantics-embedded-content.include b/sections/semantics-embedded-content.include index e8cea6f0a9..7591ab5d34 100644 --- a/sections/semantics-embedded-content.include +++ b/sections/semantics-embedded-content.include @@ -704,8 +704,8 @@

      The requirements above imply that images can be static bitmaps (e.g., PNGs, GIFs, JPEGs), - single-page vector documents (single-page PDFs, XML files with an SVG root element), animated - bitmaps (APNGs, animated GIFs), animated vector graphics (XML files with an SVG root element + single-page vector documents (single-page PDFs, XML files with an SVG document element), animated + bitmaps (APNGs, animated GIFs), animated vector graphics (XML files with an SVG document element that use declarative SMIL animation), and so forth. However, these definitions preclude SVG files with script, multipage PDF files, interactive MNG files, HTML documents, plain text documents, and so forth. [[!PNG]] [[!GIF]] [[!JPEG]] [[!PDF]] [[!XML]] [[!APNG]] [[!SVG]] [[!MNG]] @@ -1344,12 +1344,13 @@ This allows servers to return images with error responses, and have them displayed.

      - The user agent should apply the image sniffing rules to determine the type of the image, with the image's associated Content-Type headers giving the official - type. If these rules are not applied, then the type of the image must be the type given by - the image's associated Content-Type headers. + The user agent should apply the image sniffing rules to determine the type of the image, + with the image's associated Content-Type headers giving the official type. If + these rules are not applied, then the type of the image must be the type given by the image's + associated Content-Type headers. - User agents must not support non-image resources with the <{img}> element (e.g., XML - files whose root element is an HTML element). User agents must not run executable code (e.g., + User agents must not support non-image resources with the <{img}> element (e.g., XML files whose + document element is an HTML element). User agents must not run executable code (e.g., scripts) embedded in the image resource. User agents must only display the first page of a multipage resource (e.g., a PDF file). User agents must not allow the resource to act in an interactive fashion, but should honor any animation in the resource. @@ -3491,11 +3492,11 @@ My <img src="heart.png" alt="heart"> breaks.
    24. Any number of comments and space characters.
    25. -
    26. Optionally, a DOCTYPE. +
    27. Optionally, a DOCTYPE.
    28. -
    29. Any number of comments and space characters.
    30. +
    31. Any number of comments and space characters.
    32. -
    33. The root element, in the form of an <{html}> element.
    34. +
    35. The document element, in the form of an <{html}> element.
    36. Any number of comments and space characters.
    37. @@ -3622,71 +3623,50 @@ My <img src="heart.png" alt="heart"> breaks. Queue a task to run the iframe load event steps. - The task source for this task is the - DOM manipulation task source. + The task source for this task is the DOM manipulation task source.
      Otherwise
      -
      - -
        - -
      1. - - If the element has no src attribute specified, or its value is the empty string, - let url be the string "about:blank". - - Otherwise, parse the value of the src attribute, relative to the <{iframe}> element. - - If that is not successful, then let url be the string - "about:blank". Otherwise, let url be the resulting URL string. - -
      2. - -
      3. - - If there exists an ancestor browsing context whose active document's - address, ignoring fragment, is equal to url, then abort these - steps. +
        Run the otherwise steps for iframe or frame elements.
        -
      4. + -
      5. + The otherwise steps for iframe or frame elements are as follows: - Navigate the element's child browsing context - to url. + 1: If the element has no src attribute specified, or its + value is the empty string, let url be the URL "about:blank". -
      6. + Otherwise, parse the value of the src attribute, relative to the element's + node document. -
      + If that is not successful, then let url be the URL + "about:blank". Otherwise, let url be the resulting URL record. + 2. If there exists an ancestor browsing context whose active document's + address, ignoring fragments, is equal to url, then abort these steps. + 3. Navigate the element's child browsing context to url. -
      + Furthermore, if the active document of the element's child browsing context before + such a navigation was not completely loaded at the time of the new + navigation, then the navigation must be completed with replacement enabled. - - - Furthermore, if the active document of the element's child browsing - context before such a navigation was not completely - loaded at the time of the new navigation, then the navigation must be completed with replacement enabled. - - Similarly, if the child browsing context's session history contained - only one {{Document}} when the process the iframe attributes - algorithm was invoked, and that was the about:blank {{Document}} created - when the child browsing context was created, then any navigation required of the user agent in that algorithm must be completed - with replacement enabled. + Similarly, if the child browsing context's session history contained only one + {{Document}} when the process the iframe attributes algorithm was invoked, and + that was the about:blank {{Document}} created when the child browsing context + was created, then any navigation required of the user agent in that algorithm must be + completed with replacement enabled. - When a {{Document}} in an iframe is marked as completely - loaded, the user agent must run the iframe load event steps in parallel. + When a {{Document}} in an iframe is marked as completely loaded, the user + agent must run the iframe load event steps in parallel.

      - A load event is also fired at the - <{iframe}> element when it is created if no other data is loaded in it. + A load event is also fired at the <{iframe}> element when it is created if no other + data is loaded in it.

      - Each {{Document}} has an iframe load in progress flag and a mute - iframe load flag. When a {{Document}} is created, these flags must be unset for - that {{Document}}. + Each {{Document}} has an iframe load in progress flag and a mute iframe load + flag. When a {{Document}} is created, these flags must be unset for that {{Document}}. The iframe load event steps are as follows: @@ -6326,8 +6306,7 @@ zero or more <{track}> elements, then
    38. If a fetching process is in progress for the media element, the user agent should stop it.
    39. If the media element's assigned media provider object - is a MediaSource object, then detach - it. + is a MediaSource object, then detach it.
    40. Forget the media element's media-resource-specific tracks.
    41. @@ -10784,19 +10763,18 @@ red:89 manners more suitable to the user (e.g., fullscreen video or in an independent resizable window). Other controls may also be made available. - A user agent may provide controls to affect playback + Even when the attribute is absent, however, user agents may provide controls to affect playback of the media resource (e.g., play, pause, seeking, track selection, and volume controls), but such features should not interfere with the page's normal rendering. For example, such features - could be exposed in the media element's context menu, platform - media keys, or a remote control. The user agent may implement this simply by exposing a user - interface to the user as described above (as if the <{mediaelements/controls}> attribute - was present). + could be exposed in the media element's context menu, platform media keys, or a remote + control. The user agent may implement this simply by exposing a user interface to the user + as described above (as if the <{mediaelements/controls}> attribute was present). If the user agent exposes a user interface to the user by displaying controls over the media element, then the user agent should suppress any user interaction events while the user agent is interacting with this - interface. (For example, if the user clicks on a video's playback control, mousedown events and so forth would not simultaneously be fired at - elements on the page.) + interface. (For example, if the user clicks on a video's playback control, mousedown + events and so forth would not simultaneously be fired at elements on the page.) Where possible (specifically, for starting, stopping, pausing, and unpausing playback, for seeking, for changing the rate of playback, for fast-forwarding or rewinding, for listing, @@ -10804,9 +10782,9 @@ red:89 interface features exposed by the user agent must be implemented in terms of the DOM API described above, so that, e.g., all the same events fire. - For the purposes of listing chapters in the media resource, only text tracks in the media element's list of text tracks - that are showing and whose text track kind is - chapters should be used. Such tracks must be + For the purposes of listing chapters in the media resource, only text tracks in the + media element's list of text tracks that are showing and + whose text track kind is chapters should be used. Such tracks must be interpreted according to the rules for constructing the chapter tree from a text track. When seeking in response to a user manipulating a chapter selection interface, user agents should not use the approximate-for-speed flag. @@ -11023,37 +11001,28 @@ red:89 }; dictionary TrackEventInit : EventInit { - (VideoTrack or AudioTrack or TextTrack)? track; + (VideoTrack or AudioTrack or TextTrack)? track = null; };
      -
      event . track
      -
      - - Returns the track object ({{TextTrack}}, AudioTrack, or - VideoTrack) to which the event relates. - + Returns the track object ({{TextTrack}}, {{AudioTrack}}, or {{VideoTrack}}) to which the event + relates.
      -
      -
      - - The track attribute must return the value - it was initialized to. When the object is created, this attribute must be initialized to null. It + The track attribute must return the value it + was initialized to. When the object is created, this attribute must be initialized to null. It represents the context information for the event. -
      -

      Event summary
      This section is non-normative. - The following events fire on media elements as part of the - processing model described above: + The following events fire on media elements as part of the processing model described + above: @@ -12167,45 +12136,30 @@ red:89

      MathML

      - The <{math}> element from the MathML namespace - falls into the embedded content, phrasing content, flow - content, and palpable content categories for the purposes of the content - models in this specification. - - This specification refers to several specific MathML elements, in particular: - <{annotation-xml}>, - <{merror}>, - <{mi}>, - <{mn}>, - <{mo}>, - <{ms}>, and - <{mtext}>. - - When the MathML <{annotation-xml}> element contains - elements from the HTML namespace, such elements must all be flow - content. [[!MATHML]] - - When the MathML token elements (<{mi}>, <{mo}>, <{mn}>, <{ms}>, - and <{mtext}>) are descendants of HTML elements, they may contain - phrasing content elements from the HTML namespace. [[!MATHML]] + The MathML math element falls into the embedded content, + phrasing content, flow content, and palpable content categories for the + purposes of the content models in this specification. -
      + When the MathML annotation-xml element contains elements from the + HTML namespace, such elements must all be flow content. + + When the MathML token elements (MathML mi, MathML mo, MathML mn, MathML ms, + and MathML mtext) are descendants of HTML elements, they may contain + phrasing content elements from the HTML namespace. [[!MATHML]] User agents must handle text other than inter-element whitespace found in MathML elements whose content models do not allow straight text by pretending for the purposes of MathML - content models, layout, and rendering that the text is actually wrapped in an <{mtext}> element in the MathML namespace. (Such text is not, - however, conforming.) + content models, layout, and rendering that the text is actually wrapped in an MathML mtext element in + the MathML namespace. (Such text is not, however, conforming.) User agents must act as if any MathML element whose contents does not match the element's - content model was replaced, for the purposes of MathML layout and rendering, by an <{merror}> element in the MathML namespace containing some - appropriate error message. + content model was replaced, for the purposes of MathML layout and rendering, by an MathML merror + element containing some appropriate error message. To enable authors to use MathML tools that only accept MathML in its XML form, interactive HTML user agents are encouraged to provide a way to export any MathML fragment as an XML namespace-well-formed XML fragment. -
      - The semantics of MathML elements are defined by the MathML specification and other applicable specifications. [[!MATHML]] @@ -12247,64 +12201,23 @@ red:89

      SVG

      - The svg element from the SVG namespace falls into the - embedded content, phrasing content, flow content, - and palpable content categories for the purposes of the content models in this - specification. - -
      + The SVG svg element falls into the embedded content, + phrasing content, flow content, and palpable content categories for the + purposes of the content models in this specification. To enable authors to use SVG tools that only accept SVG in its XML form, interactive HTML user agents are encouraged to provide a way to export any SVG fragment as an XML namespace-well-formed XML fragment. -
      - - When the SVG <{foreignObject}> element contains elements from the HTML namespace, such + When the SVG foreignObject element contains elements from the HTML namespace, such elements must all be flow content. [[!SVG]] - The content model for title elements in the SVG namespace - inside HTML documents is phrasing content. (This further constrains the - requirements given in the SVG specification.) + The content model for SVG title elements inside HTML documents is + phrasing content. (This further constrains the requirements given in the SVG specification.) The semantics of SVG elements are defined by the SVG specification and other applicable specifications. [[!SVG]] -

      User agent requirements: SVG as implemented today follows neither SVG 1.1 nor - SVG Tiny 1.2 precisely, instead implementing subsets of each. Although it is hoped that the - in-progress SVG 2 specification is a more realistic target for implementations, until that - specification is ready, user agents must implement the SVG 1.1 specification with the following - willful violations and additions. [[!SVG11]] [[!SVGTiny12]] [[!SVG2]]

      - -

      The following features from SVG 1.1 must not be implemented:

      - -
        -
      • The tref element
      • -
      • The cursor element (use CSS's cursor property - instead)
      • -
      • The font-defining elements: font, glyph, - missing-glyph, hkern, - vkern, font-face, - font-face-src, font-face-uri, - font-face-format, and font-face-name (use - CSS's @font-face instead)
      • -
      • The externalResourcesRequired attribute
      • -
      • The enable-background property
      • -
      • The contentScriptType and contentStyleType - attributes (use the type attribute on the script - and style elements instead)
      • -
      - -

      The following features from SVG Tiny 1.2 must be implemented:

      - -
        -
      • The non-scaling-stroke value for the - vector-effect property
      • -
      • The class attribute is allowed on all SVG elements
      • -
      • The tabindex attribute is allowed on visible SVG elements
      • -
      • The ARIA accessibility attributes are allowed on all SVG elements
      • -
      -

      Dimension attributes

      Author requirements: The diff --git a/sections/semantics-forms.include b/sections/semantics-forms.include index adf0868532..a29b748fa4 100644 --- a/sections/semantics-forms.include +++ b/sections/semantics-forms.include @@ -980,13 +980,14 @@
      The elements IDL attribute must return an - {{HTMLFormControlsCollection}} rooted at the <{form}> element's home - subtree's root element, whose filter matches listed elements whose form owner is the - <{form}> element, with the exception of <{input}> elements whose <{input/type}> attribute is in the image button state, which must, for historical reasons, be + {{HTMLFormControlsCollection}} rooted at the <{form}> element, whose filter matches + listed elements whose form owner is the <{form}> element, with the exception of + <{input}> elements whose <{input/type}> attribute is in the + image button state, which must, for historical reasons, be excluded from this particular collection. - The length IDL attribute must return the number - of nodes represented by the elements collection. + The length IDL attribute must return the + number of nodes represented by the elements collection. The supported property indices at any instant are the indices supported by the object returned by the elements attribute at that @@ -1462,9 +1463,9 @@ part of the form.

      [SameObject] readonly attribute NodeList labels; void select(); - attribute unsigned long selectionStart; - attribute unsigned long selectionEnd; - attribute DOMString selectionDirection; + attribute unsigned long? selectionStart; + attribute unsigned long? selectionEnd; + attribute DOMString? selectionDirection; void setRangeText(DOMString replacement); void setRangeText(DOMString replacement, unsigned long start, unsigned long end, optional SelectionMode selectionMode = "preserve"); void setSelectionRange(unsigned long start, unsigned long end, optional DOMString direction); @@ -4954,15 +4955,17 @@ input { height: 75px; width: 49px; background: #D5CCBB; color: black; }
      - The value sanitization algorithm is as follows: If the value of the element is a valid simple color, then - set it to the value of the element converted to ASCII - lowercase; otherwise, set it to the string "#000000". + The value sanitization algorithm is as follows: If the + value of the element is a valid simple color, then set it to the + value of the element converted to ASCII lowercase; otherwise, set it to + the string "#000000".
      - The following common <{input}> element content attributes and IDL attributes apply to the element: + The following common <{input}> element content attributes and IDL attributes apply to the + element: <{input/autocomplete}> and <{input/list}> content attributes; {{HTMLInputElement/list}} and @@ -5173,8 +5176,7 @@ input { height: 75px; width: 49px; background: #D5CCBB; color: black; }
    42. Either a and b have the same form owner, or they both have no form owner.
    43. -
    44. Both a and b are in the same home - subtree.
    45. +
    46. Both a and b are in the same tree.
    47. They both have a <{input/name}> attribute, their <{input/name}> attributes are not empty, and the value of a's <{input/name}> attribute is a compatibility caseless match for the value of b's <{input/name}> attribute.
    48. @@ -7476,14 +7478,14 @@ You cannot submit this form when the field is incorrect. If the element's <{input/type}> attribute is in the Menu state, the menu attribute must be specified to give the element's menu. The value must be the ID of a <{menu}> element in - the same home subtree whose <{input/type}> attribute is in + the same tree whose <{input/type}> attribute is in the popup menu state. The attribute must not be specified if the element's <{input/type}> attribute is not in the Menu state.
      A <{button}> element's designated pop-up menu is the first element in the - <{button}>'s home subtree whose ID is that given by the <{button}> + <{button}>'s tree whose ID is that given by the <{button}> element's menu attribute, if there is such an element and its <{input/type}> attribute is in the popup menu state; otherwise, the element has no designated pop-up menu. @@ -8505,9 +8507,9 @@ You cannot submit this form when the field is incorrect. [SameObject] readonly attribute NodeList labels; void select(); - attribute unsigned long selectionStart; - attribute unsigned long selectionEnd; - attribute DOMString selectionDirection; + attribute unsigned long? selectionStart; + attribute unsigned long? selectionEnd; + attribute DOMString? selectionDirection; void setRangeText(DOMString replacement); void setRangeText(DOMString replacement, unsigned long start, unsigned long end, optional SelectionMode selectionMode = "preserve"); void setSelectionRange(unsigned long start, unsigned long end, optional DOMString direction); @@ -8520,8 +8522,6 @@ You cannot submit this form when the field is incorrect. control for the element's raw value. The contents of the control represent the control's default value. -
      - The raw value of a <{textarea}> control must be initially the empty string. @@ -8529,8 +8529,6 @@ You cannot submit this form when the field is incorrect. This element has rendering requirements involving the bidirectional algorithm.

      -
      - The readonly attribute is a boolean attribute used to control whether the text can be edited by the user or not. @@ -8539,23 +8537,21 @@ You cannot submit this form when the field is incorrect. In this example, a text field is marked read-only because it represents a read-only file:
      -Filename: <code>/etc/bash.bashrc</code>
      -<textarea name="buffer" readonly>
      -# System-wide .bashrc file for interactive bash(1) shells.
      +      Filename: <code>/etc/bash.bashrc</code>
      +      <textarea name="buffer" readonly>
      +      # System-wide .bashrc file for interactive bash(1) shells.
       
      -# To enable the settings / commands in this file for login shells as well,
      -# this file has to be sourced in /etc/profile.
      +      # To enable the settings / commands in this file for login shells as well,
      +      # this file has to be sourced in /etc/profile.
       
      -# If not running interactively, don't do anything
      -[ -z "$PS1" ] &amp;&amp; return
      +      # If not running interactively, don't do anything
      +      [ -z "$PS1" ] &amp;&amp; return
       
      -...</textarea>
      +      ...</textarea>
           
      -
      - Constraint validation: If the <{textarea/readonly}> attribute is specified on a <{textarea}> element, the element is barred from constraint validation. @@ -8570,18 +8566,18 @@ Filename: <code>/etc/bash.bashrc</code> wait for the user to have not hit a key for 100ms, so as to only fire the event when the user pauses, instead of continuously for each keystroke. - A <{textarea}> element has a dirty value flag, which must be initially set to false, and must be set to true whenever the user - interacts with the control in a way that changes the raw - value. + A <{textarea}> element has a dirty value flag, which must be initially + set to false, and must be set to true whenever the user interacts with the control in a way that + changes the raw value. When the <{textarea}> element's {{Node/textContent}} IDL attribute changes value, if the element's dirty value flag is false, then the element's raw value must be set to the value of the element's {{Node/textContent}} IDL attribute. - The reset algorithm for <{textarea}> - elements is to set the element's raw value to the - value of the element's {{Node/textContent}} IDL attribute. + The reset algorithm for <{textarea}> elements is to set the + dirty value flag back to false, and set the element's raw value to + the value of the element's {{Node/textContent}} IDL attribute. When a <{textarea}> element is popped off the stack of open elements of an HTML parser or XML parser, then the user agent must invoke the @@ -8592,17 +8588,12 @@ Filename: <code>/etc/bash.bashrc</code> writing direction or a right-to-left writing direction. If the user does so, the user agent must then run the following steps: -
        - -
      1. Set the element's <{global/dir}> attribute to "ltr" if the user selected a left-to-right writing direction, and - "rtl" if the user selected a right-to-left writing - direction.
      2. - -
      3. Queue a task to fire a simple event that bubbles named input at the <{textarea}> element.
      4. - -
      - -
      + 1. Set the element's <{global/dir}> attribute to + "ltr" if the user selected a left-to-right + writing direction, and "rtl" if the user + selected a right-to-left writing direction. + 2. Queue a task to fire a simple event that bubbles named input at the + <{textarea}> element. The cols attribute specifies the expected maximum number of characters per line. If the cols @@ -8610,15 +8601,11 @@ Filename: <code>/etc/bash.bashrc</code> zero. If applying the rules for parsing non-negative integers to the attribute's value results in a number greater than zero, then the element's character width is that value; otherwise, it is 20. -
      - The user agent may use the <{textarea}> element's character width as a hint to the user as to how many characters the server prefers per line (e.g., for visual user agents by making the width of the control be that many characters). In visual renderings, the user agent should wrap the user's input in the rendering so that each line is no wider than this number of characters. -
      - The rows attribute specifies the number of lines to show. If the rows attribute is specified, its value must be a valid non-negative integer greater than zero. If @@ -8626,12 +8613,8 @@ Filename: <code>/etc/bash.bashrc</code> in a number greater than zero, then the element's character height is that value; otherwise, it is 2. -
      - Visual user agents should set the height of the control to the number of lines given by character height. -
      - The wrap attribute is an enumerated attribute with two keywords and states: the soft keyword which maps to the Soft state, and the hard keyword which maps to the Hard state. The missing value default is the Soft state. @@ -8646,8 +8629,6 @@ Filename: <code>/etc/bash.bashrc</code> If the element's wrap attribute is in the Hard state, the cols attribute must be specified. -
      - For historical reasons, the element's value is normalized in three different ways for three different purposes. The raw value is the value as it was originally set. It is not normalized. The API @@ -8692,8 +8673,6 @@ Filename: <code>/etc/bash.bashrc</code> -
      - The maxlength attribute is a form control maxlength attribute controlled by the <{textarea}> element's dirty value flag. @@ -8710,13 +8689,9 @@ Filename: <code>/etc/bash.bashrc</code> boolean attribute. When specified, the user will be required to enter a value before submitting the form. -
      - Constraint validation: If the element has its required attribute specified, and the element is mutable, and the element's value is the empty string, then the element is suffering from being missing. -
      - The placeholder attribute represents a short hint (a word or short phrase) intended to aid the user with data entry when the control has no value. A hint could be a sample value or a brief description of the expected @@ -8726,7 +8701,7 @@ Filename: <code>/etc/bash.bashrc</code> should not be used as a replacement for a <{label}>. For a longer hint or other advisory text, place the text next to the control. -

      +

      Use of the placeholder attribute as a replacement for a <{label}> can reduce the accessibility and usability of the control for a range of users including older @@ -8740,16 +8715,12 @@ Filename: <code>/etc/bash.bashrc</code> reduces the size of the hit region available for setting focus on the control.

      -
      - User agents should present this hint to the user when the element's value is the empty string and the control is not focused (e.g., by displaying it inside a blank unfocused control). All U+000D CARRIAGE RETURN U+000A LINE FEED character pairs (CRLF) in the hint, as well as all other U+000D CARRIAGE RETURN (CR) and U+000A LINE FEED (LF) characters in the hint, must be treated as line breaks when rendering the hint. -
      - The <{textarea/name}> attribute represents the element's name. The <{textarea/dirname}> attribute controls how the element's directionality is submitted. The <{textarea/disabled}> attribute is used to make the control non-interactive and to prevent its @@ -8783,73 +8754,71 @@ Filename: <code>/etc/bash.bashrc</code> -
      - The cols, placeholder, - required, rows, and wrap - attributes must reflect the respective content attributes of the same name. The - cols and rows attributes are limited to only non-negative numbers - greater than zero. The cols attribute's default value is 20. The - <{textarea/rows}> attribute's default value is 2. The dirName IDL - attribute must reflect the <{textarea/dirname}> content attribute. The - inputMode IDL attribute must reflect the <{textarea/inputmode}> - content attribute, limited to only known values. The maxLength - IDL attribute must reflect the <{textarea/maxlength}> content attribute, - limited to only non-negative numbers. The minLength IDL attribute - must reflect the <{textarea/minlength}> content attribute, - limited to only non-negative numbers. The readOnly IDL attribute - must reflect the <{textarea/readonly}> content attribute. - - The type IDL attribute must return the value "textarea". - - The defaultValue IDL attribute must act like the element's - {{Node/textContent}} IDL attribute. - - The value attribute must, on getting, return the element's - API value; on setting, it must set the element's raw value to the new value, set - the element's dirty value flag to true, and should then move the text entry cursor - position to the end of the text field, unselecting any selected text and resetting the selection - direction to none. - - The textLength IDL attribute must return the code-unit length of - the element's API value. - - The {{HTMLTextAreaElement/willValidate}}, {{HTMLTextAreaElement/validity}}, and - {{HTMLTextAreaElement/validationMessage}} IDL attributes, - and the {{HTMLTextAreaElement/checkValidity()}}, {{HTMLTextAreaElement/reportValidity()}}, and - {{HTMLTextAreaElement/setCustomValidity()}} methods, are part of the - constraint validation API. - The {{HTMLTextAreaElement/labels}} IDL attribute provides a list of the element's <{label}>s. - The {{HTMLTextAreaElement/select()}}, - {{HTMLTextAreaElement/selectionStart}}, - {{HTMLTextAreaElement/selectionEnd}}, - {{HTMLTextAreaElement/selectionDirection}}, - {{HTMLTextAreaElement/setRangeText()}}, and - {{HTMLTextAreaElement/setSelectionRange()}} methods and IDL - attributes expose the element's text selection. - The {{HTMLTextAreaElement/autofocus}}, - {{HTMLTextAreaElement/disabled}}, - {{HTMLTextAreaElement/form}}, and - {{HTMLTextAreaElement/name}} IDL attributes are part of the element's forms API. -
      + The cols, placeholder, + required, rows, and wrap + attributes must reflect the respective content attributes of the same name. The + cols and rows attributes are limited to only non-negative numbers + greater than zero. The cols attribute's default value is 20. The + <{textarea/rows}> attribute's default value is 2. The dirName IDL + attribute must reflect the <{textarea/dirname}> content attribute. The + inputMode IDL attribute must reflect the <{textarea/inputmode}> + content attribute, limited to only known values. The maxLength + IDL attribute must reflect the <{textarea/maxlength}> content attribute, + limited to only non-negative numbers. The minLength IDL attribute + must reflect the <{textarea/minlength}> content attribute, + limited to only non-negative numbers. The readOnly IDL attribute + must reflect the <{textarea/readonly}> content attribute. + + The type IDL attribute must return the value "textarea". + + The defaultValue IDL attribute must act like the element's + {{Node/textContent}} IDL attribute. + + The value attribute must, on getting, return the element's + API value; on setting, it must set the element's raw value to the new value, set + the element's dirty value flag to true, and should then move the text entry cursor + position to the end of the text field, unselecting any selected text and resetting the selection + direction to none. + + The textLength IDL attribute must return the code-unit length of + the element's API value. + + The {{HTMLTextAreaElement/willValidate}}, {{HTMLTextAreaElement/validity}}, and + {{HTMLTextAreaElement/validationMessage}} IDL attributes, + and the {{HTMLTextAreaElement/checkValidity()}}, {{HTMLTextAreaElement/reportValidity()}}, and + {{HTMLTextAreaElement/setCustomValidity()}} methods, are part of the + constraint validation API. + The {{HTMLTextAreaElement/labels}} IDL attribute provides a list of the element's <{label}>s. + The {{HTMLTextAreaElement/select()}}, + {{HTMLTextAreaElement/selectionStart}}, + {{HTMLTextAreaElement/selectionEnd}}, + {{HTMLTextAreaElement/selectionDirection}}, + {{HTMLTextAreaElement/setRangeText()}}, and + {{HTMLTextAreaElement/setSelectionRange()}} methods and IDL + attributes expose the element's text selection. + The {{HTMLTextAreaElement/autofocus}}, + {{HTMLTextAreaElement/disabled}}, + {{HTMLTextAreaElement/form}}, and + {{HTMLTextAreaElement/name}} IDL attributes are part of the element's forms API.
      Here is an example of a <{textarea}> being used for unrestricted free-form text input in a form:
      -<p>If you have any comments, please let us know: <textarea cols=80 name=comments></textarea></p>
      +      <p>If you have any comments, please let us know: <textarea cols=80 name=comments></textarea></p>
           
      To specify a maximum length for the comments, one can use the maxlength attribute:
      -<p>If you have any short comments, please let us know: <textarea cols=80 name=comments maxlength=200></textarea></p>
      +      <p>If you have any short comments, please let us know: <textarea cols=80 name=comments maxlength=200></textarea></p>
           
      To give a default value, text can be included inside the element:
      -<p>If you have any comments, please let us know: <textarea cols=80 name=comments>You rock!</textarea></p>
      +      <p>If you have any comments, please let us know: <textarea cols=80 name=comments>You rock!</textarea></p>
           
      You can also give a minimum length. Here, a letter needs to be filled out by the user; a @@ -8857,36 +8826,36 @@ Filename: <code>/etc/bash.bashrc</code> the form:
      -<textarea required minlength="500">Dear Madam Speaker,
      +      <textarea required minlength="500">Dear Madam Speaker,
       
      -Regarding your letter dated ...
      +      Regarding your letter dated ...
       
      -...
      +      ...
       
      -Yours Sincerely,
      +      Yours Sincerely,
       
      -...</textarea>
      +      ...</textarea>
           
      A placeholder can be given as well, to suggest the basic form to the user, without providing an explicit template:
      -<textarea placeholder="Dear Francine,
      +      <textarea placeholder="Dear Francine,
       
      -They closed the parks this week, so we won't be able to
      -meet your there. Should we just have dinner?
      +      They closed the parks this week, so we won't be able to
      +      meet your there. Should we just have dinner?
       
      -Love,
      -Daddy"></textarea>
      +      Love,
      +      Daddy"></textarea>
           
      To have the browser submit the directionality of the element along with the value, the dirname attribute can be specified:
      -<p>If you have any comments, please let us know (you may use either English or Hebrew for your comments):
      -<textarea cols=80 name=comments dirname=comments.dir></textarea></p>
      +      <p>If you have any comments, please let us know (you may use either English or Hebrew for your comments):
      +      <textarea cols=80 name=comments dirname=comments.dir></textarea></p>
           
      @@ -9962,7 +9931,7 @@ out of 233 257 824 bytes available</meter></p> controls. When an element changes its parent node resulting in a form-associated element and - its form owner (if any) no longer being in the same home subtree, then + its form owner (if any) no longer being in the same tree, then the user agent must reset the form owner of that form-associated element. @@ -9998,7 +9967,7 @@ out of 233 257 824 bytes available</meter></p>
        -
      1. If the first element in the Document to +
      2. If the first element in the Document to have an ID that is case-sensitively equal to the element's <{formelements/form}> content attribute's value is a <{form}> element, then associate the form-associated element with that <{form}> element.
      3. @@ -10027,13 +9996,12 @@ out of 233 257 824 bytes available</meter></p> </form> <script> document.getElementById('b').innerHTML = - '<table><tr><td><form id="c"><input id="d"></table>' + + '<table><tr><td></form><form id="c"><input id="d"></table>' + '<input id="e">'; </script> ... - The form owner of "d" would be the inner nested form "c", while the form - owner of "e" would be the outer form "a". + The form owner of "d" would be the inner nested form "c", while the form owner of "e" would be the outer form "a". This happens as follows: First, the "e" node gets associated with "c" in the HTML parser. Then, the innerHTML algorithm moves the nodes @@ -10042,7 +10010,7 @@ out of 233 257 824 bytes available</meter></p> associations. This example is a non-conforming document, though, as it is a violation of the content models - to nest <{form}> elements. + to nest <{form}> elements, and there is a parse error for the </form> tag.
      @@ -10457,15 +10425,13 @@ out of 233 257 824 bytes available</meter></p> The <{formelements/autofocus}> attribute is a boolean attribute. - An element's nearest ancestor autofocus scoping root element is the element itself + An element's nearest ancestor autofocus scoping document element is the element itself if the element is a <{dialog}> element, or else is the element's nearest ancestor - <{dialog}> element, if any, or else is the element's root element. - - There must not be two elements with the same nearest ancestor autofocus scoping root - element that both have the <{formelements/autofocus}> attribute - specified. + <{dialog}> element, if any, or else is the element's document element. -
      + There must not be two elements with the same + nearest ancestor autofocus scoping document element that both have the + <{formelements/autofocus}> attribute specified. When an element with the <{formelements/autofocus}> attribute specified is inserted into a document, user agents @@ -10523,8 +10489,6 @@ out of 233 257 824 bytes available</meter></p> The autofocus IDL attribute must reflect the content attribute of the same name. -
      -
      In the following snippet, the text control would be focused when the document was loaded. @@ -10709,8 +10673,8 @@ out of 233 257 824 bytes available</meter></p> When wearing the autofill expectation mantle, the <{autocompleteelements/autocomplete}> attribute, if specified, must have a value that is an ordered set of space-separated tokens consisting of either a single token that - is an ASCII case-insensitive match for the string "off", or a single token that is an ASCII - case-insensitive match for the string "on", + is an ASCII case-insensitive match for the string "off", or a single token + that is an ASCII case-insensitive match for the string "on", or autofill detail tokens. When wearing the autofill anchor @@ -11457,13 +11421,12 @@ out of 233 257 824 bytes available</meter></p>
    49. - If the indexth token in tokens is not an ASCII - case-insensitive match for one of the tokens given in the first column of the following - table, or if the number of tokens in tokens is greater than the maximum - number given in the cell in the second column of that token's row, then jump to the step labeled - default. Otherwise, let field be the string given in the cell of the - first column of the matching row, and let category be the value of the cell - in the third column of that same row. + If the indexth token in tokens is not an ASCII case-insensitive + match for one of the tokens given in the first column of the following table, or if the number + of tokens in tokens is greater than the maximum number given in the cell in the + second column of that token's row, then jump to the step labeled default. Otherwise, let + field be the string given in the cell of the first column of the matching row, and + let category be the value of the cell in the third column of that same row.
    50. @@ -11760,9 +11723,8 @@ out of 233 257 824 bytes available</meter></p>
    51. - If the indexth token in tokens is an ASCII - case-insensitive match for one of the strings in the following list, then run the - substeps that follow: + If the indexth token in tokens is an ASCII case-insensitive match + for one of the strings in the following list, then run the substeps that follow:
      • "shipping" @@ -11797,8 +11759,8 @@ out of 233 257 824 bytes available</meter></p> the step labeled default.
      • If the first eight characters of the indexth token in tokens are not - an ASCII case-insensitive match for the string "section-", then jump to the step labeled - default.
      • + an ASCII case-insensitive match for the string "section-", then jump to the + step labeled default.
      • Let section be the indexth token in tokens, converted to ASCII lowercase.
      • diff --git a/sections/semantics-grouping-content.include b/sections/semantics-grouping-content.include index 815ea93cf4..168b6bb1f0 100644 --- a/sections/semantics-grouping-content.include +++ b/sections/semantics-grouping-content.include @@ -1070,11 +1070,11 @@

        - While it is conforming to include heading elements (e.g., h2) and Sectioning content - inside li elements, it likely does not convey the semantics that the author intended. - A heading starts a new section, so a heading in a list implicitly splits the list into spanning - multiple sections. Sectioning content explicitly creates a new section and so splits the - list into spanning multiple sections. + While it is conforming to include heading elements (e.g., h2) and + Sectioning content inside li elements, it likely does not convey the + semantics that the author intended. A heading starts a new section, so a heading in a list + implicitly splits the list into spanning multiple sections. Sectioning content explicitly + creates a new section and so splits the list into spanning multiple sections.

        The dl element

        diff --git a/sections/semantics-interactive-elements.include b/sections/semantics-interactive-elements.include index 9e65ead5f7..c5aba151aa 100644 --- a/sections/semantics-interactive-elements.include +++ b/sections/semantics-interactive-elements.include @@ -55,8 +55,6 @@ attribute. If present, it indicates that both the summary and the additional information is to be shown to the user. If the attribute is absent, only the summary is to be shown. -
        - When the element is created, if the attribute is absent, the additional information should be hidden; if the attribute is present, that information should be shown. Subsequently, if the attribute is removed, then the information should be hidden; if the attribute is added, the @@ -91,14 +89,11 @@ - The task source for this task must be the DOM manipulation task - source. + The task source for this task must be the DOM manipulation task source. The open IDL attribute must reflect the open content attribute. -
        -
        The following example shows the <{details}> element being used to hide technical details in a progress report. @@ -123,8 +118,7 @@
        - The following shows how a <{details}> element can be used to hide some controls by - default: + The following shows how a <{details}> element can be used to hide some controls by default:
               <details>
        @@ -134,7 +128,7 @@
               </details>
             
        - One could use this in conjunction with other details in a list to allow the user + One could use this in conjunction with other <{details}> in a list to allow the user to collapse a set of fields down to a small set of headings, with the ability to open each one. @@ -142,11 +136,10 @@ In these examples, the summary really just summarizes what the controls can change, and not the actual values, which is less than ideal. -
        - Because the open attribute is added and removed + Because the <{details/open}> attribute is added and removed automatically as the user interacts with the control, it can be used in CSS to style the element differently based on its state. Here, a stylesheet is used to animate the color of the summary when the element is opened or closed: @@ -632,7 +625,7 @@ The contextmenu attribute gives the element's context menu. The value must be the ID of a <{menu}> - element in the same home subtree whose type + element in the same tree whose type attribute is in the popup menu state.

        @@ -665,7 +658,7 @@ Each element has an assigned context menu, which can be null. If an element A has a <{global/contextmenu}> attribute, and there is an element with the ID given by A's <{global/contextmenu}> attribute's value in A's - home subtree, and the first such element in tree order is a + tree, and the first such element in tree order is a <{menu}> element whose type attribute is in the popup menu state, then A's assigned context menu is that element. Otherwise, if A has a parent element, then A's assigned context menu is the assigned context @@ -774,66 +767,45 @@ }; dictionary RelatedEventInit : EventInit { - EventTarget? relatedTarget; + EventTarget? relatedTarget = null; };

        -
        event . relatedTarget
        -
        - - Returns the other event target involved in this event. For example, when a show event fires on a <{menu}> element, the other event - target involved in the event would be the element for which the menu is being shown. - + Returns the other event target involved in this event. For example, when a show + event fires on a <{menu}> element, the other event target involved in the event would be the + element for which the menu is being shown.
        -
        -
        - - The relatedTarget attribute must - return the value it was initialized to. When the object is created, this attribute must be - initialized to null. It represents the other event target that is related to the event. - -
        + The relatedTarget attribute must return the + value it was initialized to. It represents the other event target that is related to the event.

        Commands

        Facets
        - A command is the abstraction behind menu items, buttons, and - links. Once a command is defined, other parts of the interface can refer to the same command, - allowing many access points to a single feature to share facets such as the
        Disabled State. + A command is the abstraction behind menu + items, buttons, and links. Once a command is defined, other parts of the interface can refer to + the same command, allowing many access points to a single feature to share facets such as the + Disabled State. Commands are defined to have the following facets: -
        - -
        Label
        - -
        The name of the command as seen by the user.
        - -
        Access Key
        - -
        A key combination selected by the user agent that triggers the command. A command might not - have an Access Key.
        - -
        Hidden State
        - -
        Whether the command is hidden or not (basically, whether it should be shown in menus).
        - -
        Disabled State
        - -
        Whether the command is relevant and can be triggered or not.
        - -
        Action
        - -
        The actual effect that triggering the command will have. This could be a scripted event - handler, a URL to which to navigate, or a form submission.
        - -
        + : Label + :: The name of the command as seen by the user. + : Access Key + :: A key combination selected by the user agent that triggers the command. A command might not + have an Access Key. + : Hidden State + :: Whether the command is hidden or not (basically, whether it should be shown in menus). + : Disabled State + :: Whether the command is relevant and can be triggered or not. + : Action + :: The actual effect that triggering the command will have. This could be a scripted event + handler, a URL to which to navigate, or a form submission. User agents may expose the commands that match the following criteria: diff --git a/sections/semantics-links.include b/sections/semantics-links.include index d832493dfe..7188165b18 100644 --- a/sections/semantics-links.include +++ b/sections/semantics-links.include @@ -138,74 +138,74 @@
        -
        hyperlink . toString()
        -
        hyperlink . href
        -
        +
        hyperlink . toString()
        +
        hyperlink . href
        +

        Returns the hyperlink's URL.

        Can be set, to change the URL.

        -
        + -
        hyperlink . origin
        -
        +
        hyperlink . origin
        +

        Returns the hyperlink's URL's origin.

        -
        + -
        hyperlink . protocol
        -
        +
        hyperlink . protocol
        +

        Returns the hyperlink's URL's scheme.

        Can be set, to change the URL's scheme.

        -
        + -
        hyperlink . username
        -
        +
        hyperlink . username
        +

        Returns the hyperlink's URL's username.

        Can be set, to change the URL's username.

        -
        + -
        hyperlink . password
        -
        +
        hyperlink . password
        +

        Returns the hyperlink's URL's password.

        Can be set, to change the URL's password.

        -
        + -
        hyperlink . host
        -
        +
        hyperlink . host
        +

        Returns the hyperlink's URL's host and port (if different from the default port for the scheme).

        Can be set, to change the URL's host and port.

        -
        + -
        hyperlink . hostname
        -
        +
        hyperlink . hostname
        +

        Returns the hyperlink's URL's host.

        Can be set, to change the URL's host.

        -
        + -
        hyperlink . port
        -
        +
        hyperlink . port
        +

        Returns the hyperlink's URL's port.

        Can be set, to change the URL's port.

        -
        + -
        hyperlink . pathname
        -
        +
        hyperlink . pathname
        +

        Returns the hyperlink's URL's path.

        Can be set, to change the URL's path.

        -
        + -
        hyperlink . search
        -
        +
        hyperlink . search
        +

        Returns the hyperlink's URL's query (includes leading "?" if non-empty).

        Can be set, to change the URL's query (ignores leading "?").

        -
        + -
        hyperlink . hash
        -
        +
        hyperlink . hash
        +

        Returns the hyperlink's URL's fragment (includes leading "#" if non-empty).

        Can be set, to change the URL's fragment (ignores leading "#").

        -
        +
        @@ -1096,7 +1096,7 @@ The nature of the referenced document is given by the hreflang, and type attributes. If the alternate keyword is used with the hreflang attribute, and that attribute's value differs - from the root element's language, it indicates that the referenced + from the document element's language, it indicates that the referenced document is a translation. If the alternate keyword is used with the type attribute, it indicates that the referenced document is diff --git a/sections/semantics-root.include b/sections/semantics-root.include index fdeeff6f23..9999a22cc1 100644 --- a/sections/semantics-root.include +++ b/sections/semantics-root.include @@ -1,6 +1,6 @@
        -

        The root element

        +

        The document element

        The html element

        @@ -8,7 +8,7 @@
        Categories:
        None.
        Contexts in which this element can be used:
        -
        As the root element of a document.
        +
        As the document's document element.
        Wherever a subdocument fragment is allowed in a compound document.
        Content model:
        A <{head}> element followed by a <{body}> element.
        diff --git a/sections/semantics-sections.include b/sections/semantics-sections.include index 08f921023a..2591accdb0 100644 --- a/sections/semantics-sections.include +++ b/sections/semantics-sections.include @@ -80,7 +80,7 @@

        Thus, for example, a bubbling error event dispatched on a child of the body element of a {{Document}} would first trigger the onerror - event handler content attributes of that element, then that of the root html + event handler content attributes of that element, then that of the root <{html}> element, and only then would it trigger the onerror event handler content attribute on the <{body}> element. This is because the event would bubble from the target, to the <{body}>, to the <{html}>, to the diff --git a/sections/semantics.include b/sections/semantics.include index c0f29f781d..62d2f177e1 100644 --- a/sections/semantics.include +++ b/sections/semantics.include @@ -107,8 +107,8 @@ path: sections/semantics-common-idioms.include attribute values to be defined by the host language. [[!SELECTORS4]]

        Selectors defines that ID and class selectors, when matched against - elements in documents that are in quirks mode, will be matched in an ASCII - case-insensitive manner.

        + elements in documents that are in quirks mode, will be matched in an + ASCII case-insensitive manner.

        When comparing a CSS element type selector to the names of html elements in HTML documents, the CSS element type selector must first be diff --git a/sections/syntax.include b/sections/syntax.include index 19b93a79db..48d522d3cb 100644 --- a/sections/syntax.include +++ b/sections/syntax.include @@ -18,14 +18,10 @@

        Writing HTML documents

        -
        - This section only applies to documents, authoring tools, and markup generators. In particular, it does not apply to conformance checkers; conformance checkers must use the requirements given in the next section ("parsing HTML documents"). -
        - Documents must consist of the following parts, in the given order: @@ -39,7 +35,7 @@
      • Any number of comments and space characters.
      • -
      • The root element, in the form of an <{html}> element.
      • +
      • The document element, in the form of an <{html}> element.
      • Any number of comments and space characters.
      • @@ -52,22 +48,21 @@
        - Space characters before the root <{html}> element, and space characters at the start + Space characters before the <{html}> element, and space characters at the start of the <{html}> element and before the <{head}> element, will be dropped when - the document is parsed; space characters after the root <{html}> element will + the document is parsed; space characters after the <{html}> element will be parsed as if they were at the end of the <{body}> element. Thus, space characters - around the root element do not round-trip. + around the document element do not round-trip. It is suggested that newlines be inserted after the DOCTYPE, after any comments that are - before the root element, after the <{html}> element's start tag (if it is not omitted), and after any comments that are inside the + before the document element, after the <{html}> element's start tag (if it is not omitted), and after any comments that are inside the <{html}> element but before the <{head}> element.
        Many strings in the HTML syntax (e.g., the names of elements and their attributes) are - case-insensitive, but only for uppercase ASCII letters and lowercase ASCII - letters. For convenience, in this section this is just referred to as - "case-insensitive". + case-insensitive, but only for uppercase ASCII letters and lowercase ASCII letters. + For convenience, in this section this is just referred to as "case-insensitive".

        The DOCTYPE

        @@ -242,21 +237,21 @@ For instance, consider the following HTML fragment:
        -  <p>
        -  <svg>
        -  <metadata>
        -    <!-- this is invalid -->
        -    <cdr:license xmlns:cdr="https://www.example.com/cdr/metadata" name="MIT"/>
        -  </metadata>
        -  </svg>
        -  </p>
        -  
        + <p> + <svg> + <metadata> + <!-- this is invalid --> + <cdr:license xmlns:cdr="https://www.example.com/cdr/metadata" name="MIT"/> + </metadata> + </svg> + </p> + - The innermost element, cdr:license, is actually in the SVG namespace, as + The innermost element, cdr:license, is actually in the SVG namespace, as the "xmlns:cdr" attribute has no effect (unlike in XML). In fact, as the comment in the fragment above says, the fragment is actually non-conforming. This is because the SVG specification does not define any elements called "cdr:license" in the - SVG namespace. + SVG namespace.
        @@ -441,8 +436,8 @@ - There must never be two or more attributes on the same start tag whose names are an ASCII - case-insensitive match for each other. + There must never be two or more attributes on the same start tag whose names are an + ASCII case-insensitive match for each other.
        @@ -483,7 +478,7 @@

        Omitting an element's start tag in the situations described below does not mean the element is not present; it is implied, but it is - still there. For example, an HTML document always has a root <{html}> element, even if + still there. For example, an HTML document always has an <{html}> element, even if the string <html> doesn't appear anywhere in the markup.

        @@ -520,7 +515,7 @@ </html> - This has the exact same DOM. In particular, note that white space around the root element is + This has the exact same DOM. In particular, note that white space around the document element is ignored by the parser. The following example would also have the exact same DOM:
        @@ -976,7 +971,7 @@
         
           
        CDATA sections can only be used in foreign content (MathML or SVG). In this example, a CDATA - section is used to escape the contents of an <{ms}> element: + section is used to escape the contents of an MathML ms element:
           <p>You can add a string to a number, but this stringifies the number:</p>
        @@ -1906,7 +1901,7 @@
         
           The next input character is the first character in the input stream
           that has not yet been consumed or explicitly ignored by the requirements in
        -  this section. Initially, the next input character is the
        +  this section. Initially, the next input character is the
           first character in the input. The current input character is the last character to have
           been consumed.
         
        @@ -2097,8 +2092,8 @@
           tags).
         
           

        - The "before html" insertion - mode creates the html root element node, which is then added to the stack. + The "before html" insertion mode creates the <{html}> document element + node, which is then added to the stack.

        @@ -2120,88 +2115,75 @@ Elements in the stack of open elements fall into the following categories: -

        - -
        Special
        - -
        The following elements have varying levels of special parsing rules: HTML's - <{address}>, <{applet}>, <{area}>, <{article}>, - <{aside}>, <{base}>, <{basefont}>, <{bgsound}>, - <{blockquote}>, <{body}>, <{br}>, <{button}>, - <{caption}>, <{center}>, <{col}>, <{colgroup}>, - <{dd}>, <{details}>, <{dir}>, <{div}>, <{dl}>, - <{dt}>, <{embed}>, <{fieldset}>, <{figcaption}>, - <{figure}>, <{footer}>, <{form}>, <{frame}>, - <{frameset}>, <{h1}>, <{h2}>, <{h3}>, <{h4}>, - <{h5}>, <{h6}>, <{head}>, <{header}>, - <{hr}>, <{html}>, <{iframe}>, - <{img}>, <{input}>, <{li}>, <{link}>, - <{listing}>, <{main}>, <{marquee}>, <{menu}>, - <{menuitem}>, <{meta}>, <{nav}>, <{noembed}>, - <{noframes}>, <{noscript}>, <{object}>, <{ol}>, - <{p}>, <{param}>, <{plaintext}>, <{pre}>, - <{script}>, <{section}>, <{select}>, <{source}>, - <{style}>, <{summary}>, <{table}>, <{tbody}>, - <{td}>, <{template}>, <{textarea}>, <{tfoot}>, - <{th}>, <{thead}>, title, <{tr}>, <{track}>, - <{ul}>, <{wbr}>, and <{xmp}>; MathML's <{mi}>, <{mo}>, <{mn}>, - <{ms}>, <{mtext}>, and <{annotation-xml}>; and SVG's <{foreignObject}>, <{desc}>, and title.
        - -
        Formatting
        -
        The following HTML elements are those that end up in the list of active formatting - elements: <{a}>, <{b}>, <{big}>, <{code}>, - <{em}>, <{font}>, <{i}>, <{nobr}>, <{s}>, - <{small}>, <{strike}>, <{strong}>, <{tt}>, and - <{u}>.
        - -
        Ordinary
        -
        All other elements found while parsing an HTML document.
        + : Special + :: The following elements have varying levels of special parsing rules: HTML's + <{address}>, <{applet}>, <{area}>, <{article}>, <{aside}>, <{base}>, <{basefont}>, + <{bgsound}>, <{blockquote}>, <{body}>, <{br}>, <{button}>, <{caption}>, <{center}>, <{col}>, + <{colgroup}>, <{dd}>, <{details}>, <{dir}>, <{div}>, <{dl}>, <{dt}>, <{embed}>, <{fieldset}>, + <{figcaption}>, <{figure}>, <{footer}>, <{form}>, <{frame}>, <{frameset}>, <{h1}>, <{h2}>, + <{h3}>, <{h4}>, <{h5}>, <{h6}>, <{head}>, <{header}>, <{hr}>, <{html}>, <{iframe}>, <{img}>, + <{input}>, <{}>, <{link}>, <{listing}>, <{main}>, <{marquee}>, <{menu}>, <{menuitem}>, + <{meta}>, <{nav}>, <{noembed}>, <{noframes}>, <{noscript}>, <{object}>, <{ol}>, <{p}>, + <{param}>, <{plaintext}>, <{pre}>, <{script}>, <{section}>, <{select}>, <{source}>, <{style}>, + <{summary}>, <{table}>, <{tbody}>, <{td}>, <{template}>, <{textarea}>, <{tfoot}>, <{th}>, + <{thead}>, title, <{tr}>, <{track}>, <{ul}>, <{wbr}>, + and <{xmp}>; MathML mi, MathML mo, + MathML mn, MathML ms, + MathML mtext, and MathML annotation-xml; and + SVG foreignObject, SVG desc, and + SVG title. + + : Formatting + :: The following HTML elements are those that end up in the + list of active formatting elements: <{a}>, <{b}>, <{big}>, <{code}>, <{em}>, <{font}>, + <{i}>, <{nobr}>, <{s}>, <{small}>, <{strike}>, <{strong}>, <{tt}>, and <{u}>. + + : Ordinary + :: All other elements found while parsing an HTML document. -
        +

        + Typically, the special elements have the start and and end tag tokens handled + specifically, while ordinary elements' tokens fall into "any other start tag" and "any + other end tag" clauses, and some parts of the tree builder check if a particular element in the + stack of open elements is in the special category. However, some elements (e.g., + the <{option}> element) have their start or end tag tokens handled specifically, but are still + not in the special category, so that they get the ordinary handling elsewhere. +

        The stack of open elements is said to have an element target node in a specific scope consisting of a - list of element types list when the following algorithm terminates in a match - state: - -
          - -
        1. Initialize node to be the current node (the bottommost - node of the stack).
        2. - -
        3. If node is the target node, terminate in a match state.
        4. + list of element types list when the following algorithm terminates in a match state: -
        5. Otherwise, if node is one of the element types in list, terminate in a failure state.
        6. - -
        7. Otherwise, set node to the previous entry in the stack of open - elements and return to step 2. (This will never fail, since the loop will always terminate - in the previous step if the top of the stack — an <{html}> element — is - reached.)
        8. - -
        + 1. Initialize node to be the current node (the bottommost node of the stack). + 2. If node is the target node, terminate in a match state. + 3. Otherwise, if node is one of the element types in list, terminate in a + failure state. + 4. Otherwise, set node to the previous entry in the stack of open elements and + return to step 2. (This will never fail, since the loop will always terminate in the previous + step if the top of the stack — an <{html}> element — is reached.) The stack of open elements is said to have a particular element in scope when it has that element in the specific scope consisting of the following element types: The stack of open elements is said to have a particular element in list item scope when it has that element in the specific scope consisting of the following @@ -2209,8 +2191,8 @@ The stack of open elements is said to have a particular element in button scope when it has that element in the specific scope consisting of the following element @@ -2218,24 +2200,23 @@ The stack of open elements is said to have a particular element in table scope when it has that element in the specific scope consisting of the following element types: The stack of open elements is said to have a particular element in select scope when it has that element in the specific scope consisting of all element types except the following: @@ -2245,8 +2226,8 @@ to be appended to nodes that are no longer in the DOM.

        - In some cases (namely, when closing misnested formatting - elements), the stack is manipulated in a random-access fashion. + In some cases (namely, when closing misnested formatting elements), the stack is + manipulated in a random-access fashion.

        The list of active formatting elements
        @@ -2254,109 +2235,79 @@ Initially, the list of active formatting elements is empty. It is used to handle mis-nested formatting element tags. - The list contains elements in the formatting category, and markers. The markers are inserted when entering applet - elements, buttons, <{object}> elements, marquees, table cells, and table captions, and - are used to prevent formatting from "leaking" into <{applet}> elements, buttons, - <{object}> elements, marquees, and tables. + The list contains elements in the formatting category, and markers. The + markers are inserted when entering <{applet}> elements, buttons, <{object}> elements, + marquees, table cells, and table captions, and are used to prevent formatting from "leaking" + into <{applet}> elements, buttons, <{object}> elements, marquees, and tables. - In addition, each element in the list of active formatting elements is associated - with the token for which it was created, so that further elements can be created for that token if + In addition, each element in the list of active formatting elements is associated with the + token for which it was created, so that further elements can be created for that token if necessary. - When the steps below require the user agent to push onto the list of active formatting - elements an element element, the user agent must perform the following - steps: - -
          - -
        1. If there are already three elements in the list of active formatting elements - after the last marker, if any, or anywhere in the - list if there are no markers, that have the same tag - name, namespace, and attributes as element, then remove the earliest such - element from the list of active formatting elements. For these purposes, the - attributes must be compared as they were when the elements were created by the parser; two - elements have the same attributes if all their parsed attributes can be paired such that the two - attributes in each pair have identical names, namespaces, and values (the order of the attributes - does not matter). + When the steps below require the user agent to push onto the list of active formatting elements + an element element,the user agent must perform the following steps: -

          - This is the Noah's Ark clause. But with three per family instead of two. -

        2. - -
        3. Add element to the list of active formatting - elements.
        4. + 1. If there are already three elements in the list of active formatting elements after the + last marker, if any, or anywhere in the list if there are no markers, that have + the same tag name, namespace, and attributes as element, then remove the earliest + such element from the list of active formatting elements. For these purposes, the + attributes must be compared as they were when the elements were created by the parser; two + elements have the same attributes if all their parsed attributes can be paired such that the + two attributes in each pair have identical names, namespaces, and values (the order of the + attributes does not matter). -
        +

        This is the Noah's Ark clause. But with three per family instead of two.

        + 2. Add element to the list of active formatting elements. When the steps below require the user agent to reconstruct the active formatting elements, the user agent must perform the following steps: -
          - -
        1. If there are no entries in the list of active formatting elements, then there - is nothing to reconstruct; stop this algorithm.
        2. - -
        3. If the last (most recently added) entry in the list of active formatting - elements is a marker, or if it is an element - that is in the stack of open elements, then there is nothing to reconstruct; stop - this algorithm.
        4. - -
        5. Let entry be the last (most recently added) element in the list - of active formatting elements.
        6. - -
        7. Rewind: If there are no entries before entry in the list - of active formatting elements, then jump to the step labeled create.
        8. - -
        9. Let entry be the entry one earlier than entry in - the list of active formatting elements.
        10. - -
        11. If entry is neither a marker nor an element that is also in the stack of - open elements, go to the step labeled rewind.
        12. - -
        13. Advance: Let entry be the element one later than entry in the list of active formatting elements.
        14. - -
        15. Create: Insert an HTML element for the token for which the element - entry was created, to obtain new element.
        16. - -
        17. Replace the entry for entry in the list with an entry for new element.
        18. - -
        19. If the entry for new element in the list of active formatting - elements is not the last entry in the list, return to the step labeled - advance.
        20. - -
        + 1. If there are no entries in the list of active formatting elements, then there is nothing + to reconstruct; stop this algorithm. + 2. If the last (most recently added) entry in the list of active formatting elements is a + marker, or if it is an element that is in the stack of open elements, then there + is nothing to reconstruct; stop this algorithm. + 3. Let entry be the last (most recently added) element in the + list of active formatting elements. + 4. Rewind: If there are no entries before entry in the + list of active formatting elements, then jump to the step labeled create. + 5. Let entry be the entry one earlier than entry in the + list of active formatting elements. + 6. If entry is neither a marker nor an element that is also in the + stack of open elements, go to the step labeled rewind. + 7. Advance: Let entry be the element one later than entry in the + list of active formatting elements. + 8. Create: Insert an HTML element for the token for which the element + entry was created, to obtain new element. + 9. Replace the entry for entry in the list with an entry for new element. + 10. If the entry for new element in the list of active formatting elements is + not the last entry in the list, return to the step labeled advance. This has the effect of reopening all the formatting elements that were opened in the current body, cell, or caption (whichever is youngest) that haven't been explicitly closed.

        - The way this specification is written, the list of active formatting - elements always consists of elements in chronological order with the least recently added - element first and the most recently added element last (except for while steps 7 to 10 of the - above algorithm are being executed, of course). + The way this specification is written, the list of active formatting elements always + consists of elements in chronological order with the least recently added element first and the + most recently added element last (except for while steps 7 to 10 of the above algorithm are + being executed, of course).

        - When the steps below require the user agent to clear the list of active formatting elements up to - the last marker, the user agent must perform the following steps: - -
          - -
        1. Let entry be the last (most recently added) entry in the list of - active formatting elements.
        2. - -
        3. Remove entry from the list of active formatting - elements.
        4. + When the steps below require the user agent to + clear the list of active formatting elements up to the last marker, the user agent must + perform the following steps: -
        5. If entry was a marker, - then stop the algorithm at this point. The list has been cleared up to the last marker.
        6. - -
        7. Go to step 1.
        8. - -
        + 1. Let entry be the last (most recently added) entry in the + list of active formatting elements. + 2. Remove entry from the list of active formatting elements. + 3. If entry was a marker, then stop the algorithm at this point. The list has + been cleared up to the last marker. + 4. Go to step 1.
        The element pointers
        - Initially, the head element pointer and the form element pointer are both null. + Initially, the head element pointer and the + form element pointer are both null. Once a <{head}> element has been parsed (whether implicitly or explicitly) the head element pointer gets set to point to this node. @@ -3639,15 +3590,21 @@
        Bogus comment state
        - Consume every character up to and including the first U+003E GREATER-THAN SIGN character (>) - or the end of the file (EOF), whichever comes first. - If more than one character was consumed, then emit a comment token whose data is the - concatenation of all the characters starting from and including the character that caused the - state machine to switch into the bogus comment state, up to and including the character - immediately before the last consumed character (i.e., up to the character just before the U+003E or - EOF character), but with any U+0000 NULL characters replaced by U+FFFD REPLACEMENT CHARACTER - characters. (If the comment was started by the end of the file (EOF), the token is empty. - Similarly, the token is empty if it was generated by the string "<!>".) + Consume the next input character: + +
        +
        U+003E GREATER-THAN SIGN (>)
        +
        Switch to the data state. Emit the comment token.
        + +
        EOF
        +
        Switch to the data state. Reconsume the EOF character. Emit the comment token.
        + +
        U+0000 NULL
        +
        Append a U+FFFD REPLACEMENT CHARACTER character to the comment token's data.
        + +
        Anything else
        +
        Append the current input character to the comment token's data.
        +
        Switch to the [[#data-state]]. @@ -3666,9 +3623,9 @@ for the string "[CDATA[" (the five uppercase letters "CDATA" with a U+005B LEFT SQUARE BRACKET character before and after), then consume those characters and switch to the [[#cdata-section-state]]. - Otherwise, this is a parse error. Switch to the [[#bogus-comment-state]]. - The next character that is consumed, if any, is the first character that will be in the - comment. + Otherwise, this is a parse error. Create a comment token whose data is the + empty string. Switch to the [[#bogus-comment-state]]. The next character that is consumed, if any, + is the first character that will be in the comment.
        Comment start state
        @@ -4387,8 +4344,8 @@ - Consume as many characters as match the range of characters given above (ASCII hex - digits or ASCII digits). + Consume as many characters as match the range of characters given above (ASCII hex digits + or ASCII digits). If no characters match the range, then don't consume any characters (and unconsume the U+0023 NUMBER SIGN character and, if appropriate, the X character). This is a parse error; @@ -4526,7 +4483,7 @@
        If the adjusted current node is an element in the HTML namespace
        If the adjusted current node is a MathML text integration point and the token is a start tag whose tag name is neither "mglyph" nor "malignmark"
        If the adjusted current node is a MathML text integration point and the token is a character token
        -
        If the adjusted current node is an <{annotation-xml}> element in the MathML namespace and the token is a start tag whose tag name is "svg"
        +
        If the adjusted current node is an MathML annotation-xml element and the token is a start tag whose tag name is "svg"
        If the adjusted current node is an HTML integration point and the token is a start tag
        If the adjusted current node is an HTML integration point and the token is a character token
        If the token is an end-of-file token
        @@ -4547,25 +4504,25 @@ elements: A node is an HTML integration point if it is one of the following elements:

        @@ -4730,7 +4687,7 @@

      • If the element is a form-associated element, and the form element pointer is not null, and there is no template element on the stack of open elements, and the newly created element is either not reassociateable or doesn't have a form attribute, and the intended parent is in - the same home subtree as the element pointed to by the form element pointer, associate the newly created element with the + the same tree as the element pointed to by the form element pointer, associate the newly created element with the <{form}> element pointed to by the form element pointer, and suppress the running of the reset the form owner algorithm when the parser subsequently attempts to insert the element.
      • @@ -5273,7 +5230,7 @@ - The root element can end up being removed from the {{Document}} object, e.g., by + The document element can end up being removed from the {{Document}} object, e.g., by scripts; nothing in particular happens in such cases, content continues being appended to the nodes as described in the next section. @@ -5846,7 +5803,7 @@ node, if it has one.
      • Pop all the nodes from the bottom of the stack of open elements, from the - current node up to, but not including, the root <{html}> element. + current node up to, but not including, the <{html}> element.
      • Insert an HTML element for the token.
      • @@ -6619,8 +6576,7 @@ Adjust foreign attributes for the token. (This fixes the use of namespaced attributes, in particular XLink.) - Insert a foreign element for the token, in the MathML - namespace. + Insert a foreign element for the token, in the MathML namespace. If the token has its self-closing flag set, pop the current node off the stack of open elements and acknowledge @@ -8135,7 +8091,7 @@
        An end tag whose tag name is "frameset"
        - If the current node is the root <{html}> element, then this is a + If the current node is the <{html}> element, then this is a parse error; ignore the token. (fragment case) Otherwise, pop the current node from the stack of open @@ -8168,12 +8124,11 @@
        An end-of-file token
        - If the current node is not the root <{html}> element, then this is a + If the current node is not the <{html}> element, then this is a parse error.

        - The current node can only be the root - <{html}> element in the fragment case. + The current node can only be the <{html}> element in the fragment case.

        Stop parsing. @@ -8363,10 +8318,10 @@ parse error. Ignore the token.
        -
        A start tag whose tag name is one of: "b", "big", "blockquote", "body", "br", "center", "code", "dd", "div", "dl", "dt", "em", "embed", "h1", "h2", "h3", "h4", "h5", "h6", "head", "hr", "i", "img", - "li", "listing", - "menu", "meta", "nobr", "ol", "p", "pre", "ruby", "s", "small", "span", "strong", "strike", "sub", - "sup", "table", "tt", "u", "ul", "var"
        +
        A start tag whose tag name is one of: "b", "big", "blockquote", "body", "br", "center", + "code", "dd", "div", "dl", "dt", "em", "embed", "h1", "h2", "h3", "h4", "h5", "h6", "head", + "hr", "i", "img", "li", "listing", "menu", "meta", "nobr", "ol", "p", "pre", "ruby", "s", + "small", "span", "strong", "strike", "sub", "sup", "table", "tt", "u", "ul", "var"
        A start tag whose tag name is "font", if the token has any attributes named "color", "face", or "size"
        @@ -8481,7 +8436,7 @@ -
        An end tag whose tag name is "script", if the current node is a <{script}> element in the SVG namespace
        +
        An end tag whose tag name is "script", if the current node is a SVG script element
        Pop the current node off the stack of open elements. diff --git a/sections/webappapis.include b/sections/webappapis.include index 4cc4e27072..dd4fbbfa6f 100644 --- a/sections/webappapis.include +++ b/sections/webappapis.include @@ -965,8 +965,8 @@ };
        - The message attribute must return the - value it was initialized to. It represents the error message. + The message attribute must return the value it + was initialized to. It represents the error message. The filename attribute must return the value it was initialized to. It represents the absolute URL of the script in which the error @@ -2255,10 +2255,9 @@

        Dynamic markup insertion

        - APIs for dynamically inserting markup into the document interact with the parser, - and thus their behavior varies depending on whether they are used with HTML documents - (and the HTML parser) or XHTML in XML documents (and the XML - parser). + APIs for dynamically inserting markup into the document interact with the parser, and thus their + behavior varies depending on whether they are used with HTML documents (and the + HTML parser) or XML documents (and the XML parser).

        Opening the input stream

        @@ -2424,68 +2423,47 @@

        Closing the input stream

        -
        document . {{Document/close()}}
        -
        + Closes the input stream that was opened by the document.open() method. - Closes the input stream that was opened by the document.open() method. - - Throws an InvalidStateError exception if the - Document is an XML - document. - + Throws an {{InvalidStateError}} exception if the {{Document}} is an XML document.
        -
        - The close() method must run the following - steps: - -
          - -
        1. If the Document object is not flagged as an HTML - document, throw an InvalidStateError exception and abort these - steps.
        2. - -
        3. If there is no script-created parser associated with the document, then abort - these steps.
        4. - -
        5. Insert an explicit "EOF" character at the end of the parser's input - stream.
        6. - -
        7. If there is a pending parsing-blocking script, then abort these - steps.
        8. + The close() method must run the following steps: -
        9. Run the tokenizer, processing resulting tokens as they are emitted, and stopping when the - tokenizer reaches the explicit "EOF" character or spins the event loop.
        10. - -
        + 1. If the {{Document}} object is an XML document, then throw an {{InvalidStateError}} + exception and abort these steps. + 2. If there is no script-created parser associated with the document, then abort these + steps. + 3. Insert an explicit "EOF" character at the end of the parser's input stream. + 4. If there is a pending parsing-blocking script, then abort these steps. + 5. Run the tokenizer, processing resulting tokens as they are emitted, and stopping when the + tokenizer reaches the explicit "EOF" character or spins the event loop.

        document.write()

        -
        document . {{Document/write()|write}}(text...)
        -
        + In general, adds the given string(s) to the Document's input stream. + +

        + This method has very idiosyncratic behavior. In some cases, this method can affect the state + of the HTML parser while the parser is running, resulting in a DOM that does not + correspond to the source of the document (e.g., if the string written is the string + "<plaintext>" or "<!--"). In other cases, the call can + clear the current page first, as if document.open() had been called. In yet + more cases, the method is simply ignored, or throws an exception. To make matters worse, the + exact behavior of this method can in some cases be dependent on network latency, which can + lead to failures that are very hard to debug. For all these reasons, use of this + method is strongly discouraged. +

        - In general, adds the given string(s) to the Document's input stream. - -

        This method has very idiosyncratic behavior. In some cases, this method can - affect the state of the HTML parser while the parser is running, resulting in a DOM - that does not correspond to the source of the document (e.g., if the string written is the string - "<plaintext>" or "<!--"). In other cases, - the call can clear the current page first, as if document.open() had been called. In yet more cases, the method - is simply ignored, or throws an exception. To make matters worse, the exact behavior of this - method can in some cases be dependent on network latency, which can lead to failures that are very hard to debug. For all these reasons, use - of this method is strongly discouraged.

        - - This method throws an InvalidStateError exception when invoked on XML - documents. - + This method throws an InvalidStateError exception when invoked on + XML documents.
        -
        Document objects have an ignore-destructive-writes counter, which is diff --git a/sections/xhtml.include b/sections/xhtml.include index 6c964e2913..3c37d1e7ac 100644 --- a/sections/xhtml.include +++ b/sections/xhtml.include @@ -288,10 +288,9 @@ The default namespace is the namespace for which the DOM isDefaultNamespace() method on the element would return true.

        - No - DOCTYPE is passed to the parser, and therefore no external subset is - referenced, and therefore no entities will be recognized. -

        + No DOCTYPE is passed to the parser, and therefore no external subset is + referenced, and therefore no entities will be recognized. +

        @@ -316,22 +315,18 @@
      • - If the root - element of the resulting {{Document}} has any sibling nodes, then throw a + If the document element of the resulting {{Document}} has any sibling nodes, then throw a "{{SyntaxError}}" {{DOMException}} and abort these steps.
      • - Return the - child nodes of the root element of the resulting {{Document}}, in tree - order. + Return the child nodes of the document element of the resulting {{Document}}, in + tree order.
      • -
        - diff --git a/single-page.bs b/single-page.bs index d8644e76f4..ba23a8c744 100644 --- a/single-page.bs +++ b/single-page.bs @@ -662,7 +662,6 @@ urlPrefix: https://url.spec.whatwg.org/#; type: dfn; spec: URL; text: application/x-www-form-urlencoded serializer; url: urlencoded-serializer text: basic url parser text: domain; for: url - text: domain to ascii text: domain to unicode text: host; for: host-concept text: Host equals