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 -
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.
For each element in candidate elements, run the following - substeps:
+For each element in candidate elements, run the following substeps:
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.
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.
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.
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.
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.
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).
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.
EventSource, and a two-way full-duplex socket protocol for scripts known as Web
- Sockets.EventSource, and a two-way full-duplex socket protocol for scripts known as Web Sockets.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.
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.
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.
/* 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:
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:
htmlhtml 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
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:
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.javascript:", but user agents can
- implement (and indeed, have historically implemented) others.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.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.javascript:", but user agents can implement (and indeed, have historically implemented) others.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.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.
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).
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©",
- because even without the final semicolon, "©" is handled the same
- as "©" and thus gets interpreted as "©":
+ In the following fragment, however, the attribute's value is actually "?art©", not the intended "?art©", because even without the final semicolon, "©" is handled the same as "©" and thus gets interpreted as "©":
<a href="?art©">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&copy">Art and Copy</a> <!-- the & has to be escaped, since © 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:
Let parallelQueue be a new parallel queue.
@@ -1604,18 +1102,14 @@ a.setAttribute('href', 'https://example.com/'); // change the content attribute
While true:
- Let steps be the result of dequeuing from
- parallelQueue's algorithm queue.
+ Let steps be the result of dequeuing from parallelQueue's algorithm queue.
If steps is not nothing, then run steps.
- Assert: running steps did not throw an exception, as steps
- running in parallel are not allowed to throw.
+ 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:
- Let p be a new promise created in this's relevant realm.
+ Let p be a new promise created in this's relevant realm.
- Let global be this's relevant global
- object.
+ Let global be this's relevant global object.
-
Run the following steps in parallel:
- 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.
+ 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.
Do some potentially lengthy work.
- Append name to
- nameList.
+ Append name to nameList.
- Queue a global task on the DOM manipulation task source given
- global to resolve p with undefined.
+ Queue a global task on the DOM manipulation task source given global to resolve p with undefined.
@@ -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:
- Let p be a new promise created in this's relevant realm.
+ Let p be a new promise created in this's relevant realm.
- Let global be this's relevant global
- object.
+ Let global be this's relevant global object.
-
Enqueue the following steps to nameListQueue:
- 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.
+ 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.
Do some potentially lengthy work.
- Append name to
- nameList.
+ Append name to nameList.
- Queue a global task on the DOM manipulation task source given
- global to resolve p with undefined.
+ Queue a global task on the DOM manipulation task source given global to resolve p with undefined.
@@ -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:
- 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.
+ 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.
-
-
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:
- If the form-associated element's parser inserted flag is set,
- then return.
+ If the form-associated element's parser inserted flag is set, then return.
Reset the form owner of the form-associated element.
- 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.
+ 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:
- 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.
+ 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:
Let document be removedNode's node document.
-
-
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.
- 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.
+ 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.
- 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.
+ 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.
- 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.
+ 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:
- 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.
+ 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.
- 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.
+ 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
- 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
-
+
- The general iteration terms while,
continue, and
break.
@@ -2362,41 +1595,28 @@ a.setAttribute('href', 'https://example.com/'); // change the content attribute
- Unicode and Encoding
-
-
The Unicode character set is used to represent textual data, and Encoding
- defines requirements around character encodings.
- UNICODE
+ The Unicode character set is used to represent textual data, and Encoding defines requirements around character encodings. UNICODE
- This specification introduces terminology
- based on the terms defined in those specifications, as described earlier.
+ This specification introduces terminology based on the terms defined in those specifications, as described earlier.
The following terms are used as defined in Encoding: ENCODING
- - Getting an
- encoding
+ - Getting an encoding
- - Get an output
- encoding
+ - Get an output encoding
- - The generic decode
- algorithm which takes a byte stream and an encoding and returns a character stream
+ - The generic decode algorithm which takes a byte stream and an encoding and returns a character stream
- - The UTF-8 decode
- algorithm which takes a byte stream and returns a character stream, additionally stripping one
- leading UTF-8 Byte Order Mark (BOM), if any
+ - The UTF-8 decode algorithm which takes a byte stream and returns a character stream, additionally stripping one leading UTF-8 Byte Order Mark (BOM), if any
- - The UTF-8
- decode without BOM algorithm which is identical to UTF-8 decode except that
- it does not strip one leading UTF-8 Byte Order Mark (BOM)
+ - The UTF-8 decode without BOM algorithm which is identical to UTF-8 decode except that it does not strip one leading UTF-8 Byte Order Mark (BOM)
- - The encode algorithm
- which takes a character stream and an encoding and returns a byte stream
+ - The encode algorithm which takes a character stream and an encoding and returns a byte stream
- - The UTF-8 encode
- algorithm which takes a character stream and returns a byte stream
+ - The UTF-8 encode algorithm which takes a character stream and returns a byte stream
- - The BOM sniff
- algorithm which takes a byte stream and returns an encoding or null.
+ - The BOM sniff algorithm which takes a byte stream and returns an encoding or null.
@@ -2404,40 +1624,21 @@ a.setAttribute('href', 'https://example.com/'); // change the content attribute
- XML and related specifications
-
-
Implementations that support the XML syntax for HTML must support some version
- of XML, as well as its corresponding namespaces specification, because that syntax uses an XML
- serialization with namespaces. XML XMLNS
+ Implementations that support the XML syntax for HTML must support some version of XML, as well as its corresponding namespaces specification, because that syntax uses an XML serialization with namespaces. XML XMLNS
- Data mining tools and other user agents that perform operations on content without running
- scripts, evaluating CSS or XPath expressions, or otherwise exposing the resulting DOM to
- arbitrary content, may "support namespaces" by just asserting that their DOM node analogues are
- in certain namespaces, without actually exposing the namespace strings.
+ Data mining tools and other user agents that perform operations on content without running scripts, evaluating CSS or XPath expressions, or otherwise exposing the resulting DOM to arbitrary content, may "support namespaces" by just asserting that their DOM node analogues are in certain namespaces, without actually exposing the namespace strings.
- In the HTML syntax, namespace prefixes and namespace declarations
- do not have the same effect as in XML. For instance, the colon has no special meaning in HTML
- element names.
+ In the HTML syntax, namespace prefixes and namespace declarations do not have the same effect as in XML. For instance, the colon has no special meaning in HTML element names.
- The attribute with the name space in the XML namespace is defined by
- Extensible Markup Language (XML). XML
+ The attribute with the name space in the XML namespace is defined by Extensible Markup Language (XML). XML
- The Name production is defined in XML.
- XML
+ The Name production is defined in XML. XML
- This specification also references the <?xml-stylesheet?>
- processing instruction, defined in Associating Style Sheets with XML documents.
- XMLSSPI
+ This specification also references the <?xml-stylesheet?> processing instruction, defined in Associating Style Sheets with XML documents. XMLSSPI
- This specification also non-normatively mentions the XSLTProcessor
- interface and its transformToFragment() and transformToDocument() methods.
- XSLTP
+ This specification also non-normatively mentions the XSLTProcessor interface and its transformToFragment() and transformToDocument() methods. XSLTP
@@ -2446,7 +1647,7 @@ a.setAttribute('href', 'https://example.com/'); // change the content attribute
-
The following terms are defined in URL: URL
-
+
- host
- public suffix
- domain
@@ -2511,34 +1712,17 @@ a.setAttribute('href', 'https://example.com/'); // change the content attribute
A number of schemes and protocols are referenced by this specification also:
- - The
about: scheme
- ABOUT
- - The
blob: scheme
- FILEAPI
- - The
data: scheme
- RFC2397
- - The
http: scheme
- HTTP
- - The
https: scheme
- HTTP
- - The
mailto:
- scheme MAILTO
- - The
sms: scheme
- SMS
- - The
urn: scheme
- URN
+ - The
about: scheme ABOUT
+ - The
blob: scheme FILEAPI
+ - The
data: scheme RFC2397
+ - The
http: scheme HTTP
+ - The
https: scheme HTTP
+ - The
mailto: scheme MAILTO
+ - The
sms: scheme SMS
+ - The
urn: scheme URN
- Media fragment
- syntax is defined in Media Fragments URI. MEDIAFRAG
+ Media fragment syntax is defined in Media Fragments URI. MEDIAFRAG
- URL Pattern
@@ -2572,8 +1756,7 @@ a.setAttribute('href', 'https://example.com/'); // change the content attribute
- `
Referer` header
- The following terms are defined in HTTP State Management Mechanism:
- COOKIES
+ The following terms are defined in HTTP State Management Mechanism: COOKIES
- cookie-string
@@ -2588,8 +1771,7 @@ a.setAttribute('href', 'https://example.com/'); // change the content attribute
- Parsing a `
Link` field value
- The following terms are defined in Structured Field Values for HTTP:
- STRUCTURED-FIELDS
+ The following terms are defined in Structured Field Values for HTTP: STRUCTURED-FIELDS
- structured header
@@ -2602,7 +1784,7 @@ a.setAttribute('href', 'https://example.com/'); // change the content attribute
The following terms are defined in MIME Sniffing: MIMESNIFF
-
+
- MIME type
- MIME type essence
- valid MIME type string
@@ -2677,9 +1859,7 @@ a.setAttribute('href', 'https://example.com/'); // change the content attribute
- potentially free deferred fetch quota
- is offline
-
- response and its
- associated:
+ response and its associated:
- type
- URL
@@ -2701,8 +1881,7 @@ a.setAttribute('href', 'https://example.com/'); // change the content attribute
-
- request and its associated:
+ request and its associated:
- URL
- method
@@ -2747,9 +1926,7 @@ a.setAttribute('href', 'https://example.com/'); // change the content attribute
-
- fetch timing info and its
- associated:
+ fetch timing info and its associated:
- start time
- end time
@@ -2757,10 +1934,9 @@ a.setAttribute('href', 'https://example.com/'); // change the content attribute
- The following terms are defined in Referrer Policy:
- REFERRERPOLICY
+ The following terms are defined in Referrer Policy: REFERRERPOLICY
-
+
- referrer policy
- The `
Referrer-Policy` HTTP header
- The parse a referrer policy from a `
Referrer-Policy` header algorithm
@@ -2791,8 +1967,7 @@ a.setAttribute('href', 'https://example.com/'); // change the content attribute
- The No-Vary-Search HTTP Response Header Field
-
-
The following terms are defined in The No-Vary-Search HTTP Response Header
- Field: NOVARYSEARCH
+ The following terms are defined in The No-Vary-Search HTTP Response Header Field: NOVARYSEARCH
- `
No-Vary-Search`
@@ -2816,10 +1991,9 @@ a.setAttribute('href', 'https://example.com/'); // change the content attribute
- Navigation Timing
-
-
The following terms are defined in Navigation Timing:
- NAVIGATIONTIMING
+ The following terms are defined in Navigation Timing: NAVIGATIONTIMING
-
+
- create the navigation timing entry
- queue the navigation timing entry
NavigationTimingType and its
@@ -2832,8 +2006,7 @@ a.setAttribute('href', 'https://example.com/'); // change the content attribute
- Resource Timing
-
-
The following terms are defined in Resource Timing:
- RESOURCETIMING
+ The following terms are defined in Resource Timing: RESOURCETIMING
- Mark resource timing
@@ -2842,10 +2015,9 @@ a.setAttribute('href', 'https://example.com/'); // change the content attribute
- Performance Timeline
-
-
The following terms are defined in Performance Timeline:
- PERFORMANCETIMELINE
+ The following terms are defined in Performance Timeline: PERFORMANCETIMELINE
-
+
PerformanceEntry and its
name,
entryType,
@@ -2887,12 +2059,11 @@ a.setAttribute('href', 'https://example.com/'); // change the content attribute
- Web IDL
-
-
The IDL fragments in this specification must be interpreted as required for conforming IDL
- fragments, as described in Web IDL. WEBIDL
+ The IDL fragments in this specification must be interpreted as required for conforming IDL fragments, as described in Web IDL. WEBIDL
The following terms are defined in Web IDL:
-
+
- this
- extended attribute
- named constructor
@@ -2975,11 +2146,7 @@ a.setAttribute('href', 'https://example.com/'); // change the content attribute
QuotaExceededError
- The term throw in this
- specification is used as defined in Web IDL. The DOMException
- type and the following exception names are defined by Web IDL and used by this
- specification:
+ The term throw in this specification is used as defined in Web IDL. The DOMException type and the following exception names are defined by Web IDL and used by this specification:
- "
IndexSizeError"
@@ -2999,33 +2166,22 @@ a.setAttribute('href', 'https://example.com/'); // change the content attribute
- "
NotAllowedError"
- When this specification requires a user agent to create a Date object
- representing a particular time (which could be the special value Not-a-Number), the milliseconds
- component of that time, if any, must be truncated to an integer, and the time value of the newly
- created Date object must represent the resulting truncated time.
+ When this specification requires a user agent to create a Date object representing a particular time (which could be the special value Not-a-Number), the milliseconds component of that time, if any, must be truncated to an integer, and the time value of the newly created Date object must represent the resulting truncated time.
- For instance, given the time 23045 millionths of a second after 01:00 UTC on
- January 1st 2000, i.e. the time 2000-01-01T00:00:00.023045Z, then the Date object
- created representing that time would represent the same time as that created representing the
- time 2000-01-01T00:00:00.023Z, 45 millionths earlier. If the given time is NaN, then the result
- is a Date object that represents a time value NaN (indicating that the object does
- not represent a specific instant of time).
+ For instance, given the time 23045 millionths of a second after 01:00 UTC on January 1st 2000, i.e. the time 2000-01-01T00:00:00.023045Z, then the Date object created representing that time would represent the same time as that created representing the time 2000-01-01T00:00:00.023Z, 45 millionths earlier. If the given time is NaN, then the result is a Date object that represents a time value NaN (indicating that the object does not represent a specific instant of time).
- JavaScript
-
-
Some parts of the language described by this specification only support JavaScript as the
- underlying scripting language. JAVASCRIPT
+ Some parts of the language described by this specification only support JavaScript as the underlying scripting language. JAVASCRIPT
- The term "JavaScript" is used to refer to ECMA-262, rather than the official
- term ECMAScript, since the term JavaScript is more widely known.
+ The term "JavaScript" is used to refer to ECMA-262, rather than the official term ECMAScript, since the term JavaScript is more widely known.
- The following terms are defined in the JavaScript specification and used in this
- specification:
+ The following terms are defined in the JavaScript specification and used in this specification:
-
+
- active function object
- agent and
agent cluster
@@ -3180,22 +2336,18 @@ a.setAttribute('href', 'https://example.com/'); // change the content attribute
- The TypedArray Constructors table
- User agents that support JavaScript must also implement the Dynamic Code Brand
- Checks proposal. The following terms are defined there, and used in this specification:
- JSDYNAMICCODEBRANDCHECKS
+ User agents that support JavaScript must also implement the Dynamic Code Brand Checks proposal. The following terms are defined there, and used in this specification: JSDYNAMICCODEBRANDCHECKS
- The HostEnsureCanCompileStrings abstract operation
- The HostGetCodeForEval abstract operation
- User agents that support JavaScript must also implement ECMAScript
- Internationalization API. JSINTL
+ User agents that support JavaScript must also implement ECMAScript Internationalization API. JSINTL
- User agents that support JavaScript must also implement the Temporal proposal.
- The following terms are defined there, and used in this specification: JSTEMPORAL
+ User agents that support JavaScript must also implement the Temporal proposal. The following terms are defined there, and used in this specification: JSTEMPORAL
-
+
- The HostSystemUTCEpochNanoseconds abstract operation
- The nsMaxInstant and
nsMinInstant values
@@ -3205,8 +2357,7 @@ a.setAttribute('href', 'https://example.com/'); // change the content attribute
- WebAssembly
-
-
The following term is defined in WebAssembly JavaScript Interface:
- WASMJS
+ The following term is defined in WebAssembly JavaScript Interface: WASMJS
WebAssembly.Module
@@ -3216,17 +2367,13 @@ a.setAttribute('href', 'https://example.com/'); // change the content attribute
- DOM
-
-
The Document Object Model (DOM) is a representation — a model — of a document and
- its content. The DOM is not just an API; the conformance criteria of HTML implementations are
- defined, in this specification, in terms of operations on the DOM. DOM
+ The Document Object Model (DOM) is a representation — a model — of a document and its content. The DOM is not just an API; the conformance criteria of HTML implementations are defined, in this specification, in terms of operations on the DOM. DOM
- Implementations must support DOM and the events defined in UI Events, because this
- specification is defined in terms of the DOM, and some of the features are defined as extensions
- to the DOM interfaces. DOM UIEVENTS
+ Implementations must support DOM and the events defined in UI Events, because this specification is defined in terms of the DOM, and some of the features are defined as extensions to the DOM interfaces. DOM UIEVENTS
In particular, the following features are defined in DOM: DOM
-
+
Attr interface
CharacterData interface
Comment interface
@@ -3456,8 +2603,7 @@ a.setAttribute('href', 'https://example.com/'); // change the content attribute
touchend event
- The following features are defined in Pointer Events:
- POINTEREVENTS
+ The following features are defined in Pointer Events: POINTEREVENTS
- The
PointerEvent interface
@@ -3468,8 +2614,7 @@ a.setAttribute('href', 'https://example.com/'); // change the content attribute
pointercancel event
- The following events are defined in Clipboard API and events:
- CLIPBOARD-APIS
+ The following events are defined in Clipboard API and events: CLIPBOARD-APIS
copy event
@@ -3477,13 +2622,9 @@ a.setAttribute('href', 'https://example.com/'); // change the content attribute
paste event
- This specification sometimes uses the term name to refer to the event's
- type; as in, "an event named click" or "if the event name is keypress". The terms
- "name" and "type" for events are synonymous.
+ This specification sometimes uses the term name to refer to the event's type; as in, "an event named click" or "if the event name is keypress". The terms "name" and "type" for events are synonymous.
- The following features are defined in DOM Parsing and Serialization:
- DOMPARSING
+ The following features are defined in DOM Parsing and Serialization: DOMPARSING
XML serialization
@@ -3496,8 +2637,7 @@ a.setAttribute('href', 'https://example.com/'); // change the content attribute
Selection
- User agents are encouraged to implement the features described in
- execCommand. EXECCOMMAND
+ User agents are encouraged to implement the features described in execCommand. EXECCOMMAND
The following features are defined in Fullscreen API: FULLSCREEN
@@ -3531,10 +2671,9 @@ a.setAttribute('href', 'https://example.com/'); // change the content attribute
- File API
-
-
This specification uses the following features defined in File API:
- FILEAPI
+ This specification uses the following features defined in File API: FILEAPI
-
+
- The
Blob interface and its
type attribute
- The
File interface and its
@@ -3555,8 +2694,7 @@ a.setAttribute('href', 'https://example.com/'); // change the content attribute
- Indexed Database API
-
-
The following terms are defined in Indexed Database API:
- INDEXEDDB
+ The following terms are defined in Indexed Database API: INDEXEDDB
- cleanup Indexed Database transactions
@@ -3568,8 +2706,7 @@ a.setAttribute('href', 'https://example.com/'); // change the content attribute
- Media Source Extensions
-
-
The following terms are defined in Media Source Extensions:
- MEDIASOURCE
+ The following terms are defined in Media Source Extensions: MEDIASOURCE
MediaSource interface
@@ -3580,8 +2717,7 @@ a.setAttribute('href', 'https://example.com/'); // change the content attribute
- Media Capture and Streams
-
-
The following terms are defined in Media Capture and Streams:
- MEDIASTREAM
+ The following terms are defined in Media Capture and Streams: MEDIASTREAM
MediaStream interface
@@ -3608,10 +2744,9 @@ a.setAttribute('href', 'https://example.com/'); // change the content attribute
- XMLHttpRequest
-
-
The following features and terms are defined in XMLHttpRequest:
- XHR
+ The following features and terms are defined in XMLHttpRequest: XHR
-
+
- The
XMLHttpRequest interface, and its
responseXML attribute
- The
ProgressEvent interface, and its
@@ -3637,36 +2772,22 @@ a.setAttribute('href', 'https://example.com/'); // change the content attribute
- Media Queries
-
-
Implementations must support Media Queries. The <media-condition>
- feature is defined therein. MQ
+ Implementations must support Media Queries. The <media-condition> feature is defined therein. MQ
- CSS modules
-
-
While support for CSS as a whole is not required of implementations of this specification
- (though it is encouraged, at least for web browsers), some features are defined in terms of
- specific CSS requirements.
+ While support for CSS as a whole is not required of implementations of this specification (though it is encouraged, at least for web browsers), some features are defined in terms of specific CSS requirements.
- When this specification requires that something be parsed according
- to a particular CSS grammar, the relevant algorithm in CSS Syntax must be
- followed, including error handling rules. CSSSYNTAX
+ When this specification requires that something be parsed according to a particular CSS grammar, the relevant algorithm in CSS Syntax must be followed, including error handling rules. CSSSYNTAX
- For example, user agents are required to close all open constructs upon
- finding the end of a style sheet unexpectedly. Thus, when parsing the string "rgb(0,0,0" (with a missing close-parenthesis) for a color value, the close
- parenthesis is implied by this error handling rule, and a value is obtained (the color 'black').
- However, the similar construct "rgb(0,0," (with both a missing
- parenthesis and a missing "blue" value) cannot be parsed, as closing the open construct does not
- result in a viable value.
+ For example, user agents are required to close all open constructs upon finding the end of a style sheet unexpectedly. Thus, when parsing the string "rgb(0,0,0" (with a missing close-parenthesis) for a color value, the close parenthesis is implied by this error handling rule, and a value is obtained (the color 'black'). However, the similar construct "rgb(0,0," (with both a missing parenthesis and a missing "blue" value) cannot be parsed, as closing the open construct does not result in a viable value.
- The following terms and features are defined in Cascading Style Sheets
- (CSS): CSS
+ The following terms and features are defined in Cascading Style Sheets (CSS): CSS
-
+
- viewport
- line box
- out-of-flow
@@ -3694,15 +2815,11 @@ a.setAttribute('href', 'https://example.com/'); // change the content attribute
- The 'visibility' property
- The basic version of the 'display' property
- is defined in CSS, and the property is extended by other CSS modules.
- CSS CSSRUBY CSSTABLE
+ The basic version of the 'display' property is defined in CSS, and the property is extended by other CSS modules. CSS CSSRUBY CSSTABLE
- The following terms and features are defined in CSS Box Model:
- CSSBOX
+ The following terms and features are defined in CSS Box Model: CSSBOX
-
+
- content area
- content box
- border box
@@ -3719,10 +2836,9 @@ a.setAttribute('href', 'https://example.com/'); // change the content attribute
'padding-right' properties
- The following features are defined in CSS Logical Properties:
- CSSLOGICAL
+ The following features are defined in CSS Logical Properties: CSSLOGICAL
-
+
- The 'margin-block',
'margin-block-start',
'margin-block-end',
@@ -3762,8 +2878,7 @@ a.setAttribute('href', 'https://example.com/'); // change the content attribute
- The 'inset-block-end' property
- The following terms and features are defined in CSS Color:
- CSSCOLOR
+ The following terms and features are defined in CSS Color: CSSCOLOR
- named color
@@ -3794,15 +2909,11 @@ a.setAttribute('href', 'https://example.com/'); // change the content attribute
- The 'object-fit' property
- The term paint
- source is used as defined in CSS Images Level 4
- to define the interaction of certain HTML elements with the CSS 'element()' function.
- CSSIMAGES4
+ The term paint source is used as defined in CSS Images Level 4 to define the interaction of certain HTML elements with the CSS 'element()' function. CSSIMAGES4
- The following features are defined in CSS Backgrounds and Borders:
- CSSBG
+ The following features are defined in CSS Backgrounds and Borders: CSSBG
-
+
- The 'background-color',
'background-image',
'background-repeat',
@@ -3826,8 +2937,7 @@ a.setAttribute('href', 'https://example.com/'); // change the content attribute
properties
- CSS Backgrounds and Borders also defines the following border properties:
- CSSBG
+ CSS Backgrounds and Borders also defines the following border properties: CSSBG
Border properties
@@ -3869,8 +2979,7 @@ a.setAttribute('href', 'https://example.com/'); // change the content attribute
- The 'justify-items' property
- The following terms and features are defined in CSS Display:
- CSSDISPLAY
+ The following terms and features are defined in CSS Display: CSSDISPLAY
- outer display type
@@ -3884,16 +2993,14 @@ a.setAttribute('href', 'https://example.com/'); // change the content attribute
- CSS box
- The following features are defined in CSS Flexible Box Layout:
- CSSFLEXBOX
+ The following features are defined in CSS Flexible Box Layout: CSSFLEXBOX
- The 'flex-direction' property
- The 'flex-wrap' property
- The following terms and features are defined in CSS Fonts:
- CSSFONTS
+ The following terms and features are defined in CSS Fonts: CSSFONTS
- first available font
@@ -3920,8 +3027,7 @@ a.setAttribute('href', 'https://example.com/'); // change the content attribute
- The 'ultra-expanded' value
- The following features are defined in CSS Forms:
- CSSFORMS
+ The following features are defined in CSS Forms: CSSFORMS
- '::picker'
@@ -3954,8 +3060,7 @@ a.setAttribute('href', 'https://example.com/'); // change the content attribute
- ideographic-under baseline
- The following terms and features are defined in CSS Box Sizing:
- CSSSIZING
+ The following terms and features are defined in CSS Box Sizing: CSSSIZING
- fit-content inline size
@@ -3963,8 +3068,7 @@ a.setAttribute('href', 'https://example.com/'); // change the content attribute
- intrinsic size
- The following features are defined in CSS Lists and Counters.
- CSSLISTS
+ The following features are defined in CSS Lists and Counters. CSSLISTS
- list item
@@ -3981,10 +3085,9 @@ a.setAttribute('href', 'https://example.com/'); // change the content attribute
- The term scroll container
- The following terms and features are defined in CSS Positioned Layout:
- CSSPOSITION
+ The following terms and features are defined in CSS Positioned Layout: CSSPOSITION
-
+
- absolutely-positioned
- The 'position' property and its
'static' value
@@ -3996,8 +3099,7 @@ a.setAttribute('href', 'https://example.com/'); // change the content attribute
- process top layer removals
- The following features are defined in CSS Multi-column Layout.
- CSSMULTICOL
+ The following features are defined in CSS Multi-column Layout. CSSMULTICOL
- The 'column-count' property
@@ -4007,14 +3109,11 @@ a.setAttribute('href', 'https://example.com/'); // change the content attribute
- The 'column-width' property
- The 'ruby-base'
- value of the 'display' property is defined in CSS Ruby Layout.
- CSSRUBY
+ The 'ruby-base' value of the 'display' property is defined in CSS Ruby Layout. CSSRUBY
The following features are defined in CSS Table: CSSTABLE
-
+
- The 'border-spacing' property
- The 'border-collapse' property
- The 'table-cell',
@@ -4036,7 +3135,7 @@ a.setAttribute('href', 'https://example.com/'); // change the content attribute
The following features are defined in CSS Writing Modes: CSSWM
-
+
- The 'direction' property
- The 'unicode-bidi' property
- The 'writing-mode' property
@@ -4053,10 +3152,9 @@ a.setAttribute('href', 'https://example.com/'); // change the content attribute
line-right concepts
- The following features are defined in CSS Basic User Interface:
- CSSUI
+ The following features are defined in CSS Basic User Interface: CSSUI
-
+
- The 'outline' property
- The 'cursor' property
- The 'appearance' property, its
@@ -4077,14 +3175,9 @@ a.setAttribute('href', 'https://example.com/'); // change the content attribute
- The 'user-select' property
- The algorithm to update
- animations and send events is defined in Web Animations.
- WEBANIMATIONS
+ The algorithm to update animations and send events is defined in Web Animations. WEBANIMATIONS
- Implementations that support scripting must support the CSS Object Model. The following
- features and terms are defined in the CSSOM specifications: CSSOM
- CSSOMVIEW
+
Implementations that support scripting must support the CSS Object Model. The following features and terms are defined in the CSSOM specifications: CSSOM CSSOMVIEW
Screen interface
@@ -4101,9 +3194,7 @@ a.setAttribute('href', 'https://example.com/'); // change the content attribute
- synchronously replace the rules of a
CSSStyleSheet
- disable a CSS style sheet
-
- CSS style sheets and their
- properties:
+ CSS style sheets and their properties:
- type
- location
@@ -4135,8 +3226,7 @@ a.setAttribute('href', 'https://example.com/'); // change the content attribute
- The clientX and clientY extension attributes of the MouseEvent interface
- The following features and terms are defined in CSS Syntax:
- CSSSYNTAX
+ The following features and terms are defined in CSS Syntax: CSSSYNTAX
- conformant style sheet
@@ -4156,17 +3246,14 @@ a.setAttribute('href', 'https://example.com/'); // change the content attribute
- type selector
- attribute selector
- pseudo-class
- :focus-visible
- pseudo-class
+ :focus-visible pseudo-class
- indicate focus
- pseudo-element
- match a selector against an element
- scoping root
- The following features are defined in CSS Values and Units:
- CSSVALUES
+ The following features are defined in CSS Values and Units: CSSVALUES
- <length>
@@ -4180,8 +3267,7 @@ a.setAttribute('href', 'https://example.com/'); // change the content attribute
- The math functions
- The following features are defined in CSS View Transitions:
- CSSVIEWTRANSITIONS
+ The following features are defined in CSS View Transitions: CSSVIEWTRANSITIONS
- perform pending transition operations
@@ -4194,12 +3280,9 @@ a.setAttribute('href', 'https://example.com/'); // change the content attribute
- can navigation trigger a cross-document view-transition?
- The term style attribute is
- defined in CSS Style Attributes. CSSATTR
+ The term style attribute is defined in CSS Style Attributes. CSSATTR
- The following terms are defined in the CSS Cascading and Inheritance:
- CSSCASCADE
+ The following terms are defined in the CSS Cascading and Inheritance: CSSCASCADE
- cascaded value
@@ -4215,16 +3298,11 @@ a.setAttribute('href', 'https://example.com/'); // change the content attribute
- initial value
- The CanvasRenderingContext2D object's use of fonts depends on the features
- described in the CSS Fonts and Font Loading specifications, including
- in particular FontFace objects and the font source concept.
- CSSFONTS CSSFONTLOAD
+ The CanvasRenderingContext2D object's use of fonts depends on the features described in the CSS Fonts and Font Loading specifications, including in particular FontFace objects and the font source concept. CSSFONTS CSSFONTLOAD
- The following interfaces and terms are defined in Geometry Interfaces:
- GEOMETRY
+ The following interfaces and terms are defined in Geometry Interfaces: GEOMETRY
-
+
DOMMatrix interface, and associated
m11 element,
m12 element,
@@ -4250,8 +3328,7 @@ a.setAttribute('href', 'https://example.com/'); // change the content attribute
- flat tree
- The following terms and features are defined in CSS Color Adjustment:
- CSSCOLORADJUST
+ The following terms and features are defined in CSS Color Adjustment: CSSCOLORADJUST
- 'color-scheme'
@@ -4287,8 +3364,7 @@ a.setAttribute('href', 'https://example.com/'); // change the content attribute
- Intersection Observer
-
-
The following term is defined in Intersection Observer:
- INTERSECTIONOBSERVER
+ The following term is defined in Intersection Observer: INTERSECTIONOBSERVER
- run the update intersection observations steps
@@ -4305,8 +3381,7 @@ a.setAttribute('href', 'https://example.com/'); // change the content attribute
- Resize Observer
-
-
The following terms are defined in Resize Observer:
- RESIZEOBSERVER
+ The following terms are defined in Resize Observer: RESIZEOBSERVER
- gather active resize observations at depth
@@ -4347,8 +3422,7 @@ a.setAttribute('href', 'https://example.com/'); // change the content attribute
- WebVTT
-
-
Implementations may support WebVTT as a text track format for subtitles, captions, metadata,
- etc., for media resources. WEBVTT
+ Implementations may support WebVTT as a text track format for subtitles, captions, metadata, etc., for media resources. WEBVTT
The following terms, used in this specification, are defined in WebVTT:
@@ -4368,17 +3442,14 @@ a.setAttribute('href', 'https://example.com/'); // change the content attribute
- ARIA
-
-
The role attribute is defined in
- Accessible Rich Internet Applications (ARIA), as are the following
- roles: ARIA
+ The role attribute is defined in Accessible Rich Internet Applications (ARIA), as are the following roles: ARIA
button
presentation
- In addition, the following aria-* content
- attributes are defined in ARIA: ARIA
+ In addition, the following aria-* content attributes are defined in ARIA: ARIA
aria-checked
@@ -4390,7 +3461,7 @@ a.setAttribute('href', 'https://example.com/'); // change the content attribute
Finally, the following terms are defined in ARIA: ARIA
-
+
- role
- accessible name
- The
ARIAMixin interface, with its associated
@@ -4457,8 +3528,7 @@ a.setAttribute('href', 'https://example.com/'); // change the content attribute
- Secure Contexts
-
-
The following algorithms are defined in Secure Contexts:
- SECURE-CONTEXTS
+ The following algorithms are defined in Secure Contexts: SECURE-CONTEXTS
- Is url potentially trustworthy?
@@ -4468,8 +3538,7 @@ a.setAttribute('href', 'https://example.com/'); // change the content attribute
- Permissions Policy
-
-
The following terms are defined in Permissions Policy:
- PERMISSIONSPOLICY
+ The following terms are defined in Permissions Policy: PERMISSIONSPOLICY
- permissions policy
@@ -4488,8 +3557,7 @@ a.setAttribute('href', 'https://example.com/'); // change the content attribute
- Payment Request API
-
-
The following feature is defined in Payment Request API:
- PAYMENTREQUEST
+ The following feature is defined in Payment Request API: PAYMENTREQUEST
PaymentRequest interface
@@ -4500,12 +3568,9 @@ a.setAttribute('href', 'https://example.com/'); // change the content attribute
- MathML
-
-
While support for MathML as a whole is not required by this specification (though it is
- encouraged, at least for web browsers), certain features depend upon small parts of MathML being
- implemented. MATHML
+ While support for MathML as a whole is not required by this specification (though it is encouraged, at least for web browsers), certain features depend upon small parts of MathML being implemented. MATHML
- The following features are defined in Mathematical Markup Language
- (MathML):
+ The following features are defined in Mathematical Markup Language (MathML):
- MathML
annotation-xml element
@@ -4523,15 +3588,11 @@ a.setAttribute('href', 'https://example.com/'); // change the content attribute
- SVG
-
-
While support for SVG as a whole is not required by this specification (though it is
- encouraged, at least for web browsers), certain features depend upon parts of SVG being
- implemented.
+ While support for SVG as a whole is not required by this specification (though it is encouraged, at least for web browsers), certain features depend upon parts of SVG being implemented.
- User agents that implement SVG must implement the SVG 2 specification, and not
- any earlier revisions.
+ User agents that implement SVG must implement the SVG 2 specification, and not any earlier revisions.
- The following features are defined in the SVG 2 specification:
- SVG
+ The following features are defined in the SVG 2 specification: SVG
SVGElement interface
@@ -4564,8 +3625,7 @@ a.setAttribute('href', 'https://example.com/'); // change the content attribute
- Compositing
-
-
The following features are defined in Compositing and Blending:
- COMPOSITE
+ The following features are defined in Compositing and Blending: COMPOSITE
- <blend-mode>
@@ -4577,8 +3637,7 @@ a.setAttribute('href', 'https://example.com/'); // change the content attribute
- Cooperative Scheduling of Background Tasks
-
-
The following features are defined in Cooperative Scheduling of Background
- Tasks: REQUESTIDLECALLBACK
+ The following features are defined in Cooperative Scheduling of Background Tasks: REQUESTIDLECALLBACK
requestIdleCallback()
@@ -4588,8 +3647,7 @@ a.setAttribute('href', 'https://example.com/'); // change the content attribute
- Screen Orientation
-
-
The following terms are defined in Screen Orientation:
- SCREENORIENTATION
+ The following terms are defined in Screen Orientation: SCREENORIENTATION
- screen orientation change steps
@@ -4703,8 +3761,7 @@ a.setAttribute('href', 'https://example.com/'); // change the content attribute
- Web Cryptography API
-
-
The following terms are defined in Web Cryptography API:
- WEBCRYPTO
+ The following terms are defined in Web Cryptography API: WEBCRYPTO
- generating a random UUID
@@ -4736,8 +3793,7 @@ a.setAttribute('href', 'https://example.com/'); // change the content attribute
- Web Authentication: An API for accessing Public Key Credentials
-
-
The following terms are defined in Web Authentication: An API for accessing Public Key
- Credentials: WEBAUTHN
+ The following terms are defined in Web Authentication: An API for accessing Public Key Credentials: WEBAUTHN
- public key credential
@@ -4780,8 +3836,7 @@ a.setAttribute('href', 'https://example.com/'); // change the content attribute
- Trusted Types
-
-
This specification uses the following features defined in Trusted Types:
- TRUSTED-TYPES
+ This specification uses the following features defined in Trusted Types: TRUSTED-TYPES
TrustedHTML
@@ -4952,17 +4007,11 @@ a.setAttribute('href', 'https://example.com/'); // change the content attribute
- This specification does not require support of any particular network protocol, style
- sheet language, scripting language, or any of the DOM specifications beyond those required in the
- list above. However, the language described by this specification is biased towards CSS as the
- styling language, JavaScript as the scripting language, and HTTP as the network protocol, and
- several features assume that those languages and protocols are in use.
+ This specification does not require support of any particular network protocol, style sheet language, scripting language, or any of the DOM specifications beyond those required in the list above. However, the language described by this specification is biased towards CSS as the styling language, JavaScript as the scripting language, and HTTP as the network protocol, and several features assume that those languages and protocols are in use.
- A user agent that implements the HTTP protocol must implement HTTP State Management
- Mechanism (Cookies) as well. HTTP COOKIES
+ A user agent that implements the HTTP protocol must implement HTTP State Management Mechanism (Cookies) as well. HTTP COOKIES
- This specification might have certain additional requirements on character
- encodings, image formats, audio formats, and video formats in the respective sections.
+ This specification might have certain additional requirements on character encodings, image formats, audio formats, and video formats in the respective sections.
@@ -4971,24 +4020,15 @@ a.setAttribute('href', 'https://example.com/'); // change the content attribute
Extensibility
- Vendor-specific proprietary user agent extensions to this specification are strongly
- discouraged. Documents must not use such extensions, as doing so reduces interoperability and
- fragments the user base, allowing only users of specific user agents to access the content in
- question.
+ Vendor-specific proprietary user agent extensions to this specification are strongly discouraged. Documents must not use such extensions, as doing so reduces interoperability and fragments the user base, allowing only users of specific user agents to access the content in question.
- All extensions must be defined so that the use of extensions neither contradicts nor causes the
- non-conformance of functionality defined in the specification.
+ All extensions must be defined so that the use of extensions neither contradicts nor causes the non-conformance of functionality defined in the specification.
- For example, while strongly discouraged from doing so, an implementation could add a new IDL
- attribute "typeTime" to a control that returned the time it took the user
- to select the current value of a control (say). On the other hand, defining a new control that
- appears in a form's elements array would be in violation
- of the above requirement, as it would violate the definition of elements given in this specification.
+ For example, while strongly discouraged from doing so, an implementation could add a new IDL attribute "typeTime" to a control that returned the time it took the user to select the current value of a control (say). On the other hand, defining a new control that appears in a form's elements array would be in violation of the above requirement, as it would violate the definition of elements given in this specification.
@@ -4996,36 +4036,17 @@ a.setAttribute('href', 'https://example.com/'); // change the content attribute
- When vendor-neutral extensions to this specification are needed, either this specification can
- be updated accordingly, or an extension specification can be written that overrides the
- requirements in this specification. When someone applying this specification to their activities
- decides that they will recognize the requirements of such an extension specification, it becomes
- an applicable specification for the purposes
- of conformance requirements in this specification.
+ When vendor-neutral extensions to this specification are needed, either this specification can be updated accordingly, or an extension specification can be written that overrides the requirements in this specification. When someone applying this specification to their activities decides that they will recognize the requirements of such an extension specification, it becomes an applicable specification for the purposes of conformance requirements in this specification.
- Someone could write a specification that defines any arbitrary byte stream as
- conforming, and then claim that their random junk is conforming. However, that does not mean that
- their random junk actually is conforming for everyone's purposes: if someone else decides that
- that specification does not apply to their work, then they can quite legitimately say that the
- aforementioned random junk is just that, junk, and not conforming at all. As far as conformance
- goes, what matters in a particular community is what that community agrees is
- applicable.
+ Someone could write a specification that defines any arbitrary byte stream as conforming, and then claim that their random junk is conforming. However, that does not mean that their random junk actually is conforming for everyone's purposes: if someone else decides that that specification does not apply to their work, then they can quite legitimately say that the aforementioned random junk is just that, junk, and not conforming at all. As far as conformance goes, what matters in a particular community is what that community agrees is applicable.
- User agents must treat elements and attributes that they do not understand as semantically
- neutral; leaving them in the DOM (for DOM processors), and styling them according to CSS (for CSS
- processors), but not inferring any meaning from them.
+ User agents must treat elements and attributes that they do not understand as semantically neutral; leaving them in the DOM (for DOM processors), and styling them according to CSS (for CSS processors), but not inferring any meaning from them.
- When support for a feature is disabled (e.g. as an emergency measure to mitigate a security
- problem, or to aid in development, or for performance reasons), user agents must act as if they
- had no support for the feature whatsoever, and as if the feature was not mentioned in this
- specification. For example, if a particular feature is accessed via an attribute in a Web IDL
- interface, the attribute itself would be omitted from the objects that implement that interface
- — leaving the attribute on the object but making it return null or throw an exception is
- insufficient.
+ When support for a feature is disabled (e.g. as an emergency measure to mitigate a security problem, or to aid in development, or for performance reasons), user agents must act as if they had no support for the feature whatsoever, and as if the feature was not mentioned in this specification. For example, if a particular feature is accessed via an attribute in a Web IDL interface, the attribute itself would be omitted from the objects that implement that interface — leaving the attribute on the object but making it return null or throw an exception is insufficient.
@@ -5034,24 +4055,13 @@ a.setAttribute('href', 'https://example.com/'); // change the content attribute
Interactions with XPath and XSLT
- Implementations of XPath 1.0 that operate on HTML
- documents parsed or created in the manners described in this specification (e.g. as part of
- the document.evaluate() API) must act as if the following edit was applied
- to the XPath 1.0 specification.
+ Implementations of XPath 1.0 that operate on HTML documents parsed or created in the manners described in this specification (e.g. as part of the document.evaluate() API) must act as if the following edit was applied to the XPath 1.0 specification.
First, remove this paragraph:
- A QName in the node test is expanded
- into an expanded-name
- using the namespace declarations from the expression context. This is the same way expansion is
- done for element type names in start and end-tags except that the default namespace declared with
- xmlns is not used: if the QName does not have a prefix, then the
- namespace URI is null (this is the same way attribute names are expanded). It is an error if the
- QName has a prefix for which there is
- no namespace declaration in the expression context.
+ A QName in the node test is expanded into an expanded-name using the namespace declarations from the expression context. This is the same way expansion is done for element type names in start and end-tags except that the default namespace declared with xmlns is not used: if the QName does not have a prefix, then the namespace URI is null (this is the same way attribute names are expanded). It is an error if the QName has a prefix for which there is no namespace declaration in the expression context.
@@ -5059,79 +4069,39 @@ a.setAttribute('href', 'https://example.com/'); // change the content attribute
- A QName in the node test is expanded into an expanded-name using the namespace declarations
- from the expression context. If the QName has a prefix, then there must be a namespace declaration for this prefix in
- the expression context, and the corresponding namespace URI is the one that is
- associated with this prefix. It is an error if the QName has a prefix for which there is no
- namespace declaration in the expression context.
+ A QName in the node test is expanded into an expanded-name using the namespace declarations from the expression context. If the QName has a prefix, then there must be a namespace declaration for this prefix in the expression context, and the corresponding namespace URI is the one that is associated with this prefix. It is an error if the QName has a prefix for which there is no namespace declaration in the expression context.
- If the QName has no prefix and the principal node type of the axis is element, then the
- default element namespace is used. Otherwise, if the QName has no prefix, the namespace URI is
- null. The default element namespace is a member of the context for the XPath expression. The
- value of the default element namespace when executing an XPath expression through the DOM3 XPath
- API is determined in the following way:
+ If the QName has no prefix and the principal node type of the axis is element, then the default element namespace is used. Otherwise, if the QName has no prefix, the namespace URI is null. The default element namespace is a member of the context for the XPath expression. The value of the default element namespace when executing an XPath expression through the DOM3 XPath API is determined in the following way:
- - If the context node is from an HTML DOM, the default element namespace is
- "http://www.w3.org/1999/xhtml".
+ - If the context node is from an HTML DOM, the default element namespace is "http://www.w3.org/1999/xhtml".
- Otherwise, the default element namespace URI is null.
- This is equivalent to adding the default element namespace feature of XPath 2.0
- to XPath 1.0, and using the HTML namespace as the default element namespace for HTML documents.
- It is motivated by the desire to have implementations be compatible with legacy HTML content
- while still supporting the changes that this specification introduces to HTML regarding the
- namespace used for HTML elements, and by the desire to use XPath 1.0 rather than XPath 2.0.
+ This is equivalent to adding the default element namespace feature of XPath 2.0 to XPath 1.0, and using the HTML namespace as the default element namespace for HTML documents. It is motivated by the desire to have implementations be compatible with legacy HTML content while still supporting the changes that this specification introduces to HTML regarding the namespace used for HTML elements, and by the desire to use XPath 1.0 rather than XPath 2.0.
- This change is a willful violation of the XPath 1.0 specification,
- motivated by desire to have implementations be compatible with legacy content while still
- supporting the changes that this specification introduces to HTML regarding which namespace is
- used for HTML elements. XPATH10
+ This change is a willful violation of the XPath 1.0 specification, motivated by desire to have implementations be compatible with legacy content while still supporting the changes that this specification introduces to HTML regarding which namespace is used for HTML elements. XPATH10
- XSLT 1.0 processors outputting to a DOM when the output
- method is "html" (either explicitly or via the defaulting rule in XSLT 1.0) are affected as
- follows:
+ XSLT 1.0 processors outputting to a DOM when the output method is "html" (either explicitly or via the defaulting rule in XSLT 1.0) are affected as follows:
- If the transformation program outputs an element in no namespace, the processor must, prior to
- constructing the corresponding DOM element node, change the namespace of the element to the
- HTML namespace, ASCII-lowercase the
- element's local name, and ASCII-lowercase the
- names of any non-namespaced attributes on the element.
+ If the transformation program outputs an element in no namespace, the processor must, prior to constructing the corresponding DOM element node, change the namespace of the element to the HTML namespace, ASCII-lowercase the element's local name, and ASCII-lowercase the names of any non-namespaced attributes on the element.
- This requirement is a willful violation of the XSLT 1.0
- specification, required because this specification changes the namespaces and case-sensitivity
- rules of HTML in a manner that would otherwise be incompatible with DOM-based XSLT
- transformations. (Processors that serialize the output are unaffected.) XSLT10
+ This requirement is a willful violation of the XSLT 1.0 specification, required because this specification changes the namespaces and case-sensitivity rules of HTML in a manner that would otherwise be incompatible with DOM-based XSLT transformations. (Processors that serialize the output are unaffected.) XSLT10
- This specification does not specify precisely how XSLT processing interacts with the HTML
- parser infrastructure (for example, whether an XSLT processor acts as if it puts any
- elements into a stack of open elements). However, XSLT processors must stop
- parsing if they successfully complete, and must update the current document
- readiness first to "interactive" and then to "complete" if they are aborted.
+ This specification does not specify precisely how XSLT processing interacts with the HTML parser infrastructure (for example, whether an XSLT processor acts as if it puts any elements into a stack of open elements). However, XSLT processors must stop parsing if they successfully complete, and must update the current document readiness first to "interactive" and then to "complete" if they are aborted.
- This specification does not specify how XSLT interacts with the navigation algorithm, how it fits in with the event loop, nor
- how error pages are to be handled (e.g. whether XSLT errors are to replace an incremental XSLT
- output, or are rendered inline, etc.).
+ This specification does not specify how XSLT interacts with the navigation algorithm, how it fits in with the event loop, nor how error pages are to be handled (e.g. whether XSLT errors are to replace an incremental XSLT output, or are rendered inline, etc.).
- There are also additional non-normative comments regarding the interaction of XSLT
- and HTML in the script element section, and of
- XSLT, XPath, and HTML in the template element
- section.
+ There are also additional non-normative comments regarding the interaction of XSLT and HTML in the script element section, and of XSLT, XPath, and HTML in the template element section.
@@ -5139,38 +4109,22 @@ a.setAttribute('href', 'https://example.com/'); // change the content attribute
Policy-controlled features
- This document defines the following policy-controlled features:
+ This document defines the following policy-controlled features:
- - "
autoplay", which has a default allowlist of 'self'.
- - "
cross-origin-isolated", which has a default allowlist of 'self'.
- - "
focus-without-user-activation", which has a default allowlist of 'self'.
+ - "
autoplay", which has a default allowlist of 'self'.
+ - "
cross-origin-isolated", which has a default allowlist of 'self'.
+ - "
focus-without-user-activation", which has a default allowlist of 'self'.
Common microsyntaxes
- There are various places in HTML that accept particular data types, such as dates or numbers.
- This section describes what the conformance criteria for content in those formats is, and how to
- parse them.
+ There are various places in HTML that accept particular data types, such as dates or numbers. This section describes what the conformance criteria for content in those formats is, and how to parse them.
- Implementers are strongly urged to carefully examine any third-party libraries
- they might consider using to implement the parsing of syntaxes described below. For example, date
- libraries are likely to implement error handling behavior that differs from what is required in
- this specification, since error-handling behavior is often not defined in specifications that
- describe date syntaxes similar to those used in this specification, and thus implementations tend
- to vary greatly in how they handle errors.
+ Implementers are strongly urged to carefully examine any third-party libraries they might consider using to implement the parsing of syntaxes described below. For example, date libraries are likely to implement error handling behavior that differs from what is required in this specification, since error-handling behavior is often not defined in specifications that describe date syntaxes similar to those used in this specification, and thus implementations tend to vary greatly in how they handle errors.
@@ -5179,9 +4133,7 @@ a.setAttribute('href', 'https://example.com/'); // change the content attribute
Common parser idioms
- Some of the micro-parsers described below follow the pattern of having an input
- variable that holds the string being parsed, and having a position variable pointing at
- the next character to parse in input.
+ Some of the micro-parsers described below follow the pattern of having an input variable that holds the string being parsed, and having a position variable pointing at the next character to parse in input.
@@ -5189,22 +4141,15 @@ a.setAttribute('href', 'https://example.com/'); // change the content attribute
Boolean attributes
- A number of attributes are boolean attributes. The
- presence of a boolean attribute on an element represents the true value, and the absence of the
- attribute represents the false value.
+ A number of attributes are boolean attributes. The presence of a boolean attribute on an element represents the true value, and the absence of the attribute represents the false value.
- If the attribute is present, its value must either be the empty string or a value that is an
- ASCII case-insensitive match for the attribute's canonical name, with no leading or
- trailing whitespace.
+ If the attribute is present, its value must either be the empty string or a value that is an ASCII case-insensitive match for the attribute's canonical name, with no leading or trailing whitespace.
- The values "true" and "false" are not allowed on boolean attributes. To represent
- a false value, the attribute has to be omitted altogether.
+ The values "true" and "false" are not allowed on boolean attributes. To represent a false value, the attribute has to be omitted altogether.
- Here is an example of a checkbox that is checked and disabled. The checked and disabled
- attributes are the boolean attributes.
+ Here is an example of a checkbox that is checked and disabled. The checked and disabled attributes are the boolean attributes.
<label><input type=checkbox checked name=cheese disabled> Cheese</label>
@@ -5222,12 +4167,7 @@ a.setAttribute('href', 'https://example.com/'); // change the content attribute
Keywords and enumerated attributes
- Some attributes, called enumerated attributes, take on a finite set of states. The state for such an
- attribute is derived by combining the attribute's value, a set of keyword/state mappings, and
- three possible special states that can also be given in the specification of the attribute. These
- special states are the invalid value default, the missing value
- default, and the empty value default.
+ Some attributes, called enumerated attributes, take on a finite set of states. The state for such an attribute is derived by combining the attribute's value, a set of keyword/state mappings, and three possible special states that can also be given in the specification of the attribute. These special states are the invalid value default, the missing value default, and the empty value default.
Multiple keywords can map to the same state.
@@ -5239,55 +4179,40 @@ a.setAttribute('href', 'https://example.com/'); // change the content attribute
If the attribute is not specified:
- If the attribute has a missing value default
- state defined, then return that missing value default
- state.
+ If the attribute has a missing value default state defined, then return that missing value default state.
Otherwise, return no state.
- If the attribute's value is an ASCII case-insensitive match for one of the
- keywords defined for the attribute, then return the state represented by that keyword.
+ If the attribute's value is an ASCII case-insensitive match for one of the keywords defined for the attribute, then return the state represented by that keyword.
- If the attribute has an empty value default state
- defined and the attribute's value is the empty string, then return that empty value default state.
+ If the attribute has an empty value default state defined and the attribute's value is the empty string, then return that empty value default state.
- If the attribute has an invalid value default state
- defined, then return that invalid value default
- state.
+ If the attribute has an invalid value default state defined, then return that invalid value default state.
Return no state.
- For authoring conformance purposes, if an enumerated attribute is specified, the attribute's
- value must be one of:
+ For authoring conformance purposes, if an enumerated attribute is specified, the attribute's value must be one of:
- An ASCII case-insensitive match for one of the conforming keywords for that
- attribute, with no leading or trailing whitespace.
- The empty string and the attribute must have an empty
- value default defined.
+ An ASCII case-insensitive match for one of the conforming keywords for that attribute, with no leading or trailing whitespace.
+ The empty string and the attribute must have an empty value default defined.
- For reflection purposes, states which have any keywords mapping
- to them are said to have a canonical keyword. This is determined as follows:
+ For reflection purposes, states which have any keywords mapping to them are said to have a canonical keyword. This is determined as follows:
If there is only one keyword mapping to the given state, then it is that keyword.
- If there is only one conforming keyword mapping to the given state, then it is
- that conforming keyword.
+ If there is only one conforming keyword mapping to the given state, then it is that conforming keyword.
- If there are two conforming keywords mapping to the given state, and one is the empty
- string, then the canonical keyword will be the conforming keyword that is not the empty
- string.
+ If there are two conforming keywords mapping to the given state, and one is the empty string, then the canonical keyword will be the conforming keyword that is not the empty string.
- Otherwise, the canonical keyword for the state will be explicitly given in the
- specification for the attribute.
+ Otherwise, the canonical keyword for the state will be explicitly given in the specification for the attribute.
@@ -5298,40 +4223,31 @@ a.setAttribute('href', 'https://example.com/'); // change the content attribute
Signed integers
- A string is a valid integer if it consists of one or more ASCII digits,
- optionally prefixed with a U+002D HYPHEN-MINUS character (-).
+ A string is a valid integer if it consists of one or more ASCII digits, optionally prefixed with a U+002D HYPHEN-MINUS character (-).
- A valid integer without a U+002D HYPHEN-MINUS (-) prefix represents the number
- that is represented in base ten by that string of digits. A valid integer
- with a U+002D HYPHEN-MINUS (-) prefix represents the number represented in base ten by
- the string of digits that follows the U+002D HYPHEN-MINUS, subtracted from zero.
+ A valid integer without a U+002D HYPHEN-MINUS (-) prefix represents the number that is represented in base ten by that string of digits. A valid integer with a U+002D HYPHEN-MINUS (-) prefix represents the number represented in base ten by the string of digits that follows the U+002D HYPHEN-MINUS, subtracted from zero.
- The rules for parsing integers are as given in the following algorithm. When
- invoked, the steps must be followed in the order given, aborting at the first step that returns a
- value. This algorithm will return either an integer or an error.
+ The rules for parsing integers are as given in the following algorithm. When invoked, the steps must be followed in the order given, aborting at the first step that returns a value. This algorithm will return either an integer or an error.
Let input be the string being parsed.
- Let position be a pointer into input, initially pointing at the
- start of the string.
+ Let position be a pointer into input, initially pointing at the start of the string.
Let sign have the value "positive".
- Skip ASCII whitespace within input given
- position.
+ Skip ASCII whitespace within input given position.
If position is past the end of input, return an error.
-
-
If the character indicated by position (the first character) is a U+002D
- HYPHEN-MINUS character (-):
+ If the character indicated by position (the first character) is a U+002D HYPHEN-MINUS character (-):
- Let sign be "negative".
@@ -5341,29 +4257,23 @@ a.setAttribute('href', 'https://example.com/'); // change the content attribute
- If position is past the end of input, return an error.
- Otherwise, if the character indicated by position (the first character) is a
- U+002B PLUS SIGN character (+):
+ Otherwise, if the character indicated by position (the first character) is a U+002B PLUS SIGN character (+):
- - Advance position to the next character. (The "
+" is
- ignored, but it is not conforming.)
+ - Advance position to the next character. (The "
+" is ignored, but it is not conforming.)
- If position is past the end of input, return an error.
- If the character indicated by position is not an ASCII digit, then return an error.
+ If the character indicated by position is not an ASCII digit, then return an error.
- Collect a sequence of code points that are ASCII digits from
- input given position, and interpret the resulting sequence as a base-ten
- integer. Let value be that integer.
+ Collect a sequence of code points that are ASCII digits from input given position, and interpret the resulting sequence as a base-ten integer. Let value be that integer.
- If sign is "positive", return value, otherwise return the result of
- subtracting value from zero.
+ If sign is "positive", return value, otherwise return the result of subtracting value from zero.
@@ -5373,27 +4283,22 @@ a.setAttribute('href', 'https://example.com/'); // change the content attribute
Non-negative integers
- A string is a valid non-negative integer if it consists of one or more ASCII
- digits.
+ A string is a valid non-negative integer if it consists of one or more ASCII digits.
- A valid non-negative integer represents the number that is represented in base ten
- by that string of digits.
+ A valid non-negative integer represents the number that is represented in base ten by that string of digits.
- The rules for parsing non-negative integers are as given in the following algorithm.
- When invoked, the steps must be followed in the order given, aborting at the first step that
- returns a value. This algorithm will return either zero, a positive integer, or an error.
+ The rules for parsing non-negative integers are as given in the following algorithm. When invoked, the steps must be followed in the order given, aborting at the first step that returns a value. This algorithm will return either zero, a positive integer, or an error.
Let input be the string being parsed.
- Let value be the result of parsing input using the
- rules for parsing integers.
+ Let value be the result of parsing input using the rules for parsing integers.
If value is an error, return an error.
@@ -5438,11 +4343,9 @@ a.setAttribute('href', 'https://example.com/'); // change the content attribute
Optionally:
- Either a U+0065 LATIN SMALL LETTER E character (e) or a U+0045 LATIN CAPITAL LETTER E
- character (E).
+ Either a U+0065 LATIN SMALL LETTER E character (e) or a U+0045 LATIN CAPITAL LETTER E character (E).
- Optionally, a U+002D HYPHEN-MINUS character (-) or U+002B PLUS SIGN character
- (+).
+ Optionally, a U+002D HYPHEN-MINUS character (-) or U+002B PLUS SIGN character (+).
A series of one or more ASCII digits.
@@ -5451,51 +4354,26 @@ a.setAttribute('href', 'https://example.com/'); // change the content attribute
- A valid floating-point number represents the number obtained by multiplying the
- significand by ten raised to the power of the exponent, where the significand is the first number,
- interpreted as base ten (including the decimal point and the number after the decimal point, if
- any, and interpreting the significand as a negative number if the whole string starts with a
- U+002D HYPHEN-MINUS character (-) and the number is not zero), and where the exponent is the
- number after the E, if any (interpreted as a negative number if there is a U+002D HYPHEN-MINUS
- character (-) between the E and the number and the number is not zero, or else ignoring a U+002B
- PLUS SIGN character (+) between the E and the number if there is one). If there is no E, then the
- exponent is treated as zero.
+ A valid floating-point number represents the number obtained by multiplying the significand by ten raised to the power of the exponent, where the significand is the first number, interpreted as base ten (including the decimal point and the number after the decimal point, if any, and interpreting the significand as a negative number if the whole string starts with a U+002D HYPHEN-MINUS character (-) and the number is not zero), and where the exponent is the number after the E, if any (interpreted as a negative number if there is a U+002D HYPHEN-MINUS character (-) between the E and the number and the number is not zero, or else ignoring a U+002B PLUS SIGN character (+) between the E and the number if there is one). If there is no E, then the exponent is treated as zero.
- The Infinity and Not-a-Number (NaN) values are not valid floating-point numbers.
+ The Infinity and Not-a-Number (NaN) values are not valid floating-point numbers.
- The valid floating-point number concept is typically only used to
- restrict what is allowed for authors, while the user agent requirements use the rules for
- parsing floating-point number values below (e.g., the max attribute of the progress element). However, in
- some cases the user agent requirements include checking if a string is a valid
- floating-point number (e.g., the value sanitization algorithm for the Number state of the input element, or the
- parse a srcset attribute algorithm).
+ The valid floating-point number concept is typically only used to restrict what is allowed for authors, while the user agent requirements use the rules for parsing floating-point number values below (e.g., the max attribute of the progress element). However, in some cases the user agent requirements include checking if a string is a valid floating-point number (e.g., the value sanitization algorithm for the Number state of the input element, or the parse a srcset attribute algorithm).
- The best
- representation of the number n as a floating-point number is the string
- obtained from running ToString(n). The abstract operation
- ToString is not uniquely determined. When there are multiple possible strings that
- could be obtained from ToString for a particular value, the user agent must always
- return the same string for that value (though it may differ from the value used by other user
- agents).
+ The best representation of the number n as a floating-point number is the string obtained from running ToString(n). The abstract operation ToString is not uniquely determined. When there are multiple possible strings that could be obtained from ToString for a particular value, the user agent must always return the same string for that value (though it may differ from the value used by other user agents).
- The rules for parsing floating-point number values are as given in the
- following algorithm. This algorithm must be aborted at the first step that returns something.
- This algorithm will return either a number or an error.
+ The rules for parsing floating-point number values are as given in the following algorithm. This algorithm must be aborted at the first step that returns something. This algorithm will return either a number or an error.
Let input be the string being parsed.
- Let position be a pointer into input, initially pointing at the
- start of the string.
+ Let position be a pointer into input, initially pointing at the start of the string.
Let value have the value 1.
@@ -5503,8 +4381,7 @@ a.setAttribute('href', 'https://example.com/'); // change the content attribute
Let exponent have the value 1.
- Skip ASCII whitespace within input given
- position.
+ Skip ASCII whitespace within input given position.
If position is past the end of input, return an error.
@@ -5519,61 +4396,41 @@ a.setAttribute('href', 'https://example.com/'); // change the content attribute
- If position is past the end of input, return an error.
- Otherwise, if the character indicated by position (the first character) is a
- U+002B PLUS SIGN character (+):
+ Otherwise, if the character indicated by position (the first character) is a U+002B PLUS SIGN character (+):
- - Advance position to the next character. (The "
+"
- is ignored, but it is not conforming.)
+ - Advance position to the next character. (The "
+" is ignored, but it is not conforming.)
- If position is past the end of input, return an error.
- If the character indicated by position is a U+002E FULL STOP (.), and that is
- not the last character in input, and the character after the character indicated by
- position is an ASCII digit, then set
- value to zero and jump to the step labeled fraction.
+ If the character indicated by position is a U+002E FULL STOP (.), and that is not the last character in input, and the character after the character indicated by position is an ASCII digit, then set value to zero and jump to the step labeled fraction.
- If the character indicated by position is not an ASCII digit, then return an error.
+ If the character indicated by position is not an ASCII digit, then return an error.
- Collect a sequence of code points that are ASCII digits from
- input given position, and interpret the resulting sequence as a base-ten
- integer. Multiply value by that integer.
+ Collect a sequence of code points that are ASCII digits from input given position, and interpret the resulting sequence as a base-ten integer. Multiply value by that integer.
- - If position is past the end of input, jump to the step labeled
- conversion.
+ - If position is past the end of input, jump to the step labeled conversion.
- Fraction: If the character indicated by position is a U+002E
- FULL STOP (.), run these substeps:
+ Fraction: If the character indicated by position is a U+002E FULL STOP (.), run these substeps:
Advance position to the next character.
- If position is past the end of input, or if the character
- indicated by position is not an ASCII digit,
- U+0065 LATIN SMALL LETTER E (e), or U+0045 LATIN CAPITAL LETTER E (E), then jump to the step
- labeled conversion.
+ If position is past the end of input, or if the character indicated by position is not an ASCII digit, U+0065 LATIN SMALL LETTER E (e), or U+0045 LATIN CAPITAL LETTER E (E), then jump to the step labeled conversion.
- If the character indicated by position is a U+0065 LATIN SMALL
- LETTER E character (e) or a U+0045 LATIN CAPITAL LETTER E character (E), skip the remainder of
- these substeps.
+ If the character indicated by position is a U+0065 LATIN SMALL LETTER E character (e) or a U+0045 LATIN CAPITAL LETTER E character (E), skip the remainder of these substeps.
Fraction loop: Multiply divisor by ten.
- - Add the value of the character indicated by position, interpreted as a
- base-ten digit (0..9) and divided by divisor, to value.
+ - Add the value of the character indicated by position, interpreted as a base-ten digit (0..9) and divided by divisor, to value.
Advance position to the next character.
- If position is past the end of input, then jump to the step
- labeled conversion.
+ If position is past the end of input, then jump to the step labeled conversion.
- If the character indicated by position is an ASCII digit, jump back to the step labeled fraction loop in these
- substeps.
+ If the character indicated by position is an ASCII digit, jump back to the step labeled fraction loop in these substeps.
@@ -5582,51 +4439,39 @@ a.setAttribute('href', 'https://example.com/'); // change the content attribute
Advance position to the next character.
- If position is past the end of input, then jump to the step
- labeled conversion.
+ If position is past the end of input, then jump to the step labeled conversion.
-
-
If the character indicated by position is a U+002D HYPHEN-MINUS character
- (-):
+ If the character indicated by position is a U+002D HYPHEN-MINUS character (-):
- Change exponent to −1.
- Advance position to the next character.
- If position is past the end of input, then jump to the step
- labeled conversion.
+ If position is past the end of input, then jump to the step labeled conversion.
- Otherwise, if the character indicated by position is a U+002B PLUS SIGN
- character (+):
+ Otherwise, if the character indicated by position is a U+002B PLUS SIGN character (+):
- Advance position to the next character.
- If position is past the end of input, then jump to the step
- labeled conversion.
+ If position is past the end of input, then jump to the step labeled conversion.
- If the character indicated by position is not an ASCII digit, then jump to the step labeled conversion.
+ If the character indicated by position is not an ASCII digit, then jump to the step labeled conversion.
- Collect a sequence of code points that are ASCII digits from
- input given position, and interpret the resulting sequence as a base-ten
- integer. Multiply exponent by that integer.
+ Collect a sequence of code points that are ASCII digits from input given position, and interpret the resulting sequence as a base-ten integer. Multiply exponent by that integer.
Multiply value by ten raised to the exponentth power.
- Conversion: Let S be the set of finite IEEE 754 double-precision
- floating-point values except −0, but with two special values added: 21024 and −21024.
+ Conversion: Let S be the set of finite IEEE 754 double-precision floating-point values except −0, but with two special values added: 21024 and −21024.
- Let rounded-value be the number in S that is closest to
- value, selecting the number with an even significand if there are two equally close
- values. (The two special values 21024 and −21024
- are considered to have even significands for this purpose.)
+ Let rounded-value be the number in S that is closest to value, selecting the number with an even significand if there are two equally close values. (The two special values 21024 and −21024 are considered to have even significands for this purpose.)
If rounded-value is 21024 or −21024, return an error.
@@ -5641,33 +4486,23 @@ a.setAttribute('href', 'https://example.com/'); // change the content attribute
Percentages and lengths
- The rules for parsing dimension values are as given in the following algorithm. When
- invoked, the steps must be followed in the order given, aborting at the first step that returns a
- value. This algorithm will return either a number greater than or equal to 0.0, or failure; if a
- number is returned, then it is further categorized as either a percentage or a length.
+ The rules for parsing dimension values are as given in the following algorithm. When invoked, the steps must be followed in the order given, aborting at the first step that returns a value. This algorithm will return either a number greater than or equal to 0.0, or failure; if a number is returned, then it is further categorized as either a percentage or a length.
Let input be the string being parsed.
- Let position be a position variable for input,
- initially pointing at the start of input.
+ Let position be a position variable for input, initially pointing at the start of input.
- Skip ASCII whitespace within input given
- position.
+ Skip ASCII whitespace within input given position.
- If position is past the end of input or the code point at
- position within input is not an ASCII
- digit, then return failure.
+ If position is past the end of input or the code point at position within input is not an ASCII digit, then return failure.
- Collect a sequence of code points that are ASCII digits from
- input given position, and interpret the resulting sequence as a base-ten
- integer. Let value be that number.
+ Collect a sequence of code points that are ASCII digits from input given position, and interpret the resulting sequence as a base-ten integer. Let value be that number.
- If position is past the end of input, then return value
- as a length.
+ If position is past the end of input, then return value as a length.
-
If the code point at position within input is U+002E (.), then:
@@ -5675,10 +4510,7 @@ a.setAttribute('href', 'https://example.com/'); // change the content attribute
Advance position by 1.
- If position is past the end of input or the code point at
- position within input is not an ASCII
- digit, then return the current dimension value with value,
- input, and position.
+ If position is past the end of input or the code point at position within input is not an ASCII digit, then return the current dimension value with value, input, and position.
Let divisor have the value 1.
@@ -5688,37 +4520,29 @@ a.setAttribute('href', 'https://example.com/'); // change the content attribute
Multiply divisor by ten.
- Add the value of the code point at position within input,
- interpreted as a base-ten digit (0..9) and divided by divisor, to
- value.
+ Add the value of the code point at position within input, interpreted as a base-ten digit (0..9) and divided by divisor, to value.
Advance position by 1.
- If position is past the end of input, then return
- value as a length.
+ If position is past the end of input, then return value as a length.
- If the code point at position within input is not an ASCII digit, then break.
+ If the code point at position within input is not an ASCII digit, then break.
- Return the current dimension value with value, input,
- and position.
+ Return the current dimension value with value, input, and position.
- The current dimension value, given value, input, and
- position, is determined as follows:
+ The current dimension value, given value, input, and position, is determined as follows:
- If position is past the end of input, then return value
- as a length.
+ If position is past the end of input, then return value as a length.
- If the code point at position within input is U+0025 (%), then
- return value as a percentage.
+ If the code point at position within input is U+0025 (%), then return value as a percentage.
Return value as a length.
@@ -5727,17 +4551,12 @@ a.setAttribute('href', 'https://example.com/'); // change the content attribute
Nonzero percentages and lengths
- The rules for parsing nonzero dimension
- values are as given in the following algorithm. When invoked, the steps must be followed in
- the order given, aborting at the first step that returns a value. This algorithm will return
- either a number greater than 0.0, or an error; if a number is returned, then it is further
- categorized as either a percentage or a length.
+ The rules for parsing nonzero dimension values are as given in the following algorithm. When invoked, the steps must be followed in the order given, aborting at the first step that returns a value. This algorithm will return either a number greater than 0.0, or an error; if a number is returned, then it is further categorized as either a percentage or a length.
Let input be the string being parsed.
- Let value be the result of parsing input using the rules for
- parsing dimension values.
+ Let value be the result of parsing input using the rules for parsing dimension values.
If value is an error, return an error.
@@ -5755,11 +4574,7 @@ a.setAttribute('href', 'https://example.com/'); // change the content attribute
Lists of floating-point numbers
- A valid list of floating-point numbers is a number of valid floating-point numbers separated by U+002C COMMA characters,
- with no other characters (e.g. no ASCII whitespace). In addition, there might be
- restrictions on the number of floating-point numbers that can be given, or on the range of values
- allowed.
+ A valid list of floating-point numbers is a number of valid floating-point numbers separated by U+002C COMMA characters, with no other characters (e.g. no ASCII whitespace). In addition, there might be restrictions on the number of floating-point numbers that can be given, or on the range of values allowed.
@@ -5770,38 +4585,26 @@ a.setAttribute('href', 'https://example.com/'); // change the content attribute
Let input be the string being parsed.
- Let position be a pointer into input, initially pointing at the
- start of the string.
+ Let position be a pointer into input, initially pointing at the start of the string.
- Let numbers be an initially empty list of floating-point numbers. This list
- will be the result of this algorithm.
+ Let numbers be an initially empty list of floating-point numbers. This list will be the result of this algorithm.
- Collect a sequence of code points that are ASCII whitespace,
- U+002C COMMA, or U+003B SEMICOLON characters from input given position.
- This skips past any leading delimiters.
+ Collect a sequence of code points that are ASCII whitespace, U+002C COMMA, or U+003B SEMICOLON characters from input given position. This skips past any leading delimiters.
While position is not past the end of input:
- Collect a sequence of code points that are not ASCII
- whitespace, U+002C COMMA, U+003B SEMICOLON, ASCII digits, U+002E FULL STOP,
- or U+002D HYPHEN-MINUS characters from input given position. This skips
- past leading garbage.
+ Collect a sequence of code points that are not ASCII whitespace, U+002C COMMA, U+003B SEMICOLON, ASCII digits, U+002E FULL STOP, or U+002D HYPHEN-MINUS characters from input given position. This skips past leading garbage.
- Collect a sequence of code points that are not ASCII
- whitespace, U+002C COMMA, or U+003B SEMICOLON characters from input given
- position, and let unparsed number be the result.
+ Collect a sequence of code points that are not ASCII whitespace, U+002C COMMA, or U+003B SEMICOLON characters from input given position, and let unparsed number be the result.
- Let number be the result of parsing unparsed number using the
- rules for parsing floating-point number values.
+ Let number be the result of parsing unparsed number using the rules for parsing floating-point number values.
If number is an error, set number to zero.
Append number to numbers.
- Collect a sequence of code points that are ASCII whitespace,
- U+002C COMMA, or U+003B SEMICOLON characters from input given position.
- This skips past the delimiter.
+ Collect a sequence of code points that are ASCII whitespace, U+002C COMMA, or U+003B SEMICOLON characters from input given position. This skips past the delimiter.
@@ -5819,18 +4622,14 @@ a.setAttribute('href', 'https://example.com/'); // change the content attribute
cols="" and rows="" on