diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index ff418f893df..8fba4c2d15b 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -15,6 +15,18 @@ jobs: with: fetch-depth: 2 path: 'source' + - name: Check Formatting + run: | + curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y + source $HOME/.cargo/env + cargo install reformahtml + mkdir tmp + reformahtml source/source tmp/reformatted-source + diff source/source tmp/reformatted-source > tmp/diff_output.txt || true + if [ -s tmp/diff_output.txt ]; then + cat tmp/diff_output.txt + exit 1 + fi - name: Build run: | mkdir output diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index af63a0bacfe..5a123ad572c 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -53,28 +53,9 @@ Due to the long legacy of the existing text, these guidelines are not always app #### Line wrapping length -Use a column width of 100 characters and add newlines where whitespace is used. (Emacs, set `fill-column` to `100`; in Vim, set `textwidth` to `100`; and in Sublime, set `wrap_width` to `100`. Alternatively, wrap the paragraph(s) with your changes with https://domenic.github.io/rewrapper/. Make sure that `column length to rewrap` is set to 100.) +Do not wrap text within a paragraph (or list item, etc.). Custom wrapping for readability (e.g. one `code` element per line) is OK; add a `data-noreformat` attribute on the containing element. -#### Wrapping opportunities - -Using newlines between "inline" element tag names and their content is forbidden. (This actually alters the content, by adding spaces.) That is, -```html -
Parse error. Create a new DOCTYPE token. Set its force-quirks flag to … -``` -is fine and -```html -
Parse error. Create a new DOCTYPE token. Set its - force-quirks flag to … -``` -is not. - -Using newlines between attributes and inside attribute values that contain whitespace is allowed. Always wrap after putting the maximum number of characters on a single line within these guidelines. - -```html -

A base element that is the first base element with an href content attribute in a document tree has a -``` +You can run https://github.com/zcorpan/reformahtml locally to remove inter-paragraph line wrapping. This script is also run as a GitHub workflow. ### Element hierarchy @@ -92,22 +73,20 @@ and the previous list item. No extra newline at the start or end of the list tho If a "block" element contains a single "block" element, do not put it on a new line. -Do not indent for anything except a new "block" element. For instance +For instance ```html -

  • Let corsAttributeState be the current state of the element's crossorigin content attribute.

  • +
  • Let corsAttributeState be the current state of the element's crossorigin content attribute.

  • ``` is not indented, but ```html
  • -

    For each element in candidate elements, run the following - substeps:

    +

    For each element in candidate elements, run the following substeps:

      ``` is. -End tags must not be omitted (except where it is consistent to do so) and attribute values must be quoted (use double quotes). +End tags must not be omitted (except where it is consistent to do so) and non-empty attribute values must be quoted (use double quotes). ### Algorithms diff --git a/source b/source index 3fb2c03374e..1da26a0cee8 100644 --- a/source +++ b/source @@ -1,4 +1,4 @@ - -

      HTML is the World Wide Web's core markup language. Originally, HTML was primarily designed as a - language for semantically describing scientific documents. Its general design, however, has - enabled it to be adapted, over the subsequent years, to describe a number of other types of - documents and even applications.

      +

      HTML is the World Wide Web's core markup language. Originally, HTML was primarily designed as a language for semantically describing scientific documents. Its general design, however, has enabled it to be adapted, over the subsequent years, to describe a number of other types of documents and even applications.

      Audience

      -

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

      +

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

      -

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

      +

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

      -

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

      +

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

      Scope

      -

      This specification is limited to providing a semantic-level markup language and associated - semantic-level scripting APIs for authoring accessible pages on the web ranging from static - documents to dynamic applications.

      +

      This specification is limited to providing a semantic-level markup language and associated semantic-level scripting APIs for authoring accessible pages on the web ranging from static documents to dynamic applications.

      -

      The scope of this specification does not include providing mechanisms for media-specific - customization of presentation (although default rendering rules for web browsers are included at - the end of this specification, and several mechanisms for hooking into CSS are provided as part of - the language).

      +

      The scope of this specification does not include providing mechanisms for media-specific customization of presentation (although default rendering rules for web browsers are included at the end of this specification, and several mechanisms for hooking into CSS are provided as part of the language).

      -

      The scope of this specification is not to describe an entire operating system. In particular, - hardware configuration software, image manipulation tools, and applications that users would be - expected to use with high-end workstations on a daily basis are out of scope. In terms of - applications, this specification is targeted specifically at applications that would be expected - to be used by users on an occasional basis, or regularly but from disparate locations, with low - CPU requirements. Examples of such applications include online purchasing systems, searching - systems, games (especially multiplayer online games), public telephone books or address books, - communications software (email clients, instant messaging clients, discussion software), document - editing software, etc.

      +

      The scope of this specification is not to describe an entire operating system. In particular, hardware configuration software, image manipulation tools, and applications that users would be expected to use with high-end workstations on a daily basis are out of scope. In terms of applications, this specification is targeted specifically at applications that would be expected to be used by users on an occasional basis, or regularly but from disparate locations, with low CPU requirements. Examples of such applications include online purchasing systems, searching systems, games (especially multiplayer online games), public telephone books or address books, communications software (email clients, instant messaging clients, discussion software), document editing software, etc.

      History

      -

      For its first five years (1990-1995), HTML went through a number of revisions and experienced a - number of extensions, primarily hosted first at CERN, and then at the IETF.

      - -

      With the creation of the W3C, HTML's development changed venue again. A first abortive attempt - at extending HTML in 1995 known as HTML 3.0 then made way to a more pragmatic approach known as - HTML 3.2, which was completed in 1997. HTML4 quickly followed later that same year.

      - -

      The following year, the W3C membership decided to stop evolving HTML and instead begin work on - an XML-based equivalent, called XHTML. This - effort started with a reformulation of HTML4 in XML, known as XHTML 1.0, which added no new - features except the new serialization, and which was completed in 2000. After XHTML 1.0, the W3C's - focus turned to making it easier for other working groups to extend XHTML, under the banner of - XHTML Modularization. In parallel with this, the W3C also worked on a new language that was not - compatible with the earlier HTML and XHTML languages, calling it XHTML2.

      - -

      Around the time that HTML's evolution was stopped in 1998, parts of the API for HTML developed - by browser vendors were specified and published under the name DOM Level 1 (in 1998) and DOM Level - 2 Core and DOM Level 2 HTML (starting in 2000 and culminating in 2003). These efforts then petered - out, with some DOM Level 3 specifications published in 2004 but the working group being closed - before all the Level 3 drafts were completed.

      - -

      In 2003, the publication of XForms, a technology which was positioned as the next generation of - web forms, sparked a renewed interest in evolving HTML itself, rather than finding replacements - for it. This interest was borne from the realization that XML's deployment as a web technology was - limited to entirely new technologies (like RSS and later Atom), rather than as a replacement for - existing deployed technologies (like HTML).

      - -

      A proof of concept to show that it was possible to extend HTML4's forms to provide many of the - features that XForms 1.0 introduced, without requiring browsers to implement rendering engines - that were incompatible with existing HTML web pages, was the first result of this renewed - interest. At this early stage, while the draft was already publicly available, and input was - already being solicited from all sources, the specification was only under Opera Software's - copyright.

      - -

      The idea that HTML's evolution should be reopened was tested at a W3C workshop in 2004, where - some of the principles that underlie the HTML5 work (described below), as well as the - aforementioned early draft proposal covering just forms-related features, were presented to the - W3C jointly by Mozilla and Opera. The proposal was rejected on the grounds that the proposal - conflicted with the previously chosen direction for the web's evolution; the W3C staff and - membership voted to continue developing XML-based replacements instead.

      - -

      Shortly thereafter, Apple, Mozilla, and Opera jointly announced their intent to continue - working on the effort under the umbrella of a new venue called the WHATWG. A public mailing list - was created, and the draft was moved to the WHATWG site. The copyright was subsequently amended to - be jointly owned by all three vendors, and to allow reuse of the specification.

      - -

      The WHATWG was based on several core principles, in particular that technologies need to be - backwards compatible, that specifications and implementations need to match even if this means - changing the specification rather than the implementations, and that specifications need to be - detailed enough that implementations can achieve complete interoperability without - reverse-engineering each other.

      - -

      The latter requirement in particular required that the scope of the HTML5 specification include - what had previously been specified in three separate documents: HTML4, XHTML1, and DOM2 HTML. It - also meant including significantly more detail than had previously been considered the norm.

      - -

      In 2006, the W3C indicated an interest to participate in the development of HTML5 after all, - and in 2007 formed a working group chartered to work with the WHATWG on the development of the - HTML5 specification. Apple, Mozilla, and Opera allowed the W3C to publish the specification under - the W3C copyright, while keeping a version with the less restrictive license on the WHATWG - site.

      - -

      For a number of years, both groups then worked together. In 2011, however, the groups came to - the conclusion that they had different goals: the W3C wanted to publish a "finished" version of - "HTML5", while the WHATWG wanted to continue working on a Living Standard for HTML, continuously - maintaining the specification rather than freezing it in a state with known problems, and adding - new features as needed to evolve the platform.

      - -

      In 2019, the WHATWG and W3C signed an - agreement to collaborate on a single version of HTML going forward: this document.

      +

      For its first five years (1990-1995), HTML went through a number of revisions and experienced a number of extensions, primarily hosted first at CERN, and then at the IETF.

      + +

      With the creation of the W3C, HTML's development changed venue again. A first abortive attempt at extending HTML in 1995 known as HTML 3.0 then made way to a more pragmatic approach known as HTML 3.2, which was completed in 1997. HTML4 quickly followed later that same year.

      + +

      The following year, the W3C membership decided to stop evolving HTML and instead begin work on an XML-based equivalent, called XHTML. This effort started with a reformulation of HTML4 in XML, known as XHTML 1.0, which added no new features except the new serialization, and which was completed in 2000. After XHTML 1.0, the W3C's focus turned to making it easier for other working groups to extend XHTML, under the banner of XHTML Modularization. In parallel with this, the W3C also worked on a new language that was not compatible with the earlier HTML and XHTML languages, calling it XHTML2.

      + +

      Around the time that HTML's evolution was stopped in 1998, parts of the API for HTML developed by browser vendors were specified and published under the name DOM Level 1 (in 1998) and DOM Level 2 Core and DOM Level 2 HTML (starting in 2000 and culminating in 2003). These efforts then petered out, with some DOM Level 3 specifications published in 2004 but the working group being closed before all the Level 3 drafts were completed.

      + +

      In 2003, the publication of XForms, a technology which was positioned as the next generation of web forms, sparked a renewed interest in evolving HTML itself, rather than finding replacements for it. This interest was borne from the realization that XML's deployment as a web technology was limited to entirely new technologies (like RSS and later Atom), rather than as a replacement for existing deployed technologies (like HTML).

      + +

      A proof of concept to show that it was possible to extend HTML4's forms to provide many of the features that XForms 1.0 introduced, without requiring browsers to implement rendering engines that were incompatible with existing HTML web pages, was the first result of this renewed interest. At this early stage, while the draft was already publicly available, and input was already being solicited from all sources, the specification was only under Opera Software's copyright.

      + +

      The idea that HTML's evolution should be reopened was tested at a W3C workshop in 2004, where some of the principles that underlie the HTML5 work (described below), as well as the aforementioned early draft proposal covering just forms-related features, were presented to the W3C jointly by Mozilla and Opera. The proposal was rejected on the grounds that the proposal conflicted with the previously chosen direction for the web's evolution; the W3C staff and membership voted to continue developing XML-based replacements instead.

      + +

      Shortly thereafter, Apple, Mozilla, and Opera jointly announced their intent to continue working on the effort under the umbrella of a new venue called the WHATWG. A public mailing list was created, and the draft was moved to the WHATWG site. The copyright was subsequently amended to be jointly owned by all three vendors, and to allow reuse of the specification.

      + +

      The WHATWG was based on several core principles, in particular that technologies need to be backwards compatible, that specifications and implementations need to match even if this means changing the specification rather than the implementations, and that specifications need to be detailed enough that implementations can achieve complete interoperability without reverse-engineering each other.

      + +

      The latter requirement in particular required that the scope of the HTML5 specification include what had previously been specified in three separate documents: HTML4, XHTML1, and DOM2 HTML. It also meant including significantly more detail than had previously been considered the norm.

      + +

      In 2006, the W3C indicated an interest to participate in the development of HTML5 after all, and in 2007 formed a working group chartered to work with the WHATWG on the development of the HTML5 specification. Apple, Mozilla, and Opera allowed the W3C to publish the specification under the W3C copyright, while keeping a version with the less restrictive license on the WHATWG site.

      + +

      For a number of years, both groups then worked together. In 2011, however, the groups came to the conclusion that they had different goals: the W3C wanted to publish a "finished" version of "HTML5", while the WHATWG wanted to continue working on a Living Standard for HTML, continuously maintaining the specification rather than freezing it in a state with known problems, and adding new features as needed to evolve the platform.

      + +

      In 2019, the WHATWG and W3C signed an agreement to collaborate on a single version of HTML going forward: this document.

      @@ -343,20 +245,13 @@ -

      It must be admitted that many aspects of HTML appear at first glance to be nonsensical and - inconsistent.

      +

      It must be admitted that many aspects of HTML appear at first glance to be nonsensical and inconsistent.

      -

      HTML, its supporting DOM APIs, as well as many of its supporting technologies, have been - developed over a period of several decades by a wide array of people with different priorities - who, in many cases, did not know of each other's existence.

      +

      HTML, its supporting DOM APIs, as well as many of its supporting technologies, have been developed over a period of several decades by a wide array of people with different priorities who, in many cases, did not know of each other's existence.

      -

      Features have thus arisen from many sources, and have not always been designed in especially - consistent ways. Furthermore, because of the unique characteristics of the web, implementation - bugs have often become de-facto, and now de-jure, standards, as content is often unintentionally - written in ways that rely on them before they can be fixed.

      +

      Features have thus arisen from many sources, and have not always been designed in especially consistent ways. Furthermore, because of the unique characteristics of the web, implementation bugs have often become de-facto, and now de-jure, standards, as content is often unintentionally written in ways that rely on them before they can be fixed.

      -

      Despite all this, efforts have been made to adhere to certain design goals. These are described - in the next few subsections.

      +

      Despite all this, efforts have been made to adhere to certain design goals. These are described in the next few subsections.

      @@ -365,17 +260,9 @@ -

      To avoid exposing web authors to the complexities of multithreading, the HTML and DOM APIs are - designed such that no script can ever detect the simultaneous execution of other scripts. Even - with workers, the intent is that the behavior of implementations can - be thought of as completely serializing the execution of all scripts in all globals.

      +

      To avoid exposing web authors to the complexities of multithreading, the HTML and DOM APIs are designed such that no script can ever detect the simultaneous execution of other scripts. Even with workers, the intent is that the behavior of implementations can be thought of as completely serializing the execution of all scripts in all globals.

      -

      The exception to this general design principle is the JavaScript SharedArrayBuffer - class. Using SharedArrayBuffer objects, it can in fact be observed that scripts in - other agents are executing simultaneously. Furthermore, due to the - JavaScript memory model, there are situations which not only are un-representable via serialized - script execution, but also un-representable via serialized statement execution - among those scripts.

      +

      The exception to this general design principle is the JavaScript SharedArrayBuffer class. Using SharedArrayBuffer objects, it can in fact be observed that scripts in other agents are executing simultaneously. Furthermore, due to the JavaScript memory model, there are situations which not only are un-representable via serialized script execution, but also un-representable via serialized statement execution among those scripts.

      @@ -385,42 +272,24 @@ -

      HTML has a wide array of extensibility mechanisms that can be used for adding semantics in a - safe manner:

      +

      HTML has a wide array of extensibility mechanisms that can be used for adding semantics in a safe manner:

        -
      • Authors can use the class attribute to extend elements, - effectively creating their own elements, while using the most applicable existing "real" HTML - element, so that browsers and other tools that don't know of the extension can still support it - somewhat well. This is the tack used by microformats, for example.

      • - -
      • Authors can include data for inline client-side scripts or server-side site-wide scripts - to process using the data-*="" attributes. These are guaranteed - to never be touched by browsers, and allow scripts to include data on HTML elements that scripts - can then look for and process.

      • - -
      • Authors can use the <meta name="" content=""> mechanism to - include page-wide metadata.

      • - -
      • Authors can use the rel="" mechanism to annotate - links with specific meanings by registering extensions to - the predefined set of link types. This is also used by microformats.

      • - -
      • Authors can embed raw data using the <script type=""> - mechanism with a custom type, for further handling by inline or server-side scripts.

      • - -
      • Authors can extend APIs using the JavaScript prototyping mechanism. This is widely used by - script libraries, for instance.

      • - -
      • Authors can use the microdata feature (the itemscope="" and itemprop="" - attributes) to embed nested name-value pairs of data to be shared with other applications and - sites.

      • - -
      • Authors can define, share, and use custom elements - to extend the vocabulary of HTML. The requirements of valid custom element names ensure forward compatibility (since no elements will be - added to HTML, SVG, or MathML with hyphen-containing local names in the future).

      • +
      • Authors can use the class attribute to extend elements, effectively creating their own elements, while using the most applicable existing "real" HTML element, so that browsers and other tools that don't know of the extension can still support it somewhat well. This is the tack used by microformats, for example.

      • + +
      • Authors can include data for inline client-side scripts or server-side site-wide scripts to process using the data-*="" attributes. These are guaranteed to never be touched by browsers, and allow scripts to include data on HTML elements that scripts can then look for and process.

      • + +
      • Authors can use the <meta name="" content=""> mechanism to include page-wide metadata.

      • + +
      • Authors can use the rel="" mechanism to annotate links with specific meanings by registering extensions to the predefined set of link types. This is also used by microformats.

      • + +
      • Authors can embed raw data using the <script type=""> mechanism with a custom type, for further handling by inline or server-side scripts.

      • + +
      • Authors can extend APIs using the JavaScript prototyping mechanism. This is widely used by script libraries, for instance.

      • + +
      • Authors can use the microdata feature (the itemscope="" and itemprop="" attributes) to embed nested name-value pairs of data to be shared with other applications and sites.

      • + +
      • Authors can define, share, and use custom elements to extend the vocabulary of HTML. The requirements of valid custom element names ensure forward compatibility (since no elements will be added to HTML, SVG, or MathML with hyphen-containing local names in the future).

      @@ -430,35 +299,19 @@ -

      This specification defines an abstract language for describing documents and applications, and - some APIs for interacting with in-memory representations of resources that use this language.

      +

      This specification defines an abstract language for describing documents and applications, and some APIs for interacting with in-memory representations of resources that use this language.

      The in-memory representation is known as "DOM HTML", or "the DOM" for short.

      -

      There are various concrete syntaxes that can be used to transmit resources that use this - abstract language, two of which are defined in this specification.

      +

      There are various concrete syntaxes that can be used to transmit resources that use this abstract language, two of which are defined in this specification.

      -

      The first such concrete syntax is the HTML syntax. This is the format suggested for most - authors. 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 HTML syntax, known simply as "HTML".

      +

      The first such concrete syntax is the HTML syntax. This is the format suggested for most authors. 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 HTML syntax, known simply as "HTML".

      -

      The second concrete syntax is XML. When a document is transmitted with an XML MIME - type, such as application/xhtml+xml, then it is treated as an 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.

      +

      The second concrete syntax is XML. When a document is transmitted with an XML MIME type, such as application/xhtml+xml, then it is treated as an 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.

      -

      The XML syntax for HTML was formerly referred to as "XHTML", but this - specification does not use that term (among other reasons, because no such term is used for the - HTML syntaxes of MathML and SVG).

      +

      The XML syntax for HTML was formerly referred to as "XHTML", but this specification does not use that term (among other reasons, because no such term is used for the HTML syntaxes of MathML and SVG).

      -

      The DOM, the HTML syntax, and the XML syntax cannot all represent the same content. For - example, namespaces cannot be represented using the HTML syntax, but they are supported in the DOM - and in the XML syntax. Similarly, documents that use the noscript feature can be - represented using the HTML syntax, but cannot be represented with the DOM or in the XML syntax. - Comments that contain the string "-->" can only be represented in the - DOM, not in the HTML and XML syntaxes.

      +

      The DOM, the HTML syntax, and the XML syntax cannot all represent the same content. For example, namespaces cannot be represented using the HTML syntax, but they are supported in the DOM and in the XML syntax. Similarly, documents that use the noscript feature can be represented using the HTML syntax, but cannot be represented with the DOM or in the XML syntax. Comments that contain the string "-->" can only be represented in the DOM, not in the HTML and XML syntaxes.

      Structure of this specification

      @@ -472,35 +325,22 @@
      Non-normative materials providing a context for the HTML standard.
      Common infrastructure
      -
      The conformance classes, algorithms, definitions, and the common underpinnings of the rest of - the specification.
      +
      The conformance classes, algorithms, definitions, and the common underpinnings of the rest of the specification.
      Semantics, structure, and APIs of HTML documents
      -
      Documents are built from elements. These elements form a tree using the DOM. This section - defines the features of this DOM, as well as introducing the features common to all elements, and - the concepts used in defining elements.
      +
      Documents are built from elements. These elements form a tree using the DOM. This section defines the features of this DOM, as well as introducing the features common to all elements, and the concepts used in defining elements.
      The elements of HTML
      -
      Each element has a predefined meaning, which is explained in this section. Rules for authors - on how to use the element, along with user agent requirements for how to - handle each element, are also given. This includes large signature features of HTML such - as video playback and subtitles, form controls and form submission, and a 2D graphics API known - as the HTML canvas.
      +
      Each element has a predefined meaning, which is explained in this section. Rules for authors on how to use the element, along with user agent requirements for how to handle each element, are also given. This includes large signature features of HTML such as video playback and subtitles, form controls and form submission, and a 2D graphics API known as the HTML canvas.
      Microdata
      -
      This specification introduces a mechanism for adding machine-readable annotations to - documents, so that tools can extract trees of name-value pairs from the document. This section - describes this mechanism and some algorithms that can be used to convert HTML - documents into other formats. This section also defines some sample Microdata vocabularies - for contact information, calendar events, and licensing works.
      +
      This specification introduces a mechanism for adding machine-readable annotations to documents, so that tools can extract trees of name-value pairs from the document. This section describes this mechanism and some algorithms that can be used to convert HTML documents into other formats. This section also defines some sample Microdata vocabularies for contact information, calendar events, and licensing works.
      User interaction
      -
      HTML documents can provide a number of mechanisms for users to interact with and modify - content, which are described in this section, such as how focus works, and drag-and-drop.
      +
      HTML documents can provide a number of mechanisms for users to interact with and modify content, which are described in this section, such as how focus works, and drag-and-drop.
      Loading web pages
      -
      HTML documents do not exist in a vacuum — this section defines many of the features - that affect environments that deal with multiple pages, such as web browsers.
      +
      HTML documents do not exist in a vacuum — this section defines many of the features that affect environments that deal with multiple pages, such as web browsers.
      Web application APIs
      This section introduces basic features for scripting of applications in HTML.
      @@ -509,55 +349,36 @@
      This section defines an API for background threads in JavaScript.
      Worklets
      -
      This section defines infrastructure for APIs that need to run JavaScript separately from the - main JavaScript execution environment.
      +
      This section defines infrastructure for APIs that need to run JavaScript separately from the main JavaScript execution environment.
      The communication APIs
      -
      This section describes some mechanisms that applications written in HTML can use to - communicate with other applications from different domains running on the same client. It also - introduces a server-push event stream mechanism known as Server Sent Events or - EventSource, and a two-way full-duplex socket protocol for scripts known as Web - Sockets.
      +
      This section describes some mechanisms that applications written in HTML can use to communicate with other applications from different domains running on the same client. It also introduces a server-push event stream mechanism known as Server Sent Events or EventSource, and a two-way full-duplex socket protocol for scripts known as Web Sockets.
      Web storage
      This section defines a client-side storage mechanism based on name-value pairs.
      The HTML syntax
      The XML syntax
      -
      All of these features would be for naught if they couldn't be represented in a serialized - form and sent to other people, and so these sections define the syntaxes of HTML and XML, along with rules for how to parse content using those syntaxes.
      +
      All of these features would be for naught if they couldn't be represented in a serialized form and sent to other people, and so these sections define the syntaxes of HTML and XML, along with rules for how to parse content using those syntaxes.
      Rendering
      This section defines the default rendering rules for web browsers.
      -

      There are also some appendices, listing obsolete features and IANA considerations, and several indices.

      +

      There are also some appendices, listing obsolete features and IANA considerations, and several indices.

      How to read this specification

      -

      This specification should be read like all other specifications. First, it should be read - cover-to-cover, multiple times. Then, it should be read backwards at least once. Then it should be - read by picking random sections from the contents list and following all the cross-references.

      +

      This specification should be read like all other specifications. First, it should be read cover-to-cover, multiple times. Then, it should be read backwards at least once. Then it should be read by picking random sections from the contents list and following all the cross-references.

      -

      As described in the conformance requirements section below, this specification describes - conformance criteria for a variety of conformance classes. In particular, there are conformance - requirements that apply to producers, for example authors and the documents they create, - and there are conformance requirements that apply to consumers, for example web browsers. - They can be distinguished by what they are requiring: a requirement on a producer states what is - allowed, while a requirement on a consumer states how software is to act.

      +

      As described in the conformance requirements section below, this specification describes conformance criteria for a variety of conformance classes. In particular, there are conformance requirements that apply to producers, for example authors and the documents they create, and there are conformance requirements that apply to consumers, for example web browsers. They can be distinguished by what they are requiring: a requirement on a producer states what is allowed, while a requirement on a consumer states how software is to act.

      -

      For example, "the foo attribute's value must be a valid - integer" is a requirement on producers, as it lays out the allowed values; in contrast, - the requirement "the foo attribute's value must be parsed using the - rules for parsing integers" is a requirement on consumers, as it describes how to - process the content.

      +

      For example, "the foo attribute's value must be a valid integer" is a requirement on producers, as it lays out the allowed values; in contrast, the requirement "the foo attribute's value must be parsed using the rules for parsing integers" is a requirement on consumers, as it describes how to process the content.

      @@ -565,13 +386,7 @@
      -

      Continuing the above example, a requirement stating that a particular attribute's value is - constrained to being a valid integer emphatically does not imply anything - about the requirements on consumers. It might be that the consumers are in fact required to treat - the attribute as an opaque string, completely unaffected by whether the value conforms to the - requirements or not. It might be (as in the previous example) that the consumers are required to - parse the value using specific rules that define how invalid (non-numeric in this case) values - are to be processed.

      +

      Continuing the above example, a requirement stating that a particular attribute's value is constrained to being a valid integer emphatically does not imply anything about the requirements on consumers. It might be that the consumers are in fact required to treat the attribute as an opaque string, completely unaffected by whether the value conforms to the requirements or not. It might be (as in the previous example) that the consumers are required to parse the value using specific rules that define how invalid (non-numeric in this case) values are to be processed.

      @@ -604,24 +419,17 @@ interface Example {
      /* this is a CSS fragment */
      -

      The defining instance of a term is marked up like this. Uses of that - term are marked up like this or like this.

      +

      The defining instance of a term is marked up like this. Uses of that term are marked up like this or like this.

      -

      The defining instance of an element, attribute, or API is marked up like this. References to that element, attribute, or API are marked up - like this.

      +

      The defining instance of an element, attribute, or API is marked up like this. References to that element, attribute, or API are marked up like this.

      Other code fragments are marked up like this.

      Variables are marked up like this.

      -

      In an algorithm, steps in synchronous - sections are marked with ⌛.

      +

      In an algorithm, steps in synchronous sections are marked with ⌛.

      -

      In some cases, requirements are given in the form of lists with conditions and corresponding - requirements. In such cases, the requirements that apply to a condition are always the first set - of requirements that follow the condition, even in the case of there being multiple sets of - conditions for those requirements. Such cases are presented as follows:

      +

      In some cases, requirements are given in the form of lists with conditions and corresponding requirements. In such cases, the requirements that apply to a condition are always the first set of requirements that follow the condition, even in the case of there being multiple sets of conditions for those requirements. Such cases are presented as follows:

      @@ -654,36 +462,20 @@ interface Example { </body> </html> -

      HTML documents consist of a tree of elements and text. Each element is denoted in the source by - a start tag, such as "<body>", and - an end tag, such as "</body>". - (Certain start tags and end tags can in certain cases be omitted and are implied by other tags.)

      +

      HTML documents consist of a tree of elements and text. Each element is denoted in the source by a start tag, such as "<body>", and an end tag, such as "</body>". (Certain start tags and end tags can in certain cases be omitted and are implied by other tags.)

      -

      Tags have to be nested such that elements are all completely within each other, without - overlapping:

      +

      Tags have to be nested such that elements are all completely within each other, without overlapping:

      <p>This is <em>very <strong>wrong</em>!</strong></p>
      <p>This <em>is <strong>correct</strong>.</em></p>
      -

      This specification defines a set of elements that can be used in HTML, along with rules about - the ways in which the elements can be nested.

      +

      This specification defines a set of elements that can be used in HTML, along with rules about the ways in which the elements can be nested.

      -

      Elements can have attributes, which control how the elements work. In the example below, there - is a hyperlink, formed using the a element and its href attribute:

      +

      Elements can have attributes, which control how the elements work. In the example below, there is a hyperlink, formed using the a element and its href attribute:

      <a href="demo.html">simple</a>
      -

      Attributes are placed inside the start tag, and consist - of a name and a value, separated by an "=" character. - The attribute value can remain unquoted if it doesn't contain ASCII - whitespace or any of " ' ` = < or >. Otherwise, it has to be quoted using either single or double quotes. The - value, along with the "=" character, can be omitted altogether if the value - is the empty string.

      +

      Attributes are placed inside the start tag, and consist of a name and a value, separated by an "=" character. The attribute value can remain unquoted if it doesn't contain ASCII whitespace or any of " ' ` = < or >. Otherwise, it has to be quoted using either single or double quotes. The value, along with the "=" character, can be omitted altogether if the value is the empty string.

      <!-- empty attributes -->
       <input name=address disabled>
      @@ -694,40 +486,23 @@ interface Example {
       <input name=address maxlength='200'>
       <input name=address maxlength="200">
      -

      HTML user agents (e.g., web browsers) then parse this markup, turning it into a DOM - (Document Object Model) tree. A DOM tree is an in-memory representation of a document.

      +

      HTML user agents (e.g., web browsers) then parse this markup, turning it into a DOM (Document Object Model) tree. A DOM tree is an in-memory representation of a document.

      -

      DOM trees contain several kinds of nodes, in particular a DocumentType node, - Element nodes, Text nodes, Comment nodes, and in some cases - ProcessingInstruction nodes.

      +

      DOM trees contain several kinds of nodes, in particular a DocumentType node, Element nodes, Text nodes, Comment nodes, and in some cases ProcessingInstruction nodes.

      -

      The markup snippet at the top of this section would be - turned into the following DOM tree:

      +

      The markup snippet at the top of this section would be turned into the following DOM tree:

      • DOCTYPE: html
      • html lang="en"
        • head
          • #text: ⏎␣␣
          • title
            • #text: Sample page
          • #text: ⏎␣
        • #text: ⏎␣
        • body
          • #text: ⏎␣␣
          • h1
            • #text: Sample page
          • #text: ⏎␣␣
          • p
            • #text: This is a
            • a href="demo.html"
              • #text: simple
            • #text: sample.
          • #text: ⏎␣␣
          • #comment: this is a comment
          • #text: ⏎␣⏎
      -

      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 node between them.

      +

      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 node between them.

      -

      There are many more Text nodes in the DOM tree than one would initially expect, - because the source contains a number of spaces (represented here by "␣") and line breaks - ("⏎") that all end up as Text nodes in the DOM. However, for historical - reasons not all of the spaces and line breaks in the original markup appear in the DOM. In - particular, all the whitespace before head start tag ends up being dropped silently, - and all the whitespace after the body end tag ends up placed at the end of the - body.

      +

      There are many more Text nodes in the DOM tree than one would initially expect, because the source contains a number of spaces (represented here by "␣") and line breaks ("⏎") that all end up as Text nodes in the DOM. However, for historical reasons not all of the spaces and line breaks in the original markup appear in the DOM. In particular, all the whitespace before head start tag ends up being dropped silently, and all the whitespace after the body end tag ends up placed at the end of the body.

      -

      The head element contains a title element, which itself contains a - Text node with the text "Sample page". Similarly, the body element - contains an h1 element, a p element, and a comment.

      +

      The head element contains a title element, which itself contains a Text node with the text "Sample page". Similarly, the body element contains an h1 element, a p element, and a comment.


      -

      This DOM tree can be manipulated from scripts in the page. Scripts (typically in JavaScript) - are small programs that can be embedded using the script element or using event - handler content attributes. For example, here is a form with a script that sets the value - of the form's output element to say "Hello World":

      +

      This DOM tree can be manipulated from scripts in the page. Scripts (typically in JavaScript) are small programs that can be embedded using the script element or using event handler content attributes. For example, here is a form with a script that sets the value of the form's output element to say "Hello World":

      <form name="main">
        Result: <output name="result"></output>
      @@ -736,26 +511,18 @@ interface Example {
        </script>
       </form>
      -

      Each element in the DOM tree is represented by an object, and these objects have APIs so that - they can be manipulated. For instance, a link (e.g. the a element in the tree above) - can have its "href" attribute changed in several - ways:

      +

      Each element in the DOM tree is represented by an object, and these objects have APIs so that they can be manipulated. For instance, a link (e.g. the a element in the tree above) can have its "href" attribute changed in several ways:

      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
      -

      Since DOM trees are used as the way to represent HTML documents when they are processed and - presented by implementations (especially interactive implementations like web browsers), this - specification is mostly phrased in terms of DOM trees, instead of the markup described above.

      +

      Since DOM trees are used as the way to represent HTML documents when they are processed and presented by implementations (especially interactive implementations like web browsers), this specification is mostly phrased in terms of DOM trees, instead of the markup described above.


      -

      HTML documents represent a media-independent description of interactive content. HTML documents - might be rendered to a screen, or through a speech synthesizer, or on a braille display. To - influence exactly how such rendering takes place, authors can use a styling language such as - CSS.

      +

      HTML documents represent a media-independent description of interactive content. HTML documents might be rendered to a screen, or through a speech synthesizer, or on a braille display. To influence exactly how such rendering takes place, authors can use a styling language such as CSS.

      In the following example, the page has been made yellow-on-blue using CSS.

      @@ -773,10 +540,7 @@ a.setAttribute('href', 'https://example.com/'); // change the content attribute </body> </html> -

      For more details on how to use HTML, authors are encouraged to consult tutorials and guides. - Some of the examples included in this specification might also be of use, but the novice author is - cautioned that this specification, by necessity, defines the language with a level of detail that - might be difficult to understand at first.

      +

      For more details on how to use HTML, authors are encouraged to consult tutorials and guides. Some of the examples included in this specification might also be of use, but the novice author is cautioned that this specification, by necessity, defines the language with a level of detail that might be difficult to understand at first.

      @@ -784,16 +548,11 @@ a.setAttribute('href', 'https://example.com/'); // change the content attribute -

      When HTML is used to create interactive sites, care needs to be taken to avoid introducing - vulnerabilities through which attackers can compromise the integrity of the site itself or of the - site's users.

      +

      When HTML is used to create interactive sites, care needs to be taken to avoid introducing vulnerabilities through which attackers can compromise the integrity of the site itself or of the site's users.

      -

      A comprehensive study of this matter is beyond the scope of this document, and authors are - strongly encouraged to study the matter in more detail. However, this section attempts to provide - a quick introduction to some common pitfalls in HTML application development.

      +

      A comprehensive study of this matter is beyond the scope of this document, and authors are strongly encouraged to study the matter in more detail. However, this section attempts to provide a quick introduction to some common pitfalls in HTML application development.

      -

      The security model of the web is based on the concept of "origins", and correspondingly many of - the potential attacks on the web involve cross-origin actions. ORIGIN

      +

      The security model of the web is based on the concept of "origins", and correspondingly many of the potential attacks on the web involve cross-origin actions. ORIGIN

      Not validating user input
      @@ -801,24 +560,13 @@ a.setAttribute('href', 'https://example.com/'); // change the content attribute
      SQL injection
      -

      When accepting untrusted input, e.g. user-generated content such as text comments, values in - URL parameters, messages from third-party sites, etc, it is imperative that the data be - validated before use, and properly escaped when displayed. Failing to do this can allow a - hostile user to perform a variety of attacks, ranging from the potentially benign, such as - providing bogus user information like a negative age, to the serious, such as running scripts - every time a user looks at a page that includes the information, potentially propagating the - attack in the process, to the catastrophic, such as deleting all data in the server.

      +

      When accepting untrusted input, e.g. user-generated content such as text comments, values in URL parameters, messages from third-party sites, etc, it is imperative that the data be validated before use, and properly escaped when displayed. Failing to do this can allow a hostile user to perform a variety of attacks, ranging from the potentially benign, such as providing bogus user information like a negative age, to the serious, such as running scripts every time a user looks at a page that includes the information, potentially propagating the attack in the process, to the catastrophic, such as deleting all data in the server.

      -

      When writing filters to validate user input, it is imperative that filters always be - safelist-based, allowing known-safe constructs and disallowing all other input. Blocklist-based - filters that disallow known-bad inputs and allow everything else are not secure, as not - everything that is bad is yet known (for example, because it might be invented in the - future).

      +

      When writing filters to validate user input, it is imperative that filters always be safelist-based, allowing known-safe constructs and disallowing all other input. Blocklist-based filters that disallow known-bad inputs and allow everything else are not secure, as not everything that is bad is yet known (for example, because it might be invented in the future).

      -

      For example, suppose a page looked at its URL's query string to determine what to display, - and the site then redirected the user to that page to display a message, as in:

      +

      For example, suppose a page looked at its URL's query string to determine what to display, and the site then redirected the user to that page to display a message, as in:

      <ul>
        <li><a href="message.cgi?say=Hello">Say Hello</a>
      @@ -826,38 +574,24 @@ a.setAttribute('href', 'https://example.com/'); // change the content attribute
        <li><a href="message.cgi?say=Kittens">Say Kittens</a>
       </ul>
      -

      If the message was just displayed to the user without escaping, a hostile attacker could - then craft a URL that contained a script element:

      +

      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
      -

      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 actions, limited - only by what the site offers: if the site is an e-commerce shop, for instance, such a script - could cause the user to unknowingly make arbitrarily many unwanted purchases.

      +

      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 actions, limited only by what the site offers: if the site is an e-commerce shop, for instance, such a script could cause the user to unknowingly make arbitrarily many unwanted purchases.

      This is called a cross-site scripting attack.

      -

      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:

      +

      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, 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 historically implemented) others.
      • - -
      • Allowing a base element to be inserted means any script elements - in the page with relative links can be hijacked, and similarly that any form submissions can - get redirected to a hostile site.
      • +
      • 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 historically implemented) others.
      • + +
      • Allowing a base element to be inserted means any script elements in the page with relative links can be hijacked, and similarly that any form submissions can get redirected to a hostile site.
      @@ -865,15 +599,11 @@ a.setAttribute('href', 'https://example.com/'); // change the content attribute
      Cross-site request forgery (CSRF)
      -

      If a site allows a user to make form submissions with user-specific side-effects, for example - posting messages on a forum under the user's name, making purchases, or applying for a passport, - it is important to verify that the request was made by the user intentionally, rather than by - another site tricking the user into making the request unknowingly.

      +

      If a site allows a user to make form submissions with user-specific side-effects, for example posting messages on a forum under the user's name, making purchases, or applying for a passport, it is important to verify that the request was made by the user intentionally, rather than by another site tricking the user into making the request unknowingly.

      This problem exists because HTML forms can be submitted to other origins.

      -

      Sites can prevent such attacks by populating forms with user-specific hidden tokens, or by - checking `Origin` headers on all requests.

      +

      Sites can prevent such attacks by populating forms with user-specific hidden tokens, or by checking `Origin` headers on all requests.

      @@ -881,20 +611,11 @@ a.setAttribute('href', 'https://example.com/'); // change the content attribute
      Clickjacking
      -

      A page that provides users with an interface to perform actions that the user might not wish - to perform needs to be designed so as to avoid the possibility that users can be tricked into - activating the interface.

      +

      A page that provides users with an interface to perform actions that the user might not wish to perform needs to be designed so as to avoid the possibility that users can be tricked into activating the interface.

      -

      One way that a user could be so tricked is if a hostile site places the victim site in a - small iframe and then convinces the user to click, for instance by having the user - play a reaction game. Once the user is playing the game, the hostile site can quickly position - the iframe under the mouse cursor just as the user is about to click, thus tricking the user - into clicking the victim site's interface.

      +

      One way that a user could be so tricked is if a hostile site places the victim site in a small iframe and then convinces the user to click, for instance by having the user play a reaction game. Once the user is playing the game, the hostile site can quickly position the iframe under the mouse cursor just as the user is about to click, thus tricking the user into clicking the victim site's interface.

      -

      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 top - attribute).

      +

      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 top attribute).

      @@ -903,33 +624,21 @@ a.setAttribute('href', 'https://example.com/'); // change the content attribute -

      Scripts in HTML have "run-to-completion" semantics, meaning that the browser will generally run - the script uninterrupted before doing anything else, such as firing further events or continuing - to parse the document.

      +

      Scripts in HTML have "run-to-completion" semantics, meaning that the browser will generally run 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 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 mentioned earlier, scripts are run to completion before further events can - fire.

      +

      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 mentioned earlier, scripts are run to completion before further events can fire.

      -

      One way this could manifest itself is with img elements and the load event. The event could fire as soon as the element has been - parsed, especially if the image has already been cached (which is common).

      +

      One way this could manifest itself is with img elements and the load event. The event could fire as soon as the element has been parsed, especially if the image has already been cached (which is common).

      -

      Here, the author uses the onload handler on an - img element to catch the load event:

      +

      Here, the author uses the onload handler on an img element to catch the load event:

      <img src="games.png" alt="Games" onload="gamesLogoHasLoaded(event)">
      -

      If the element is being added by script, then so long as the event handlers are added in the - same script, the event will still not be missed:

      +

      If the element is being added by script, then so long as the event handlers are added in the same script, the event will still not be missed:

      <script>
        var img = new Image();
      @@ -939,9 +648,7 @@ a.setAttribute('href', 'https://example.com/'); // change the content attribute
        // img.addEventListener('load', gamesLogoHasLoaded, false); // would work also
       </script>
      -

      However, if the author first created the img element and then in a separate - script added the event listeners, there's a chance that the load - event would be fired in between, leading it to be missed:

      +

      However, if the author first created the img element and then in a separate script added the event listeners, there's a chance that the load event would be fired in between, leading it to be missed:

      <!-- Do not use this style, it has a race condition! -->
        <img id="games" src="games.png" alt="Games">
      @@ -960,9 +667,7 @@ a.setAttribute('href', 'https://example.com/'); // change the content attribute
       
         
       
      -  

      Authors are encouraged to make use of conformance checkers (also known as validators) to - catch common mistakes. The WHATWG maintains a list of such tools at: https://whatwg.org/validator/

      +

      Authors are encouraged to make use of conformance checkers (also known as validators) to catch common mistakes. The WHATWG maintains a list of such tools at: https://whatwg.org/validator/

      @@ -970,76 +675,46 @@ a.setAttribute('href', 'https://example.com/'); // change the content attribute -

      Unlike previous versions of the HTML specification, this specification defines in some detail - the required processing for invalid documents as well as valid documents.

      +

      Unlike previous versions of the HTML specification, this specification defines in some detail the required processing for invalid documents as well as valid documents.

      -

      However, even though the processing of invalid content is in most cases well-defined, - conformance requirements for documents are still important: in practice, interoperability (the - situation in which all implementations process particular content in a reliable and identical or - equivalent way) is not the only goal of document conformance requirements. This section details - some of the more common reasons for still distinguishing between a conforming document and one - with errors.

      +

      However, even though the processing of invalid content is in most cases well-defined, conformance requirements for documents are still important: in practice, interoperability (the situation in which all implementations process particular content in a reliable and identical or equivalent way) is not the only goal of document conformance requirements. This section details some of the more common reasons for still distinguishing between a conforming document and one with errors.

      Presentational markup

      -

      The majority of presentational features from previous versions of HTML are no longer allowed. - Presentational markup in general has been found to have a number of problems:

      +

      The majority of presentational features from previous versions of HTML are no longer allowed. Presentational markup in general has been found to have a number of problems:

      The use of presentational elements leads to poorer accessibility
      -

      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, even using - such techniques doesn't help make pages accessible for non-AT non-graphical users, such as users - of text-mode browsers.

      +

      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, 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 work for more users (e.g. users of text browsers).

      +

      Using media-independent markup, on the other hand, provides an easy way for documents to be authored in such a way that they work for more users (e.g. users of text browsers).

      Higher cost of maintenance
      -

      It is significantly easier to maintain a site written in such a way that the markup is - style-independent. For example, changing the color of a site that uses <font color=""> throughout requires changes across the entire site, - whereas a similar change to a site based on CSS can be done by changing a single file.

      +

      It is significantly easier to maintain a site written in such a way that the markup is style-independent. For example, changing the color of a site that uses <font color=""> throughout requires changes across the entire site, whereas a similar change to a site based on CSS can be done by changing a single file.

      Larger document sizes
      -

      Presentational markup tends to be much more redundant, and thus results in larger document - sizes.

      +

      Presentational markup tends to be much more redundant, and thus results in larger document sizes.

      -

      For those reasons, presentational markup has been removed from HTML in this version. This - change should not come as a surprise; HTML4 deprecated presentational markup many years ago and - provided a mode (HTML4 Transitional) to help authors move away from presentational markup; later, - XHTML 1.1 went further and obsoleted those features altogether.

      +

      For those reasons, presentational markup has been removed from HTML in this version. This change should not come as a surprise; HTML4 deprecated presentational markup many years ago and provided a mode (HTML4 Transitional) to help authors move away from presentational markup; later, XHTML 1.1 went further and obsoleted those features altogether.

      -

      The only remaining presentational markup features in HTML are the style attribute and the style element. Use of the style attribute is somewhat discouraged in 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 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.

      +

      The only remaining presentational markup features in HTML are the style attribute and the style element. Use of the style attribute is somewhat discouraged in 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 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 - redefined in this specification to be media-independent: b, i, - hr, s, small, and u.

      +

      It is also worth noting that some elements that were previously presentational have been redefined in this specification to be media-independent: b, i, hr, s, small, and u.

      Syntax errors

      @@ -1052,13 +727,11 @@ a.setAttribute('href', 'https://example.com/'); // change the content attribute
      Unintuitive error-handling behavior
      -

      Certain invalid syntax constructs, when parsed, result in DOM trees that are highly - unintuitive.

      +

      Certain invalid syntax constructs, when parsed, result in DOM trees that are highly unintuitive.

      -

      For example, the following markup fragment results in a DOM with an hr element - that is an earlier sibling of the corresponding table element:

      +

      For example, the following markup fragment results in a DOM with an hr element that is an earlier sibling of the corresponding table element:

      <table><hr>...
      @@ -1069,46 +742,32 @@ a.setAttribute('href', 'https://example.com/'); // change the content attribute
      Errors with optional error recovery
      -

      To allow user agents to be used in controlled environments without having to implement the - more bizarre and convoluted error handling rules, user agents are permitted to fail whenever - encountering a parse error.

      +

      To allow user agents to be used in controlled environments without having to implement the more bizarre and convoluted error handling rules, user agents are permitted to fail whenever encountering a parse error.

      Errors where the error-handling behavior is not compatible with streaming user agents
      -

      Some error-handling behavior, such as the behavior for the <table><hr>... example mentioned above, are incompatible with streaming - user agents (user agents that process HTML files in one pass, without storing state). To avoid - interoperability problems with such user agents, any syntax resulting in such behavior is - considered invalid.

      +

      Some error-handling behavior, such as the behavior for the <table><hr>... example mentioned above, are incompatible with streaming user agents (user agents that process HTML files in one pass, without storing state). To avoid interoperability problems with such 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 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.)

      +

      When a user agent based on XML is connected to an HTML parser, it is possible that certain 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.

      +

      Certain syntax constructs can result in disproportionately poor performance. To discourage the use of such constructs, they are typically made non-conforming.

      -

      For example, the following markup results in poor performance, since all the unclosed - i elements have to be reconstructed in each paragraph, resulting in progressively - more elements in each paragraph:

      +

      For example, the following markup results in poor performance, since all the unclosed i elements have to be reconstructed in each paragraph, resulting in progressively more elements in each paragraph:

      <p><i>She dreamt.
       <p><i>She dreamt that she ate breakfast.
      @@ -1126,35 +785,23 @@ a.setAttribute('href', 'https://example.com/'); // change the content attribute
          
      Errors involving fragile syntax constructs
      -

      There are syntax constructs that, for historical reasons, are relatively fragile. To help - reduce the number of users who accidentally run into such problems, they are made - non-conforming.

      +

      There are syntax constructs that, for historical reasons, are relatively fragile. To help reduce the number of users who accidentally run into such problems, they are made non-conforming.

      -

      For example, the parsing of certain named character references in attributes happens even - with the closing semicolon being omitted. It is safe to include an ampersand followed by - letters that do not form a named character reference, but if the letters are changed to a - string that does form a named character reference, they will be interpreted as that - character instead.

      +

      For example, the parsing of certain named character references in attributes happens even with the closing semicolon being omitted. It is safe to include an ampersand followed by letters that do not form a named character reference, but if the letters are changed to a string that does form a named character reference, they will be interpreted as that character instead.

      In this fragment, the attribute's value is "?bill&ted":

      <a href="?bill&ted">Bill and Ted</a>
      -

      In the following fragment, however, the attribute's value is actually "?art©", not the intended "?art&copy", - because even without the final semicolon, "&copy" is handled the same - as "&copy;" and thus gets interpreted as "©":

      +

      In the following fragment, however, the attribute's value is actually "?art©", not the intended "?art&copy", because even without the final semicolon, "&copy" is handled the same as "&copy;" and thus gets interpreted as "©":

      <a href="?art&copy">Art and Copy</a>
      -

      To avoid this problem, all named character references are required to end with a semicolon, - and uses of named character references without a semicolon are flagged as errors.

      +

      To avoid this problem, all named character references are required to end with a semicolon, and uses of named character references without a semicolon are flagged as errors.

      -

      Thus, the correct way to express the above cases is as - follows:

      +

      Thus, the correct way to express the above cases is as follows:

      <a href="?bill&ted">Bill and Ted</a> <!-- &ted is ok, since it's not a named character reference -->
      <a href="?art&amp;copy">Art and Copy</a> <!-- the & has to be escaped, since &copy is a named character reference -->
      @@ -1166,22 +813,17 @@ a.setAttribute('href', 'https://example.com/'); // change the content attribute
      Errors involving known interoperability problems in legacy user agents
      -

      Certain syntax constructs are known to cause especially subtle or serious problems in legacy - user agents, and are therefore marked as non-conforming to help authors avoid them.

      +

      Certain syntax constructs are known to cause especially subtle or serious problems in legacy user agents, and are therefore marked as non-conforming to help authors avoid them.

      -

      For example, this is why the U+0060 GRAVE ACCENT character (`) is not allowed in unquoted - attributes. In certain legacy user agents, it is sometimes treated as a - quote character.

      +

      For example, this is why the U+0060 GRAVE ACCENT character (`) is not allowed in unquoted attributes. In certain legacy user agents, it is sometimes treated as a quote character.

      -

      Another example of this is the DOCTYPE, which is required to trigger no-quirks - mode, because the behavior of legacy user agents in quirks mode is often - largely undocumented.

      +

      Another example of this is the DOCTYPE, which is required to trigger no-quirks mode, because the behavior of legacy user agents in quirks mode is often largely undocumented.

      @@ -1194,8 +836,7 @@ a.setAttribute('href', 'https://example.com/'); // change the content attribute
      -

      For example, the restriction on using UTF-7 exists purely to avoid authors falling prey to a - known cross-site-scripting attack using UTF-7. UTF7

      +

      For example, the restriction on using UTF-7 exists purely to avoid authors falling prey to a known cross-site-scripting attack using UTF-7. UTF7

      @@ -1204,13 +845,11 @@ a.setAttribute('href', 'https://example.com/'); // change the content attribute
      Cases where the author's intent is unclear
      -

      Markup where the author's intent is very unclear is often made non-conforming. Correcting - these errors early makes later maintenance easier.

      +

      Markup where the author's intent is very unclear is often made non-conforming. Correcting these errors early makes later maintenance easier.

      -

      For example, it is unclear whether the author intended the following to be an - h1 heading or an h2 heading:

      +

      For example, it is unclear whether the author intended the following to be an h1 heading or an h2 heading:

      <h1>Contact details</h2>
      @@ -1221,16 +860,11 @@ a.setAttribute('href', 'https://example.com/'); // change the content attribute
      Cases that are likely to be typos
      -

      When a user makes a simple typo, it is helpful if the error can be caught early, as this can - save the author a lot of debugging time. This specification therefore usually considers it an - error to use element names, attribute names, and so forth, that do not match the names defined - in this specification.

      +

      When a user makes a simple typo, it is helpful if the error can be caught early, as this can save the author a lot of debugging time. This specification therefore usually considers it an error to use element names, attribute names, and so forth, that do not match the names defined in this specification.

      -

      For example, if the author typed <capton> instead of <caption>, this would be flagged as an error and the author could correct - the typo immediately.

      +

      For example, if the author typed <capton> instead of <caption>, this would be flagged as an error and the author could correct the typo immediately.

      @@ -1239,24 +873,17 @@ a.setAttribute('href', 'https://example.com/'); // change the content attribute
      Errors that could interfere with new syntax in the future
      -

      In order to allow the language syntax to be extended in the future, certain otherwise - harmless features are disallowed.

      +

      In order to allow the language syntax to be extended in the future, certain otherwise harmless features are disallowed.

      -

      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.

      +

      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.

      -

      Some authors find it helpful to be in the practice of always quoting all attributes and always - including all optional tags, preferring the consistency derived from such custom over the minor - benefits of terseness afforded by making use of the flexibility of the HTML syntax. To aid such - authors, conformance checkers can provide modes of operation wherein such conventions are - enforced.

      +

      Some authors find it helpful to be in the practice of always quoting all attributes and always including all optional tags, preferring the consistency derived from such custom over the minor benefits of terseness afforded by making use of the flexibility of the HTML syntax. To aid such authors, conformance checkers can provide modes of operation wherein such conventions are enforced.

      @@ -1264,81 +891,54 @@ a.setAttribute('href', 'https://example.com/'); // change the content attribute -

      Beyond the syntax of the language, this specification also places restrictions on how elements - and attributes can be specified. These restrictions are present for similar reasons:

      +

      Beyond the syntax of the language, this specification also places restrictions on how elements and attributes can be specified. These restrictions are present for similar reasons:

      Errors involving content with dubious semantics
      -

      To avoid misuse of elements with defined meanings, content models are defined that restrict - how elements can be nested when such nestings would be of dubious value.

      +

      To avoid misuse of elements with defined meanings, content models are defined that restrict how elements can be nested when such nestings would be of dubious value.

      -

      For example, this specification disallows nesting a section - element inside a kbd element, since it is highly unlikely for an author to indicate - that an entire section should be keyed in.

      +

      For example, this specification disallows nesting a section element inside a kbd element, since it is highly unlikely for an author to indicate that an entire section should be keyed in.

      Errors that involve a conflict in expressed semantics
      -

      Similarly, to draw the author's attention to mistakes in the use of elements, clear - contradictions in the semantics expressed are also considered conformance errors.

      +

      Similarly, to draw the author's attention to mistakes in the use of elements, clear contradictions in the semantics expressed are also considered conformance errors.

      -

      In the fragments below, for example, the semantics are nonsensical: a separator cannot - simultaneously be a cell, nor can a radio button be a progress bar.

      +

      In the fragments below, for example, the semantics are nonsensical: a separator cannot simultaneously be a cell, nor can a radio button be a progress bar.

      <hr role="cell">
      <input type=radio role=progressbar>
      -

      Another example is the restrictions on the content models of the - ul element, which only allows li element children. Lists by definition - consist just of zero or more list items, so if a ul element contains something - other than an li element, it's not clear what was meant.

      +

      Another example is the restrictions on the content models of the ul element, which only allows li element children. Lists by definition consist just of zero or more list items, so if a ul element contains something other than an li element, it's not clear what was meant.

      Cases where the default styles are likely to lead to confusion
      -

      Certain elements have default styles or behaviors that make certain combinations likely to - lead to confusion. Where these have equivalent alternatives without this problem, the confusing - combinations are disallowed.

      +

      Certain elements have default styles or behaviors that make certain combinations likely to lead to confusion. Where these have equivalent alternatives without this problem, the 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 inline box, the latter combination is 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 inline box, the latter combination is disallowed.

      -

      Another example would be the way interactive content cannot be - nested. For example, a button element cannot contain a textarea - element. This is because the default behavior of such nesting interactive elements would be - highly confusing to users. Instead of nesting these elements, they can be placed side by - side.

      +

      Another example would be the way interactive content cannot be nested. For example, a button element cannot contain a textarea element. This is because the default behavior of such nesting interactive elements would be highly confusing to users. Instead of nesting these elements, they can be placed side by side.

      Errors that indicate a likely misunderstanding of the specification
      -

      Sometimes, something is disallowed because allowing it would likely cause author - confusion.

      +

      Sometimes, something is disallowed because allowing it would likely cause author confusion.

      -

      For example, setting the disabled - attribute to the value "false" is disallowed, because despite the - appearance of meaning that the element is enabled, it in fact means that the element is - disabled (what matters for implementations is the presence of the attribute, not its - value).

      +

      For example, setting the disabled attribute to the value "false" is disallowed, because despite the appearance of meaning that the element is enabled, it in fact means that the element is disabled (what matters for implementations is the presence of the attribute, not its value).

      @@ -1347,29 +947,18 @@ a.setAttribute('href', 'https://example.com/'); // change the content attribute

      Some conformance errors simplify the language that authors need to learn.

      -

      For example, the area element's shape attribute, despite accepting both circ and circle values in practice as synonyms, disallows - the use of the circ value, so as to simplify - tutorials and other learning aids. There would be no benefit to allowing both, but it would - cause extra confusion when teaching the language.

      +

      For example, the area element's shape attribute, despite accepting both circ and circle values in practice as synonyms, disallows the use of the circ value, so as to simplify tutorials and other learning aids. There would be no benefit to allowing both, but it would cause extra confusion when teaching the language.

      Errors that involve peculiarities of the parser
      -

      Certain elements are parsed in somewhat eccentric ways (typically for historical reasons), - and their content model restrictions are intended to avoid exposing the author to these - issues.

      +

      Certain elements are parsed in somewhat eccentric ways (typically for historical reasons), and their content model restrictions are intended to avoid exposing the author to these issues.

      -

      For example, a form element isn't allowed inside phrasing content, - because when parsed as HTML, a form element's start tag will imply a - p element's end tag. Thus, the following markup results in two paragraphs, not one:

      +

      For example, a form element isn't allowed inside phrasing content, because when parsed as HTML, a form element's start tag will imply a p element's end tag. Thus, the following markup results in two paragraphs, not one:

      <p>Welcome. <form><label>Name:</label> <input></form>
      @@ -1386,75 +975,45 @@ a.setAttribute('href', 'https://example.com/'); // change the content attribute

      Some errors are intended to help prevent script problems that would be hard to debug.

      -

      This is why, for instance, it is non-conforming to have two id attributes with the same value. Duplicate IDs lead to the wrong - element being selected, with sometimes disastrous effects whose cause is hard to determine.

      +

      This is why, for instance, it is non-conforming to have two id attributes with the same value. Duplicate IDs lead to the wrong element being selected, with sometimes disastrous effects whose cause is hard to determine.

      Errors that waste authoring time
      -

      Some constructs are disallowed because historically they have been the cause of a lot of - wasted authoring time, and by encouraging authors to avoid making them, authors can save time in - future efforts.

      +

      Some constructs are disallowed because historically they have been the cause of a lot of wasted authoring time, and by encouraging authors to avoid making them, authors can save time in future efforts.

      -

      For example, a script element's src attribute causes the element's contents to be ignored. - However, this isn't obvious, especially if the element's contents appear to be executable script - — which can lead to authors spending a lot of time trying to debug the inline script - without realizing that it is not executing. To reduce this problem, this specification makes it - non-conforming to have executable script in a script element when the src attribute is present. This means that authors who are - validating their documents are less likely to waste time with this kind of mistake.

      +

      For example, a script element's src attribute causes the element's contents to be ignored. However, this isn't obvious, especially if the element's contents appear to be executable script — which can lead to authors spending a lot of time trying to debug the inline script without realizing that it is not executing. To reduce this problem, this specification makes it non-conforming to have executable script in a script element when the src attribute is present. This means that authors who are validating their documents are less likely to waste time with this kind of mistake.

      -
      Errors that involve areas that affect authors migrating between the HTML and XML - syntaxes
      +
      Errors that involve areas that affect authors migrating between the HTML and XML syntaxes
      -

      Some authors like to write files that can be interpreted as both XML and HTML with similar - results. Though this practice is discouraged in general due to the myriad of subtle - complications involved (especially when involving scripting, styling, or any kind of automated - serialization), this specification has a few restrictions intended to at least somewhat mitigate - the difficulties. This makes it easier for authors to use this as a transitionary step when - migrating between the HTML and XML syntaxes.

      +

      Some authors like to write files that can be interpreted as both XML and HTML with similar results. Though this practice is discouraged in general due to the myriad of subtle complications involved (especially when involving scripting, styling, or any kind of automated serialization), this specification has a few restrictions intended to at least somewhat mitigate the difficulties. This makes it easier for authors to use this as a transitionary step when migrating between the HTML and XML syntaxes.

      -

      For example, there are somewhat complicated rules surrounding the lang and xml:lang attributes - intended to keep the two synchronized.

      +

      For example, there are somewhat complicated rules surrounding the lang and xml:lang attributes intended to keep the two synchronized.

      -

      Another example would be the restrictions on the values of xmlns attributes in the HTML serialization, which are intended to ensure that - elements in conforming documents end up in the same namespaces whether processed as HTML or - XML.

      +

      Another example would be the restrictions on the values of xmlns attributes in the HTML serialization, which are intended to ensure that elements in conforming documents end up in the same namespaces whether processed as HTML or XML.

      Errors that involve areas reserved for future expansion
      -

      As with the restrictions on the syntax intended to allow for new syntax in future revisions - of the language, some restrictions on the content models of elements and values of attributes - are intended to allow for future expansion of the HTML vocabulary.

      +

      As with the restrictions on the syntax intended to allow for new syntax in future revisions of the language, some restrictions on the content models of elements and values of attributes are intended to allow for future expansion of the HTML vocabulary.

      -

      For example, limiting the values of the target attribute that start with an U+005F LOW LINE - character (_) to only specific predefined values allows new predefined values to be introduced - at a future time without conflicting with author-defined values.

      +

      For example, limiting the values of the target attribute that start with an U+005F LOW LINE character (_) to only specific predefined values allows new predefined values to be introduced at a future time without conflicting with author-defined values.

      Errors that indicate a mis-use of other specifications
      -

      Certain restrictions are intended to support the restrictions made by other - specifications.

      +

      Certain restrictions are intended to support the restrictions made by other specifications.

      -

      For example, requiring that attributes that take media query lists use only - valid media query lists reinforces the importance of following the conformance rules of - that specification.

      +

      For example, requiring that attributes that take media query lists use only valid media query lists reinforces the importance of following the conformance rules of that specification.

      @@ -1469,49 +1028,23 @@ a.setAttribute('href', 'https://example.com/'); // change the content attribute
      Character Model for the World Wide Web 1.0: Fundamentals CHARMOD
      -

      This Architectural Specification provides authors of specifications, software - developers, and content developers with a common reference for interoperable text manipulation on - the World Wide Web, building on the Universal Character Set, defined jointly by the Unicode - Standard and ISO/IEC 10646. Topics addressed include use of the terms 'character', 'encoding' and - 'string', a reference processing model, choice and identification of character encodings, - character escaping, and string indexing.

      +

      This Architectural Specification provides authors of specifications, software developers, and content developers with a common reference for interoperable text manipulation on the World Wide Web, building on the Universal Character Set, defined jointly by the Unicode Standard and ISO/IEC 10646. Topics addressed include use of the terms 'character', 'encoding' and 'string', a reference processing model, choice and identification of character encodings, character escaping, and string indexing.

      Unicode Security Considerations UTR36
      -

      Because Unicode contains such a large number of characters and incorporates - the varied writing systems of the world, incorrect usage can expose programs or systems to - possible security attacks. This is especially important as more and more products are - internationalized. This document describes some of the security considerations that programmers, - system analysts, standards developers, and users should take into account, and provides specific - recommendations to reduce the risk of problems.

      +

      Because Unicode contains such a large number of characters and incorporates the varied writing systems of the world, incorrect usage can expose programs or systems to possible security attacks. This is especially important as more and more products are internationalized. This document describes some of the security considerations that programmers, system analysts, standards developers, and users should take into account, and provides specific recommendations to reduce the risk of problems.

      Web Content Accessibility Guidelines (WCAG) WCAG
      -

      Web Content Accessibility Guidelines (WCAG) covers a wide range of - recommendations for making web content more accessible. Following these guidelines will make - content accessible to a wider range of people with disabilities, including blindness and low - vision, deafness and hearing loss, learning disabilities, cognitive limitations, limited - movement, speech disabilities, photosensitivity and combinations of these. Following these - guidelines will also often make your web content more usable to users in - general.

      +

      Web Content Accessibility Guidelines (WCAG) covers a wide range of recommendations for making web content more accessible. Following these guidelines will make content accessible to a wider range of people with disabilities, including blindness and low vision, deafness and hearing loss, learning disabilities, cognitive limitations, limited movement, speech disabilities, photosensitivity and combinations of these. Following these guidelines will also often make your web content more usable to users in general.

      Authoring Tool Accessibility Guidelines (ATAG) 2.0 ATAG
      -

      This specification provides guidelines for designing web content - authoring tools that are more accessible for people with disabilities. An authoring tool that - conforms to these guidelines will promote accessibility by providing an accessible user interface - to authors with disabilities as well as by enabling, supporting, and promoting the production of - accessible web content by all authors.

      +

      This specification provides guidelines for designing web content authoring tools that are more accessible for people with disabilities. An authoring tool that conforms to these guidelines will promote accessibility by providing an accessible user interface to authors with disabilities as well as by enabling, supporting, and promoting the production of accessible web content by all authors.

      User Agent Accessibility Guidelines (UAAG) 2.0 UAAG
      -

      This document provides guidelines for designing user agents that - lower barriers to web accessibility for people with disabilities. User agents include browsers - and other types of software that retrieve and render web content. A user agent that conforms to - these guidelines will promote accessibility through its own user interface and through other - internal facilities, including its ability to communicate with other technologies (especially - assistive technologies). Furthermore, all users, not just users with disabilities, should find - conforming user agents to be more usable.

      +

      This document provides guidelines for designing user agents that lower barriers to web accessibility for people with disabilities. User agents include browsers and other types of software that retrieve and render web content. A user agent that conforms to these guidelines will promote accessibility through its own user interface and through other internal facilities, including its ability to communicate with other technologies (especially assistive technologies). Furthermore, all users, not just users with disabilities, should find conforming user agents to be more usable.

      @@ -1522,76 +1055,41 @@ a.setAttribute('href', 'https://example.com/'); // change the content attribute

      Terminology

      -

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

      - -

      Generally, when the specification states that a feature applies to the HTML syntax - or the XML 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 XML)".

      - -

      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 the XML syntax, depending - on context.

      - -

      In the context of the DOM structures, the terms HTML - document and XML document are used as defined in - DOM, 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.

      +

      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 XML 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 XML)".

      + +

      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 the XML syntax, depending on context.

      + +

      In the context of the DOM structures, the terms HTML document and XML document are used as defined in DOM, 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.


      -

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

      +

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

      Parallelism

      -

      To run steps in parallel means those steps are to be run, one after another, - at the same time as other logic in the standard (e.g., at the same time as the event - loop). This standard does not define the precise mechanism by which this is achieved, be it - time-sharing cooperative multitasking, fibers, threads, processes, using different hyperthreads, - cores, CPUs, machines, etc. By contrast, an operation that is to run immediately must - interrupt the currently running task, run itself, and then resume the previously running task.

      +

      To run steps in parallel means those steps are to be run, one after another, at the same time as other logic in the standard (e.g., at the same time as the event loop). This standard does not define the precise mechanism by which this is achieved, be it time-sharing cooperative multitasking, fibers, threads, processes, using different hyperthreads, cores, CPUs, machines, etc. By contrast, an operation that is to run immediately must interrupt the currently running task, run itself, and then resume the previously running task.

      -

      For guidance on writing specifications that leverage parallelism, see Dealing with the event loop from other specifications.

      +

      For guidance on writing specifications that leverage parallelism, see Dealing with the event loop from other specifications.

      -

      To avoid race conditions between different in parallel algorithms that operate on - the same data, a parallel queue can be used.

      +

      To avoid race conditions between different in parallel algorithms that operate on the same data, a parallel queue can be used.

      -

      A parallel queue represents a queue of algorithm steps that must be run in - series.

      +

      A parallel queue represents a queue of algorithm steps that must be run in series.

      -

      A parallel queue has an algorithm queue (a queue), - initially empty.

      +

      A parallel queue has an algorithm queue (a queue), initially empty.

      -

      To enqueue steps to a parallel queue, - enqueue the algorithm steps to the parallel queue's algorithm - queue.

      +

      To enqueue steps to a parallel queue, enqueue the algorithm steps to the parallel queue's algorithm queue.

      -

      To start a new parallel queue, run the following steps:

      +

      To start a new parallel queue, run the following steps:

      1. Let parallelQueue be a new parallel queue.

      2. @@ -1604,18 +1102,14 @@ a.setAttribute('href', 'https://example.com/'); // change the content attribute

        While true:

          -
        1. Let steps be the result of dequeuing from - parallelQueue's algorithm queue.

        2. +
        3. Let steps be the result of dequeuing from parallelQueue's algorithm queue.

        4. If steps is not nothing, then run steps.

        5. -
        6. Assert: running steps did not throw an exception, as steps - running in parallel are not allowed to throw.

        7. +
        8. Assert: running steps did not throw an exception, as steps running in parallel are not allowed to throw.

        -

        Implementations are not expected to implement this as a continuously running - loop. Algorithms in standards are to be easy to understand and are not necessarily great for - battery life or performance.

        +

        Implementations are not expected to implement this as a continuously running loop. Algorithms in standards are to be easy to understand and are not necessarily great for battery life or performance.

      @@ -1624,41 +1118,30 @@ a.setAttribute('href', 'https://example.com/'); // change the content attribute
    -

    Steps running in parallel can themselves run other steps in in - parallel. E.g., inside a parallel queue it can be useful to run a series of - steps in parallel with the queue.

    +

    Steps running in parallel can themselves run other steps in in parallel. E.g., inside a parallel queue it can be useful to run a series of steps in parallel with the queue.

    -

    Imagine a standard defined nameList (a list), along with a method to - add a name to nameList, unless nameList already contains name, in which case it rejects.

    +

    Imagine a standard defined nameList (a list), along with a method to add a name to nameList, unless nameList already contains name, in which case it rejects.

    The following solution suffers from race conditions:

      -
    1. Let p be a new promise created in this's relevant realm.

    2. +
    3. Let p be a new promise created in this's relevant realm.

    4. -
    5. Let global be this's relevant global - object.

    6. +
    7. Let global be this's relevant global object.

    8. Run the following steps in parallel:

        -
      1. If nameList contains name, - then queue a global task on the DOM manipulation task source given - global to reject p with a TypeError, and abort these - steps.

      2. +
      3. If nameList contains name, then queue a global task on the DOM manipulation task source given global to reject p with a TypeError, and abort these steps.

      4. Do some potentially lengthy work.

      5. -
      6. Append name to - nameList.

      7. +
      8. Append name to nameList.

      9. -
      10. Queue a global task on the DOM manipulation task source given - global to resolve p with undefined.

      11. +
      12. Queue a global task on the DOM manipulation task source given global to resolve p with undefined.

    9. @@ -1666,37 +1149,27 @@ a.setAttribute('href', 'https://example.com/'); // change the content attribute
    -

    Two invocations of the above could run simultaneously, meaning name isn't in - nameList during step 3.1, but it might be added before step 3.3 runs, - meaning name ends up in nameList twice.

    +

    Two invocations of the above could run simultaneously, meaning name isn't in nameList during step 3.1, but it might be added before step 3.3 runs, meaning name ends up in nameList twice.

    -

    Parallel queues solve this. The standard would let nameListQueue be the result of - starting a new parallel queue, then:

    +

    Parallel queues solve this. The standard would let nameListQueue be the result of starting a new parallel queue, then:

      -
    1. Let p be a new promise created in this's relevant realm.

    2. +
    3. Let p be a new promise created in this's relevant realm.

    4. -
    5. Let global be this's relevant global - object.

    6. +
    7. Let global be this's relevant global object.

    8. Enqueue the following steps to nameListQueue:

        -
      1. If nameList contains name, - then queue a global task on the DOM manipulation task source given - global to reject p with a TypeError, and abort these - steps.

      2. +
      3. If nameList contains name, then queue a global task on the DOM manipulation task source given global to reject p with a TypeError, and abort these steps.

      4. Do some potentially lengthy work.

      5. -
      6. Append name to - nameList.

      7. +
      8. Append name to nameList.

      9. -
      10. Queue a global task on the DOM manipulation task source given - global to resolve p with undefined.

      11. +
      12. Queue a global task on the DOM manipulation task source given global to resolve p with undefined.

    9. @@ -1712,274 +1185,143 @@ a.setAttribute('href', 'https://example.com/'); // change the content attribute

      Resources

      -

      The specification uses the term supported when referring to whether a user - agent has an implementation capable of decoding the semantics of an external resource. A format or - type is said to be supported if the implementation can process an external resource of that - format or type without critical aspects of the resource being ignored. Whether a specific resource - is supported can depend on what features of the resource's format are in use.

      +

      The specification uses the term supported when referring to whether a user agent has an implementation capable of decoding the semantics of an external resource. A format or type is said to be supported if the implementation can process an external resource of that format or type without critical aspects of the resource being ignored. Whether a specific resource is supported can depend on what features of the resource's format are in use.

      -

      For example, a PNG image would be considered to be in a supported format if its - pixel data could be decoded and rendered, even if, unbeknownst to the implementation, the image - also contained animation data.

      +

      For example, a PNG image would be considered to be in a supported format if its pixel data could be decoded and rendered, even if, unbeknownst to the implementation, the image also contained animation data.

      -

      An MPEG-4 video file would not be considered to be in a supported format if the - compression format used was not supported, even if the implementation could determine the - dimensions of the movie from the file's metadata.

      +

      An MPEG-4 video file would not be considered to be in a supported format if the compression format used was not supported, even if the implementation could determine the dimensions of the movie from the file's metadata.

      -

      What some specifications, in particular the HTTP specifications, refer to as a - representation is referred to in this specification as a resource. - HTTP

      +

      What some specifications, in particular the HTTP specifications, refer to as a representation is referred to in this specification as a resource. HTTP

      -

      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.

      +

      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.

      -

      For CSS style sheets, we tentatively define here that - their critical subresources are other style sheets imported via @import - rules, including those indirectly imported by other imported style sheets.

      +

      For CSS style sheets, we tentatively define here that their critical subresources are other style sheets imported via @import rules, including those indirectly imported by other imported style sheets.

      -

      This definition is not fully interoperable; furthermore, some user agents seem to - count resources like background images or web fonts as critical subresources. Ideally, the CSS - Working Group would define this; see w3c/csswg-drafts issue #1088 to track - progress on that front.

      +

      This definition is not fully interoperable; furthermore, some user agents seem to count resources like background images or web fonts as critical subresources. Ideally, the CSS Working Group would define this; see w3c/csswg-drafts issue #1088 to track progress on that front.

      XML compatibility

      -

      To ease migration from HTML to XML, 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" refers to any element in that namespace, even in - XML documents.

      +

      To ease migration from HTML to XML, 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" refers to any element in that namespace, even in XML documents.

      -

      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 mentioned in this specification have no namespace.

      +

      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 mentioned in this specification have no namespace.

      -

      The term element type is used to refer to the set of elements that have a given - local name and namespace. For example, button elements are elements with the element - type button, meaning they have the local name "button" and - (implicitly as defined above) the HTML namespace.

      +

      The term element type is used to refer to the set of elements that have a given local name and namespace. For example, button elements are elements with the element type button, meaning they have the local name "button" and (implicitly as defined above) the HTML namespace.

      DOM trees

      -

      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.

      +

      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.

      -

      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.

      +

      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.

      -

      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 controls or U+0020 SPACE).

      +

      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 controls or U+0020 SPACE).

      -

      An HTML element can have specific HTML element insertion steps, HTML element - post-connection steps, HTML element removing steps, and HTML element moving - steps all defined for the element's local - name.

      +

      An HTML element can have specific HTML element insertion steps, HTML element post-connection steps, HTML element removing steps, and HTML element moving steps all defined for the element's local name.

      -

      The insertion steps for the HTML Standard, given - insertedNode, are defined as the following:

      +

      The insertion steps for the HTML Standard, given insertedNode, are defined as the following:

        -
      1. If insertedNode is an element whose namespace is the HTML namespace, and this - standard defines HTML element insertion steps - for insertedNode's local name, then - run the corresponding HTML element insertion steps given - insertedNode.

      2. +
      3. If insertedNode is an element whose namespace is the HTML namespace, and this standard defines HTML element insertion steps for insertedNode's local name, then run the corresponding HTML element insertion steps given insertedNode.

      4. -

        If insertedNode is a form-associated element or the ancestor of a - form-associated element, then:

        +

        If insertedNode is a form-associated element or the ancestor of a form-associated element, then:

          -
        1. If the form-associated element's parser inserted flag is set, - then return.

        2. +
        3. If the form-associated element's parser inserted flag is set, then return.

        4. Reset the form owner of the form-associated element.

      5. -
      6. If insertedNode is an Element that is not on the - stack of open elements of an HTML parser, then - process internal resource links given insertedNode's - node document.

      7. +
      8. If insertedNode is an Element that is not on the stack of open elements of an HTML parser, then process internal resource links given insertedNode's node document.

      -

      The post-connection steps for the HTML - Standard, given insertedNode, are defined as the following:

      +

      The post-connection steps for the HTML Standard, given insertedNode, are defined as the following:

        -
      1. If insertedNode is an element whose namespace is the HTML namespace, and this - standard defines HTML element post-connection - steps for insertedNode's local - name, then run the corresponding HTML element post-connection steps given - insertedNode.

      2. +
      3. If insertedNode is an element whose namespace is the HTML namespace, and this standard defines HTML element post-connection steps for insertedNode's local name, then run the corresponding HTML element post-connection steps given insertedNode.

      -

      The removing steps for the HTML Standard, given - removedNode and oldParent, are defined as the following:

      +

      The removing steps for the HTML Standard, given removedNode and oldParent, are defined as the following:

      1. Let document be removedNode's node document.

      2. -

        If document's focused area is - removedNode, then set document's focused area to document's viewport, and set - document's relevant global object's navigation API's focus changed during ongoing - navigation to false.

        +

        If document's focused area is removedNode, then set document's focused area to document's viewport, and set document's relevant global object's navigation API's focus changed during ongoing navigation to false.

        -

        This does not perform the unfocusing steps, - focusing steps, or focus update steps, and thus no blur or change events are - fired.

        +

        This does not perform the unfocusing steps, focusing steps, or focus update steps, and thus no blur or change events are fired.

      3. -
      4. If removedNode is an element whose namespace is the HTML namespace, and this - standard defines HTML element removing steps - for removedNode's local name, then - run the corresponding HTML element removing steps given removedNode and - oldParent.

      5. +
      6. If removedNode is an element whose namespace is the HTML namespace, and this standard defines HTML element removing steps for removedNode's local name, then run the corresponding HTML element removing steps given removedNode and oldParent.

      7. -
      8. If removedNode is a form-associated element with a non-null - form owner and removedNode and its form owner are no longer - in the same tree, then reset the form owner of - removedNode.

      9. +
      10. If removedNode is a form-associated element with a non-null form owner and removedNode and its form owner are no longer in the same tree, then reset the form owner of removedNode.

      11. -
      12. If removedNode's popover attribute is not in - the No Popover state, then run the hide - popover algorithm given removedNode, false, false, false, and null.

      13. +
      14. If removedNode's popover attribute is not in the No Popover state, then run the hide popover algorithm given removedNode, false, false, false, and null.

      -

      The moving steps for the HTML Standard, given - movedNode, are defined as the following:

      +

      The moving steps for the HTML Standard, given movedNode, are defined as the following:

        -
      1. If movedNode is an element whose namespace is the HTML namespace, and this - standard defines HTML element moving steps for movedNode's local name, then run the corresponding HTML - element moving steps given movedNode.

      2. +
      3. If movedNode is an element whose namespace is the HTML namespace, and this standard defines HTML element moving steps for movedNode's local name, then run the corresponding HTML element moving steps given movedNode.

      4. -
      5. If movedNode is a form-associated element with a non-null - form owner and movedNode and its form owner are no longer in - the same tree, then reset the form owner of - movedNode.

      6. +
      7. If movedNode is a form-associated element with a non-null form owner and movedNode and its form owner are no longer in the same tree, then reset the form owner of movedNode.

      -

      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.

      +

      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.

      -

      A node becomes connected when the insertion steps are invoked with it as the argument and it - is now connected. Analogously, a node becomes disconnected when the removing - steps are invoked with it as the argument and it is now no longer - connected.

      +

      A node becomes connected when the insertion steps are invoked with it as the argument and it is now connected. Analogously, a node becomes disconnected when the removing steps are invoked with it as the argument and it is now no longer connected.

      -

      A node is browsing-context connected when it is connected and - its shadow-including root's browsing context is non-null. A node becomes browsing-context connected when the insertion steps are invoked with it as the argument and it - is now browsing-context connected. A node becomes browsing-context disconnected either when the removing steps are invoked with it as the argument and it - is now no longer browsing-context connected, or when its shadow-including - root's browsing context becomes null. +

      A node is browsing-context connected when it is connected and its shadow-including root's browsing context is non-null. A node becomes browsing-context connected when the insertion steps are invoked with it as the argument and it is now browsing-context connected. A node becomes browsing-context disconnected either when the removing steps are invoked with it as the argument and it is now no longer browsing-context connected, or when its shadow-including root's browsing context becomes null.

      Scripting

      -

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

      +

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

      -

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

      +

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

      -

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

      +

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

      Plugins

      -

      The term plugin refers to an implementation-defined set of content - handlers used by the user agent that can take part in the user agent's rendering of a - Document object, but that neither act as child - navigables of the Document nor introduce any Node objects to the - Document's DOM.

      +

      The term plugin refers to an implementation-defined set of content handlers used by the user agent that can take part in the user agent's rendering of a Document object, but that neither act as child navigables of the Document nor introduce any Node objects to the Document's DOM.

      -

      Typically such content handlers are provided by third parties, though a user agent can also - designate built-in content handlers as plugins.

      +

      Typically such content handlers are provided by third parties, though a user agent can also designate built-in content handlers as plugins.

      -

      A user agent must not consider the types text/plain and - application/octet-stream as having a registered plugin.

      +

      A user agent must not consider the types text/plain and application/octet-stream as having a registered plugin.

      -

      One example of a plugin would be a PDF viewer that is instantiated in a - navigable when the user navigates to a PDF file. This would count as a plugin - regardless of whether the party that implemented the PDF viewer component was the same as that - which implemented the user agent itself. However, a PDF viewer application that launches separate - from the user agent (as opposed to using the same interface) is not a plugin by this - definition.

      +

      One example of a plugin would be a PDF viewer that is instantiated in a navigable when the user navigates to a PDF file. This would count as a plugin regardless of whether the party that implemented the PDF viewer component was the same as that which implemented the user agent itself. However, a PDF viewer application that launches separate from the user agent (as opposed to using the same interface) is not a plugin by this definition.

      -

      This specification does not define a mechanism for interacting with plugins, as it - is expected to be user-agent- and platform-specific. Some UAs might opt to support a plugin - mechanism such as the Netscape Plugin API; others might use remote content converters or have - built-in support for certain types. Indeed, this specification doesn't require user agents to - support plugins at all. NPAPI

      +

      This specification does not define a mechanism for interacting with plugins, as it is expected to be user-agent- and platform-specific. Some UAs might opt to support a plugin mechanism such as the Netscape Plugin API; others might use remote content converters or have built-in support for certain types. Indeed, this specification doesn't require user agents to support plugins at all. NPAPI

      -

      Browsers should take extreme care when interacting with external content - intended for plugins. When third-party software is run with the same - privileges as the user agent itself, vulnerabilities in the third-party software become as - dangerous as those in the user agent.

      +

      Browsers should take extreme care when interacting with external content intended for plugins. When third-party software is run with the same privileges as the user agent itself, vulnerabilities in the third-party software become as dangerous as those in the user agent.

      - Since different users having different sets of plugins provides a - tracking vector that increases the chances of users being uniquely identified, user agents are - encouraged to support the exact same set of plugins for each - user.

      + Since different users having different sets of plugins provides a tracking vector that increases the chances of users being uniquely identified, user agents are encouraged to support the exact same set of plugins for each user.

      @@ -1987,13 +1329,7 @@ a.setAttribute('href', 'https://example.com/'); // change the content attribute

      Character encodings

      -

      A character - encoding, or just encoding where that is not ambiguous, is a defined way to convert - between byte streams and Unicode strings, as defined in Encoding. An - encoding has an encoding - name and one or more encoding labels, referred to as the - encoding's name and labels in the Encoding standard. ENCODING

      +

      A character encoding, or just encoding where that is not ambiguous, is a defined way to convert between byte streams and Unicode strings, as defined in Encoding. An encoding has an encoding name and one or more encoding labels, referred to as the encoding's name and labels in the Encoding standard. ENCODING

      @@ -2001,103 +1337,57 @@ a.setAttribute('href', 'https://example.com/'); // change the content attribute

      Conformance classes

      -

      This specification describes the conformance criteria for user agents - (relevant to implementers) and documents (relevant to authors and - authoring tool implementers).

      +

      This specification describes the conformance criteria for user agents (relevant to implementers) and documents (relevant to authors and authoring tool implementers).

      -

      Conforming documents are those that comply with all the conformance criteria for - documents. For readability, some of these conformance requirements are phrased as conformance - requirements on authors; such requirements are implicitly requirements on documents: by - definition, all documents are assumed to have had an author. (In some cases, that author may - itself be a user agent — such user agents are subject to additional rules, as explained - below.)

      +

      Conforming documents are those that comply with all the conformance criteria for documents. For readability, some of these conformance requirements are phrased as conformance requirements on authors; such requirements are implicitly requirements on documents: by definition, all documents are assumed to have had an author. (In some cases, that author may itself be a user agent — such user agents are subject to additional rules, as explained below.)

      -

      For example, if a requirement states that "authors must not - use the foobar element", it would imply that documents are not allowed to - contain elements named foobar.

      +

      For example, if a requirement states that "authors must not use the foobar element", it would imply that documents are not allowed to contain elements named foobar.

      -

      There is no implied relationship between document conformance requirements - and implementation conformance requirements. User agents are not free to handle non-conformant - documents as they please; the processing model described in this specification applies to - implementations regardless of the conformity of the input documents.

      +

      There is no implied relationship between document conformance requirements and implementation conformance requirements. User agents are not free to handle non-conformant documents as they please; the processing model described in this specification applies to implementations regardless of the conformity of the input documents.

      -

      User agents fall into several (overlapping) categories with different conformance - requirements.

      +

      User agents fall into several (overlapping) categories with different conformance requirements.

      Web browsers and other interactive user agents
      -

      Web browsers that support the XML syntax must process elements and attributes - from the HTML namespace found in XML documents as described in this specification, - so that users can interact with them, unless the semantics of those elements have been - overridden by other specifications.

      +

      Web browsers that support the XML syntax must process elements and attributes from the HTML namespace found in XML documents as described in this specification, so that users can interact with them, unless the semantics of those elements have been overridden by other specifications.

      -

      A conforming web browser would, upon finding a script element in - an XML document, execute the script contained in that element. However, if the element is found - within a transformation expressed in XSLT (assuming the user agent also supports XSLT), then the - processor would instead treat the script element as an opaque element that forms - part of the transform.

      +

      A conforming web browser would, upon finding a script element in an XML document, execute the script contained in that element. However, if the element is found within a transformation expressed in XSLT (assuming the user agent also supports XSLT), then the processor would instead treat the script element as an opaque element that forms part of the transform.

      -

      Web browsers that support the HTML syntax must process documents labeled with an - HTML MIME type as described in this specification, so that users can interact with - them.

      +

      Web browsers that support the HTML syntax must process documents labeled with an HTML MIME type as described in this specification, so that users can interact with them.

      -

      User agents that support scripting must also be conforming implementations of the IDL - fragments in this specification, as described in Web IDL. WEBIDL

      +

      User agents that support scripting must also be conforming implementations of the IDL fragments in this specification, as described in Web IDL. WEBIDL

      -

      Unless explicitly stated, specifications that override the semantics of HTML - elements do not override the requirements on DOM objects representing those elements. For - example, the script element in the example above would still implement the - HTMLScriptElement interface.

      +

      Unless explicitly stated, specifications that override the semantics of HTML elements do not override the requirements on DOM objects representing those elements. For example, the script element in the example above would still implement the HTMLScriptElement interface.

      Non-interactive presentation user agents
      -

      User agents that process HTML and XML documents purely to render non-interactive versions of - them must comply to the same conformance criteria as web browsers, except that they are exempt - from requirements regarding user interaction.

      +

      User agents that process HTML and XML documents purely to render non-interactive versions of them must comply to the same conformance criteria as web browsers, except that they are exempt from requirements regarding user interaction.

      -

      Typical examples of non-interactive presentation user agents are printers - (static UAs) and overhead displays (dynamic UAs). It is expected that most static - non-interactive presentation user agents will also opt to lack scripting - support.

      +

      Typical examples of non-interactive presentation user agents are printers (static UAs) and overhead displays (dynamic UAs). It is expected that most static non-interactive presentation user agents will also opt to lack scripting support.

      -

      A non-interactive but dynamic presentation UA would still execute scripts, - allowing forms to be dynamically submitted, and so forth. However, since the concept of "focus" - is irrelevant when the user cannot interact with the document, the UA would not need to support - any of the focus-related DOM APIs.

      +

      A non-interactive but dynamic presentation UA would still execute scripts, allowing forms to be dynamically submitted, and so forth. However, since the concept of "focus" is irrelevant when the user cannot interact with the document, the UA would not need to support any of the focus-related DOM APIs.

      Visual user agents that support the suggested default rendering
      -

      User agents, whether interactive or not, may be designated (possibly as a user option) as - supporting the suggested default rendering defined by this specification.

      +

      User agents, whether interactive or not, may be designated (possibly as a user option) as supporting the suggested default rendering defined by this specification.

      -

      This is not required. In particular, even user agents that do implement the suggested default - rendering are encouraged to offer settings that override this default to improve the experience - for the user, e.g. changing the color contrast, using different focus styles, or otherwise - making the experience more accessible and usable to the user.

      +

      This is not required. In particular, even user agents that do implement the suggested default rendering are encouraged to offer settings that override this default to improve the experience for the user, e.g. changing the color contrast, using different focus styles, or otherwise making the experience more accessible and usable to the user.

      -

      User agents that are designated as supporting the suggested default rendering must, while so - designated, implement the rules the Rendering section defines as the - behavior that user agents are expected to implement.

      +

      User agents that are designated as supporting the suggested default rendering must, while so designated, implement the rules the Rendering section defines as the behavior that user agents are expected to implement.

      User agents with no scripting support
      -

      Implementations that do not support scripting (or which have their scripting features - disabled entirely) are exempt from supporting the events and DOM interfaces mentioned in this - specification. For the parts of this specification that are defined in terms of an events model - or in terms of the DOM, such user agents must still act as if events and the DOM were - supported.

      +

      Implementations that do not support scripting (or which have their scripting features disabled entirely) are exempt from supporting the events and DOM interfaces mentioned in this specification. For the parts of this specification that are defined in terms of an events model or in terms of the DOM, such user agents must still act as if events and the DOM were supported.

      -

      Scripting can form an integral part of an application. Web browsers that do not - support scripting, or that have scripting disabled, might be unable to fully convey the author's - intent.

      +

      Scripting can form an integral part of an application. Web browsers that do not support scripting, or that have scripting disabled, might be unable to fully convey the author's intent.

      @@ -2105,30 +1395,15 @@ a.setAttribute('href', 'https://example.com/'); // change the content attribute
      -

      Conformance checkers must verify that a document conforms to the applicable conformance - criteria described in this specification. Automated conformance checkers are exempt from - detecting errors that require interpretation of the author's intent (for example, while a - document is non-conforming if the content of a blockquote element is not a quote, - conformance checkers running without the input of human judgement do not have to check that - blockquote elements only contain quoted material).

      +

      Conformance checkers must verify that a document conforms to the applicable conformance criteria described in this specification. Automated conformance checkers are exempt from detecting errors that require interpretation of the author's intent (for example, while a document is non-conforming if the content of a blockquote element is not a quote, conformance checkers running without the input of human judgement do not have to check that blockquote elements only contain quoted material).

      -

      Conformance checkers must check that the input document conforms when parsed without a - browsing context (meaning that no scripts are run, and - that the parser's scripting flag is disabled), and should also check that the input - document conforms when parsed with a browsing context - in which scripts execute, and that the scripts never cause non-conforming states to occur other - than transiently during script execution itself. (This is only a "SHOULD" and not a "MUST" - requirement because it has been proven to be impossible. COMPUTABLE)

      +

      Conformance checkers must check that the input document conforms when parsed without a browsing context (meaning that no scripts are run, and that the parser's scripting flag is disabled), and should also check that the input document conforms when parsed with a browsing context in which scripts execute, and that the scripts never cause non-conforming states to occur other than transiently during script execution itself. (This is only a "SHOULD" and not a "MUST" requirement because it has been proven to be impossible. COMPUTABLE)

      -

      The term "HTML validator" can be used to refer to a conformance checker that itself conforms - to the applicable requirements of this specification.

      +

      The term "HTML validator" can be used to refer to a conformance checker that itself conforms to the applicable requirements of this specification.

      -

      XML DTDs cannot express all the conformance requirements of this specification. Therefore, a - validating XML processor and a DTD cannot constitute a conformance checker. Also, since neither - of the two authoring formats defined in this specification are applications of SGML, a - validating SGML system cannot constitute a conformance checker either.

      +

      XML DTDs cannot express all the conformance requirements of this specification. Therefore, a validating XML processor and a DTD cannot constitute a conformance checker. Also, since neither of the two authoring formats defined in this specification are applications of SGML, a validating SGML system cannot constitute a conformance checker either.

      To put it another way, there are three types of conformance criteria:

      @@ -2140,9 +1415,7 @@ a.setAttribute('href', 'https://example.com/'); // change the content attribute
    10. Criteria that can only be checked by a human.
    -

    A conformance checker must check for the first two. A simple DTD-based validator only checks - for the first class of errors and is therefore not a conforming conformance checker according - to this specification.

    +

    A conformance checker must check for the first two. A simple DTD-based validator only checks for the first class of errors and is therefore not a conforming conformance checker according to this specification.

  • @@ -2152,78 +1425,38 @@ a.setAttribute('href', 'https://example.com/'); // change the content attribute
    -

    Applications and tools that process HTML and XML documents for reasons other than to either - render the documents or check them for conformance should act in accordance with the semantics - of the documents that they process.

    +

    Applications and tools that process HTML and XML documents for reasons other than to either render the documents or check them for conformance should act in accordance with the semantics of the documents that they process.

    -

    A tool that generates document outlines but - increases the nesting level for each paragraph and does not increase the nesting level for - headings would not be conforming.

    +

    A tool that generates document outlines but increases the nesting level for each paragraph and does not increase the nesting level for headings would not be conforming.

    Authoring tools and markup generators
    -

    Authoring tools and markup generators must generate conforming documents. - Conformance criteria that apply to authors also apply to authoring tools, where appropriate.

    +

    Authoring tools and markup generators must generate conforming documents. Conformance criteria that apply to authors also apply to authoring tools, where appropriate.

    -

    Authoring tools are exempt from the strict requirements of using elements only for their - specified purpose, but only to the extent that authoring tools are not yet able to determine - author intent. However, authoring tools must not automatically misuse elements or encourage - their users to do so.

    +

    Authoring tools are exempt from the strict requirements of using elements only for their specified purpose, but only to the extent that authoring tools are not yet able to determine author intent. However, authoring tools must not automatically misuse elements or encourage their users to do so.

    -

    For example, it is not conforming to use an address element for - arbitrary contact information; that element can only be used for marking up contact information - for its nearest article or body element ancestor. However, since an - authoring tool is likely unable to determine the difference, an authoring tool is exempt from - that requirement. This does not mean, though, that authoring tools can use address - elements for any block of italics text (for instance); it just means that the authoring tool - doesn't have to verify that when the user uses a tool for inserting contact information for an - article element, that the user really is doing that and not inserting something - else instead.

    +

    For example, it is not conforming to use an address element for arbitrary contact information; that element can only be used for marking up contact information for its nearest article or body element ancestor. However, since an authoring tool is likely unable to determine the difference, an authoring tool is exempt from that requirement. This does not mean, though, that authoring tools can use address elements for any block of italics text (for instance); it just means that the authoring tool doesn't have to verify that when the user uses a tool for inserting contact information for an article element, that the user really is doing that and not inserting something else instead.

    -

    In terms of conformance checking, an editor has to output documents that conform - to the same extent that a conformance checker will verify.

    +

    In terms of conformance checking, an editor has to output documents that conform to the same extent that a conformance checker will verify.

    -

    When an authoring tool is used to edit a non-conforming document, it may preserve the - conformance errors in sections of the document that were not edited during the editing session - (i.e. an editing tool is allowed to round-trip erroneous content). However, an authoring tool - must not claim that the output is conformant if errors have been so preserved.

    +

    When an authoring tool is used to edit a non-conforming document, it may preserve the conformance errors in sections of the document that were not edited during the editing session (i.e. an editing tool is allowed to round-trip erroneous content). However, an authoring tool must not claim that the output is conformant if errors have been so preserved.

    -

    Authoring tools are expected to come in two broad varieties: tools that work from structure - or semantic data, and tools that work on a What-You-See-Is-What-You-Get media-specific editing - basis (WYSIWYG).

    +

    Authoring tools are expected to come in two broad varieties: tools that work from structure or semantic data, and tools that work on a What-You-See-Is-What-You-Get media-specific editing basis (WYSIWYG).

    -

    The former is the preferred mechanism for tools that author HTML, since the structure in the - source information can be used to make informed choices regarding which HTML elements and - attributes are most appropriate.

    +

    The former is the preferred mechanism for tools that author HTML, since the structure in the source information can be used to make informed choices regarding which HTML elements and attributes are most appropriate.

    -

    However, WYSIWYG tools are legitimate. WYSIWYG tools should use elements they know are - appropriate, and should not use elements that they do not know to be appropriate. This might in - certain extreme cases mean limiting the use of flow elements to just a few elements, like - div, b, i, and span and making liberal use - of the style attribute.

    +

    However, WYSIWYG tools are legitimate. WYSIWYG tools should use elements they know are appropriate, and should not use elements that they do not know to be appropriate. This might in certain extreme cases mean limiting the use of flow elements to just a few elements, like div, b, i, and span and making liberal use of the style attribute.

    -

    All authoring tools, whether WYSIWYG or not, should make a best effort attempt at enabling - users to create well-structured, semantically rich, media-independent content.

    +

    All authoring tools, whether WYSIWYG or not, should make a best effort attempt at enabling users to create well-structured, semantically rich, media-independent content.

    -

    For compatibility with existing content and prior specifications, this specification describes - two authoring formats: one based on XML, and one using a custom format inspired by SGML (referred to as the HTML syntax). - Implementations must support at least one of these two formats, although supporting both is - encouraged.

    +

    For compatibility with existing content and prior specifications, this specification describes two authoring formats: one based on XML, and one using a custom format inspired by SGML (referred to as the HTML syntax). Implementations must support at least one of these two formats, although supporting both is encouraged.

    -

    Some conformance requirements are phrased as requirements on elements, attributes, methods or - objects. Such requirements fall into two categories: those describing content model restrictions, - and those describing implementation behavior. Those in the former category are requirements on - documents and authoring tools. Those in the second category are requirements on user agents. - Similarly, some conformance requirements are phrased as requirements on authors; such requirements - are to be interpreted as conformance requirements on the documents that authors produce. (In other - words, this specification does not distinguish between conformance criteria on authors and - conformance criteria on documents.)

    +

    Some conformance requirements are phrased as requirements on elements, attributes, methods or objects. Such requirements fall into two categories: those describing content model restrictions, and those describing implementation behavior. Those in the former category are requirements on documents and authoring tools. Those in the second category are requirements on user agents. Similarly, some conformance requirements are phrased as requirements on authors; such requirements are to be interpreted as conformance requirements on the documents that authors produce. (In other words, this specification does not distinguish between conformance criteria on authors and conformance criteria on documents.)

    @@ -2249,7 +1482,7 @@ a.setAttribute('href', 'https://example.com/'); // change the content attribute

    The following terms are defined in Infra: INFRA

    -