diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 5d1ee8e3704..af63a0bacfe 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -109,6 +109,122 @@ is. End tags must not be omitted (except where it is consistent to do so) and attribute values must be quoted (use double quotes). +### Algorithms + +[The Infra Standard](https://infra.spec.whatwg.org/#algorithms) sets out the basics of algorithms, but the HTML spec goes way beyond that. + +When contributing to HTML, we attempt to mark up algorithms and variable scopes. The main visible benefit of this is that it gives "var highlighting", where clicking on a `` element highlights all other references to it. Behind the scenes, it also enables various static analysis checks. Do your best to follow the below guidelines when introducing new algorithms or modifying existing ones. + +HTML's algorithm system is based on, and intended to be compatible with, [that of Bikeshed](https://speced.github.io/bikeshed/#var-and-algorithms) (a build tool often used for other specifications). + +#### The markup + +Each algorithm should be wrapped in `
...
`. The contents of this `
` should not be indented. + +The 'body' of an algorithm will normally be preceded by a 'preamble', some text that gives: + +* the name of the algorithm, or some indication of how/when it is invoked; +* the names and/or types of any parameters; and +* maybe the type of the return value, if any. + +Include this preamble within the `
`. Sometimes the preamble will be preceded by other stuff (not specific to the algorithm) in the same `

`. It's generally okay to include the other stuff within the `

`, but consider splitting it off into its own `

`, so that the `

` can be focused on the algorithm. + +If the algorithm is followed by one or more paragraphs that refer to any of the algorithm's variables, include those paragraphs within the `
`, so that they can participate in var-highlighting. + +Sometimes, a set of related algorithms (e.g., the 4 associated algorithms of a reflected target) are presented in a `
`, where each `
/
` pair are (roughly speaking) the preamble and body of an algorithm. In these cases, each `
/
` pair is wrapped in `
...
`. + +--- + +According to the Infra standard, "very short algorithms can be declared and specified using a single sentence". (The HTML spec sometimes strains the idea of "very short".) So an algorithm might be contained by a single `

` element, and you might be tempted to just add the `algorithm` attribute to the `

`. But we prefer + +```html +

+

...

+
+``` + +over + +```html +

...

+``` + +as it makes refactoring easier, and is easy to spot. + +In fact, a single `

` can contain two or more single-sentence algorithms. For instance, this sometimes happens with the getter and setter steps of an IDL attribute. You might think that each algorithm should get its own markup, but it's okay to put a single `

` around the multiple algorithms in the `

`. + +--- + +In Bikeshed, the `algorithm` attribute has an optional value, which supplies the name of the algorithm. In the HTML spec, don't give the `algorithm` attribute a value. + +#### What qualifies as an algorithm? + +Algorithms are easy to spot when the body is a block element like `

    ` or `
    ` (when used like a 'switch' statement). But the existence of single-sentence algorithms (see above) can make it harder to know when you've written an algorithm. + +Here are some categories of algorithms (roughly from commonest to rarest): + +* Generally, if you have a term in a `` element, followed by a description of how to 'implement' that term, that's probably an algorithm. Likewise if the term is in a `` element; the `` might be elsewhere in the spec, or even in a different spec. + +* Most Web IDL interface members (attributes and operations) have associated behavior. Any text that defines such behavior is an algorithm, even it just says that an IDL attribute reflects a content attribute, or that a method does nothing. + +* Text of roughly the form + + ```html + When [something happens], the user agent must [do something]. + ``` + + or + + ```html + When [something happens], [do something]. + ``` + + is probably an algorithm. + +* The behavior of each tokenization state is an algorithm. Similarly for the behavior of each insertion mode. + +* The JavaScript spec declares some internal methods and implementation-defined abstract operations, but leaves their definitions to the 'host'. Any text that defines such JavaScript-related behavior is an algorithm. Typically, the method/operation's signature (name and parameter list) is given in an `` element; include this in the `
    `. + +* There are format-definitions, which typically start with wording such as: + + ```html + A string is a foo if it consists of... + ``` + + or + + ```html + A foo is a string containing... + ``` + + These aren't algorithms per se, but they're wrapped in `
    ` by special dispensation. + +* Even algorithms that appear in examples should be marked up. + +Note that this list isn't exhaustive. There are things that are clearly algorithms that don't fit into any of the above categories. There are cases where it's unclear. + +And it's possible that we'll change our minds about what should be marked as an algorithm. + +### `` and `var-scope` + +For every `` element, one or more of the following should be true: + +* It has the `ignore` attribute. +* It is within an element with the `var-scope` attribute. +* It is within an element with the `algorithm` attribute. +* It is within a `
    ` element with `class="domintro"`. + +The build process will complain if it finds an 'unscoped' ``, one for which none of the above is true. + +Most of the time, any `` element that you introduce will be within a `
    ` or a `
    `. But for other cases, the question arises as to whether to mark a `` with `ignore` or mark an ancestor with `var-scope` (possibly creating a `
    ` to have the `var-scope`). Here are some guidelines: + +- When you have a set of consecutive algorithms that share variables, put `
    ...
    ` around the algorithms and any preamble that mentions the shared variables. +- In any context that has two or more `` elements with the same variable-name, mark the context with `var-scope`, or put a `
    ` around it, so that the ``s will participate in var-highlighting. +- Even when a context has only single-use ``s, it can be easier (if there's enough of them) to mark the context `var-scope` rather than mark each `` as `ignore`. +- But if a context has only one ``, or two with different variable-names, probably use `ignore`. + +But there's an additional situation in which to use `ignore`. In addition to looking for unscoped ``s, the build process will examine the ``s within each algorithm. Typically, a given variable-name will appear at least twice in an algorithm: once when it's declared/defined, and one or more times when it's used. So it's supicious if a variable-name appears only *once* within an algorithm, and the build process will raise a warning about it. If you have a `` that should be ignored by this check, mark it with `ignore`. + ### Common mistakes around prose style Most of the style conventions in this section are covered by Infra or the WHATWG style guide, but the editors often have to correct them in contributions anyway. @@ -123,7 +239,7 @@ Most of the style conventions in this section are covered by Infra or the WHATWG
  1. If (all|any) of the following are true:

    - +
    • condition 1;

    • @@ -136,7 +252,7 @@ Most of the style conventions in this section are covered by Infra or the WHATWG

      then…

      - +
    • Baz.

    • ``` - **Conjugate algorithm invocations inline** so they read more naturally in English, instead of more procedurally. For [example](https://github.com/whatwg/html/pull/9778#discussion_r1574075112), use `the result of getting the popcorn` instead of `the result of running get the popcorn`. diff --git a/source b/source index 434a87ae0ad..93ec67949e4 100644 --- a/source +++ b/source @@ -58,6 +58,7 @@ +
+

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.

The following solution suffers from race conditions:

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

  2. @@ -1658,6 +1664,7 @@ a.setAttribute('href', 'https://example.com/'); // change the content attribute
  3. Return p.

+

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, @@ -1666,6 +1673,7 @@ a.setAttribute('href', 'https://example.com/'); // change the content attribute

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

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

  2. @@ -1694,6 +1702,7 @@ a.setAttribute('href', 'https://example.com/'); // change the content attribute
  3. Return p.

+

The steps would now queue and the race is avoided.

@@ -1774,6 +1783,7 @@ a.setAttribute('href', 'https://example.com/'); // change the content attribute steps all defined for the element's local name.

+

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

@@ -1802,7 +1812,9 @@ a.setAttribute('href', 'https://example.com/'); // change the content attribute process internal resource links given insertedNode's node document.

+
+

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

@@ -1814,7 +1826,9 @@ a.setAttribute('href', 'https://example.com/'); // change the content attribute 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:

@@ -1851,7 +1865,9 @@ a.setAttribute('href', 'https://example.com/'); // change the content attribute 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:

@@ -1867,7 +1883,9 @@ a.setAttribute('href', 'https://example.com/'); // change the content attribute the same tree, then reset the form owner of movedNode.

+
+

A node is inserted into a document when the insertion steps are invoked @@ -1876,14 +1894,18 @@ a.setAttribute('href', 'https://example.com/'); // change the content attribute from a document|node is removed from a document" export>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 is browsing-context connected when it is connected and its shadow-including root's browsing context is non-null. A node 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

@@ -2434,7 +2457,7 @@ a.setAttribute('href', 'https://example.com/'); // change the content attribute
  • Relative URL
  • registrable domain
  • The URL parser -
  • The basic URL parser and its +
  • The basic URL parser and its url and state override arguments, as well as these parser states: @@ -3152,7 +3175,7 @@ a.setAttribute('href', 'https://example.com/'); // change the content attribute
  • The HostGetImportMetaProperties abstract operation
  • The typeof operator
  • The delete operator
  • -
  • The TypedArray Constructors table
  • +
  • The TypedArray Constructors table
  • User agents that support JavaScript must also implement the Dynamic Code Brand @@ -3349,7 +3372,7 @@ a.setAttribute('href', 'https://example.com/'); // change the content attribute

  • The terms quirks mode, limited-quirks mode, and no-quirks mode
  • -
  • The algorithm clone a node with its arguments +
  • The algorithm clone a node with its arguments document, subtree, parent, and @@ -5154,7 +5177,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 +

    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.

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

    Multiple keywords can map to the same state.

    +

    To determine the state of an attribute, use the following steps:

      @@ -5234,6 +5258,7 @@ a.setAttribute('href', 'https://example.com/'); // change the content attribute
    1. Return no state.

    +

    For authoring conformance purposes, if an enumerated attribute is specified, the attribute's value must be one of:

    @@ -5245,6 +5270,7 @@ a.setAttribute('href', 'https://example.com/'); // change the content attribute 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:

    @@ -5261,6 +5287,7 @@ a.setAttribute('href', 'https://example.com/'); // change the content attribute
  • Otherwise, the canonical keyword for the state will be explicitly given in the specification for the attribute.

  • +
    @@ -5268,16 +5295,21 @@ 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 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.

    @@ -5331,20 +5363,26 @@ a.setAttribute('href', 'https://example.com/'); // change the content attribute
  • If sign is "positive", return value, otherwise return the result of subtracting value from zero.

  • +
    Non-negative integers
    +

    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.

    +
    +

    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.

    @@ -5361,6 +5399,7 @@ a.setAttribute('href', 'https://example.com/'); // change the content attribute
  • Return value.

  • +
    @@ -5369,6 +5408,7 @@ a.setAttribute('href', 'https://example.com/'); // change the content attribute
    Floating-point numbers
    +

    A string is a valid floating-point number if it consists of:

      @@ -5406,7 +5446,9 @@ 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 @@ -5416,6 +5458,7 @@ a.setAttribute('href', 'https://example.com/'); // change the content attribute 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.

    @@ -5431,6 +5474,7 @@ a.setAttribute('href', 'https://example.com/'); // change the content attribute data-x="attr-input-type-number">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 @@ -5438,7 +5482,9 @@ a.setAttribute('href', 'https://example.com/'); // change the content attribute 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.

    @@ -5584,6 +5630,7 @@ a.setAttribute('href', 'https://example.com/'); // change the content attribute
  • Return rounded-value.

  • +
    @@ -5591,6 +5638,7 @@ 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 @@ -5657,7 +5705,9 @@ a.setAttribute('href', 'https://example.com/'); // change the content attribute

  • Return the current dimension value with value, input, and position.

  • +
    +

    The current dimension value, given value, input, and position, is determined as follows:

    @@ -5670,9 +5720,11 @@ a.setAttribute('href', 'https://example.com/'); // change the content attribute
  • Return value as a length.

  • +
    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 @@ -5693,20 +5745,24 @@ a.setAttribute('href', 'https://example.com/'); // change the content attribute

  • Return value as a length.

  • +
    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.

    +
    +

    The rules for parsing a list of floating-point numbers are as follows:

      @@ -5749,6 +5805,7 @@ a.setAttribute('href', 'https://example.com/'); // change the content attribute
    1. Return numbers.

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

    The rules for parsing a list of dimensions are as follows. These rules return a list of zero or more pairs consisting of a number and a unit, the unit being one of percentage, relative, and absolute.

    @@ -5838,18 +5896,21 @@ a.setAttribute('href', 'https://example.com/'); // change the content attribute
  • Return the list result.

  • +

    Dates and times

    +

    In the algorithms below, the number of days in month month of year year is: 31 if month is 1, 3, 5, 7, 8, 10, or 12; 30 if month is 4, 6, 9, or 11; 29 if month is 2 and year is a number divisible by 400, or if year is a number divisible by 4 but not by 100; and 28 otherwise. This takes into account leap years in the Gregorian calendar. GREGORIAN

    +

    When ASCII digits are used in the date and time syntaxes defined in this section, they express numbers in base ten.

    @@ -5883,6 +5944,7 @@ a.setAttribute('href', 'https://example.com/'); // change the content attribute date with no time-zone information and no date information beyond a year and a month. GREGORIAN

    +

    A string is a valid month string representing a year year and month month if it consists of the following components in the given order:

    @@ -5894,9 +5956,11 @@ a.setAttribute('href', 'https://example.com/'); // change the content attribute
  • Two ASCII digits, representing the month month, in the range 1 ≤ month ≤ 12
  • +
    +

    The rules to parse a month string are as follows. This will return either a year and month, or nothing. If at any point the algorithm says that it "fails", this means that it is aborted at that point and returns nothing.

    @@ -5914,7 +5978,9 @@ a.setAttribute('href', 'https://example.com/'); // change the content attribute
  • Return year and month.

  • +
    +

    The rules to parse a month component, given an input string and a position, are as follows. This will return either a year and a month, or nothing. If at any point the algorithm says that it "fails", this means that it is aborted at that @@ -5941,6 +6007,7 @@ a.setAttribute('href', 'https://example.com/'); // change the content attribute

  • Return year and month.

  • +
    @@ -5951,6 +6018,7 @@ a.setAttribute('href', 'https://example.com/'); // change the content attribute date with no time-zone information, consisting of a year, a month, and a day. GREGORIAN

    +

    A string is a valid date string representing a year year, month month, and day day if it consists of the following components in the given order:

    @@ -5964,9 +6032,11 @@ a.setAttribute('href', 'https://example.com/'); // change the content attribute 1 ≤ day ≤ maxday where maxday is the number of days in the month month and year year +
    +

    The rules to parse a date string are as follows. This will return either a date, or nothing. If at any point the algorithm says that it "fails", this means that it is aborted at that point and returns nothing.

    @@ -5985,7 +6055,9 @@ a.setAttribute('href', 'https://example.com/'); // change the content attribute
  • Return date.

  • +
    +

    The rules to parse a date component, given an input string and a position, are as follows. This will return either a year, a month, and a day, or nothing. If at any point the algorithm says that it "fails", this means that it is aborted at @@ -6009,6 +6081,7 @@ a.setAttribute('href', 'https://example.com/'); // change the content attribute

  • Return year, month, and day.

  • +
    @@ -6018,6 +6091,7 @@ a.setAttribute('href', 'https://example.com/'); // change the content attribute

    A yearless date consists of a Gregorian month and a day within that month, but with no associated year. GREGORIAN

    +

    A string is a valid yearless date string representing a month month and a day day if it consists of the following components in the given order:

    @@ -6037,9 +6111,11 @@ a.setAttribute('href', 'https://example.com/'); // change the content attribute

    In other words, if the month is "02", meaning February, then the day can be 29, as if the year was a leap year.

    +
    +

    The rules to parse a yearless date string are as follows. This will return either a month and a day, or nothing. If at any point the algorithm says that it "fails", this means that it is aborted at that point and returns nothing.

    @@ -6056,7 +6132,9 @@ a.setAttribute('href', 'https://example.com/'); // change the content attribute
  • Return month and day.

  • +
    +

    The rules to parse a yearless date component, given an input string and a position, are as follows. This will return either a month and a day, or nothing. If at any point the algorithm says that it "fails", this means that it is aborted @@ -6091,6 +6169,7 @@ a.setAttribute('href', 'https://example.com/'); // change the content attribute

  • Return month and day.

  • +
    @@ -6100,6 +6179,7 @@ a.setAttribute('href', 'https://example.com/'); // change the content attribute

    A time consists of a specific time with no time-zone information, consisting of an hour, a minute, a second, and a fraction of a second.

    +

    A string is a valid time string representing an hour hour, a minute minute, and a second second if it consists of the following components in the given order:

    @@ -6136,9 +6216,11 @@ a.setAttribute('href', 'https://example.com/'); // change the content attribute

    The second component cannot be 60 or 61; leap seconds cannot be represented.

    +
    +

    The rules to parse a time string are as follows. This will return either a time, or nothing. If at any point the algorithm says that it "fails", this means that it is aborted at that point and returns nothing.

    @@ -6157,7 +6239,9 @@ a.setAttribute('href', 'https://example.com/'); // change the content attribute
  • Return time.

  • +
    +

    The rules to parse a time component, given an input string and a position, are as follows. This will return either an hour, a minute, and a second, or nothing. If at any point the algorithm says that it "fails", this means that it is @@ -6209,6 +6293,7 @@ a.setAttribute('href', 'https://example.com/'); // change the content attribute

  • Return hour, minute, and second.

  • +
    @@ -6220,6 +6305,7 @@ a.setAttribute('href', 'https://example.com/'); // change the content attribute consisting of an hour, a minute, a second, and a fraction of a second, but expressed without a time zone. GREGORIAN

    +

    A string is a valid local date and time string representing a date and time if it consists of the following components in the given order:

    @@ -6230,7 +6316,9 @@ a.setAttribute('href', 'https://example.com/'); // change the content attribute
  • A valid time string representing the time
  • +
    +

    A string is a valid normalized local date and time string representing a date and time if it consists of the following components in the given order:

    @@ -6244,9 +6332,11 @@ a.setAttribute('href', 'https://example.com/'); // change the content attribute string for the given time (e.g. omitting the seconds component entirely if the given time is zero seconds past the minute) +
    +

    The rules to parse a local date and time string are as follows. This will return either a date and time, or nothing. If at any point the algorithm says that it "fails", this means that it is aborted at that point and returns nothing.

    @@ -6274,6 +6364,7 @@ a.setAttribute('href', 'https://example.com/'); // change the content attribute
  • Return date and time.

  • +
    @@ -6283,6 +6374,7 @@ a.setAttribute('href', 'https://example.com/'); // change the content attribute

    A time-zone offset consists of a signed number of hours and minutes.

    +

    A string is a valid time-zone offset string representing a time-zone offset if it consists of either:

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

    This format allows for time-zone offsets from -23:59 to +23:59. Right now, in practice, the range of offsets of actual time zones is -12:00 to +14:00, and the minutes component @@ -6321,6 +6414,7 @@ a.setAttribute('href', 'https://example.com/'); // change the content attribute

    +

    The rules to parse a time-zone offset string are as follows. This will return either a time-zone offset, or nothing. If at any point the algorithm says that it "fails", this means that it is aborted at that point and returns nothing.

    @@ -6339,7 +6433,9 @@ a.setAttribute('href', 'https://example.com/'); // change the content attribute
  • Return the time-zone offset that is timezonehours hours and timezoneminutes minutes from UTC.

  • +
    +

    The rules to parse a time-zone offset component, given an input string and a position, are as follows. This will return either time-zone hours and time-zone minutes, or nothing. If at any point the algorithm says that it "fails", this means @@ -6417,6 +6513,7 @@ a.setAttribute('href', 'https://example.com/'); // change the content attribute

  • Return timezonehours and timezoneminutes.

  • +
    @@ -6428,6 +6525,7 @@ a.setAttribute('href', 'https://example.com/'); // change the content attribute consisting of an hour, a minute, a second, and a fraction of a second, expressed with a time-zone offset, consisting of a signed number of hours and minutes. GREGORIAN

    +

    A string is a valid global date and time string representing a date, time, and a time-zone offset if it consists of the following components in the given order:

    @@ -6440,6 +6538,7 @@ a.setAttribute('href', 'https://example.com/'); // change the content attribute
  • A valid time-zone offset string representing the time-zone offset
  • +

    Times in dates before the formation of UTC in the mid-twentieth century must be expressed and interpreted in terms of UT1 (contemporary Earth solar time at the 0° longitude), not UTC (the @@ -6505,6 +6604,7 @@ a.setAttribute('href', 'https://example.com/'); // change the content attribute

    +

    The rules to parse a global date and time string are as follows. This will return either a time in UTC, with associated time-zone offset information for round-tripping or display purposes, or nothing. If at any point the algorithm says that it "fails", this means that it is @@ -6543,6 +6643,7 @@ a.setAttribute('href', 'https://example.com/'); // change the content attribute

  • Return time and timezone.

  • +
    @@ -6556,16 +6657,20 @@ a.setAttribute('href', 'https://example.com/'); // change the content attribute 1970. Consecutive weeks are numbered sequentially. The week before the number 1 week in a week-year is the last week in the previous week-year, and vice versa. GREGORIAN

    +

    A week-year with a number year has 53 weeks if it corresponds to either a year year in the proleptic Gregorian calendar that has a Thursday as its first day (January 1st), or a year year in the proleptic Gregorian calendar that has a Wednesday as its first day (January 1st) and where year is a number divisible by 400, or a number divisible by 4 but not by 100. All other week-years have 52 weeks.

    +
    +

    The week number of the last day of a week-year with 53 weeks is 53; the week number of the last day of a week-year with 52 weeks is 52.

    +
    -

    The week-year number of a particular day can be different than the number of the +

    The week-year number of a particular day can be different than the number of the year that contains that day in the proleptic Gregorian calendar. The first week in a week-year y is the week that contains the first Thursday of the Gregorian year y.

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

    For modern purposes, a week as defined here is equivalent to ISO weeks as defined in ISO 8601. ISO8601

    +

    A string is a valid week string representing a week-year year and week week if it consists of the following components in the given order:

    @@ -6587,9 +6693,11 @@ a.setAttribute('href', 'https://example.com/'); // change the content attribute
  • Two ASCII digits, representing the week week, in the range 1 ≤ week ≤ maxweek, where maxweek is the week number of the last day of week-year year
  • +
    +

    The rules to parse a week string are as follows. This will return either a week-year number and week number, or nothing. If at any point the algorithm says that it "fails", this means that it is aborted at that point and returns nothing.

    @@ -6629,6 +6737,7 @@ a.setAttribute('href', 'https://example.com/'); // change the content attribute
  • Return the week-year number year and the week number week.

  • +
    @@ -6647,6 +6756,7 @@ a.setAttribute('href', 'https://example.com/'); // change the content attribute include months (or years, which are equivalent to twelve months). Only durations that describe a specific number of seconds can be described.

    +

    A string is a valid duration string representing a duration t if it consists of either of the following:

    @@ -6776,9 +6886,11 @@ a.setAttribute('href', 'https://example.com/'); // change the content attribute human-readable alternative to the ISO 8601 duration format.

    +
    +

    The rules to parse a duration string are as follows. This will return either a duration or nothing. If at any point the algorithm says that it "fails", this means that it is aborted at that point and returns nothing.

    @@ -6979,12 +7091,14 @@ a.setAttribute('href', 'https://example.com/'); // change the content attribute
  • Return the duration consisting of seconds seconds.

  • +
    Vaguer moments in time
    +

    A string is a valid date string with optional time if it is also one of the following:

    @@ -6993,11 +7107,13 @@ a.setAttribute('href', 'https://example.com/'); // change the content attribute
  • A valid global date and time string
  • +

    +

    The rules to parse a date or time string are as follows. The algorithm will return either a date, a time, a global date and time, or nothing. If at any point the algorithm @@ -7058,6 +7174,7 @@ a.setAttribute('href', 'https://example.com/'); // change the content attribute minutes from UTC; and return time and timezone.

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

    Legacy colors

    +

    Some obsolete legacy attributes parse colors using the rules for parsing a legacy color value, given a string input. They will return either a CSS color or failure.

    @@ -7147,6 +7265,7 @@ a.setAttribute('href', 'https://example.com/'); // change the content attribute
  • Return result.

    +
  • @@ -7154,19 +7273,25 @@ a.setAttribute('href', 'https://example.com/'); // change the content attribute

    Space-separated tokens

    +

    A set of space-separated tokens is a string containing zero or more words (known as tokens) separated by one or more ASCII whitespace, where words consist of any string of one or more characters, none of which are ASCII whitespace.

    A string containing a set of space-separated tokens may have leading or trailing ASCII whitespace.

    +
    +

    An unordered set of unique space-separated tokens is a set of space-separated tokens where none of the tokens are duplicated.

    +
    +

    An ordered set of unique space-separated tokens is a set of space-separated tokens where none of the tokens are duplicated but where the order of the tokens is meaningful.

    +

    Sets of space-separated tokens sometimes have a defined set of allowed values. When a set of allowed values is defined, the tokens must all @@ -7180,11 +7305,13 @@ a.setAttribute('href', 'https://example.com/'); // change the content attribute

    Comma-separated tokens

    +

    A set of comma-separated tokens is a string containing zero or more tokens each separated from the next by a single U+002C COMMA character (,), where tokens consist of any string of zero or more characters, neither beginning nor ending with ASCII whitespace, nor containing any U+002C COMMA characters (,), and optionally surrounded by ASCII whitespace.

    +

    For instance, the string " a ,b,,d d " consists of four tokens: "a", "b", the empty @@ -7200,13 +7327,16 @@ a.setAttribute('href', 'https://example.com/'); // change the content attribute

    References

    +

    A valid hash-name reference to an element of type type is a string consisting of a U+0023 NUMBER SIGN character (#) followed by a string which exactly matches the value of the name attribute of an element with type type in the same tree.

    +
    +

    The rules for parsing a hash-name reference to an element of type type, given a context node scope, are as follows:

    @@ -7232,19 +7362,24 @@ a.setAttribute('href', 'https://example.com/'); // change the content attribute +

    Media queries

    +

    A string is a valid media query list if it matches the <media-query-list> production of Media Queries. MQ

    +
    +

    A string matches the environment of the user if it is the empty string, a string consisting of only ASCII whitespace, or is a media query list that matches the user's environment according to the definitions given in Media Queries. MQ

    +

    Unique internal values

    @@ -7252,24 +7387,32 @@ a.setAttribute('href', 'https://example.com/'); // change the content attribute

    A unique internal value is a value that is serializable, comparable by value, and never exposed to script.

    +

    To create a new unique internal value, return a unique internal value that has never previously been returned by this algorithm.

    +

    URLs

    Terminology

    +

    A string is a valid non-empty URL if it is a valid URL string but it is not the empty string.

    +
    +

    A string is a valid URL potentially surrounded by spaces if, after stripping leading and trailing ASCII whitespace from it, it is a valid URL string.

    +
    +

    A string is a valid non-empty URL potentially surrounded by spaces if, after stripping leading and trailing ASCII whitespace from it, it is a valid non-empty URL.

    +

    @@ -7290,18 +7433,21 @@ a.setAttribute('href', 'https://example.com/'); // change the content attribute
    +

    A URL matches about:blank if its scheme is "about", its path contains a single string "blank", its username and password are the empty string, and its host is null.

    +

    Such a URL's query and fragment can be non-null. For example, the URL record created by parsing "about:blank?foo#bar" matches about:blank.

    +

    A URL matches about:srcdoc if its scheme is "about", its path contains a single string "srcdoc", @@ -7309,6 +7455,7 @@ a.setAttribute('href', 'https://example.com/'); // change the content attribute data-x="concept-url-username">username and password are the empty string, and its host is null.

    +

    The reason that matches about:srcdoc ensures that the URL's query is null is because it is not @@ -7335,6 +7482,7 @@ a.setAttribute('href', 'https://example.com/'); // change the content attribute custom base URL is needed or no base URL is desired, the URL parser can of course be used directly as well.

    +

    To parse a URL, given a string url, relative to a Document object or environment settings object environment, run these steps. They return failure or a URL.

    @@ -7347,7 +7495,9 @@ a.setAttribute('href', 'https://example.com/'); // change the content attribute
  • Return the result of applying the URL parser to url, with baseURL.

  • +
    +

    To encoding-parse a URL, given a string url, relative to a Document object or environment settings object environment, run these steps. They return failure or a @@ -7373,7 +7523,9 @@ a.setAttribute('href', 'https://example.com/'); // change the content attribute

  • Return the result of applying the URL parser to url, with baseURL and encoding.

  • +
    +

    To encoding-parse-and-serialize a URL, given a string url, relative to a Document object or environment settings object environment, run these steps. They return @@ -7388,6 +7540,7 @@ a.setAttribute('href', 'https://example.com/'); // change the content attribute

  • Return the result of applying the URL serializer to url.

  • +
    @@ -7397,6 +7550,7 @@ a.setAttribute('href', 'https://example.com/'); // change the content attribute

    Document base URLs

    +

    The document base URL of a Document document is the URL record obtained by running these steps:

    @@ -7409,7 +7563,9 @@ a.setAttribute('href', 'https://example.com/'); // change the content attribute in document that has an href attribute, in tree order.

    +
    +

    The fallback base URL of a Document object document is the URL record obtained by running these steps:

    @@ -7437,9 +7593,11 @@ a.setAttribute('href', 'https://example.com/'); // change the content attribute
  • Return document's URL.

  • +

    +

    To set the URL for a Document document to a URL record url:

    @@ -7449,7 +7607,9 @@ a.setAttribute('href', 'https://example.com/'); // change the content attribute
  • Respond to base URL changes given document.

  • +
    +

    To respond to base URL changes for a Document document:

    @@ -7491,6 +7651,7 @@ a.setAttribute('href', 'https://example.com/'); // change the content attribute
  • Consider speculative loads given document.

  • +

    This means that changing the base URL doesn't affect, for example, the image displayed by img elements. Thus, @@ -7507,19 +7668,26 @@ a.setAttribute('href', 'https://example.com/'); // change the content attribute

    Terminology

    +

    A response whose type is "basic", "cors", or "default" is CORS-same-origin. FETCH

    +
    +

    A response whose type is "opaque" or "opaqueredirect" is CORS-cross-origin.

    +
    +

    A response's unsafe response is its internal response if it has one, and the response itself otherwise.

    +
    +

    To create a potential-CORS request, given a url, destination, corsAttributeState, and an optional same-origin fallback flag, run these steps:

    @@ -7545,6 +7713,7 @@ a.setAttribute('href', 'https://example.com/'); // change the content attribute data-x="concept-request-credentials-mode">credentials mode is credentialsMode, and whose use-URL-credentials flag is set.

    +

    Determining the type of a resource

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

    Extracting character encodings from meta elements

    +

    The algorithm for extracting a character encoding from a meta element, given a string s, is as follows. It returns either a character encoding or nothing.

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

    This algorithm is distinct from those in the HTTP specifications (for example, HTTP doesn't allow the use of single quotes and requires supporting a backslash-escape mechanism @@ -7657,14 +7828,17 @@ a.setAttribute('href', 'https://example.com/'); // change the content attribute data-x="">include". +

    The attribute's missing value default is the No CORS state, and its invalid value default and empty value default are both the Anonymous state.

    +

    The majority of fetches governed by CORS settings attributes will be done via the create a potential-CORS request algorithm.

    +

    For more modern features, where the request's mode is always "cors", certain CORS settings attributes have been repurposed to have a @@ -7682,6 +7856,7 @@ a.setAttribute('href', 'https://example.com/'); // change the content attribute

    Use Credentials
    "include"
    +

    Referrer policy attributes

    @@ -7690,8 +7865,10 @@ a.setAttribute('href', 'https://example.com/'); // change the content attribute referrer policy, including the empty string, is a keyword for this attribute, mapping to a state of the same name.

    +

    The attribute's missing value default and invalid value default are both the empty string state.

    +

    The impact of these states on the processing model of various fetches is defined in more detail throughout this specification, in @@ -7739,10 +7916,12 @@ a.setAttribute('href', 'https://example.com/'); // change the content attribute

    Updates element's cryptographic nonce value.

    +

    The nonce IDL attribute must, on getting, return the value of this element's [[CryptographicNonce]]; and on setting, set this element's [[CryptographicNonce]] to the given value.

    +

    Note how the setter for the nonce IDL attribute does not update the corresponding @@ -7753,6 +7932,7 @@ a.setAttribute('href', 'https://example.com/'); // change the content attribute issue #2369, where this behavior was introduced.

    +

    The following attribute change steps are used for the nonce content attribute: @@ -7769,7 +7949,9 @@ a.setAttribute('href', 'https://example.com/'); // change the content attribute

  • Otherwise, set element's [[CryptographicNonce]] to value.

  • +
    +

    Whenever an element including HTMLOrSVGElement becomes browsing-context connected, the user agent must execute the following steps on the element:

    @@ -7800,11 +7982,14 @@ a.setAttribute('href', 'https://example.com/'); // change the content attribute would be the empty string at this point.

    +
    +

    The cloning steps for elements that include HTMLOrSVGElement given node, copy, and subtree are to set copy's [[CryptographicNonce]] to node's [[CryptographicNonce]].

    +

    Lazy loading attributes

    @@ -7832,12 +8017,15 @@ a.setAttribute('href', 'https://example.com/'); // change the content attribute some conditions associated with the element are met, according to the attribute's current state.

    +

    The attribute's missing value default and invalid value default are both the Eager state.

    +

    +

    The will lazy load element steps, given an element element, are as follows:

    @@ -7857,6 +8045,7 @@ a.setAttribute('href', 'https://example.com/'); // change the content attribute
  • Return false.

  • +

    Each img and iframe element has associated lazy load resumption steps, initially null.

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

    Each Document has a lazy load intersection observer, initially set to null but can be set to an IntersectionObserver instance.

    +

    To start intersection-observing a lazy loading element element, run these steps:

    @@ -7955,7 +8145,9 @@ a.setAttribute('href', 'https://example.com/'); // change the content attribute INTERSECTIONOBSERVER

    +
    +

    To stop intersection-observing a lazy loading element element, run these steps:

    @@ -7976,6 +8168,7 @@ a.setAttribute('href', 'https://example.com/'); // change the content attribute INTERSECTIONOBSERVER

    +

    @@ -8030,6 +8223,7 @@ a.setAttribute('href', 'https://example.com/'); // change the content attribute blocking attribute are the possible blocking tokens. Any element can have at most one blocking attribute.

    +

    The blocking tokens set for an element el are the result of the following steps:

    @@ -8045,11 +8239,14 @@ a.setAttribute('href', 'https://example.com/'); // change the content attribute
  • Return a set containing the elements of rawTokens that are possible blocking tokens.

    +
  • +

    An element is potentially render-blocking if its blocking tokens set contains "render", or if it is implicitly potentially render-blocking, which will be defined at the individual elements. By default, an element is not implicitly potentially render-blocking.

    +

    Fetch priority attributes

    @@ -8087,9 +8284,11 @@ a.setAttribute('href', 'https://example.com/'); // change the content attribute data-x="concept-request-destination">destination. +

    The attribute's missing value default and invalid value default are both the Auto state.

    +

    Common DOM interfaces

    @@ -8124,17 +8323,21 @@ a.setAttribute('href', 'https://example.com/'); // change the content attribute
    • get the element: takes no arguments; returns an element.
    • get the content attribute: takes no arguments; returns null or a string.
    • -
    • set the content attribute: takes a string value; returns nothing.
    • +
    • set the content attribute: takes a string value; returns nothing.
    • delete the content attribute: takes no arguments; returns nothing.
    +

    For a reflected target that is an element element, these are defined as follows:

    +
    get the element
    1. Return element.

    +
    +
    get the content attribute
      @@ -8149,26 +8352,36 @@ a.setAttribute('href', 'https://example.com/'); // change the content attribute data-x="concept-attribute-value">value.

    +
    +
    set the content attribute with a string value
    1. Set an attribute value given element, the reflected content attribute name, and value.

    +
    +
    delete the content attribute
    1. Remove an attribute by namespace and local name given null, the reflected content attribute name, and element.

    +
    +
    +

    For a reflected target that is an ElementInternals object elementInternals, they are defined as follows:

    +
    get the element
    1. Return elementInternals's target element.

    +
    +
    get the content attribute
      @@ -8181,17 +8394,23 @@ a.setAttribute('href', 'https://example.com/'); // change the content attribute attribute name].

    +
    +
    set the content attribute with a string value
    1. Set elementInternals's target element's internal content attribute map[the reflected content attribute name] to value.

    +
    +
    delete the content attribute
    1. Remove elementInternals's target element's internal content attribute map[the reflected content attribute name].

    +
    +

    This results in somewhat redundant data structures for ElementInternals objects as their target @@ -8213,6 +8432,7 @@ a.setAttribute('href', 'https://example.com/'); // change the content attribute

    • +

      The getter steps are:

        @@ -8247,10 +8467,15 @@ a.setAttribute('href', 'https://example.com/'); // change the content attribute
      1. Return contentAttributeValue.

      +
    • -
    • The setter steps are to run this's set the content attribute - with the given value.

    • +
    • +
      +

      The setter steps are to run this's set the content attribute + with the given value.

      +
      +

    If a reflected IDL attribute has the type

  • +

    The getter steps are:

      @@ -8291,9 +8517,11 @@ a.setAttribute('href', 'https://example.com/'); // change the content attribute
    1. Return contentAttributeValue.

    +
  • +

    The setter steps are:

      @@ -8303,6 +8531,7 @@ a.setAttribute('href', 'https://example.com/'); // change the content attribute
    1. Otherwise, run this's set the content attribute with the given value.

    +
  • @@ -8311,6 +8540,7 @@ a.setAttribute('href', 'https://example.com/'); // change the content attribute
    • +

      The getter steps are:

        @@ -8337,10 +8567,15 @@ a.setAttribute('href', 'https://example.com/'); // change the content attribute
      1. Return contentAttributeValue, converted to a scalar value string.

      +
    • -
    • The setter steps are to run this's set the content attribute - with the given value.

    • +
    • +
      +

      The setter steps are to run this's set the content attribute + with the given value.

      +
      +

    If a reflected IDL attribute has the type

  • +

    The getter steps are:

      @@ -8358,9 +8594,11 @@ a.setAttribute('href', 'https://example.com/'); // change the content attribute
    1. Return true.

    +
  • +

    The setter steps are:

      @@ -8370,18 +8608,21 @@ a.setAttribute('href', 'https://example.com/'); // change the content attribute
    1. If the given value is true, then run this's set the content attribute with the empty string.

    +
  • This corresponds to the rules for boolean content attributes. +

    If a reflected IDL attribute has the type long, optionally limited to only non-negative numbers and optionally with a default value defaultValue:

    • +

      The getter steps are:

        @@ -8411,9 +8652,11 @@ a.setAttribute('href', 'https://example.com/'); // change the content attribute
      1. Return 0.

      +
    • +

      The setter steps are:

        @@ -8425,9 +8668,12 @@ a.setAttribute('href', 'https://example.com/'); // change the content attribute converted to the shortest possible string representing the number as a valid integer.

      +
    +
    +

    If a reflected IDL attribute has the type unsigned long, optionally limited to only positive @@ -8438,6 +8684,7 @@ a.setAttribute('href', 'https://example.com/'); // change the content attribute

    • +

      The getter steps are:

        @@ -8486,9 +8733,11 @@ a.setAttribute('href', 'https://example.com/'); // change the content attribute
      1. Return minimum.

      +
    • +

      The setter steps are:

        @@ -8514,22 +8763,26 @@ a.setAttribute('href', 'https://example.com/'); // change the content attribute converted to the shortest possible string representing the number as a valid non-negative integer.

      +

      Clamped to the range has no effect on the setter steps.

    +
    +

    If a reflected IDL attribute has the type double, optionally limited to only positive numbers and optionally with a default value defaultValue:

    • +

      The getter steps are:

        @@ -8558,10 +8811,12 @@ a.setAttribute('href', 'https://example.com/'); // change the content attribute
      1. Return 0.

      +
    • +

      The setter steps are:

        @@ -8572,20 +8827,25 @@ a.setAttribute('href', 'https://example.com/'); // change the content attribute converted to the best representation of the number as a floating-point number.

      +
    +

    The values Infinity and Not-a-Number (NaN) values throw an exception on setting, as defined in Web IDL. WEBIDL

    +

    If a reflected IDL attribute has the type DOMTokenList, then its getter steps are to return a DOMTokenList object whose associated element is this and associated attribute's local name is the reflected content attribute name. Specification authors cannot reflect IDL attributes of this type on ElementInternals.

    +
    +

    If a reflected IDL attribute has the type T?, where T is either Element or an interface that inherits from Element, then with attr being the reflected content attribute @@ -8597,6 +8857,7 @@ a.setAttribute('href', 'https://example.com/'); // change the content attribute null.

  • +

    Its reflected target reflectedTarget has a get the attr-associated element algorithm, that runs these steps:

    @@ -8641,12 +8902,18 @@ a.setAttribute('href', 'https://example.com/'); // change the content attribute
  • Return null.

  • +
    -
  • The getter steps are to return the result of running this's get the - attr-associated element.

  • +
  • +
    +

    The getter steps are to return the result of running this's get the + attr-associated element.

    +
    +
  • +

    The setter steps are:

    1. @@ -8668,9 +8935,11 @@ a.setAttribute('href', 'https://example.com/'); // change the content attribute
    2. Set this's explicitly set attr-element to a weak reference to the given value.

    +
  • +

    For element reflected targets only: the following attribute change steps, given element, localName, oldValue, value, and @@ -8684,13 +8953,16 @@ a.setAttribute('href', 'https://example.com/'); // change the content attribute

  • Set element's explicitly set attr-element to null.

  • +
    +

    Reflected IDL attributes of this type are strongly encouraged to have their identifier end in "Element" for consistency.

    +

    If a reflected IDL attribute has the type FrozenArray<T>?, where T is either Element or an interface that inherits from Element, then with @@ -8709,6 +8981,7 @@ a.setAttribute('href', 'https://example.com/'); // change the content attribute initially null.

  • +

    Its reflected target reflectedTarget has a get the attr-associated elements algorithm, which runs these steps:

    @@ -8782,9 +9055,11 @@ a.setAttribute('href', 'https://example.com/'); // change the content attribute
  • Return elements.

  • +
  • +

    The getter steps are:

      @@ -8807,12 +9082,14 @@ a.setAttribute('href', 'https://example.com/'); // change the content attribute
    1. Return elementsAsFrozenArray.

    +

    This extra caching layer is necessary to preserve the invariant that element.reflectedElements === element.reflectedElements.

  • +

    The setter steps are:

    1. @@ -8845,9 +9122,11 @@ a.setAttribute('href', 'https://example.com/'); // change the content attribute
    2. Set this's explicitly set attr-elements to elements.

    +
  • +

    For element reflected targets only: the following attribute change steps, given element, localName, oldValue, value, and @@ -8861,8 +9140,10 @@ a.setAttribute('href', 'https://example.com/'); // change the content attribute

  • Set element's explicitly set attr-elements to null.

  • +
    +

    Reflected IDL attributes of this type are strongly encouraged to have their identifier end in "Elements" for @@ -8946,7 +9227,7 @@ a.setAttribute('href', 'https://example.com/'); // change the content attribute unsigned long. Additionally, it must also only appear alongside [Reflect].

    -

    IDL attributes with the [ReflectRange] extended +

    IDL attributes with the [ReflectRange] extended attribute are clamped to the range [clampedMin, clampedMax] where clampedMin is the first, and clampedMax is the second argument to the list provided to whose type is one of the following:

      -
    • T?, where T is either Element or +

    • T?, where T is either Element or an interface that inherits from Element

    • -
    • FrozenArray<T>?, where T is either +

    • FrozenArray<T>?, where T is either Element or an interface that inherits from Element

    -

    For those, specification authors must use the reflected target's +

    For those, specification authors must use the reflected target's get the attr-associated element and get the attr-associated elements, respectively. The content attribute presence and value must not be used as they cannot be fully synchronized with the reflected IDL attribute.

    -

    A reflected target's explicitly set attr-element, +

    A reflected target's explicitly set attr-element, explicitly set attr-elements, cached attr-associated elements, and cached attr-associated elements object are to be treated as internal implementation details and not to be built upon.

    @@ -9066,9 +9347,12 @@ interface HTMLAllCollection {
    +

    The object's supported property indices are as defined for HTMLCollection objects.

    +
    +

    The supported property names consist of the non-empty values of all the id attributes of all the elements represented by the collection, and the non-empty values of all the name attributes of @@ -9076,20 +9360,28 @@ interface HTMLAllCollection { tree order, ignoring later duplicates, with the id of an element preceding its name if it contributes both, they differ from each other, and neither is the duplicate of an earlier entry.

    +
    +

    The length getter steps are to return the number of nodes represented by the collection.

    +
    +

    The indexed property getter must return the result of getting the "all"-indexed element from this given the passed index.

    +
    +

    The namedItem(name) method steps are to return the result of getting the "all"-named element(s) from this given name.

    +
    +

    The item(nameOrIndex) method steps are:

    @@ -9101,10 +9393,12 @@ interface HTMLAllCollection { "all"-indexed or named element(s) from this, given nameOrIndex.

    +

    +

    The following elements are "all"-named elements: a, button, @@ -9121,12 +9415,16 @@ interface HTMLAllCollection { select, and textarea

    +
    +

    To get the "all"-indexed element from an HTMLAllCollection collection given an index index, return the indexth element in collection, or null if there is no such indexth element.

    +
    +

    To get the "all"-named element(s) from an HTMLAllCollection collection given a name name, perform the following steps:

    @@ -9154,7 +9452,9 @@ interface HTMLAllCollection {
  • Otherwise, return subCollection.

  • +
    +

    To get the "all"-indexed or named element(s) from an HTMLAllCollection collection given nameOrIndex: @@ -9168,7 +9468,9 @@ interface HTMLAllCollection {

  • Return the result of getting the "all"-named element(s) from collection given nameOrIndex.

  • +
    +
    [[Call]] ( thisArgument, argumentsList )
      @@ -9192,6 +9494,7 @@ interface HTMLAllCollection { elements. (document.all.call does not exist, since document.all does not inherit from Function.prototype.)

      +
    @@ -9245,16 +9548,21 @@ interface RadioNodeList : NodeList {
    +

    The object's supported property indices are as defined for HTMLCollection objects.

    +
    +

    The supported property names consist of the non-empty values of all the id and name attributes of all the elements represented by the collection, in tree order, ignoring later duplicates, with the id of an element preceding its name if it contributes both, they differ from each other, and neither is the duplicate of an earlier entry.

    +
    +

    The namedItem(name) method must act according to the following algorithm:

    @@ -9279,12 +9587,14 @@ interface RadioNodeList : NodeList {
  • Return that RadioNodeList object.
  • +

    Members of the RadioNodeList interface inherited from the NodeList interface must behave as they would on a NodeList object.

    +

    The value IDL attribute on the RadioNodeList object, on getting, must return the value returned by running the @@ -9305,7 +9615,9 @@ interface RadioNodeList : NodeList {

  • Otherwise, return the value of element's value attribute.

  • +
    +

    On setting, the value IDL attribute must run the following steps:

    @@ -9326,6 +9638,7 @@ interface RadioNodeList : NodeList {
  • If element is not null, then set its checkedness to true.

    +
  • @@ -9591,24 +9920,32 @@ interface DOMStringList {

    Each DOMStringList object has an associated list.

    +

    The DOMStringList interface supports indexed properties. The supported property indices are the indices of this's associated list.

    +
    +

    The length getter steps are to return this's associated list's size.

    +
    +

    The item(index) method steps are to return the indexth item in this's associated list, or null if index plus one is greater than this's associated list's size.

    +
    +

    The contains(string) method steps are to return true if this's associated list contains string, and false otherwise.

    +
    @@ -9649,6 +9986,7 @@ interface DOMStringList { attribute. Such interfaces must also define the following algorithms:

    +
    serialization steps, taking a platform object value, a Record serialized, and a boolean forStorage
    @@ -9666,7 +10004,9 @@ interface DOMStringList {

    The introduction of these steps should omit mention of the forStorage argument if it is not relevant to the algorithm.

    +
    +
    deserialization steps, taking a Record serialized, a platform object value, and a realm targetRealm
    @@ -9682,6 +10022,7 @@ interface DOMStringList { structures. They should not call StructuredDeserialize directly, as doing so will omit the important targetRealm and memory arguments.

    +

    It is up to the definition of individual platform objects to determine what data is serialized @@ -9714,6 +10055,7 @@ interface DOMStringList { data-x="Serializable">[Serializable] extended attribute, and defining the following accompanying algorithms:

    +

    Their serialization steps, given value and serialized:

      @@ -9725,7 +10067,9 @@ interface DOMStringList {
    1. Set serialized.[[BestFriend]] to serializedBestFriend.

    +
    +

    Their deserialization steps, given serialized, value, and targetRealm:

    @@ -9739,6 +10083,7 @@ interface DOMStringList {
  • Set value's associated best friend value to deserializedBestFriend.

  • +

    Objects defined in the JavaScript specification are handled by the @@ -9771,6 +10116,7 @@ interface DOMStringList { attribute. Such interfaces must also define the following algorithms:

    +
    transfer steps, taking a platform object value and a Record dataHolder
    @@ -9780,7 +10126,9 @@ interface DOMStringList {

    These steps may throw an exception if transferral is not possible.

    +
    +
    transfer-receiving steps, taking a Record dataHolder and a platform object value
    @@ -9791,6 +10139,7 @@ interface DOMStringList {

    These steps may throw an exception if it is not possible to receive the transfer.

    +

    It is up to the definition of individual platform objects to determine what data is transferred @@ -9815,6 +10164,7 @@ interface DOMStringList {

    Objects defined in the JavaScript specification are handled by the StructuredSerializeWithTransfer abstract operation directly.

    +

    StructuredSerializeInternal ( value, forStorage [ , memory ] )

    @@ -10225,6 +10575,7 @@ interface DOMStringList {
  • Return serialized.

  • +

    It's important to realize that the Records @@ -10249,22 +10600,27 @@ o.myself = o;

    +

    StructuredSerialize ( value )

    1. Return ? StructuredSerializeInternal(value, false).

    +
    +

    StructuredSerializeForStorage ( value )

    1. Return ? StructuredSerializeInternal(value, true).

    +
    +

    StructuredDeserialize ( serialized, targetRealm [ , memory ] )

    @@ -10606,7 +10962,9 @@ o.myself = o;
  • Return value.

  • +
    +

    StructuredSerializeWithTransfer ( value, transferList )

    @@ -10740,7 +11098,9 @@ o.myself = o;
  • Return { [[Serialized]]: serialized, [[TransferDataHolders]]: transferDataHolders }.

  • +
    +

    StructuredDeserializeWithTransfer ( serializeWithTransferResult, targetRealm )

    @@ -10826,6 +11186,7 @@ o.myself = o;
  • Return { [[Deserialized]]: deserialized, [[TransferredValues]]: transferredValues }.

  • +

    Performing serialization and @@ -10860,7 +11221,7 @@ o.myself = o; when attempting to serialize SharedArrayBuffer objects, since storing shared memory does not make sense. Similarly, it can throw or possibly have different behavior when given a platform object with custom serialization steps when the - forStorage argument is true.

    + forStorage argument is true.

    history.pushState() and history.replaceState() use @@ -10930,6 +11291,7 @@ o.myself = o;

    +

    The structuredClone(value, options) method steps are:

    @@ -10945,6 +11307,7 @@ o.myself = o;
  • Return deserializeRecord.[[Deserialized]].

  • +
    @@ -11131,8 +11494,10 @@ partial interface Document {
    +

    The referrer attribute must return the document's referrer.

    +
    @@ -11166,6 +11531,7 @@ partial interface Document { href="https://cookiestore.spec.whatwg.org/#intro">Cookie Store API introduction for more information. COOKIESTORE

    +

    A Document object that falls into one of the following conditions is a cookie-averse Document object:

    @@ -11176,10 +11542,12 @@ partial interface Document {
  • A Document whose URL's scheme is not an HTTP(S) scheme.
  • +
    +

    On getting, if the document is a cookie-averse Document object, then the @@ -11189,7 +11557,9 @@ partial interface Document { DOMException. Otherwise, the user agent must return the cookie-string for the document's URL for a "non-HTTP" API, decoded using UTF-8 decode without BOM. COOKIES

    +
    +

    On setting, if the document is a cookie-averse Document object, then the user agent must do nothing. Otherwise, if the Document's origin is an opaque @@ -11198,6 +11568,7 @@ partial interface Document { data-x="receives a set-cookie-string">receiving a set-cookie-string for the document's URL via a "non-HTTP" API, consisting of the new value encoded as UTF-8. COOKIES ENCODING

    +

    Since the cookie attribute is accessible across frames, the path restrictions on cookies are only a tool to help manage which cookies are @@ -11227,6 +11598,7 @@ partial interface Document {

    +

    The lastModified attribute, on getting, must return the date and time of the Document's source file's last modification, in the user's @@ -11260,6 +11632,7 @@ partial interface Document { digits representing the number in base ten, zero-padded if necessary. The year must be given as the shortest possible string of four or more ASCII digits representing the number in base ten, zero-padded if necessary.

    +

    The Document's source file's last modification date and time must be derived from relevant features of the networking protocols used, e.g. from the value of the HTTP `Document { about:blank Documents or Documents without a browsing context.

    +

    The readyState getter steps are to return this's current document readiness.

    +
    +

    To update the current document readiness for Document document to readinessValue:

    @@ -11339,12 +11715,15 @@ partial interface Document {
  • Fire an event named readystatechange at document.

  • +

    +

    A Document is said to have an active parser if it is associated with an HTML parser or an XML parser that has not yet been stopped or aborted.

    +

    @@ -11391,10 +11770,13 @@ partial interface Document {

    Each Document has a render-blocking element set, a set of elements, initially the empty set.

    +

    A Document document allows adding render-blocking elements if document's content type is "text/html" and the body element of document is null.

    +
    +

    A Document document is render-blocked if both of the following are true:

    @@ -11405,11 +11787,15 @@ partial interface Document {
  • The current high resolution time given document's relevant global object has not exceeded an implementation-defined timeout value.

    +
  • +

    An element el is render-blocking if el's node document document is render-blocked, and el is in document's render-blocking element set.

    +
    +

    To block rendering on an element el:

      @@ -11419,7 +11805,9 @@ partial interface Document { append el to document's render-blocking element set.

    +
    +

    To unblock rendering on an element el:

      @@ -11428,17 +11816,22 @@ partial interface Document {
    1. Remove el from document's render-blocking element set.

    +
    +

    Whenever a render-blocking element el becomes browsing-context disconnected, or el's blocking attribute's value is changed so that el is no longer potentially render-blocking, then unblock rendering on el.

    +

    DOM tree accessors

    +

    The html element of a document is its document element, if it's an html element, and null otherwise.

    +

    @@ -11447,15 +11840,19 @@ partial interface Document {

    Returns the head element.

    +

    The head element of a document is the first head element that is a child of the html element, if there is one, or null otherwise.

    +
    +

    The head attribute, on getting, must return the head element of the document (a head element or null).

    +
    @@ -11472,11 +11869,14 @@ partial interface Document { +

    The title element of a document is the first title element in the document (in tree order), if there is one, or null otherwise.

    +
    +

    The title attribute must, on getting, run the following algorithm:

    @@ -11494,7 +11894,9 @@ partial interface Document {
  • Return value.

  • +
    +

    On setting, the steps corresponding to the first matching condition in the following list must be run:

    @@ -11553,6 +11955,7 @@ partial interface Document {

    Do nothing.

    +
    @@ -11570,12 +11973,15 @@ partial interface Document { +

    The body element of a document is the first of the html element's children that is either a body element or a frameset element, or null if there is no such element.

    +
    +

    The body attribute, on getting, must return the body element of the document (either a body element, a frameset element, or null). On setting, the following algorithm must be @@ -11607,6 +12013,7 @@ partial interface Document { document element. Append the new value to the document element. +

    The value returned by the body getter is not always the one passed to the setter.

    @@ -11667,31 +12074,43 @@ partial interface Document { +

    The images attribute must return an HTMLCollection rooted at the Document node, whose filter matches only img elements.

    +
    +

    The embeds attribute must return an HTMLCollection rooted at the Document node, whose filter matches only embed elements.

    +
    +

    The plugins attribute must return the same object as that returned by the embeds attribute.

    +
    +

    The links attribute must return an HTMLCollection rooted at the Document node, whose filter matches only a elements with href attributes and area elements with href attributes.

    +
    +

    The forms attribute must return an HTMLCollection rooted at the Document node, whose filter matches only form elements.

    +
    +

    The scripts attribute must return an HTMLCollection rooted at the Document node, whose filter matches only script elements.

    +

    @@ -11705,6 +12124,7 @@ partial interface Document {
    +

    The getElementsByName(elementName) method steps are to return a live NodeList containing all the HTML @@ -11713,6 +12133,7 @@ partial interface Document { method is invoked on a Document object again with the same argument, the user agent may return the same as the object returned by the earlier call. In other cases, a new NodeList object must be returned.

    +
    @@ -11735,10 +12156,12 @@ partial interface Document {
    +

    The currentScript attribute, on getting, must return the value to which it was most recently set. When the Document is created, the currentScript must be initialized to null.

    +
    @@ -11753,6 +12176,7 @@ partial interface Document {
    +

    The Document interface supports named properties. The supported property names of a Document object document at any moment consist of the following, in @@ -11778,7 +12202,9 @@ partial interface Document { attribute and a non-empty name content attribute, and are in a document tree with document as their root.

    +
    +

    To determine the value of a named property name for a Document, the user agent must return the value obtained using the following steps:

    @@ -11815,7 +12241,9 @@ partial interface Document { This is what the "LegacyOverrideBuiltIns" bit means in the IDL. --> +
    +

    Named elements with the name name, for the purposes of the above algorithm, are those that are either:

    @@ -11831,11 +12259,14 @@ partial interface Document { whose value is name, and that have a non-empty name content attribute present also. +
    +

    An embed or object element is said to be exposed if it has no exposed object ancestor, and, for object elements, is additionally either not showing its fallback content or has no object or embed descendants.

    +
    @@ -12148,6 +12579,7 @@ interface HTMLUnknownElement : HTMLElement {
    +

    The element interface for an element with name name in the HTML namespace is determined as follows:

    @@ -12175,6 +12607,7 @@ interface HTMLUnknownElement : HTMLElement {
  • Return HTMLUnknownElement.

  • +

    The use of HTMLElement instead of HTMLUnknownElement in the case of valid custom element names is done to @@ -12221,6 +12654,7 @@ console.assert(el.constructor === Element); contain only the single, annotated constructor operation, and no others. The annotated constructor operation must be declared to take no arguments.

    +

    Interfaces declared with constructor operations that are annotated with the [HTMLConstructor] extended attribute have the following overridden constructor steps:

    @@ -12467,6 +12901,7 @@ class DontDoThis extends HTMLElement { constructor assigns that existing element to this.

    +

    @@ -12599,7 +13034,7 @@ console.assert(image.height === 200); ignored when establishing whether an element's contents match the element's content model or not, and must be ignored when following algorithms that define document and element semantics.

    -

    Thus, an element A is said to be preceded or followed +

    Thus, an element A is said to be preceded or followed by a second element B if A and B have the same parent node and there are no other element nodes or Text nodes (other than inter-element whitespace) between them. Similarly, a node is the only child of @@ -13326,6 +13761,7 @@ https://software.hixie.ch/utilities/js/live-dom-viewer/?%3C%21DOCTYPE%20HTML%3E%

    +

    Let view be a view of the DOM that replaces all a, ins, del, and map elements in the document with their contents. Then, in view, for each run @@ -13336,6 +13772,7 @@ https://software.hixie.ch/utilities/js/live-dom-viewer/?%3C%21DOCTYPE%20HTML%3E% paragraph exists in the original DOM from immediately before first to immediately after last. (Paragraphs can thus span across a, ins, del, and map elements.)

    +

    Conformance checkers may warn authors of cases where they have paragraphs that overlap each other (this can happen with object, video, audio, and @@ -13749,6 +14186,7 @@ Transport Protocol">HTTP</abbr> today.</p> +

    Other specifications may define other attributes that are also translatable attributes. For example, ARIA would define the HTTP</abbr> today.</p>

    +
    +

    The default fetch and process the linked resource, given a link element el, is as follows:

    @@ -16140,7 +16670,9 @@ interface HTMLLinkElement : HTMLElement { +
    +

    To create a link request given a link processing options options:

    @@ -16191,6 +16723,7 @@ interface HTMLLinkElement : HTMLElement {
  • Return request.

  • +

    User agents may opt to only try to fetch and process such resources when they are needed, instead of pro-actively fetching all the @@ -16198,6 +16731,7 @@ interface HTMLLinkElement : HTMLElement { +

    Similar to the fetch and process the linked resource algorithm, all external resource links have a process the linked resource algorithm which takes a link element el, boolean @@ -16205,6 +16739,7 @@ interface HTMLLinkElement : HTMLElement { byte sequence bodyBytes. Individual link types may provide their own process the linked resource algorithm, but unless explicitly stated, that algorithm does nothing.

    +

    Unless otherwise specified for a given rel keyword, the element must delay the load event of the element's node document until @@ -16277,6 +16812,7 @@ interface HTMLLinkElement : HTMLElement { rather than a parsed URL because the URL could be a result of the options's source set.

    +

    To create link options from element given a link element el:

    @@ -16352,7 +16888,9 @@ interface HTMLLinkElement : HTMLElement {
  • Return options.

  • +
    +

    To extract links from headers given a header list headers:

    @@ -16380,7 +16918,9 @@ interface HTMLLinkElement : HTMLElement {
  • Return links.

  • +
    +

    To process link headers given a Document doc, a response response, and a "pre-media" or "media" phase:

    @@ -16456,7 +16996,9 @@ interface HTMLLinkElement : HTMLElement { +
    +

    To apply link options from parsed header attributes to a link processing options options given attribs:

    @@ -16498,6 +17040,7 @@ interface HTMLLinkElement : HTMLElement { data-x="link options fetch priority">fetch priority to that fetch priority attribute keyword.

    +
    @@ -16561,6 +17104,7 @@ data-x="rel-preload">preload; as=font< the style will not be accessible to the document.

    +

    To process early hint headers given a response response and an environment reservedEnvironment:

    @@ -16671,6 +17215,7 @@ data-x="rel-preload">preload; as=font< +
    @@ -16841,6 +17386,7 @@ interface HTMLMetaElement : HTMLElement { status of the page at a particular moment in time instead of just being the name of the application.

    +

    To find the application name to use given an ordered list of languages (e.g. British English, American English, and English), user agents must run the following steps:

    @@ -16874,6 +17420,7 @@ interface HTMLMetaElement : HTMLElement { and whose language is winning language.

    +

    This algorithm would be used by a browser when it needs a name for the page, for instance, to label a bookmark. The languages it would provide to the algorithm would be the @@ -16940,6 +17487,7 @@ interface HTMLMetaElement : HTMLElement {

    +

    To obtain the list of keywords that the author has specified as applicable to the page, the user agent must run the following steps:

    @@ -16965,6 +17513,7 @@ interface HTMLMetaElement : HTMLElement {
  • Return keywords. This is the list of keywords that the author has specified as applicable to the page.

  • +

    User agents should not use this information when there is insufficient confidence in the reliability of the value.

    @@ -16986,6 +17535,7 @@ interface HTMLMetaElement : HTMLElement {
    +

    If any meta element element is inserted into the document, or has its name or content @@ -17035,6 +17585,7 @@ interface HTMLMetaElement : HTMLElement { container's referrer policy to policy.

    +

    For historical reasons, unlike other standard metadata names, the processing model for referrer is not responsive to element removals, @@ -17083,6 +17634,7 @@ interface HTMLMetaElement : HTMLElement {

    +

    To obtain a page's theme color, user agents must run the following steps:

      @@ -17123,6 +17675,7 @@ interface HTMLMetaElement : HTMLElement {
    1. Return nothing (the page has no theme color).

    +

    If any meta elements are inserted into the document or inserted into the document or inserted @@ -17852,6 +18409,8 @@ people expect to have work and what is necessary. +

    +

    There must not be more than one meta element with any particular state in the document at a time.

    @@ -17896,6 +18455,7 @@ people expect to have work and what is necessary. encoding declarations per document, if the document is an XML document and one is an XML declaration, the other is , and the encoding is UTF-8. --> +

    If an HTML document does not start with a BOM, and its encoding is not explicitly given by Content-Type metadata, and the document is not an iframe meta element with an http-equiv attribute in the Encoding declaration state.

    +

    A character encoding declaration is required (either in the HTMLStyleElement : HTMLElement { model. The element does not represent content for the user.

    +

    The disabled getter steps are:

    @@ -17991,7 +18553,9 @@ interface HTMLStyleElement : HTMLElement {
  • Return false.

  • +
    +

    The disabled setter steps are:

      @@ -18003,6 +18567,7 @@ interface HTMLStyleElement : HTMLElement { Otherwise, unset this's associated CSS style sheet's disabled flag.

    +

    Importantly, disabled attribute assignments only take @@ -18054,8 +18619,10 @@ console.log(style.disabled); // false

    The child text content of a style element must be that of a conformant style sheet.

    +

    A style element is implicitly potentially render-blocking if the element was created by its node document's parser.

    +

    @@ -18077,6 +18644,7 @@ console.log(style.disabled); // false
  • The element's children changed steps run.

  • +

    The update a style block algorithm is as follows:

      @@ -18168,9 +18736,11 @@ console.log(style.disabled); // false potentially render-blocking, then block rendering on element.

    +
    +

    Once the attempts to obtain the style sheet's critical subresources, if any, are complete, or, if the style sheet has no critical subresources, once the style sheet has been parsed and processed, the user agent must run these steps:

    @@ -18225,6 +18795,7 @@ console.log(style.disabled); // false +

    The element must delay the load event of the element's node document until all the attempts to obtain the style sheet's critical subresources, if any, are complete.

    @@ -18272,6 +18843,7 @@ console.log(style.disabled); // false made available to script once the event loop reaches its update the rendering step.

    +

    An element el in the context of a Document of an HTML parser or XML parser contributes a script-blocking style sheet if all of the following are true:

    @@ -18306,6 +18878,7 @@ console.log(style.disabled); // false of doing nothing while waiting for a slow network request to finish.

    +

    It is expected that counterparts to the above rules also apply to <?xml-stylesheet?> PIs. However, this has not yet been thoroughly @@ -18314,6 +18887,7 @@ console.log(style.disabled); // false

    A Document has a script-blocking style sheet set, which is an ordered set, initially empty.

    +

    A Document document has a style sheet that is blocking scripts if the following steps return true:

    @@ -18332,10 +18906,13 @@ console.log(style.disabled); // false
  • Return false.

  • +
    +

    A Document has no style sheet that is blocking scripts if it does not have a style sheet that is blocking scripts.

    +
    @@ -19520,6 +20097,7 @@ interface HTMLHeadingElement : HTMLElement {
    +

    The contact information for a node node is a collection of address elements defined by the first applicable entry from the following list:

    @@ -19556,6 +20134,7 @@ interface HTMLHeadingElement : HTMLElement {

    There is no contact information for node.

    +

    User agents may expose the contact information of a node to the user, or use it for other purposes, such as indexing sections based on the sections' contact information.

    @@ -19589,8 +20168,10 @@ interface HTMLHeadingElement : HTMLElement { data-x="concept-heading">heading's heading level is, the fewer ancestor sections the heading has.

    +

    The outline is all headings in a document, in tree order.

    +

    The outline should be used for generating document outlines, for example when generating tables of contents. When creating an interactive table of contents, entries should @@ -19600,10 +20181,12 @@ interface HTMLHeadingElement : HTMLElement { single heading within the outline should have a heading level of 1.

    +

    Each heading following another heading lead in the outline must have a heading level that is less than, equal to, or 1 greater than lead's heading level.

    +

    The following example is non-conforming:

    @@ -19639,6 +20222,7 @@ interface HTMLHeadingElement : HTMLElement { content attribute allows authors to prevent a heading offset computation from traversing beyond the element with the attribute.

    +

    To get an element's computed heading level, given an element element:

    @@ -19673,7 +20257,9 @@ interface HTMLHeadingElement : HTMLElement {
  • Return level.

  • +
    +

    To get an element's computed heading offset, given an element element, perform the following steps. They return a non-negative integer.

    @@ -19710,6 +20296,7 @@ interface HTMLHeadingElement : HTMLElement {
  • Return offset.

  • +

    This example shows a combination of headingoffset, @@ -20734,6 +21321,7 @@ interface HTMLOListElement : HTMLElement { +

    An ol element has a starting value, which is an integer determined as follows:

    @@ -20756,6 +21344,7 @@ interface HTMLOListElement : HTMLElement {
  • Return 1.

  • +
    @@ -21032,6 +21621,7 @@ interface HTMLLIElement : HTMLElement {
    +

    Any element whose computed value of 'display' is 'list-item' has a list owner, which is determined as follows:

    @@ -21052,7 +21642,9 @@ interface HTMLLIElement : HTMLElement { element will always produce a CSS box.

    +
    +

    To determine the ordinal value of each element owned by a given list owner owner, perform the following steps:

    @@ -21094,6 +21686,7 @@ interface HTMLLIElement : HTMLElement {
  • Go to the step labeled loop.

    +

  • @@ -21217,6 +21810,8 @@ interface HTMLDListElement : HTMLElement {
    +
    +

    The name-value groups of a dl element dl are determined using the following algorithm. A name-value group has a name (a list of dt elements, initially empty) and a value (a list of dd elements, initially empty).

    @@ -21268,7 +21863,9 @@ interface HTMLDListElement : HTMLElement {
  • Return groups.

  • +
    +

    To process dt or dd for a node node means to follow these steps:

    @@ -21290,6 +21887,8 @@ interface HTMLDListElement : HTMLElement {
  • Otherwise, if node is a dd element, then append node to current's value and set seenDd to true.

  • +
    +

    When a name-value group has an empty list as name or value, it is often due to accidentally using dd elements in the place of dt elements and vice @@ -21792,11 +22391,13 @@ included with Exhibit B.

    A document must not have more than one main element that does not have the hidden attribute specified.

    +

    A hierarchically correct main element is one whose ancestor elements are limited to html, body, div, form without an accessible name, and autonomous custom elements. Each main element must be a hierarchically correct main element.

    +
    @@ -22181,16 +22782,22 @@ interface HTMLAnchorElement : HTMLElement {
    +

    The IDL attribute referrerPolicy must reflect the referrerpolicy content attribute, limited to only known values.

    +
    +

    The text attribute's getter must return this element's descendant text content.

    +
    +

    The text attribute's setter must string replace all with the given value within this element.

    +
    @@ -22823,6 +23430,7 @@ resulting from the campaign's mismanagement.</p> element must also contain the definition(s) for the term given by the dfn element.

    +

    Defining term: if the dfn element has a title attribute, then the exact value of that attribute is the term being defined. Otherwise, if it contains exactly one element child node and @@ -22830,6 +23438,7 @@ resulting from the campaign's mismanagement.</p> title attribute, then the exact value of that attribute is the term being defined. Otherwise, it is the descendant text content of the dfn element that gives the term being defined.

    +
    @@ -23237,6 +23846,8 @@ this specification: the <abbr>WHATWG</abbr> and the
    +
    +

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

    @@ -23339,8 +23950,10 @@ this specification: the <abbr>WHATWG</abbr> and the segments. Any content of the ruby element not described by segments in either of those lists is implicitly in an ignored segment.

    +
    +

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

    @@ -23362,8 +23975,10 @@ this specification: the <abbr>WHATWG</abbr> and the
  • Let start index be null.

  • +
    +

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

    @@ -23377,8 +23992,10 @@ this specification: the <abbr>WHATWG</abbr> and the
  • Let start index be null.

  • +
    +

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

    @@ -23395,8 +24012,10 @@ this specification: the <abbr>WHATWG</abbr> and the
  • Let saved start index be null.

  • +
    +

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

    @@ -23419,6 +24038,8 @@ this specification: the <abbr>WHATWG</abbr> and the
  • Add new annotation segment to annotation segments.

  • +
    +
    @@ -23706,9 +24327,11 @@ interface HTMLTimeElement : HTMLElement { data-x="attr-time-datetime">datetime content attribute must not have any element descendants.

    +

    The datetime value of a time element is the value of the element's datetime content attribute, if it has one, otherwise the child text content of the time element.

    +

    The datetime value of a time element must match one of the following syntaxes.

    @@ -23862,6 +24485,7 @@ interface HTMLTimeElement : HTMLElement {
    +

    The machine-readable equivalent of the element's contents must be obtained from the element's datetime value by using the following algorithm:

    @@ -23910,8 +24534,9 @@ interface HTMLTimeElement : HTMLElement {
  • There is no machine-readable equivalent.

  • +
    -

    The algorithms referenced above are intended to be designed such that for any +

    The algorithms referenced above are intended to be designed such that for any arbitrary string s, only one of the algorithms returns a value. A more efficient approach might be to create a single algorithm that parses all these data types in one pass; developing such an algorithm is left as an exercise to the reader.

    @@ -25261,6 +25886,7 @@ document.body.appendChild(wbr); download attribute, and should be to download the specified resource if it does.

    +

    The activation behavior of an a or area element element given an event event is:

    @@ -25319,6 +25945,7 @@ document.body.appendChild(wbr); hyperlinkSuffix and userInvolvement set to userInvolvement.

    +

    API for a and area elements

    @@ -25423,6 +26050,7 @@ document.body.appendChild(wbr);

    An element implementing the HTMLHyperlinkElementUtils mixin has an associated url (null or a URL). It is initially null. +

    An element implementing the HTMLHyperlinkElementUtils mixin has an associated set the url algorithm, which runs these steps:

    @@ -25439,10 +26067,14 @@ document.body.appendChild(wbr);
  • If url is not failure, then set this element's url to url.

  • +
    +

    When elements implementing the HTMLHyperlinkElementUtils mixin are created, the user agent must set the url.

    +
    +

    The HTML element insertion steps for a and area elements, given insertedNode, are:

    @@ -25452,7 +26084,9 @@ document.body.appendChild(wbr);
  • Consider speculative loads given insertedNode's node document.

  • +
    +

    The HTML element removing steps for a and area elements, given removedNode and oldParent, are:

    @@ -25462,7 +26096,9 @@ document.body.appendChild(wbr);
  • Consider speculative loads given oldParent's node document.

  • +
    +

    The HTML element moving steps for a and area elements, given movedNode, are:

    @@ -25470,7 +26106,9 @@ document.body.appendChild(wbr);
  • Consider speculative loads given movedNode's node document.

  • +
    +

    The following attribute change steps, given element, localName, oldValue, value, and namespace, are used for all a and area @@ -25494,7 +26132,9 @@ document.body.appendChild(wbr); data-x="attr-hyperlink-rel">rel, then consider speculative loads given element's node document.

    +
    +

    An element implementing the HTMLHyperlinkElementUtils mixin has an associated reinitialize url algorithm, which runs these steps:

    @@ -25506,14 +26146,18 @@ document.body.appendChild(wbr);
  • Set the url.

  • +
    +

    To update href, set the element's href content attribute's value to the element's url, serialized.

    +

    +

    The href getter steps are:

    @@ -25531,7 +26175,9 @@ document.body.appendChild(wbr);
  • Return url, serialized.

  • +
    +

    The origin getter steps are:

    @@ -25545,7 +26191,9 @@ document.body.appendChild(wbr); this's url's origin.

    +
    +

    The protocol getter steps are:

    @@ -25558,7 +26206,9 @@ document.body.appendChild(wbr);
  • Return this's url's scheme, followed by ":".

  • +
    +

    The protocol setter steps are:

      @@ -25580,7 +26230,9 @@ document.body.appendChild(wbr);
    1. Update href.

    +
    +

    The username getter steps are:

    @@ -25593,7 +26245,9 @@ document.body.appendChild(wbr);
  • Return this's url's username.

  • +
    +

    The username setter steps are:

      @@ -25609,7 +26263,9 @@ document.body.appendChild(wbr);
    1. Update href.

    +
    +

    The password getter steps are:

    @@ -25623,7 +26279,9 @@ document.body.appendChild(wbr);
  • Return url's password.

  • +
    +

    The password setter steps are:

      @@ -25639,7 +26297,9 @@ document.body.appendChild(wbr);
    1. Update href.

    +
    +

    The host getter steps are:

    @@ -25661,7 +26321,9 @@ document.body.appendChild(wbr); data-x="concept-url-port">port, serialized.

    +
    +

    The host setter steps are:

      @@ -25680,7 +26342,9 @@ document.body.appendChild(wbr);
    1. Update href.

    +
    +

    The hostname getter steps are:

    @@ -25696,7 +26360,9 @@ document.body.appendChild(wbr);
  • Return url's host, serialized.

  • +
    +

    The hostname setter steps are:

      @@ -25715,7 +26381,9 @@ document.body.appendChild(wbr);
    1. Update href.

    +
    +

    The port getter steps are:

    @@ -25731,7 +26399,9 @@ document.body.appendChild(wbr);
  • Return url's port, serialized.

  • +
    +

    The port setter steps are:

      @@ -25753,7 +26423,9 @@ document.body.appendChild(wbr);
    1. Update href.

    +
    +

    The pathname getter steps are:

    @@ -25768,7 +26440,9 @@ document.body.appendChild(wbr);
  • Return the result of URL path serializing url.

  • +
    +

    The pathname setter steps are:

      @@ -25790,7 +26464,9 @@ document.body.appendChild(wbr);
    1. Update href.

    +
    +

    The search getter steps are:

    @@ -25807,7 +26483,9 @@ document.body.appendChild(wbr);
  • Return "?", followed by url's query.

  • +
    +

    The search setter steps are:

      @@ -25840,7 +26518,9 @@ document.body.appendChild(wbr);
    1. Update href.

    +
    +

    The hash getter steps are:

    @@ -25857,7 +26537,9 @@ document.body.appendChild(wbr);
  • Return "#", followed by url's fragment.

  • +
    +

    The hash setter steps are:

      @@ -25890,10 +26572,12 @@ document.body.appendChild(wbr);
    1. Update href.

    +

    Following hyperlinks

    +

    An element element cannot navigate if any of the following are true:

      @@ -25903,11 +26587,13 @@ document.body.appendChild(wbr);
    • element is not an a element and is not connected.

    +

    This is also used by form submission for the form element. The exception for a elements is for compatibility with web content.

    +

    To get an element's noopener, given an a, area, or form element element, a URL record url, and a string target, perform the following steps. They return a boolean.

    @@ -25942,7 +26628,9 @@ document.body.appendChild(wbr);
  • Return false.

  • +
    +

    To follow the hyperlink created by an element subject, given an optional hyperlinkSuffix (default null) and an @@ -25995,7 +26683,9 @@ document.body.appendChild(wbr); data-x="">aElement.click().

    +
    +

    The hyperlink referrer policy for an element subject is the value returned by the following steps:

    @@ -26007,6 +26697,7 @@ document.body.appendChild(wbr);
  • Return the current state of subject's referrerpolicy content attribute.

  • +
    @@ -26037,6 +26728,7 @@ document.body.appendChild(wbr);
    +

    To download the hyperlink created by an element subject, given an optional hyperlinkSuffix (default null) and an @@ -26108,7 +26800,9 @@ document.body.appendChild(wbr); +

    +

    To handle as a download a response response with a navigable navigable and a navigation ID or null navigationId:

    @@ -26196,7 +26890,9 @@ document.body.appendChild(wbr); +
    +

    To get the suggested filename for a response response:

    @@ -26340,6 +27036,7 @@ document.body.appendChild(wbr);
  • Return filename as the filename.

  • +

    For the purposes of this algorithm, a file extension consists of any part of the filename that platform conventions dictate will be used for @@ -26358,6 +27055,7 @@ document.body.appendChild(wbr);

    +

    If a hyperlink created by an a or area element has a ping attribute, and the user follows the hyperlink, and the value of the element's href attribute can be

  • Fetch request.

  • +

    This may be done in parallel with the primary fetch, and is independent of the result of that fetch.

    @@ -27011,6 +27710,7 @@ document.body.appendChild(wbr);

    There is no default type for resources given by the dns-prefetch keyword.

    +

    The appropriate times to fetch and process this type of link are:

    @@ -27026,7 +27726,9 @@ document.body.appendChild(wbr); element of an external resource link that is already browsing-context connected is changed.

    +
    +

    The fetch and process the linked resource steps for this type of linked resource, given a link element el, are: @@ -27049,6 +27751,7 @@ document.body.appendChild(wbr); faster.

    +
    Link type "expect"
    @@ -27065,6 +27768,7 @@ document.body.appendChild(wbr);

    There is no default type for resources given by the expect keyword.

    +

    Whenever any of the following conditions occur for a link element el:

    @@ -27088,7 +27792,9 @@ document.body.appendChild(wbr);

    then process el.

    +
    +

    To process internal resource link given a link element el, run these steps:

    @@ -27138,7 +27844,9 @@ document.body.appendChild(wbr);
  • Otherwise, unblock rendering on el.

  • +
    +

    To process internal resource links given a Document doc:

      @@ -27147,7 +27855,9 @@ document.body.appendChild(wbr); doc's render-blocking element set, process link.

    +
    +

    The following attribute change steps, given element, localName, oldValue, value, and namespace, are used to ensure node document.

    +
    Link type "external"
    @@ -27272,6 +27983,7 @@ document.body.appendChild(wbr);
    +

    Other keywords must be further parsed as follows to determine what they represent:

      @@ -27298,6 +28010,7 @@ document.body.appendChild(wbr);
    1. The keyword represents that the resource contains a bitmap icon with a width of width device pixels and a height of height device pixels.

    +
    @@ -27306,6 +28019,7 @@ document.body.appendChild(wbr);
    +

    The linked resource fetch setup steps for this type of linked resource, given a link element el and request request, are:

    @@ -27316,10 +28030,14 @@ document.body.appendChild(wbr);
  • Return true.

  • +
    +

    The process a link header steps for this type of linked resource are to do nothing.

    +
    +

    In the absence of a link with the icon keyword, for Document objects whose URL's scheme is an HTTP(S) scheme, user agents may @@ -27343,6 +28061,7 @@ document.body.appendChild(wbr);

  • Use response's unsafe response as an icon as if it had been declared using the icon keyword.

  • +
    @@ -27455,6 +28174,7 @@ document.body.appendChild(wbr); the user agent deems it necessary. For example, when the user chooses to install the web application.

    +

    For an installed web application, the appropriate times to fetch and process the linked resource for this link type are:

    @@ -27470,6 +28190,7 @@ document.body.appendChild(wbr); element of an external resource link that is already browsing-context connected is changed.

    +

    In any case, only the first link element in tree order whose rel attribute contains the token

    A user agent must not delay the load event for this link type.

    +

    The linked resource fetch setup steps for this type of linked resource, given a link element el and request request, are:

    @@ -27505,7 +28227,9 @@ document.body.appendChild(wbr);
  • Return true.

  • +
    +

    To process this type of linked resource given a link element el, boolean success, response response, and byte sequence @@ -27530,9 +28254,12 @@ document.body.appendChild(wbr); +

    +

    The process a link header steps for this type of linked resource are to do nothing.

    +
    @@ -27567,6 +28294,7 @@ document.body.appendChild(wbr);

    A user agent must not delay the load event for this link type.

    +

    The appropriate times to fetch and process the linked resource for such a link are:

    @@ -27581,6 +28309,7 @@ document.body.appendChild(wbr); element of an external resource link that is already browsing-context connected is changed.

    +
    @@ -27593,6 +28322,7 @@ document.body.appendChild(wbr);
    +

    The fetch and process the linked resource algorithm for modulepreload links, given a link element el, is as follows:

    @@ -27668,9 +28398,12 @@ document.body.appendChild(wbr); +
    +

    The process a link header steps for this type of linked resource are to do nothing.

    +
    @@ -27837,6 +28570,7 @@ document.body.appendChild(wbr);

    A user agent must not delay the load event for this link type.

    +

    The appropriate times to fetch and process this type of link are:

    @@ -27857,16 +28591,22 @@ document.body.appendChild(wbr); link that is already browsing-context connected is set, changed, or removed.

    +
    +

    The fetch and process the linked resource steps for this type of linked resource, given a link element el, are to create link options from el and to preconnect given the result.

    +
    +

    The process a link header step for this type of linked resource given a link processing options options are to preconnect given options.

    +
    +

    To preconnect given a link processing options options:

      @@ -27919,6 +28659,7 @@ document.body.appendChild(wbr); is deferred to the user agent.

    +
    Link type "prefetch"
    @@ -27935,6 +28676,7 @@ document.body.appendChild(wbr);

    There is no default type for resources given by the prefetch keyword.

    +

    The appropriate times to fetch and process this type of link are:

    @@ -27954,7 +28696,9 @@ document.body.appendChild(wbr); link that is already browsing-context connected is set, changed, or removed.

    +
    +

    The fetch and process the linked resource algorithm for prefetch links, given a link element el, is as follows:

    @@ -27997,9 +28741,12 @@ document.body.appendChild(wbr); processPrefetchResponse. User agents may delay the fetching of request to prioritize other requests that are necessary for the current document.

    +
    +

    The process a link header steps for this type of linked resource are to do nothing.

    +
    Link type "preload"
    @@ -28026,6 +28773,7 @@ document.body.appendChild(wbr);

    A user agent must not delay the load event for this link type.

    +

    The appropriate times to fetch and process the linked resource for such a link are:

    @@ -28058,6 +28806,7 @@ document.body.appendChild(wbr); matching the environment, is changed or removed.

    +

    A Document has a map of preloaded resources, which is an ordered map, initially empty.

    @@ -28095,6 +28844,7 @@ document.body.appendChild(wbr);
    Null, or an algorithm accepting a response or null +

    To consume a preloaded resource for Window window, given a URL url, a string destination, a string mode, a string credentialsMode, a string integrityMetadata, and @@ -28165,7 +28915,9 @@ document.body.appendChild(wbr);

  • Return true.

  • +
    +

    For the purposes of this section, a string type matches a string destination if the following algorithm returns true:

    @@ -28218,7 +28970,9 @@ document.body.appendChild(wbr);
  • Return false.

  • +
    +

    To create a preload key for a request request, return a new preload key whose URL is request's URL, mode">mode is request's mode, and credentials mode is request's credentials mode.

    +
    +

    To translate a preload destination given a string destination:

      @@ -28239,7 +28995,9 @@ document.body.appendChild(wbr); data-x="concept-potential-destination-translate">translating destination.

    +
    +

    To preload given a link processing options options and an optional processResponse, which is an algorithm accepting a Otherwise, call commit with options's document.

    +
    +

    The fetch and process the linked resource steps for this type of linked resource, given a link element el, are:

    @@ -28371,10 +29131,13 @@ document.body.appendChild(wbr); +
    +

    The process a link header step for this type of link given a link processing options options is to preload options.

    +
    Link type "

    The default type for resources given by the stylesheet keyword is text/css.

    +

    A link element of this type is implicitly potentially render-blocking if the element was created by its node document's parser.

    +
    +

    When the disabled attribute of a link element with a stylesheet keyword is set, disable the associated CSS style sheet.

    +
    +

    The appropriate times to fetch and process this type of link are: @@ -28476,12 +29244,14 @@ document.body.appendChild(wbr); connected changes from being an alternative style sheet to not being one, or vice versa.

    +

    Quirk: If the document has been set to quirks mode, has the same origin as the URL of the external resource, and the Content-Type metadata of the external resource is not a supported style sheet type, the user agent must instead assume it to be text/css.

    +

    The linked resource fetch setup steps for this type of linked resource, given a link element el and request request, are:

    @@ -28504,6 +29274,7 @@ document.body.appendChild(wbr);
  • Return true.

  • +

    See issue #968 for plans to use the CSSOM fetch a CSS @@ -28513,6 +29284,7 @@ document.body.appendChild(wbr); data-x="concept-request-render-blocking">render-blocking set to whether or not the link element is currently render-blocking.

    +

    To process this type of linked resource given a link element el, boolean success, response response, and byte sequence @@ -28646,9 +29418,12 @@ document.body.appendChild(wbr);

  • Unblock rendering on el.

  • +
    +

    The process a link header steps for this type of linked resource are to do nothing.

    +
    @@ -29133,6 +29908,7 @@ document.body.appendChild(wbr);
    +

    User agents must parse the datetime attribute according to the parse a date or time string algorithm. If that doesn't return a date or a global date and time, @@ -29142,6 +29918,7 @@ document.body.appendChild(wbr); data-x="concept-datetime">global date and time. If the given value is a global date and time, then user agents should use the associated time-zone offset information to determine which time zone to present the given datetime in.

    +
    @@ -29596,6 +30373,7 @@ interface HTMLSourceElement : HTMLElement {
    +

    The source HTML element insertion steps, given insertedNode, are:

    @@ -29615,7 +30393,9 @@ interface HTMLSourceElement : HTMLElement { then count this as a relevant mutation for child.

    +
    +

    The source HTML element moving steps, given movedNode and oldParent, are:

    @@ -29626,7 +30406,9 @@ interface HTMLSourceElement : HTMLElement { then count this as a relevant mutation for child.

    +
    +

    The source HTML element removing steps, given removedNode and oldParent, are:

    @@ -29637,6 +30419,7 @@ interface HTMLSourceElement : HTMLElement { then count this as a relevant mutation for child.

    +
    @@ -29803,6 +30586,7 @@ interface HTMLImageElement : HTMLElement { which contributes the source size to the source set (if no source element was selected).

    +

    An img element allows auto-sizes if:

      @@ -29813,6 +30597,7 @@ interface HTMLImageElement : HTMLElement { data-x="">auto" (ASCII case-insensitive), or starts with "auto," (ASCII case-insensitive).
    +

    The crossorigin attribute is a CORS settings attribute. Its purpose is to allow images from @@ -29840,6 +30625,7 @@ interface HTMLImageElement : HTMLElement { loading attribute. Its purpose is to indicate the policy for loading images that are outside the viewport.

    +

    When the loading attribute's state is changed to the Eager state, the user agent must run these steps:

    @@ -29854,6 +30640,7 @@ interface HTMLImageElement : HTMLElement {
  • Invoke resumptionSteps.

  • +
    <img src="1.jpeg" alt="1">
    @@ -29885,6 +30672,7 @@ interface HTMLImageElement : HTMLElement {
        page layout from shifting around after the image loads.

    +

    The img HTML element insertion steps, given insertedNode, are:

    @@ -29893,7 +30681,9 @@ interface HTMLImageElement : HTMLElement { a relevant mutation for insertedNode.

    +
    +

    The img HTML element moving steps, given movedNode and oldParent, are:

    @@ -29901,7 +30691,9 @@ interface HTMLImageElement : HTMLElement {
  • If oldParent is a picture element, then, count this as a relevant mutation for movedNode.

  • +
    +

    The img HTML element removing steps, given removedNode and oldParent, are:

    @@ -29909,6 +30701,7 @@ interface HTMLImageElement : HTMLElement {
  • If oldParent is a picture element, then, count this as a relevant mutation for removedNode.

  • +

    @@ -29920,6 +30713,7 @@ interface HTMLImageElement : HTMLElement {
    +

    What an img element represents depends on the src attribute and the alt attribute.

    @@ -30012,6 +30806,7 @@ interface HTMLImageElement : HTMLElement { data-x="attr-img-alt">alt
    attribute.

    +

    The alt attribute does not represent advisory information. User agents must not present the contents of the alt attribute @@ -30060,28 +30855,38 @@ interface HTMLImageElement : HTMLElement {

    +

    The crossOrigin IDL attribute must reflect the crossorigin content attribute, limited to only known values.

    +
    +

    The referrerPolicy IDL attribute must reflect the referrerpolicy content attribute, limited to only known values.

    +
    +

    The decoding IDL attribute must reflect the decoding content attribute, limited to only known values.

    +
    +

    The loading IDL attribute must reflect the loading content attribute, limited to only known values.

    +
    +

    The fetchPriority IDL attribute must reflect the fetchpriority content attribute, limited to only known values.

    +
    @@ -30136,6 +30941,7 @@ interface HTMLImageElement : HTMLElement {
    +

    The IDL attributes width and height must return the rendered width and height of the @@ -30145,13 +30951,16 @@ interface HTMLImageElement : HTMLElement { height and is available but is not being rendered; or else 0, if the image is not available or does not have density-corrected natural width and height. CSS

    +
    +

    The IDL attributes naturalWidth and naturalHeight must return the density-corrected natural width and height of the image, in CSS pixels, if the image has density-corrected natural width and height and is available, or else 0. CSS

    +

    Since the density-corrected natural width and height of an image take into account any orientation specified in its metadata, HTMLImageElement : HTMLElement { rotation needed to correctly orient the image, regardless of the value of the 'image-orientation' property.

    +

    The complete getter steps are:

    @@ -30192,12 +31002,16 @@ interface HTMLImageElement : HTMLElement {
  • Return false.

  • +
    +

    The currentSrc IDL attribute must return the img element's current request's current URL.

    +
    +

    The decode() method, when invoked, must perform the following steps:

    @@ -30286,6 +31100,7 @@ img.decode();
  • Return promise.

  • +
    @@ -30348,6 +31163,7 @@ img.decode().then(() => {
    +

    A legacy factory function is provided for creating HTMLImageElement objects (in addition to the factory methods from DOM such as createElement()): {

  • Return img.

  • +
    @@ -31082,6 +31899,7 @@ was an English <a href="/wiki/Music_hall">music hall</a> singer, ...image candidate string, if there is one, must begin with one or more ASCII whitespace.

    +

    An image candidate string consists of the following components, in order, with the further restrictions described below this list:

    @@ -31111,6 +31929,7 @@ was an English <a href="/wiki/Music_hall">music hall</a> singer, ...

    Zero or more ASCII whitespace.

    +

    There must not be an image candidate string for an element that has the same width descriptor value as another image candidate string's width @@ -31141,6 +31960,7 @@ was an English <a href="/wiki/Music_hall">music hall</a> singer, ...If present, the value must be a valid source size list.

    +

    A valid source size list is a string that matches the following grammar: CSSVALUES MQ

    @@ -31150,6 +31970,7 @@ was an English <a href="/wiki/Music_hall">music hall</a> singer, ...A <source-size-value> that is a <length> must not be negative, and must not use CSS functions other than the math functions.

    +

    The keyword auto is a width that is computed in parse a sizes attribute. If present, it must be the first entry and the @@ -31239,14 +32060,18 @@ was an English <a href="/wiki/Music_hall">music hall</a> singer, ...An image request's image data is the decoded image data.

    +

    When an image request's state is either partially available or completely available, the image request is said to be available.

    +
    +

    When an img element's current request's state is completely available and the user agent can decode the media data without errors, then the img element is said to be fully decodable.

    +

    An image request's state is initially unavailable.

    @@ -31260,9 +32085,11 @@ was an English <a href="/wiki/Music_hall">music hall</a> singer, ... +

    An img element is said to use srcset or picture if it has a srcset attribute specified or if it has a parent that is a picture element.

    +

    @@ -31275,6 +32102,7 @@ was an English <a href="/wiki/Music_hall">music hall</a> singer, ...Each image request has preferred density-corrected dimensions, which is either a struct consisting of a width and a height or is null. It must initially be null.

    +

    To determine the density-corrected natural width and height of an img element img:

    @@ -31299,6 +32127,7 @@ was an English <a href="/wiki/Music_hall">music hall</a> singer, ...

    Return dim.

    +

    For example, if the current pixel density is 3.125, that means that there are 300 device pixels per CSS inch, and thus if the image @@ -31336,7 +32165,7 @@ was an English <a href="/wiki/Music_hall">music hall</a> singer, ...The user agent should apply the image sniffing rules to determine the type of the image, with the image's associated Content-Type headers giving the official + data-x="Content-Type">associated Content-Type headers giving the official type. If these rules are not applied, then the type of the image must be the type given by the image's associated Content-Type headers.

    @@ -31355,10 +32184,13 @@ was an English <a href="/wiki/Music_hall">music hall</a> singer, ... +

    When obtaining images immediately, the user agent must synchronously update the image data of the img element, with the restart animation flag set if so stated, whenever that element is created or has experienced relevant mutations.

    +
    +

    When obtaining images on demand, the user agent must update the image data of an img element whenever it needs the image data (i.e., on demand), but only if the img element's current request's music hall</a> singer, ...img element has experienced relevant mutations, if the user agent only obtains images on demand, the img element's current request's state must return to unavailable.

    +
    Reacting to DOM mutations
    +

    The relevant mutations for an img element are as follows:

      @@ -31403,6 +32237,7 @@ was an English <a href="/wiki/Music_hall">music hall</a> singer, ...
    +
    The list of available images
    @@ -31510,6 +32345,7 @@ was an English <a href="/wiki/Music_hall">music hall</a> singer, ...in parallel, it needs to queue a task to do so.

    +

    When the user agent is to update the image data of an img element, optionally with the restart animations flag set, optionally with the maybe omit events flag set, it must run the following steps:

    @@ -31967,11 +32803,15 @@ was an English <a href="/wiki/Music_hall">music hall</a> singer, ... +
    +

    While a user agent is running the above algorithm for an element x, there must be a strong reference from the element's node document to the element x, even if that element is not connected.

    +
    +

    To abort the image request for an image request or null image request means to run the following steps:

    @@ -31981,7 +32821,9 @@ was an English <a href="/wiki/Music_hall">music hall</a> singer, ...

    Abort any instance of the fetching algorithm for image request, discarding any pending tasks generated by that algorithm.

    +
    +

    To upgrade the pending request to the current request for an img element means to run the following steps:

      @@ -31989,10 +32831,12 @@ was an English <a href="/wiki/Music_hall">music hall</a> singer, ...

      Set the img element's pending request to null.

    +
    Preparing an image for presentation
    +

    To prepare an image for presentation for an image request req given image element img:

    @@ -32049,6 +32893,7 @@ was an English <a href="/wiki/Music_hall">music hall</a> singer, ...

    Update req's img element's presentation appropriately.

    +

    Resolution in EXIF is equivalent to CSS points per inch, therefore 72 is the base for computing size from resolution.

    @@ -32061,6 +32906,7 @@ was an English <a href="/wiki/Music_hall">music hall</a> singer, ...Selecting an image source

    +

    To select an image source given an img element el:

      @@ -32072,7 +32918,9 @@ was an English <a href="/wiki/Music_hall">music hall</a> singer, ...

      Return the result of selecting an image from el's source set.

    +
    +

    To select an image source from a source set given a source set sourceSet:

    @@ -32087,9 +32935,11 @@ was an English <a href="/wiki/Music_hall">music hall</a> singer, ...

    Return selectedSource and its associated pixel density.

    +
    Creating a source set from attributes
    +

    When asked to create a source set given a string default source, a string srcset, a string sizes, and an element or null img:

    @@ -32112,10 +32962,12 @@ was an English <a href="/wiki/Music_hall">music hall</a> singer, ...

    Return source set.

    +
    Updating the source set
    +

    When asked to update the source set for a given img or link element el, user agents must do the following:

    @@ -32222,6 +33074,7 @@ was an English <a href="/wiki/Music_hall">music hall</a> singer, ... +

    Each img element independently considers its previous sibling source elements plus the img element itself for selecting an image @@ -32232,6 +33085,7 @@ was an English <a href="/wiki/Music_hall">music hall</a> singer, ...Parsing a srcset attribute +

    When asked to parse a srcset attribute from an element, parse the value of the element's srcset attribute as follows:

    @@ -32469,10 +33323,12 @@ was an English <a href="/wiki/Music_hall">music hall</a> singer, ...

    Return to the step labeled splitting loop.

    +
    Parsing a sizes attribute
    +

    When asked to parse a sizes attribute from an element element, with an img element or null img:

    @@ -32538,6 +33394,7 @@ was an English <a href="/wiki/Music_hall">music hall</a> singer, ...

    Return 100vw.

    +

    It is invalid to use a bare <source-size-value> that is a <length> (without an accompanying <media-condition>) @@ -32557,6 +33414,7 @@ was an English <a href="/wiki/Music_hall">music hall</a> singer, ..., or no descriptor at all accompanying its URL. Normalizing a source set gives every image source a pixel density descriptor.

    +

    When asked to normalize the source densities of a source set source set, the user agent must do the following:

    @@ -32586,10 +33444,12 @@ was an English <a href="/wiki/Music_hall">music hall</a> singer, ... +
    Reacting to environment changes
    +

    The user agent may at any time run the following algorithm to update an img element's image in order to react to changes in the environment. (User agents are not required to ever run this algorithm; for example, @@ -32731,6 +33591,7 @@ was an English <a href="/wiki/Music_hall">music hall</a> singer, ... +

    @@ -33759,6 +34620,7 @@ interface HTMLIFrameElement : HTMLElement { data-x="attr-iframe-srcdoc">srcdoc document, which is a Document whose URL matches about:srcdoc.

    +

    The srcdoc attribute, if present, must have a value using the HTML syntax that consists of the following syntactic components, in the given order:

    @@ -33778,6 +34640,7 @@ interface HTMLIFrameElement : HTMLElement {
  • Any number of comments and ASCII whitespace.
  • +

    The above requirements apply in XML documents as well. @@ -33855,6 +34718,7 @@ interface HTMLIFrameElement : HTMLElement {


    +

    The iframe HTML element post-connection steps, given insertedNode, are:

    @@ -33869,10 +34733,13 @@ interface HTMLIFrameElement : HTMLElement {
  • Process the iframe attributes for insertedNode, with initialInsertion set to true.

  • +
    +

    The iframe HTML element removing steps, given removedNode, are to destroy a child navigable given removedNode.

    +

    This happens without any unload events firing (the element's content document is srcdoc attribute set, changed, or removed, the user agent must process the iframe attributes.

    + +

    Similarly, whenever an iframe element with a non-null content navigable but with no srcdoc attribute specified has its src attribute set, changed, or removed, the user agent must process the iframe attributes.

    +
    +

    To process the iframe attributes for an element element, with an optional boolean initialInsertion (default false):

    @@ -33989,7 +34861,9 @@ interface HTMLIFrameElement : HTMLElement { +
    +

    The shared attribute processing steps for iframe and frame elements, given an element element and a boolean initialInsertion, are:

    @@ -34031,7 +34905,9 @@ interface HTMLIFrameElement : HTMLElement {
  • Return url.

  • +
    +

    To navigate an iframe or frame given an element element, a URL url, a referrer policy referrerPolicy, an optional string-or-null srcdocString (default @@ -34058,11 +34934,13 @@ interface HTMLIFrameElement : HTMLElement { data-x="navigation-resource">documentResource set to srcdocString, and initialInsertion set to initialInsertion.

    +

    Each Document has an iframe load in progress flag and a mute iframe load flag. When a Document is created, these flags must be unset for that Document.

    +

    To run the iframe load event steps, given an iframe element element:

    @@ -34109,12 +34987,14 @@ interface HTMLIFrameElement : HTMLElement {
  • Unset childDocument's iframe load in progress flag.

  • +

    This, in conjunction with scripting, can be used to probe the URL space of the local network's HTTP servers. User agents may implement cross-origin access control policies that are stricter than those described above to mitigate this attack, but unfortunately such policies are typically not compatible with existing web content.

    +

    If an element type potentially delays the load event, then for each element element of that type, the user agent must delay the load event of element's node document if element's content @@ -34135,6 +35015,7 @@ interface HTMLIFrameElement : HTMLElement {

    If, during the handling of the load event, element's content navigable is again navigated, that will further delay the load event.

    +

    Each iframe element has an associated current navigation was lazy loaded boolean, initially false. It is set and unset in the process the @@ -34284,15 +35165,19 @@ interface HTMLIFrameElement : HTMLElement { - block access to 'parent.frames' from sandbox --> +

    When an iframe element's sandbox attribute is set or changed while it has a non-null content navigable, the user agent must parse the sandboxing directive given the attribute's value and the iframe element's iframe sandboxing flag set.

    +
    +

    When an iframe element's sandbox attribute is removed while it has a non-null content navigable, the user agent must empty the iframe element's iframe sandboxing flag set.

    +
    @@ -34414,6 +35299,7 @@ interface HTMLIFrameElement : HTMLElement { document is not already allowed to use that feature.

    +

    To determine whether a Document object document is allowed to use the policy-controlled-feature feature, run these steps:

    @@ -34431,6 +35317,7 @@ interface HTMLIFrameElement : HTMLElement {
  • Return false.

  • +

    Because they only influence the HTMLIFrameElement : HTMLElement { loading attribute. Its purpose is to indicate the policy for loading iframe elements that are outside the viewport.

    +

    When the loading attribute's state is changed to the Eager state, the user agent must run these steps:

    @@ -34478,6 +35366,7 @@ interface HTMLIFrameElement : HTMLElement {
  • Invoke resumptionSteps.

  • +

    @@ -34493,6 +35382,7 @@ interface HTMLIFrameElement : HTMLElement {
    +

    The srcdoc getter steps are:

    @@ -34507,7 +35397,9 @@ interface HTMLIFrameElement : HTMLElement {
  • Return attribute's value.

  • +
    +

    The srcdoc setter steps are:

    @@ -34523,29 +35415,38 @@ interface HTMLIFrameElement : HTMLElement { data-x="concept-attribute-local-name">local name, and compliantString.

    +

    The supported tokens for sandbox's DOMTokenList are the allowed values defined in the sandbox attribute and supported by the user agent.

    +

    The referrerPolicy IDL attribute must reflect the referrerpolicy content attribute, limited to only known values.

    +
    +

    The loading IDL attribute must reflect the loading content attribute, limited to only known values.

    +
    +

    The contentDocument getter steps are to return this's content document.

    +
    +

    The contentWindow getter steps are to return this's content window.

    +
    @@ -34640,6 +35541,7 @@ interface HTMLEmbedElement : HTMLElement {
    +

    While any of the following conditions are occurring, any plugin instantiated for the element must be removed, and the embed element represents nothing:

    @@ -34653,7 +35555,9 @@ interface HTMLEmbedElement : HTMLElement {
  • The element has an ancestor object element that is not showing its fallback content.

  • +
    +

    An embed element is said to be potentially active when the following conditions are all met simultaneously:

    @@ -34677,7 +35581,9 @@ interface HTMLEmbedElement : HTMLElement {
  • The element is being rendered, or was being rendered the last time the event loop reached step 1.

  • +
    +

    Whenever an embed element that was not potentially active becomes potentially active, and whenever a HTMLEmbedElement : HTMLElement { data-x="attr-embed-type">type attribute set, changed, or removed, the user agent must queue an element task on the embed task source given the element to run the embed element setup steps for that element.

    +
    +

    The embed element setup steps for a given embed element element are as follows:

    @@ -34782,7 +35690,9 @@ interface HTMLEmbedElement : HTMLElement {
  • Otherwise, display no plugin for element.

  • +
    +

    To determine the type of the content given an embed element element and a response response, run the following steps:

    @@ -34816,7 +35726,9 @@ interface HTMLEmbedElement : HTMLElement {

    It is intentional that the above algorithm allows response to have a non-ok status. This allows servers to return data for plugins even with error responses (e.g., HTTP 500 Internal Server Error codes can still contain plugin data).

    +
    +

    To display no plugin for an embed element element:

      @@ -34827,13 +35739,16 @@ interface HTMLEmbedElement : HTMLElement {
    1. element now represents nothing.

    +

    The embed element has no fallback content; its descendants are ignored.

    +

    Whenever an embed element that was potentially active stops being potentially active, any plugin that had been instantiated for that element must be unloaded.

    +

    The embed element potentially delays the load event.

    @@ -34922,6 +35837,7 @@ interface HTMLObjectElement : HTMLElement {
    +

    Whenever one of the following conditions occur:

      @@ -35310,6 +36226,7 @@ interface HTMLObjectElement : HTMLElement { children. This is the element's fallback content. Destroy a child navigable given the element.

      +

    Due to the algorithm above, the contents of object elements act as fallback content, used only when referenced resources can't be shown (e.g. because it returned a 404 @@ -35328,13 +36245,17 @@ interface HTMLObjectElement : HTMLElement {

    +

    The contentDocument getter steps are to return this's content document.

    +
    +

    The contentWindow getter steps are to return this's content window.

    +

    The willValidate, validity, and HTMLVideoElement : HTMLMediaElement

    +

    If the specified resource is to be used, then, when the element is created or when the poster attribute is set, changed, or removed, the user agent must run the following steps to determine the element's poster frame (regardless of the @@ -35485,6 +36407,7 @@ interface HTMLVideoElement : HTMLMediaElement

  • If an image is thus obtained, the poster frame is that image. Otherwise, there is no poster frame.

  • +
    @@ -35509,6 +36432,7 @@ interface HTMLVideoElement : HTMLMediaElement
    +

    A video element represents what is given for the first matching condition in the list below:

    @@ -35555,6 +36479,7 @@ interface HTMLVideoElement : HTMLMediaElement frame corresponding to the current playback position in the video, the new frame must be rendered. +

    Frames of video must be obtained from the video track that was selected when the event loop last reached @@ -35616,6 +36541,7 @@ interface HTMLVideoElement : HTMLMediaElement ratio to the video data's dimensions to obtain the "correct" dimensions, then the user agent must apply the ratio by increasing one dimension and leaving the other unchanged.

    +

    The videoWidth IDL attribute must return the natural width of the video in HTMLVideoElement : HTMLMediaElement data-x="'px'">CSS pixels. If the element's readyState attribute is HAVE_NOTHING, then the attributes must return 0.

    +
    +

    Whenever the natural width or natural height of the video changes (including, for example, because the selected video @@ -35634,6 +36562,7 @@ interface HTMLVideoElement : HTMLMediaElement queue a media element task given the media element to fire an event named resize at the media element.

    +
    @@ -35651,20 +36580,26 @@ interface HTMLVideoElement : HTMLMediaElement

    In user agents that implement CSS, the above requirement can be implemented by using the style rule suggested in the Rendering section.

    +

    The natural width of a video element's playback area is the natural width of the poster frame, if that is available and the element currently represents its poster frame; otherwise, it is the natural width of the video resource, if that is available; otherwise the natural width is missing.

    +
    +

    The natural height of a video element's playback area is the natural height of the poster frame, if that is available and the element currently represents its poster frame; otherwise it is the natural height of the video resource, if that is available; otherwise the natural height is missing.

    +
    +

    The default object size is a width of 300 CSS pixels and a height of 150 CSS pixels. CSSIMAGES

    +

    @@ -35843,6 +36778,7 @@ interface HTMLAudioElement : HTMLMediaElement
    +

    A legacy factory function is provided for creating HTMLAudioElement objects (in addition to the factory methods from DOM such as createElement()): HTMLAudioElement : HTMLMediaElement

  • Return audio.

  • +
    @@ -35994,10 +36931,12 @@ interface HTMLTrackElement : HTMLElement { Metadata +

    The attribute's missing value default is the subtitles state, and its invalid value default is the metadata state.

    +

    The src attribute gives the URL of the text track data. The value must be a valid non-empty URL @@ -36007,6 +36946,7 @@ interface HTMLTrackElement : HTMLElement {

    The element has an associated track URL (a string), initially the empty string.

    +

    When the element's src attribute is set, run these steps:

      @@ -36022,6 +36962,7 @@ interface HTMLTrackElement : HTMLElement {
    1. Set the element's track URL to trackURL if it is not failure; otherwise to the empty string.

    +
    @@ -36039,9 +36980,11 @@ interface HTMLTrackElement : HTMLElement {
    +

    If the element has a srclang attribute whose value is not the empty string, then the element's track language is the value of the attribute. Otherwise, the element has no track language.

    +
    @@ -36061,9 +37004,11 @@ interface HTMLTrackElement : HTMLElement {
    +

    If the element has a label attribute whose value is not the empty string, then the element's track label is the value of the attribute. Otherwise, the element's track label is an empty string.

    +
    @@ -36120,6 +37065,7 @@ interface HTMLTrackElement : HTMLElement {
    +

    The readyState attribute must return the numeric value corresponding to the text track readiness state of the track element's @@ -36135,14 +37081,19 @@ interface HTMLTrackElement : HTMLElement {

    ERROR (numeric value 3)
    The text track failed to load state.
    +
    +

    The track IDL attribute must, on getting, return the track element's text track's corresponding TextTrack object.

    +
    +

    The kind IDL attribute must reflect the content attribute of the same name, limited to only known values.

    +
    @@ -36305,10 +37256,12 @@ interface HTMLMediaElement : HTMLElement {

    Each media element has a unique media element event task source.

    +

    To queue a media element task with a media element element and a series of steps steps, queue an element task on the media element's media element event task source given element and steps.

    +
    @@ -36329,12 +37282,14 @@ interface HTMLMediaElement : HTMLElement {
    +

    All media elements have an associated error status, which records the last error the element encountered since its resource selection algorithm was last invoked. The error attribute, on getting, must return the MediaError object created for this last error, or null if there has not been an error.

    +
    @@ -36395,6 +37350,7 @@ interface MediaError {
    +

    To create a MediaError, given an error code which is one of the above values, return a new MediaError object whose code is the given error code and whose MediaError { the code into a string format. If no additional information is available beyond that provided by the error code, the message must be set to the empty string.

    +
    +

    The code getter steps are to return this's code.

    +
    +

    The message getter steps are to return this's message.

    +
    @@ -36436,20 +37397,26 @@ interface MediaError {
    +

    If a media element is created with a src attribute, the user agent must immediately invoke the media element's resource selection algorithm.

    +
    +

    If a src attribute of a media element is set or changed, the user agent must invoke the media element's media element load algorithm. (Removing the src attribute does not do this, even if there are source elements present.)

    +
    +

    The crossOrigin IDL attribute must reflect the crossorigin content attribute, limited to only known values.

    +
    @@ -36491,11 +37458,13 @@ interface MediaError { empty string. Its value is changed by the resource selection algorithm defined below.

    +

    The srcObject IDL attribute, on getting, must return the element's assigned media provider object, if any, or null otherwise. On setting, it must set the element's assigned media provider object to the new value, and then invoke the element's media element load algorithm.

    +
    @@ -36549,6 +37518,7 @@ interface MediaError {
    +

    The canPlayType(type) method must return the empty string if type is a type @@ -36563,6 +37533,7 @@ interface MediaError { confidently established as being supported or not. Generally, a user agent should never return "probably" for a type that allows the codecs parameter if that parameter is not present.

    +
    @@ -36604,10 +37575,12 @@ interface MediaError {
    +

    As media elements interact with the network, their current network activity is represented by the networkState attribute. On getting, it must return the current network state of the element, which must be one of the following values:

    +
    @@ -36662,13 +37635,16 @@ interface MediaError { begin in the false state. While the delaying-the-load-event flag is true, the element must delay the load event of its document.

    +

    When the load() method on a media element is invoked, the user agent must run the media element load algorithm.

    +

    A media element has an associated boolean is currently stalled, which is initially false.

    +

    The media element load algorithm consists of the following steps.

      @@ -36791,7 +37767,9 @@ interface MediaError { stops.

    +
    +

    The resource selection algorithm for a media element is as follows. This algorithm is always invoked as part of a task, but one of the first steps in the algorithm is to return and continue running the remaining steps @@ -37099,7 +38077,9 @@ interface MediaError { +

    +

    To verify a media response given a response response, a media resource resource, and "entire resource" or a @@ -37168,7 +38148,9 @@ interface MediaError {

  • Return true.

  • +
    +

    The resource fetch algorithm for a media element and a given URL record or media provider object is as follows:

    @@ -37796,7 +38778,9 @@ interface MediaError { gets loaded and kept available): abort the overall resource selection algorithm.

    +
    +

    When a media element is to forget the media element's media-resource-specific tracks, the user agent must remove from the media element's list of text tracks all the media-resource-specific @@ -37807,6 +38791,7 @@ interface MediaError { data-x="event-media-removetrack">removetrack events) are fired as part of this; the error and emptied events, fired by the algorithms that invoke this one, can be used instead.

    +
    @@ -37845,11 +38830,13 @@ interface MediaError {

    The attribute's empty value default is the Automatic state.

    +

    The attribute's missing value default and invalid value default are both implementation-defined, though the Metadata state is suggested as a compromise between reducing server load and providing an optimal user experience.

    +

    The attribute can be changed even once the media resource is being buffered or played; the descriptions in the table above are to be interpreted with that in mind.

    @@ -37869,9 +38856,11 @@ interface MediaError { may be ignored altogether, for example based on explicit user preferences or based on the available connectivity.

    +

    The preload IDL attribute must reflect the content attribute of the same name, limited to only known values.

    +
    @@ -37905,12 +38894,14 @@ interface MediaError {
    +

    The buffered attribute must return a new static normalized TimeRanges object that represents the ranges of the media resource, if any, that the user agent has buffered, at the time the attribute is evaluated. User agents must accurately determine the ranges available, even for media streams where this can only be determined by tedious inspection.

    +

    Typically this will be a single range anchored at the zero point, but if, e.g. the user agent uses HTTP range requests in response to seeking, then there could be multiple @@ -38064,6 +39055,7 @@ interface MediaError { user agent is to show a poster frame for a video element instead of showing the video contents.

    +

    The currentTime attribute must, on getting, return the media element's default playback start position, unless that is zero, in @@ -38075,6 +39067,7 @@ interface MediaError { set the official playback position to the new value and then seek to the new value. The new value must be interpreted as being in seconds.

    +

    If the media resource is a streaming resource, then the user agent might be unable to obtain certain parts of the resource after it has expired from its buffer. Similarly, some @@ -38088,6 +39081,7 @@ interface MediaError { data-x="dom-media-seekable">seekable attribute's TimeRanges object, if any, or the current playback position otherwise.

    +

    When the earliest possible position changes, then: if the current playback position is before the earliest possible position, the user agent must seek to the earliest possible position; otherwise, if @@ -38096,6 +39090,7 @@ interface MediaError { then the user agent must queue a media element task given the media element to fire an event named timeupdate at the element.

    +

    Because of the above requirement and the requirement in the resource fetch algorithm that kicks in MediaError { +

    If at any time the user agent learns that an audio or video track has ended and all media data relating to that track corresponds to parts of the media timeline that are before the earliest possible position, the user agent may queue a @@ -38124,13 +39120,16 @@ interface MediaError { initialized to the AudioTrack or VideoTrack object representing the track.

    +
    +

    The duration attribute must return the time of the end of the media resource, in seconds, on the media timeline. If no media data is available, then the attributes must return the Not-a-Number (NaN) value. If the media resource is not known to be bounded (e.g. streaming radio, or a live event with no announced end time), then the attribute must return the positive Infinity value.

    +

    The user agent must determine the duration of the media resource before playing any part of the media data and before setting MediaError { data-x="dom-media-HAVE_METADATA">HAVE_METADATA, even if doing so requires fetching multiple parts of the resource.

    +

    When the length of the media resource changes to a known value (e.g. from being unknown to known, or from a previously established length to a new length), the user agent must queue a media element task given the media element to @@ -38147,6 +39147,7 @@ interface MediaError { duration is changed such that the current playback position ends up being greater than the time of the end of the media resource, then the user agent must also seek to the time of the end of the media resource.

    +

    If an "infinite" stream ends for some reason, then the duration would change from positive Infinity to the time of the last frame or sample in the stream, and the MediaError { media timeline, known as the timeline offset. Initially, the timeline offset must be set to Not-a-Number (NaN).

    +

    The getStartDate() method must return a new Date object representing the current timeline offset.

    +
    @@ -38272,6 +39275,7 @@ interface MediaError {
    +

    When the ready state of a media element whose networkState is not NETWORK_EMPTY changes, the user agent must follow the steps @@ -38415,6 +39419,7 @@ interface MediaError { +

    @@ -38427,10 +39432,12 @@ interface MediaError {
    +

    The readyState IDL attribute must, on getting, return the value described above that describes the current ready state of the media element.

    +
    @@ -38520,17 +39527,21 @@ interface MediaError { attribute represents whether the media element is paused or not. The attribute must initially be true.

    +

    A media element is a blocked media element if its readyState attribute is in the HAVE_NOTHING state, the HAVE_METADATA state, or the HAVE_CURRENT_DATA state, or if the element has paused for user interaction or paused for in-band content.

    +
    +

    A media element is said to be potentially playing when its paused attribute is false, the element has not ended playback, playback has not stopped due to errors, and the element is not a blocked media element.

    +

    A waiting DOM event can be fired as a result of an element that is @@ -38538,6 +39549,7 @@ interface MediaError { data-x="dom-media-readyState">readyState attribute changing to a value lower than HAVE_FUTURE_DATA.

    +

    A media element is said to be eligible for autoplay when all of the following are true:

    @@ -38555,15 +39567,19 @@ interface MediaError {
  • its node document is allowed to use the "autoplay" feature.

  • +
    +

    A media element is said to be allowed to play if the user agent and the system allow media playback in the current context.

    +

    For example, a user agent could allow playback only when the media element's Window object has transient activation, but an exception could be made to allow playback while muted.

    +

    A media element is said to have ended playback when:

      @@ -38593,19 +39609,25 @@ interface MediaError {
    +
    +

    The ended attribute must return true if, the last time the event loop reached step 1, the media element had ended playback and the direction of playback was forwards, and false otherwise.

    +
    +

    A media element is said to have stopped due to errors when the element's readyState attribute is HAVE_METADATA or greater, and the user agent encounters a non-fatal error during the processing of the media data, and due to that error, is not able to play the content at the current playback position.

    +
    +

    A media element is said to have paused for user interaction when its paused attribute is false, the readyState attribute is either MediaError { data-x="dom-media-HAVE_ENOUGH_DATA">HAVE_ENOUGH_DATA, and the user agent has reached a point in the media resource where the user has to make a selection for the resource to continue.

    +

    It is possible for a media element to have both ended playback and paused for user interaction at the same time.

    +

    When a media element that is potentially playing stops playing because it has paused for user interaction, the user agent must queue a media element task given the media element to fire an event named timeupdate at the element.

    +
    +

    A media element is said to have paused for in-band content when its paused attribute is false, the readyState attribute is either MediaError { to the media resource and has a nonzero length, or to play content that is temporally anchored to a segment of the media resource but has a length longer than that segment.

    +

    One example of when a media element would be paused for in-band content is when the user agent is playing MediaError {


    +

    When the current playback position reaches the end of the media resource when the direction of playback is forwards, then the user agent must follow these steps:

    @@ -38686,12 +39714,15 @@ interface MediaError { +
    +

    When the current playback position reaches the earliest possible position of the media resource when the direction of playback is backwards, then the user agent must only queue a media element task given the media element to fire an event named timeupdate at the element.

    +

    The word "reaches" here does not imply that the current playback position needs to have changed during normal playback; it could be via MediaError {


    +

    The defaultPlaybackRate attribute gives the desired speed at which the media resource is to play, as a multiple of its intrinsic speed. The attribute is mutable: on getting it must return the last value it was set to, or 1.0 if it hasn't yet been set; on setting the attribute must be set to the new value.

    +

    The defaultPlaybackRate is used by the user agent when it exposes a user interface to the user.

    +

    The playbackRate attribute gives the effective playback rate, which is the speed at which the media resource plays, as a multiple of its @@ -38725,7 +39759,9 @@ interface MediaError {

  • Set playbackRate to the new value, and if the element is potentially playing, change the playback speed.

  • +
    +

    When the defaultPlaybackRate or playbackRate attributes change value (either by being set @@ -38735,21 +39771,26 @@ interface MediaError { data-x="event-media-ratechange">ratechange at the media element. The user agent must process attribute changes smoothly and must not introduce any perceivable gaps or muting of playback in response.

    +
    +

    The preservesPitch getter steps are to return true if a pitch-preserving algorithm is in effect during playback. The setter steps are to correspondingly switch the pitch-preserving algorithm on or off, without any perceivable gaps or muting of playback. By default, such a pitch-preserving algorithm must be in effect (i.e., the getter will initially return true).

    +

    +

    The played attribute must return a new static normalized TimeRanges object that represents the ranges of points on the media timeline of the media resource reached through the usual monotonic increase of the current playback position during normal playback, if any, at the time the attribute is evaluated.

    +

    Returning a new object each time is a bad pattern for attribute getters and is only enshrined here as it would be costly to change it. It is not to be copied to new APIs.

    @@ -38759,6 +39800,7 @@ interface MediaError {

    Each media element has a list of pending play promises, which must initially be empty.

    +

    To take pending play promises for a media element, the user agent must run the following steps:

    @@ -38773,15 +39815,21 @@ interface MediaError {
  • Return promises.
  • +
    +

    To resolve pending play promises for a media element with a list of promises promises, the user agent must resolve each promise in promises with undefined.

    +
    +

    To reject pending play promises for a media element with a list of promises promises and an exception name error, the user agent must reject each promise in promises with error.

    +
    +

    To notify about playing for a media element, the user agent must run the following steps:

    @@ -38800,7 +39848,9 @@ interface MediaError { +
    +

    When the play() method on a media element is invoked, the user agent must run the following steps.

    @@ -38829,7 +39879,9 @@ interface MediaError {
  • Return promise.

  • +
    +

    The internal play steps for a media element are as follows:

      @@ -38896,9 +39948,11 @@ interface MediaError {
    1. Set the media element's can autoplay flag to false.

    +

    +

    When the pause() method is invoked, and when the user agent is required to pause the media element, the user agent must run the following steps:

    @@ -38911,7 +39965,9 @@ interface MediaError {
  • Run the internal pause steps for the media element.

  • +
    +

    The internal pause steps for a media element are as follows:

      @@ -38947,12 +40003,16 @@ interface MediaError {
    +

    +

    If the element's playbackRate is positive or zero, then the direction of playback is forwards. Otherwise, it is backwards.

    +
    +

    When a media element is potentially playing and its Document is a fully active Document, its current playback position must increase monotonically at the element's MediaError { media timeline's clock. (This specification always refers to this as an increase, but that increase could actually be a decrease if the element's playbackRate is negative.)

    +

    The element's playbackRate can be 0.0, in which case the current playback position doesn't move, despite playback not @@ -38973,10 +40034,13 @@ interface MediaError { the stream's playback rate) the client doesn't actually have to drop or interpolate any frames.

    +

    Any time the user agent provides a stable state, the official playback position must be set to the current playback position.

    +
    +

    While the direction of playback is backwards, any corresponding audio must be muted. While the element's playbackRate is so low or so high that the user agent @@ -38986,20 +40050,27 @@ interface MediaError { data-x="dom-media-preservesPitch">preservesPitch is true, the user agent must apply pitch adjustment to preserve the original pitch of the audio. Otherwise, the user agent must speed up or slow down the audio without any pitch adjustment.

    +
    +

    When a media element is potentially playing, its audio data played must be synchronized with the current playback position, at the element's effective media volume. The user agent must play the audio from audio tracks that were enabled when the event loop last reached step 1.

    +
    +

    When a media element is not potentially playing, audio must not play for the element.

    +
    +

    Media elements that are potentially playing while not in a document must not play any video, but should play any audio component. Media elements must not stop playing just because all references to them have been removed; only once a media element is in a state where no further audio could ever be played by that element may the element be garbage collected.

    +

    It is possible for an element to which no explicit references exist to play audio, even if such an element is not still actively playing: for instance, it could be unpaused but @@ -39010,6 +40081,7 @@ interface MediaError {


    +

    Each media element has a list of newly introduced cues, which must be initially empty. Whenever a text track cue is added to the list of cues of a text track that is in the list of text @@ -39022,14 +40094,18 @@ interface MediaError { element's list of newly introduced cues has new cues added while the media element's show poster flag is not set, then the user agent must run the time marches on steps.

    +
    +

    When a text track cue is removed from the list of cues of a text track that is in the list of text tracks for a media element, and whenever a text track is removed from the list of text tracks of a media element, if the media element's show poster flag is not set, then the user agent must run the time marches on steps.

    +
    +

    When the current playback position of a media element changes (e.g. due to playback or seeking), the user agent must run the time marches on steps. To support use cases that depend on the timing accuracy of cue event firing, such as @@ -39038,12 +40114,14 @@ interface MediaError { current playback position changes while the steps are running, then the user agent must wait for the steps to complete, and then must immediately rerun the steps. These steps are thus run as often as possible or needed.

    +

    If one iteration takes a long time, this can cause short duration cues to be skipped over as the user agent rushes ahead to "catch up", so these cues will not appear in the activeCues list.

    +

    The time marches on steps are as follows:

      @@ -39195,15 +40273,19 @@ interface MediaError { data-x="text track">text tracks based on WebVTT, the rules for updating the display of WebVTT text tracks. WEBVTT

    +
    +

    For the purposes of the algorithm above, a text track cue is considered to be part of a text track only if it is listed in the text track list of cues, not merely if it is associated with the text track.

    +

    If the media element's node document stops being a fully active document, then the playback will stop until the document is active again.

    +

    When a media element is removed from a Document, the user agent must run the following steps:

    @@ -39218,6 +40300,7 @@ interface MediaError {
  • ⌛ Run the internal pause steps for the media element.

    +
  • @@ -39253,11 +40336,14 @@ interface MediaError {

    The seeking attribute must initially have the value false.

    +

    The fastSeek(time) method must seek to the time given by time, with the approximate-for-speed flag set.

    +
    +

    When the user agent is required to seek to a particular new playback position in the media resource, optionally with the approximate-for-speed flag set, it means that the user agent must run the following steps. This algorithm interacts closely with the event loop mechanism; in particular, it has @@ -39358,14 +40444,17 @@ interface MediaError { fire an event named seeked at the element.

    +

    +

    The seekable attribute must return a new static normalized TimeRanges object that represents the ranges of the media resource, if any, that the user agent is able to seek to, at the time the attribute is evaluated.

    +

    If the user agent can seek to anywhere in the media resource, e.g. because it is a simple movie file and the user agent and the server support HTTP Range requests, @@ -39428,15 +40517,19 @@ interface MediaError {

    +

    The audioTracks attribute of a media element must return a live AudioTrackList object representing the audio tracks available in the media element's media resource.

    +
    +

    The videoTracks attribute of a media element must return a live VideoTrackList object representing the video tracks available in the media element's media resource.

    +

    There are only ever one AudioTrackList object and one VideoTrackList object per media element, even if another media @@ -39583,23 +40676,30 @@ interface VideoTrack { will change dynamically. If the media resource changes entirely, then all the previous tracks will be removed and replaced with new tracks.

    +

    The AudioTrackList length and VideoTrackList length attribute getters must return the number of tracks represented by their objects at the time of getting.

    +
    +

    The supported property indices of AudioTrackList and VideoTrackList objects at any instant are the numbers from zero to the number of tracks represented by the respective object minus one, if any tracks are represented. If an AudioTrackList or VideoTrackList object represents no tracks, it has no supported property indices.

    +
    +

    To determine the value of an indexed property for a given index index in an AudioTrackList or VideoTrackList object list, the user agent must return the AudioTrack or VideoTrack object that represents the indexth track in list.

    +
    +

    The AudioTrackList getTrackById(id) and VideoTrackList VideoTrack { AudioTrackList or VideoTrackList object (respectively) whose identifier is equal to the value of the id argument (in the natural order of the list, as defined above). When no tracks match the given argument, the methods must return null.

    +

    The AudioTrack and VideoTrack objects represent specific tracks of a media resource. Each track can have an identifier, category, label, and language. @@ -39625,6 +40726,7 @@ interface VideoTrack { created, its selection state must be set to false (not selected). The resource fetch algorithm can override this.

    +

    The AudioTrack id and VideoTrack id attributes must return the @@ -39633,14 +40735,17 @@ interface VideoTrack { returned for a particular track must be the same identifier that would enable the track if used as the name of a track in the track dimension of such a fragment. INBAND

    +

    For example, in Ogg files, this would be the Name header field of the track. OGGSKELETONHEADERS

    +

    The AudioTrack kind and VideoTrack kind attributes must return the category of the track, if it has one, or the empty string otherwise.

    +

    The category of a track is the string given in the first column of the table below that is the most appropriate for the track based on the definitions in the table's second and third columns, @@ -39733,11 +40838,14 @@ interface VideoTrack {

    +

    The AudioTrack label and VideoTrack label attributes must return the label of the track, if it has one, or the empty string otherwise. INBAND

    +
    +

    The AudioTrack language and VideoTrack language attributes must @@ -39746,30 +40854,38 @@ interface VideoTrack { example because the language information in the media resource's format is a free-form string without a defined interpretation), then the method must return the empty string, as if the track had no language. INBAND

    +
    +

    The AudioTrack enabled attribute, on getting, must return true if the track is currently enabled, and false otherwise. On setting, it must enable the track if the new value is true, and disable it otherwise. (If the track is no longer in an AudioTrackList object, then the track being enabled or disabled has no effect beyond changing the value of the attribute on the AudioTrack object.)

    +
    +

    Whenever an audio track in an AudioTrackList that was disabled is enabled, and whenever one that was enabled is disabled, the user agent must queue a media element task given the media element to fire an event named change at the AudioTrackList object.

    +

    An audio track that has no data for a particular position on the media timeline, or that does not exist at that position, must be interpreted as being silent at that point on the timeline.

    +

    The VideoTrackList selectedIndex attribute must return the index of the currently selected track, if any. If the VideoTrackList object does not currently represent any tracks, or if none of the tracks are selected, it must instead return −1.

    +
    +

    The VideoTrack selected attribute, on getting, must return true if the track is currently selected, and false otherwise. On setting, it must select the track if the @@ -39778,7 +40894,9 @@ interface VideoTrack { is no longer in a VideoTrackList object, then the track being selected or unselected has no effect beyond changing the value of the attribute on the VideoTrack object.)

    +
    +

    Whenever a track in a VideoTrackList that was previously not selected is selected, and whenever the selected track in a VideoTrackList is unselected without a new track being selected in its stead, the user agent must queue a @@ -39788,6 +40906,7 @@ interface VideoTrack { data-x="concept-task">task must be queued before the task that fires the resize event, if any.

    +

    A video track that has no data for a particular position on the media timeline must be interpreted as being transparent black at that point on the timeline, with @@ -40033,6 +41152,7 @@ interface VideoTrack { initially be empty, a blocked-on-parser flag, which must initially be false, and a did-perform-automatic-track-selection flag, which must also initially be false.

    +

    When the user agent is required to populate the list of pending text tracks of a media element, the user agent must add to the element's list of pending text tracks each text track in the element's list of text tracks whose @@ -40040,30 +41160,40 @@ interface VideoTrack { text track readiness state is loading.

    +
    +

    Whenever a track element's parent node changes, the user agent must remove the corresponding text track from any list of pending text tracks that it is in.

    +
    +

    Whenever a text track's text track readiness state changes to either loaded or failed to load, the user agent must remove it from any list of pending text tracks that it is in.

    +
    +

    When a media element is created by an HTML parser or XML parser, the user agent must set the element's blocked-on-parser flag to true. When a media element is popped off the stack of open elements of an HTML parser or XML parser, the user agent must honor user preferences for automatic text track selection, populate the list of pending text tracks, and set the element's blocked-on-parser flag to false.

    +
    +

    The text tracks of a media element are ready when both the element's list of pending text tracks is empty and the element's blocked-on-parser flag is false.

    +

    Each media element has a pending text track change notification flag, which must initially be unset.

    +

    Whenever a text track that is in a media element's list of text tracks has its text track mode change value, the user agent must run the following steps for the media element:

    @@ -40093,6 +41223,7 @@ interface VideoTrack {
  • If the media element's show poster flag is not set, run the time marches on steps.

  • +

    The task source for the tasks listed in this section is the DOM manipulation task source.

    @@ -40138,11 +41269,13 @@ interface VideoTrack { +

    An unbounded text track cue is a text track cue with a text track cue end time set to positive Infinity. An active unbounded text track cue cannot become inactive through the usual monotonic increase of the current playback position during normal playback (e.g. a metadata cue for a chapter in a live event with no announced end time.)

    +

    The text track cue start time and text track cue end time can be negative. (The current playback position can never be negative, @@ -40168,6 +41301,7 @@ interface VideoTrack {

    This flag must be initially unset. The flag is used to ensure events are fired appropriately when the cue becomes active or inactive, and to make sure the right cues are rendered.

    +

    The user agent must synchronously unset this flag whenever the text track cue is removed from its text track's text track list of cues; whenever the text track itself is removed from its media element's list of @@ -40180,7 +41314,9 @@ interface VideoTrack { the flag for all the affected cues, apply the rules for updating the text track rendering of those text tracks. For example, for text tracks based on WebVTT, the rules for updating the display - of WebVTT text tracks. WEBVTT

    + of WebVTT text tracks. WEBVTT

    +
    +
    The display state
    @@ -40219,6 +41355,7 @@ interface VideoTrack { some legacy formats can be found in Sourcing In-band Media Resource Tracks from Media Containers into HTML. INBAND

    +

    When a media resource contains data that the user agent recognizes and supports as being equivalent to a text track, the user agent runs the steps to expose a @@ -40333,6 +41470,7 @@ interface VideoTrack { using TrackEvent, with the track attribute initialized to the text track's TextTrack object.

    +

    +

    When a text track corresponding to a track element is added to a media element's list of text tracks, the user agent must queue a media element task given the media element to run the following steps for the @@ -40439,7 +41590,9 @@ interface VideoTrack {

  • Honor user preferences for automatic text track selection for this element.

  • +
    +

    When the user agent is required to honor user preferences for automatic text track selection for a media element, the user agent must run the following steps:

    @@ -40463,7 +41616,9 @@ interface VideoTrack {
  • Set the element's did-perform-automatic-track-selection flag to true.

  • +
    +

    When the steps above say to perform automatic text track selection for one or more text track kinds, it means to run the following steps:

    @@ -40504,7 +41659,9 @@ interface VideoTrack { mode of the first such track to showing.

    +
    +

    When a text track corresponding to a track element experiences any of the following circumstances, the user agent must start the track processing model for that text track and its track element: @@ -40517,7 +41674,9 @@ interface VideoTrack {

  • The track element's parent element changes and the new parent is a media element.
  • +
    +

    When a user agent is to start the track processing model for a text track and its track element, it must run the following algorithm. This algorithm interacts closely with the event loop mechanism; in particular, it has @@ -40656,11 +41815,14 @@ interface VideoTrack {

  • Jump to the step labeled top.

  • +
    +

    Whenever a track element has its src attribute set, changed, or removed, the user agent must immediately empty the element's text track's text track list of cues. (This also causes the algorithm above to stop adding cues from the resource being obtained using the previously given URL, if any.)

    +
    @@ -40738,34 +41900,44 @@ interface TextTrackList : EventTarget {

    A TextTrackList object represents a dynamically updating list of text tracks in a given order.

    +

    The textTracks attribute of media elements must return a TextTrackList object representing the TextTrack objects of the text tracks in the media element's list of text tracks, in the same order as in the list of text tracks.

    +
    +

    The length attribute of a TextTrackList object must return the number of text tracks in the list represented by the TextTrackList object.

    +
    +

    The supported property indices of a TextTrackList object at any instant are the numbers from zero to the number of text tracks in the list represented by the TextTrackList object minus one, if any. If there are no text tracks in the list, there are no supported property indices.

    +
    +

    To determine the value of an indexed property of a TextTrackList object for a given index index, the user agent must return the indexth text track in the list represented by the TextTrackList object.

    +
    +

    The getTrackById(id) method must return the first TextTrack in the TextTrackList object whose id IDL attribute would return a value equal to the value of the id argument. When no tracks match the given argument, the method must return null.

    +
    @@ -40879,6 +42051,7 @@ interface TextTrack : EventTarget {
    +

    The addTextTrack(kind, label, language) method of media elements, @@ -40919,21 +42092,29 @@ interface TextTrack : EventTarget {

    Return the new TextTrack object.

    +

    +

    The kind attribute must return the text track kind of the text track that the TextTrack object represents.

    +
    +

    The label attribute must return the text track label of the text track that the TextTrack object represents.

    +
    +

    The language attribute must return the text track language of the text track that the TextTrack object represents.

    +
    +

    The id attribute returns the track's identifier, if it has one, or the empty string otherwise. For tracks that correspond to track elements, the track's identifier is the value of the element's @@ -40942,12 +42123,16 @@ interface TextTrack : EventTarget { that supports media fragment syntax, the identifier returned for a particular track must be the same identifier that would enable the track if used as the name of a track in the track dimension of such a fragment.

    +
    +

    The inBandMetadataTrackDispatchType attribute must return the text track in-band metadata track dispatch type of the text track that the TextTrack object represents.

    +
    +

    The mode attribute, on getting, must return the string corresponding to the text track mode of the text track that the TextTrack object represents, as defined by the @@ -40961,7 +42146,9 @@ interface TextTrack : EventTarget {

    "showing"
    The text track showing mode.
    +
    +

    On setting, if the new value isn't equal to what the attribute would currently return, the new value must be processed as follows:

    @@ -40988,7 +42175,9 @@ interface TextTrack : EventTarget { TextTrack object represents to the text track showing mode.

    +
    +

    If the text track mode of the text track that the TextTrack object represents is not the text track disabled mode, then the cues attribute @@ -40999,11 +42188,15 @@ interface TextTrack : EventTarget { started, in text track cue order. Otherwise, it must return null. For each TextTrack object, when an object is returned, the same TextTrackCueList object must be returned each time.

    +
    +

    The earliest possible position when the script started is whatever the earliest possible position was the last time the event loop reached step 1.

    +
    +

    If the text track mode of the text track that the TextTrack object represents is not the text track disabled mode, then the activeCues @@ -41013,13 +42206,17 @@ interface TextTrack : EventTarget { started, in text track cue order. Otherwise, it must return null. For each TextTrack object, when an object is returned, the same TextTrackCueList object must be returned each time.

    +
    +

    A text track cue's active flag was set when the script started if its text track cue active flag was set the last time the event loop reached step 1.

    +

    +

    The addCue(cue) method of TextTrack objects, when invoked, must run the following steps:

    @@ -41040,7 +42237,9 @@ interface TextTrack : EventTarget {
  • Add cue to the TextTrack object's text track's text track list of cues.

  • +
    +

    The removeCue(cue) method of TextTrack objects, when invoked, must run the following steps:

    @@ -41053,6 +42252,7 @@ interface TextTrack : EventTarget {
  • Remove cue from the TextTrack object's text track's text track list of cues.

  • +
    @@ -41129,27 +42329,35 @@ interface TextTrackCueList {

    A TextTrackCueList object represents a dynamically updating list of text track cues in a given order.

    +

    The length attribute must return the number of cues in the list represented by the TextTrackCueList object.

    +
    +

    The supported property indices of a TextTrackCueList object at any instant are the numbers from zero to the number of cues in the list represented by the TextTrackCueList object minus one, if any. If there are no cues in the list, there are no supported property indices.

    +
    +

    To determine the value of an indexed property for a given index index, the user agent must return the indexth text track cue in the list represented by the TextTrackCueList object.

    +
    +

    The getCueById(id) method, when called with an argument other than the empty string, must return the first text track cue in the list represented by the TextTrackCueList object whose text track cue identifier is id, if any, or null otherwise. If the argument is the empty string, then the method must return null.

    +
    @@ -41209,17 +42417,22 @@ interface TextTrackCue : EventTarget {
    +

    The track attribute, on getting, must return the TextTrack object of the text track in whose list of cues the text track cue that the TextTrackCue object represents finds itself, if any; or null otherwise.

    +
    +

    The id attribute, on getting, must return the text track cue identifier of the text track cue that the TextTrackCue object represents. On setting, the text track cue identifier must be set to the new value.

    +
    +

    The startTime attribute, on getting, must return the text track cue start time of the text track cue that the @@ -41230,7 +42443,9 @@ interface TextTrackCue : EventTarget { a media element's list of text tracks, and the media element's show poster flag is not set, then run the time marches on steps for that media element.

    +
    +

    The endTime attribute, on getting, must return the text track cue end time of the text track cue that the @@ -41243,13 +42458,16 @@ interface TextTrackCue : EventTarget { track is in a media element's list of text tracks, and the media element's show poster flag is not set, then run the time marches on steps for that media element.

    +
    +

    The pauseOnExit attribute, on getting, must return true if the text track cue pause-on-exit flag of the text track cue that the TextTrackCue object represents is set; or false otherwise. On setting, the text track cue pause-on-exit flag must be set if the new value is true, and must be unset otherwise.

    +
    Event handlers for objects of the text track APIs
    @@ -41462,6 +42680,7 @@ red:89 Initially, the volume should be 1.0, but user agents may remember the last set value across sessions, on a per-site basis or otherwise, so the volume may start at other values.

    +

    The volume IDL attribute must return the playback volume of any audio portions of the media element. On setting, if the new value is in the range 0.0 @@ -41469,11 +42688,13 @@ red:89 volume must be set to the new value. If the new value is outside the range 0.0 to 1.0 inclusive, then, on setting, an "IndexSizeError" DOMException must be thrown instead.

    +

    A media element can also be muted. If anything is muting the element, then it is muted. (For example, when the direction of playback is backwards, the element is muted.)

    +

    The muted IDL attribute must return the value to which it was last set. When a media element is created, if the element has a muted content attribute @@ -41482,7 +42703,9 @@ red:89 the last set value across sessions, on a per-site basis or otherwise). While the muted IDL attribute is set to true, the media element must be muted.

    +
    +

    Whenever either of the values that would be returned by the volume and muted IDL attributes change, the user agent must queue a media element task given the @@ -41490,11 +42713,13 @@ red:89 data-x="event-media-volumechange">volumechange at the media element. Then, if the media element is not allowed to play, the user agent must run the internal pause steps for the media element.

    +

    A user agent has an associated volume locked (a boolean). Its value is implementation-defined and determines whether the playback volume takes effect.

    +

    An element's effective media volume is determined as follows:

    @@ -41517,6 +42742,7 @@ red:89 need not be linear. The loudest setting may be lower than the system's loudest possible setting; for example the user could have set a maximum volume.

    +
    @@ -41579,23 +42805,30 @@ interface TimeRanges {
    +

    The length IDL attribute must return the number of ranges represented by the object.

    +
    +

    The start(index) method must return the position of the start of the indexth range represented by the object, in seconds measured from the start of the timeline that the object covers.

    +
    +

    The end(index) method must return the position of the end of the indexth range represented by the object, in seconds measured from the start of the timeline that the object covers.

    +

    These methods must throw "IndexSizeError" DOMExceptions - if called with an index argument greater than or equal to the number of ranges + if called with an index argument greater than or equal to the number of ranges represented by the object.

    +

    When a TimeRanges object is said to be a normalized TimeRanges object, the ranges it represents must obey the following criteria:

    @@ -41605,6 +42838,7 @@ interface TimeRanges {
  • The start of a range must be less than or equal to the end of that same range.
  • +

    In other words, the ranges in such an object are ordered, don't overlap, and don't touch (adjacent ranges are folded into one bigger range). A range can be empty (referencing just a @@ -41650,9 +42884,11 @@ dictionary TrackEventInit : EventInit {

    +

    The track attribute must return the value it was initialized to. It represents the context information for the event.

    +
    @@ -42294,9 +43530,11 @@ interface HTMLMapElement : HTMLElement {
    +

    The areas attribute must return an HTMLCollection rooted at the map element, whose filter matches only area elements.

    +
    @@ -42460,9 +43698,11 @@ interface HTMLAreaElement : HTMLElement { No +

    The attribute's missing value default and invalid value default are both the rectangle state.

    +

    The coords attribute must, if specified, contain a valid list of floating-point numbers. This attribute @@ -42525,10 +43765,12 @@ interface HTMLAreaElement : HTMLElement {

    +

    The IDL attribute referrerPolicy must reflect the referrerpolicy content attribute, limited to only known values.

    +
    @@ -42586,6 +43828,7 @@ interface HTMLAreaElement : HTMLElement {
    Processing model
    +

    If an img element has a usemap attribute specified, user agents must process it as follows:

    @@ -42633,7 +43876,9 @@ interface HTMLAreaElement : HTMLElement { area elements in areas, in reverse tree order (so the last specified area element in the map is the bottom-most shape, and the first element in the map, in tree order, is the top-most shape).

    +
    +

    Each area element in areas must be processed as follows to obtain a shape to layer onto the image:

    @@ -42762,6 +44007,7 @@ interface HTMLAreaElement : HTMLElement { coordinates.

    +

    Pointing device interaction with an image associated with a set of layered shapes per the above algorithm must result in the relevant user interaction events being first fired to the top-most @@ -42882,6 +44128,7 @@ interface HTMLAreaElement : HTMLElement {

    +

    The getSVGDocument() method steps are:

    @@ -42896,6 +44143,7 @@ interface HTMLAreaElement : HTMLElement {
  • Return null.

  • +
    @@ -42915,6 +44163,7 @@ interface HTMLAreaElement : HTMLElement { medium), in CSS pixels. The attributes, if specified, must have values that are valid non-negative integers.

    +

    The specified dimensions given may differ from the dimensions specified in the resource itself, since the resource may have a resolution that differs from the CSS pixel resolution. (On screens, CSS pixels have a resolution of 96ppi, but in general the CSS pixel @@ -42937,6 +44186,7 @@ interface HTMLAreaElement : HTMLElement { natural height in the resource. The specified width and specified height are the values of the width and height attributes respectively.

    +

    The two attributes must be omitted if the resource in question does not have both a natural width and a natural height.

    @@ -43197,27 +44447,36 @@ interface HTMLTableElement : HTMLElement {
    +

    In all of the following attribute and method definitions, when an element is to be table-created, that means to create an element given the table element's node document, the given local name, and the HTML namespace.

    +
    +

    The caption IDL attribute must return, on getting, the first caption element child of the table element, if any, or null otherwise. On setting, the first caption element child of the table element, if any, must be removed, and the new value, if not null, must be inserted as the first node of the table element.

    +
    +

    The createCaption() method must return the first caption element child of the table element, if any; otherwise a new caption element must be table-created, inserted as the first node of the table element, and then returned.

    +
    +

    The deleteCaption() method must remove the first caption element child of the table element, if any.

    +
    +

    The tHead IDL attribute must return, on getting, the first thead element child of the table element, if any, or null otherwise. On setting, if the new value is null or a @@ -43228,7 +44487,9 @@ interface HTMLTableElement : HTMLElement { such elements. If the new value is neither null nor a thead element, then a "HierarchyRequestError" DOMException must be thrown instead.

    +
    +

    The createTHead() method must return the first thead element child of the table element, if any; otherwise a new @@ -43236,11 +44497,15 @@ interface HTMLTableElement : HTMLElement { first element in the table element that is neither a caption element nor a colgroup element, if any, or at the end of the table if there are no such elements, and then that new element must be returned.

    +
    +

    The deleteTHead() method must remove the first thead element child of the table element, if any.

    +
    +

    The tFoot IDL attribute must return, on getting, the first tfoot element child of the table element, if any, or null otherwise. On setting, if the new value is null or a @@ -43249,29 +44514,39 @@ interface HTMLTableElement : HTMLElement { the table. If the new value is neither null nor a tfoot element, then a "HierarchyRequestError" DOMException must be thrown instead.

    +
    +

    The createTFoot() method must return the first tfoot element child of the table element, if any; otherwise a new tfoot element must be table-created and inserted at the end of the table, and then that new element must be returned.

    +
    +

    The deleteTFoot() method must remove the first tfoot element child of the table element, if any.

    +
    +

    The tBodies attribute must return an HTMLCollection rooted at the table node, whose filter matches only tbody elements that are children of the table element.

    +
    +

    The createTBody() method must table-create a new tbody element, insert it immediately after the last tbody element child in the table element, if any, or at the end of the table element if the table element has no tbody element children, and then must return the new tbody element.

    +
    +

    The rows attribute must return an HTMLCollection rooted at the table node, whose filter matches only tr elements that are either children of the table @@ -43281,7 +44556,9 @@ interface HTMLTableElement : HTMLElement { in tree order, followed by those elements whose parent is either a table or tbody element, again in tree order, followed finally by those elements whose parent is a tfoot element, still in tree order.

    +
    +

    The behavior of the insertRow(index) method depends on the state of the table. When it is called, the method must act as required by the first item in the @@ -43326,7 +44603,9 @@ interface HTMLTableElement : HTMLElement { data-x="dom-table-rows">rows collection, in the same parent, and finally must return the newly created tr element. +

    +

    When the deleteRow(index) method is called, the user agent must run the following steps:

    @@ -43343,6 +44622,7 @@ interface HTMLTableElement : HTMLElement {
  • Otherwise, remove the indexth element in the rows collection from its parent.

  • +
    @@ -43890,11 +45170,14 @@ interface HTMLTableSectionElement : HTMLElement +

    The rows attribute must return an HTMLCollection rooted at this element, whose filter matches only tr elements that are children of this element.

    +
    +

    The insertRow(index) method must act as follows:

    @@ -43918,7 +45201,9 @@ interface HTMLTableSectionElement : HTMLElement

    Return table row.

    +
    +

    The deleteRow(index) method must, when invoked, act as follows: @@ -43936,6 +45221,7 @@ interface HTMLTableSectionElement : HTMLElement

    Otherwise, remove the indexth element in the rows collection from this element.

    +
    @@ -44151,6 +45437,7 @@ interface HTMLTableRowElement : HTMLElement {
    +

    The rowIndex attribute must, if this element has a parent table element, or a parent tbody, thead, or @@ -44158,7 +45445,9 @@ interface HTMLTableRowElement : HTMLElement { of this tr element in that table element's rows collection. If there is no such table element, then the attribute must return −1.

    +
    +

    The sectionRowIndex attribute must, if this element has a parent table, tbody, thead, or tfoot element, @@ -44167,12 +45456,16 @@ interface HTMLTableRowElement : HTMLElement { data-x="dom-table-rows">rows collection; for table sections, that's HTMLTableSectionElement's rows collection). If there is no such parent element, then the attribute must return −1.

    +
    +

    The cells attribute must return an HTMLCollection rooted at this tr element, whose filter matches only td and th elements that are children of the tr element.

    +
    +

    The insertCell(index) method must act as follows:

    @@ -44197,7 +45490,9 @@ interface HTMLTableRowElement : HTMLElement {
  • Return table cell.

  • +
    +

    The deleteCell(index) method must act as follows:

    @@ -44215,6 +45510,7 @@ interface HTMLTableRowElement : HTMLElement {
  • Otherwise, remove the indexth element in the cells collection from its parent.

  • +
    @@ -44380,10 +45676,12 @@ interface HTMLTableCellElement : HTMLElement { The header cell applies to all the remaining cells in the column group. +

    The attribute's missing value default and invalid value default are both the Auto state. (In this state the header cell applies to a set of cells selected based on context.)

    +

    A th element's scope attribute must not be in the Row Group state if the element is not anchored in @@ -44484,6 +45782,7 @@ interface HTMLTableCellElement : HTMLElement { data-x="concept-table">table as the td or th element (as defined by the table model).

    +

    A th element with ID id is said to be directly targeted by all td and th elements in the same table that have HTMLTableCellElement : HTMLElement { B if either A is directly targeted by B or if there exists an element C that is itself targeted by the element B and A is directly targeted by C.

    +

    A th element must not be targeted by itself.

    @@ -44526,15 +45826,19 @@ interface HTMLTableCellElement : HTMLElement { +

    The cellIndex IDL attribute must, if the element has a parent tr element, return the index of the cell's element in the parent element's cells collection. If there is no such parent element, then the attribute must return −1.

    +
    +

    The scope IDL attribute must reflect the content attribute of the same name, limited to only known values.

    +
    @@ -44546,6 +45850,7 @@ interface HTMLTableCellElement : HTMLElement {

    The various table elements and their content attributes together define the table model.

    +

    A table consists of cells aligned on a two-dimensional grid of slots with coordinates (x, y). The grid is finite, and is either empty or has one or more slots. If the grid has one or more slots, then the x coordinates are always in the range HTMLTableCellElement : HTMLElement { data-x="">groupx ≤ x < groupx+width and 0 ≤ y < yheight. Column groups correspond to colgroup elements. Not every column is necessarily in a column group.

    +

    Row groups cannot overlap each other. Similarly, column groups cannot overlap each other.

    @@ -44607,6 +45913,8 @@ interface HTMLTableCellElement : HTMLElement {
    Forming a table
    +
    +

    To determine which elements correspond to which slots in a table associated with a table element, to determine the dimensions of the table (xwidth and yheight), and to determine if there are any cell cell so that it also covers the slots with coordinates (x, ycurrent), where cellx ≤ x < cellx+width.

    +
    +
    Forming relationships between data cells and header cells
    +

    Each cell can be assigned zero or more header cells. The algorithm for assigning header cells to a cell principal cell is as follows.

    @@ -45178,7 +46497,9 @@ interface HTMLTableCellElement : HTMLElement { cell.

    +
    +

    The internal algorithm for scanning and assigning header cells, given a principal cell, a header list, an initial coordinate (initialx, initialy), and Δx and Δy increments, is as follows:

    @@ -45291,7 +46612,9 @@ interface HTMLTableCellElement : HTMLElement {

    Return to the step labeled loop.

    +
    +

    A header cell anchored at the slot with coordinate (x, y) with width width and height height is said to be a column header if any of the following are true:

    @@ -45305,7 +46628,9 @@ interface HTMLTableCellElement : HTMLElement { cells covering slots with y-coordinates y .. y+height-1.

    +
    +

    A header cell anchored at the slot with coordinate (x, y) with width width and height height is said to be a row header if any of the following are true:

    @@ -45319,17 +46644,24 @@ interface HTMLTableCellElement : HTMLElement { header, and there are no data cells in any of the cells covering slots with x-coordinates x .. x+width-1.

    +
    +

    A header cell is said to be a column group header if its scope attribute is in the Column Group state.

    +
    +

    A header cell is said to be a row group header if its scope attribute is in the Row Group state.

    +
    +

    A cell is said to be an empty cell if it contains no elements and its child text content, if any, consists only of ASCII whitespace.

    +
    @@ -46139,8 +47471,8 @@ interface HTMLTableCellElement : HTMLElement {

    Denotes elements that are listed in the form.elements and fieldset.elements APIs. These elements also + data-x="dom-form-elements">form.elements and fieldset.elements APIs. These elements also have a form content attribute, and a matching form IDL attribute, that allow authors to specify an explicit form owner.

    @@ -46332,9 +47664,11 @@ interface HTMLFormElement : HTMLElement { data-x="attr-fe-autocomplete-off">off" by default. +

    The attribute's missing value default and invalid value default are both the On state.

    +

    The action, enctype, method, novalidate, @@ -46439,12 +47773,15 @@ interface HTMLFormElement : HTMLElement {

    +

    The autocomplete IDL attribute must reflect the content attribute of the same name, limited to only known values.

    +

    +

    The elements IDL attribute must return an HTMLFormControlsCollection rooted at the form element's root, whose filter matches HTMLFormElement : HTMLElement { data-x="attr-input-type">type attribute is in the Image Button state, which must, for historical reasons, be excluded from this particular collection.

    +
    +

    The length IDL attribute must return the number of nodes represented by the elements collection.

    +
    +

    The supported property indices at any instant are the indices supported by the object returned by the elements attribute at that instant.

    +
    +

    To determine the value of an indexed property for a form element, the user agent must return the value returned by the item method on the elements collection, when invoked with the given index as its argument.

    +

    Each form element has a mapping of names to elements called the past names map. It is used to persist names of controls even when they change names.

    +

    The supported property names consist of the names obtained from the following algorithm, in the order obtained from this algorithm:

    @@ -46541,7 +47886,9 @@ interface HTMLFormElement : HTMLElement {
  • Return the list of names from sourced names, maintaining their relative order.

  • +
    +

    To determine the value of a named property name for a form element, the user agent must run the following steps:

    @@ -46574,6 +47921,7 @@ interface HTMLFormElement : HTMLElement {
  • Return the node in candidates.

  • +

    If an element listed in a form element's past names map changes form owner, then its entries must be removed from that map.

    @@ -46606,11 +47954,14 @@ interface HTMLFormElement : HTMLElement {
    +

    The submit() method steps are to submit this from this, with submitted from submit() method set to true.

    +
    +

    The requestSubmit(submitter) method, when invoked, must run the following steps:

    @@ -46633,7 +47984,9 @@ interface HTMLFormElement : HTMLElement {
  • Submit this form element, from submitter.

  • +
    +

    The reset() method, when invoked, must run the following steps:

    @@ -46646,18 +47999,23 @@ interface HTMLFormElement : HTMLElement {
  • Unmark the form element as locked for reset.

  • +
    +

    If the checkValidity() method is invoked, the user agent must statically validate the constraints of the form element, and return true if the constraint validation returned a positive result, and false if it returned a negative result.

    +
    +

    If the reportValidity() method is invoked, the user agent must interactively validate the constraints of the form element, and return true if the constraint validation returned a positive result, and false if it returned a negative result.

    +
    @@ -46734,16 +48092,20 @@ interface HTMLLabelElement : HTMLElement {
    +

    If the for attribute is not specified, but the label element has a labelable element descendant, then the first such descendant in tree order is the label element's labeled control.

    +
    +

    The label element's exact default presentation and behavior, in particular what its activation behavior might be, if anything, should match the platform's label behavior. The activation behavior of a label element for events targeted at interactive content descendants of a label element, and any descendants of those interactive content descendants, must be to do nothing.

    +

    Form-associated custom elements are labelable elements, so for user agents @@ -46808,10 +48170,13 @@ interface HTMLLabelElement : HTMLElement {

    +

    The control IDL attribute must return the label element's labeled control, if any, or null if there isn't one.

    +
    +

    The form IDL attribute must run the following steps:

    @@ -46825,6 +48190,7 @@ interface HTMLLabelElement : HTMLElement {
  • Return the label element's labeled control's form owner (which can still be null).

  • +
    @@ -46847,6 +48213,7 @@ interface HTMLLabelElement : HTMLElement {
    +

    Labelable elements and all input elements have a live NodeList object associated with them that represents the list of label elements, in tree order, whose labeled @@ -46860,7 +48227,9 @@ interface HTMLLabelElement : HTMLElement { this element is an input element whose type attribute is in the Hidden state, in which case it must instead return null.

    +
    +

    Form-associated custom elements don't have a labels IDL attribute. Instead, their ElementInternals object has a HTMLLabelElement : HTMLElement { data-x="internals-target">target element is not a form-associated custom element. Otherwise, it must return that NodeList object, and that same value must always be returned.

    +

    This (non-conforming) example shows what happens to the NodeList and what HTMLInputElement : HTMLElement { A button +

    The attribute's missing value default and invalid value default are both the Text state.

    +

    Which of the accept, @@ -48440,14 +49812,17 @@ interface HTMLInputElement : HTMLElement { valueAsNumber, and stepUp().

    +

    An input element's dirty value flag must be set to true whenever the user interacts with the control in a way that changes the value. (It is also set to true when the value is programmatically changed, as described in the definition of the value IDL attribute.)

    +
    +

    The value content attribute gives the default value of the input element. When the value content attribute is @@ -48456,21 +49831,25 @@ interface HTMLInputElement : HTMLElement { to the value of the value content attribute, if there is one, or the empty string otherwise, and then run the current value sanitization algorithm, if one is defined.

    +

    Each input element has a checkedness, which is exposed by the checked IDL attribute.

    +

    Each input element has a boolean dirty checkedness flag. When it is true, the element is said to have a dirty checkedness. The dirty checkedness flag must be initially set to false when the element is created, and must be set to true whenever the user interacts with the control in a way that changes the checkedness.

    +
    +

    The checked content attribute is a boolean attribute that gives the default checkedness of the input element. HTMLInputElement : HTMLElement { control does not have dirty checkedness, the user agent must set the checkedness of the element to false.

    +
    +

    The reset algorithm for input elements is to set its user validity, dirty value flag, and @@ -48496,6 +49877,7 @@ interface HTMLInputElement : HTMLElement { data-x="concept-input-type-file-selected">selected files, and then invoke the value sanitization algorithm, if the type attribute's current state defines one.

    +

    Each input element can be mutable. Except where otherwise specified, an input element is always HTMLInputElement : HTMLElement { agent should not allow the user to modify the element's value or checkedness.

    +

    When an input element is disabled, it is not mutable.

    +

    The readonly attribute can also in some cases (e.g. for the Date state, but not the HTMLInputElement : HTMLElement {

    +

    The cloning steps for input elements given node, copy, and subtree are to propagate the value, dirty value flag, checkedness, and dirty checkedness flag from node to copy.

    +
    +

    The activation behavior for input elements element, given event, are these steps:

    @@ -48567,6 +49954,7 @@ interface HTMLInputElement : HTMLElement {
  • Run the popover target attribute activation behavior given element and event's target.

  • +

    Recall that an element's activation behavior runs for both user-initiated activations and for synthetic activations (e.g., via HTMLInputElement : HTMLElement { data-x="attr-input-type-file">File Upload and Color states.

    +

    The legacy-pre-activation behavior for input elements are these steps:

    @@ -48593,7 +49982,9 @@ interface HTMLInputElement : HTMLElement { data-x="concept-fe-checked">checkedness set to true, if any, and then set this element's checkedness to true.

    +
    +

    The legacy-canceled-activation behavior for input elements are these steps:

    @@ -48613,6 +50004,7 @@ interface HTMLInputElement : HTMLElement { group, or if this element no longer has a radio button group, set this element's checkedness to false. +
    +

    If the element is mutable, the user agent should allow the user to change the writing direction of the element, setting it either to a left-to-right writing direction or a right-to-left writing direction. If the user does so, the user agent must then run @@ -48898,6 +50303,7 @@ interface HTMLInputElement : HTMLElement { data-x="dom-Event-bubbles">bubbles and composed attributes initialized to true.

    +
    @@ -48906,8 +50312,10 @@ interface HTMLInputElement : HTMLElement {
    +

    The value sanitization algorithm is as follows: Strip newlines from the value.

    +
    @@ -49001,8 +50409,10 @@ interface HTMLInputElement : HTMLElement {
    +

    The value sanitization algorithm is as follows: Strip newlines from the value.

    +
    @@ -49113,13 +50523,17 @@ interface HTMLInputElement : HTMLElement {
    +

    The value sanitization algorithm is as follows: Strip newlines from the value, then strip leading and trailing ASCII whitespace from the value.

    +
    +

    Constraint validation: While the value of the element is neither the empty string nor a valid absolute URL, the element is suffering from a type mismatch.

    +
    @@ -49257,9 +50671,11 @@ interface HTMLInputElement : HTMLElement { convert punycode in the domain labels of the value to IDN in the display and vice versa.

    +

    Constraint validation: While the user interface is representing input that the user agent cannot convert to punycode, the control is suffering from bad input.

    +
    @@ -49268,13 +50684,17 @@ interface HTMLInputElement : HTMLElement {
    +

    The value sanitization algorithm is as follows: Strip newlines from the value, then strip leading and trailing ASCII whitespace from the value.

    +
    +

    Constraint validation: While the value of the element is neither the empty string nor a single valid email address, the element is suffering from a type mismatch.

    +
    @@ -49301,10 +50721,13 @@ interface HTMLInputElement : HTMLElement { particular, user agents should convert punycode in the domain labels of the value to IDN in the display and vice versa.

    +

    Constraint validation: While the user interface describes a situation where an individual value contains a U+002C COMMA (,) or is representing input that the user agent cannot convert to punycode, the control is suffering from bad input.

    +
    +

    Whenever the user changes the element's values, the user agent must run the following steps:

    @@ -49323,6 +50746,7 @@ interface HTMLInputElement : HTMLElement { concatenating all the values in latest values, separating each value from the next by a single U+002C COMMA character (,), maintaining the list's order.

    +
    @@ -49331,6 +50755,7 @@ interface HTMLInputElement : HTMLElement {
    +

    The value sanitization algorithm is as follows:

      @@ -49345,18 +50770,24 @@ interface HTMLInputElement : HTMLElement { each value from the next by a single U+002C COMMA character (,), maintaining the list's order.

    +
    +

    Constraint validation: While the value of the element is not a valid email address list, the element is suffering from a type mismatch.

    +
    +

    When the multiple attribute is set or removed, the user agent must run the value sanitization algorithm.

    +
    +

    A valid email address is a string that matches the email production of the following ABNF, the character set for which is Unicode. This ABNF implements the extensions described in RFC 1123. ABNF RFC5322 @@ -49367,6 +50798,7 @@ label = let-dig [ [ ldh-str ] let-dig ] ; limited to a length of 63 cha atext = < as defined in RFC 5322 section 3.2.3 > let-dig = < as defined in RFC 1034 section 3.5 > ldh-str = < as defined in RFC 1034 section 3.5 > +

    @@ -49386,11 +50818,13 @@ ldh-str = < as defined in valid email address list is a set of comma-separated tokens, where each token is itself a valid email address. To obtain the list of tokens from a valid email address list, an implementation must split the string on commas.

    +
    @@ -49584,9 +51020,11 @@ ldh-str = < as defined in value to the empty string.

    +

    Constraint validation: While the user interface describes input that the user agent cannot convert to a valid date string, the control is suffering from bad input.

    +
    @@ -49601,9 +51039,11 @@ ldh-str = < as defined in
    value of the element is not a valid date string, then set it to the empty string instead.

    + @@ -49623,6 +51063,7 @@ ldh-str = < as defined in
    date for which the element would not suffer from a step mismatch.

    +

    The algorithm to convert a string to a number, given a string input, is as follows: If parsing a date from input results in an @@ -49630,25 +51071,32 @@ ldh-str = < as defined in 1970-01-01T00:00:00.0Z") to midnight UTC on the morning of the parsed date, ignoring leap seconds.

    +
    +

    The algorithm to convert a number to a string, given a number input, is as follows: Return a valid date string that represents the date that, in UTC, is current input milliseconds after midnight UTC on the morning of 1970-01-01 (the time represented by the value "1970-01-01T00:00:00.0Z").

    +
    +

    The algorithm to convert a string to a Date object, given a string input, is as follows: If parsing a date from input results in an error, then return an error; otherwise, return a new Date object representing midnight UTC on the morning of the parsed date.

    +
    +

    The algorithm to convert a Date object to a string, given a Date object input, is as follows: Return a valid date string that represents the date current at the time represented by input in the UTC time zone.

    +
    @@ -49760,9 +51208,11 @@ ldh-str = < as defined in
    value to the empty string.

    +

    Constraint validation: While the user interface describes input that the user agent cannot convert to a valid month string, the control is suffering from bad input.

    +
    @@ -49777,9 +51227,11 @@ ldh-str = < as defined in
    value of the element is not a valid month string, then set it to the empty string instead.

    + @@ -49799,32 +51251,40 @@ ldh-str = < as defined in
    month for which the element would not suffer from a step mismatch.

    +

    The algorithm to convert a string to a number, given a string input, is as follows: If parsing a month from input results in an error, then return an error; otherwise, return the number of months between January 1970 and the parsed month.

    +
    +

    The algorithm to convert a number to a string, given a number input, is as follows: Return a valid month string that represents the month that has input months between it and January 1970.

    +
    +

    The algorithm to convert a string to a Date object, given a string input, is as follows: If parsing a month from input results in an error, then return an error; otherwise, return a new Date object representing midnight UTC on the morning of the first day of the parsed month.

    +
    +

    The algorithm to convert a Date object to a string, given a Date object input, is as follows: Return a valid month string that represents the month current at the time represented by input in the UTC time zone.

    +
    @@ -49916,9 +51376,11 @@ ldh-str = < as defined in
    value to the empty string.

    +

    Constraint validation: While the user interface describes input that the user agent cannot convert to a valid week string, the control is suffering from bad input.

    +
    @@ -49933,9 +51395,11 @@ ldh-str = < as defined in
    value of the element is not a valid week string, then set it to the empty string instead.

    + @@ -49957,6 +51421,7 @@ ldh-str = < as defined in
    week for which the element would not suffer from a step mismatch.

    +

    The algorithm to convert a string to a number, given a string input, is as follows: If parsing a week string from input results in @@ -49964,25 +51429,32 @@ ldh-str = < as defined in 1970-01-01T00:00:00.0Z") to midnight UTC on the morning of the Monday of the parsed week, ignoring leap seconds.

    +
    +

    The algorithm to convert a number to a string, given a number input, is as follows: Return a valid week string that represents the week that, in UTC, is current input milliseconds after midnight UTC on the morning of 1970-01-01 (the time represented by the value "1970-01-01T00:00:00.0Z").

    +
    +

    The algorithm to convert a string to a Date object, given a string input, is as follows: If parsing a week from input results in an error, then return an error; otherwise, return a new Date object representing midnight UTC on the morning of the Monday of the parsed week.

    +
    +

    The algorithm to convert a Date object to a string, given a Date object input, is as follows: Return a valid week string that represents the week current at the time represented by input in the UTC time zone.

    +
    @@ -50074,9 +51546,11 @@ ldh-str = < as defined in
    value to the empty string.

    +

    Constraint validation: While the user interface describes input that the user agent cannot convert to a valid time string, the control is suffering from bad input.

    +
    @@ -50091,9 +51565,11 @@ ldh-str = < as defined in
    value of the element is not a valid time string, then set it to the empty string instead.

    +

    The form control has a periodic domain.

    @@ -50115,17 +51591,22 @@ ldh-str = < as defined in
    time for which the element would not suffer from a step mismatch.

    +

    The algorithm to convert a string to a number, given a string input, is as follows: If parsing a time from input results in an error, then return an error; otherwise, return the number of milliseconds elapsed from midnight to the parsed time on a day with no time changes.

    +
    +

    The algorithm to convert a number to a string, given a number input, is as follows: Return a valid time string that represents the time that is input milliseconds after midnight on a day with no time changes.

    +
    +

    The algorithm to convert a string to a Date object, given a string input, is as follows: If parsing a time from @@ -50133,11 +51614,14 @@ ldh-str = < as defined in a new Date object representing the parsed time in UTC on 1970-01-01.

    +
    +

    The algorithm to convert a Date object to a string, given a Date object input, is as follows: Return a valid time string that represents the UTC time component that is represented by input.

    +
    @@ -50232,9 +51716,11 @@ ldh-str = < as defined in
    value to the empty string.

    +

    Constraint validation: While the user interface describes input that the user agent cannot convert to a valid normalized local date and time string, the control is suffering from bad input.

    +
    @@ -50249,10 +51735,12 @@ ldh-str = < as defined in
    value of the element is a valid local date and time string, then set it to a valid normalized local date and time string representing the same date and time; otherwise, set it to the empty string instead.

    + @@ -50273,18 +51761,22 @@ ldh-str = < as defined in
    local date and time for which the element would not suffer from a step mismatch.

    +

    The algorithm to convert a string to a number, given a string input, is as follows: If parsing a date and time from input results in an error, then return an error; otherwise, return the number of milliseconds elapsed from midnight on the morning of 1970-01-01 (the time represented by the value "1970-01-01T00:00:00.0") to the parsed local date and time, ignoring leap seconds.

    +
    +

    The algorithm to convert a number to a string, given a number input, is as follows: Return a valid normalized local date and time string that represents the date and time that is input milliseconds after midnight on the morning of 1970-01-01 (the time represented by the value "1970-01-01T00:00:00.0").

    +
    @@ -50401,9 +51893,11 @@ ldh-str = < as defined in
    value to the empty string.

    +

    Constraint validation: While the user interface describes input that the user agent cannot convert to a valid floating-point number, the control is suffering from bad input.

    +
    @@ -50422,9 +51916,11 @@ ldh-str = < as defined in
    value of the element is not a valid floating-point number, then set it to the empty string instead.

    + @@ -50445,14 +51941,18 @@ ldh-str = < as defined in
    algorithm to convert a string to a number, given a string input, is as follows: If applying the rules for parsing floating-point number values to input results in an error, then return an error; otherwise, return the resulting number.

    + +

    The algorithm to convert a number to a string, given a number input, is as follows: Return a valid floating-point number that represents input.

    +
    @@ -50573,9 +52073,11 @@ ldh-str = < as defined in
    value to the empty string.

    +

    Constraint validation: While the user interface describes input that the user agent cannot convert to a valid floating-point number, the control is suffering from bad input.

    +
    @@ -50587,14 +52089,17 @@ ldh-str = < as defined in
    value of the element is not a valid floating-point number, then set it to the best representation, as a floating-point number, of the default value.

    + +

    The default value is the minimum plus half the difference between the minimum and the minimum, in which case the default value is the minimum.

    +
    +

    When the element is suffering from an underflow, the user agent must set the element's value to the best representation, as a floating-point number, of the minimum.

    +
    +

    When the element is suffering from an overflow, if the maximum is not less than the minimum, the user agent must set the element's value to a valid floating-point number that represents the maximum.

    +
    +

    When the element is suffering from a step mismatch, the user agent must round the element's value to the nearest number for which the element would not suffer from a step @@ -50627,6 +52138,7 @@ ldh-str = < as defined in maximum, if there is a number that matches these constraints. If two numbers match these constraints, then user agents must use the one nearest to positive infinity.

    +

    For example, the markup <input type="range" min=0 max=100 step=20 value=50> @@ -50721,15 +52233,19 @@ ldh-str = < as defined in algorithm to convert a string to a number, given a string input, is as follows: If applying the rules for parsing floating-point number values to input results in an error, then return an error; otherwise, return the resulting number.

    +
    +

    The algorithm to convert a number to a string, given a number input, is as follows: Return the best representation, as a floating-point number, of input.

    +
    @@ -50844,9 +52360,11 @@ ldh-str = < as defined in
    color(display-p3 1.84 -0.19 0.72 / 0.6)". +

    The attribute's missing value default and invalid value default are both the Limited sRGB state.

    +
    @@ -50866,13 +52384,17 @@ ldh-str = < as defined in serializing a color well control color given the element and the end user's selection.

    +

    The input activation behavior for such an element element is to show the picker, if applicable, for element.

    +
    +

    Constraint validation: While the element's value is not the empty string and parsing it returns failure, the control is suffering from bad input.

    +
    @@ -50881,9 +52403,12 @@ ldh-str = < as defined in serializing a color well control color given element and color.

    + +

    To serialize a color well control color, given an element element and a CSS color color:

    @@ -50959,6 +52486,7 @@ ldh-str = < as defined in
    HTML-compatible serialization requested.

    +
    @@ -51049,6 +52577,7 @@ ldh-str = < as defined in change at the element with the bubbles attribute initialized to true.

    + +

    Constraint validation: If the element is required and its checkedness is false, then the element is suffering from being missing.

    +
    @@ -51161,6 +52693,7 @@ ldh-str = < as defined in
    +

    A tree must not contain an input element whose radio button group contains only that element.

    +

    When any of the following phenomena occur, if the element's checkedness state is true after the occurrence, the checkedness state of all the other elements in the same radio @@ -51206,7 +52741,9 @@ ldh-str = < as defined in change at the element with the bubbles attribute initialized to true.

    +
    +

    Constraint validation: If an element in the radio button group is required, and all of the input elements in the radio button group have a checkedness that is false, then the element is suffering from being missing.

    +
    @@ -51603,10 +53149,13 @@ ldh-str = < as defined in optional value is the value of the element's value attribute, if there is one; otherwise null.

    +
    +

    The element's input activation behavior given event is as follows:

      @@ -51619,6 +53168,7 @@ ldh-str = < as defined in userInvolvement set to event's user navigation involvement.

    +
    @@ -51712,7 +53262,7 @@ ldh-str = < as defined in The coordinate is sent to the server during form submission by sending two entries for the element, derived from the name of the control but with ".x" and ".y" appended to - the name with the x and y components of the coordinate respectively.

    + the name with the x and y components of the coordinate respectively.


    @@ -51724,6 +53274,7 @@ ldh-str = < as defined in
    + +

    Fetching the image must delay the load event of the element's node document until the task that is queued by the networking task source once the resource has been fetched (defined below) has been run.

    +

    If the image was successfully obtained, with no network errors, and the image's type is a supported image type, and the image is a valid image of that type, then the image is said to be @@ -51799,7 +53353,7 @@ ldh-str = < as defined in image sniffing rules to determine the type of the image, with the image's associated Content-Type headers giving the official + data-x="Content-Type">associated Content-Type headers giving the official type. If these rules are not applied, then the type of the image must be the type given by the image's associated Content-Type headers.

    @@ -51821,6 +53375,7 @@ ldh-str = < as defined in src attribute is set, and the image is available and the user agent is configured to display that image, then the element represents a control for selecting a alt attribute.

    +
    +

    The element's input activation behavior given event is as follows:

      @@ -51856,7 +53413,9 @@ ldh-str = < as defined in userInvolvement set to event's user navigation involvement.

    +
    +

    The element's selected coordinate consists of an x-component and a y-component. It is initially (0, 0). The coordinates represent the position relative to the edge of the element's image, with the @@ -51873,6 +53432,7 @@ ldh-str = < as defined in −(bordertop+paddingtop) ≤ yheight+borderbottom+paddingbottom, where height is the rendered height of the image, bordertop is the width of the border above the image, paddingtop is the width of the padding above the image, borderbottom is the width of the border below the image, and paddingbottom is the width of the padding below the image, with all dimensions given in CSS pixels.

    +

    Where a border or padding is missing, its width is zero CSS pixels.

    @@ -52011,6 +53571,7 @@ ldh-str = < as defined in

    Reset the form owner from the element.

    +
    +

    Constraint validation: The element is barred from constraint validation.

    +
    @@ -52110,8 +53674,10 @@ ldh-str = < as defined in
    +

    Constraint validation: If the readonly attribute is specified on an input element, the element is barred from constraint validation.

    +
    @@ -52353,6 +53921,7 @@ ldh-str = < as defined in
    required, and its value IDL attribute applies and is in the mode mutable, and the element's value is the empty string, then the element is suffering from being missing.

    + @@ -52486,6 +54056,7 @@ ldh-str = < as defined in

    Return ! RegExpCreate(anchoredPattern, "v").

    +

    The reasoning behind these steps, instead of just using the value of the pattern attribute directly, is twofold. First, we want to @@ -52523,10 +54095,13 @@ ldh-str = < as defined in ^(?:" and ")$" anchors.

    +

    A RegExp object regexp matches a string input, if ! RegExpBuiltinExec(regexp, input) is not null.

    +
    +

    Constraint validation: If the element's value is not the empty string, and either the element's multiple attribute is not specified or it match the element's value, then the element is suffering from a pattern mismatch.

    +
    +

    Constraint validation: If the element's value is not the empty string, and the element's multiple attribute is specified and match each of the element's values, then the element is suffering from a pattern mismatch.

    +
    @@ -52604,6 +54182,7 @@ You cannot submit this form when the field is incorrect.

    Their syntax is defined by the section that defines the type attribute's current state.

    +

    If the element has a min attribute, and the result of applying the algorithm to convert a string to a number to the value of the min attribute is a number, @@ -52612,10 +54191,12 @@ You cannot submit this form when the field is incorrect. data-x="concept-input-min-default">default minimum, then that is the minimum; otherwise, the element has no minimum.

    +

    The min attribute also defines the step base.

    +

    If the element has a max attribute, and the result of applying the algorithm to convert a string to a number to the value of the max attribute is a number, @@ -52624,6 +54205,7 @@ You cannot submit this form when the field is incorrect. data-x="concept-input-max-default">default maximum, then that is the maximum; otherwise, the element has no maximum.

    +
    @@ -52641,18 +54223,23 @@ You cannot submit this form when the field is incorrect. data-x="concept-fe-value">value, it will either be suffering from an underflow or suffering from an overflow.

    +

    An element has a reversed range if it has a periodic domain and its maximum is less than its minimum.

    +
    +

    An element has range limitations if it has a defined minimum or a defined maximum.

    +
    +

    Constraint validation: When the element has a minimum and does not have a reversed range, and the result of applying the the number obtained from that algorithm is less than the minimum, the element is suffering from an underflow.

    +
    +

    Constraint validation: When the element has a maximum and does not have a reversed range, and the result of applying the the number obtained from that algorithm is more than the maximum, the element is suffering from an overflow.

    +
    +

    Constraint validation: When an element has a reversed range, and the result of applying the algorithm to convert a string to a number to the string given by the element's is more than the maximum and less than the minimum, the element is simultaneously suffering from an underflow and suffering from an overflow.

    +
    @@ -52730,6 +54322,7 @@ You cannot submit this form when the field is incorrect.
    +

    The attribute provides the allowed value step for the element, as follows:

    @@ -52756,7 +54349,9 @@ You cannot submit this form when the field is incorrect. to the attribute's value, multiplied by the step scale factor.

    +
    +

    The step base is the value returned by the following algorithm:

    @@ -52777,7 +54372,9 @@ You cannot submit this form when the field is incorrect.
  • Return zero.

  • +
    +

    Constraint validation: When the element has an allowed value step, and the result of applying the algorithm to convert a string to a number to @@ -52785,6 +54382,7 @@ You cannot submit this form when the field is incorrect. that number subtracted from the step base is not an integral multiple of the allowed value step, the element is suffering from a step mismatch.

    +
    @@ -52822,6 +54420,7 @@ You cannot submit this form when the field is incorrect.
    +

    The suggestions source element is the first element in the tree in tree order to have an ID equal to the value of the list attribute, if that element @@ -52830,6 +54429,7 @@ You cannot submit this form when the field is incorrect. first element with that ID is not a datalist element, then there is no suggestions source element.

    +

    If there is a suggestions source element, then, when the user agent is allowing the user to edit the input element's so we've given some "should" suggestions above.

    +

    How user selections of suggestions are handled depends on whether the element is a control accepting a single value only, or whether it accepts multiple values:

    @@ -52918,6 +54519,7 @@ You cannot submit this form when the field is incorrect. applied depends on the user interface in an implementation-defined manner.

    +

    @@ -53176,9 +54778,12 @@ You cannot submit this form when the field is incorrect.
    value
    +

    On getting, return the current value of the element.

    +
    +

    On setting:

      @@ -53201,40 +54806,53 @@ You cannot submit this form when the field is incorrect. end of the text control, unselecting any selected text and resetting the selection direction to "none".

    +
    default
    +

    On getting, if the element has a value content attribute, return that attribute's value; otherwise, return the empty string.

    +
    +

    On setting, set the value of the element's value content attribute to the new value.

    +
    default/on
    +

    On getting, if the element has a value content attribute, return that attribute's value; otherwise, return the string "on".

    +
    +

    On setting, set the value of the element's value content attribute to the new value.

    +
    filename
    +

    On getting, return the string "C:\fakepath\" followed by the name of the first file in the list of selected files, if any, or the empty string if the list is empty.

    +
    +

    On setting, if the new value is the empty string, empty the list of selected files; otherwise, throw an "InvalidStateError" DOMException.

    +

    This "fakepath" requirement is a sad accident of history. See the example in the File Upload state section for more @@ -53248,6 +54866,7 @@ You cannot submit this form when the field is incorrect.


    +

    The checked IDL attribute allows scripts to manipulate the checkedness of an input element. On getting, it @@ -53255,6 +54874,7 @@ You cannot submit this form when the field is incorrect. on setting, it must set the element's checkedness to the new value and set the element's dirty checkedness flag to true.

    +

    @@ -53262,13 +54882,16 @@ You cannot submit this form when the field is incorrect. attribute allows scripts to access the element's selected files. +

    On getting, if the IDL attribute applies, it must return a FileList object that represents the current selected files. The same object must be returned until the list of selected files changes. If the IDL attribute does not apply, then it must instead return null. FILEAPI

    +
    +

    On setting, it must run these steps:

      @@ -53280,6 +54903,7 @@ You cannot submit this form when the field is incorrect.
    1. Replace the element's selected files with the given value.

    +

    @@ -53287,6 +54911,7 @@ You cannot submit this form when the field is incorrect. data-x="dom-input-valueAsDate">valueAsDate IDL attribute represents the value of the element, interpreted as a date.

    +

    On getting, if the valueAsDate attribute does not apply, as defined for the input element's type attribute's current state, then return null. Otherwise, run @@ -53294,7 +54919,9 @@ You cannot submit this form when the field is incorrect. Date object defined for that state to the element's value; if the algorithm returned a Date object, then return it, otherwise, return null.

    +
    +

    On setting, if the valueAsDate attribute does not apply, as defined for the input element's type attribute's current state, then throw an @@ -53305,6 +54932,7 @@ You cannot submit this form when the field is incorrect. otherwise, run the algorithm to convert a Date object to a string, as defined for that state, on the new value, and set the value of the element to the resulting string.

    +

    @@ -53312,6 +54940,7 @@ You cannot submit this form when the field is incorrect. data-x="dom-input-valueAsNumber">valueAsNumber IDL attribute represents the value of the element, interpreted as a number.

    +

    On getting, if the valueAsNumber attribute does not apply, as defined for the input element's type attribute's current state, then return a Not-a-Number (NaN) @@ -53319,7 +54948,9 @@ You cannot submit this form when the field is incorrect. string to a number defined for that state to the element's value; if the algorithm returned a number, then return it, otherwise, return a Not-a-Number (NaN) value.

    +
    +

    On setting, if the new value is infinite, then throw a TypeError exception. Otherwise, if the valueAsNumber attribute does not apply, as defined for the input element's data-x="concept-input-value-number-string">algorithm to convert a number to a string, as defined for that state, on the new value, and set the value of the element to the resulting string.

    +

    +

    The stepDown(n) and stepUp(n) methods, @@ -53428,15 +55061,19 @@ You cannot submit this form when the field is incorrect.

  • Set the value of the element to value as string.

  • +

    +

    The list IDL attribute must return the current suggestions source element, if any, or null otherwise.

    +

    +

    The HTMLInputElement showPicker() and HTMLSelectElement showPicker() @@ -53472,7 +55109,9 @@ You cannot submit this form when the field is incorrect.

  • Show the picker, if applicable, for this.

  • +
    +

    To show the picker, if applicable for an input or select element element:

    @@ -53553,6 +55192,7 @@ You cannot submit this form when the field is incorrect. event.)

    +
    @@ -53583,6 +55223,7 @@ You cannot submit this form when the field is incorrect. data-x="attr-input-type-radio">Radio Button state, or the File Upload state.)

    +

    For input elements without a defined input activation behavior, but to which these events apply, and for which the user interface involves both interactive manipulation and an explicit commit action, then when the @@ -53597,6 +55238,7 @@ You cannot submit this form when the field is incorrect. data-x="concept-event-fire">fire an event named change at the input element, with the bubbles attribute initialized to true.

    +

    An example of a user interface involving both interactive manipulation and a commit action would be a Range controls that use a @@ -53605,6 +55247,7 @@ You cannot submit this form when the field is incorrect. whereas the change event would only fire when the user let go of the knob, committing to a specific value.

    +

    For input elements without a defined input activation behavior, but to which these events apply, and for which the user interface involves an explicit commit action but no intermediate manipulation, then any time the @@ -53617,6 +55260,7 @@ You cannot submit this form when the field is incorrect. data-x="concept-event-fire">fire an event named change at the input element, with the bubbles attribute initialized to true.

    +

    An example of a user interface with a commit action would be a Color control that consists of a single button that brings @@ -53630,6 +55274,7 @@ You cannot submit this form when the field is incorrect. selecting a date from the drop down calendar and then dismissing the drop down would be a commit action.

    +

    For input elements without a defined input activation behavior, but to which these events apply, any time the user causes the element's value to change without an explicit commit @@ -53640,6 +55285,7 @@ You cannot submit this form when the field is incorrect. data-x="dom-Event-composed">composed attributes initialized to true. The corresponding change event, if any, will be fired when the control loses focus.

    +

    Examples of a user changing the element's value would include the user typing into a text control, pasting @@ -53660,6 +55306,7 @@ You cannot submit this form when the field is incorrect. when the user pauses, instead of continuously for each keystroke. +

    When the user agent is to change an input element's value on behalf of the user (e.g. as part of a form prefilling feature), the user agent must queue an element task on the user interaction @@ -53671,6 +55318,7 @@ You cannot submit this form when the field is incorrect. data-x="concept-event-fire">fire an event named change at the input element, with the bubbles attribute initialized to true.

    +

    These events are not fired in response to changes made to the values of form controls by scripts. (This is to make it easier to update the values of form controls in response @@ -53786,10 +55434,13 @@ interface HTMLButtonElement : HTMLElement { Does nothing. +

    The attribute's missing value default and invalid value default are both the Auto state.

    +
    +

    A button element is said to be a submit button if any of the following are true:

    @@ -53804,10 +55455,13 @@ interface HTMLButtonElement : HTMLElement {
  • the type attribute is in the Submit Button state.

  • +
    +

    Constraint validation: If the element is not a submit button, the element is barred from constraint validation.

    +

    If specified, the commandfor attribute value must be the HTMLButtonElement : HTMLElement { element. +

    The attribute's missing value default and invalid value default are both the Unknown state.

    +
    +

    A custom command keyword is a string that starts with "--".

    +

    If a button element is the first child which is an element of a select element, then it is @@ -53875,6 +55533,7 @@ interface HTMLButtonElement : HTMLElement {

    +

    A button element element's activation behavior given event is:

    @@ -54018,6 +55677,7 @@ interface HTMLButtonElement : HTMLElement { element and event's target.

    +

    An HTML element can have specific is valid command steps and command steps defined for the @@ -54046,6 +55706,7 @@ interface HTMLButtonElement : HTMLElement { data-x="attr-fs-formtarget">formtarget must not be specified if the element is not a submit button.

    +

    The command getter steps are:

    @@ -54063,7 +55724,9 @@ interface HTMLButtonElement : HTMLElement {
  • Return the keyword corresponding to the value of command.

  • +
    +

    The value attribute gives the element's value for the purposes of form submission. The element's value is the value of the element's HTMLButtonElement : HTMLElement { The element's optional value is the value of the element's value attribute, if there is one; otherwise null.

    +

    A button (and its value) is only included in the form submission if the button itself was used to initiate the form submission.

    @@ -54079,6 +55743,7 @@ interface HTMLButtonElement : HTMLElement {
    +

    The type getter steps are:

    @@ -54097,6 +55762,7 @@ interface HTMLButtonElement : HTMLElement {
  • Return the keyword value corresponding to state.

  • +

    The willValidate, validity, and HTMLSelectElement : HTMLElement { data-x="attr-fe-autocomplete">autocomplete attribute controls how the user agent provides autofill behavior.

    +

    If a select element has a required attribute specified, does not have a multiple attribute specified, and has a display size of 1; and if the HTMLSelectElement : HTMLElement { any) is the empty string, and that option element's parent node is the select element (and not an optgroup element), then that option is the select element's placeholder label option.

    +
    +

    If a select element has a required attribute specified, does not have a multiple attribute specified, and has a display size of 1, then the select element must have a placeholder label option.

    +

    In practice, the requirement stated in the paragraph above can only apply when a select element does not have a size attribute @@ -54308,6 +55978,7 @@ interface HTMLSelectElement : HTMLElement {


    +

    Constraint validation: If the element has its required attribute specified, and either none of the option elements in the select element's HTMLSelectElement : HTMLElement { data-x="concept-select-option-list">list of options with its selectedness set to true is the placeholder label option, then the element is suffering from being missing.

    +
    +

    The reset algorithm for a select element selectElement is:

    @@ -54343,12 +56016,16 @@ interface HTMLSelectElement : HTMLElement {
  • Run the selectedness setting algorithm given selectElement.

  • +
    +

    A select element that is not disabled is mutable.

    +

    +

    The user agent should allow the user to pick an option element from a select element in its list of options (either through a click, or through unfocusing the element after changing its @@ -54358,7 +56035,9 @@ interface HTMLSelectElement : HTMLElement { its select popover are both being rendered with base appearance, a corresponding keydown or mouseup event, otherwise null.

    +
    +

    To pick an option given a select element select, an option element option, and an Event or null event:

    @@ -54386,7 +56065,9 @@ interface HTMLSelectElement : HTMLElement { appearance, then run the hide popover algorithm given select's select popover.

    +
    +

    If the multiple attribute is absent, whenever an option element in the select element's list of options has its HTMLSelectElement : HTMLElement { the user agent must set the selectedness of all the other option elements in its list of options to false.

    +
    +

    If the multiple attribute is absent and the element's display size is greater than 1, then the user agent should also allow the user to request that the option whose HTMLSelectElement : HTMLElement { data-x="concept-option-selectedness">selectedness of that option element to false, set its dirtiness to true, and then send select update notifications.

    +
    +

    If the select is being rendered as a drop-down box with base appearance, then the user agent should allow the user to open the picker given a corresponding select @@ -54424,7 +56109,9 @@ interface HTMLSelectElement : HTMLElement {

  • Run the show popover algorithm given select's select popover, false, and select.

  • +
    +

    If the select is being rendered as a drop-down box with base appearance, then the user agent should allow the user to focus another option given the new option element to focus option and a HTMLSelectElement : HTMLElement {

  • Run the focusing steps on option.

  • +

    Implementations commonly allow the user to focus the next or previous option via the arrow-up and arrow-down keys, focus the first or last option via the Home or End keys, or @@ -54462,6 +56150,7 @@ interface HTMLSelectElement : HTMLElement {


    +

    The display size of a select element is the result of applying the rules for parsing non-negative integers to the value of the element's size attribute, if it has one and parsing it is @@ -54469,7 +56158,9 @@ interface HTMLSelectElement : HTMLElement { data-x="attr-select-size">size attribute is absent, then the element's display size is 4 if the element's multiple content attribute is present, and 1 otherwise.

    +
    +

    To get the list of options given a select element select:

    @@ -54512,11 +56203,15 @@ interface HTMLSelectElement : HTMLElement {
  • Return options.

  • +
    +

    If an option element in the list of options asks for a reset, then run that select element's selectedness setting algorithm.

    +
    +

    The selectedness setting algorithm, given a select element element, is to run the following steps:

    @@ -54540,7 +56235,9 @@ interface HTMLSelectElement : HTMLElement { the list of options in tree order to false.

    +
    +

    To send select update notifications for a select element element, queue an element task on the user interaction task source given element to run these steps:

    @@ -54563,6 +56260,7 @@ interface HTMLSelectElement : HTMLElement { data-x="event-change">change
    at element, with the bubbles attribute initialized to true.

    +
    @@ -54674,69 +56372,92 @@ interface HTMLSelectElement : HTMLElement {
    +

    The type IDL attribute, on getting, must return the string "select-one" if the multiple attribute is absent, and the string "select-multiple" if the multiple attribute is present.

    +
    +

    The options IDL attribute must return an HTMLOptionsCollection rooted at the select node, whose filter matches the elements in the list of options.

    +
    +

    The options collection is also mirrored on the HTMLSelectElement object. The supported property indices at any instant are the indices supported by the object returned by the options attribute at that instant.

    +
    +

    The length IDL attribute must return the number of nodes represented by the options collection. On setting, it must act like the attribute of the same name on the options collection.

    +
    +

    The item(index) method must return the value returned by the method of the same name on the options collection, when invoked with the same argument.

    +
    +

    The namedItem(name) method must return the value returned by the method of the same name on the options collection, when invoked with the same argument.

    +
    +

    When the user agent is to set the value of a new indexed property or set the value of an existing indexed property for a select element, it must instead run the corresponding algorithm on the select element's options collection.

    +
    +

    Similarly, the add(element, before) method must act like its namesake method on that same options collection.

    +
    +

    The remove() method must act like its namesake method on that same options collection when it has arguments, and like its namesake method on the ChildNode interface implemented by the HTMLSelectElement ancestor interface Element when it has no arguments.

    +
    +

    The selectedOptions IDL attribute must return an HTMLCollection rooted at the select node, whose filter matches the elements in the list of options that have their selectedness set to true.

    +
    +

    The selectedIndex getter steps are to return the index of the first option element in this's list of options in tree order that has its selectedness set to true, if any. If there isn't one, then return −1.

    +
    +

    The selectedIndex setter steps are:

      @@ -54764,19 +56485,23 @@ interface HTMLSelectElement : HTMLElement {
    1. Run update a select's selectedcontent given this.

    +

    This can result in no element having a selectedness set to true even in the case of the select element having no multiple attribute and a display size of 1.

    +

    The value getter steps are to return the value of the first option element in this's list of options in tree order that has its selectedness set to true, if any. If there isn't one, then return the empty string.

    +
    +

    The value setter steps are:

      @@ -54804,6 +56529,7 @@ interface HTMLSelectElement : HTMLElement {
    1. Run update a select's selectedcontent given this.

    +

    This can result in no element having a selectedness set to true even in the case of the @@ -55053,13 +56779,17 @@ interface HTMLDataListElement : HTMLElement {

    +

    The options IDL attribute must return an HTMLCollection rooted at the datalist node, whose filter matches option elements.

    +
    +

    Constraint validation: If an element has a datalist element ancestor, it is barred from constraint validation.

    +
    @@ -55098,8 +56828,10 @@ interface HTMLOptGroupElement : HTMLElement {

    The optgroup element represents a group of option elements with a common label.

    +

    The element's group of option elements consists of the option elements that are children of the optgroup element.

    +
    @@ -55118,6 +56850,7 @@ interface HTMLOptGroupElement : HTMLElement { attribute must be specified if the optgroup has no child legend element.

    +

    The optgroup HTML element removing steps, given removedNode and oldParent, are:

    @@ -55126,7 +56859,9 @@ interface HTMLOptGroupElement : HTMLElement { option child, then run oldParent's selectedness setting algorithm.

    +
    +

    The optgroup HTML element moving steps, given movedNode and oldParent, are:

    @@ -55134,7 +56869,9 @@ interface HTMLOptGroupElement : HTMLElement {
  • Run the optgroup HTML element removing steps given movedNode and oldParent.

  • +
    +

    To get an optgroup element's label, given an optgroup optgroup:

    @@ -55150,6 +56887,7 @@ interface HTMLOptGroupElement : HTMLElement {
  • Otherwise, return the value of optgroup's label attribute.

  • +

    The value of the optgroup label algorithm gives the name of the group, for the purposes of the user interface. HTMLOptionElement : HTMLElement { option. A placeholder label option does not represent an actual option, but instead represents a label for the select control.

    +

    The disabled attribute is a boolean attribute. An option element is disabled if its disabled attribute is present or if it is a child of an optgroup element whose disabled attribute is present.

    +
    @@ -55269,20 +57009,24 @@ interface HTMLOptionElement : HTMLElement { JavaScript. Or, it could be indirectly modified by user action, e.g., if other non-disabled option elements in the select element were modified.

    +

    The label attribute provides a label for element. The label of an option element is the value of the label content attribute, if there is one and its value is not the empty string, or, otherwise, the value of the element's text IDL attribute.

    +

    The label content attribute, if specified, must not be empty.

    +

    The value attribute provides a value for element. The value of an option element is the value of the value content attribute, if there is one, or, if there is not, the result of collect option text given this and false.

    +

    The selected attribute is a boolean attribute. It represents the default HTMLOptionElement : HTMLElement { a boolean state, initially false. It controls whether adding or removing the selected content attribute has any effect.

    +

    The selectedness of an option element is a boolean state, initially false. Except where otherwise specified, when the element is created, its selectedness must be set to true if @@ -55304,6 +57049,7 @@ interface HTMLOptionElement : HTMLElement { option element's selected attribute is removed, if its dirtiness is false, its selectedness must be set to false.

    +

    The Option() constructor, when called with three or fewer arguments, overrides the initial state of the HTMLOptionElement : HTMLElement {

    +

    An option element's index is the number of option elements that are in the same list of options but that come before it in tree order. If the option element is not in a list of options, then the option element's index is zero.

    +
    +

    The option HTML element insertion steps, given insertedOption, are:

    @@ -55344,7 +57093,9 @@ interface HTMLOptionElement : HTMLElement { +
    +

    The option HTML element removing steps, given removedOption and oldParent, are:

    @@ -55358,7 +57109,9 @@ interface HTMLOptionElement : HTMLElement { setting algorithm given ancestor and return.

    +
    +

    The option HTML element moving steps, given movedNode and oldParent, are:

    @@ -55369,7 +57122,9 @@ interface HTMLOptionElement : HTMLElement {
  • Run the option HTML element insertion steps given movedNode.

  • +
    +

    To get the option element nearest ancestor select given an option option, run these steps. They return a select or null.

    @@ -55387,7 +57142,9 @@ interface HTMLOptionElement : HTMLElement {
  • Return null.

  • +
    +

    To maybe clone an option into selectedcontent, given an option option:

    @@ -55413,7 +57170,9 @@ interface HTMLOptionElement : HTMLElement { selectedcontent.

    +
    +

    To clone selected option into select button, given a select element select:

    @@ -55431,6 +57190,7 @@ interface HTMLOptionElement : HTMLElement {
  • Set select's select fallback button text to text.

  • +
    option.selected
    @@ -55478,6 +57238,7 @@ interface HTMLOptionElement : HTMLElement {
    +

    The label getter steps are:

    @@ -55491,11 +57252,15 @@ interface HTMLOptionElement : HTMLElement {
  • Return attribute's value.

  • +
    +

    The value getter steps are to return this's value.

    +
    +

    The selected IDL attribute, on getting, must return true if the element's selectedness is true, and false @@ -55503,17 +57268,25 @@ interface HTMLOptionElement : HTMLElement { data-x="concept-option-selectedness">selectedness to the new value, set its dirtiness to true, and then cause the element to ask for a reset.

    +
    +

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

    +
    +

    The text getter steps are to return the result of collect option text given this and false.

    +
    +

    The text setter steps are to string replace all with the given value within this.

    +
    +

    The form IDL attribute's behavior depends on whether the option element is in a select element or not. If the option has a select element @@ -55522,7 +57295,9 @@ interface HTMLOptionElement : HTMLElement { data-x="dom-option-form">form IDL attribute must return the same value as the form IDL attribute on that select element. Otherwise, it must return null.

    +
    +

    A legacy factory function is provided for creating HTMLOptionElement objects (in addition to the factory methods from DOM such as createElement()): HTMLOptionElement : HTMLElement {

  • Return option.

  • +
    +

    To collect option text, given an option element option and a boolean includeAltText:

    @@ -55595,6 +57372,7 @@ interface HTMLOptionElement : HTMLElement {
  • Return the result of strip and collapse ASCII whitespace given text.

  • +
    @@ -55725,14 +57503,19 @@ interface HTMLTextAreaElement : HTMLElement {
    +

    Constraint validation: If the readonly attribute is specified on a textarea element, the element is barred from constraint validation.

    +
    +

    A textarea element is mutable if it is neither disabled nor has a readonly attribute specified.

    +
    +

    When a textarea is mutable, its raw value should be editable by the user: the user agent should allow the user to edit, insert, and remove text, and to insert and remove line breaks @@ -55746,34 +57529,46 @@ interface HTMLTextAreaElement : HTMLElement { interaction before queuing the task; for example, a user agent could wait for the user to have not hit a key for 100ms, so as to only fire the event when the user pauses, instead of continuously for each keystroke.

    +
    +

    A textarea element's dirty value flag must be set to true whenever the user interacts with the control in a way that changes the raw value.

    +
    +

    The cloning steps for textarea elements given node, copy, and subtree are to propagate the raw value and dirty value flag from node to copy.

    +
    +

    The children changed steps for textarea elements must, if the element's dirty value flag is false, set the element's raw value to its child text content.

    +
    +

    The reset algorithm for textarea elements is to set the user validity to false, the dirty value flag back to false, and the raw value to its child text content.

    +
    +

    When a textarea element is popped off the stack of open elements of an HTML parser or XML parser, then the user agent must invoke the element's reset algorithm.

    +
    +

    If the element is mutable, the user agent should allow the user to change the writing direction of the element, setting it either to a left-to-right writing direction or a right-to-left writing direction. If the user does so, the user agent must @@ -55791,9 +57586,11 @@ interface HTMLTextAreaElement : HTMLElement { data-x="dom-Event-bubbles">bubbles and composed attributes initialized to true.

    +
    +

    The cols attribute specifies the expected maximum number of characters per line. If the cols attribute is specified, its value must be a valid @@ -55801,6 +57598,7 @@ interface HTMLTextAreaElement : HTMLElement { parsing non-negative integers to the attribute's value results in a number greater than zero, then the element's character width is that value; otherwise, it is 20.

    +
    @@ -55812,6 +57610,7 @@ interface HTMLTextAreaElement : HTMLElement {
    +

    The rows attribute specifies the number of lines to show. If the rows attribute is specified, its value must be a valid @@ -55819,6 +57618,7 @@ interface HTMLTextAreaElement : HTMLElement { parsing non-negative integers to the attribute's value results in a number greater than zero, then the element's character height is that value; otherwise, it is 2.

    +
    @@ -55850,9 +57650,11 @@ interface HTMLTextAreaElement : HTMLElement { submitted. +

    The attribute's missing value default and invalid value default are both the Soft state.

    +

    If the element's wrap attribute is in the Hard state, the HTMLTextAreaElement : HTMLElement { data-x="attr-textarea-wrap">wrap attribute, additional line breaks are inserted to wrap the text at the given width.

    +

    The algorithm for obtaining the element's API value is to return the element's raw value, with newlines normalized.

    +
    +

    The element's value is defined to be the element's API value with the textarea wrapping transformation applied. The textarea wrapping transformation is the following @@ -55895,6 +57700,7 @@ interface HTMLTextAreaElement : HTMLElement { purposes of this requirement, lines are delimited by the start of the string, the end of the string, and U+000A LINE FEED (LF) characters.

    +
    @@ -55922,11 +57728,13 @@ interface HTMLTextAreaElement : HTMLElement {
    +

    Constraint validation: If the element has its required attribute specified, and the element is mutable, and the element's value is the empty string, then the element is suffering from being missing.

    +
    @@ -55993,16 +57801,23 @@ interface HTMLTextAreaElement : HTMLElement {
    +

    The type IDL attribute must return the value "textarea".

    +
    +

    The defaultValue attribute's getter must return the element's child text content. +

    +

    The defaultValue attribute's setter must string replace all with the given value within this element.

    +
    +

    The value IDL attribute must, on getting, return the element's API value. On setting, it must perform the @@ -56024,10 +57839,13 @@ interface HTMLTextAreaElement : HTMLElement { data-x="set the selection direction">resetting the selection direction to "none".

    +
    +

    The textLength IDL attribute must return the length of the element's API value.

    +

    The willValidate, validity, and HTMLOutputElement : HTMLElement {

    The element has a default value override (null or a string). Initially it must be null.

    +

    The element's default value is determined by the following steps:

    @@ -56183,7 +58002,9 @@ interface HTMLOutputElement : HTMLElement {
  • Return this element's descendant text content.

  • +
    +

    The reset algorithm for output elements is to run these steps: @@ -56194,6 +58015,7 @@ interface HTMLOutputElement : HTMLElement {

  • Set this element's default value override to null.

  • +
    @@ -56218,9 +58040,12 @@ interface HTMLOutputElement : HTMLElement {
    +

    The value getter steps are to return this's descendant text content.

    +
    +

    The value setter steps are:

      @@ -56229,12 +58054,16 @@ interface HTMLOutputElement : HTMLElement {
    1. String replace all with the given value within this.

    +
    +

    The defaultValue getter steps are to return the result of running this's default value.

    +
    +

    The defaultValue setter steps are:

      @@ -56245,9 +58074,12 @@ interface HTMLOutputElement : HTMLElement {
    1. Set this's default value override to the given value.

    +
    +

    The type getter steps are to return "output".

    +

    The willValidate, validity, and HTMLProgressElement : HTMLElement {

    +

    User agent requirements: If the value attribute is omitted, then the progress bar is an indeterminate progress bar. Otherwise, it is a determinate progress bar.

    +
    +

    If the progress bar is a determinate progress bar and the element has a max attribute, the user agent must parse the max attribute's value according to the rules for parsing @@ -56398,7 +58233,9 @@ interface HTMLProgressElement : HTMLElement { data-x="attr-progress-max">max attribute, or if it has one but parsing it resulted in an error, or if the parsed value was less than or equal to zero, then the maximum value of the progress bar is 1.0.

    +
    +

    If the progress bar is a determinate progress bar, user agents must parse the value attribute's value according to the rules for parsing floating-point number values. If this does not result in an error and the parsed @@ -56407,13 +58244,16 @@ interface HTMLProgressElement : HTMLElement { data-x="attr-progress-value">value attribute's value resulted in an error or a number less than or equal to zero, then the value of the progress bar is zero.

    +
    +

    If the progress bar is a determinate progress bar, then the current value is the maximum value, if value is greater than the maximum value, and value otherwise.

    +

    UA requirements for showing the progress bar: When representing a progress element to the user, the UA should indicate whether it is a determinate or @@ -56436,16 +58276,20 @@ interface HTMLProgressElement : HTMLElement {

    +

    If the progress bar is an indeterminate progress bar, then the position IDL attribute must return −1. Otherwise, it must return the result of dividing the current value by the maximum value.

    +
    +

    The value getter steps are to return 0 if this is an indeterminate progress bar; otherwise this's current value.

    +

    Setting the value IDL attribute to itself when the corresponding content attribute is absent would change the progress bar from an @@ -56542,6 +58386,7 @@ interface HTMLMeterElement : HTMLElement { when present, must have values that are valid floating-point numbers.

    +

    In addition, the attributes' values are further constrained:

    Let value be the value attribute's @@ -56569,6 +58414,7 @@ interface HTMLMeterElement : HTMLElement { (if both low and high are specified)

    +

    If no minimum or maximum is specified, then the range is assumed to be 0..1, and the value thus has to be within that range.

    @@ -56624,6 +58470,7 @@ and a height of <meter value=2>2cm</meter>.</p> <!-- BAD! +

    User agent requirements: User agents must parse the min, max, value, low, 2cm</meter>.</p> <!-- BAD!

    minimum value ≤ optimum point ≤ maximum value

    +

    UA requirements for regions of the gauge: If the optimum point is equal to the low boundary or the high boundary, or anywhere in between them, then the region between the low @@ -56792,28 +58640,40 @@ and a height of <meter value=2>2cm</meter>.</p> <!-- BAD! +

    The value getter steps are to return this's actual value.

    +
    +

    The min getter steps are to return this's minimum value.

    +
    +

    The max getter steps are to return this's maximum value.

    +
    +

    The low getter steps are to return this's low boundary.

    +
    +

    The high getter steps are to return this's high boundary.

    +
    +

    The optimum getter steps are to return this's optimum value.

    +

    The labels IDL attribute provides a list of the element's labels.

    @@ -56883,12 +58743,15 @@ interface HTMLFieldSetElement : HTMLElement { legend element that is a child of the fieldset element, if any. The remainder of the descendants form the group.

    +

    The disabled attribute, when specified, causes all the form control descendants of the fieldset element, excluding those that are descendants of the fieldset element's first legend element child, if any, to be disabled.

    +
    +

    A fieldset element is a disabled fieldset if it matches any of the following conditions:

    @@ -56900,6 +58763,7 @@ interface HTMLFieldSetElement : HTMLElement { descendant of that fieldset element's first legend element child, if any. +

    The form attribute is used to explicitly associate the fieldset element with its form owner. The HTMLFieldSetElement : HTMLElement {

    +

    The type IDL attribute must return the string "fieldset".

    +
    +

    The elements IDL attribute must return an HTMLCollection rooted at the fieldset element, whose filter matches listed elements.

    +

    The willValidate, validity, and HTMLLegendElement : HTMLElement {

    +

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

    +
    @@ -57134,6 +59004,7 @@ interface HTMLSelectedContentElement : HTMLElementdisabled state, which is a boolean, initially set to false.

    +

    To update a select's selectedcontent given a select element select:

    @@ -57155,7 +59026,9 @@ interface HTMLSelectedContentElement : HTMLElement

    Otherwise, run clone an option into a selectedcontent given option and selectedcontent.

    +
    +

    To get a select's enabled selectedcontent given a select element select:

    @@ -57172,7 +59045,9 @@ interface HTMLSelectedContentElement : HTMLElement

    Return selectedcontent.

    +
    +

    To clone an option into a selectedcontent, given an option element option and a selectedcontent element selectedcontent:

    @@ -57198,7 +59073,9 @@ interface HTMLSelectedContentElement : HTMLElement

    Replace all with documentFragment within selectedcontent.

    +
    +

    To clear a selectedcontent given a selectedcontent element selectedcontent:

    @@ -57206,7 +59083,9 @@ interface HTMLSelectedContentElement : HTMLElement

    Replace all with null within selectedcontent.

    +
    +

    To clear a select's non-primary selectedcontent elements, given a select element select:

    @@ -57227,7 +59106,9 @@ interface HTMLSelectedContentElement : HTMLElement +
    +

    The selectedcontent HTML element post-connection steps, given selectedcontent, are:

    @@ -57271,7 +59152,9 @@ interface HTMLSelectedContentElement : HTMLElement

    Run clear a select's non-primary selectedcontent elements given nearestSelectAncestor.

    +
    +

    The selectedcontent HTML element removing steps, given selectedcontent and oldParent, are:

    @@ -57296,6 +59179,7 @@ interface HTMLSelectedContentElement : HTMLElement +
    @@ -57380,10 +59264,12 @@ interface HTMLSelectedContentElement : HTMLElementThis feature allows authors to work around the lack of support for nested form elements.

    +

    If a listed form-associated element has a form attribute specified, then that attribute's value must be the ID of a form element in the element's tree.

    +
    @@ -57394,32 +59280,43 @@ interface HTMLSelectedContentElement : HTMLElementform-associated element being associated with a form element that is not its ancestor.

    +

    When a form-associated element is created, its form owner must be initialized to null (no owner).

    +
    +

    When a form-associated element is to be associated with a form, its form owner must be set to that form.

    +
    +

    When a listed form-associated element's form attribute is set, changed, or removed, then the user agent must reset the form owner of that element.

    +
    +

    When a listed form-associated element has a form attribute and the ID of any of the elements in the tree changes, then the user agent must reset the form owner of that form-associated element.

    +
    +

    When a listed form-associated element has a form attribute and an element with an ID is inserted into or removed from the Document, or its HTML element moving steps are run, then the user agent must reset the form owner of that form-associated element.

    +

    The form owner is also reset by the HTML element insertion steps, HTML element removing steps, and HTML element moving steps.

    +

    To reset the form owner of a form-associated element element:

    @@ -57463,6 +59360,7 @@ interface HTMLSelectedContentElement : HTMLElementassociate element with the nearest such ancestor form element.

    +
    @@ -57508,13 +59406,16 @@ interface HTMLSelectedContentElement : HTMLElement +

    Listed form-associated elements except for form-associated custom elements have a form IDL attribute, which, on getting, must return the element's form owner, or null if there isn't one.

    +
    +

    Form-associated custom elements don't have form IDL attribute. Instead, their ElementInternals object has a HTMLSelectedContentElement : HTMLElementtarget element is not a form-associated custom element. Otherwise, it must return the element's form owner, or null if there isn't one.

    +
    @@ -57614,21 +59516,25 @@ form.method === input; // => true of textarea elements, with all newlines normalized to a single character (as opposed to CRLF pairs).

    +

    If an element has its form control maxlength attribute specified, the attribute's value must be a valid non-negative integer. If the attribute is specified and applying the rules for parsing non-negative integers to its value results in a number, then that number is the element's maximum allowed value length. If the attribute is omitted or parsing its value results in an error, then there is no maximum allowed value length.

    +
    +

    Constraint validation: If an element has a maximum allowed value length, its dirty value flag is true, its value was last changed by a user edit (as opposed to a change made by a script), and the length of the element's API value is greater than the element's maximum allowed value length, then the element is suffering from being too long.

    +

    User agents may prevent the user from causing the element's API value to be set to a value whose length is @@ -57659,12 +59565,14 @@ form.method === input; // => true value at all. If the empty string is not allowed, then the required attribute also needs to be set.

    +

    If an element has its form control minlength attribute specified, the attribute's value must be a valid non-negative integer. If the attribute is specified and applying the rules for parsing non-negative integers to its value results in a number, then that number is the element's minimum allowed value length. If the attribute is omitted or parsing its value results in an error, then there is no minimum allowed value length.

    +

    If an element has both a maximum allowed value length and a minimum allowed value length, the minimum allowed value length must be smaller than or equal @@ -57672,6 +59580,7 @@ form.method === input; // => true

    +

    Constraint validation: If an element has a minimum allowed value length, its dirty value flag is true, its value was last changed by a user edit (as opposed to a change @@ -57679,6 +59588,7 @@ form.method === input; // => true the length of the element's API value is less than the element's minimum allowed value length, then the element is suffering from being too short.

    +
    @@ -57713,6 +59623,7 @@ form.method === input; // => true option elements and the disabled attribute for optgroup elements are defined separately.

    +

    A form control is disabled if any of the following are true:

    @@ -57727,6 +59638,7 @@ form.method === input; // => true descendant of that fieldset element's first legend element child, if any.

    +
    @@ -57745,9 +59657,11 @@ form.method === input; // => true
    +

    Constraint validation: If an element is disabled, it is barred from constraint validation.

    +
    @@ -57827,11 +59741,13 @@ form.method === input; // => true value default">missing value default, and its invalid value default is the GET state.

    +

    The method of an element is one of those states. If the element is a submit button and has a formmethod attribute, then the element's method is that attribute's state; otherwise, it is the form owner's method attribute's state.

    +
    @@ -57905,20 +59821,24 @@ form.method === input; // => true data-x="attr-fs-enctype-text">text/plain" keyword and corresponding state. +

    The attribute's missing value default and invalid value default are both the application/x-www-form-urlencoded state.

    +

    The formenctype attribute has no missing value default, and its invalid value default is the application/x-www-form-urlencoded state.

    +

    The enctype of an element is one of those three states. If the element is a submit button and has a formenctype attribute, then the element's enctype is that attribute's state; otherwise, it is the form owner's enctype attribute's state.

    +

    @@ -57935,11 +59855,13 @@ form.method === input; // => true data-x="boolean attribute">boolean attributes. If present, they indicate that the form is not to be validated during submission.

    +

    The no-validate state of an element is true if the element is a submit button and the element's formnovalidate attribute is present, or if the element's form owner's novalidate attribute is present, and false otherwise.

    +
    @@ -57963,6 +59885,7 @@ form.method === input; // => true
    +

    The action getter steps are:

    @@ -57984,7 +59907,9 @@ form.method === input; // => true
  • Return attribute's value, converted to a scalar value string.

  • +
    +

    The formAction getter steps are:

    @@ -58006,7 +59931,9 @@ form.method === input; // => true
  • Return attribute's value, converted to a scalar value string.

  • +
    +

    The method and enctype IDL attributes must reflect the respective content attributes of the same name, @@ -58020,6 +59947,7 @@ form.method === input; // => true data-x="dom-fs-formMethod">formMethod IDL attribute must reflect the formmethod content attribute, limited to only known values. +

    @@ -58062,6 +59990,7 @@ form.method === input; // => true "on" and "off" keywords are not allowed).

    +

    Autofill detail tokens are the following, in the order given below:

      @@ -58240,6 +60169,7 @@ form.method === input; // => true form control. webauthn is only valid for input and textarea elements.

    +

    As noted earlier, the meaning of the attribute and its keywords depends on the mantle that the attribute is wearing.

    @@ -58319,11 +60249,13 @@ form.method === input; // => true first and the given name second, and many others simply have one name (a mononym). Having a single field is therefore more flexible.

    +

    Some fields are only appropriate for certain form controls. An autofill field name is inappropriate for a control if the control does not belong to the group listed for that autofill field in the fifth column of the first row describing that autofill field in the table below. What controls fall into each group is described below the table.

    +
    @@ -58930,6 +60862,7 @@ MIT Room 32-G524 "section-parent shipping", or "section-child shipping home".

    +

    These values are defined as the result of running the following algorithm:

      @@ -59122,7 +61055,9 @@ MIT Room 32-G524 data-x="attr-fe-autocomplete-on">on".

    +
    +

    To determine a field's category, given field:

      @@ -59376,9 +61311,11 @@ MIT Room 32-G524
    1. Return the pair (category, maximum tokens).

    +

    +

    For the purposes of autofill, a control's data depends on the kind of control:

    @@ -59411,6 +61348,7 @@ MIT Room 32-G524 data-x="concept-select-option-list">list of options that has its selectedness set to true.
    +

    @@ -59740,9 +61678,11 @@ MIT Room 32-G524
    +

    The autocomplete IDL attribute, on getting, must return the element's IDL-exposed autofill value.

    +
    @@ -59873,6 +61813,7 @@ MIT Room 32-G524 count as characters. Thus, for instance, the selection can include just an invisible character, and the text insertion cursor can be placed to one side or another of such a character.

    +

    Whenever the relevant value changes for an element to which these APIs apply, run these steps:

    @@ -59903,6 +61844,7 @@ MIT Room 32-G524 data-x="concept-textarea/input-relevant-value">relevant value, set it to the end of the relevant value.

    +

    In some cases where the relevant value changes, other parts of the @@ -59923,10 +61865,12 @@ MIT Room 32-G524 data-x="">none" if the platform supports that direction, or "forward" otherwise.

    +

    To set the selection direction of an element to a given direction, update the element's selection direction to the given direction, unless the direction is "none" and the platform does not support that direction; in that case, update the element's selection direction to "forward".

    +

    On Windows, the direction indicates the position of the caret relative to @@ -59944,6 +61888,7 @@ MIT Room 32-G524

    +

    The select() method, when invoked, must run the following steps:

    @@ -59962,7 +61907,9 @@ MIT Room 32-G524
  • Set the selection range with 0 and infinity.

  • +
    +

    The selectionStart attribute's getter must run the following steps:

    @@ -59983,7 +61930,9 @@ MIT Room 32-G524 immediately follows the start of the selection.

    +
    +

    The selectionStart attribute's setter must run the following steps:

    @@ -60003,7 +61952,9 @@ MIT Room 32-G524 of this element's selectionDirection attribute.

    +
    +

    The selectionEnd attribute's getter must run the following steps:

    @@ -60024,7 +61975,9 @@ MIT Room 32-G524 immediately follows the end of the selection.

    +
    +

    The selectionEnd attribute's setter must run the following steps:

    @@ -60039,7 +61992,9 @@ MIT Room 32-G524 the value of this element's selectionDirection attribute.

    +
    +

    The selectionDirection attribute's getter must run the following steps:

    @@ -60051,7 +62006,9 @@ MIT Room 32-G524
  • Return this element's selection direction.

  • +
    +

    The selectionDirection attribute's setter must run the following steps:

    @@ -60066,7 +62023,9 @@ MIT Room 32-G524 element's selectionEnd attribute, and the given value.

    +
    +

    The setSelectionRange(start, end, direction) method, when invoked, must run the following steps:

    @@ -60080,7 +62039,9 @@ MIT Room 32-G524
  • Set the selection range with start, end, and direction.

  • +
    +

    To set the selection range with an integer or null start, an integer or null or the special value infinity end, and optionally a string direction, run the following steps:

    @@ -60117,8 +62078,10 @@ MIT Room 32-G524 at the element, with the bubbles attribute initialized to true.

    +
    +

    The setRangeText(replacement, start, end, selectMode) method, when invoked, must run the following @@ -60238,6 +62201,7 @@ MIT Room 32-G524

  • Set the selection range with selection start and selection end.

  • +

    The setRangeText() method uses the following enumeration:

    @@ -60259,7 +62223,7 @@ MIT Room 32-G524
    var selectionText = control.value.substring(control.selectionStart, control.selectionEnd);
    -

    ...where control is the input or textarea +

    ...where control is the input or textarea element.

    @@ -60276,7 +62240,7 @@ var prefix = "http://"; control.value = prefix + control.value; control.setSelectionRange(oldStart + prefix.length, oldEnd + prefix.length, oldDirection); -

    ...where control is the input or textarea +

    ...where control is the input or textarea element.

    @@ -60289,10 +62253,12 @@ control.setSelectionRange(oldStart + prefix.length, oldEnd + prefix.length, oldD
    Definitions
    +

    A submittable element is a candidate for constraint validation except when a condition has barred the element from constraint validation. (For example, an element is barred from constraint validation if it has a datalist element ancestor.)

    +

    An element can have a custom validity error message defined. Initially, an element must have its custom validity error message set to the empty string. When its value @@ -60432,8 +62398,10 @@ control.setSelectionRange(oldStart + prefix.length, oldEnd + prefix.length, oldD data-x="concept-fe-disabled">disabled; thus these states can be represented in the DOM even if validating the form during submission wouldn't indicate a problem to the user.

    +

    An element satisfies its constraints if it is not suffering from any of the above validity states.

    +
    @@ -60443,6 +62411,7 @@ control.setSelectionRange(oldStart + prefix.length, oldEnd + prefix.length, oldD
    Constraint validation
    +

    When the user agent is required to statically validate the constraints of form element form, it must run the following steps, which return either a positive result (all the controls in the form are valid) or a negative @@ -60492,7 +62461,9 @@ control.setSelectionRange(oldStart + prefix.length, oldEnd + prefix.length, oldD

  • Return a negative result with the list of elements in the unhandled invalid controls list.

  • +
    +

    If a user agent is to interactively validate the constraints of form element form, then the user agent must run the following steps:

    @@ -60529,6 +62500,7 @@ control.setSelectionRange(oldStart + prefix.length, oldEnd + prefix.length, oldD
  • Return a negative result.

  • +
    @@ -60635,13 +62607,16 @@ control.setSelectionRange(oldStart + prefix.length, oldEnd + prefix.length, oldD
    +

    The willValidate attribute's getter must return true, if this element is a candidate for constraint validation, and false otherwise (i.e., false if any conditions are barring it from constraint validation).

    +
    +

    The willValidate attribute of ElementInternals interface, on getting, must throw a @@ -60649,7 +62624,9 @@ control.setSelectionRange(oldStart + prefix.length, oldEnd + prefix.length, oldD data-x="internals-target">target element is not a form-associated custom element. Otherwise, it must return true if the target element is a candidate for constraint validation, and false otherwise.

    +
    +

    The setCustomValidity(error) method steps @@ -60661,6 +62638,7 @@ control.setSelectionRange(oldStart + prefix.length, oldEnd + prefix.length, oldD

  • Set the custom validity error message to error.

  • +
    @@ -60691,12 +62669,15 @@ control.setSelectionRange(oldStart + prefix.length, oldEnd + prefix.length, oldD
    +

    The validity attribute's getter must return a ValidityState object that represents the validity states of this element. This object is live.

    +
    +

    The validity attribute of ElementInternals interface, on getting, must throw a @@ -60705,6 +62686,7 @@ control.setSelectionRange(oldStart + prefix.length, oldEnd + prefix.length, oldD element. Otherwise, it must return a ValidityState object that represents the validity states of the target element. This object is live.

    +
    [Exposed=Window]
     interface ValidityState {
    @@ -60721,6 +62703,7 @@ interface ValidityState {
       readonly attribute boolean valid;
     };
    +

    A ValidityState object has the following attributes. On getting, they must return true if the corresponding condition given in the following list is true, and false otherwise.

    @@ -60758,7 +62741,9 @@ interface ValidityState {
    valid

    None of the other conditions are true.

    +
    +

    The check validity steps for an element element are:

      @@ -60777,12 +62762,16 @@ interface ValidityState {
    1. Return true.

    +
    +

    The checkValidity() method, when invoked, must run the check validity steps on this element.

    +
    +

    The checkValidity() method of the ElementInternals interface must run these steps:

    @@ -60796,7 +62785,9 @@ interface ValidityState {
  • Run the check validity steps on element.

  • +
    +

    The report validity steps for an element element are:

      @@ -60821,12 +62812,16 @@ interface ValidityState {
    1. Return true.

    +
    +

    The reportValidity() method, when invoked, must run the report validity steps on this element.

    +
    +

    The reportValidity() method of the ElementInternals interface must run these steps:

    @@ -60840,7 +62835,9 @@ interface ValidityState {
  • Run the report validity steps on element.

  • +
    +

    The validationMessage attribute's getter must run @@ -60859,6 +62856,7 @@ interface ValidityState { validation and is suffering from a custom error, then the custom validity error message should be present in the return value.

    +
    @@ -60927,20 +62925,25 @@ fur
    Implicit submission
    +

    A form element's default button is the first submit button in tree order whose form owner is that form element.

    +
    +

    If the user agent supports letting the user submit a form implicitly (for example, on some platforms hitting the "enter" key while a text control is focused implicitly submits the form), then doing so for a form, whose default button has activation behavior and is not disabled, must cause the user agent to fire a click event at that default button.

    +

    There are pages on the web that are only usable if there is a way to implicitly submit forms, so user agents are strongly encouraged to support this.

    +

    If the form has no submit button, then the implicit submission mechanism must perform the following steps: @@ -60953,7 +62956,9 @@ fur form element itself with userInvolvement set to "activation".

    +
    +

    For the purpose of the previous paragraph, an element is a field that blocks implicit submission of a form element if it is an input element whose form owner is that form element and whose Local Date and Time, Number

    +
    @@ -60985,6 +62991,7 @@ fur

    Each form element has a firing submission events boolean, initially false.

    +

    To submit a form element form from an element submitter (typically a button), given an optional boolean submitted from +

    Constructing the entry list
    @@ -61405,6 +63413,7 @@ fur data-x="form entry value" for="entry list/entry" export>value (either a scalar value string or a File object).

    +

    To create an entry given a string name, a string or Blob object value, and optionally a scalar value string filename:

    @@ -61440,7 +63449,9 @@ fur name">name is name and whose value is value.

    +
    +

    To construct the entry list given a form, an optional submitter (default null), and an optional encoding (default @@ -61629,6 +63640,7 @@ fur

  • Return a clone of entry list.

  • +
    @@ -61637,6 +63649,7 @@ fur
    Selecting a form submission encoding
    +

    If the user agent is to pick an encoding for a form, it must run the following steps:

    @@ -61672,6 +63685,7 @@ fur
  • Return the result of getting an output encoding from encoding.

  • +
    @@ -61684,6 +63698,7 @@ fur must be strings, rather than an entry list where the value can be a File. The following algorithm performs the conversion.

    +

    To convert to a list of name-value pairs an entry list entry list, run these steps:

    @@ -61715,6 +63730,7 @@ fur
  • Return list.

  • +
    @@ -61735,6 +63751,7 @@ fur +

    The multipart/form-data encoding algorithm, given an entry list entry list and an encoding encoding, is as follows:

    @@ -61789,6 +63806,7 @@ fur +
    @@ -61800,6 +63818,7 @@ fur
    +

    The text/plain encoding algorithm, given a list of name-value pairs pairs, is as follows:

    @@ -61822,6 +63841,7 @@ fur
  • Return result.

  • +
    @@ -61851,9 +63871,11 @@ dictionary SubmitEventInit : EventInit {
    +

    The submitter attribute must return the value it was initialized to.

    +
    @@ -61882,14 +63904,17 @@ dictionary FormDataEventInit : EventInit {
    +

    The formData attribute must return the value it was initialized to. It represents a FormData object associated to the entry list that is constructed when the form is submitted.

    +

    Resetting a form

    +

    When a form element form is reset, run these steps:

    @@ -61904,6 +63929,7 @@ dictionary FormDataEventInit : EventInit { data-x="category-reset">resettable element whose form owner is form.

    +

    Each resettable element defines its own reset algorithm. Changes made to form controls as part of @@ -62032,6 +64058,7 @@ interface HTMLDetailsElement : HTMLElement { exists, user agents can still provide this ability through some other user interface affordance.

    +

    The details name group that contains a details element a also contains all the other details elements b that fulfill all of the following conditions:

    @@ -62044,10 +64071,12 @@ interface HTMLDetailsElement : HTMLElement { a's name attribute equals the value of b's name attribute. +

    Every details element has a details toggle task tracker, which is a toggle task tracker or null, initially null.

    +

    The following attribute change steps, given element, localName, oldValue, value, and namespace, are used for all details elements:

    @@ -62087,7 +64116,9 @@ interface HTMLDetailsElement : HTMLElement { +
    +

    The details HTML element insertion steps, given insertedNode, are:

    @@ -62095,10 +64126,12 @@ interface HTMLDetailsElement : HTMLElement {
  • Ensure details exclusivity by closing the given element if needed given insertedNode.

  • +

    To be clear, these attribute change and insertion steps also run when an attribute or element is inserted via the parser.

    +

    To queue a details toggle event task given a details element element, a string oldState, and a string newState: @@ -62137,7 +64170,9 @@ interface HTMLDetailsElement : HTMLElement { data-x="concept-task">task and old state set to oldState.

    +
    +

    To ensure details exclusivity by closing other elements if needed given a details element element:

    @@ -62175,7 +64210,9 @@ interface HTMLDetailsElement : HTMLElement { +
    +

    To ensure details exclusivity by closing the given element if needed given a details element element:

    @@ -62211,6 +64248,7 @@ interface HTMLDetailsElement : HTMLElement { +
    @@ -62359,6 +64397,7 @@ interface HTMLDetailsElement : HTMLElement {
    +

    A summary element is a summary for its parent details if the following algorithm returns true:

    @@ -62374,7 +64413,9 @@ interface HTMLDetailsElement : HTMLElement {
  • Return true.

  • +
    +

    The activation behavior of summary elements is to run the following steps:

    @@ -62393,6 +64434,7 @@ interface HTMLDetailsElement : HTMLElement {

    This will then run the details notification task steps.

    +
    @@ -62435,6 +64477,7 @@ interface HTMLDetailsElement : HTMLElement { handler, a URL to which to navigate, or a form submission. +

    User agents may expose the commands that match the following criteria:

    @@ -62448,6 +64491,7 @@ interface HTMLDetailsElement : HTMLElement {
  • Neither the element nor any of its ancestors has a hidden attribute specified.

  • +

    User agents are encouraged to do this especially for commands that have Access Keys, as a way to advertise those keys to the @@ -62460,43 +64504,62 @@ interface HTMLDetailsElement : HTMLElement {

    Using the a element to define a command
    +

    An a element with an href attribute defines a command.

    +
    +

    The Label of the command is the element's descendant text content.

    +
    +

    The Access Key of the command is the element's assigned access key, if any.

    +
    +

    The Hidden State of the command is true (hidden) if the element has a hidden attribute, and false otherwise.

    +
    +

    The Disabled State facet of the command is true if the element or one of its ancestors is inert, and false otherwise.

    +
    +

    The Action of the command is to fire a click event at the element.

    +
    Using the button element to define a command
    +

    A button element always defines a command.

    +
    +

    The Label, Access Key, Hidden State, and Action facets of the command are determined as for a elements (see the previous section).

    +
    +

    The Disabled State of the command is true if the element or one of its ancestors is inert, or if the element's disabled state is set, and false otherwise.

    +
    Using the input element to define a command
    +

    An input element whose type attribute is in one of the Submit Button, Reset Button, Image @@ -62504,7 +64567,9 @@ interface HTMLDetailsElement : HTMLElement { data-x="attr-input-type-radio">Radio Button, or Checkbox states defines a command.

    +
    +

    The Label of the command is determined as follows:

    @@ -62529,6 +64594,7 @@ interface HTMLDetailsElement : HTMLElement {
  • Otherwise, the Label is the empty string.

  • +

    Even though the value attribute on @@ -62538,53 +64604,74 @@ interface HTMLDetailsElement : HTMLElement { alt attribute is missing.

    +

    The Access Key of the command is the element's assigned access key, if any.

    +
    +

    The Hidden State of the command is true (hidden) if the element has a hidden attribute, and false otherwise.

    +
    +

    The Disabled State of the command is true if the element or one of its ancestors is inert, or if the element's disabled state is set, and false otherwise.

    +
    +

    The Action of the command is to fire a click event at the element.

    +
    Using the option element to define a command
    +

    An option element with an ancestor select element and either no value attribute or a value attribute that is not the empty string defines a command.

    +
    +

    The Label of the command is the value of the option element's label attribute, if there is one, or else the option element's descendant text content, with ASCII whitespace stripped and collapsed.

    +
    +

    The Access Key of the command is the element's assigned access key, if any.

    +
    +

    The Hidden State of the command is true (hidden) if the element has a hidden attribute, and false otherwise.

    +
    +

    The Disabled State of the command is true if the element is disabled, or if its nearest ancestor select element is disabled, or if it or one of its ancestors is inert, and false otherwise.

    +
    +

    If the option's nearest ancestor select element has a multiple attribute, the Action of the command is to toggle the option element. Otherwise, the Action is to pick the option element.

    +
    Using the accesskey attribute on a legend element to define a command
    +

    A legend element defines a command if all of the following are true:

    @@ -62598,17 +64685,24 @@ interface HTMLDetailsElement : HTMLElement { if it exists, is the legend element's accesskey delegatee.

    +
    +

    The Label of the command is the element's descendant text content.

    +
    +

    The Access Key of the command is the element's assigned access key.

    +
    +

    The Hidden State, Disabled State, and Action facets of the command are the same as the respective facets of the legend element's accesskey delegatee.

    +

    In this example, the legend element specifies an HTMLDetailsElement : HTMLElement {

    Using the accesskey attribute to define a command on other elements
    +

    An element that has an assigned access key defines a command.

    +

    If one of the earlier sections that define elements that define commands define that this element defines a command, then that section applies to this element, and this section does not. Otherwise, this section applies to that element.

    +

    The Label of the command depends on the element. If the element is a labeled control, the descendant text content of the first label element in tree order whose labeled control is @@ -62645,16 +64742,24 @@ interface HTMLDetailsElement : HTMLElement { terms, this is given by element.labels[0].textContent). Otherwise, the Label is the element's descendant text content.

    +
    +

    The Access Key of the command is the element's assigned access key.

    +
    +

    The Hidden State of the command is true (hidden) if the element has a hidden attribute, and false otherwise.

    +
    +

    The Disabled State of the command is true if the element or one of its ancestors is inert, and false otherwise.

    +
    +

    The Action of the command is to run the following steps:

    @@ -62663,6 +64768,7 @@ interface HTMLDetailsElement : HTMLElement {
  • Fire a click event at the element.
  • +
    @@ -62925,6 +65031,7 @@ interface HTMLDialogElement : HTMLElement {
    +

    The show() method steps are:

    @@ -62973,11 +65080,15 @@ interface HTMLDialogElement : HTMLElement {
  • Run the dialog focusing steps given this.

  • +
    +

    The showModal() method steps are to show a modal dialog given this and null.

    +
    +

    The close(returnValue) method steps are: @@ -62987,7 +65098,9 @@ interface HTMLDialogElement : HTMLElement {

  • Close the dialog this with returnValue and null.

  • +
    +

    The requestClose(returnValue) method steps are:

    @@ -62998,6 +65111,7 @@ interface HTMLDialogElement : HTMLElement {
  • Request to close the dialog this with returnValue and null.

  • +

    We use show/close as the verbs for dialog elements, as opposed to verb pairs that @@ -63035,14 +65149,18 @@ interface HTMLDialogElement : HTMLElement {

    +

    The returnValue IDL attribute, on getting, must return the last value to which it was set. On setting, it must be set to the new value. When the element is created, it must be set to the empty string.

    +
    +

    The closedBy getter steps are to return the keyword corresponding to the computed closed-by state given this.

    +

    @@ -63083,6 +65201,7 @@ interface HTMLDialogElement : HTMLElement {
    +

    The dialog HTML element insertion steps, given insertedNode, are:

    @@ -63094,7 +65213,9 @@ interface HTMLDialogElement : HTMLElement { and is connected, then run the dialog setup steps given insertedNode.

    +
    +

    The dialog HTML element removing steps, given removedNode and oldParent, are:

    @@ -63108,7 +65229,9 @@ interface HTMLDialogElement : HTMLElement {
  • Set is modal of removedNode to false.

  • +
    +

    The following attribute change steps, given element, localName, oldValue, value, and namespace are used for dialog elements:

    @@ -63136,7 +65259,9 @@ interface HTMLDialogElement : HTMLElement {
  • If value is not null and oldValue is null, then run the dialog setup steps given element.

  • +
    +

    To show a modal dialog given a dialog element subject and an Element or null source:

    @@ -63222,7 +65347,9 @@ interface HTMLDialogElement : HTMLElement {
  • Run the dialog focusing steps given subject.

  • +
    +

    To set the dialog close watcher, given a dialog element dialog:

    @@ -63258,7 +65385,9 @@ interface HTMLDialogElement : HTMLElement { +
    +

    The is valid command steps for dialog elements, given a command attribute command, are:

    @@ -63270,7 +65399,9 @@ interface HTMLDialogElement : HTMLElement {
  • Return false.

  • +
    +

    The command steps for dialog elements, given an element element, an element source, and a command attribute command, are:

    @@ -63297,6 +65428,7 @@ interface HTMLDialogElement : HTMLElement { not have an open attribute, then show a modal dialog given element and source.

    +

    The following buttons use commandfor to open and @@ -63321,6 +65453,7 @@ interface HTMLDialogElement : HTMLElement {

    +

    When a dialog element subject is to be closed, with null or a string result and an Element or null source, run these steps:

    @@ -63382,7 +65515,9 @@ interface HTMLDialogElement : HTMLElement { subject element to fire an event named close at subject.

    +
    +

    To request to close dialog element subject, given null or a string returnValue and null or an Element source:

    @@ -63412,9 +65547,11 @@ interface HTMLDialogElement : HTMLElement {
  • Set subject's enable close watcher for request close to false.

  • +
    +

    To queue a dialog toggle event task given a dialog element element, a string oldState, a string newState, and an Element or null source:

    @@ -63456,7 +65593,9 @@ interface HTMLDialogElement : HTMLElement { data-x="concept-task">task and old state set to oldState.

    +
    +

    To retrieve a dialog's computed closed-by state, given a dialog dialog: @@ -63476,7 +65615,9 @@ interface HTMLDialogElement : HTMLElement {

  • Return the state of dialog's closedby attribute.

  • +
    +

    The dialog focusing steps, given a dialog element subject, are as follows:

    @@ -63518,7 +65659,9 @@ interface HTMLDialogElement : HTMLElement {
  • Set topDocument's autofocus processed flag to true.

  • +
    +

    The dialog setup steps, given a dialog element subject, are as follows:

    @@ -63536,7 +65679,9 @@ interface HTMLDialogElement : HTMLElement {
  • Set the dialog close watcher with subject.

  • +
    +

    The dialog cleanup steps, given a dialog element subject, are as follows:

    @@ -63557,6 +65702,7 @@ interface HTMLDialogElement : HTMLElement { +

    Dialog light dismiss

    @@ -63565,6 +65711,7 @@ interface HTMLDialogElement : HTMLElement { data-x="attr-dialog-closedby-any-state">Any state will close the dialog element. This is in addition to how such dialogs respond to close requests.

    +

    To light dismiss open dialogs, given a PointerEvent event:

      @@ -63613,7 +65760,9 @@ interface HTMLDialogElement : HTMLElement {
    +
    +

    To run light dismiss activities, given a PointerEvent event:

    @@ -63622,11 +65771,13 @@ interface HTMLDialogElement : HTMLElement {
  • Run light dismiss open dialogs with event.

  • +

    Run light dismiss activities will be called by the Pointer Events spec when the user clicks or touches anywhere on the page.

    +

    To find the nearest clicked dialog, given a PointerEvent event:

    @@ -63662,6 +65813,7 @@ interface HTMLDialogElement : HTMLElement {
  • Return null.

  • +

    Scripting

    @@ -64038,21 +66190,28 @@ interface HTMLScriptElement : HTMLElement {
    +

    The crossOrigin IDL attribute must reflect the crossorigin content attribute, limited to only known values.

    +
    +

    The referrerPolicy IDL attribute must reflect the referrerpolicy content attribute, limited to only known values.

    +
    +

    The fetchPriority IDL attribute must reflect the fetchpriority content attribute, limited to only known values.

    +
    +

    The async getter steps are:

    @@ -64065,7 +66224,9 @@ interface HTMLScriptElement : HTMLElement {
  • Return false.

  • +
    +

    The async setter steps are:

      @@ -64078,6 +66239,7 @@ interface HTMLScriptElement : HTMLElement {
    1. Otherwise, remove this's async content attribute.

    +
    @@ -64103,12 +66265,17 @@ interface HTMLScriptElement : HTMLElement {
    +

    The text getter steps are to return this's child text content.

    +
    +

    The text setter steps are to string replace all with the given value within this.

    +
    +

    The static supports(type) method steps are:

    @@ -64127,10 +66294,11 @@ interface HTMLScriptElement : HTMLElement {
  • Return false.

  • +
    -

    The type argument has to exactly match these values; we do not +

    The type argument has to exactly match these values; we do not perform an ASCII case-insensitive match. This is different from how type content attribute values are treated, and how DOMTokenList's supports() method @@ -64357,6 +66525,7 @@ o............A....e speculation rules parse result. It is initially "uninitialized".

    +

    A script element has steps to run when the result is ready, which are a series of steps or null, initially null. To mark as ready a script element el given a result:

    @@ -64374,32 +66543,42 @@ o............A....e
  • Set el's delaying the load event to false.

  • +

    +

    A script element el is implicitly potentially render-blocking if el's type is "classic", el is parser-inserted, and el does not have an async or defer attribute.

    +
    +

    The cloning steps for script elements given node, copy, and subtree are to set copy's already started to node's already started.

    +
    +

    When an async attribute is added to a script element el, the user agent must set el's force async to false.

    +
    +

    Whenever a script element el's delaying the load event is true, the user agent must delay the load event of el's preparation-time document.

    +

    +

    The script HTML element post-connection steps, given insertedNode, are:

    @@ -64408,6 +66587,7 @@ o............A....e
  • Prepare the script element given insertedNode.

  • +

    The HTML element post-connection steps only run when the inserted element is @@ -64436,6 +66616,7 @@ document.body.append(script1, script2); script element">prepared.

    +

    The script HTML element removing steps given removedNode are:

    @@ -64456,7 +66637,9 @@ document.body.append(script1, script2); +
    +

    The script children changed steps given changedNode are:

    @@ -64466,6 +66649,7 @@ document.body.append(script1, script2);
  • Run the script HTML element post-connection steps, given changedNode.

  • +

    This has an interesting implication on the execution order of a script element @@ -64509,6 +66693,7 @@ document.body.append(script1, script2);

    +

    The following attribute change steps, given element, localName, oldValue, value, and namespace, are used for all script elements:

    @@ -64520,7 +66705,9 @@ document.body.append(script1, script2); element is connected, then run the script HTML element post-connection steps, given element.

    +
    +

    To prepare the script element given a script element el:

    @@ -65061,6 +67248,7 @@ document.body.append(script1, script2); +

    Each Document has a pending parsing-blocking script, which is a script element or null, initially null.

    @@ -65091,6 +67279,7 @@ document.body.append(script1, script2); loaded, because there's just a binary "are style sheets blocking scripts" state, things aren't defined in terms of which style sheets are blocking which scripts --> +

    To execute the script element given a script element el:

    @@ -65180,6 +67369,7 @@ document.body.append(script1, script2); true, then fire an event named load at el.

    +
    @@ -65479,8 +67669,8 @@ not-slash = %x0000-002E / %x0030-10FFFF

    The noscript element must contain only text, except that invoking the HTML fragment parsing algorithm with - the noscript element as the context - element and the text contents as the input must result in a list of nodes + the noscript element as the context + element and the text contents as the input must result in a list of nodes that consists only of link, style, and meta elements that would be conforming if they were children of the noscript element, and no parse errors.

    @@ -65503,6 +67693,7 @@ not-slash = %x0000-002E / %x0030-10FFFF error:

    +
    1. Remove every script element from the document.
    2. @@ -65519,6 +67710,7 @@ not-slash = %x0000-002E / %x0030-10FFFF
    +
    @@ -65745,6 +67937,7 @@ interface HTMLTemplateElement : HTMLElement {
    +

    Each template element has an associated DocumentFragment object that is its template contents. The template contents have no conformance requirements. When a template element @@ -65762,7 +67955,9 @@ interface HTMLTemplateElement : HTMLElement {

  • Set the template element's template contents to the newly created DocumentFragment object.

  • +
    +

    A Document doc's appropriate template contents owner document is the Document returned by the following algorithm:

    @@ -65802,7 +67997,9 @@ interface HTMLTemplateElement : HTMLElement {
  • Return doc.

  • +
    +

    The adopting steps (with node and oldDocument as parameters) for template elements are the following:

    @@ -65819,16 +68016,21 @@ interface HTMLTemplateElement : HTMLElement {
  • Adopt node's template contents (a DocumentFragment object) into doc.

  • +
    +

    The content getter steps are to return template's template contents, if the template contents is not a ShadowRoot node; otherwise null.

    +
    +

    The shadowRootMode IDL attribute must reflect the shadowrootmode content attribute, limited to only known values.

    +

    The shadowRootCustomElementRegistry IDL @@ -65836,6 +68038,7 @@ interface HTMLTemplateElement : HTMLElement {


    +

    The cloning steps for template elements given node, copy, and subtree are:

    @@ -65851,6 +68054,7 @@ interface HTMLTemplateElement : HTMLElement { data-x="concept-node-clone-parent">parent set to copy's template contents.

    +
    @@ -66022,6 +68226,7 @@ dictionary AssignedNodesOptions { references to the slottables, because this set is not directly accessible from script.

    +

    The assignedNodes(options) method steps are:

    @@ -66033,7 +68238,9 @@ dictionary AssignedNodesOptions {
  • Return the result of finding flattened slottables with this.

  • +
    +

    The assignedElements(options) method steps are:

    @@ -66046,7 +68253,9 @@ dictionary AssignedNodesOptions {
  • Return the result of finding flattened slottables with this, filtered to contain only Element nodes.

  • +
    +

    The assign(...nodes) method steps are:

    @@ -66077,6 +68286,7 @@ dictionary AssignedNodesOptions {
  • Run assign slottables for a tree for this's root.

  • +

    The canvas element

    @@ -66174,9 +68384,11 @@ callback BlobCallback = undefined (Blob? blob); effect on mouse interaction events.) UIEVENTS

    +

    An element whose nearest canvas element ancestor is being rendered and represents embedded content is an element that is being used as relevant canvas fallback content.

    +

    @@ -66191,16 +68403,20 @@ callback BlobCallback = undefined (Blob? blob); attribute defaults to 300, and the height attribute defaults to 150.

    +

    When setting the value of the width or height attribute, if the context mode of the canvas element is set to placeholder, the user agent must throw an "InvalidStateError" DOMException and leave the attribute's value unchanged.

    +
    +

    The natural dimensions of the canvas element when it represents embedded content are equal to the dimensions of the element's bitmap.

    +

    The user agent must use a square pixel density consisting of one pixel of image data per coordinate space unit for the bitmaps of a canvas and its rendering contexts.

    @@ -66253,6 +68469,7 @@ callback BlobCallback = undefined (Blob? blob); paint source whose width is the element's natural width, whose height is the element's natural height, and whose appearance is the element's bitmap.

    +

    Whenever the width and height content attributes are set, removed, changed, or redundantly set to the value they already have, then the user agent must perform the action @@ -66311,11 +68528,14 @@ callback BlobCallback = undefined (Blob? blob);

    Do nothing.

    +
    +

    The width and height IDL attributes must reflect the respective content attributes of the same name, with the same defaults.

    +
    @@ -66346,6 +68566,7 @@ callback BlobCallback = undefined (Blob? blob);
    +

    The getContext(contextId, options) method of the canvas element, when invoked, must run these steps: @@ -66498,6 +68719,7 @@ callback BlobCallback = undefined (Blob? blob); the graphics hardware's abilities and having no software fallback implementation.

    +

    @@ -66552,6 +68774,7 @@ callback BlobCallback = undefined (Blob? blob);
    +

    The toDataURL(type, quality) method, when invoked, must run these steps:

    @@ -66579,7 +68802,9 @@ callback BlobCallback = undefined (Blob? blob); +
    +

    The toBlob(callback, type, quality) method, when invoked, must run these steps:

    @@ -66621,7 +68846,9 @@ callback BlobCallback = undefined (Blob? blob); +
    +

    The transferControlToOffscreen() method, when invoked, must run these steps:

    @@ -66653,6 +68880,7 @@ callback BlobCallback = undefined (Blob? blob);
  • Return offscreenCanvas.

  • +
    @@ -66999,6 +69227,7 @@ interface Path2D {
    +

    The CanvasRenderingContext2D 2D rendering context represents a flat linear Cartesian surface whose origin (0,0) is at the top left corner, with the coordinate space having x values increasing when going right, and y values increasing when going @@ -67006,6 +69235,7 @@ interface Path2D { context's output bitmap in CSS pixels; similarly, the y-coordinate of the bottom-most edge is equal to the height of the rendering context's output bitmap in CSS pixels.

    +

    The size of the coordinate space does not necessarily represent the size of the actual bitmaps that the user agent will use internally or during rendering. On high-definition displays, for @@ -67030,6 +69260,7 @@ interface Path2D {


    +

    The 2D context creation algorithm, which is passed a target (a canvas element) and options, consists of running these steps:

    @@ -67056,9 +69287,11 @@ interface Path2D {
  • Return context.

  • +

    +

    When the user agent is to set bitmap dimensions to width and height, it must run these steps:

    @@ -67083,6 +69316,7 @@ interface Path2D { data-x="attr-canvas-height">height
    content attribute to the shortest possible string representing height as a valid non-negative integer.

    +

    Only one square appears to be drawn in the following example:

    @@ -67097,9 +69331,11 @@ context.fillRect(100,0,50,50); // only this square remains

    +

    The canvas attribute must return the value it was initialized to when the object was created.

    +
    @@ -67266,6 +69502,7 @@ context.fillRect(100,0,50,50); // only this square remains data-x="concept-canvas-color-type">color type indicates the data type of the color and alpha components of the pixels of the output bitmap.

    +

    To initialize a CanvasSettings output bitmap, given a CanvasSettings context and a CanvasRenderingContext2DSettings settings:

    @@ -67293,7 +69530,9 @@ context.fillRect(100,0,50,50); // only this square remains for="CanvasRenderingContext2DSettings">willReadFrequently"].

    +
    +

    The getContextAttributes() method steps are to return «[ "alpha" → @@ -67307,6 +69546,7 @@ context.fillRect(100,0,50,50); // only this square remains data-x="dom-CanvasRenderingContext2DSettings-willReadFrequently">willReadFrequently" → this's will read frequently ]».

    +
    The canvas state
    @@ -67379,16 +69619,23 @@ context.fillRect(100,0,50,50); // only this square remains
    +

    The save() method steps are to push a copy of the current drawing state onto the drawing state stack.

    +
    +

    The restore() method steps are to pop the top entry in the drawing state stack, and reset the drawing state it describes. If there is no saved state, then the method must do nothing.

    +
    +

    The reset() method steps are to reset the rendering context to its default state.

    +
    +

    To reset the rendering context to its default state:

      @@ -67401,10 +69648,13 @@ context.fillRect(100,0,50,50); // only this square remains
    1. Reset everything that drawing state consists of to their initial values.

    +
    +

    The isContextLost() method steps are to return this's context lost.

    +
    @@ -67489,11 +69739,13 @@ context.fillRect(100,0,50,50); // only this square remains

    Objects that implement the CanvasPathDrawingStyles interface have attributes and methods (defined in this section) that control how lines are treated by the object.

    +

    The lineWidth attribute gives the width of lines, in coordinate space units. On getting, it must return the current value. On setting, zero, negative, infinite, and NaN values must be ignored, leaving the value unchanged; other values must change the current value to the new value.

    +

    When the object implementing the CanvasPathDrawingStyles interface is created, the lineWidth attribute must initially have the value @@ -67506,8 +69758,10 @@ context.fillRect(100,0,50,50); // only this square remains UAs will place on the end of lines. The three valid values are "butt", "round", and "square".

    +

    On getting, it must return the current value. On setting, the current value must be changed to the new value.

    +

    When the object implementing the CanvasPathDrawingStyles interface is created, the lineCap attribute must initially have the value @@ -67520,8 +69774,10 @@ context.fillRect(100,0,50,50); // only this square remains UAs will place where two lines meet. The three valid values are "bevel", "round", and "miter".

    +

    On getting, it must return the current value. On setting, the current value must be changed to the new value.

    +

    When the object implementing the CanvasPathDrawingStyles interface is created, the lineJoin attribute must initially have the value @@ -67529,6 +69785,7 @@ context.fillRect(100,0,50,50); // only this square remains


    +

    When the lineJoin attribute has the value "miter", strokes use the miter limit ratio to decide how to render joins. The miter limit ratio can be explicitly set using the attribute. On getting, it must return the current value. On setting, zero, negative, infinite, and NaN values must be ignored, leaving the value unchanged; other values must change the current value to the new value.

    +
    @@ -67549,6 +69807,7 @@ context.fillRect(100,0,50,50); // only this square remains empty or consists of an even number of non-negative numbers. Initially, the dash list must be empty.

    +

    The setLineDash(segments) method, when invoked, must run these steps:

    @@ -67564,17 +69823,22 @@ context.fillRect(100,0,50,50); // only this square remains
  • Set the object's dash list to segments.

  • +
    +

    When the getLineDash() method is invoked, it must return a sequence whose values are the values of the object's dash list, in the same order.

    +
    +

    It is sometimes useful to change the "phase" of the dash pattern, e.g. to achieve a "marching ants" effect. The phase can be set using the lineDashOffset attribute. On getting, it must return the current value. On setting, infinite and NaN values must be ignored, leaving the value unchanged; other values must change the current value to the new value.

    +

    When the object implementing the CanvasPathDrawingStyles interface is created, the lineDashOffset attribute must initially have @@ -67582,6 +69846,7 @@ context.fillRect(100,0,50,50); // only this square remains


    +

    When a user agent is to trace a path, given an object style that implements the CanvasPathDrawingStyles interface, it must run the following algorithm. This algorithm returns a new path.

    @@ -67819,6 +70084,7 @@ context.fillRect(100,0,50,50); // only this square remains
  • Return the newly created path.

  • +
    @@ -67954,6 +70220,7 @@ transform. ack Shaun Morris. --> OffscreenCanvasRenderingContext2D objects, this is the associated OffscreenCanvas object.

    +

    Font resolution for the font style source object requires a font source. This is determined for a given object implementing CanvasTextDrawingStyles by the following steps: CSSFONTLOAD

    @@ -67980,6 +70247,7 @@ transform. ack Shaun Morris. --> +

    This is an example of font resolution with a regular canvas element with ID Notice that the font is only loaded inside the worker, and not in the document context.

    +

    The font IDL attribute, on setting, must be parsed as a CSS <'font'> value (but @@ -68031,6 +70300,7 @@ worker.postMessage(offscreenCanvas, [offscreenCanvas]); and with system fonts being computed to explicit values. If the new value is syntactically incorrect (including using property-independent style sheet syntax like 'inherit' or 'initial'), then it must be ignored, without assigning a new font value. CSS

    +

    Font family names must be interpreted in the context of the font style source object when the font is to be used; any fonts embedded using unknown font, falling back to another as described by the relevant CSS specifications. CSSFONTS CSSFONTLOAD

    +

    On getting, the font attribute must return the serialized form of the current font of the context (with no 'line-height' component). CSSOM

    +
    @@ -68073,19 +70345,23 @@ worker.postMessage(offscreenCanvas, [offscreenCanvas]); rendered), then the relative keywords must be interpreted relative to the normal-weight 10px sans-serif default.

    +

    The textAlign IDL attribute, on getting, must return the current value. On setting, the current value must be changed to the new value. When the object implementing the CanvasTextDrawingStyles interface is created, the textAlign attribute must initially have the value start.

    +
    +

    The textBaseline IDL attribute, on getting, must return the current value. On setting, the current value must be changed to the new value. When the object implementing the CanvasTextDrawingStyles interface is created, the textBaseline attribute must initially have the value alphabetic.

    +

    Objects that implement the CanvasTextDrawingStyles interface have an associated language value used to localize font @@ -68096,19 +70372,25 @@ worker.postMessage(offscreenCanvas, [offscreenCanvas]); data-x="concept-CanvasTextDrawingStyles-language">language must be "inherit".

    +

    The lang getter steps are to return this's language.

    +
    +

    The lang setter steps are to set this's language to the given value.

    +
    +

    The direction IDL attribute, on getting, must return the current value. On setting, the current value must be changed to the new value. When the object implementing the CanvasTextDrawingStyles interface is created, the direction attribute must initially have the value "inherit".

    +

    Objects that implement the CanvasTextDrawingStyles interface have attributes that control the spacing between letters and words. Such objects have associated something according to a CSS grammar">parsing "0px" as a CSS <length>.

    +

    The letterSpacing getter steps are to return the serialized form of this's letter spacing.

    +
    +

    The letterSpacing setter steps are:

      @@ -68135,12 +70420,16 @@ worker.postMessage(offscreenCanvas, [offscreenCanvas]); data-x="concept-CanvasTextDrawingStyles-letter-spacing">letter spacing to parsed.

    +
    +

    The wordSpacing getter steps are to return the serialized form of this's word spacing.

    +
    +

    The wordSpacing setter steps are:

      @@ -68152,28 +70441,36 @@ worker.postMessage(offscreenCanvas, [offscreenCanvas]);
    1. Set this's word spacing to parsed.

    +
    +

    The fontKerning IDL attribute, on getting, must return the current value. On setting, the current value must be changed to the new value. When the object implementing the CanvasTextDrawingStyles interface is created, the fontKerning attribute must initially have the value "auto".

    +
    +

    The fontStretch IDL attribute, on getting, must return the current value. On setting, the current value must be changed to the new value. When the object implementing the CanvasTextDrawingStyles interface is created, the fontStretch attribute must initially have the value "normal".

    +
    +

    The fontVariantCaps IDL attribute, on getting, must return the current value. On setting, the current value must be changed to the new value. When the object implementing the CanvasTextDrawingStyles interface is created, the fontVariantCaps attribute must initially have the value "normal".

    +
    +

    The textRendering IDL attribute, on getting, must return the current value. On setting, the current value must be changed to the new @@ -68181,6 +70478,7 @@ worker.postMessage(offscreenCanvas, [offscreenCanvas]); the textRendering attribute must initially have the value "auto".

    +

    The textAlign attribute's allowed keywords are as follows:

    @@ -68341,6 +70639,7 @@ worker.postMessage(offscreenCanvas, [offscreenCanvas]);

    Same as 'geometricPrecision' in SVG text-rendering property.

    +

    The text preparation algorithm is as follows. It takes as input a string text, a CanvasTextDrawingStyles object target, and an optional length maxWidth. It returns an array of glyph shapes, each positioned on a common coordinate @@ -68587,6 +70886,7 @@ worker.postMessage(offscreenCanvas, [offscreenCanvas]);

  • Return result, physical alignment, and the inline box.

  • +
    Building paths
    @@ -69045,6 +71345,7 @@ try { data-x="dom-context-2d-transformation">current transformation matrix before being added to the path.

    +

    The moveTo(x, y) method, when invoked, must run these steps:

    @@ -69053,7 +71354,9 @@ try {
  • Create a new subpath with the specified point as its first (and only) point.

  • +
    +

    When the user agent is to ensure there is a subpath for a coordinate (x, y) on a path, the user agent must check to see if the path has its need new subpath flag set. If it @@ -69061,13 +71364,16 @@ try { its first (and only) point, as if the moveTo() method had been called, and must then unset the path's need new subpath flag.

    +
    +

    The closePath() method, when invoked, must do nothing if the object's path has no subpaths. Otherwise, it must mark the last subpath as closed, create a new subpath whose first point is the same as the previous subpath's first point, and finally add this new subpath to the path.

    +

    If the last subpath had more than one point in its list of points, then this is equivalent to adding a straight line connecting the last point back to the first point of the last @@ -69078,6 +71384,7 @@ try {

    New points and the lines connecting them are added to subpaths using the methods described below. In all cases, the methods only modify the last subpath in the object's path.

    +

    The lineTo(x, y) method, when invoked, must run these steps:

    @@ -69091,7 +71398,9 @@ try { y) using a straight line, and then add the given point (x, y) to the subpath.

    +
    +

    The quadraticCurveTo(cpx, cpy, x, y) method, when invoked, must run these steps:

    @@ -69108,7 +71417,9 @@ try {
  • Add the given point (x, y) to the subpath.

  • +
    +

    The bezierCurveTo(cp1x, cp1y, cp2x, cp2y, x, y) method, when invoked, @@ -69126,9 +71437,11 @@ try {

  • Add the point (x, y) to the subpath.

  • +

    +

    The arcTo(x1, y1, x2, y2, radius) method, when invoked, must run these steps:

    @@ -69169,25 +71482,31 @@ try { point to the end tangent point by The Arc, adding the end tangent point to the subpath.

    +

    +

    The arc(x, y, radius, startAngle, endAngle, counterclockwise) method, when invoked, must run the ellipse method steps with this, x, y, radius, radius, 0, startAngle, endAngle, and counterclockwise.

    +

    This makes it equivalent to ellipse() - except that both radii are equal and rotation is 0.

    + except that both radii are equal and rotation is 0.

    +

    The ellipse(x, y, radiusX, radiusY, rotation, startAngle, endAngle, counterclockwise) method, when invoked, must run the ellipse method steps with this, x, y, radiusX, radiusY, rotation, startAngle, endAngle, and counterclockwise.

    +
    +

    The determine the point on an ellipse steps, given ellipse, and angle, are:

    @@ -69205,7 +71524,9 @@ try {
  • Return the point on chord that crosses ellipse's circumference.

  • +
    +

    The ellipse method steps, given canvasPath, x, y, radiusX, radiusY, rotation, startAngle, endAngle, and counterclockwise, are:

    @@ -69250,9 +71571,11 @@ try { data-x="dom-context-2d-closePath">closePath() method is appropriately invoked.

    +

    +

    The rect(x, y, w, h) method, when invoked, must run these steps:

    @@ -69270,7 +71593,9 @@ try {
  • Create a new subpath with the point (x, y) as the only point in the subpath.

  • +
    +

    The roundRect(x, y, w, h, radii) method steps are:

    @@ -69415,6 +71740,7 @@ try {
  • Create a new subpath with the point (x, y) as the only point in the subpath.

  • +

    This is designed to behave similarly to the CSS 'border-radius' property.

    @@ -69453,6 +71779,7 @@ try {
    +

    The Path2D(path) constructor, when invoked, must run these steps:

    @@ -69483,9 +71810,11 @@ try {
  • Return output.

  • +

    +

    The addPath(path, transform) method, when invoked on a Path2D object a, must run these steps:

    @@ -69515,6 +71844,7 @@ try {
  • Create a new subpath in a with (x, y) as the only point in the subpath.

  • +
    @@ -69599,6 +71929,7 @@ try {
    +

    The scale(x, y) method, when invoked, must run these steps:

    @@ -69610,7 +71941,9 @@ try { horizontal direction and the y argument represents the scale factor in the vertical direction. The factors are multiples.

    +
    +

    The rotate(angle) method, when invoked, must run these steps:

    @@ -69622,7 +71955,9 @@ try { transformation matrix. The angle argument represents a clockwise rotation angle expressed in radians.

    +
    +

    The translate(x, y) method, when invoked, must run these steps:

    @@ -69635,7 +71970,9 @@ try { the horizontal direction and the y argument represents the translation distance in the vertical direction. The arguments are in coordinate space units.

    +
    +

    The transform(a, b, c, d, e, f) method, when invoked, must run these @@ -69668,10 +72005,11 @@ try { +

    -

    The arguments a, b, c, d, +

    The arguments a, b, c, d, e, and f are sometimes called m11, m12, m21, m22, dx, and dy or m11, m21, m12, m22, dx, and dy. Care ought to be @@ -69681,15 +72019,18 @@ try {

    +

    The getTransform() method, when invoked, must return a newly created DOMMatrix representing a copy of the current transformation matrix matrix of the context.

    +

    This returned object is not live, so updating it will not affect the current transformation matrix, and updating the current transformation matrix will not affect an already returned DOMMatrix.

    +

    The setTransform(a, b, c, d, e, f) method, when invoked, must run these @@ -69720,7 +72061,9 @@ try { +

    +

    The setTransform(transform) method, when invoked, must run these steps:

    @@ -69736,14 +72079,17 @@ try {
  • Reset the current transformation matrix to matrix.

  • +
    +

    The resetTransform() method, when invoked, must reset the current transformation matrix to the identity matrix.

    +
    -
    +

    Given a matrix of the form created by the transform() and setTransform() methods, i.e.,

    @@ -69807,6 +72153,7 @@ try {

    The ImageBitmap interface can be created from a number of other image-representing types, including ImageData.

    +

    To check the usability of the image argument, where image is a CanvasImageSource object, run these steps:

    @@ -69852,6 +72199,7 @@ try {

    Return good.

    +

    When a CanvasImageSource object represents an HTMLOrSVGImageElement, the element's image must be used as the source image.

    @@ -69890,6 +72238,7 @@ try { pixel data must be used as the source image, and the source image's dimensions must be the object's [[display width]] and [[display height]].

    +

    An object image is not origin-clean if, switching on image's type:

    @@ -69907,6 +72256,7 @@ try {

    image's bitmap's origin-clean flag is false.

    +
    @@ -69978,6 +72328,7 @@ try { changes made to the object after the assignment do affect subsequent stroking or filling of shapes.

    +

    The fillStyle getter steps are:

    @@ -69990,7 +72341,9 @@ try {
  • Return this's fill style.

  • +
    +

    The fillStyle setter steps are:

      @@ -70022,7 +72375,9 @@ try {
    1. Set this's fill style to the given value.

    +
    +

    The strokeStyle getter steps are:

    @@ -70035,7 +72390,9 @@ try {
  • Return this's stroke style.

  • +
    +

    The strokeStyle setter steps are:

      @@ -70068,6 +72425,7 @@ try {
    1. Set this's stroke style to the given value.

    +
    @@ -70124,6 +72482,7 @@ try {
    +

    The addColorStop(offset, color) method on the CanvasGradient, when invoked, must run @@ -70156,7 +72515,9 @@ try { last stop added at each point to be ignored).

    +
    +

    The createLinearGradient(x0, y0, x1, y1) method takes four arguments that represent the start @@ -70173,7 +72534,9 @@ try {

    If x0 = x1 and y0 = y1, then the linear gradient must paint nothing.

    +
    +

    The createRadialGradient(x0, y0, r0, x1, y1, r1) method takes six @@ -70184,7 +72547,9 @@ try { "IndexSizeError" DOMException must be thrown. Otherwise, the method, when invoked, must return a radial CanvasGradient initialized with the two specified circles.

    +
    +

    Radial gradients must be rendered by following these steps:

      @@ -70208,6 +72573,7 @@ try { color at ω, but only painting on the parts of the bitmap that have not yet been painted on by earlier circles in this step for this rendering of the gradient.

    +

    This effectively creates a cone, touched by the two circles defined in the creation of the gradient, with the part of the cone before the start circle (0.0) using the color @@ -70217,6 +72583,7 @@ try {

    The resulting radial gradient must then be transformed as described by the current transformation matrix when rendering.

    +

    The createConicGradient(startAngle, x, y) method takes three arguments, the first argument, @@ -70237,6 +72604,7 @@ try { data-x="dom-canvasgradient-addColorStop">addColorStop(), with the color stop offsets interpreted as percentages.

    +

    Gradients must be painted only where the relevant stroking or filling effects requires that they be drawn.

    @@ -70274,6 +72642,7 @@ try {
    +

    The createPattern(image, repetition) method, when invoked, must run these steps:

    @@ -70306,10 +72675,12 @@ try {

    Modifying the image used when creating a CanvasPattern object after calling the createPattern() method must not affect the pattern(s) rendered by the CanvasPattern object.

    +

    Patterns have a transformation matrix, which controls how the pattern is used when it is painted. Initially, a pattern's transformation matrix must be the identity matrix.

    +

    The setTransform(transform) method, when invoked, must run these steps:

    @@ -70325,7 +72696,9 @@ try {
  • Reset the pattern's transformation matrix to matrix.

  • +
    +

    When a pattern is to be rendered within an area, the user agent must run the following steps to determine what is rendered:

    @@ -70366,6 +72739,7 @@ try {
  • The resulting bitmap is what is to be rendered, with the same origin and same scale.

  • +

    @@ -70381,17 +72755,19 @@ try {
    Drawing rectangles to the bitmap
    -

    Objects that implement the CanvasRect interface provide the following methods for +

    Objects that implement the CanvasRect interface provide the following methods for immediately drawing rectangles to the bitmap. The methods each take four arguments; the first two give the x and y coordinates of the top left of the rectangle, and the second two give the width w and height h of the rectangle, respectively.

    +

    The current transformation matrix must be applied to the following four coordinates, which form the path that must then be closed to get the specified rectangle: (x, y), (x+w, y), (x+w, y+h), (x, y+h).

    +

    Shapes are painted without affecting the current default path, and are subject to the clipping region, and, with the exception of +

    The clearRect(x, y, w, h) method, when invoked, must run these steps:

    @@ -70434,10 +72811,12 @@ try {
  • Clear the pixels in pixels to a transparent black, erasing any previous image.

  • +

    If either height or width are zero, this method has no effect, since the set of pixels would be empty.

    +

    The fillRect(x, y, w, h) method, when invoked, must run these steps:

    @@ -70450,7 +72829,9 @@ try {
  • Paint the specified rectangular area using this's fill style.

  • +
    +

    The strokeRect(x, y, w, h) method, when invoked, must run these steps:

    @@ -70477,6 +72858,7 @@ try { data-x="">x+w, y), (x+w, y+h), and (x, y+h), connected to each other in that order by straight lines.

    +
    @@ -70522,6 +72904,7 @@ try {

    Objects that implement the CanvasText interface provide the following methods for rendering text.

    +

    The fillText(text, x, y, maxWidth) and .

    +
    +

    The CanvasText interface, and then using the returned inline box return a new TextMetrics object with members behaving as described in the following list: CSS

    +
    @@ -70772,14 +73158,18 @@ try {
    +

    The beginPath() method steps are to empty the list of subpaths in this's current default path so that it once again has zero subpaths.

    +
    +

    Where the following method definitions use the term intended path for a Path2D-or-null path, it means path itself if it is a Path2D object, or the current default path otherwise.

    +

    When the intended path is a Path2D object, the coordinates and lines of its subpaths must be transformed according to the current default path when it is constructed, so applying it when it is painted as well would result in a double transformation.)

    +

    The fill(fillRule) method steps are to run the fill steps given this, null, and fillRule.

    +
    +

    The fill(path, fillRule) method steps are to run the fill steps given this, path, and fillRule.

    +
    +

    The fill steps, given a CanvasDrawPath context, a Path2D-or-null path, and a fill rule fillRule, are to fill all the subpaths of the intended path for path, using context's fill style, and using the fill rule indicated by fillRule. Open subpaths must be implicitly closed when being filled (without affecting the actual subpaths).

    +
    +

    The stroke() method steps are to run the stroke steps given this and null.

    +
    +

    The stroke(path) method steps are to run the stroke steps given this and path.

    +
    +

    The stroke steps, given a CanvasDrawPath context and a Path2D-or-null path, are to trace the intended path for path, using context's line styles as set by @@ -70821,6 +73222,7 @@ try { context's stroke style, using the nonzero winding rule.

    +

    As a result of how the algorithm to trace a path is defined, overlapping parts of the paths in one stroke operation are treated as if their union was what was @@ -70838,15 +73240,20 @@ try {


    +

    The clip(fillRule) method steps are to run the clip steps given this, null, and fillRule.

    +
    +

    The clip(path, fillRule) method steps are to run the clip steps given this, path, and fillRule.

    +
    +

    The clip steps, given a CanvasDrawPath context, a Path2D-or-null path, and a fill rule fillRule, are to create a new clipping region by calculating the intersection of @@ -70855,6 +73262,7 @@ try { fillRule. Open subpaths must be implicitly closed when computing the clipping region, without affecting the actual subpaths. The new clipping region replaces the current clipping region.

    +

    When the context is initialized, its current clipping region must be set to the largest infinite surface (i.e. by default, no clipping occurs).

    @@ -70868,18 +73276,23 @@ try {
    +

    The isPointInPath(x, y, fillRule) method steps are to return the result of the is point in path steps given this, null, x, y, and fillRule.

    +
    +

    The isPointInPath(path, x, y, fillRule) method steps are to return the result of the is point in path steps given this, path, x, y, and fillRule.

    +
    +

    The is point in path steps, given a CanvasDrawPath context, a Path2D-or-null path, two numbers x and y, and a fill rule fillRule, are:

    @@ -70896,19 +73309,25 @@ try {
  • Return false.

  • +

    +

    The isPointInStroke(x, y) method steps are to return the result of the is point in stroke steps given this, null, x, and y.

    +
    +

    The isPointInStroke(path, x, y) method steps are to return the result of the is point in stroke steps given this, path, x, and y.

    +
    +

    The is point in stroke steps, given a CanvasDrawPath context, a Path2D-or-null path, and two numbers x and y, are:

    @@ -70926,6 +73345,7 @@ try {
  • Return false.

  • +

    @@ -71030,20 +73450,25 @@ try {

    Objects that implement the CanvasUserInterface interface provide the following methods to draw focus rings.

    +

    The drawFocusIfNeeded(element) method steps are to draw focus if needed given this, element, and this's current default path.

    +
    +

    The drawFocusIfNeeded(path, element) method steps are to draw focus if needed given this, element, and path.

    +
    +

    To draw focus if needed, given an object implementing CanvasUserInterface context, an element element, and a path path:

    @@ -71078,6 +73503,7 @@ try { intended path. User agents may wait until the next time the event loop reaches its update the rendering step to optionally inform the user.

    +

    User agents should not implicitly close open subpaths in the intended path when drawing the focus ring.

    @@ -71106,7 +73532,7 @@ try {

    This method can be invoked with three different sets of arguments:

    -
      +
      • drawImage(image, dx, dy)
      • drawImage(image, dx, dy, dw, dh)
      • drawImage(image, sx, sy, sw, sh, dx, dy, dw, dh) @@ -71135,6 +73561,7 @@ try {
        +

        When the drawImage() method is invoked, the user agent must run these steps:

        @@ -71237,6 +73664,7 @@ try { CanvasRenderingContext2D's origin-clean flag to false.

      • +
    @@ -71292,6 +73720,7 @@ try {

    Objects that implement the CanvasImageData interface provide the following methods for reading and writing pixel data to the bitmap.

    +

    The createImageData(sw, sh, settings) method steps are:

    @@ -71313,7 +73742,9 @@ try {
  • Return newImageData.

  • +
    +

    The createImageData(imageData) method steps are:

    @@ -71337,7 +73768,9 @@ try {
  • Return newImageData.

  • +
    +

    The getImageData(sx, sy, sw, sh, settings) method steps are:

    @@ -71375,8 +73808,10 @@ try {
  • Return imageData.

  • +
    +

    The putImageData(imageData, dx, dy) method steps are to @@ -71386,7 +73821,9 @@ try { dx, dy, 0, 0, imageData's width, and imageData's height.

    +
    +

    The putImageData(imageData, dx, dy, dirtyX, dirtyY, @@ -71396,7 +73833,9 @@ try { imageData, this's output bitmap, dx, dy, dirtyX, dirtyY, dirtyWidth, and dirtyHeight.

    +
    +

    To put pixels from an ImageData onto a bitmap, given an ImageData imageData, an output bitmap bitmap, and numbers dx, dy, @@ -71458,6 +73897,7 @@ try { to the color space of bitmap using 'relative-colorimetric' rendering intent.

    +

    Due to the lossy nature of converting between color spaces and converting to and from premultiplied alpha color values, pixels @@ -71633,10 +74073,13 @@ console.log(pixels.data[2]); The value ranges from 0.0 (fully transparent) to 1.0 (no additional transparency). It must initially have the value 1.0.

    +

    The globalAlpha getter steps are to return this's global alpha.

    +
    +

    The globalAlpha setter steps are:

      @@ -71646,6 +74089,7 @@ console.log(pixels.data[2]);
    1. Otherwise, set this's global alpha to the given value.

    +

    The current compositing and blending operator value controls how shapes and images are drawn onto the output bitmap, once they have had the applied. Initially, it must be set to "source-over".

    +

    The globalCompositeOperation getter steps are to return this's current compositing and blending operator.

    +
    +

    The globalCompositeOperation setter steps are:

    @@ -71670,6 +74117,7 @@ console.log(pixels.data[2]);
  • Otherwise, set this's current compositing and blending operator to the given value.

  • +
    @@ -71704,17 +74152,21 @@ console.log(pixels.data[2]);

    Objects that implement the CanvasImageSmoothing interface have attributes that control how image smoothing is performed.

    +

    The imageSmoothingEnabled attribute, on getting, must return the last value it was set to. On setting, it must be set to the new value. When the object implementing the CanvasImageSmoothing interface is created, the attribute must be set to true.

    +
    +

    The imageSmoothingQuality attribute, on getting, must return the last value it was set to. On setting, it must be set to the new value. When the object implementing the CanvasImageSmoothing interface is created, the attribute must be set to "low".

    +
    @@ -71759,13 +74211,16 @@ console.log(pixels.data[2]); data-x="concept-CanvasShadowStyles-shadow-color">shadow color, which is a CSS color. Initially, it must be transparent black.

    +

    The shadowColor getter steps are to return the serialization of this's shadow color with HTML-compatible serialization requested.

    +
    +

    The shadowColor setter steps are:

      @@ -71781,6 +74236,7 @@ console.log(pixels.data[2]);
    1. Set this's shadow color to parsedValue.

    +

    The shadowOffsetX and When the context is created, the shadow offset attributes must initially have the value 0.

    +

    On getting, they must return their current value. On setting, the attribute being set must be set to the new value, except if the value is infinite or NaN, in which case the new value must be ignored.

    +

    The shadowBlur attribute specifies the level of the @@ -71804,16 +74262,21 @@ console.log(pixels.data[2]);

    When the context is created, the shadowBlur attribute must initially have the value 0.

    +

    On getting, the attribute must return its current value. On setting, the attribute must be set to the new value, except if the value is negative, infinite or NaN, in which case the new value must be ignored.

    +
    +

    Shadows are only drawn if the opacity component of the alpha component of the shadow color is nonzero and either the shadowBlur is nonzero, or the shadowOffsetX is nonzero, or the shadowOffsetY is nonzero.

    +
    +

    When shadows are drawn, they must be rendered as follows:

      @@ -71854,6 +74317,7 @@ console.log(pixels.data[2]);
    1. The shadow is in the bitmap B, and is rendered as part of the drawing model described below.

    +
    @@ -71889,9 +74353,12 @@ console.log(pixels.data[2]); data-x="concept-canvas-current-filter">current filter is the string "none" filters will be disabled for the context.

    +

    The filter getter steps are to return this's current filter.

    +
    +

    The filter setter steps are:

      @@ -71909,10 +74376,11 @@ console.log(pixels.data[2]);
    1. Set this's current filter to the given value.

    +
    -

    Though context.Though context.filter = "none" will disable filters for the context, context.filter = "", Drawing model +

    When a shape or image is painted, user agents must follow these steps, in the order given (or act as if they do):

    @@ -72014,6 +74483,7 @@ console.log(pixels.data[2]); output bitmap using the current compositing and blending operator.

    +

    When compositing onto the output bitmap, pixels that would fall outside of the output bitmap must be discarded.

    @@ -72230,9 +74700,11 @@ dictionary ImageBitmapRenderingContextSettings {
    +

    The canvas attribute must return the value it was initialized to when the object was created.

    +

    An ImageBitmapRenderingContext object has an output bitmap, which is a @@ -72250,6 +74722,7 @@ dictionary ImageBitmapRenderingContextSettings { context's output bitmap is a default transparent bitmap.

    +

    An ImageBitmapRenderingContext object also has an alpha flag, which can be set to true or false. When an ImageBitmapRenderingContext object has its ImageBitmapRenderingContextSettings { output bitmap is used as the contents of the canvas element to which the context is bound. COMPOSITE

    +

    The step of compositing over an opaque black bitmap ought to be elided whenever equivalent results can be obtained more efficiently by other means.


    +

    When a user agent is required to set an ImageBitmapRenderingContext's output bitmap, with a context argument that is an ImageBitmapRenderingContext object and an optional argument bitmap that @@ -72320,9 +74795,11 @@ dictionary ImageBitmapRenderingContextSettings { +


    +

    The ImageBitmapRenderingContext creation algorithm, which is passed a target and options, consists of running these steps:

    @@ -72358,9 +74835,11 @@ dictionary ImageBitmapRenderingContextSettings {
  • Return context.

  • +

    +

    The transferFromImageBitmap(bitmap) method, when invoked, must run these steps:

    @@ -72389,6 +74868,7 @@ dictionary ImageBitmapRenderingContextSettings {
  • Unset bitmap's bitmap data.

  • +
    @@ -72504,6 +74984,7 @@ interface OffscreenCanvas : EventTarget { data-x="offscreencanvas-context-detached">detached by algorithms defined in this specification.

    +

    The new OffscreenCanvas(width, height) constructor steps are:

    @@ -72550,7 +75031,9 @@ interface OffscreenCanvas : EventTarget { +
    +

    OffscreenCanvas objects are transferable. Their transfer steps, given value and dataHolder, are as follows:

    @@ -72582,7 +75065,9 @@ interface OffscreenCanvas : EventTarget { value's placeholder canvas element, if value has one, or null if it does not.

    +
    +

    Their transfer-receiving steps, given dataHolder and value, are:

    @@ -72601,9 +75086,11 @@ interface OffscreenCanvas : EventTarget { dataHolder.[[PlaceholderCanvas]] (while maintaining the weak reference semantics).

    +

    +

    The getContext(contextId, options) method of an OffscreenCanvas object, when invoked, @@ -72737,6 +75224,7 @@ interface OffscreenCanvas : EventTarget { +


    @@ -72761,6 +75249,7 @@ interface OffscreenCanvas : EventTarget {
    +

    If either the width or height attributes of @@ -72771,6 +75260,7 @@ interface OffscreenCanvas : EventTarget { data-x="offscreencanvas-bitmap">bitmap to the new values of the width and height attributes.

    +

    The resizing behavior for "webgl" and "webgl2" contexts is defined in the WebGL @@ -72815,6 +75305,7 @@ interface OffscreenCanvas : EventTarget {

    +

    The convertToBlob(options) method steps are:

    @@ -72869,7 +75360,9 @@ interface OffscreenCanvas : EventTarget {
  • Return result.

  • +
    +

    The transferToImageBitmap() method, when invoked, must run the following steps:

    @@ -72903,6 +75396,7 @@ interface OffscreenCanvas : EventTarget {
  • Return image.

  • +

    The following are the event handlers (and their corresponding event handler event types) that must be supported, @@ -72965,6 +75459,7 @@ interface OffscreenCanvasRenderingContext2D {

    +

    The offscreen 2D context creation algorithm, which is passed a target (an OffscreenCanvas object) and optionally some arguments, consists of running the following steps:

    @@ -72998,6 +75493,7 @@ interface OffscreenCanvasRenderingContext2D {
  • Return context.

  • +

    Implementations are encouraged to short-circuit the graphics update steps of the window event loop for the purposes of updating the contents of a OffscreenCanvasRenderingContext2D { case toDataURL() or toBlob() are called on it.

    +

    The canvas attribute, on getting, must return this OffscreenCanvasRenderingContext2D's associated OffscreenCanvas object. +

    @@ -73058,6 +75556,7 @@ interface OffscreenCanvasRenderingContext2D {
    +

    When a user agent is to create a serialization of the bitmap as a file, given a type and an optional quality, it must create an image file in the format given by type. If an @@ -73119,6 +75618,7 @@ interface OffscreenCanvasRenderingContext2D {

    The use of type-testing here, instead of simply declaring quality as a Web IDL double, is a historical artifact.

    +

    Different implementations can have slightly different interpretations of "quality". When the quality is not specified, an implementation-specific default is used that @@ -74072,10 +76572,12 @@ document.body.append(parent);


    +

    An autonomous custom element is called a form-associated custom element if the element is associated with a custom element definition whose form-associated field is set to true.

    +

    The name attribute represents the form-associated custom element's name. The disabled attribute is @@ -74092,17 +76594,22 @@ document.body.append(parent); non-editable in some appropriate fashion, similar to the behavior for the readonly attribute on built-in form controls.

    +

    Constraint validation: If the readonly attribute is specified on a form-associated custom element, the element is barred from constraint validation.

    +
    +

    The reset algorithm for form-associated custom elements is to enqueue a custom element callback reaction with the element, callback name "formResetCallback", and « ».

    +

    +

    A string name is a valid custom element name if all of the following are true:

    @@ -74156,6 +76663,7 @@ document.body.append(parent); SVG 2 and MathML. SVG MATHML

    +

    Apart from these restrictions, a large variety of names is allowed, to give maximum flexibility for use cases like <math-α> or Controls attachShadow(). +

    To look up a custom element definition, given null or a CustomElementRegistry object registry, string-or-null namespace, string localName, and string-or-null is, perform the @@ -74244,6 +76753,7 @@ document.body.append(parent);

  • Return null.

  • +
    @@ -74255,6 +76765,7 @@ document.body.append(parent); window agent">active custom element constructor map, which is a map of constructors to CustomElementRegistry objects.

    +

    The Window customElements getter steps are:

    @@ -74273,8 +76784,9 @@ document.body.append(parent); Document's custom element registry.

    +
    -
    [Exposed=Window]
    +  
    [Exposed=Window]
     interface CustomElementRegistry {
       constructor();
     
    @@ -74314,6 +76826,7 @@ dictionary ElementDefinitionOptions {
       element names to promises. It is used to implement the whenDefined() method.

    +

    To look up a custom element registry, given a Node object node:

    @@ -74329,6 +76842,7 @@ dictionary ElementDefinitionOptions {
  • Return null.

  • +
    @@ -74384,9 +76898,11 @@ dictionary ElementDefinitionOptions { CustomElementRegistry object. +

    The new CustomElementRegistry() constructor steps are to set this's is scoped to true.

    +

    Element definition is a process of adding a custom element definition to the CustomElementRegistry. This is accomplished by the ElementDefinitionOptions {

    +

    The define(name, constructor, options) method steps are:

    @@ -74590,7 +77107,9 @@ dictionary ElementDefinitionOptions { +
    +

    To upgrade particular elements within a document given a CustomElementRegistry object registry, a Document object document, a custom element definition definition, a string @@ -74611,7 +77130,9 @@ dictionary ElementDefinitionOptions { +

    +

    The get(name) method steps are:

    @@ -74623,7 +77144,9 @@ dictionary ElementDefinitionOptions {
  • Return undefined.

  • +
    +

    The getName(constructor) method steps are:

    @@ -74637,7 +77160,9 @@ dictionary ElementDefinitionOptions {
  • Return null.

  • +
    +

    The whenDefined(name) method steps are:

    @@ -74661,6 +77186,7 @@ dictionary ElementDefinitionOptions {
  • Return this's when-defined promise map[name].

  • +
    @@ -74691,6 +77217,7 @@ fetch(articleURL)
    +

    The upgrade(root) method steps are:

    @@ -74703,6 +77230,7 @@ fetch(articleURL)
  • For each candidate of candidates, try to upgrade candidate.

  • +
    @@ -74725,6 +77253,7 @@ console.assert(el instanceof SpiderMan); // upgraded!
    +

    The initialize(root) method steps are:

    @@ -74762,6 +77291,7 @@ console.assert(el instanceof SpiderMan); // upgraded!
    +

    Once the custom element registry of a node is initialized to a CustomElementRegistry object, it intentionally cannot be changed any further. This @@ -74770,6 +77300,7 @@ console.assert(el instanceof SpiderMan); // upgraded!

    Upgrades

    +

    To upgrade an element, given as input a custom element definition definition and an element element, run the following steps:

    @@ -74952,7 +77483,9 @@ customElements.define("x-foo", class extends HTMLElement {
  • Set element's custom element state to "custom".

  • +
    +

    To try to upgrade an element given an element element:

    @@ -74967,11 +77500,13 @@ customElements.define("x-foo", class extends HTMLElement {
  • If definition is not null, then enqueue a custom element upgrade reaction given element and definition.

  • +

    Custom element reactions

    +

    A custom element possesses the ability to respond to certain occurrences by running author code:

    @@ -75024,6 +77559,7 @@ customElements.define("x-foo", class extends HTMLElement {

    We call these reactions collectively custom element reactions.

    +

    The way in which custom element reactions are invoked is done with special care, to avoid running author code during the middle of delicate @@ -75080,6 +77616,7 @@ customElements.define("x-foo", class extends HTMLElement {

    A custom element reactions stack consists of a stack of element queues. Zooming in on a particular queue, we see that it contains a number of elements (in our example, <x-a>, then <x-b>, then <x-c>). Any particular element in the queue then has a custom element reaction queue. Zooming in on the custom element reaction queue, we see that it contains a variety of queued-up reactions (in our example, upgrade, then attribute changed, then another attribute changed, then connected).

    +

    To enqueue an element on the appropriate element queue, given an element element, run the following steps:

    @@ -75117,7 +77654,9 @@ customElements.define("x-foo", class extends HTMLElement {
  • Otherwise, add element to element's relevant agent's current element queue.

  • +
    +

    To enqueue a custom element callback reaction, given a custom element element, a callback name callbackName, and a list of arguments args, run the following steps:

    @@ -75181,7 +77720,9 @@ customElements.define("x-foo", class extends HTMLElement {
  • Enqueue an element on the appropriate element queue given element.

  • +
    +

    To enqueue a custom element upgrade reaction, given an element element and custom element definition definition, run the following steps:

    @@ -75194,7 +77735,9 @@ customElements.define("x-foo", class extends HTMLElement {
  • Enqueue an element on the appropriate element queue given element.

  • +
    +

    To invoke custom element reactions in an element queue queue, run the following steps:

    @@ -75245,6 +77788,7 @@ customElements.define("x-foo", class extends HTMLElement { +

    @@ -75259,6 +77803,7 @@ customElements.define("x-foo", class extends HTMLElement { arguments, and must not appear on anything other than an operation, attribute, setter, or deleter. Additionally, it must not appear on readonly attributes.

    +

    Operations, attributes, setters, or deleters annotated with the [CEReactions] extended attribute must run the following steps in place of the ones specified in their description:

    @@ -75282,6 +77827,7 @@ customElements.define("x-foo", class extends HTMLElement {
  • If a value value was returned from the original steps, return value.

  • +

    The intent behind this extended attribute is somewhat subtle. One way of accomplishing its @@ -75339,6 +77885,7 @@ customElements.define("x-foo", class extends HTMLElement {

    Each HTMLElement has an attached internals (null or an ElementInternals object), initially null.

    +

    The attachInternals() method steps are:

    @@ -75374,6 +77921,7 @@ customElements.define("x-foo", class extends HTMLElement {
  • Return this's attached internals.

  • +
    The ElementInternals interface
    @@ -75437,6 +77985,7 @@ dictionary ValidityStateFlags {
    +

    The shadowRoot getter steps are:

    @@ -75455,6 +78004,7 @@ dictionary ValidityStateFlags {
  • Return shadow.

  • +
    Form-associated custom elements
    @@ -75577,6 +78127,7 @@ dictionary ValidityStateFlags {
    +

    The setFormValue(value, state) method steps are:

    @@ -75604,6 +78155,7 @@ dictionary ValidityStateFlags {
  • Otherwise, set element's state to state.

  • +

    @@ -75621,6 +78173,7 @@ dictionary ValidityStateFlags {

    Each form-associated custom element has a validation anchor element. It is null initially.

    +

    The setValidity(flags, message, anchor) method steps are:

    @@ -75656,7 +78209,9 @@ dictionary ValidityStateFlags {
  • Set element's validation anchor to anchor.

  • +
    +

    The validationMessage getter steps are:

    @@ -75671,7 +78226,9 @@ dictionary ValidityStateFlags {
  • Return element's validation message.

  • +
    +

    The entry construction algorithm for a form-associated custom element, given an element element and an entry list entry list, consists of the following steps:

    @@ -75701,6 +78258,7 @@ dictionary ValidityStateFlags { value and the submission value, and append it to entry list.

    +
    @@ -75788,10 +78346,12 @@ interface CustomStateSet { setlike<DOMString>; };
    +

    The states getter steps are to return this's target element's states set.

    +
    @@ -76178,6 +78738,7 @@ contradict people?

    Disabled elements

    +

    An element is said to be actually disabled if it is one of the following:

    @@ -76199,6 +78760,7 @@ contradict people?
  • a form-associated custom element that is disabled
  • +

    This definition is used to determine what elements are focusable and which elements match the :enabled and @@ -76377,6 +78939,7 @@ contradict people? element is being activated by the user.

    +

    To determine whether a particular element is being activated for the purposes of defining the :active pseudo-class only, an HTML user agent must use the first relevant entry in the @@ -76407,17 +78970,22 @@ contradict people?

    If the element is being actively pointed at

    The element is being activated.

    +
    +

    An element is said to be in a formal activation state between the time the user begins to indicate an intent to trigger the element's activation behavior and either the time the user stops indicating an intent to trigger the element's activation behavior, or the time the element's activation behavior has finished running, which ever comes first.

    +
    +

    An element is said to be being actively pointed at while the user indicates the element using a pointing device while that pointing device is in the "down" state (e.g. for a mouse, between the time the mouse button is pressed and the time it is released; for a finger in a multitouch environment, while the finger is touching the display surface).

    +

    Per the definition in Selectors, :active also matches flat tree ancestors of @@ -76480,6 +79048,7 @@ Demos:

    :focus
    +

    For the purposes of the CSS :focus pseudo-class, an element has the focus when:

    @@ -76497,14 +79066,17 @@ Demos: +
    :target
    +

    For the purposes of the CSS :target pseudo-class, the Document's target elements are a list containing the Document's target element, if it is not null, or containing no elements, if it is. SELECTORS

    +
    :popover-open
    @@ -76784,7 +79356,7 @@ Demos:
    Custom state pseudo-class
    -

    The :state(identifier) pseudo-class must +

    The :state(identifier) pseudo-class must match all custom elements whose states set's set entries contains identifier.

    @@ -76794,8 +79366,8 @@ Demos: h1, h2, h3, h4, h5, and h6 elements.

    -
    :heading(integer#)
    -

    The :heading(integer#) +

    :heading(integer#)
    +

    The :heading(integer#) pseudo-class must match all h1, h2, h3, h4, h5, and h6 elements that have a heading level of integer. CSSSYNTAX CSSVALUES

    @@ -77407,11 +79979,13 @@ Demos: is an absolute URL, and all of which are defined to use the same vocabulary. The attribute's value must have at least one token.

    +

    The item types of an item are the tokens obtained by splitting the element's itemtype attribute's value on ASCII whitespace. If the itemtype attribute is missing or parsing it in this way finds no tokens, the item is said to have no item types.

    +

    The item types must all be types defined in applicable specifications and must all be defined to use the same @@ -77437,6 +80011,7 @@ Demos:


    +

    An item is said to be a typed item when either it has an item type, or it is the value of a item for which it is a property's value.

    +

    @@ -77458,12 +80034,14 @@ Demos:

    The itemid attribute, if specified, must have a value that is a valid URL potentially surrounded by spaces.

    +

    The global identifier of an item is the value of its element's itemid attribute, if it has one, parsed relative to the node document of the element on which the attribute is specified. If the itemid attribute is missing or if parsing it returns failure, it is said to have no global identifier.

    +

    The itemid attribute must not be specified on elements that do not have both an itemscope attribute and an +

    The property names of an element are the tokens that the element's itemprop attribute is found to contain when its value is split on ASCII whitespace, with the order preserved but with duplicates removed (leaving only the first occurrence of each name).

    +

    Within an item, the properties are unordered with respect to each other, except for properties with the same name, which are ordered in the order they are @@ -77693,6 +80273,7 @@ Demos:

    Values

    +

    The property value of a name-value pair added by an element with an itemprop attribute is as given for the first matching case in the following list:

    @@ -77774,10 +80355,13 @@ Demos:

    The value is the element's descendant text content.

    +
    +

    The URL property elements are the a, area, audio, embed, iframe, img, link, object, source, track, and video elements.

    +

    If a property's value, as defined by the property's definition, is an absolute URL, the property must be specified using a Associating names with items +

    To find the properties of an item defined by the element root, the user agent must run the following steps. These steps are also used to flag microdata errors.

    @@ -77843,14 +80428,17 @@ Demos:
  • Return results.

  • +

    A document must not contain any items for which the algorithm to find the properties of an item finds any microdata errors.

    +

    An item is a top-level microdata item if its element does not have an itemprop attribute.

    +
    +

    A string is a valid vevent duration string if it matches the following pattern:

      @@ -79924,10 +82529,12 @@ END:VCARD
    +
    Conversion to iCalendar
    +

    Given a list of nodes nodes in a Document, a user agent must run the following algorithm to extract any vEvent data represented by those nodes:

    @@ -80020,7 +82627,9 @@ END:VCARD
  • Add an iCalendar line with the type "END" and the value "VCALENDAR" to output.

  • +
    +

    When the above algorithm says that the user agent is to add an iCalendar line consisting of a type type, a value value, and optionally an annotation, to a string output, it must run the following steps:

    @@ -80088,6 +82697,7 @@ END:VCARD
  • Append a U+000A LINE FEED character (LF) to output.

  • +

    This algorithm can generate invalid iCalendar output, if the input does not conform to the rules described for the

    JSON

    +

    Given a list of nodes nodes in a Document, a user agent must run the following algorithm to extract the microdata from those nodes into a JSON form:

    @@ -80266,11 +82877,13 @@ END:VCARD sequence), and with a lowercase "e" used, when appropriate, in the representation of any numbers. JSON

    +

    This algorithm returns an object with a single property that is an array, instead of just returning an array, so that it is possible to extend the algorithm in the future if necessary.

    +

    When the user agent is to get the object for an item item, optionally with a list of elements memory, it must run the following substeps:

    @@ -80323,6 +82936,7 @@ END:VCARD
  • Return result.

  • +
    @@ -80447,10 +83061,12 @@ END:VCARD and fragment navigation. +

    The attribute's missing value default is the Not Hidden state, and its invalid value default and empty value default are both the Hidden state.

    +

    When an element has the hidden attribute in the Hidden state, it indicates that the element is not yet, or @@ -80589,6 +83205,7 @@ END:VCARD

    +

    The hidden getter steps are:

    @@ -80602,7 +83219,9 @@ END:VCARD
  • Return false.

  • +
    +

    The hidden setter steps are:

      @@ -80629,11 +83248,13 @@ END:VCARD
    1. Otherwise, set the hidden attribute to the empty string.

    +

    An ancestor reveal pair is a tuple consisting of a node and a string.

    +

    The ancestor revealing algorithm given a node target is:

      @@ -80707,6 +83328,7 @@ END:VCARD
    +
    @@ -80717,6 +83339,7 @@ END:VCARD the browser window is minimized, a browser tab is currently in the background, or a system element such as a task switcher obscures the page.

    +

    When a user agent determines that the system visibility state for traversable navigable traversable has changed to newState, it must run the following steps:

    @@ -80739,19 +83362,25 @@ END:VCARD +

    A Document has a visibility state, which is either "hidden" or "visible", initially set to "hidden".

    +

    The visibilityState getter steps are to return this's visibility state.

    +
    +

    The hidden getter steps are to return true if this's visibility state is "hidden", otherwise false.

    +
    +

    To update the visibility state of Document document to visibilityState:

    @@ -80792,6 +83421,7 @@ END:VCARD document, with its bubbles attribute initialized to true.

    +

    The VisibilityStateEntry interface

    @@ -80831,21 +83461,29 @@ interface VisibilityStateEntry : PerformanceEntryhidden
    " visibility state.

    +

    The name getter steps are to return this's visibility state.

    +
    +

    The entryType getter steps are to return "visibility-state".

    +
    +

    The startTime getter steps are to return this's timestamp.

    +
    +

    The duration getter steps are to return zero.

    +

    Inert subtrees

    @@ -80880,17 +83518,21 @@ interface VisibilityStateEntry : PerformanceEntryModal dialogs and inert subtrees +

    A Document document is blocked by a modal dialog subject if subject is the topmost dialog element in document's top layer. While document is so blocked, every node that is connected to document, with the exception of the subject element and its flat tree descendants, must become inert.

    +
    +

    subject can additionally become inert via the inert attribute, but only if specified on subject itself (i.e., subject escapes inertness of ancestors); subject's flat tree descendants can become inert in a similar fashion.

    +

    The dialog element's showModal() method causes this mechanism to trigger, by VisibilityStateEntry : PerformanceEntryData model +

    For the purpose of tracking user activation, each Window W has two relevant values:

    @@ -81003,6 +83646,7 @@ interface VisibilityStateEntry : PerformanceEntry

    A last history-action activation timestamp, which is either a DOMHighResTimeStamp or positive infinity, initially positive infinity.

    +

    A user agent also defines a transient activation duration, which is a constant number indicating how long a user activation is available for certain VisibilityStateEntry : PerformanceEntry +

    We then have the following boolean user activation states for W:

    Sticky activation
    +

    When the current high resolution time given W is greater than or equal to the last activation timestamp in W, W is said to have sticky activation.

    +

    This is W's historical activation state, indicating whether the user has ever interacted in W. It starts false, then changes to true (and never changes back to @@ -81028,27 +83675,33 @@ interface VisibilityStateEntry : PerformanceEntryTransient activation

    +

    When the current high resolution time given W is greater than or equal to the last activation timestamp in W, and less than the last activation timestamp in W plus the transient activation duration, then W is said to have transient activation.

    +

    This is W's current activation state, indicating whether the user has interacted in W recently. This starts with a false value, and remains true for a limited time after every activation notification W gets.

    +

    The transient activation state is considered expired if it becomes false because the transient activation duration time has elapsed since the last user activation. Note that it can become false even before the expiry time through an activation consumption.

    +
    History-action activation
    +

    When the last history-action activation timestamp of W is not equal to the last activation timestamp of W, then W is said to have history-action activation.

    +

    This is a special variant of user activation, used to allow access to certain session history APIs which, if used too frequently, would make it harder for the user to traverse back using VisibilityStateEntry : PerformanceEntry

    +

    The last activation timestamp and last history-action activation timestamp are retained even after the Document changes its @@ -81074,6 +83728,7 @@ interface VisibilityStateEntry : PerformanceEntryProcessing model +

    When a user interaction causes firing of an activation triggering input event in a Document document, the user agent must perform the following activation notification steps before VisibilityStateEntry : PerformanceEntry +

    +

    An activation triggering input event is any event whose isTrusted attribute is true and whose type is one of:

    @@ -81127,7 +83784,9 @@ interface VisibilityStateEntry : PerformanceEntry

    "touchend".

    +
    +

    Activation consuming APIs defined in this and other specifications can consume user activation by performing the following steps, given a Window W:

    @@ -81150,7 +83809,9 @@ interface VisibilityStateEntry : PerformanceEntrywindow's last activation timestamp is not positive infinity, then set window's last activation timestamp to negative infinity.

    +
    +

    History-action activation-consuming APIs can consume history-action user activation by performing the following steps, given a Window W:

    @@ -81173,6 +83834,7 @@ interface VisibilityStateEntry : PerformanceEntrywindow's last history-action activation timestamp to window's last activation timestamp.

    +

    Note the asymmetry in the sets of browsing contexts in the page that are affected by an activation notification vs an @@ -81214,11 +83876,13 @@ interface VisibilityStateEntry : PerformanceEntryThe UserActivation interface +

    Each Window has an associated UserActivation, which is a UserActivation object. Upon creation of the Window object, its associated UserActivation must be set to a new UserActivation object created in the Window object's relevant realm.

    +
    [Exposed=Window]
     interface UserActivation {
    @@ -81244,20 +83908,26 @@ partial interface Navigator {
     
       
    +

    The userActivation getter steps are to return this's relevant global object's associated UserActivation.

    +
    +

    The hasBeenActive getter steps are to return true if this's relevant global object has sticky activation, and false otherwise.

    +
    +

    The isActive getter steps are to return true if this's relevant global object has transient activation, and false otherwise.

    +

    User agent automation

    @@ -81277,11 +83947,12 @@ partial interface Navigator { `POST` - /session/{session id}/window/consume-user-activation + /session/{session id}/window/consume-user-activation +

    The remote end steps are:

      @@ -81296,6 +83967,7 @@ partial interface Navigator {
    1. Return success with data consume.

    +
    @@ -81330,6 +84002,7 @@ partial interface Navigator {

    Each element has an associated click in progress flag, which is initially unset.

    +

    The click() method must run the following steps:

    @@ -81346,6 +84019,7 @@ partial interface Navigator {
  • Unset this element's click in progress flag.

  • +
    @@ -81392,16 +84066,20 @@ dictionary ToggleEventInit : EventInit { +

    The oldState and newState attributes must return the values they are initialized to.

    +
    +

    The source getter steps are to return the result of retargeting source against this's currentTarget.

    +

    DOM standard issue #1328 tracks how to better standardize associated event data in a way which makes sense on Events. @@ -81449,15 +84127,19 @@ dictionary CommandEventInit : EventInit { +

    The command attribute must return the value it was initialized to.

    +
    +

    The source getter steps are to return the result of retargeting source against this's currentTarget.

    +

    DOM standard issue #1328 tracks how to better standardize associated event data in a way which makes sense on Events. @@ -81520,10 +84202,12 @@ dictionary CommandEventInit : EventInit {

    Data model

    +

    A top-level traversable has system focus when it can receive keyboard input channeled from the operating system, possibly targeted at one of its active document's descendant navigables.

    +

    A top-level traversable has user attention when its system visibility state is "visible", and it either @@ -81534,10 +84218,12 @@ dictionary CommandEventInit : EventInit {

    User attention is lost when a browser window loses focus, whereas system focus might also be lost to other system widgets in the browser window such as a location bar.

    +

    A Document d is a fully active descendant of a top-level traversable with user attention when d is fully active and d's node navigable's top-level traversable has user attention.

    +

    The term focusable area is used to refer to regions of the interface that can further become the target of such keyboard input. Focusable areas can be elements, parts of elements, or other regions @@ -81684,6 +84370,7 @@ dictionary CommandEventInit : EventInit { can still have a focused area of the document. If a document's fully active state changes, its focused area of the document will stay the same.

    +

    The currently focused area of a top-level traversable traversable is the focusable area-or-null returned by this algorithm:

    @@ -81708,20 +84395,26 @@ dictionary CommandEventInit : EventInit {
  • Return candidate.

  • +
    +

    The current focus chain of a top-level traversable traversable is the focus chain of the currently focused area of traversable, if traversable is non-null, or an empty list otherwise.

    +
    +

    An element that is the DOM anchor of a focusable area is said to gain focus when that focusable area becomes the currently focused area of a top-level traversable. When an element is the DOM anchor of a focusable area of the currently focused area of a top-level traversable, it is focused.

    +
    +

    The focus chain of a focusable area subject is the ordered list constructed as follows:

    @@ -81769,6 +84462,7 @@ dictionary CommandEventInit : EventInit { hierarchy up to the Document of the top-level traversable.

    +

    All elements that are focusable areas are said to be focusable.

    @@ -81777,14 +84471,18 @@ dictionary CommandEventInit : EventInit { areas:

    • +

      A focusable area is said to be sequentially focusable if it is included in its Document's sequential focus navigation order and the user agent determines that it is sequentially focusable.

      +
    • +

      A focusable area is said to be click focusable if the user agent determines that it is click focusable. User agents should consider focusable areas with non-null tabindex values to be click focusable.

      +
    @@ -81818,9 +84516,11 @@ dictionary CommandEventInit : EventInit { focusable via user interaction, only via programmatic APIs.

    +

    When a user activates a click focusable focusable area, the user agent must run the focusing steps on the focusable area with focus trigger set to "click".

    +

    Note that focusing is not an activation behavior, i.e. calling the click() method on an element or dispatching a synthetic CommandEventInit : EventInit {


    +

    A node is a focus navigation scope owner if it is a Document, a shadow host, a slot, or an element which is the popover trigger of an element in the popover showing state.

    +
    +

    Each focus navigation scope owner has a focus navigation scope, which is a list of elements. Its contents are determined as follows:

    @@ -81858,16 +84561,20 @@ dictionary CommandEventInit : EventInit {
  • Return element's parent's associated focus navigation owner.

  • +
    +

    Then, the contents of a given focus navigation scope owner owner's focus navigation scope are all elements whose associated focus navigation owner is owner.

    +

    The order of elements within a focus navigation scope does not impact any of the algorithms in this specification. Ordering only becomes important for the tabindex-ordered focus navigation scope and flattened tabindex-ordered focus navigation scope concepts defined below.

    +

    A tabindex-ordered focus navigation scope is a list of focusable areas and focus navigation scope owners. Every focus navigation scope owner owner has @@ -81884,6 +84591,7 @@ dictionary CommandEventInit : EventInit { except the focusable areas whose tabindex value is a negative integer.

    +

    The order within a tabindex-ordered focus navigation scope is determined by each element's tabindex value, as described in the section below.

    @@ -81891,6 +84599,7 @@ dictionary CommandEventInit : EventInit {

    The rules there do not give a precise ordering, as they are composed mostly of "should" statements and relative orderings.

    +

    A flattened tabindex-ordered focus navigation scope is a list of focusable areas. Every focus navigation scope owner owner owns a distinct flattened tabindex-ordered focus navigation scope, @@ -81916,6 +84625,7 @@ dictionary CommandEventInit : EventInit { +

    @@ -81977,13 +84687,17 @@ dictionary CommandEventInit : EventInit {
    +

    The tabindex value of an element is the value of its tabindex attribute, parsed using the rules for parsing integers. If parsing fails or the attribute is not specified, then the tabindex value is null.

    +
    +

    The tabindex value of a focusable area is the tabindex value of its DOM anchor.

    +

    The tabindex value of an element must be interpreted as follows:

    @@ -82064,7 +84778,7 @@ dictionary CommandEventInit : EventInit {
    If the value is greater than zero
    -
    +

    The user agent must allow the element to be considered as a focusable area and should allow the element and any focusable areas that have the element as their DOM anchor to be sequentially focusable, and @@ -82103,6 +84817,7 @@ dictionary CommandEventInit : EventInit {

    +

    The tabIndex getter steps are:

    @@ -82129,6 +84844,7 @@ dictionary CommandEventInit : EventInit { a element, or is a summary element that is a summary for its parent details; otherwise 1.

    +

    The varying default value based on element type is a historical artifact.

    @@ -82139,6 +84855,7 @@ dictionary CommandEventInit : EventInit {

    Processing model

    +

    To get the focusable area for a focus target that is either an element that is not a focusable area, or is a navigable, given an optional string focus trigger (default "other"), run the first @@ -82200,7 +84917,9 @@ dictionary CommandEventInit : EventInit {

    Return null.

    +
    +

    The focus delegate for a focusTarget, given an optional string focusTrigger (default "other"), is given by the following steps:

    @@ -82261,7 +84980,9 @@ dictionary CommandEventInit : EventInit {

    The above algorithm essentially returns the first suitable focusable area where the path between its DOM anchor and focusTarget delegates focus at any shadow tree boundaries.

    +
    +

    The autofocus delegate for a focus target given a focus trigger is given by the following steps:

    @@ -82291,7 +85012,9 @@ dictionary CommandEventInit : EventInit {
  • Return null.

  • +
    +

    The focusing steps for an object new focus target that is either a focusable area, or an element that is not a focusable area, or a navigable, are as follows. They can optionally be run with a fallback @@ -82338,11 +85061,15 @@ dictionary CommandEventInit : EventInit {

  • Run the focus update steps with old chain, new chain, and new focus target respectively.

  • +
    +

    User agents must immediately run the focusing steps for a focusable area or navigable candidate whenever the user attempts to move the focus to candidate.

    +
    +

    The unfocusing steps for an object old focus target that is either a focusable area or an element that is not a focusable area are as follows:

    @@ -82386,6 +85113,7 @@ dictionary CommandEventInit : EventInit { update steps given old chain, an empty list, and null.

    +

    The unfocusing steps do not always result in the focus changing, even when applied to the currently focused area of a top-level traversable. For @@ -82395,6 +85123,7 @@ dictionary CommandEventInit : EventInit {


    +

    The focus update steps, given an old chain, a new chain, and a new focus target respectively, are as follows:

    @@ -82504,7 +85233,9 @@ dictionary CommandEventInit : EventInit { +
    +

    To fire a focus event named e at an element t with a given related target r, fire an event named e at t, using FocusEvent, with the CommandEventInit : EventInit { the view attribute initialized to t's node document's relevant global object, and the composed flag set.

    +

    +

    When a key event is to be routed in a top-level traversable, the user agent must run the following steps:

    @@ -82553,9 +85286,11 @@ dictionary CommandEventInit : EventInit { +

    +

    The has focus steps, given a Document object target, are as follows:

    @@ -82582,6 +85317,7 @@ dictionary CommandEventInit : EventInit { +
    @@ -82621,6 +85357,7 @@ dictionary CommandEventInit : EventInit { describe how the sequential navigation search algorithm finds the focusable area it returns.

    +

    When the user requests that focus move from the currently focused area of a top-level traversable to the next or previous focusable area (e.g., as the default action of pressing the tab key), or when the user requests that focus @@ -82696,8 +85433,10 @@ dictionary CommandEventInit : EventInit { https://software.hixie.ch/utilities/js/live-dom-viewer/?saved=2857 --> +

    +

    The sequential navigation search algorithm, given a focusable area starting point, sequential focus direction direction, and selection mechanism selection mechanism, consists of the following steps. @@ -82780,6 +85519,7 @@ dictionary CommandEventInit : EventInit {

  • Return candidate.

  • +
    @@ -82886,6 +85626,7 @@ dictionary CommandEventInit : EventInit {
    +

    The DocumentOrShadowRoot activeElement getter steps are:

    @@ -82911,13 +85652,17 @@ dictionary CommandEventInit : EventInit {
  • Return null.

  • +
    +

    The Document hasFocus() method steps are to return the result of running the has focus steps given this.

    +

    +

    The Window focus() method steps are:

    @@ -82936,9 +85681,12 @@ dictionary CommandEventInit : EventInit { to trigger some sort of notification to indicate to the user that the page is attempting to gain focus.

    +
    +

    The Window blur() method steps are to do nothing.

    +

    Historically, the focus() and blur() methods actually affected the system-level focus of the @@ -82947,6 +85695,7 @@ dictionary CommandEventInit : EventInit {


    +

    The HTMLOrSVGElement focus(options) method steps are:

    @@ -82966,7 +85715,9 @@ dictionary CommandEventInit : EventInit { a target into view given this, "auto", "center", and "center".

    +
    +

    The HTMLOrSVGElement blur() method steps are:

    @@ -82977,6 +85728,7 @@ dictionary CommandEventInit : EventInit {

    User agents may instead selectively or uniformly do nothing, for usability reasons.

    +

    For example, if the blur() method is unwisely being used to remove the focus ring for aesthetics reasons, the page would become unusable by @@ -82985,6 +85737,7 @@ dictionary CommandEventInit : EventInit {


    +

    The allow focus steps, given a Document object target, are:

    @@ -82998,6 +85751,7 @@ dictionary CommandEventInit : EventInit {
  • Return false.

  • +
    @@ -83018,6 +85772,7 @@ dictionary CommandEventInit : EventInit {

    The autofocus attribute is a boolean attribute.

    +

    To find the nearest ancestor autofocus scoping root element given an Element element:

    @@ -83048,6 +85803,7 @@ dictionary CommandEventInit : EventInit {
  • Return ancestor.

  • +

    There must not be two elements with the same nearest ancestor autofocus scoping root element that both have the autofocus attribute @@ -83061,6 +85817,7 @@ dictionary CommandEventInit : EventInit {

    Each Document has an autofocus processed flag boolean, initially false.

    +

    When an element with the autofocus attribute specified is inserted into a document, run the following steps:

    @@ -83088,11 +85845,13 @@ dictionary CommandEventInit : EventInit { autofocus candidates, and append the element to topDocument's autofocus candidates.

    +

    We do not check if an element is a focusable area before storing it in the autofocus candidates list, because even if it is not a focusable area when it is inserted, it could become one by the time flush autofocus candidates sees it.

    +

    To flush autofocus candidates for a document topDocument, run these steps:

    @@ -83187,6 +85946,7 @@ dictionary CommandEventInit : EventInit { +

    This handles the automatic focusing during document load. The show() and showModal() @@ -83354,6 +86114,7 @@ addShortcutKeyLabel(document.getElementById('c')); accesskey content attribute. Initially, an element must not have an assigned access key.

    +

    Whenever an element's accesskey attribute is set, changed, or removed, the user agent must update the element's assigned access key by running the following steps:

    @@ -83390,12 +86151,14 @@ addShortcutKeyLabel(document.getElementById('c'));
  • If this step is reached, the element has no assigned access key.

  • +

    Once a user agent has selected and assigned an access key for an element, the user agent should not change the element's assigned access key unless the accesskey content attribute is changed or the element is moved to another Document.

    +

    When the user presses the key combination corresponding to the assigned access key for an element, if the element defines a command, the command's Hidden State facet is false (visible), @@ -83404,6 +86167,7 @@ addShortcutKeyLabel(document.getElementById('c')); data-x="concept-document-bc">browsing context, and neither the element nor any of its ancestors has a hidden attribute specified, then the user agent must trigger the Action of the command.

    +

    User agents might expose elements that have an accesskey attribute in other ways as well, e.g. in a menu @@ -83412,10 +86176,12 @@ addShortcutKeyLabel(document.getElementById('c'));


    +

    The accessKeyLabel IDL attribute must return a string that represents the element's assigned access key, if any. If the element does not have one, then the IDL attribute must return the empty string.

    +
    @@ -83462,12 +86228,14 @@ addShortcutKeyLabel(document.getElementById('c'));
    +

    The attribute's missing value default and invalid value default are both the Inherit state. The inherit state indicates that the element is editable (or not) based on the parent element's state. The attribute's empty value default is the True state.

    +

    For example, consider a page that has a form and a textarea to @@ -83546,6 +86314,7 @@ body { display:none }

    +

    The contentEditable IDL attribute, on getting, must return the string "true" if the content attribute is set to the false", then the content attribute must be set to the string "false", and otherwise the attribute setter must throw a "SyntaxError" DOMException.

    +
    +

    The isContentEditable IDL attribute, on getting, must return true if the element is either an editing host or editable, and false otherwise.

    +
    @@ -83594,11 +86366,14 @@ body { display:none }

    Document objects have an associated design mode enabled, which is a boolean. It is initially false.

    +

    The designMode getter steps are to return "on" if this's design mode enabled is true; otherwise "off".

    +
    +

    The designMode setter steps are:

      @@ -83623,6 +86398,7 @@ body { display:none }
    1. If value is "off", then set this's design mode enabled to false.

    +
    @@ -83661,11 +86437,13 @@ body { display:none }

    Editing APIs

    +

    An editing host is either an HTML element with its contenteditable attribute in the true state or plaintext-only state, or a child HTML element of a Document whose design mode enabled is true.

    +

    The definition of the terms active range, Spelling and grammar will not be checked. +

    The attribute's missing value default and invalid value default are both the Default state. The default state indicates that the @@ -83751,6 +86530,7 @@ body { display:none } spellcheck state, as defined below. The attribute's empty value default is the True state.

    +
    @@ -83772,6 +86552,7 @@ body { display:none }
    +

    The spellcheck IDL attribute, on getting, must return true if the element's spellcheck content attribute is in the inherit-by-default and the element's parent element's spellcheck IDL attribute would return true; otherwise, if none of those conditions applies, then the attribute must instead return false.

    +

    The spellcheck IDL attribute is not affected by user preferences that override the spellcheck content attribute, and therefore might not reflect the actual spellchecking state.

    +

    On setting, if the new value is true, then the element's spellcheck content attribute must be set to "true", otherwise it must be set to "false". +


    @@ -83825,6 +86609,7 @@ body { display:none } sentence, or other piece of text. For text in attributes, it is the attribute's element. For the values of input and textarea elements, it is the element itself.

    +

    To determine if a word, sentence, or other piece of text in an applicable element (as defined above) is to have spelling- and grammar-checking enabled, the UA must use the following algorithm:

    @@ -83870,6 +86655,7 @@ body { display:none }
  • Otherwise, checking is disabled.
  • +

    If the checking is enabled for a word/sentence/text, the user agent should indicate spelling and grammar errors in that text. User agents should take into account the other semantics given in @@ -83938,15 +86724,19 @@ body { display:none } +

    The attribute's missing value default is the Default state. The default state indicates that the element is to act according to a default behavior, possibly based on the parent element's own writingsuggestions state, as defined below.

    +
    +

    The attribute's invalid value default and empty value default are both the True state.

    +
    element.writingSuggestions [ = value ]
    @@ -83961,6 +86751,7 @@ body { display:none }
    +

    The computed writing suggestions value of a given element is determined by running the following steps:

    @@ -83978,13 +86769,16 @@ body { display:none }
  • Return "true".

  • +
    +

    The writingSuggestions getter steps are:

    1. Return this's computed writing suggestions value.

    +

    The writingSuggestions IDL attribute is not affected by user preferences that override the +

    User agents should only offer suggestions within an element's scope if the result of running the following algorithm given element returns true:

    @@ -84038,6 +86833,7 @@ body { display:none }
  • Otherwise, return true.

  • +

    This specification does not define the user interface for writing suggestions. A user agent could offer on-demand suggestions, continuous suggestions as the user types, inline @@ -84144,10 +86940,12 @@ body { display:none } Characters +

    The attribute's missing value default is the Default state, and its invalid value default is the Sentences state. +

    element.autocapitalize [ = value ]
    @@ -84167,6 +86965,7 @@ body { display:none }
    +

    To compute the own autocapitalization hint of an element element, run the following steps:

    @@ -84182,7 +86981,9 @@ body { display:none }
  • Return Default.

  • +
    +

    The autocapitalize getter steps are to:

    @@ -84201,6 +87002,7 @@ body { display:none }
  • Return the keyword value corresponding to state.

  • +

    @@ -84213,6 +87015,7 @@ body { display:none }

    User agents or input methods may choose to ignore or override the used autocapitalization hint in certain circumstances.

    +

    The used autocapitalization hint for an element element is computed using the following algorithm:

    @@ -84233,6 +87036,7 @@ body { display:none }
  • Assert: this step is never reached, since text input only occurs in elements that meet one of the above criteria.

  • +
    @@ -84287,10 +87091,13 @@ body { display:none } The user agent is not allowed to automatically correct spelling while the user types. +

    The attribute's invalid value default, missing value default, and empty value default are all the On state.

    +
    +

    The autocorrect getter steps are: return true if the element's used autocorrection state is On and false if the element's used autocorrection @@ -84298,7 +87105,9 @@ body { display:none } given value is true, then the element's autocorrect attribute must be set to "on"; otherwise it must be set to "off".

    +
    +

    To compute the used autocorrection state of an element element, run these steps:

    @@ -84320,6 +87129,7 @@ body { display:none }
  • Return On.

  • +
    element . autocorrect
    @@ -84422,10 +87232,12 @@ body { display:none }
    +

    The inputMode IDL attribute must reflect the inputmode content attribute, limited to only known values.

    +

    When inputmode is unspecified (or is in a state not supported by the user agent), the user agent should determine the default virtual keyboard to be @@ -84502,10 +87314,12 @@ body { display:none }

    +

    The enterKeyHint IDL attribute must reflect the enterkeyhint content attribute, limited to only known values.

    +

    When enterkeyhint is unspecified (or is in a state not supported by the user agent), the user agent should determine the default action label (or icon) @@ -84549,6 +87363,7 @@ body { display:none }

    Interaction with details and hidden=until-found

    +

    When find-in-page begins searching for matches, all details elements in the page which do not have their open attribute set should have the skipped contents of their second slot become accessible, @@ -84563,7 +87378,9 @@ body { display:none } data-x="attr-hidden-until-found-state">Hidden Until Found state should have their contents become skipped again. This entire process must happen synchronously (and so is not observable to users or to author code). CSSCONTAIN

    +
    +

    When find-in-page chooses a new active match, perform the following steps:

    @@ -84575,6 +87392,7 @@ body { display:none } node's relevant global object to run the ancestor revealing algorithm on node.

    +

    @@ -84629,6 +87447,7 @@ body { display:none }

    +

    Whenever the user agent receives a potential close request targeted at a Document document, it must queue a global task on the user interaction task source given document's relevant global object to perform the @@ -84700,6 +87519,7 @@ body { display:none } watching for a close request. The user agent may instead interpret this interaction as some other action, instead of interpreting it as a close request.

    +
    @@ -84779,6 +87599,7 @@ body { display:none } encourages non-abusive developers to create close watchers directly in response to user interactions.

    +

    To notify the close watcher manager about user activation given a Window window:

    @@ -84792,6 +87613,7 @@ body { display:none }
  • Set manager's next user interaction allows a new group to false.

  • +

    @@ -84820,13 +87642,16 @@ body { display:none } exception.

    +

    A close watcher closeWatcher is active if closeWatcher's window's close watcher manager contains any list which contains closeWatcher.

    +

    +

    To establish a close watcher given a Window window, a list of steps cancelAction, a list of steps closeAction, @@ -84887,7 +87712,9 @@ body { display:none }

  • Return closeWatcher.

  • +
    +

    To request to close a close watcher closeWatcher with boolean requireHistoryActionActivation:

    @@ -84949,7 +87776,9 @@ body { display:none }
  • Return true.

  • +
    +

    To close a close watcher closeWatcher:

    @@ -84969,7 +87798,9 @@ body { display:none }
  • Run closeWatcher's close action.

  • +
    +

    To destroy a close watcher closeWatcher:

    @@ -84985,9 +87816,11 @@ body { display:none } data-x="close watcher manager groups">groups that is empty.

    +

    +

    To process close watchers given a Window window:

      @@ -85027,6 +87860,7 @@ body { display:none }
    1. Return processedACloseWatcher.

    +
    @@ -85109,6 +87943,7 @@ dictionary CloseWatcherOptions {

    Each CloseWatcher instance has an internal close watcher, which is a close watcher.

    +

    The new CloseWatcher(options) constructor steps are:

    @@ -85163,20 +87998,27 @@ dictionary CloseWatcherOptions {
  • Set this's internal close watcher to closeWatcher.

  • +
    +

    The requestClose() method steps are to request to close this's internal close watcher with false.

    +
    +

    The close() method steps are to close this's internal close watcher.

    +
    +

    The destroy() method steps are to destroy this's internal close watcher.

    +
    @@ -85604,6 +88446,7 @@ button2.onclick = () => { +

    When a drag data store is created, it must be initialized such that its drag data store item list is empty, it has no drag data store default feedback, it has no drag data store bitmap and @@ -85611,6 +88454,7 @@ button2.onclick = () => { data-x="concept-dnd-p">protected mode, and its drag data store allowed effects state is the string "uninitialized".

    +

    The DataTransfer interface

    @@ -85733,6 +88577,7 @@ interface DataTransfer {

    A DataTransfer object is associated with a drag data store while it is valid.

    +

    A DataTransfer object has an associated types array, which is a FrozenArray<DOMString>, initially empty. When the contents @@ -85765,7 +88610,9 @@ interface DataTransfer {

  • Set the DataTransfer object's types array to the result of creating a frozen array from L.

  • +
    +

    The DataTransfer() constructor, when invoked, must return a newly created DataTransfer object initialized as follows:

    @@ -85780,7 +88627,9 @@ interface DataTransfer {
  • Set the dropEffect and effectAllowed to "none".

  • +
    +

    The dropEffect attribute controls the drag-and-drop feedback that the user is given during a drag-and-drop operation. When the @@ -85792,7 +88641,9 @@ interface DataTransfer { data-x="dom-DataTransfer-dropEffect-link">link", or "move", then the attribute's current value must be set to the new value. Other values must be ignored.

    +
    +

    The effectAllowed attribute is used in the drag-and-drop processing model to initialize the DataTransfer { data-x="dom-DataTransfer-effectAllowed-all">all", or "uninitialized", then the attribute's current value must be set to the new value. Otherwise, it must be left unchanged.

    +
    +

    The items attribute must return a DataTransferItemList object associated with the DataTransfer object.

    +
    +

    The setDragImage(image, x, y) method must run the following steps:

    @@ -85838,11 +88693,15 @@ interface DataTransfer {
  • Set the drag data store hot spot coordinate to the given x, y coordinate.

  • +
    +

    The types attribute must return this DataTransfer object's types array.

    +
    +

    The getData(format) method must run the following steps:

    @@ -85880,7 +88739,9 @@ interface DataTransfer {
  • Return result.

  • +
    +

    The setData(format, data) method must run the following steps:

    @@ -85914,7 +88775,9 @@ interface DataTransfer { string">type string is equal to format, and whose data is the string given by the method's second argument.

    +
    +

    The clearData(format) method must run the following steps:

    @@ -85947,6 +88810,7 @@ interface DataTransfer { item type string">type string is equal to format, if there is one.

    +

    The clearData() method does not affect whether any files were included in the drag, so the DataTransfer { calling clearData() (it would still contain the "Files" string if any files were included in the drag).

    +

    The files attribute must return a live FileList sequence consisting of File objects representing the files found by the following steps. Furthermore, for a @@ -85979,6 +88844,7 @@ interface DataTransfer {

  • The files found by these steps are those in the list L.

  • +

    This version of the API does not expose the types of the files during the drag.

    @@ -86039,6 +88905,7 @@ DND-v5: DataTransferItem? DataTransferItemList
    object is not in the disabled mode) is the drag data store with which the DataTransferItemList object's DataTransfer object is associated.

    +
    +

    The length attribute must return zero if the object is in the disabled mode; otherwise it must return the number of items in the drag data store item list.

    +
    +

    When a DataTransferItemList object is not in the disabled mode, its supported property indices are the indices of the drag data store item list.

    +
    +

    To determine the value of an indexed property i of a DataTransferItemList object, the user agent must return a DataTransferItem object representing the ith item in the @@ -86065,7 +88938,9 @@ DND-v5: DataTransferItem? add() method must run the following steps:

    @@ -86136,7 +89011,9 @@ DND-v5: DataTransferItem? remove(index) method must run these steps:

    @@ -86151,12 +89028,15 @@ DND-v5: DataTransferItem? clear() method, if the DataTransferItemList object is in the read/write mode, must remove all the items from the drag data store. Otherwise, it must do nothing.

    +
    @@ -86222,6 +89102,7 @@ callback FunctionObjectCallback = undefined (any data);-->
    +

    While the DataTransferItem object's DataTransfer object is associated with a drag data store and that drag data store's drag data store item list still contains the item that the DataTransferItem object represents, @@ -86234,7 +89115,9 @@ callback FunctionObjectCallback = undefined (any data);-->DataTransferItem object is not in the disabled mode) is the drag data store with which the DataTransferItem object's DataTransfer object is associated.

    +
    +

    The kind attribute must return the empty string if the DataTransferItem object is in the disabled mode; otherwise it must return the @@ -86251,13 +89134,17 @@ callback FunctionObjectCallback = undefined (any data);--> File "file" +

    +

    The type attribute must return the empty string if the DataTransferItem object is in the disabled mode; otherwise it must return the drag data item type string of the item represented by the DataTransferItem object.

    +
    +

    The getAsString(callback) method must run the following steps:

    @@ -86276,6 +89163,7 @@ callback FunctionObjectCallback = undefined (any data);-->DataTransferItem object as the argument.

    +
    --> +

    The getAsFile() method must run the following steps:

    @@ -86322,6 +89211,7 @@ callback FunctionObjectCallback = undefined (any data);-->

    Return a new File object representing the actual data of the item represented by the DataTransferItem object.

    +
    serialization of an origin is the string obtained by applying the following algorithm to the given origin origin:

    @@ -88862,6 +91823,7 @@ dictionary DragEventInit : MouseEventInit {
  • Return result.

  • +
    @@ -88876,6 +91838,7 @@ dictionary DragEventInit : MouseEventInit {
    +

    Two origins, A and B, are said to be same origin if the following algorithm returns true:

    @@ -88890,7 +91853,9 @@ dictionary DragEventInit : MouseEventInit {
  • Return false.

  • +
    +

    Two origins, A and B, are said to be same origin-domain if the following algorithm returns true:

    @@ -88913,6 +91878,7 @@ dictionary DragEventInit : MouseEventInit {
  • Return false.

  • +
    @@ -88923,8 +91889,8 @@ dictionary DragEventInit : MouseEventInit { - @@ -88967,6 +91933,7 @@ dictionary DragEventInit : MouseEventInit {
    +

    To obtain a site, given an origin origin, run these steps:

      @@ -88982,7 +91949,9 @@ dictionary DragEventInit : MouseEventInit { origin's host's registrable domain).

    +
    +

    Two sites, A and B, are said to be same site if the following algorithm returns true:

    @@ -89004,7 +91973,9 @@ dictionary DragEventInit : MouseEventInit {
  • Return true.

  • +
    +

    The serialization of a site is the string obtained by applying the following algorithm to the given site site:

    @@ -89021,6 +91992,7 @@ dictionary DragEventInit : MouseEventInit {
  • Return result.

  • +

    It needs to be clear from context that the serialized value is a site, not an origin, as there is not necessarily a syntactic difference between the two. For example, the @@ -89028,6 +92000,7 @@ dictionary DragEventInit : MouseEventInit { the site ("https", "shop.example") have the same serialization: "https://shop.example".

    +

    Two origins, A and B, are said to be schemelessly same site if the following algorithm returns true:

    @@ -89055,7 +92028,9 @@ dictionary DragEventInit : MouseEventInit {
  • Return false.

  • +
    +

    Two origins, A and B, are said to be same site if the following algorithm returns true:

    @@ -89071,6 +92046,7 @@ dictionary DragEventInit : MouseEventInit {
  • Return false.

  • +
    @@ -89095,8 +92071,8 @@ dictionary DragEventInit : MouseEventInit {
    A - B + A + B same origin same origin-domain
    - @@ -89192,6 +92168,7 @@ dictionary DragEventInit : MouseEventInit {
    +

    The domain getter steps are:

    @@ -89205,7 +92182,9 @@ dictionary DragEventInit : MouseEventInit {
  • Return effectiveDomain, serialized.

  • +
    +

    The domain setter steps are:

      @@ -89234,7 +92213,9 @@ dictionary DragEventInit : MouseEventInit { data-x="concept-origin-domain">domain to the result of parsing the given value.

    +
    +

    To determine if a scalar value string hostSuffixString is a registrable domain suffix of or is equal to a DragEventInit : MouseEventInit {

  • Return true.

  • +
    A - B + A + B schemelessly same site same site
    - - + + @@ -89355,7 +92337,7 @@ dictionary DragEventInit : MouseEventInit { - + @@ -89427,9 +92409,11 @@ dictionary DragEventInit : MouseEventInit { browsing context group. Similarly, it can return true even when the header is not set.

    +

    The originAgentCluster getter steps are to return the surrounding agent's agent cluster's is origin-keyed.

    +

    Documents with an opaque origin can be considered unconditionally origin-keyed; for them the header has no effect, @@ -89548,6 +92532,7 @@ dictionary DragEventInit : MouseEventInit { which is a string or null, initially null.

    +

    To match opener policy values, given an opener policy value documentCOOP, an origin documentOrigin, an opener policy value responseCOOP, and an origin @@ -89567,6 +92552,7 @@ dictionary DragEventInit : MouseEventInit {

  • Return false.

  • +
    @@ -89595,6 +92581,7 @@ dictionary DragEventInit : MouseEventInit {
    +

    To obtain an opener policy given a response response and an environment reservedEnvironment:

    @@ -89700,11 +92687,13 @@ dictionary DragEventInit : MouseEventInit {
  • Return policy.

  • +
    Browsing context group switches due to opener policy
    +

    To check if popup COOP values require a browsing context group switch, given two origins responseOrigin and @@ -89735,7 +92724,9 @@ dictionary DragEventInit : MouseEventInit {

  • Return true.

    +
  • +

    To check if COOP values require a browsing context group switch, given a boolean isInitialAboutBlank, two origins responseOrigin and @@ -89759,7 +92750,9 @@ dictionary DragEventInit : MouseEventInit {

  • Return true.

    +
  • +

    To check if enforcing report-only COOP would require a browsing context group switch, given a boolean isInitialAboutBlank, two origins @@ -89800,6 +92793,7 @@ dictionary DragEventInit : MouseEventInit {

  • Return false.

  • +

    An opener policy enforcement result is a struct with the following items:

    @@ -89822,6 +92816,7 @@ dictionary DragEventInit : MouseEventInit { source, initially false.

    +

    To enforce a response's opener policy, given a browsing context browsingContext, a URL responseURL, an origin responseOrigin, an opener policy @@ -89948,7 +92943,9 @@ dictionary DragEventInit : MouseEventInit {

  • Return newCOOPEnforcementResult.

  • +
    +

    To obtain a browsing context to use for a navigation response, given navigation params navigationParams:

    @@ -90081,6 +93078,7 @@ dictionary DragEventInit : MouseEventInit {
  • Return newBrowsingContext.

  • +
    Reporting
    @@ -90108,6 +93106,7 @@ dictionary DragEventInit : MouseEventInit { context">ancestors.

    +

    To check if an access between two browsing contexts should be reported, given two browsing contexts accessor and accessed, a JavaScript property name P, and an @@ -90188,7 +93187,9 @@ dictionary DragEventInit : MouseEventInit { accessedTopDocument's referrer, P, and environment.

    +
    +

    To sanitize a URL to send in a report given a URL url:

    @@ -90205,7 +93206,9 @@ dictionary DragEventInit : MouseEventInit { sanitizedURL with exclude fragment set to true.

    +
    +

    To queue a violation report for browsing context group switch when navigating to a COOP response given an opener policy coop, a string disposition, a URL @@ -90268,7 +93271,9 @@ dictionary DragEventInit : MouseEventInit { data-x="">coop" for coop's reporting endpoint with coopURL.

    +
    +

    To queue a violation report for browsing context group switch when navigating away from a COOP response given an opener policy coop, a string disposition, a URL @@ -90324,7 +93329,9 @@ dictionary DragEventInit : MouseEventInit { data-x="">coop" for coop's reporting endpoint with coopURL.

    +
    +

    To queue violation reports for accesses, given an accessor-accessed relationship accessorAccessedRelationship, two opener policies accessorCOOP and accessedCOOP, @@ -90399,7 +93406,9 @@ dictionary DragEventInit : MouseEventInit { +

    +

    To queue a violation report for access to the opener, given an opener policy coop, two URLs coopURL and openerURL, two DragEventInit : MouseEventInit { data-x="coop-struct-report-endpoint">reporting endpoint with coopURL and environment.

    +
    +

    To queue a violation report for access to an opened window, given an opener policy coop, three URLs coopURL, openedWindowURL and @@ -90548,8 +93559,10 @@ dictionary DragEventInit : MouseEventInit { for coop's reporting endpoint with coopURL and environment.

    +
    +

    To queue a violation report for access to another window, given an opener policy coop, two URLs coopURL and otherURL, two DragEventInit : MouseEventInit { for coop's reporting endpoint with coopURL and environment.

    +
    +

    To queue a violation report for access from the opener, given an opener policy coop, two URLs coopURL and openerURL, two DragEventInit : MouseEventInit { for coop's reporting endpoint with coopURL.

    +
    +

    To queue a violation report for access from an opened window, given an opener policy coop, three URLs coopURL, openedWindowURL and @@ -90738,8 +93755,10 @@ dictionary DragEventInit : MouseEventInit { for coop's reporting endpoint with coopURL.

    +
    +

    To queue a violation report for access from another window, given an opener policy coop, two URLs coopURL and otherURL, two DragEventInit : MouseEventInit { for coop's reporting endpoint with coopURL.

    +
    @@ -90837,9 +93857,11 @@ dictionary DragEventInit : MouseEventInit { capability.

    +

    An embedder policy value is compatible with cross-origin isolation if it is "credentialless" or "require-corp".

    +
    @@ -90937,6 +93959,7 @@ dictionary DragEventInit : MouseEventInit {
    +

    To obtain an embedder policy from a response response and an environment environment:

    @@ -90989,10 +94012,12 @@ dictionary DragEventInit : MouseEventInit {
  • Return policy.

  • +
    Embedder policy checks
    +

    To check a navigation response's adherence to its embedder policy given a response response, a navigable navigable, and an embedder policy responsePolicy:

    @@ -91030,7 +94055,9 @@ dictionary DragEventInit : MouseEventInit {
  • Return false.

  • +
    +

    To check a global object's embedder policy given a WorkerGlobalScope workerGlobalScope, an environment settings object owner, and a response response:

    @@ -91066,7 +94093,9 @@ dictionary DragEventInit : MouseEventInit {
  • Return false.

  • +
    +

    To queue a cross-origin embedder policy inheritance violation given a response response, a string type, a string endpoint, a string disposition, and an environment settings @@ -91107,6 +94136,7 @@ dictionary DragEventInit : MouseEventInit {

  • Queue body as the "coep" report type for endpoint on settings. +

  • @@ -91287,6 +94317,7 @@ dictionary DragEventInit : MouseEventInit {
    +

    When the user agent is to parse a sandboxing directive, given a string input and a sandboxing flag set output, it must run the following steps:

    @@ -91402,6 +94433,7 @@ dictionary DragEventInit : MouseEventInit { +

    @@ -91421,6 +94453,7 @@ dictionary DragEventInit : MouseEventInit { active sandboxing flag set must be empty. It is populated by the navigation algorithm.

    +

    Every CSP list cspList has CSP-derived sandboxing flags, which is a sandboxing flag set. It is the return value of the following algorithm:

    @@ -91452,9 +94485,11 @@ dictionary DragEventInit : MouseEventInit {
  • Return the result of parsing the sandboxing directive directive.

  • +

    +

    To determine the creation sandboxing flags for a browsing context browsing context, given null or an element embedder, return the Policy containers @@ -91505,6 +94541,7 @@ dictionary DragEventInit : MouseEventInit {

    Move other policies into the policy container.

    +

    To clone a policy container given a policy container policyContainer:

    @@ -91530,7 +94567,9 @@ dictionary DragEventInit : MouseEventInit {
  • Return clone.

  • +
    +

    To determine whether a URL url requires storing the policy container in history:

    @@ -91550,7 +94589,9 @@ dictionary DragEventInit : MouseEventInit {
  • Return false.

  • +
    +

    To create a policy container from a fetch response given a response response and an @@ -91586,7 +94627,9 @@ dictionary DragEventInit : MouseEventInit {

  • Return result.

  • +
    +

    To determine navigation params policy container given a URL responseURL and four policy container-or-nulls historyPolicyContainer, @@ -91626,7 +94669,9 @@ dictionary DragEventInit : MouseEventInit {

  • Return a new policy container.

  • +
    +

    To initialize a worker global scope's policy container given a WorkerGlobalScope workerGlobalScope, a response response, and an environment @@ -91655,6 +94700,7 @@ dictionary DragEventInit : MouseEventInit { creating a policy container from a fetch response given response and environment.

    +
    @@ -91677,6 +94723,7 @@ dictionary DragEventInit : MouseEventInit {
    Integration with IDL
    +

    When perform a security check is invoked, with a platformObject, identifier, and type, run these steps:

    @@ -91709,6 +94756,7 @@ dictionary DragEventInit : MouseEventInit {
  • If IsPlatformObjectSameOrigin(platformObject) is false, then throw a "SecurityError" DOMException.

  • +
    Shared internal slot: [[CrossOriginPropertyDescriptorMap]]
    @@ -91717,12 +94765,14 @@ dictionary DragEventInit : MouseEventInit { [[CrossOriginPropertyDescriptorMap]] internal slot, whose value is initially an empty map.

    +

    The [[CrossOriginPropertyDescriptorMap]] internal slot contains a map with entries whose keys are (currentGlobal, objectGlobal, propertyKey)-tuples and values are property descriptors, as a memoization of what is visible to scripts when currentGlobal inspects a Window or Location object from objectGlobal. It is filled lazily by CrossOriginGetOwnPropertyHelper, which consults it on future lookups.

    +

    User agents should allow a value held in the map to be garbage collected along with its corresponding key when nothing holds a reference to any part of the value. That is, as long as @@ -91745,6 +94795,7 @@ dictionary DragEventInit : MouseEventInit {

    Shared abstract operations
    +
    CrossOriginProperties ( O )
      @@ -91770,12 +94821,14 @@ dictionary DragEventInit : MouseEventInit { { [[Property]]: "parent", [[NeedsGet]]: true, [[NeedsSet]]: false }, { [[Property]]: "postMessage" } ».

    +

    This abstract operation does not return a Completion Record.

    Indexed properties do not need to be safelisted in this algorithm, as they are handled directly by the WindowProxy object.

    +

    A JavaScript property name P is a cross-origin accessible window property name if it is "window", "self", "location", "close", "closed", @@ -91783,7 +94836,9 @@ dictionary DragEventInit : MouseEventInit { "length", "top", "opener", "parent", "postMessage", or an array index property name.

    +
    +
    CrossOriginPropertyFallback ( P )
      @@ -91797,7 +94852,9 @@ dictionary DragEventInit : MouseEventInit {
    1. Throw a "SecurityError" DOMException.

    +
    +
    IsPlatformObjectSameOrigin ( O )
      @@ -91806,6 +94863,7 @@ dictionary DragEventInit : MouseEventInit { O's relevant settings object's origin, and false otherwise.

    +

    This abstract operation does not return a Completion Record.

    @@ -91815,8 +94873,9 @@ dictionary DragEventInit : MouseEventInit { execution context stack. For example, in the code w.document, this step is invoked before the document getter is reached as part of the [[Get]] algorithm for the WindowProxy - w.

    + w.

    +
    CrossOriginGetOwnPropertyHelper ( O, P )

    If this abstract operation returns undefined and there is no custom behavior, the @@ -91900,6 +94959,7 @@ dictionary DragEventInit : MouseEventInit {

  • Return undefined.

  • +

    This abstract operation does not return a Completion Record.

    @@ -91915,6 +94975,7 @@ dictionary DragEventInit : MouseEventInit { the same-origin behavior, is for compatibility with existing web content. See issue #3183 for details.

    +
    CrossOriginGet ( O, P, Receiver )
      @@ -91934,7 +94995,9 @@ dictionary DragEventInit : MouseEventInit {
    1. Return ? Call(getter, Receiver).

    +
    +
    CrossOriginSet ( O, P, V, Receiver )
    @@ -91956,7 +95019,9 @@ dictionary DragEventInit : MouseEventInit {
  • Throw a "SecurityError" DOMException.

  • +
    +
    CrossOriginOwnPropertyKeys ( O )
      @@ -91969,6 +95034,7 @@ dictionary DragEventInit : MouseEventInit { %Symbol.toStringTag%, %Symbol.hasInstance%, %Symbol.isConcatSpreadable% ».

    +

    This abstract operation does not return a Completion Record.

    @@ -92064,24 +95130,32 @@ dictionary WindowPostMessageOptions : StructuredSeri data-x="navigate">navigation from the initial about:blank Document.

    +

    A Window's browsing context is its associated Document's browsing context. It is either null or a browsing context.

    +
    +

    A Window's navigable is the navigable whose active document is the Window's associated Document's, or null if there is no such navigable.

    +
    +

    The window, frames, and self getter steps are to return this's relevant realm.[[GlobalEnv]].[[GlobalThisValue]].

    +
    +

    The document getter steps are to return this's associated Document.

    +

    The Document object associated with a Window object can change in exactly one case: when the navigate algorithm WindowPostMessageOptions : StructuredSeri Window object of the initial about:blank page is reused and gets a new Document object.

    +

    The defaultView getter steps are:

    @@ -92100,6 +95175,7 @@ dictionary WindowPostMessageOptions : StructuredSeri
  • Return this's browsing context's WindowProxy object.

  • +

    @@ -92155,6 +95231,7 @@ dictionary WindowPostMessageOptions : StructuredSeri
    +

    To get noopener for window open, given a Document sourceDocument, an ordered map tokenizedFeatures, and a URL record-or-null url, perform the following steps. They return a @@ -92188,7 +95265,9 @@ dictionary WindowPostMessageOptions : StructuredSeri

  • Return noopener.

  • +
    +

    The window open steps, given a string url, a string target, and a string features, are as follows:

    @@ -92309,10 +95388,13 @@ dictionary WindowPostMessageOptions : StructuredSeri
  • Return targetNavigable's active WindowProxy.

  • +
    +

    The open(url, target, features) method steps are to run the window open steps with url, target, and features.

    +

    The method provides a mechanism for navigating an existing browsing context or opening and navigating an auxiliary browsing @@ -92320,6 +95402,7 @@ dictionary WindowPostMessageOptions : StructuredSeri


    +

    To tokenize the features argument:

    @@ -92396,7 +95479,9 @@ dictionary WindowPostMessageOptions : StructuredSeri
  • Return tokenizedFeatures.

  • +
    +

    To check if a window feature is set, given tokenizedFeatures, featureName, and defaultValue:

    @@ -92408,7 +95493,9 @@ dictionary WindowPostMessageOptions : StructuredSeri
  • Return defaultValue.

  • +
    +

    To check if a popup window is requested, given tokenizedFeatures:

    @@ -92458,10 +95545,14 @@ dictionary WindowPostMessageOptions : StructuredSeri
  • Return false.

  • +
    +

    A code point is a feature separator if it is ASCII whitespace, U+003D (=), or U+002C (,).

    +
    +

    For legacy reasons, there are some aliases of some feature names. To normalize a feature name name, switch on name:

    @@ -92477,7 +95568,9 @@ dictionary WindowPostMessageOptions : StructuredSeri
    Anything else
    Return name. +
    +

    To parse a boolean feature given a string value:

    @@ -92497,9 +95590,11 @@ dictionary WindowPostMessageOptions : StructuredSeri
  • Return false if parsed is 0, and true otherwise.

  • +

    +

    The name getter steps are:

      @@ -92509,7 +95604,9 @@ dictionary WindowPostMessageOptions : StructuredSeri
    1. Return this's navigable's target name.

    +
    +

    The name setter steps are:

      @@ -92521,12 +95618,14 @@ dictionary WindowPostMessageOptions : StructuredSeri data-x="she-document-state">document state's navigable target name to the given value.

    +

    The name gets reset when the navigable is navigated to another origin.


    +

    The close() method steps are:

    @@ -92573,7 +95672,9 @@ dictionary WindowPostMessageOptions : StructuredSeri +
    +

    A navigable is script-closable if it is a top-level traversable, and any of the following are true:

    @@ -92583,6 +95684,7 @@ dictionary WindowPostMessageOptions : StructuredSeri
  • its session history entries's size is 1.
  • +
    +

    The closed getter steps are to return true if this's browsing context is null or its is closing is true; otherwise false.

    +
    +

    The stop() method steps are:

    @@ -92604,6 +95709,7 @@ dictionary WindowPostMessageOptions : StructuredSeri
  • Stop loading this's navigable.

  • +
    @@ -92623,10 +95729,12 @@ dictionary WindowPostMessageOptions : StructuredSeri
    +

    The length getter steps are to return this's associated Document's document-tree child navigables's size.

    +

    Indexed access to document-tree child navigables is defined through the [[GetOwnProperty]] internal method of the @@ -92652,6 +95760,7 @@ dictionary WindowPostMessageOptions : StructuredSeri

    +

    The document-tree child navigable target name property set of a Window object window is the @@ -92703,6 +95812,7 @@ dictionary WindowPostMessageOptions : StructuredSeri

  • Return names.

  • +

    The two seperate iterations mean that in the following example, hosted on WindowPostMessageOptions : StructuredSeri <iframe name=spices></iframe>

    +

    The Window object supports named properties. The supported property names of a Window object window at any moment consist of the following, in tree order according to @@ -92736,7 +95847,9 @@ dictionary WindowPostMessageOptions : StructuredSeri data-x="concept-document-window">associated Document as their root.

    +
    +

    To determine the value of a named property name in a Window object window, the user agent must return the value obtained using the following steps:

    @@ -92773,7 +95886,9 @@ dictionary WindowPostMessageOptions : StructuredSeri the name name. (By definition, these will all be elements.)

    +
    +

    Named objects of Window object window with the name name, for the purposes of the above algorithm, consist of the following:

    @@ -92795,6 +95910,7 @@ dictionary WindowPostMessageOptions : StructuredSeri associated Document as their root.

    +

    Since the Window interface has the [Global] extended attribute, its named properties follow the rules for @@ -92833,6 +95949,7 @@ dictionary WindowPostMessageOptions : StructuredSeri

    +

    The top getter steps are:

      @@ -92843,7 +95960,9 @@ dictionary WindowPostMessageOptions : StructuredSeri data-x="nav-top">top-level traversable's active WindowProxy.

    +
    +

    The opener getter steps are:

    @@ -92859,7 +95978,9 @@ dictionary WindowPostMessageOptions : StructuredSeri
  • Return current's opener browsing context's WindowProxy object.

  • +
    +

    The opener setter steps are:

      @@ -92872,6 +95993,7 @@ dictionary WindowPostMessageOptions : StructuredSeri [[Value]]: the given value, [[Writable]]: true, [[Enumerable]]: true, [[Configurable]]: true }).

    +

    Setting window.opener to null clears the opener @@ -92884,6 +96006,7 @@ dictionary WindowPostMessageOptions : StructuredSeri browsing context to navigate.

    +

    The parent getter steps are:

    @@ -92899,7 +96022,9 @@ dictionary WindowPostMessageOptions : StructuredSeri
  • Return navigable's active WindowProxy.

  • +
    +

    The frameElement getter steps are:

    @@ -92920,6 +96045,7 @@ dictionary WindowPostMessageOptions : StructuredSeri
  • Return container.

  • +

    An example of when these properties can return null is as follows:

    @@ -92977,6 +96103,7 @@ interface BarProp {
    +

    The visible getter steps are:

    @@ -92989,6 +96116,7 @@ interface BarProp {
  • Return the negation of browsingContext's top-level browsing context's is popup.

  • +

    The following BarProp objects must exist for each Window object:

    @@ -93022,35 +96150,50 @@ interface BarProp { reload buttons, etc.). +

    The locationbar attribute must return the location bar BarProp object.

    +
    +

    The menubar attribute must return the menu bar BarProp object.

    +
    +

    The personalbar attribute must return the personal bar BarProp object.

    +
    +

    The scrollbars attribute must return the scrollbar BarProp object.

    +
    +

    The statusbar attribute must return the status bar BarProp object.

    +
    +

    The toolbar attribute must return the toolbar BarProp object.

    +

    +

    For historical reasons, the status attribute on the Window object must, on getting, return the last string it was set to, and on setting, must set itself to the new value. When the Window object is created, the attribute must be set to the empty string. It does not do anything else.

    +
    Script settings for Window objects
    +

    To set up a window environment settings object, given a URL creationURL, a JavaScript execution context execution context, null or an environment reservedEnvironment, a URL @@ -93186,6 +96329,7 @@ interface BarProp {

  • Set realm's [[HostDefined]] field to settings object.

  • +
    @@ -93215,6 +96359,7 @@ interface BarProp { Window object remains an ordinary object this is unobservable and can be implemented either way.

    +
    [[GetPrototypeOf]] ( )
      @@ -93227,25 +96372,33 @@ interface BarProp {
    1. Return null.

    +
    +
    [[SetPrototypeOf]] ( V )
    1. Return ! SetImmutablePrototype(this, V).

    +
    +
    [[IsExtensible]] ( )
    1. Return true.

    +
    +
    [[PreventExtensions]] ( )
    1. Return false.

    +
    +
    [[GetOwnProperty]] ( P )
      @@ -93341,7 +96494,9 @@ interface BarProp {
    1. Return ? CrossOriginPropertyFallback(P).

    +
    +
    [[DefineOwnProperty]] ( P, Desc )
    @@ -93369,7 +96524,9 @@ interface BarProp {
  • Throw a "SecurityError" DOMException.

  • +
    +
    [[Get]] ( P, Receiver )
      @@ -93393,7 +96550,9 @@ interface BarProp {

      this is passed rather than W as OrdinaryGet and CrossOriginGet will invoke the [[GetOwnProperty]] internal method.

      +
    +
    [[Set]] ( P, V, Receiver )
      @@ -93427,7 +96586,9 @@ interface BarProp { internal method.

    +
    +
    [[Delete]] ( P )
      @@ -93456,7 +96617,9 @@ interface BarProp {
    1. Throw a "SecurityError" DOMException.

    +
    +
    [[OwnPropertyKeys]] ( )
      @@ -93477,6 +96640,7 @@ interface BarProp {
    1. Return the concatenation of keys and ! CrossOriginOwnPropertyKeys(W).

    +
    @@ -93493,6 +96657,7 @@ interface BarProp { methods. Coupled with its scary security policy, please take extra care while implementing this excrescence.

    +

    To create a Location object, run these steps:

      @@ -93520,6 +96685,7 @@ interface BarProp {
    1. Return location.

    +

    The addition of valueOf and %Symbol.toPrimitive% own data properties, as well as the fact that all of Location's IDL attributes are marked @@ -93546,14 +96712,18 @@ interface BarProp {

    +

    The Document object's location getter steps are to return this's relevant global object's Location object, if this is fully active, and null otherwise.

    +
    +

    The Window object's location getter steps are to return this's Location object.

    +
    @@ -93666,17 +96836,22 @@ interface Location { // but see also browsing context's active document, if this Location object's relevant global object's browsing context is non-null, and null otherwise.

    +
    +

    A Location object has an associated url, which is this Location object's relevant Document's URL, if this Location object's relevant Document is non-null, and about:blank otherwise.

    +
    +
    + + + + + + + + + +

    The replace() method intentionally has no security check.

    +

    The details of how the ancestorOrigins attribute works are still @@ -94240,6 +97460,7 @@ interface Location { // but see also [[GetPrototypeOf]] ( )

      @@ -94248,25 +97469,33 @@ interface Location { // but see also [[SetPrototypeOf]] ( V )
      1. Return ! SetImmutablePrototype(this, V).

      +
    +
    [[IsExtensible]] ( )
    1. Return true.

    +
    +
    [[PreventExtensions]] ( )
    1. Return false.

    +
    +
    + + +

    The scrollRestoration getter steps are:

    @@ -94525,7 +97770,9 @@ interface History { entry's scroll restoration mode.

    +
    +

    The scrollRestoration setter steps are:

    @@ -94540,7 +97787,9 @@ interface History { entry's scroll restoration mode to the given value.

    +
    +

    The state getter steps are:

    @@ -94552,16 +97801,24 @@ interface History {
  • Return this's state.

  • +
    +

    The go(delta) method steps are to delta traverse this given delta.

    +
    +

    The back() method steps are to delta traverse this given −1.

    +
    +

    The forward() method steps are to delta traverse this given +1.

    +
    +

    To delta traverse a History object history given an integer delta:

    @@ -94580,18 +97837,24 @@ interface History { and with sourceDocument set to document.

    +
    +

    The pushState(data, unused, url) method steps are to run the shared history push/replace state steps given this, data, url, and "push".

    +
    +

    The replaceState(data, unused, url) method steps are to run the shared history push/replace state steps given this, data, url, and "replace".

    +
    +

    The shared history push/replace state steps, given a History history, a value data, a scalar value string-or-null url, and a history handling behavior historyHandling, are:

    @@ -94655,13 +97918,17 @@ interface History { serializedData and historyHandling set to historyHandling.

    +
    +

    User agents may limit the number of state objects added to the session history per page. If a page hits the implementation-defined limit, user agents must remove the entry immediately after the first entry for that Document object in the session history after having added the new entry. (Thus the state history acts as a FIFO buffer for eviction, but as a LIFO buffer for navigation.)

    +
    +

    A Document document can have its URL rewritten to a URL targetURL if the following algorithm returns true:

    @@ -94712,6 +97979,7 @@ interface History {
  • Return true.

  • +
    @@ -94719,8 +97987,8 @@ interface History {
    hostSuffixStringoriginalHosthostSuffixStringoriginalHost Outcome of is a registrable domain suffix of or is equal to Notes
    "compute.amazonaws.com" example.compute.amazonaws.com ❌At the time of writing, *.compute.amazonaws.com is a public suffix.At the time of writing, *.compute.amazonaws.com is a public suffix.
    "example.compute.amazonaws.com"
    - @@ -94863,7 +98131,7 @@ interface History { for the same experience. Furthermore, contrary to the experience the user would have with just a naïve script-based approach, bookmarking and navigating the session history still work.

    -

    In the example above, the data argument to the In the example above, the data argument to the pushState() method is the same information as would be sent to the server, but in a more convenient form, so that the script doesn't have to parse the URL each time the user navigates.

    @@ -95069,15 +98337,19 @@ enum NavigationHistoryBehavior { "replace" }; +

    Each Window has an associated navigation API, which is a Navigation object. Upon creation of the Window object, its navigation API must be set to a new Navigation object created in the Window object's relevant realm.

    +
    +

    The navigation getter steps are to return this's navigation API.

    +
    @@ -95118,6 +98390,7 @@ enum NavigationHistoryBehavior { data-x="navigation-current-entry-index">current entry index, an integer, initially −1.

    +

    The current entry of a Navigation navigation is the result of running the following steps:

    @@ -95132,7 +98405,9 @@ enum NavigationHistoryBehavior { list[navigation's current entry index].

    +
    +

    A Navigation navigation has entries and events disabled if the following steps return true:

    @@ -95150,7 +98425,9 @@ enum NavigationHistoryBehavior {
  • Return false.

  • +
    +

    To get the navigation API entry index of a session history entry she within a Navigation navigation:

    @@ -95172,6 +98449,7 @@ enum NavigationHistoryBehavior {
  • Return −1.

  • +

    @@ -95219,6 +98497,7 @@ enum NavigationHistoryBehavior {
    Initializing and updating the entry list
    +

    To initialize the navigation API entries for a new document given a Navigation navigation, a list of session history entries newSHEs, and a session history @@ -95259,7 +98538,9 @@ enum NavigationHistoryBehavior { index to the result of getting the navigation API entry index of initialSHE within navigation.

    +
    +

    To update the navigation API entries for reactivation given a Navigation navigation, a list of session history entries newSHEs, and a session history @@ -95358,7 +98639,9 @@ enum NavigationHistoryBehavior {

    + +

    To update the navigation API entries for a same-document navigation given a Navigation navigation, a session history entry destinationSHE, and a NavigationType navigationType:

    @@ -95490,6 +98773,7 @@ enum NavigationHistoryBehavior {
  • Clean up after running script given navigation's relevant settings object.

  • +

    In implementations, same-document navigations can cause session history entries to be disposed by falling off the back of the @@ -95581,6 +98865,7 @@ interface NavigationHistoryEntry : EventTarget

    Each NavigationHistoryEntry has an associated session history entry, which is a session history entry.

    +

    The key of a NavigationHistoryEntry nhe is given by the return value of the following algorithm:

    @@ -95593,7 +98878,9 @@ interface NavigationHistoryEntry : EventTarget
  • Return nhe's session history entry's navigation API key.

  • +
    +

    The ID of a NavigationHistoryEntry nhe is given by the return value of the following algorithm:

    @@ -95606,7 +98893,9 @@ interface NavigationHistoryEntry : EventTarget
  • Return nhe's session history entry's navigation API ID.

  • +
    +

    The index of a NavigationHistoryEntry nhe is given by the return value of the following algorithm:

    @@ -95621,7 +98910,9 @@ interface NavigationHistoryEntry : EventTarget this's relevant global object's navigation API.

    +
    +

    The url getter steps are:

    @@ -95644,19 +98935,27 @@ interface NavigationHistoryEntry : EventTarget
  • Return she's URL, serialized.

  • +
    +

    The key getter steps are to return this's key.

    +
    +

    The id getter steps are to return this's ID.

    +
    +

    The index getter steps are to return this's index.

    +
    +

    The sameDocument getter steps are:

    @@ -95670,7 +98969,9 @@ interface NavigationHistoryEntry : EventTarget document equals document, and false otherwise.

    +
    +

    The getState() method steps are:

    @@ -95688,6 +98989,7 @@ interface NavigationHistoryEntry : EventTarget ArrayBuffer when not enough memory is available.

    +
    @@ -95758,6 +99060,7 @@ interface NavigationHistoryEntry : EventTarget
    +

    The entries() method steps are:

    @@ -95774,11 +99077,15 @@ interface NavigationHistoryEntry : EventTarget data-x="dom-Navigation-entries">navigation.entries().

    +
    +

    The currentEntry getter steps are to return the current entry of this.

    +
    +

    The updateCurrentEntry(options) method steps are:

    @@ -95806,7 +99113,9 @@ interface NavigationHistoryEntry : EventTarget initialized to null and its from initialized to current.

    +
    +

    The canGoBack getter steps are:

    @@ -95822,7 +99131,9 @@ interface NavigationHistoryEntry : EventTarget
  • Return true.

  • +
    +

    The canGoForward getter steps are:

    @@ -95839,6 +99150,7 @@ interface NavigationHistoryEntry : EventTarget
  • Return true.

  • +
    @@ -96010,6 +99322,7 @@ interface NavigationHistoryEntry : EventTarget
    +

    The navigate(url, options) method steps are:

    @@ -96110,7 +99423,9 @@ interface NavigationHistoryEntry : EventTarget
  • Return a navigation API method tracker-derived result for apiMethodTracker.

  • +
    +

    The reload(options) method steps are:

    @@ -96170,7 +99485,9 @@ interface NavigationHistoryEntry : EventTarget
  • Return a navigation API method tracker-derived result for apiMethodTracker.

  • +
    +

    The traverseTo(key, options) method steps are:

    @@ -96191,7 +99508,9 @@ interface NavigationHistoryEntry : EventTarget
  • Return the result of performing a navigation API traversal given this, key, and options.

  • +
    +

    The back(options) method steps are:

    @@ -96209,7 +99528,9 @@ interface NavigationHistoryEntry : EventTarget
  • Return the result of performing a navigation API traversal given this, key, and options.

  • +
    +

    The forward(options) method steps are:

    @@ -96228,7 +99549,9 @@ interface NavigationHistoryEntry : EventTarget
  • Return the result of performing a navigation API traversal given this, key, and options.

  • +
    +

    To perform a navigation API traversal given a Navigation navigation, a string key, and a NavigationOptions options:

    @@ -96354,19 +99677,24 @@ interface NavigationHistoryEntry : EventTarget
  • Return a navigation API method tracker-derived result for apiMethodTracker.

  • +
    +

    An early error result for an exception e is a NavigationResult dictionary instance given by «[ "committed" → a promise rejected with e, "finished" → a promise rejected with e ]».

    +
    +

    A navigation API method tracker-derived result for a navigation API method tracker is a NavigationResult dictionary instance given by «[ "committed" → apiMethodTracker's committed promise, "finished" → apiMethodTracker's finished promise ]».

    +
    @@ -96509,6 +99837,7 @@ const p2 = navigation.navigate(url2).finished;

    All this state is then managed via the following algorithms.

    +

    To maybe set the upcoming non-traverse API method tracker given a Navigation navigation, a JavaScript value info, and a serialized state-or-null serializedState:

    @@ -96590,7 +99919,9 @@ const p2 = navigation.navigate(url2).finished;
  • Return apiMethodTracker.

  • +
    +

    To add an upcoming traverse API method tracker given a Navigation navigation, a string destinationKey, and a JavaScript value info:

    @@ -96638,7 +99969,9 @@ const p2 = navigation.navigate(url2).finished;
  • Return apiMethodTracker.

  • +
    +

    To promote an upcoming API method tracker to ongoing given a Navigation navigation and a string-or-null destinationKey:

    @@ -96681,7 +100014,9 @@ const p2 = navigation.navigate(url2).finished; +
    +

    To clean up a navigation API method tracker apiMethodTracker:

    @@ -96710,7 +100045,9 @@ const p2 = navigation.navigate(url2).finished; +
    +

    To notify about the committed-to entry given a navigation API method tracker apiMethodTracker and a NavigationHistoryEntry nhe:

    @@ -96749,7 +100086,9 @@ const p2 = navigation.navigate(url2).finished; tracker.

    +
    +

    To resolve the finished promise for a navigation API method tracker apiMethodTracker:

    @@ -96765,7 +100104,9 @@ const p2 = navigation.navigate(url2).finished;
  • Clean up apiMethodTracker.

  • +
    +

    To reject the finished promise for a navigation API method tracker apiMethodTracker with a JavaScript value exception:

    @@ -96787,7 +100128,9 @@ const p2 = navigation.navigate(url2).finished;
  • Clean up apiMethodTracker.

  • +
    +

    To abort the ongoing navigation given a Navigation navigation and an optional DOMException error:

    @@ -96863,7 +100206,9 @@ const p2 = navigation.navigate(url2).finished;
  • Set navigation's transition to null.

  • +
    +

    To inform the navigation API about aborting navigation in a navigable navigable:

    @@ -96882,7 +100227,9 @@ const p2 = navigation.navigate(url2).finished;
  • Abort the ongoing navigation given navigation.

  • +
    +

    To inform the navigation API about child navigable destruction given a navigable navigable:

    @@ -96902,6 +100249,7 @@ const p2 = navigation.navigate(url2).finished; DOMException created in navigation's relevant realm.

    +

    @@ -96968,9 +100316,11 @@ interface NavigationTransition { data-x="concept-Navigation-transition">transition, which is a NavigationTransition or null, initially null.

    +

    The transition getter steps are to return this's transition.

    +

    Each NavigationTransition has an associated navigation type, which is a @@ -96986,15 +100336,20 @@ interface NavigationTransition {

    Each NavigationTransition has an associated finished promise, which is a promise.

    +

    The navigationType getter steps are to return this's navigation type.

    +
    +

    The from getter steps are to return this's from entry.

    +
    +

    The committed getter steps are to return this's committed @@ -97004,6 +100359,7 @@ interface NavigationTransition { data-x="dom-NavigationTransition-finished">finished getter steps are to return this's finished promise.

    +
    @@ -97081,22 +100437,30 @@ interface NavigationActivation { NavigationType.

    +

    The activation getter steps are to return this's activation.

    +
    +

    The from getter steps are to return this's old entry.

    +
    +

    The entry getter steps are to return this's new entry.

    +
    +

    The navigationType getter steps are to return this's navigation type.

    +
    The navigate event
    @@ -97376,6 +100740,7 @@ callback NavigationInterceptHandler = replace", and is set appropriately when the event is fired.

    +

    The navigationType, destination, NavigationInterceptHandler = sourceElement attributes must return the values they are initialized to.

    +
    +

    The intercept(options) method steps are:

    @@ -97481,7 +100848,9 @@ callback NavigationInterceptHandler = scroll() method steps are:

    @@ -97496,7 +100865,9 @@ callback NavigationInterceptHandler = perform shared checks for a NavigateEvent event:

    @@ -97513,6 +100884,7 @@ callback NavigationInterceptHandler = InvalidStateError" DOMException.

    +
    @@ -97558,6 +100930,7 @@ callback NavigationInterceptHandler = event.

    +

    The redirect(url, options) method steps are:

    @@ -97641,6 +101014,7 @@ callback NavigationInterceptHandler = info to options["info"].

    +
    @@ -97731,11 +101105,14 @@ interface NavigationDestination {
    +

    The url getter steps are to return this's URL, serialized.

    +
    +

    The key getter steps are:

    @@ -97747,7 +101124,9 @@ interface NavigationDestination { data-x="concept-NavigationDestination-entry">entry's key.

    +
    +

    The id getter steps are:

    @@ -97759,7 +101138,9 @@ interface NavigationDestination { data-x="concept-NavigationDestination-entry">entry's ID.

    +
    +

    The index getter steps are:

    @@ -97771,16 +101152,21 @@ interface NavigationDestination { data-x="concept-NavigationDestination-entry">entry's index.

    +
    +

    The sameDocument getter steps are to return this's is same document.

    +
    +

    The getState() method steps are to return StructuredDeserialize(this's state).

    +
    @@ -97788,6 +101174,7 @@ interface NavigationDestination {

    Other parts of the standard fire the navigate event, through a series of wrapper algorithms given in this section.

    +

    To fire a traverse navigate event at a Navigation navigation given a session history entry destinationSHE and an optional @@ -97855,7 +101242,9 @@ interface NavigationDestination { event, destination, userInvolvement, null, null, and null.

    +
    +

    To fire a push/replace/reload navigate event at a Navigation navigation given a NavigationType navigationType, a URL NavigationDestination { userInvolvement, sourceElement, formDataEntryList, and null.

    +
    +

    To fire a download request navigate event at a Navigation navigation given a URL destinationURL, a user @@ -97987,7 +101378,9 @@ interface NavigationDestination { destination, userInvolvement, sourceElement, null, and filename.

    +
    +

    The inner navigate event firing algorithm consists of the following steps, given a Navigation navigation, a NavigationType navigationType, a NavigateEvent @@ -98531,6 +101924,7 @@ interface NavigationDestination {

  • Return false.

  • +
    @@ -98540,6 +101934,7 @@ interface NavigationDestination { instead invoking cross-document navigation-like behavior at a later time. The algorithms in this section are called at those appropriate later points.

    +

    To finish a NavigateEvent event, given a boolean didFulfill:

    @@ -98582,7 +101977,9 @@ interface NavigationDestination { data-x="concept-NavigateEvent-interception-state">interception state to "finished".

    +
    +

    To potentially reset the focus given a NavigateEvent event:

    @@ -98630,7 +102027,9 @@ interface NavigationDestination {
  • Move the sequential focus navigation starting point to focusTarget.

  • +
    +

    To potentially process scroll behavior given a NavigateEvent event:

    @@ -98653,7 +102052,9 @@ interface NavigationDestination {
  • Process scroll behavior given event.

    +
  • +

    To process scroll behavior given a NavigateEvent event:

      @@ -98687,6 +102088,7 @@ interface NavigationDestination {
    +
    @@ -98733,11 +102135,13 @@ dictionary NavigationCurrentEntryChangeEventInit : E
    +

    The navigationType and from attributes must return the values they were initialized to.

    +
    @@ -98773,13 +102177,17 @@ dictionary PopStateEventInit : EventInit {
    +

    The state attribute must return the value it was initialized to. It represents the context information for the event, or null, if the state represented is the initial state of the Document.

    +
    +

    The hasUAVisualTransition attribute must return the value it was initialized to.

    +
    @@ -98818,15 +102226,19 @@ dictionary HashChangeEventInit : EventInit {
    +

    The oldURL attribute must return the value it was initialized to. It represents context information for the event, specifically the URL of the session history entry that was traversed from.

    +
    +

    The newURL attribute must return the value it was initialized to. It represents context information for the event, specifically the URL of the session history entry that was traversed to.

    +
    @@ -98875,11 +102287,13 @@ dictionary PageSwapEventInit : EventInit {
    +

    The activation and viewTransition attributes must return the values they were initialized to.

    +
    @@ -98906,9 +102320,11 @@ dictionary PageRevealEventInit : EventInit {
    +

    The viewTransition attribute must return the value it was initialized to.

    +
    @@ -98957,10 +102373,13 @@ dictionary PageTransitionEventInit : EventInit +

    The persisted attribute must return the value it was initialized to. It represents the context information for the event.

    +
    +

    To fire a page transition event named eventName at a Window window with a boolean persisted, fire an event named eventName at window, using @@ -98969,6 +102388,7 @@ dictionary PageTransitionEventInit : EventInitpersisted, the cancelable attribute initialized to true, the bubbles attribute initialized to true, and legacy target override flag set.

    +

    The values for cancelable and bubbles don't make any sense, since canceling the event does @@ -98996,11 +102416,13 @@ interface BeforeUnloadEvent : Event {

    +

    The returnValue attribute controls the process of checking if unloading is canceled. When the event is created, the attribute must be set to the empty string. On getting, it must return the last value it was set to. On setting, the attribute must be set to the new value.

    +

    This attribute is a DOMString only for historical reasons. Any value besides the empty string will be treated as a request to ask the user for @@ -99075,12 +102497,15 @@ interface NotRestoredReasons { data-x="concept-not-restored-reason-details-backing-struct">backing struct, a not restored reason details or null, initially null.

    +

    The reason getter steps are to return this's backing struct's reason.

    +
    +

    To create a NotRestoredReasonDetails object given a not restored reason details backingStruct and a realm realm:

    @@ -99095,6 +102520,7 @@ interface NotRestoredReasons {
  • Return notRestoredReasonDetails.

  • +

    A not restored reason details is a struct with the following items:

    @@ -99374,24 +102800,31 @@ interface NotRestoredReasons { FrozenArray<NotRestoredReasons> or null, initially null.

    +

    The src getter steps are to return this's backing struct's src.

    +
    +

    The id getter steps are to return this's backing struct's id.

    +
    +

    The name getter steps are to return this's backing struct's name.

    +
    +

    The url getter steps are:

    @@ -99404,17 +102837,23 @@ interface NotRestoredReasons { data-x="concept-not-restored-reasons-backing-struct">backing struct's URL, serialized.

    +
    +

    The reasons getter steps are to return this's reasons array.

    +
    +

    The children getter steps are to return this's children array.

    +
    +

    To create a NotRestoredReasons object given a not restored reasons backingStruct and a realm realm:

    @@ -99481,6 +102920,7 @@ interface NotRestoredReasons {
  • Return notRestoredReasons.

  • +

    A not restored reasons is a struct with the following items:

    @@ -99502,6 +102942,7 @@ interface NotRestoredReasons { data-x="nrr-struct">not restored reasons, initially null.

    +

    A Document's not restored reasons is its node navigable's active session history entry's NotRestoredReasons { data-x="document-state-not-restored-reasons">not restored reasons, if Document's node navigable is a top-level traversable; otherwise null.

    +

    Infrastructure for sequences of documents

    @@ -99599,9 +103041,11 @@ interface NotRestoredReasons {
    +

    A navigable's active document is its active session history entry's document.

    +

    This can be safely read from within the session history traversal queue of the @@ -99609,37 +103053,48 @@ interface NotRestoredReasons { navigable's active history entry can change synchronously, the new entry will always have the same Document.

    +

    A navigable's active browsing context is its active document's browsing context. If this navigable is a traversable navigable, then its active browsing context will be a top-level browsing context.

    +
    +

    A navigable's active WindowProxy is its active browsing context's associated WindowProxy.

    +
    +

    A navigable's active window is its active WindowProxy's [[Window]].

    +

    This will always equal the navigable's active document's relevant global object; this is kept in sync by the make active algorithm.

    +

    A navigable's target name is its active session history entry's document state's navigable target name.

    +

    +

    To get the node navigable of a node node, return the navigable whose active document is node's node document, or null if there is no such navigable.

    +

    +

    To initialize the navigable navigable navigable, given a document state documentState and an optional navigable-or-null parent (default null):

    @@ -99674,6 +103129,7 @@ interface NotRestoredReasons {
  • Set navigable's parent to parent.

  • +
    Traversable navigables
    @@ -99712,6 +103168,7 @@ interface NotRestoredReasons {
  • An is created by web content boolean, initially false.

  • +

    To get the traversable navigable of a navigable inputNavigable:

    @@ -99723,11 +103180,14 @@ interface NotRestoredReasons {
  • Return navigable.

  • +
    Top-level traversables
    +

    A top-level traversable is a traversable navigable with a null parent.

    +

    Currently, all traversable navigables are top-level traversables. Future proposals envision @@ -99737,6 +103197,7 @@ interface NotRestoredReasons { set of top-level traversables). These are typically presented to the user in the form of browser windows or browser tabs.

    +

    To get the top-level traversable of a navigable inputNavigable:

    @@ -99748,7 +103209,9 @@ interface NotRestoredReasons {
  • Return navigable.

  • +
    +

    To create a new top-level traversable given a browsing context-or-null opener, a string targetName, and an optional navigable @@ -99812,7 +103275,9 @@ interface NotRestoredReasons {

  • Return traversable.

  • +
    +

    To create a fresh top-level traversable given a URL initialNavigationURL and an optional POST resource-or-null initialNavigationPostResource (default null):

    @@ -99833,6 +103298,7 @@ interface NotRestoredReasons {
  • Return traversable.

  • +
    Child navigables
    @@ -99845,10 +103311,13 @@ interface NotRestoredReasons { for="navigable container">content navigable, which is either a navigable or null. It is initially null.

    +

    The container of a navigable navigable is the navigable container whose content navigable is navigable, or null if there is no such element.

    +
    +

    The container document of a navigable navigable is the result of running these steps:

    @@ -99867,7 +103336,9 @@ interface NotRestoredReasons { connected.

    +
    +

    The container document of a Document document is the result of running these steps:

    @@ -99877,16 +103348,20 @@ interface NotRestoredReasons {
  • Return document's node navigable's container document.

  • +
    +

    A navigable navigable is a child navigable of another navigable potentialParent when navigable's parent is potentialParent. We can also just say that a navigable "is a child navigable", which means that its parent is non-null.

    +

    All child navigables are the content navigable of their container.

    +

    The content document of a navigable container container is the result of running these steps:

    @@ -99904,7 +103379,9 @@ interface NotRestoredReasons {
  • Return document.

  • +
    +

    The content window of a navigable container container is the result of running these steps:

    @@ -99915,9 +103392,11 @@ interface NotRestoredReasons {
  • Return container's content navigable's active WindowProxy's object.

  • +

    +

    To create a new child navigable, given an element element:

    @@ -100008,6 +103487,7 @@ interface NotRestoredReasons {
  • Invoke WebDriver BiDi navigable created with traversable.

  • +
    Jake diagrams
    @@ -100085,6 +103565,7 @@ interface NotRestoredReasons { Documents do have ancestor and descendant navigables, they often behave as if they don't (e.g., in the window.parent getter).

    +

    The ancestor navigables of a Document document are given by these steps:

    @@ -100108,7 +103589,9 @@ interface NotRestoredReasons {
  • Return ancestors.

  • +
    +

    The inclusive ancestor navigables of a Document document are given by these steps:

    @@ -100121,7 +103604,9 @@ interface NotRestoredReasons {
  • Return navigables.

  • +
    +

    The descendant navigables of a Document document are given by these steps:

    @@ -100150,7 +103635,9 @@ interface NotRestoredReasons {
  • Return navigables.

  • +
    +

    The inclusive descendant navigables of a Document document are given by these steps:

    @@ -100163,12 +103650,14 @@ interface NotRestoredReasons {
  • Return navigables.

  • +

    These descendant-collecting algorithms are described as looking at the DOM tree of descendant Document objects. In reality, this is often not feasible since the DOM tree can be in another process from the caller of the algorithm. Instead, implementations generally replicate the appropriate trees across processes.

    +

    The document-tree child navigables of a Document document are given by these steps:

    @@ -100197,10 +103686,12 @@ interface NotRestoredReasons {
  • Return navigables.

  • +
    Navigable destruction
    +

    To destroy a child navigable given a navigable container container:

    @@ -100242,7 +103733,9 @@ interface NotRestoredReasons {
  • Invoke WebDriver BiDi navigable destroyed with navigable.

  • +
    +

    To destroy a top-level traversable traversable:

    @@ -100274,10 +103767,12 @@ interface NotRestoredReasons {
  • Invoke WebDriver BiDi navigable destroyed with traversable.

  • +

    User agents may destroy a top-level traversable at any time (typically, in response to user requests).

    +

    To close a top-level traversable traversable:

    @@ -100288,7 +103783,9 @@ interface NotRestoredReasons {
  • Definitely close traversable.

  • +
    +

    To definitely close a top-level traversable traversable:

    @@ -100312,6 +103809,7 @@ interface NotRestoredReasons { +

    The close vs. definitely close separation allows other @@ -100328,15 +103826,19 @@ interface NotRestoredReasons { data-x="attr-hyperlink-target">target attribute) to target navigations at that navigable.

    +

    A valid navigable target name is any string with at least one character that does not contain both an ASCII tab or newline and a U+003C (<), and it does not start with a U+005F (_). (Names starting with a U+005F (_) are reserved for special keywords.)

    +
    +

    A valid navigable target name or keyword is any string that is either a valid navigable target name or that is an ASCII case-insensitive match for one of: _blank, _self, _parent, or _top.

    +

    These values have different meanings based on whether the page is sandboxed or not, as summarized in the following (non-normative) table. In this table, "current" means the @@ -100478,6 +103980,7 @@ interface NotRestoredReasons {


    +

    To find a navigable by target name given a string name and a navigable currentNavigable:

    @@ -100583,7 +104086,9 @@ interface NotRestoredReasons {
  • Return null.

  • +
    +

    The rules for choosing a navigable, given a string name, a navigable currentNavigable, and a boolean noopener are as follows:

    @@ -100717,6 +104222,7 @@ interface NotRestoredReasons {
  • Return chosen and windowType.

  • +

    Browsing contexts

    @@ -100752,18 +104258,24 @@ interface NotRestoredReasons { if the report-only policy had been enforced.

    +

    A browsing context's active window is its WindowProxy object's [[Window]] internal slot value. A browsing context's active document is its active window's associated Document.

    +
    +

    A browsing context's top-level traversable is its active document's node navigable's top-level traversable.

    +
    +

    A browsing context whose is auxiliary is true is known as an auxiliary browsing context. Auxiliary browsing contexts are always top-level browsing contexts.

    +

    It's unclear whether a separate is auxiliary concept is necessary. In issue #5680, it is indicated that we may @@ -100803,6 +104315,7 @@ interface NotRestoredReasons {

    Creating browsing contexts
    +

    To create a new browsing context and document, given null or a Document object creator, null or an element embedder, and a browsing context @@ -100967,7 +104480,9 @@ interface NotRestoredReasons {

  • Return browsingContext and document.

  • +
    +

    To create a new top-level browsing context and document:

    @@ -100978,7 +104493,9 @@ interface NotRestoredReasons {
  • Return group's browsing context set[0] and document.

  • +
    +

    To create a new auxiliary browsing context and document, given a browsing context opener:

    @@ -101016,7 +104533,9 @@ interface NotRestoredReasons {
  • Return browsingContext and document.

  • +
    +

    To determine the origin, given a URL url, a sandboxing flag set sandboxFlags, and an origin-or-null sourceOrigin:

    @@ -101049,10 +104568,12 @@ interface NotRestoredReasons { Documents that end up with the same underlying origin, meaning that document.domain affects both.

    +
    Related browsing contexts
    +

    A browsing context potentialDescendant is said to be an ancestor of a browsing context potentialAncestor if the following algorithm returns true:

    @@ -101074,13 +104595,17 @@ interface NotRestoredReasons {
  • Return false.

  • +
    +

    A top-level browsing context is a browsing context whose active document's node navigable is a traversable navigable.

    +

    It is not required to be a top-level traversable.

    +

    The top-level browsing context of a browsing context start is the result of the following algorithm:

    @@ -101097,6 +104622,7 @@ interface NotRestoredReasons {
  • Return navigable's active browsing context.

  • +
    +

    To create a new browsing context group and document:

    @@ -101226,7 +104755,9 @@ interface NotRestoredReasons {
  • Return group and document.

  • +
    +

    To append a top-level browsing context browsingContext to a browsing context group group:

    @@ -101237,7 +104768,9 @@ interface NotRestoredReasons {
  • Set browsingContext's group to group.

  • +
    +

    To remove a top-level browsing context browsingContext:

    @@ -101257,12 +104790,14 @@ interface NotRestoredReasons { empty, then remove group from the user agent's browsing context group set.

    +

    Append and remove are primitive operations that help define the lifetime of a browsing context group. They are called by higher-level creation and destruction operations for Documents and browsing contexts.

    +

    When there are no Document objects whose browsing context equals a given browsing context (i.e., all such Documents have been remove it.

    +

    Fully active documents

    +

    A Document d is said to be fully active when d is the active document of a navigable navigable, and either navigable is a top-level traversable or navigable's container document is fully active.

    +

    Because they are associated with an element, child navigables are always tied to a specific Document, their NotRestoredReasons { +

    To get a session history entry's document, return its document state's document.

    +

    @@ -101734,13 +105274,16 @@ interface NotRestoredReasons { data-x="session-history-traversal-parallel-queue-sync-nav-steps-target-nav">target navigable (a navigable).

    +

    To append session history traversal steps to a traversable navigable traversable given algorithm steps steps, append steps to traversable's session history traversal queue's algorithm set.

    +
    +

    To append session history synchronous navigation steps involving a navigable targetNavigable to a traversable navigable traversable given algorithm steps steps, @@ -101751,7 +105294,9 @@ interface NotRestoredReasons { navigable targetNavigable to traversable's session history traversal queue's algorithm set.

    +
    +

    To start a new session history traversal parallel queue:

    @@ -101784,6 +105329,7 @@ interface NotRestoredReasons {
  • Return sessionHistoryTraversalQueue.

  • +

    Synchronous navigation @@ -101980,6 +105526,7 @@ location.href = '#foo'; standard when manipulating session history. The best way to get a sense of what they do is to look at their call sites.

    +

    To get session history entries of a navigable navigable:

    @@ -102026,7 +105573,9 @@ location.href = '#foo';
  • Assert: this step is not reached.

  • +
    +

    To get session history entries for the navigation API of a navigable navigable given an integer targetStep:

    @@ -102089,7 +105638,9 @@ location.href = '#foo';
  • Return entriesForNavigationAPI.

  • +
    +

    To clear the forward session history of a traversable navigable navigable:

    @@ -102127,7 +105678,9 @@ location.href = '#foo'; +
    +

    To get all used history steps that are part of traversable navigable traversable:

    @@ -102166,6 +105719,7 @@ location.href = '#foo';
  • Return steps, sorted.

  • +
    @@ -102230,6 +105784,7 @@ location.href = '#foo';
    a policy container
    +

    To snapshot source snapshot params given a Document-or-null sourceDocument:

    @@ -102283,6 +105838,7 @@ location.href = '#foo'; +

    @@ -102296,12 +105852,14 @@ location.href = '#foo';
    a sandboxing flag set
    +

    To snapshot target snapshot params given a navigable targetNavigable, return a new target snapshot params with sandboxing flags set to the result of determining the creation sandboxing flags given targetNavigable's active browsing context and targetNavigable's container.

    +

    @@ -102419,6 +105977,7 @@ location.href = '#foo'; data-x="NavigationHistoryBehavior-replace">replace", i.e., that has been resolved away from any initial "auto" value.

    +

    The navigation must be a replace, given a URL url and a Document document, if any of the following are true:

    @@ -102428,6 +105987,7 @@ location.href = '#foo';
  • document's is initial about:blank is true.

  • +

    Other cases that often, but not always, force a "

    The navigation was not initiated by the user.
    +

    For convenience at certain call sites, the user navigation involvement for an Event event is defined as follows:

    @@ -102476,6 +106037,7 @@ location.href = '#foo';
  • Return "none".

  • +
    Beginning navigation
    @@ -102484,6 +106046,7 @@ location.href = '#foo'; +

    To navigate a navigable navigable to a URL url using an optional Document-or-null sourceDocument (default null), with an optional POST @@ -102974,6 +106537,7 @@ location.href = '#foo'; +

    Ending navigation
    @@ -102986,6 +106550,7 @@ location.href = '#foo';
    The usual cross-document navigation case
    +

    To finalize a cross-document navigation given a navigable navigable, a history handling behavior historyHandling, a user navigation involvement userInvolvement, and a session history @@ -103083,6 +106648,7 @@ location.href = '#foo';

  • Apply the push/replace history step targetStep to traversable given historyHandling and userInvolvement.

  • +
    The javascript: URL special case
    @@ -103091,6 +106657,7 @@ location.href = '#foo'; href="https://github.com/whatwg/html/labels/topic%3A%20javascript%3A%20URLs">dedicated label on the issue tracker documenting various problems with their specification.

    +

    To navigate to a javascript: URL, given a navigable targetNavigable, a URL url, a history handling behavior historyHandling, a source snapshot params @@ -103218,7 +106785,9 @@ location.href = '#foo'; to finalize a cross-document navigation with targetNavigable, historyHandling, userInvolvement, and historyEntry.

    +
    +

    To evaluate a javascript: URL given a navigable targetNavigable, a URL url, an origin newDocumentOrigin, and a user navigation involvement @@ -103366,10 +106935,12 @@ location.href = '#foo';

  • Return the result of loading an HTML document given navigationParams.

  • +
    Fragment navigations
    +

    To navigate to a fragment given a navigable navigable, a URL url, a history handling behavior historyHandling, a user navigation involvement userInvolvement, @@ -103514,7 +107085,9 @@ location.href = '#foo'; +

    +

    To finalize a same-document navigation given a traversable navigable traversable, a navigable targetNavigable, a session history entry targetEntry, a session history entry-or-null @@ -103580,6 +107153,7 @@ location.href = '#foo'; conditions across multiple synchronous navigations.

    +
    Non-fetch schemes and external software
    @@ -103635,6 +107209,7 @@ location.href = '#foo'; Document (if one is created) +

    To attempt to create a non-fetch scheme document, given a non-fetch scheme navigation params navigationParams:

    @@ -103677,7 +107252,9 @@ location.href = '#foo'; invoked with a new URL.

    +
    +

    To hand-off to external software given a URL or response resource, a navigable navigable, a sandboxing flag set sandboxFlags, a boolean @@ -103724,6 +107301,7 @@ location.href = '#foo'; link.

    +
    Preventing navigation
    @@ -103732,6 +107310,7 @@ location.href = '#foo'; a halt. This can be especially exciting when multiple navigables are navigating at the same time, due to a session history traversal.

    +

    A navigable source is allowed by sandboxing to navigate a second navigable target, given a source snapshot params sourceSnapshotParams, if the following steps @@ -103786,7 +107365,9 @@ location.href = '#foo';

  • Return true.

  • +
    +

    To check if unloading is canceled for a list of

  • Return finalStatus.

  • +
    +

    The steps to fire beforeunload given a Document document and a boolean unloadPromptShown are:

    @@ -104014,6 +107597,7 @@ location.href = '#foo';
  • Return (unloadPromptShown, unloadPromptCanceled).

  • +
    Aborting navigation
    @@ -104023,6 +107607,7 @@ location.href = '#foo'; null. It is used to track navigation aborting and to prevent any navigations from taking place during traversal.

    +

    To set the ongoing navigation for a navigable navigable to newValue:

    @@ -104036,10 +107621,12 @@ location.href = '#foo';
  • Set navigable's ongoing navigation to newValue.

  • +

    Reloading and traversing

    +

    To reload a navigable navigable given an optional serialized state-or-null navigationAPIState (default null) and an @@ -104097,7 +107684,9 @@ location.href = '#foo'; +

    +

    To traverse the history by a delta given a traversable navigable traversable, an integer delta, and an optional Document sourceDocument:

    @@ -104147,6 +107736,7 @@ location.href = '#foo'; +
    @@ -104159,6 +107749,7 @@ location.href = '#foo'; standard also need to perform updates to the active history entry, and they use these steps to do so.

    +

    The URL and history update steps, given a Document document, a URL newURL, an optional serialized state-or-null serializedData (default @@ -104264,6 +107855,7 @@ location.href = '#foo'; +

    Although both fragment navigation and the URL and history update steps perform synchronous history updates, only fragment @@ -104294,6 +107886,7 @@ location.href = '#foo'; session history entry with an error document.

    +

    To attempt to populate the history entry's document for a session history entry entry, given a navigable navigable, a NavigationTimingType navTimingType, a source snapshot params @@ -104616,7 +108209,9 @@ location.href = '#foo'; +

    +

    To create navigation params from a srcdoc resource given a session history entry entry, a navigable navigable, a target snapshot params targetSnapshotParams, a user navigation involvement @@ -104729,7 +108324,9 @@ location.href = '#foo'; +

    +

    To create navigation params by fetching given a session history entry entry, a navigable navigable, a source snapshot params sourceSnapshotParams, a @@ -105406,7 +109003,9 @@ location.href = '#foo'; +

    +

    An element has a browsing context scope origin if its Document's node navigable is a top-level traversable or if all of its Document's ancestor navigables have node document's origin. If an element has a browsing context scope origin, then its value is the origin of the element's node document.

    +

    This definition is broken and needs investigation to see what it was intended to express: see issue #4703.

    +

    To load a document given navigation params navigationParams, source snapshot params sourceSnapshotParams, and origin initiatorOrigin, perform the following steps. They return a @@ -105517,6 +109118,7 @@ location.href = '#foo';

  • Return null.

  • +

    Applying the history step

    @@ -105561,6 +109163,7 @@ location.href = '#foo'; the history step algorithm, each possible entry point comes along with some minor customizations:

    +

    To update for navigable creation/destruction given a traversable navigable traversable:

    @@ -105572,7 +109175,9 @@ location.href = '#foo'; step step to traversable given false, null, null, "none", and null.

    +
    +

    To apply the push/replace history step given a non-negative integer step to a traversable navigable traversable, given a history handling behavior historyHandling and a user navigation involvement @@ -105583,12 +109188,14 @@ location.href = '#foo'; step step to traversable given false, null, null, userInvolvement, and historyHandling.

    +

    Apply the push/replace history step never passes source snapshot params or an initiator navigable to apply the history step. This is because those checks are done earlier in the navigation algorithm.

    +

    To apply the reload history step to a traversable navigable traversable given user navigation involvement userInvolvement:

    @@ -105602,12 +109209,14 @@ location.href = '#foo'; userInvolvement, and "reload".

    +

    Apply the reload history step never passes source snapshot params or an initiator navigable to apply the history step. This is because reloading is always treated as if it were done by the navigable itself, even in cases like parent.location.reload().

    +

    To apply the traverse history step given a non-negative integer step to a traversable navigable traversable, with source snapshot params sourceSnapshotParams, navigable initiatorToCheck, @@ -105620,12 +109229,15 @@ location.href = '#foo'; userInvolvement, and "traverse".

    +
    +

    To resume applying the traverse history step given a non-negative integer step, a traversable navigable traversable, and user navigation involvement userInvolvement, apply step to traversable given false, null, null, userInvolvement, and "traverse".

    +

    When resuming a traverse, we are already past the cancelation, initiator, and source snapshot checks, and this traversal has already been determined to be a same-document @@ -105635,6 +109247,7 @@ location.href = '#foo';

    Now for the algorithm itself.

    +

    To apply the history step given a non-negative integer step to a traversable navigable traversable, with boolean checkForCancelation, source snapshot @@ -106162,7 +109775,9 @@ location.href = '#foo';

  • Return "applied".

  • +
    +

    To deactivate a document for a cross-document navigation given a Document displayedDocument, a user navigation involvement userNavigationInvolvement, a session history entry targetEntry, @@ -106266,7 +109881,9 @@ location.href = '#foo'; +

    +

    To fire the pageswap event given a Document displayedDocument, a session history entry targetEntry, a NavigationType navigationType, and a @@ -106354,7 +109971,9 @@ location.href = '#foo'; and its viewTransition set to viewTransition.

    +
    +

    To activate history entry session history entry entry for navigable navigable:

    @@ -106376,7 +109995,9 @@ location.href = '#foo';
  • Make active newDocument.

  • +
    +

    To get the used step given a traversable navigable traversable, and a non-negative integer step, perform the following steps. They return a non-negative integer.

    @@ -106394,7 +110015,9 @@ location.href = '#foo'; navigable.

    +
    +

    To get the history object length and index given a traversable navigable traversable, and a non-negative integer step, perform the following steps. They return a tuple of two @@ -106420,7 +110043,9 @@ location.href = '#foo';

  • Return (scriptHistoryLength, scriptHistoryIndex).

  • +
    +

    To get all navigables whose current session history entry will change or reload given a traversable navigable traversable, and a non-negative integer targetStep, perform the following steps. They return a list of

  • Return results.

  • +
    +

    To get all navigables that only need history object length/index update given a traversable navigable traversable, and a non-negative integer targetStep, @@ -106526,7 +110153,9 @@ location.href = '#foo';

  • Return results.

  • +
    +

    To get the target history entry given a navigable navigable, and a non-negative integer step, perform the following steps. They return a session history entry.

    @@ -106538,6 +110167,7 @@ location.href = '#foo';
  • Return the item in entries that has the greatest step less than or equal to step.

  • +

    To see why getting the target history entry returns the entry with the greatest @@ -106562,6 +110192,7 @@ location.href = '#foo';

    document's URL - targetURL + document's URL + targetURL can have its URL rewritten
    0123
    top/t/t#foo
    frames[0]/i-0-a/i-0-b
    +

    To get all navigables that might experience a cross-document traversal given a traversable navigable traversable, and a non-negative integer targetStep, @@ -106625,10 +110256,12 @@ location.href = '#foo';

  • Return results.

  • +
    Updating the document
    +

    To update document for history step application given a Document document, a session history entry entry, a boolean doNotReactivate, integers scriptHistoryLength and @@ -106821,7 +110454,9 @@ location.href = '#foo'; cases.

    +
    +

    To restore the history object state given Document document and session history entry entry:

    @@ -106836,7 +110471,9 @@ location.href = '#foo';
  • Set document's history object's state to state.

  • +
    +

    To make active a Document document:

      @@ -106859,7 +110496,9 @@ location.href = '#foo';
    1. Set window's relevant settings object's execution ready flag.

    +
    +

    To reactivate a Document document given a session history entry reactivatedEntry and a list of salvageable state to false.

    +
    +

    To build not restored reasons for document state given Document document:

    @@ -107039,7 +110684,9 @@ location.href = '#foo'; data-x="document-state-not-restored-reasons">not restored reasons to notRestoredReasonsForDocument.

    +
    +

    To build not restored reasons for a top-level traversable and its descendants given top-level traversable topLevelTraversable:

      @@ -107091,6 +110738,7 @@ location.href = '#foo'; data-x="nav-document">active document and "masked".

    +
    Revealing the document
    @@ -107099,6 +110747,7 @@ location.href = '#foo'; activation of the Document (once when it's rendered initially, and once for each reactivation).

    +

    To reveal a Document document:

      @@ -107133,6 +110782,7 @@ location.href = '#foo'; step.

    +

    Though pagereveal is guaranteed to be fired during the first update the rendering step that displays an up-to-date version of the @@ -107143,6 +110793,7 @@ location.href = '#foo';

    Scrolling to a fragment
    +

    To scroll to the fragment given a Document document:

    @@ -107189,7 +110840,9 @@ location.href = '#foo'; +
    +

    A Document's indicated part is the one that its URL's fragment identifies, or null if the fragment does not @@ -107198,17 +110851,21 @@ location.href = '#foo'; type used by the Document (for example, the processing of fragments for XML MIME types is the responsibility of RFC7303). RFC7303

    +

    There is also a target element for each Document, which is used in defining the :target pseudo-class and is updated by the above algorithm. It is initially null.

    +

    For an HTML document document, its indicated part is the result of selecting the indicated part given document and document's URL.

    +
    +

    To select the indicated part given a Document document and a URL url:

    @@ -107249,7 +110906,9 @@ location.href = '#foo';
  • Return null.

  • +
    +

    To find a potential indicated element given a Document document and a string fragment, run these steps:

    @@ -107266,10 +110925,12 @@ location.href = '#foo';
  • Return null.

  • +
    Persisted history entry state
    +

    To save persisted state to a session history entry entry:

    @@ -107282,7 +110943,9 @@ location.href = '#foo'; to reflect any state that the user agent wishes to persist, such as the values of form fields.

    +
    +

    To restore persisted state from a session history entry entry:

    @@ -107328,6 +110991,7 @@ location.href = '#foo'; custom element">form-associated custom elements.

    +

    @@ -107335,14 +110999,17 @@ location.href = '#foo'; false. If the user scrolls the document, the user agent must set that document's has been scrolled by the user to true.

    +

    The restorable scrollable regions of a Document document are document's viewport, and all of document's scrollable regions excepting any navigable containers.

    +

    Child navigable scroll restoration is handled as part of state restoration for the session history entry for those navigables' Documents.

    +

    To restore scroll position data given a session history entry entry:

    @@ -107369,12 +111036,14 @@ location.href = '#foo'; CSSSCROLLANCHORING

    +

    Document lifecycle

    Shared document creation infrastructure

    +

    When loading a document using one of the below algorithms, we use the following steps to create and initialize a Document object, @@ -107695,6 +111364,7 @@ location.href = '#foo';

  • Return document.

  • +

    In this example, the child document is not allowed to use PaymentRequest, @@ -107739,6 +111409,7 @@ new PaymentRequest(…); // Allowed to use </script>

    +

    To populate with html/head/body given a Document document:

    @@ -107764,10 +111435,12 @@ new PaymentRequest(…); // Allowed to use
  • Append body to html.

  • +

    Loading HTML documents

    +

    To load an HTML document, given navigation params navigationParams:

    @@ -107819,10 +111492,12 @@ new PaymentRequest(…); // Allowed to use
  • Return document.

  • +

    Loading XML documents

    +

    When faced with displaying an XML file inline, provided navigation params navigationParams and a string type, user agents must follow the requirements defined in XML and Namespaces in XML, XML Media @@ -107854,6 +111529,7 @@ new PaymentRequest(…); // Allowed to use

    Once parsing is complete, the user agent must set document's during-loading navigation ID for WebDriver BiDi to null.

    +

    For HTML documents this is reset when parsing is complete, after firing the load event.

    @@ -107864,6 +111540,7 @@ new PaymentRequest(…); // Allowed to use

    Loading text documents

    +

    To load a text document, given a navigation params navigationParams and a string type:

    @@ -107924,10 +111601,12 @@ new PaymentRequest(…); // Allowed to use the rules for actually rendering the text to the user, are defined by the specifications for the computed MIME type of the resource (i.e., type).

    +

    Loading multipart/x-mixed-replace documents

    +

    To load a multipart/x-mixed-replace document, given navigation params navigationParams, source snapshot params sourceSnapshotParams, @@ -107966,6 +111645,7 @@ new PaymentRequest(…); // Allowed to use

  • Return document.

  • +

    For the purposes of algorithms processing these body parts as if they were complete stand-alone resources, the user agent must act as if there were no more bytes for those resources @@ -107977,6 +111657,7 @@ new PaymentRequest(…); // Allowed to use

    Loading media documents

    +

    To load a media document, given navigationParams and a string type:

    @@ -108033,16 +111714,20 @@ new PaymentRequest(…); // Allowed to use audio src +
    +

    Before any script execution occurs, the user agent must wait for scripts may run for the newly-created document to be true for the Document.

    +
    -

    Loading a document for inline content that doesn't have a - DOM

    +

    Loading + a document for inline content that doesn't have a DOM

    -

    When the user agent is to create a document to display a user agent page or PDF viewer inline, +

    +

    When the user agent is to create a document to display a user + agent page or PDF viewer inline, provided a navigable navigable, a navigation ID navigationId, a NavigationTimingType navTimingType, and a user navigation involvement userInvolvement, the user agent should:

    @@ -108141,9 +111826,12 @@ new PaymentRequest(…); // Allowed to use Similarly, most of the items in navigationParams don't have any observable effect, besides preventing the Document-creation algorithm from getting confused, and so are set to default values.

    +
    +

    Once the page has been set up, the user agent must act as if it had stopped parsing.

    +

    Finishing the loading process

    @@ -108151,9 +111839,12 @@ new PaymentRequest(…); // Allowed to use

    A Document has a completely loaded time (a time or null), which is initially null.

    +

    A Document is considered completely loaded if its completely loaded time is non-null. +

    +

    To completely finish loading a Document document:

      @@ -108192,6 +111883,7 @@ new PaymentRequest(…); // Allowed to use data-x="concept-event-fire">fire an event named load at container.

    +

    Unloading documents

    @@ -108217,6 +111909,7 @@ new PaymentRequest(…); // Allowed to use counter, which is used to ignore certain operations while the below algorithms run. Initially, the counter must be set to zero.

    +

    To unload a Document oldDocument, given an optional Document newDocument:

    @@ -108333,7 +112026,9 @@ new PaymentRequest(…); // Allowed to use newDocument's previous document unload timing to unloadTimingInfo.

    +
    +

    To unload a document and its descendants, given a Document document, an optional Document-or-null newDocument (default null), an optional set of steps afterAllUnloads, and an optional set of steps @@ -108384,7 +112079,9 @@ new PaymentRequest(…); // Allowed to use +

    +

    This specification defines the following unloading document cleanup steps. Other specifications can define more. Given a Document document:

    @@ -108420,6 +112117,7 @@ new PaymentRequest(…); // Allowed to use +

    It would be better if specification authors sent a pull request to add calls from here into @@ -108441,6 +112139,7 @@ new PaymentRequest(…); // Allowed to use

    Destroying documents

    +

    To destroy a Document document:

    @@ -108485,11 +112184,13 @@ new PaymentRequest(…); // Allowed to use scopes, terminate workletGlobalScope.

    +

    Even after destruction, the Document object itself might still be accessible to script, in the case where we are destroying a child navigable.

    +

    To destroy a document and its descendants given a Document document and an optional set of steps afterAllDestruction, perform the following steps in parallel:

    @@ -108549,9 +112250,11 @@ new PaymentRequest(…); // Allowed to use +

    Aborting a document load

    +

    To abort a Document document:

      @@ -108600,7 +112303,9 @@ new PaymentRequest(…); // Allowed to use
    +
    +

    To abort a document and its descendants given a Document document:

    @@ -108632,7 +112337,9 @@ new PaymentRequest(…); // Allowed to use
  • Abort document.

  • +
    +

    To stop loading a navigable navigable:

    @@ -108652,6 +112359,7 @@ new PaymentRequest(…); // Allowed to use
  • Abort a document and its descendants given document.

  • +

    Through their user interface, user agents also allow stopping traversals, i.e. cases where the ongoing navigation is " +

    A speculation rule eagerness A is less eager than another speculation rule eagerness B if A follows B in the above list.

    +
    +

    A speculation rule eagerness A is at least as eager as another speculation rule eagerness B if A is not less eager than B.

    +

    @@ -108999,6 +112711,7 @@ new PaymentRequest(…); // Allowed to use rule set is discarded.

    +

    To parse a speculation rule set string given a string input, a Document document, and a URL baseURL:

    @@ -109073,7 +112786,9 @@ new PaymentRequest(…); // Allowed to use
  • Return result.

  • +
    +

    To parse a speculation rule given a map input, a speculation rule tag rulesetLevelTag, a Document document, and a URL baseURL:

    @@ -109442,7 +113157,9 @@ new PaymentRequest(…); // Allowed to use +
    +

    To parse a document rule predicate given a value input, a Document document, and a URL baseURL:

    @@ -109694,6 +113411,7 @@ new PaymentRequest(…); // Allowed to use
  • Assert: this step is never reached, as one of the previous branches was taken.

  • +
    Processing model
    @@ -109734,6 +113452,7 @@ new PaymentRequest(…); // Allowed to use
    +

    A speculative load candidate candidateA is redundant with another speculative load candidate candidateB if the following steps return true:

    @@ -109750,6 +113469,7 @@ new PaymentRequest(…); // Allowed to use
  • Return true.

  • +

    The requirement that the No-Vary-Search hints be @@ -109768,7 +113488,7 @@ new PaymentRequest(…); // Allowed to use practices and use static `No-Vary-Search` header values/speculation rule hints.

    -
    +

    Consider three speculative load candidates:

    @@ -109811,6 +113531,7 @@ new PaymentRequest(…); // Allowed to use

    Every Document has a consider speculative loads microtask queued, a boolean, initially false.

    +

    To consider speculative loads for a Document document:

      @@ -109841,6 +113562,7 @@ new PaymentRequest(…); // Allowed to use
    +

    In addition to the call sites explicitly given in this standard:

    @@ -109875,6 +113597,7 @@ new PaymentRequest(…); // Allowed to use together.

    +

    The inner consider speculative loads steps for a Document document are:

    @@ -110129,7 +113852,9 @@ new PaymentRequest(…); // Allowed to use +
    +

    To compute a speculative load referrer policy given a speculation rule rule and an a element, area element, or null link:

    @@ -110143,7 +113868,9 @@ new PaymentRequest(…); // Allowed to use
  • Return link's hyperlink referrer policy.

  • +
    +

    To collect tags from speculative load candidates given a list of speculative load candidates candidates:

    @@ -110167,9 +113894,11 @@ new PaymentRequest(…); // Allowed to use
  • Return tags.

  • +

    +

    To find matching links given a Document document and a document rule predicate predicate:

    @@ -110206,7 +113935,9 @@ new PaymentRequest(…); // Allowed to use
  • Return links.

  • +
    +

    A document rule predicate predicate matches an a or area element el if the following steps return true, switching on predicate's type:

    @@ -110292,6 +114023,7 @@ new PaymentRequest(…); // Allowed to use +

    @@ -110354,6 +114086,7 @@ new PaymentRequest(…); // Allowed to use strings that are all valid URL strings.

    +

    To process the `Speculation-Rules` header given a Document document and a response response:

    @@ -110439,6 +114172,7 @@ new PaymentRequest(…); // Allowed to use +

    The `Sec-Speculation-Tags` header

    @@ -110664,6 +114398,7 @@ new PaymentRequest(…); // Allowed to use
    +

    To check a navigation response's adherence to `X-Frame-Options`, given a response response, a navigable navigable, a CSP list cspList, and @@ -110751,6 +114486,7 @@ new PaymentRequest(…); // Allowed to use entirely.

    +

    @@ -111056,6 +114792,7 @@ new PaymentRequest(…); // Allowed to use
    +

    To create an agent, given a boolean canBlock:

      @@ -111073,15 +114810,20 @@ new PaymentRequest(…); // Allowed to use
    1. Return agent.

    +
    +

    For a realm realm, the agent whose [[Signifier]] is realm.[[AgentSignifier]] is the realm's agent.

    +
    +

    The relevant agent for a platform object platformObject is platformObject's relevant realm's agent.

    +

    The agent equivalent of the current realm is the surrounding agent.

    @@ -111131,6 +114873,7 @@ new PaymentRequest(…); // Allowed to use

    An equivalent formulation is that an agent cluster key can be a scheme-and-host or an origin.

    +

    To obtain a similar-origin window agent, given an origin origin, a browsing context group group, and a boolean requestsOAC, run these steps:

    @@ -111194,6 +114937,7 @@ new PaymentRequest(…); // Allowed to use
  • Return the single similar-origin window agent contained in group's agent cluster map[key].

  • +

    This means that there is only one similar-origin window agent per browsing context agent cluster. (However, dedicated @@ -111205,6 +114949,7 @@ new PaymentRequest(…); // Allowed to use

    The following defines the allocation of the agent clusters of all other types of agents.

    +

    To obtain a worker/worklet agent, given an environment settings object or null outside settings, a boolean isTopLevel, and a boolean canBlock, run these steps:

    @@ -111250,18 +114995,25 @@ new PaymentRequest(…); // Allowed to use
  • Return agent.

  • +
    +

    To obtain a dedicated/shared worker agent, given an environment settings object outside settings and a boolean isShared, return the result of obtaining a worker/worklet agent given outside settings, isShared, and true.

    +
    +

    To obtain a worklet agent, given an environment settings object outside settings, return the result of obtaining a worker/worklet agent given outside settings, false, and false.

    +
    +

    To obtain a service worker agent, return the result of obtaining a worker/worklet agent given null, true, and false.

    +

    @@ -111276,7 +115028,7 @@ new PaymentRequest(…); // Allowed to use
  • A worker (of any type) and a dedicated worker it created.

  • -
  • A Window object A and the Window object of an +

  • A Window object A and the Window object of an iframe element that A created that could be same origin-domain with A.

  • @@ -111296,7 +115048,7 @@ new PaymentRequest(…); // Allowed to use
  • A Window object and a service worker it created.

  • -
  • A Window object A and the Window object of an +

  • A Window object A and the Window object of an iframe element that A created that cannot be same origin-domain with A.

  • @@ -111460,15 +115212,19 @@ new PaymentRequest(…); // Allowed to use
    A number used as the baseline for performance-related timestamps. HRT
    +

    An environment settings object's responsible event loop is its global object's relevant agent's event loop.

    +
    Realms, settings objects, and global objects
    +

    A global object is a JavaScript object that is the [[GlobalObject]] field of a realm.

    +

    In this specification, all realms are created with global @@ -111513,13 +115269,21 @@ new PaymentRequest(…); // Allowed to use object">environment settings objects:

      -
    • A realm has a [[HostDefined]] field, which contains the realm's - settings object.

    • +
    • +
      +

      A realm has a [[HostDefined]] field, which contains the realm's + settings object.

      +
      +
    • -
    • A realm has a [[GlobalObject]] field, which contains the realm's global - object.

    • +
    • +
      +

      A realm has a [[GlobalObject]] field, which contains the realm's global + object.

      +
      +
    • Each global object in this specification is created during the creation of a corresponding realm, known as @@ -111530,16 +115294,25 @@ new PaymentRequest(…); // Allowed to use specification is created alongside a corresponding environment settings object, known as its relevant settings object.

      -
    • An environment settings object's realm execution context's - Realm component is the environment settings object's realm.

    • +
    • +
      +

      An environment settings object's realm execution context's + Realm component is the environment settings object's realm.

      +
      +
    • -
    • An environment settings object's realm then has a [[GlobalObject]] field, which contains the environment settings object's global object.

    • +
    • +
      +

      An environment settings object's realm then has a [[GlobalObject]] field, which contains the environment settings object's global object.

      +
      +
    +

    To create a new realm in an agent agent, optionally with instructions to create a global object or a global this binding (or both), the following steps are taken:

    @@ -111585,6 +115358,7 @@ new PaymentRequest(…); // Allowed to use
  • Return realm execution context.

  • +

    @@ -111757,18 +115531,24 @@ new PaymentRequest(…); // Allowed to use execution context stack, interspersed with other execution contexts.

    +

    With this in hand, we define the entry execution context to be the most recently pushed item in the JavaScript execution context stack that is a realm execution context. The entry realm is the entry execution context's Realm component.

    +
    +

    Then, the entry settings object is the environment settings object of the entry realm.

    +
    +

    Similarly, the entry global object is the global object of the entry realm.

    +
    Incumbent
    @@ -111790,6 +115570,7 @@ new PaymentRequest(…); // Allowed to use code, or when HostEnqueuePromiseJob invokes a promise job, they use the following algorithms to track relevant data for determining the incumbent settings object:

    +

    To prepare to run a callback with an environment settings object settings:

    @@ -111803,7 +115584,9 @@ new PaymentRequest(…); // Allowed to use
  • If context is not null, increment context's skip-when-determining-incumbent counter.

  • +
    +

    To clean up after running a callback with an environment settings object settings:

    @@ -111825,11 +115608,15 @@ new PaymentRequest(…); // Allowed to use
  • Remove settings from the backup incumbent settings object stack.

  • +
    +

    Here, the topmost script-having execution context is the topmost entry of the JavaScript execution context stack that has a non-null ScriptOrModule component, or null if there is no such entry in the JavaScript execution context stack.

    +
    +

    With all this in place, the incumbent settings object is determined as follows:

    @@ -111864,14 +115651,19 @@ new PaymentRequest(…); // Allowed to use
  • Return context's Realm component's settings object.

  • +
    +

    Then, the incumbent realm is the realm of the incumbent settings object.

    +
    +

    Similarly, the incumbent global object is the global object of the incumbent settings object.

    +

    @@ -112043,31 +115835,42 @@ document.querySelector("button").addEventListener("click", bound);

    The JavaScript specification defines the current realm, also known as the "current Realm Record". JAVASCRIPT

    +

    Then, the current settings object is the environment settings object of the current realm.

    +
    +

    Similarly, the current global object is the global object of the current realm.

    +
    Relevant
    +

    The relevant realm for a platform object is the value of its [[Realm]] field.

    +
    +

    Then, the relevant settings object for a platform object o is the environment settings object of the relevant realm for o.

    +
    +

    Similarly, the relevant global object for a platform object o is the global object of the relevant realm for o.

    +
    Enabling and disabling scripting
    +

    Scripting is enabled for an environment settings object settings when all of the following conditions are true:

    @@ -112089,18 +115892,23 @@ document.querySelector("button").addEventListener("click", bound); sandboxing flag set does not have its sandboxed scripts browsing context flag set. +
    +

    Scripting is disabled for an environment settings object when scripting is not enabled for it, i.e., when any of the above conditions are false.

    +

    +

    Scripting is enabled for a node node if node's node document's browsing context is non-null, and scripting is enabled for node's relevant settings object.

    +

    Scripting is disabled for a node when scripting is not enabled, i.e., when its node document's Secure contexts +

    An environment environment is a secure context if the following algorithm returns true:

    @@ -112152,9 +115961,12 @@ document.querySelector("button").addEventListener("click", bound);
  • Return false.

  • +
    +

    An environment is a non-secure context if it is not a secure context.

    +
    @@ -112261,15 +116073,21 @@ document.querySelector("button").addEventListener("click", bound);

    Module scripts can be classified into four types:

      -
    • A module script is a JavaScript module script if - its record is a Source Text Module - Record.

    • +
    • +
      +

      A module script is a JavaScript module script if + its record is a Source Text Module + Record.

      +
      +
    • +

      A module script is a CSS module script if its record is a Synthetic Module Record, and it was created via the create a CSS module script algorithm. CSS module scripts represent a parsed CSS style sheet.

      +
      +

      An event loop must continually run through the following steps for as long as it exists:

      @@ -116867,7 +120860,9 @@ import "https://example.com/foo/../module2.mjs";
    • +
    +

    A window event loop eventLoop must also run the following in parallel, as long as it exists:

    @@ -117151,11 +121146,14 @@ import "https://example.com/foo/../module2.mjs"; +
    +

    A navigable has a rendering opportunity if the user agent is currently able to present the contents of the navigable to the user, accounting for hardware refresh rate constraints and user agent throttling for performance reasons, but considering content presentable even if it's outside the viewport.

    +

    A navigable's rendering opportunities are determined based on hardware constraints such as display refresh rates and other factors such @@ -117175,6 +121173,7 @@ import "https://example.com/foo/../module2.mjs";


    +

    When a user agent is to perform a microtask checkpoint:

      @@ -117229,9 +121228,11 @@ import "https://example.com/foo/../module2.mjs";
    1. Record timing info for microtask checkpoint.

    +

    +

    When an algorithm running in parallel is to await a stable state, the user agent must queue a microtask that runs the following steps, and must then stop executing (execution of the algorithm resumes when the microtask is run, as described in the @@ -117243,12 +121244,14 @@ import "https://example.com/foo/../module2.mjs";

  • Resume execution of the algorithm in parallel, if appropriate, as described in the algorithm's steps.

  • +

    Steps in synchronous sections are marked with ⌛.


    +

    Algorithm steps that say to spin the event loop until a condition goal is met are equivalent to substituting in the following algorithm steps:

    @@ -117306,6 +121309,7 @@ import "https://example.com/foo/../module2.mjs"; a microtask checkpoint algorithm to continue.

    +

    Unlike other algorithms in this and other specifications, which behave similar to programming-language function calls, spin the event loop is more like a macro, which @@ -117315,6 +121319,7 @@ import "https://example.com/foo/../module2.mjs";

    An algorithm whose steps are:

    +
    1. Do something.

    2. @@ -117322,9 +121327,11 @@ import "https://example.com/foo/../module2.mjs";
    3. Do something else.

    +

    is a shorthand which, after "macro expansion", becomes

    +
    1. Do something.

    2. @@ -117354,12 +121361,14 @@ import "https://example.com/foo/../module2.mjs";
    +

    Here is a more full example of the substitution, where the event loop is spun from inside a task that is queued from work in parallel. The version using spin the event loop:

    +
    1. In parallel:

      @@ -117383,9 +121392,11 @@ import "https://example.com/foo/../module2.mjs";
    +

    The fully expanded version:

    +
    1. In parallel:

      @@ -117427,10 +121438,12 @@ import "https://example.com/foo/../module2.mjs";
    +

    +

    Some of the algorithms in this specification, for historical reasons, require the user agent to pause while running a task until a condition goal is met. This means running the following steps:

    @@ -117455,6 +121468,7 @@ import "https://example.com/foo/../module2.mjs"; timeBeforePause to the current high resolution time given global.

    +

    Pausing is highly detrimental to the user experience, especially @@ -117582,6 +121596,7 @@ import "https://example.com/foo/../module2.mjs"; task combined with the implied event loop and implied document concepts, but this is discouraged.

    +

    Putting this all together, we can provide a template for a typical algorithm that needs to do work asynchronously:

    @@ -117597,9 +121612,11 @@ import "https://example.com/foo/../module2.mjs"; appropriate global object, to convert the realm-agnostic result back into observable effects on the observable world of JavaScript objects on the event loop.

    +
    +

    The following is an algorithm that "encrypts" a passed-in list of scalar value strings input, after parsing them as URLs:

    @@ -117667,6 +121684,7 @@ import "https://example.com/foo/../module2.mjs";
  • Return p.

  • +

    Here are several things to notice about this algorithm:

    @@ -117692,7 +121710,7 @@ import "https://example.com/foo/../module2.mjs"; the in parallel steps, thus not blocking the main event loop.

  • Promises, as observable JavaScript objects, are never created and manipulated during the - in parallel steps. p is created before entering those steps, and then is + in parallel steps. p is created before entering those steps, and then is manipulated during a task that is queued specifically for that purpose.

  • @@ -117777,6 +121795,7 @@ import "https://example.com/foo/../module2.mjs";
    +

    To determine the target of an event handler, given an EventTarget object eventTarget on which the event handler is exposed, and an event handler name @@ -117811,6 +121830,7 @@ import "https://example.com/foo/../module2.mjs";

  • Return eventTarget's node document's relevant global object.

  • +

    @@ -117819,12 +121839,14 @@ import "https://example.com/foo/../module2.mjs"; data-x="ordered map">map of strings representing names of event handlers to event handlers.

    +

    When an EventTarget object that has one or more event handlers specified is created, its event handler map must be initialized such that it contains an entry for each event handler that has that object as target, with items in those event handlers set to their initial values.

    +

    The order of the entries of event handler map could be arbitrary. It is not observable through any algorithms that operate on the @@ -117845,6 +121867,7 @@ import "https://example.com/foo/../module2.mjs";

    +

    The getter of an event handler IDL attribute with name name, when called, must run these steps:

    @@ -117857,7 +121880,9 @@ import "https://example.com/foo/../module2.mjs";
  • Return the result of getting the current value of the event handler given eventTarget and name.

    +
  • +

    The setter of an event handler IDL attribute with name name, when called, must run these steps:

    @@ -117887,6 +121912,7 @@ import "https://example.com/foo/../module2.mjs"; +

    Certain event handler IDL attributes have additional requirements, in particular the onmessage attribute of @@ -117907,6 +121933,7 @@ import "https://example.com/foo/../module2.mjs";

    +

    The following attribute change steps are used to synchronize between event handler content attributes and event handlers: DOM

    @@ -117954,9 +121981,11 @@ import "https://example.com/foo/../module2.mjs"; value are identical (setting an attribute to its current value), but not if oldValue and value are both null (removing an attribute that doesn't currently exist). DOM

    +

    +

    To deactivate an event handler given an EventTarget object eventTarget and a string name that is the name of an event handler, run these steps:

    @@ -117979,7 +122008,9 @@ import "https://example.com/foo/../module2.mjs";
  • Set eventHandler's listener to null.

  • +
    +

    To erase all event listeners and handlers given an EventTarget object eventTarget, run these steps:

    @@ -117991,10 +122022,12 @@ import "https://example.com/foo/../module2.mjs";
  • Remove all event listeners given eventTarget.

  • +

    This algorithm is used to define document.open().

    +

    To activate an event handler given an EventTarget object eventTarget and a string name that is the name of an event handler, run these steps:

    @@ -118040,6 +122073,7 @@ import "https://example.com/foo/../module2.mjs";
  • Set eventHandler's listener to listener.

  • +

    The event listener registration happens only if the event @@ -118106,6 +122140,7 @@ import "https://example.com/foo/../module2.mjs";

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

    +

    The event handler processing algorithm for an EventTarget object eventTarget, a string name representing the name of an event handler, and an @@ -118206,6 +122241,7 @@ import "https://example.com/foo/../module2.mjs"; +

    @@ -118281,6 +122317,7 @@ typedef OnBeforeUnloadEventHandlerNonNull? OnBeforeUnl reported

    +

    When the user agent is to get the current value of the event handler given an EventTarget object eventTarget and a string name that is the value.

    +
    @@ -118598,9 +122636,11 @@ typedef OnBeforeUnloadEventHandlerNonNull? OnBeforeUnl onscroll scroll +

    We call the set of the names of the event handlers listed in the first column of this table the Window-reflecting body element event handler set.

    +

    @@ -118772,6 +122812,7 @@ interface mixin WindowEventHandlers { data-x="dom-click">click() method on the HTMLElement interface is defined as firing a click event on the element. UIEVENTS

    +

    Firing a synthetic pointer event named e at target, with an optional not trusted flag, means running these steps:

    @@ -118806,10 +122847,13 @@ interface mixin WindowEventHandlers {
  • Return the result of dispatching event at target.

  • +
    +

    Firing a click event at target means firing a synthetic pointer event named click at target.

    +
    @@ -118889,22 +122933,28 @@ document.body.appendChild(frame)
    +

    The isSecureContext getter steps are to return true if this's relevant settings object is a secure context, or false otherwise.

    +
    +

    The origin getter steps are to return this's relevant settings object's origin, serialized.

    +
    +

    The crossOriginIsolated getter steps are to return this's relevant settings object's cross-origin isolated capability.

    +
    @@ -118945,6 +122995,7 @@ document.body.appendChild(frame)
    +

    The btoa(data) method must throw an "InvalidCharacterError" DOMException if data @@ -118952,7 +123003,9 @@ document.body.appendChild(frame) convert data to a byte sequence whose nth byte is the eight-bit representation of the nth code point of data, and then must apply forgiving-base64 encode to that byte sequence and return the result.

    +
    +

    The atob(data) method steps are:

    @@ -118965,6 +123018,7 @@ document.body.appendChild(frame)
  • Return decodedData.

  • +
    @@ -119021,6 +123075,7 @@ document.body.appendChild(frame) and document.write() methods (directly or indirectly) after the document's active parser has been aborted. It is initially false.

    +

    The document open steps, given a document, are as follows:

      @@ -119133,10 +123188,12 @@ document.body.appendChild(frame)
    1. Return document.

    +

    The document open steps do not affect whether a Document is ready for post-load tasks or completely loaded.

    +

    The open(unused1, unused2) method must return the result of running the document open steps with this.

    @@ -119148,7 +123205,9 @@ document.body.appendChild(frame) exception for such calls had the arguments not been there. whatwg/webidl issue #581 investigates changing the algorithm to allow for their removal. WEBIDL

    +
    +

    The open(url, name, features) method must run these steps:

    @@ -119159,6 +123218,7 @@ document.body.appendChild(frame)
  • Return the result of running the window open steps with url, name, and features.

  • +
    @@ -119183,6 +123243,7 @@ document.body.appendChild(frame)
    +

    The close() method must run the following steps:

    @@ -119207,6 +123268,7 @@ document.body.appendChild(frame) tokenizer reaches the explicit "EOF" character or spins the event loop.

    +
    @@ -119258,6 +123320,7 @@ document.body.appendChild(frame) away the document by implicitly calling document.open(). Initially, the counter must be set to zero.

    +

    The document write steps, given a Document object document, a list text, a boolean lineFeed, and a string sink, are as follows:

    @@ -119330,11 +123393,14 @@ document.body.appendChild(frame) flag check.

    +
    +

    The document.write(...text) method steps are to run the document write steps with this, text, false, and "Document write".

    +
    @@ -119366,10 +123432,12 @@ document.body.appendChild(frame)
    +

    The document.writeln(...text) method steps are to run the document write steps with this, text, true, and "Document writeln".

    +
    @@ -119453,9 +123521,12 @@ enum DOMParserSupportedType {
    +

    The new DOMParser() constructor steps are to do nothing.

    +
    +

    The parseFromString(string, type) method steps are:

    @@ -119533,7 +123604,9 @@ enum DOMParserSupportedType {
  • Return document.

    +
  • +

    To parse HTML from a string, given a Document document and a string html:

    @@ -119556,6 +123629,7 @@ enum DOMParserSupportedType { data-x="concept-document-mode">mode.

    +
    @@ -119598,6 +123672,7 @@ enum DOMParserSupportedType {
    +

    Element's setHTMLUnsafe(html) method steps are:

    @@ -119615,7 +123690,9 @@ enum DOMParserSupportedType {
  • Unsafely set HTML given target, this, and compliantHTML.

  • +
    +

    ShadowRoot's setHTMLUnsafe(html) method steps are:

    @@ -119630,7 +123707,9 @@ enum DOMParserSupportedType {
  • Unsafely set HTML given this, this's shadow host, and compliantHTML.

  • +
    +

    To unsafely set HTML, given an Element or DocumentFragment target, an Element contextElement, and a string html:

    @@ -119648,9 +123727,11 @@ enum DOMParserSupportedType {
  • Replace all with fragment within target.

  • +

    +

    The static parseHTMLUnsafe(html) method steps are:

    @@ -119680,6 +123761,7 @@ enum DOMParserSupportedType {
  • Return document.

  • +
    @@ -119707,19 +123789,23 @@ enum DOMParserSupportedType {
    +

    Element's getHTML(options) method steps are to return the result of HTML fragment serialization algorithm with this, options["serializableShadowRoots"], and options["shadowRoots"].

    +
    +

    ShadowRoot's getHTML(options) method steps are to return the result of HTML fragment serialization algorithm with this, options["serializableShadowRoots"], and options["shadowRoots"].

    +
    @@ -119762,6 +123848,7 @@ enum DOMParserSupportedType {
    +

    The fragment serializing algorithm steps, given an Element, Document, or DocumentFragment node and a boolean require well-formed, are:

    @@ -119776,7 +123863,9 @@ enum DOMParserSupportedType {
  • Return the XML serialization of node given require well-formed.

  • +
    +

    The fragment parsing algorithm steps, given an Element context and a string markup, are:

    @@ -119803,15 +123892,21 @@ enum DOMParserSupportedType {
  • Return fragment.

  • +
    +

    Element's innerHTML getter steps are to return the result of running fragment serializing algorithm steps with this and true.

    +
    +

    ShadowRoot's innerHTML getter steps are to return the result of running fragment serializing algorithm steps with this and true.

    +
    +

    Element's innerHTML setter steps are:

    @@ -119840,7 +123935,9 @@ enum DOMParserSupportedType {
  • Replace all with fragment within context.

  • +
    +

    ShadowRoot's innerHTML setter steps are:

    @@ -119860,6 +123957,7 @@ enum DOMParserSupportedType {
  • Replace all with fragment within this.

  • +
    @@ -119896,6 +123994,7 @@ enum DOMParserSupportedType {
    +

    Element's outerHTML getter steps are:

    @@ -119904,7 +124003,9 @@ enum DOMParserSupportedType {
  • Return the result of running fragment serializing algorithm steps with element and true. +

  • +

    Element's outerHTML setter steps are:

    @@ -119934,6 +124035,7 @@ enum DOMParserSupportedType {
  • Replace this with fragment within this's parent.

  • +
    @@ -119979,6 +124081,7 @@ enum DOMParserSupportedType {
    +

    Element's insertAdjacentHTML(position, string) method steps are:

    @@ -120065,6 +124168,7 @@ enum DOMParserSupportedType { +

    As with other direct Node-manipulation APIs (and unlike innerHTML), DOMParserSupportedType {

    +

    Range's createContextualFragment(string) method steps are:

    @@ -120161,6 +124266,7 @@ enum DOMParserSupportedType {
  • Return fragment node.

  • +
    @@ -120199,9 +124305,12 @@ interface XMLSerializer {
    +

    The new XMLSerializer() constructor steps are to do nothing.

    +
    +

    The serializeToString(root) method steps are:

    @@ -120210,6 +124319,7 @@ interface XMLSerializer {
  • Return the XML serialization of root given false.

  • +
    @@ -120279,24 +124389,30 @@ interface XMLSerializer {
    +

    The setTimeout(handler, timeout, ...arguments) method steps are to return the result of running the timer initialization steps given this, handler, timeout, arguments, and false.

    +
    +

    The setInterval(handler, timeout, ...arguments) method steps are to return the result of running the timer initialization steps given this, handler, timeout, arguments, and true.

    +
    +

    The clearTimeout(id) and clearInterval(id) method steps are to remove this's map of setTimeout and setInterval IDs[id].

    +

    Because clearTimeout() and clearInterval() clear entries from the same map, either method @@ -120305,6 +124421,7 @@ interface XMLSerializer {


    +

    To perform the timer initialization steps, given a WindowOrWorkerGlobalScope global, a string or Function or TrustedScript @@ -120504,6 +124621,7 @@ interface XMLSerializer {

  • Return id.

  • +

    Argument conversion as defined by Web IDL (for example, invoking toString() methods on objects passed as the first argument) happens in the @@ -120559,6 +124677,7 @@ scheduleWork(); // queues a task to do lots of work value that represents a timer, and each value is a DOMHighResTimeStamp, representing the expiry time for that timer.

    +

    To run steps after a timeout, given a WindowOrWorkerGlobalScope global, a string orderingIdentifier, a number milliseconds, and a set of steps completionSteps, perform the following steps. They return a unique @@ -120621,6 +124740,7 @@ scheduleWork(); // queues a task to do lots of work Such specifications can choose an orderingIdentifier to ensure ordering within their specification's timeouts, while not constraining ordering with respect to other specification's timeouts.

    +
    @@ -120632,17 +124752,19 @@ scheduleWork(); // queues a task to do lots of work callback.

    +

    The queueMicrotask(callback) method must queue a microtask to invoke callback with « » and "report".

    +

    The queueMicrotask() method allows authors to schedule a callback on the microtask queue. This allows their code to run once the JavaScript execution context stack is next empty, which happens once all currently executing synchronous JavaScript has run to completion. This doesn't yield control back to the event loop, as would be the case when using, for example, setTimeout(f, 0).

    + data-x="dom-setTimeout">setTimeout(f, 0).

    Authors ought to be aware that scheduling a lot of microtasks has the same performance downsides as running a lot of synchronous code. Both will prevent the browser from doing its own @@ -120781,6 +124903,7 @@ function sendData(data) {

    +

    The alert() and alert(message) method steps are:

    @@ -120815,6 +124938,7 @@ function sendData(data) {
  • Invoke WebDriver BiDi user prompt closed with this, "alert", and true.

  • +

    This method is defined using two overloads, instead of using an optional argument, for historical reasons. The practical impact of this is @@ -120822,6 +124946,7 @@ function sendData(data) { class="js">alert("undefined"), but alert() is treated as alert("").

    +

    The confirm(message) method steps are:

    @@ -120861,7 +124986,9 @@ function sendData(data) {
  • Return accepted.

  • +
    +

    The prompt(message, default) method steps are:

    @@ -120907,18 +125034,22 @@ function sendData(data) {
  • Return result.

  • +
    +

    To optionally truncate a simple dialog string s, return either s itself or some string derived from s that is shorter. User agents should not provide UI for displaying the elided portion of s, as this makes it too easy for abusers to create dialogs of the form "Important security alert! Click 'Show More' for full details!".

    +

    For example, a user agent might want to only display the first 100 characters of a message. Or, a user agent might replace the middle of the string with "…". These types of modifications can be useful in limiting the abuse potential of unnaturally large, trustworthy-looking system dialogs.

    +

    We cannot show simple dialogs for a Window window when the following algorithm returns true:

    @@ -120942,6 +125073,7 @@ function sendData(data) {
  • Return false.

  • +
    @@ -120956,6 +125088,7 @@ function sendData(data) {
    +

    The print() method steps are:

    @@ -120973,11 +125106,13 @@ function sendData(data) {
  • Otherwise, set document's print when loaded flag.

  • +

    User agents should also run the printing steps whenever the user asks for the opportunity to obtain a physical form (e.g. printed copy), or the representation of a physical form (e.g. PDF copy), of a document.

    +

    The printing steps for a Document document are:

      @@ -121036,6 +125171,7 @@ function sendData(data) { script could automatically advance to the next step after having printed a form or other.

    +
    @@ -121066,14 +125202,18 @@ interface Navigator {

    These interface mixins are defined separately so that WorkerNavigator can reuse parts of the Navigator interface.

    +

    Each Window has an associated Navigator, which is a Navigator object. Upon creation of the Window object, its associated Navigator must be set to a new Navigator object created in the Window object's relevant realm.

    +
    +

    The navigator and clientInformation getter steps are to return this's associated Navigator. +

    @@ -121147,13 +125287,18 @@ interface Navigator {
    +

    The appCodeName getter steps are to return "Mozilla".

    +
    +

    The appName getter steps are to return "Netscape".

    +
    +

    The appVersion getter steps are:

    @@ -121190,16 +125335,22 @@ interface Navigator { +
    +

    The platform getter steps are to return a string representing the platform on which the browser is executing (e.g. "MacIntel", "Win32", "Linux x86_64", "Linux armv81") or, for privacy and compatibility, a string that is commonly returned on another platform.

    +
    +

    The product getter steps are to return "Gecko".

    +
    +

    The productSub getter steps are to return the appropriate string from the following list:

    @@ -121213,11 +125364,15 @@ interface Navigator { mode is Gecko

    The string "20100101".

    +
    +

    The userAgent getter steps are to return this's relevant settings object's environment default `User-Agent` value.

    +
    +

    The vendor getter steps are to return the appropriate string from the following list:

    @@ -121234,9 +125389,12 @@ interface Navigator { mode is WebKit

    The string "Apple Computer, Inc.".

    +
    +

    The vendorSub getter steps are to return the empty string.

    +

    If the navigator compatibility mode is Gecko, then the user agent must also support the following partial interface:

    @@ -121246,13 +125404,17 @@ interface Navigator { [Exposed=Window] readonly attribute DOMString oscpu; }; +

    The taintEnabled() method must return false.

    +
    +

    The oscpu attribute's getter must return either the empty string or a string representing the platform on which the browser is executing, e.g. "Windows NT 10.0; Win64; x64", "Linux x86_64".

    +

    @@ -121293,11 +125455,14 @@ interface Navigator {

    +

    The language getter steps are to return a valid BCP 47 language tag representing either a plausible language or the user's most preferred language. BCP47

    +
    +

    The languages getter steps are to return a frozen array of valid BCP 47 language tags representing either one @@ -121305,7 +125470,9 @@ interface Navigator { languages, ordered by preference with the most preferred language first. The same object must be returned until the user agent needs to return different values, or values in a different order. BCP47

    +
    +

    Whenever the user agent needs to make the navigator.languages attribute of a Window or WorkerGlobalScope object global return a new set of language tags, @@ -121313,6 +125480,7 @@ interface Navigator { source given global to fire an event named languagechange at global, and wait until that task begins to be executed before actually returning a new value.

    +

    To determine a plausible language, the user agent should bear in mind the following:

    @@ -121361,18 +125529,23 @@ interface Navigator {
    +

    The onLine attribute must return false if the user agent will not contact the network when the user follows links or when a script requests a remote page (or knows that such an attempt would fail), and must return true otherwise.

    +
    +

    When the value that would be returned by the navigator.onLine attribute of a Window or WorkerGlobalScope global changes from true to false, the user agent must queue a global task on the networking task source given global to fire an event named offline at global.

    +
    +

    On the other hand, when the value that would be returned by the navigator.onLine attribute of a Window or WorkerGlobalScope global changes from false to true, the user agent must @@ -121380,6 +125553,7 @@ interface Navigator { global to fire an event named online at the Window or WorkerGlobalScope object.

    +
    @@ -121447,6 +125621,7 @@ interface Navigator {
    +

    The registerProtocolHandler(scheme, url) method steps are:

    @@ -121543,7 +125718,9 @@ interface Navigator { otherwise consider handing schemes to native plugins or helper applications.

    +
    +

    The unregisterProtocolHandler(scheme, url) method steps are: @@ -121556,9 +125733,11 @@ interface Navigator {

  • In parallel: unregister the handler described by normalizedScheme and normalizedURLString.

  • +

    +

    To normalize protocol handler parameters, given a string scheme, a string url, and an environment settings object environment, run these steps:

    @@ -121646,6 +125825,7 @@ interface Navigator { the string "%s" which is not a valid component in a URL.

    +
    @@ -121713,6 +125893,7 @@ interface Navigator { /session/{session id}/custom-handlers/set-mode +

    The remote end steps are:

      @@ -121737,6 +125918,7 @@ interface Navigator {
    1. Return success with data null.

    +
    @@ -121754,10 +125936,12 @@ interface Navigator {
    +

    The cookieEnabled attribute must return true if the user agent attempts to handle cookies according to HTTP State Management Mechanism, and false if it ignores cookie change requests. COOKIES

    +
    @@ -121873,27 +126057,38 @@ interface MimeType { PluginArray, and a mime types array, which is a new MimeTypeArray.

    +

    The NavigatorPlugins mixin's plugins getter steps are to return this's plugins array.

    +
    +

    The NavigatorPlugins mixin's mimeTypes getter steps are to return this's mime types array.

    +
    +

    The NavigatorPlugins mixin's javaEnabled() method steps are to return false.

    +
    +

    The NavigatorPlugins mixin's pdfViewerEnabled getter steps are to return the user agent's PDF viewer supported.

    +

    +

    The PluginArray interface supports named properties. If the user agent's PDF viewer supported is true, then they are the PDF viewer plugin names. Otherwise, they are the empty list.

    +
    +

    The PluginArray interface's namedItem(name) method steps are:

    @@ -121905,11 +126100,15 @@ interface MimeType {
  • Return null.

  • +
    +

    The PluginArray interface supports indexed properties. The supported property indices are the indices of this's relevant global object's PDF viewer plugin objects.

    +
    +

    The PluginArray interface's item(index) method steps are:

    @@ -121922,21 +126121,29 @@ interface MimeType {
  • Return null.

  • +
    +

    The PluginArray interface's length getter steps are to return this's relevant global object's PDF viewer plugin objects's size.

    +
    +

    The PluginArray interface's refresh() method steps are to do nothing.

    +

    +

    The MimeTypeArray interface supports named properties. If the user agent's PDF viewer supported is true, then they are the PDF viewer mime types. Otherwise, they are the empty list.

    +
    +

    The MimeTypeArray interface's namedItem(name) method steps are:

    @@ -121948,11 +126155,15 @@ interface MimeType {
  • Return null.

  • +
    +

    The MimeTypeArray interface supports indexed properties. The supported property indices are the indices of this's relevant global object's PDF viewer mime type objects.

    +
    +

    The MimeTypeArray interface's item(index) method steps are:

    @@ -121965,34 +126176,46 @@ interface MimeType {
  • Return null.

  • +
    +

    The MimeTypeArray interface's length getter steps are to return this's relevant global object's PDF viewer mime type objects's size.

    +

    Each Plugin object has a name, which is set when the object is created.

    +

    The Plugin interface's name getter steps are to return this's name.

    +
    +

    The Plugin interface's description getter steps are to return "Portable Document Format".

    +
    +

    The Plugin interface's filename getter steps are to return "internal-pdf-viewer".

    +
    +

    The Plugin interface supports named properties. If the user agent's PDF viewer supported is true, then they are the PDF viewer mime types. Otherwise, they are the empty list.

    +
    +

    The Plugin interface's namedItem(name) method steps are:

    @@ -122004,11 +126227,15 @@ interface MimeType {
  • Return null.

  • +
    +

    The Plugin interface supports indexed properties. The supported property indices are the indices of this's relevant global object's PDF viewer mime type objects.

    +
    +

    The Plugin interface's item(index) method steps are:

    @@ -122021,33 +126248,44 @@ interface MimeType {
  • Return null.

  • +
    +

    The Plugin interface's length getter steps are to return this's relevant global object's PDF viewer mime type objects's size.

    +

    Each MimeType object has a type, which is set when the object is created.

    +

    The MimeType interface's type getter steps are to return this's type.

    +
    +

    The MimeType interface's description getter steps are to return "Portable Document Format".

    +
    +

    The MimeType interface's suffixes getter steps are to return "pdf".

    +
    +

    The MimeType interface's enabledPlugin getter steps are to return this's relevant global object's PDF viewer plugin objects[0] (i.e., the generic "PDF Viewer" one).

    +
    @@ -122128,6 +126366,7 @@ interface ImageData {

    Returns the color space of the pixels.

    +

    The new ImageData(sw, sh, settings) constructor steps are:

    @@ -122140,7 +126379,9 @@ interface ImageData {
  • Initialize the image data of this to transparent black.

  • +
    +

    The new ImageData(data, sw, sh, settings) constructor steps are:

    @@ -122180,8 +126421,10 @@ interface ImageData { It sets it to the actual ImageDataArray object passed as data.

    +
    +

    To initialize an ImageData object imageData, given a positive integer number of pixels per row pixelsPerRow, a positive integer number of rows rows, an ImageDataSettings settings, an optional @@ -122270,7 +126513,9 @@ interface ImageData { attribute of imageData to "srgb".

    +
    +

    ImageData objects are serializable objects. Their serialization steps, given value and serialized, are:

    @@ -122290,7 +126535,9 @@ interface ImageData {
  • Set serialized.[[PixelFormat]] to the value of value's pixelFormat attribute.

  • +
    +

    Their deserialization steps, given serialized, value, and targetRealm, are:

    @@ -122310,6 +126557,7 @@ interface ImageData {
  • Initialize value's pixelFormat attribute to serialized.[[PixelFormat]].

  • +

    The ImageDataPixelFormat enumeration is used to specify type of the data attribute of an ImageData @@ -122444,6 +126692,7 @@ dictionary ImageBitmapOptions {

    ImageBitmap objects are serializable objects and transferable objects.

    +

    Their serialization steps, given value and serialized, are:

    @@ -122455,7 +126704,9 @@ dictionary ImageBitmapOptions {
  • Set serialized.[[BitmapData]] to a copy of value's bitmap data.

  • +
    +

    Their deserialization steps, given serialized, value, and targetRealm, are:

    @@ -122463,7 +126714,9 @@ dictionary ImageBitmapOptions {
  • Set value's bitmap data to serialized.[[BitmapData]].

  • +
    +

    Their transfer steps, given value and dataHolder, are:

      @@ -122477,7 +126730,9 @@ dictionary ImageBitmapOptions {
    1. Unset value's bitmap data.

    +
    +

    Their transfer-receiving steps, given dataHolder and value, are:

    @@ -122485,12 +126740,15 @@ dictionary ImageBitmapOptions {
  • Set value's bitmap data to dataHolder.[[BitmapData]].

  • +

    The createImageBitmap method uses the bitmap task source to settle its returned Promise.

    +
    +

    The createImageBitmap(image, options) and createImageBitmap(image, @@ -122686,7 +126944,9 @@ dictionary ImageBitmapOptions {

  • Return promise.

  • +
    +

    When the steps above require that the user agent crop bitmap data to the source rectangle with formatting, the user agent must run the following steps:

    @@ -122833,7 +127093,10 @@ dictionary ImageBitmapOptions {
  • Return output.

  • +
    +
    +

    The close() method steps are:

    @@ -122843,7 +127106,9 @@ dictionary ImageBitmapOptions {
  • Unset this's bitmap data.

  • +
    +

    The width getter steps are:

    @@ -122853,7 +127118,9 @@ dictionary ImageBitmapOptions {
  • Return this's width, in CSS pixels.

  • +
    +

    The height getter steps are:

    @@ -122863,6 +127130,7 @@ dictionary ImageBitmapOptions {
  • Return this's height, in CSS pixels.

  • +

    The ResizeQuality enumeration is used to express a preference for the interpolation quality to use when scaling images.

    @@ -122948,6 +127216,7 @@ interface mixin AnimationFrameProvider { Window includes AnimationFrameProvider; DedicatedWorkerGlobalScope includes AnimationFrameProvider;
    +

    Each AnimationFrameProvider object also has a target object that stores the provider's internal state. It is defined as follows:

    @@ -122960,12 +127229,14 @@ interface mixin AnimationFrameProvider {
    If the AnimationFrameProvider is a DedicatedWorkerGlobalScope
    The DedicatedWorkerGlobalScope
    +

    Each target object has a map of animation frame callbacks, which is an ordered map that must be initially empty, and an animation frame callback identifier, which is a number that must initially be zero.

    +

    An AnimationFrameProvider provider is considered supported if any of the following are true:

    @@ -122980,9 +127251,11 @@ interface mixin AnimationFrameProvider { owner set are supported.

    +

    +

    The requestAnimationFrame(callback) method steps are:

    @@ -123006,7 +127279,9 @@ interface mixin AnimationFrameProvider {
  • Return handle.

  • +
    +

    The cancelAnimationFrame(handle) method steps are:

    @@ -123022,7 +127297,9 @@ interface mixin AnimationFrameProvider {
  • Remove callbacks[handle].

  • +
    +

    To run the animation frame callbacks for a target object target with a timestamp now:

    @@ -123050,6 +127327,7 @@ interface mixin AnimationFrameProvider { +

    Inside workers, WindowProxy or MessagePort or ServiceWo

    +

    The data attribute must return the value it was initialized to. It represents the message being sent.

    +
    +

    The origin attribute must return the value it was initialized to. It represents, in server-sent events and cross-document messaging, the origin of the document that sent the message (typically the scheme, hostname, and port of the document, but not its path or fragment).

    +
    +

    The lastEventId attribute must return the value it was initialized to. It represents, in server-sent events, the last event ID string of the event source.

    +
    +

    The source attribute must return the value it was initialized to. It represents, in cross-document messaging, the @@ -123179,19 +127464,24 @@ typedef (WindowProxy or MessagePort or ServiceWo data-x="event-WorkerGlobalScope-connect">connect events used by shared workers, the newly connecting MessagePort.

    +
    +

    The ports attribute must return the value it was initialized to. It represents, in cross-document messaging and channel messaging, the MessagePort array being sent.

    +
    +

    The initMessageEvent(type, bubbles, cancelable, data, origin, lastEventId, source, ports) method must initialize the event in a manner analogous to the similarly-named initEvent() method. DOM

    +
    @@ -123364,6 +127654,7 @@ dictionary EventSourceInit {
    +

    The EventSource(url, eventSourceInitDict) constructor, when invoked, must run these steps:

    @@ -123443,17 +127734,22 @@ dictionary EventSourceInit {
  • Return ev.

  • +

    +

    The url attribute's getter must return the serialization of this EventSource object's url.

    +
    +

    The withCredentials attribute must return the value to which it was last initialized. When the object is created, it must be initialized to false.

    +

    The readyState attribute represents the state of the @@ -123479,16 +127775,20 @@ dictionary EventSourceInit {

    +

    When the object is created, its readyState must be set to CONNECTING (0). The rules given below for handling the connection define when the value changes.

    +
    +

    The close() method must abort any instances of the fetch algorithm started for this EventSource object, and must set the readyState attribute to CLOSED.

    +
    @@ -123512,6 +127812,7 @@ dictionary EventSourceInit {

    Processing model

    +

    When a user agent is to announce the connection, the user agent must queue a task which, if the readyState attribute is set to a value other than CLOSED, sets the EventSourceInit { data-x="dom-EventSource-OPEN">OPEN and fires an event named open at the EventSource object.

    +
    +

    When a user agent is to reestablish the connection, the user agent must run the following steps. These steps are run in parallel, not as part of a task. (The tasks that it queues, of course, are run like normal tasks @@ -123583,7 +127886,9 @@ dictionary EventSourceInit { +

    +

    When a user agent is to fail the connection, the user agent must queue a task which, if the readyState attribute is set to a value other than CLOSED, sets the EventSourceInit { event named error at the EventSource object. Once the user agent has failed the connection, it does not attempt to reconnect.

    +

    @@ -123667,10 +127973,12 @@ any-char = %x0000-0009 / %x000B-000C / %x000E-10FFFF character not followed by a U+000A LINE FEED (LF) character being the ways in which a line can end.

    +

    When a stream is parsed, a data buffer, an event type buffer, and a last event ID buffer must be associated with it. They must be initialized to the empty string.

    +

    Lines must be processed, in the order they are received, as follows:

    @@ -123704,12 +128012,14 @@ any-char = %x0000-0009 / %x000B-000C / %x000E-10FFFF whole line as the field name, and the empty string as the field value.

    +

    Once the end of the file is reached, any pending data must be discarded. (If the file ends in the middle of an event, before the final empty line, the incomplete event is not dispatched.)


    +

    The steps to process the field given a field name and a field value depend on the field name, as given in the following list. Field names must be compared literally, with no case folding performed.

    @@ -123771,12 +128081,16 @@ any-char = %x0000-0009 / %x000B-000C / %x000E-10FFFF

    The field is ignored.

    +
    +

    When the user agent is required to dispatch the event, the user agent must process the data buffer, the event type buffer, and the last event ID buffer using steps appropriate for the user agent.

    +
    +

    For web browsers, the appropriate steps to dispatch the event are as follows:

      @@ -123826,10 +128140,14 @@ any-char = %x0000-0009 / %x000B-000C / %x000E-10FFFF source's last event ID string, then the event's lastEventId field will be set to the value of whatever the last seen "id" field was.

      +
    +

    For other user agents, the appropriate steps to dispatch the event are implementation dependent, but at a minimum they must set the data and event type buffers to the empty string before returning.

    +
    +
    @@ -124011,17 +128329,21 @@ data: test WorkerGlobalScope object that the EventSource object's constructor was invoked from to that EventSource object.

    +

    If a user agent is to forcibly close an EventSource object (this happens when a Document object goes away permanently), the user agent must abort any instances of the fetch algorithm started for this EventSource object, and must set the readyState attribute to CLOSED.

    +
    +

    If an EventSource object is garbage collected while its connection is still open, the user agent must abort any instance of the fetch algorithm opened by this EventSource.

    +

    Implementation advice

    @@ -124120,7 +128442,7 @@ function receiver(e) { data-x="dom-window-postMessage">postMessage()
    method could result in the attack being propagated into the receiver.

    -

    Authors should not use the wildcard keyword (*) in the targetOrigin +

    Authors should not use the wildcard keyword (*) in the targetOrigin argument in messages that contain any confidential information, as otherwise there is no way to guarantee that the message is only delivered to the recipient to which it was intended.

    @@ -124206,6 +128528,7 @@ function receiver(e) {
    +

    The window post message steps, given a targetWindow, message, and options, are as follows:

    @@ -124298,12 +128621,16 @@ function receiver(e) { +
    +

    The Window interface's postMessage(message, options) method steps are to run the window post message steps given this, message, and options.

    +
    +

    The Window interface's postMessage(message, targetOrigin, transfer) method steps are to run the window post message @@ -124311,6 +128638,7 @@ function receiver(e) { data-x="dom-WindowPostMessageOptions-targetOrigin">targetOrigin" → targetOrigin, "transfer" → transfer ]».

    +
    @@ -124428,11 +128756,13 @@ function handleMessage(event) { +

    Ports can be viewed as a way to expose limited capabilities (in the object-capability model sense) to other actors in the system. This can either be a weak capability system, where the ports are merely used as a convenient model within a particular origin, or as a strong capability model, where they are provided by one origin provider as the only mechanism by which another origin consumer can effect change in or obtain information from provider.

    +

    For example, consider a situation in which a social web site embeds in one iframe the user's email contacts provider (an address book site, from a second origin), and in a second @@ -124535,6 +128865,7 @@ interface MessageChannel {

    A MessageChannel object has an associated port 1 and an associated port 2, both MessagePort objects.

    +

    The new MessageChannel() constructor steps are:

    @@ -124550,14 +128881,19 @@ interface MessageChannel {
  • Entangle this's port 1 and this's port 2.

  • +
    +

    The port1 getter steps are to return this's port 1.

    +
    +

    The port2 getter steps are to return this's port 2.

    +
    @@ -124641,18 +128977,21 @@ dictionary StructuredSerializeOptions { same effect). A MessagePort also has a has been shipped flag, which must initially be false.

    +

    When a port's port message queue is enabled, the event loop must use it as one of its task sources. When a port's relevant global object is a Window, all tasks queued on its port message queue must be associated with the port's relevant global object's associated Document.

    +

    If the document is fully active, but the event listeners were all created in the context of documents that are not fully active, then the messages will not be received unless and until the documents become fully active again.

    +

    Each event loop has a task source called the unshipped port message queue. This is a virtual task source: it must act as if it contained the tasks of each port message queue of each @@ -124662,10 +129001,13 @@ dictionary StructuredSerializeOptions { in which they were added to their respective task source. When a task would be removed from the unshipped port message queue, it must instead be removed from its port message queue.

    +
    +

    When a MessagePort's has been shipped flag is false, its port message queue must be ignored for the purposes of the event loop. (The unshipped port message queue is used instead.)

    +

    The has been shipped flag is set to true when a port, its twin, or the object it was cloned from, is or has been transferred. When a MessagePort's @@ -124673,6 +129015,7 @@ dictionary StructuredSerializeOptions { first-class task source, unaffected to any unshipped port message queue.

    +

    When the user agent is to entangle two MessagePort objects, it must run the following steps:

    @@ -124699,7 +129042,9 @@ dictionary StructuredSerializeOptions { specification.

    +
    +

    The disentangle steps, given a MessagePort initiatorPort which initiates disentangling, are as follows:

    @@ -124733,9 +129078,11 @@ dictionary StructuredSerializeOptions { triggered the close, its Document no longer exists, or it was already garbage collected, as described above.

    +

    +

    MessagePort objects are transferable objects. Their transfer steps, given value and dataHolder, are:

    @@ -124758,7 +129105,9 @@ dictionary StructuredSerializeOptions {
  • Otherwise, set dataHolder.[[RemotePort]] to null.

  • +
    +

    Their transfer-receiving steps, given dataHolder and value, are:

    @@ -124777,9 +129126,11 @@ dictionary StructuredSerializeOptions { dataHolder.[[RemotePort]] and value. (This will disentangle dataHolder.[[RemotePort]] from the original port that was transferred.)

    +

    +

    The message port post message steps, given sourcePort, targetPort, message, and options are as follows:

    @@ -124854,7 +129205,9 @@ dictionary StructuredSerializeOptions { +
    +

    The postMessage(message, options) method steps are:

    @@ -124866,7 +129219,9 @@ dictionary StructuredSerializeOptions {
  • Run the message port post message steps providing this, targetPort, message and options.

  • +
    +

    The postMessage(message, transfer) method steps are:

    @@ -124882,15 +129237,19 @@ dictionary StructuredSerializeOptions {
  • Run the message port post message steps providing this, targetPort, message and options.

  • +

    +

    The start() method steps are to enable this's port message queue, if it is not already enabled.

    +

    +

    The close() method steps are:

    @@ -124899,6 +129258,7 @@ dictionary StructuredSerializeOptions {
  • If this is entangled, disentangle it.

  • +

    @@ -124914,10 +129274,12 @@ dictionary StructuredSerializeOptions { onclose close +

    The first time a MessagePort object's onmessage IDL attribute is set, the port's port message queue must be enabled, as if the start() method had been called.

    +
    @@ -124925,14 +129287,18 @@ dictionary StructuredSerializeOptions {

    Ports and garbage collection

    +

    When a MessagePort object o is garbage collected, if o is entangled, then the user agent must disentangle o.

    +
    +

    When a MessagePort object o is entangled and message or messageerror event listener is registered, user agents must act as if o's entangled MessagePort object has a strong reference to o.

    +

    Furthermore, a MessagePort object must not be garbage collected while there exists an event referenced by a task in a task @@ -125021,6 +129387,7 @@ interface BroadcastChannel : EventTarget {

    A BroadcastChannel object has a channel name and a closed flag.

    +

    The new BroadcastChannel(name) constructor steps are:

    @@ -125030,11 +129397,15 @@ interface BroadcastChannel : EventTarget {
  • Set this's closed flag to false.

  • +
    +

    The name getter steps are to return this's channel name.

    +
    +

    A BroadcastChannel object is said to be eligible for messaging when its relevant global object is either:

    @@ -125046,7 +129417,9 @@ interface BroadcastChannel : EventTarget { data-x="dom-WorkerGlobalScope-closing">closing flag is false and is not suspendable.

    +
    +

    The postMessage(message) method steps are:

    @@ -125124,6 +129497,7 @@ interface BroadcastChannel : EventTarget { +

    While a BroadcastChannel object whose closed flag is false has an event listener @@ -125132,9 +129506,11 @@ interface BroadcastChannel : EventTarget { BroadcastChannel object's relevant global object to the BroadcastChannel object itself.

    +

    The close() method steps are to set this's closed flag to true.

    +
    @@ -125696,15 +130072,19 @@ interface WorkerGlobalScope : EventTarget {
    +

    The self attribute must return the WorkerGlobalScope object itself.

    +
    +

    The location attribute must return the WorkerLocation object whose associated WorkerGlobalScope object is the WorkerGlobalScope object.

    +

    While the WorkerLocation object is created after the WorkerGlobalScope object, this is not problematic as it cannot be observed from @@ -125769,12 +130149,15 @@ interface DedicatedWorkerGlobalScope : WorkerGlobalSc

    +

    The name getter steps are to return this's name. Its value represents the name given to the worker using the Worker constructor, used primarily for debugging purposes.

    +
    +

    The postMessage(message, transfer) and DedicatedWorkerGlobalScope : WorkerGlobalSc and postMessage(message, options) on the port, with the same arguments, and returned the same return value.

    +
    +

    To close a worker, given a workerGlobal, run these steps:

      @@ -125797,10 +130182,13 @@ interface DedicatedWorkerGlobalScope : WorkerGlobalSc
    1. Set workerGlobal's closing flag to true. (This prevents any further tasks from being queued.)

    +
    +

    The close() method steps are to close a worker given this.

    +

    @@ -125848,15 +130236,19 @@ interface SharedWorkerGlobalScope : WorkerGlobalScope
    +

    The name getter steps are to return this's name. Its value represents the name that can be used to obtain a reference to the worker using the SharedWorker constructor.

    +
    +

    The close() method steps are to close a worker given this.

    +

    @@ -125888,6 +130280,7 @@ interface SharedWorkerGlobalScope : WorkerGlobalScope false, but which can get set to true by the algorithms in the processing model section belowwhen the worker is requested to close.

    +

    Once the WorkerGlobalScope's closing flag is set to true, the event loop's task queues must discard any @@ -125895,6 +130288,7 @@ interface SharedWorkerGlobalScope : WorkerGlobalScope queue are unaffected except where otherwise specified). Effectively, once the closing flag is true, timers stop firing, notifications for all pending background operations are dropped, etc.

    +
    @@ -125906,12 +130300,15 @@ interface SharedWorkerGlobalScope : WorkerGlobalScope data-x="channel messaging">message channels and their MessagePort objects.

    +

    Each WorkerGlobalScope object worker global scope has a list of the worker's ports, which consists of all the MessagePort objects that are entangled with another port and that have one (but only one) port owned by worker global scope. This list includes the implicit MessagePort in the case of dedicated workers.

    +
    +

    Given an environment settings object o when creating or obtaining a worker, the relevant owner to add depends on the type of global @@ -125922,6 +130319,7 @@ interface SharedWorkerGlobalScope : WorkerGlobalScope object is a Window object, and the relevant owner is that Window's associated Document.

    +

    @@ -125937,6 +130335,7 @@ interface SharedWorkerGlobalScope : WorkerGlobalScope
    +

    A WorkerGlobalScope global is actively needed if the following algorithm returns true:

    @@ -125956,7 +130355,9 @@ interface SharedWorkerGlobalScope : WorkerGlobalScope
  • Return false.

  • +
    +

    A WorkerGlobalScope global is protected if the following algorithm returns true:

    @@ -125975,7 +130376,9 @@ interface SharedWorkerGlobalScope : WorkerGlobalScope
  • Return false.

  • +
    +

    A WorkerGlobalScope global is permissible if the following algorithm returns true:

    @@ -126002,7 +130405,9 @@ interface SharedWorkerGlobalScope : WorkerGlobalScope
  • Return false.

  • +
    +

    A WorkerGlobalScope global is suspendable if the following algorithm returns true:

    @@ -126015,6 +130420,7 @@ interface SharedWorkerGlobalScope : WorkerGlobalScope
  • Return false.

  • +

    These concepts are used elsewhere in the specification's normative requirements as @@ -126055,6 +130461,7 @@ interface SharedWorkerGlobalScope : WorkerGlobalScope

    Processing model

    +

    When a user agent is to run a worker for a script with Worker or SharedWorker object worker, URL url, environment settings object outside settings, MessagePort @@ -126353,9 +130760,11 @@ interface SharedWorkerGlobalScope : WorkerGlobalScope +


    +

    When a user agent is to terminate a worker, it must run the following steps in parallel with the worker's main loop (the "run a worker" processing model defined above):

    @@ -126377,6 +130786,7 @@ interface SharedWorkerGlobalScope : WorkerGlobalScope empty the port message queue of the port that the worker's implicit port is entangled with.

    +

    User agents may invoke the terminate a worker algorithm when a worker stops being actively needed and @@ -126388,9 +130798,11 @@ interface SharedWorkerGlobalScope : WorkerGlobalScope

    Runtime script errors

    +

    Whenever an uncaught runtime script error occurs in one of the worker's scripts, if the error did not occur while handling a previous script error, the user agent will report it for the worker's WorkerGlobalScope object.

    +

    Creating workers

    @@ -126420,6 +130832,7 @@ interface SharedWorkerGlobalScope : WorkerGlobalScope
    Script settings for workers
    +

    To set up a worker environment settings object, given a JavaScript execution context execution context, an environment settings object outside settings, and a number unsafeWorkerCreationTime:

    @@ -126525,6 +130938,7 @@ interface SharedWorkerGlobalScope : WorkerGlobalScope
  • Return settings object.

  • +
    Dedicated workers and the Worker interface
    @@ -126591,12 +131005,15 @@ enum WorkerType { "classic", "module" }; created, but it is not exposed. This object must never be garbage collected before the Worker object.

    +

    The terminate() method steps are to terminate a worker given this's worker.

    +
    +

    The postMessage(message, transfer) and WorkerType { "classic", "module" }; and postMessage(message, options) on this's outside port, with the same arguments, and returned the same return value.

    +
    @@ -126623,6 +131041,7 @@ enum WorkerType { "classic", "module" };
    +

    The new Worker(scriptURL, options) constructor steps are:

    @@ -126669,6 +131088,7 @@ enum WorkerType { "classic", "module" }; +
    @@ -126740,10 +131160,13 @@ interface SharedWorker : EventTarget {

    Each SharedWorker has a port, a MessagePort set when the object is created.

    +

    The port getter steps are to return this's port.

    +
    +

    The new SharedWorker(scriptURL, options) constructor steps are:

    @@ -126933,6 +131356,7 @@ interface SharedWorker : EventTarget { +
    @@ -126951,12 +131375,14 @@ interface SharedWorker : EventTarget {
    +

    The navigator.hardwareConcurrency attribute's getter must return a number between 1 and the number of logical processors potentially available to the user agent. If this cannot be determined, the getter must return 1.

    +

    User agents should err toward exposing the number of logical processors available, using lower values only in cases where there are user-agent specific limits in place (such as a limitation @@ -126971,6 +131397,7 @@ interface SharedWorker : EventTarget {

    Importing scripts and libraries

    +

    The importScripts(...urls) method steps are:

    @@ -126993,7 +131420,9 @@ interface SharedWorker : EventTarget {
  • Import scripts into worker global scope given this and urlStrings.

  • +
    +

    To import scripts into worker global scope, given a WorkerGlobalScope object worker global scope, a list of scalar value strings urls, and an optional @@ -127050,6 +131479,7 @@ interface SharedWorker : EventTarget { +

    Service Workers is an example of a specification that runs this algorithm with its own perform the fetch @@ -127062,11 +131492,13 @@ interface SharedWorker : EventTarget {

    +

    The navigator attribute of the WorkerGlobalScope interface must return an instance of the WorkerNavigator interface, which represents the identity and state of the user agent (the client):

    +
    @@ -127117,26 +131549,33 @@ interface WorkerLocation { data-x="concept-WorkerLocation-WorkerGlobalScope">WorkerGlobalScope object (a WorkerGlobalScope object). +

    The href getter steps are to return this's WorkerGlobalScope object's url, serialized.

    +
    +

    The origin getter steps are to return the serialization of this's WorkerGlobalScope object's url's origin.

    +
    +

    The protocol getter steps are to return this's WorkerGlobalScope object's url's scheme, followed by ":".

    +
    +

    The host getter steps are:

    @@ -127157,7 +131596,9 @@ interface WorkerLocation { data-x="concept-url-port">port, serialized.

    +
    +

    The hostname getter steps are:

    @@ -127171,7 +131612,9 @@ interface WorkerLocation {
  • Return host, serialized.

  • +
    +

    The port getter steps are:

    @@ -127185,13 +131628,17 @@ interface WorkerLocation {
  • Return port, serialized.

  • +
    +

    The pathname getter steps are to return the result of URL path serializing this's WorkerGlobalScope object's url.

    +
    +

    The search getter steps are:

    @@ -127205,7 +131652,9 @@ interface WorkerLocation {
  • Return "?", followed by query.

  • +
    +

    The hash getter steps are:

    @@ -127219,6 +131668,7 @@ interface WorkerLocation {
  • Return "#", followed by fragment.

  • +
    @@ -127386,11 +131836,15 @@ interface WorkerLocation {
    +

    The fakeWorklet1 getter steps are to return this's fake worklet 1.

    +
    +

    The fakeWorklet2 getter steps are to return this's fake worklet 2.

    +
    @@ -127417,10 +131871,12 @@ interface FakeWorkletGlobalScope : WorkletGl

    Each FakeWorkletGlobalScope has a registered class constructors map, which is an ordered map, initially empty.

    +

    The registerFake(type, classConstructor) method steps are to set this's registered class constructors map[type] to classConstructor.

    +
    @@ -127492,6 +131948,7 @@ registerFake('negation-processor', class {
    // app.mjs
     window.fakeWorklet1.addModule("script.mjs");
    +

    To make use of such registered classes, the specification for fake worklets could define a find the opposite of true algorithm, given a Worklet worklet, which invokes the data-x="dfn-callback-this-value">callback this value set to classInstance.

    +

    Another, perhaps better, specification architecture would be to extract the "process" property and convert it into a WorkletGlobalScope {};

    Creation and termination
    +

    To create a worklet global scope for a Worklet worklet:

    @@ -127676,7 +132135,9 @@ interface WorkletGlobalScope {};
  • Run runNextAddedModule.

  • +
    +

    To terminate a worklet global scope given a WorkletGlobalScope workletGlobalScope:

    @@ -127706,9 +132167,11 @@ interface WorkletGlobalScope {};
    Document whose worklet global scopes contains workletGlobalScope.

    +
    Script settings for worklets
    +

    To set up a worklet environment settings object, given a JavaScript execution context executionContext and an environment settings object outsideSettings:

    @@ -127795,6 +132258,7 @@ interface WorkletGlobalScope {};
  • Return settingsObject.

  • +
    @@ -127884,6 +132348,7 @@ dictionary WorkletOptions { the new WorkletGlobalScope.

    +

    The addModule(moduleURL, options) method steps are:

    @@ -128040,6 +132505,7 @@ dictionary WorkletOptions {
  • Return promise.

  • +
    @@ -128243,13 +132709,16 @@ interface Storage {
    "local" or "session". +

    To reorder a Storage object storage, reorder storage's map's entries in an implementation-defined manner.

    +

    Unfortunate as it is, iteration order is not defined and can change upon most mutations.

    +

    To broadcast a Storage object storage, given a key, oldValue, and newValue, run these steps:

    @@ -128301,13 +132770,17 @@ interface Storage { becomes fully active again.

    +

    +

    The length getter steps are to return this's map's size.

    +
    +

    The key(index) method steps are:

    @@ -128321,11 +132794,15 @@ interface Storage {
  • Return keys[index].

  • +
    +

    The supported property names on a Storage object storage are the result of running get the keys on storage's map.

    +
    +

    The getItem(key) method steps are:

    @@ -128336,7 +132813,9 @@ interface Storage {
  • Return this's map[key].

  • +
    +

    The setItem(key, value) method steps are:

    @@ -128371,7 +132850,9 @@ interface Storage {
  • Broadcast this with key, oldValue, and value.

  • +
    +

    The removeItem(key) method steps are:

    @@ -128390,7 +132871,9 @@ interface Storage {
  • Broadcast this with key, oldValue, and null.

  • +
    +

    The clear() method steps are:

    @@ -128401,6 +132884,7 @@ interface Storage {
  • Broadcast this with null, null, and null.

  • +
    @@ -128430,6 +132914,7 @@ interface Storage {

    A Document object has an associated session storage holder, which is null or a Storage object. It is initially null.

    +

    The Storage {

  • Return storage.

  • +

    After creating a new auxiliary browsing context and document, the session storage is copied over.

    @@ -128490,6 +132976,7 @@ interface Storage {

    A Document object has an associated local storage holder, which is null or a Storage object. It is initially null.

    +

    The Storage {

  • Return storage.

  • +
    @@ -128565,19 +133053,23 @@ dictionary StorageEventInit : EventInit {
    +

    The key, oldValue, newValue, url, and storageArea attributes must return the values they were initialized to.

    +
    +

    The initStorageEvent(type, bubbles, cancelable, key, oldValue, newValue, url, storageArea) method must initialize the event in a manner analogous to the similarly-named initEvent() method. DOM

    +
    @@ -128748,6 +133240,7 @@ dictionary StorageEventInit : EventInit { +

    Documents must consist of the following parts, in the given order:

    @@ -128768,6 +133261,7 @@ dictionary StorageEventInit : EventInit {
  • Any number of comments and ASCII whitespace.
  • +

    The various types of content mentioned above are described in the next few sections.

    @@ -128806,6 +133300,7 @@ dictionary StorageEventInit : EventInit { document ensures that the browser makes a best-effort attempt at following the relevant specifications.

    +

    A DOCTYPE must consist of the following components, in this order:

      @@ -128816,11 +133311,13 @@ dictionary StorageEventInit : EventInit {
    1. Zero or more ASCII whitespace.
    2. A U+003E GREATER-THAN SIGN character (>).
    +

    In other words, <!DOCTYPE html>, case-insensitively.


    +

    For the purposes of HTML generators that cannot output HTML markup with the short DOCTYPE "<!DOCTYPE html>", a DOCTYPE legacy string may be inserted into the DOCTYPE (in the position defined above). This string must consist of:

    @@ -128833,6 +133330,7 @@ dictionary StorageEventInit : EventInit {
  • The literal string "about:legacy-compat".
  • A matching U+0022 QUOTATION MARK or U+0027 APOSTROPHE character (i.e. the same character as in the earlier step labeled quote mark).
  • +

    In other words, <!DOCTYPE html SYSTEM "about:legacy-compat"> or <!DOCTYPE html SYSTEM 'about:legacy-compat'>, case-insensitively except for the @@ -128976,6 +133474,7 @@ dictionary StorageEventInit : EventInit {

    Start tags
    +

    Start tags must have the following format:

      @@ -129007,10 +133506,12 @@ dictionary StorageEventInit : EventInit {
    1. Finally, start tags must be closed by a U+003E GREATER-THAN SIGN character (>).
    +
    End tags
    +

    End tags must have the following format:

      @@ -129025,6 +133526,7 @@ dictionary StorageEventInit : EventInit {
    1. Finally, end tags must be closed by a U+003E GREATER-THAN SIGN character (>).
    +
    Attributes
    @@ -129671,6 +134173,7 @@ dictionary StorageEventInit : EventInit { characters that couldn't otherwise legally be included in text.

    +

    Character references must start with a U+0026 AMPERSAND character (&). Following this, there are three possible kinds of character references:

    @@ -129702,15 +134205,19 @@ dictionary StorageEventInit : EventInit {

    The numeric character reference forms described above are allowed to reference any code point excluding U+000D CR, noncharacters, and controls other than ASCII whitespace.

    +
    +

    An ambiguous ampersand is a U+0026 AMPERSAND character (&) that is followed by one or more ASCII alphanumerics, followed by a U+003B SEMICOLON character (;), where these characters do not match any of the names given in the named character references section.

    +

    CDATA sections

    +

    CDATA sections must consist of the following components, in this order:

    @@ -129722,6 +134229,7 @@ dictionary StorageEventInit : EventInit {
  • The string "]]>".
  • +
    @@ -129742,6 +134250,7 @@ dictionary StorageEventInit : EventInit {

    Comments

    +

    Comments must have the following format:

      @@ -129755,6 +134264,7 @@ dictionary StorageEventInit : EventInit {
    1. The string "-->".
    +

    The text is allowed to end with the string "<!", as in <!--My favorite operators are > and @@ -130371,9 +134881,11 @@ dictionary StorageEventInit : EventInit {

    Usually, the encoding sniffing algorithm defined below is used to determine the character encoding.

    +

    Given a character encoding, the bytes in the input byte stream must be converted to characters for the tokenizer's input stream, by passing the input byte stream and character encoding to decode.

    +

    A leading Byte Order Mark (BOM) causes the character encoding argument to be ignored and will itself be skipped.

    @@ -130419,6 +134931,7 @@ dictionary StorageEventInit : EventInit { encoding declaration that conflicts with this information, then the parser can get reinvoked to perform a parse of the document with the real encoding.

    +

    User agents must use the following algorithm, called the encoding sniffing algorithm, to determine the character encoding to use when decoding a document in the first pass. This algorithm takes as input any out-of-band metadata available to the user agent @@ -130939,6 +135452,7 @@ dictionary StorageEventInit : EventInit { Windows, Chrome, and Firefox defaults.

    +

    The document's character encoding must immediately be set to the value returned from this algorithm, at the same time as the user agent uses the returned value to select the @@ -130946,6 +135460,7 @@ dictionary StorageEventInit : EventInit {


    +

    When an algorithm requires a user agent to prescan a byte stream to determine its encoding, given some defined end condition, then it must run the following @@ -131099,7 +135614,9 @@ dictionary StorageEventInit : EventInit {

  • Next byte: Move position so it points at the next byte in the input byte stream, and return to the step above labeled loop.
  • +
    +

    When the prescan a byte stream to determine its encoding algorithm says to get an attribute, it means doing this:

    @@ -131240,7 +135757,9 @@ dictionary StorageEventInit : EventInit {
  • Advance position to the next byte and return to the previous step.

  • +
    +

    When the prescan a byte stream to determine its encoding algorithm is aborted without returning an encoding, get an XML encoding means doing this.

    @@ -131300,6 +135819,7 @@ dictionary StorageEventInit : EventInit {
  • Return encoding.

  • +

    For the sake of interoperability, user agents should not use a pre-scan algorithm that returns different results than the one described above. (But, if you do, please at least let us know, so @@ -131344,6 +135864,7 @@ dictionary StorageEventInit : EventInit {

    Changing the encoding while parsing
    +

    When the parser requires the user agent to change the encoding, it must run the following steps. This might happen if the encoding sniffing algorithm described above failed to find a character encoding, or if it found a character encoding that was not the actual @@ -131394,6 +135915,7 @@ dictionary StorageEventInit : EventInit { encoding. The resource will be misinterpreted. User agents may notify the user of the situation, to aid in application development.

    +

    This algorithm is only invoked when a new encoding is found declared on a meta element.

    +

    Consume the next input character:

    @@ -132217,11 +136802,13 @@ dictionary StorageEventInit : EventInit {
    Emit a U+003C LESS-THAN SIGN character token. Reconsume in the RCDATA state.
    +
    RCDATA end tag open state
    +

    Consume the next input character:

    @@ -132234,11 +136821,13 @@ dictionary StorageEventInit : EventInit {
    Emit a U+003C LESS-THAN SIGN character token and a U+002F SOLIDUS character token. Reconsume in the RCDATA state.
    +
    RCDATA end tag name state
    +

    Consume the next input character:

    @@ -132278,11 +136867,13 @@ dictionary StorageEventInit : EventInit { buffer (in the order they were added to the buffer). Reconsume in the RCDATA state.
    +
    RAWTEXT less-than sign state
    +

    Consume the next input character:

    @@ -132295,11 +136886,13 @@ dictionary StorageEventInit : EventInit {
    Emit a U+003C LESS-THAN SIGN character token. Reconsume in the RAWTEXT state.
    +
    RAWTEXT end tag open state
    +

    Consume the next input character:

    @@ -132312,11 +136905,13 @@ dictionary StorageEventInit : EventInit {
    Emit a U+003C LESS-THAN SIGN character token and a U+002F SOLIDUS character token. Reconsume in the RAWTEXT state.
    +
    RAWTEXT end tag name state
    +

    Consume the next input character:

    @@ -132356,10 +136951,12 @@ dictionary StorageEventInit : EventInit { buffer (in the order they were added to the buffer). Reconsume in the RAWTEXT state.
    +
    Script data less-than sign state
    +

    Consume the next input character:

    @@ -132376,11 +136973,13 @@ dictionary StorageEventInit : EventInit {
    Emit a U+003C LESS-THAN SIGN character token. Reconsume in the script data state.
    +
    Script data end tag open state
    +

    Consume the next input character:

    @@ -132393,11 +136992,13 @@ dictionary StorageEventInit : EventInit {
    Emit a U+003C LESS-THAN SIGN character token and a U+002F SOLIDUS character token. Reconsume in the script data state.
    +
    Script data end tag name state
    +

    Consume the next input character:

    @@ -132437,10 +137038,12 @@ dictionary StorageEventInit : EventInit { buffer (in the order they were added to the buffer). Reconsume in the script data state.
    +
    Script data escape start state
    +

    Consume the next input character:

    @@ -132452,10 +137055,12 @@ dictionary StorageEventInit : EventInit {
    Anything else
    Reconsume in the script data state.
    +
    Script data escape start dash state
    +

    Consume the next input character:

    @@ -132467,10 +137072,12 @@ dictionary StorageEventInit : EventInit {
    Anything else
    Reconsume in the script data state.
    +
    Script data escaped state
    +

    Consume the next input character:

    @@ -132495,10 +137102,12 @@ dictionary StorageEventInit : EventInit {
    Anything else
    Emit the current input character as a character token.
    +
    Script data escaped dash state
    +

    Consume the next input character:

    @@ -132525,10 +137134,12 @@ dictionary StorageEventInit : EventInit {
    Switch to the script data escaped state. Emit the current input character as a character token.
    +
    Script data escaped dash dash state
    +

    Consume the next input character:

    @@ -132558,10 +137169,12 @@ dictionary StorageEventInit : EventInit {
    Switch to the script data escaped state. Emit the current input character as a character token.
    +
    Script data escaped less-than sign state
    +

    Consume the next input character:

    @@ -132579,10 +137192,12 @@ dictionary StorageEventInit : EventInit {
    Emit a U+003C LESS-THAN SIGN character token. Reconsume in the script data escaped state.
    +
    Script data escaped end tag open state
    +

    Consume the next input character:

    @@ -132595,10 +137210,12 @@ dictionary StorageEventInit : EventInit {
    Emit a U+003C LESS-THAN SIGN character token and a U+002F SOLIDUS character token. Reconsume in the script data escaped state.
    +
    Script data escaped end tag name state
    +

    Consume the next input character:

    @@ -132638,10 +137255,12 @@ dictionary StorageEventInit : EventInit { (in the order they were added to the buffer). Reconsume in the script data escaped state.
    +
    Script data double escape start state
    +

    Consume the next input character:

    @@ -132671,10 +137290,12 @@ dictionary StorageEventInit : EventInit {
    Anything else
    Reconsume in the script data escaped state.
    +
    Script data double escaped state
    +

    Consume the next input character:

    @@ -132700,10 +137321,12 @@ dictionary StorageEventInit : EventInit {
    Anything else
    Emit the current input character as a character token.
    +
    Script data double escaped dash state
    +

    Consume the next input character:

    @@ -132731,10 +137354,12 @@ dictionary StorageEventInit : EventInit {
    Switch to the script data double escaped state. Emit the current input character as a character token.
    +
    Script data double escaped dash dash state
    +

    Consume the next input character:

    @@ -132765,10 +137390,12 @@ dictionary StorageEventInit : EventInit {
    Switch to the script data double escaped state. Emit the current input character as a character token.
    +
    Script data double escaped less-than sign state
    +

    Consume the next input character:

    @@ -132780,10 +137407,12 @@ dictionary StorageEventInit : EventInit {
    Anything else
    Reconsume in the script data double escaped state.
    +
    Script data double escape end state
    +

    Consume the next input character:

    @@ -132813,10 +137442,12 @@ dictionary StorageEventInit : EventInit {
    Anything else
    Reconsume in the script data double escaped state.
    +
    Before attribute name state
    +

    Consume the next input character:

    @@ -132844,10 +137475,12 @@ dictionary StorageEventInit : EventInit {
    Start a new attribute in the current tag token. Set that attribute name and value to the empty string. Reconsume in the attribute name state.
    +
    Attribute name state
    +

    Consume the next input character:

    @@ -132891,6 +137524,7 @@ dictionary StorageEventInit : EventInit { token; if there is already an attribute on the token with the exact same name, then this is a duplicate-attribute parse error and the new attribute must be removed from the token.

    +

    If an attribute is so removed from a token, it, and the value that gets associated with it, if any, are never subsequently used by the parser, and are therefore effectively @@ -132900,6 +137534,7 @@ dictionary StorageEventInit : EventInit {

    After attribute name state
    +

    Consume the next input character:

    @@ -132928,10 +137563,12 @@ dictionary StorageEventInit : EventInit {
    Start a new attribute in the current tag token. Set that attribute name and value to the empty string. Reconsume in the attribute name state.
    +
    Before attribute value state
    +

    Consume the next input character:

    @@ -132956,10 +137593,12 @@ dictionary StorageEventInit : EventInit {
    Anything else
    Reconsume in the attribute value (unquoted) state.
    +
    Attribute value (double-quoted) state
    +

    Consume the next input character:

    @@ -132984,10 +137623,12 @@ dictionary StorageEventInit : EventInit {
    Anything else
    Append the current input character to the current attribute's value.
    +
    Attribute value (single-quoted) state
    +

    Consume the next input character:

    @@ -133012,10 +137653,12 @@ dictionary StorageEventInit : EventInit {
    Anything else
    Append the current input character to the current attribute's value.
    +
    Attribute value (unquoted) state
    +

    Consume the next input character:

    @@ -133056,10 +137699,12 @@ dictionary StorageEventInit : EventInit {
    Anything else
    Append the current input character to the current attribute's value.
    +
    After attribute value (quoted) state
    +

    Consume the next input character:

    @@ -133087,10 +137732,12 @@ dictionary StorageEventInit : EventInit { parse error. Reconsume in the before attribute name state.
    +
    Self-closing start tag state
    +

    Consume the next input character:

    @@ -133108,10 +137755,12 @@ dictionary StorageEventInit : EventInit { data-x="parse-error-unexpected-solidus-in-tag">unexpected-solidus-in-tag parse error. Reconsume in the before attribute name state.
    +
    Bogus comment state
    +

    Consume the next input character:

    @@ -133130,10 +137779,12 @@ dictionary StorageEventInit : EventInit {
    Anything else
    Append the current input character to the comment token's data.
    +
    Markup declaration open state
    +

    If the next few characters are:

    @@ -133161,10 +137812,12 @@ dictionary StorageEventInit : EventInit { parse error. Create a comment token whose data is the empty string. Switch to the bogus comment state (don't consume anything in the current state).
    +
    Comment start state
    +

    Consume the next input character:

    @@ -133180,10 +137833,12 @@ dictionary StorageEventInit : EventInit {
    Anything else
    Reconsume in the comment state.
    +
    Comment start dash state
    +

    Consume the next input character:

    @@ -133204,10 +137859,12 @@ dictionary StorageEventInit : EventInit {
    Append a U+002D HYPHEN-MINUS character (-) to the comment token's data. Reconsume in the comment state.
    +
    Comment state
    +

    Consume the next input character:

    @@ -133231,10 +137888,12 @@ dictionary StorageEventInit : EventInit {
    Anything else
    Append the current input character to the comment token's data.
    +
    Comment less-than sign state
    +

    Consume the next input character:

    @@ -133249,10 +137908,12 @@ dictionary StorageEventInit : EventInit {
    Anything else
    Reconsume in the comment state.
    +
    Comment less-than sign bang state
    +

    Consume the next input character:

    @@ -133263,10 +137924,12 @@ dictionary StorageEventInit : EventInit {
    Anything else
    Reconsume in the comment state.
    +
    Comment less-than sign bang dash state
    +

    Consume the next input character:

    @@ -133277,10 +137940,12 @@ dictionary StorageEventInit : EventInit {
    Anything else
    Reconsume in the comment end dash state.
    +
    Comment less-than sign bang dash dash state
    +

    Consume the next input character:

    @@ -133293,10 +137958,12 @@ dictionary StorageEventInit : EventInit {
    This is a nested-comment parse error. Reconsume in the comment end state.
    +
    Comment end dash state
    +

    Consume the next input character:

    @@ -133312,10 +137979,12 @@ dictionary StorageEventInit : EventInit {
    Append a U+002D HYPHEN-MINUS character (-) to the comment token's data. Reconsume in the comment state.
    +
    Comment end state
    +

    Consume the next input character:

    @@ -133337,10 +138006,12 @@ dictionary StorageEventInit : EventInit {
    Append two U+002D HYPHEN-MINUS characters (-) to the comment token's data. Reconsume in the comment state.
    +
    Comment end bang state
    +

    Consume the next input character:

    @@ -133362,10 +138033,12 @@ dictionary StorageEventInit : EventInit {
    Append two U+002D HYPHEN-MINUS characters (-) and a U+0021 EXCLAMATION MARK character (!) to the comment token's data. Reconsume in the comment state.
    +
    DOCTYPE state
    +

    Consume the next input character:

    @@ -133391,10 +138064,12 @@ dictionary StorageEventInit : EventInit { parse error. Reconsume in the before DOCTYPE name state.
    +
    Before DOCTYPE name state
    +

    Consume the next input character:

    @@ -133432,10 +138107,12 @@ dictionary StorageEventInit : EventInit {
    Create a new DOCTYPE token. Set the token's name to the current input character. Switch to the DOCTYPE name state.
    +
    DOCTYPE name state
    +

    Consume the next input character:

    @@ -133468,10 +138145,12 @@ dictionary StorageEventInit : EventInit {
    Anything else
    Append the current input character to the current DOCTYPE token's name.
    +
    After DOCTYPE name state
    +

    Consume the next input character:

    @@ -133507,10 +138186,12 @@ dictionary StorageEventInit : EventInit { flag to on. Reconsume in the bogus DOCTYPE state.

    +
    After DOCTYPE public keyword state
    +

    Consume the next input character:

    @@ -133551,10 +138232,12 @@ dictionary StorageEventInit : EventInit { parse error. Set the current DOCTYPE token's force-quirks flag to on. Reconsume in the bogus DOCTYPE state.
    +
    Before DOCTYPE public identifier state
    +

    Consume the next input character:

    @@ -133591,10 +138274,12 @@ dictionary StorageEventInit : EventInit { parse error. Set the current DOCTYPE token's force-quirks flag to on. Reconsume in the bogus DOCTYPE state.
    +
    DOCTYPE public identifier (double-quoted) state
    +

    Consume the next input character:

    @@ -133623,10 +138308,12 @@ dictionary StorageEventInit : EventInit {
    Append the current input character to the current DOCTYPE token's public identifier.
    +
    DOCTYPE public identifier (single-quoted) state
    +

    Consume the next input character:

    @@ -133655,10 +138342,12 @@ dictionary StorageEventInit : EventInit {
    Append the current input character to the current DOCTYPE token's public identifier.
    +
    After DOCTYPE public identifier state
    +

    Consume the next input character:

    @@ -133696,10 +138385,12 @@ dictionary StorageEventInit : EventInit { parse error. Set the current DOCTYPE token's force-quirks flag to on. Reconsume in the bogus DOCTYPE state.
    +
    Between DOCTYPE public and system identifiers state
    +

    Consume the next input character:

    @@ -133733,10 +138424,12 @@ dictionary StorageEventInit : EventInit { parse error. Set the current DOCTYPE token's force-quirks flag to on. Reconsume in the bogus DOCTYPE state.
    +
    After DOCTYPE system keyword state
    +

    Consume the next input character:

    @@ -133777,10 +138470,12 @@ dictionary StorageEventInit : EventInit { parse error. Set the current DOCTYPE token's force-quirks flag to on. Reconsume in the bogus DOCTYPE state.
    +
    Before DOCTYPE system identifier state
    +

    Consume the next input character:

    @@ -133817,10 +138512,12 @@ dictionary StorageEventInit : EventInit { parse error. Set the current DOCTYPE token's force-quirks flag to on. Reconsume in the bogus DOCTYPE state.
    +
    DOCTYPE system identifier (double-quoted) state
    +

    Consume the next input character:

    @@ -133849,10 +138546,12 @@ dictionary StorageEventInit : EventInit {
    Append the current input character to the current DOCTYPE token's system identifier.
    +
    DOCTYPE system identifier (single-quoted) state
    +

    Consume the next input character:

    @@ -133881,10 +138580,12 @@ dictionary StorageEventInit : EventInit {
    Append the current input character to the current DOCTYPE token's system identifier.
    +
    After DOCTYPE system identifier state
    +

    Consume the next input character:

    @@ -133911,10 +138612,12 @@ dictionary StorageEventInit : EventInit { does not set the current DOCTYPE token's force-quirks flag to on.)
    +
    Bogus DOCTYPE state
    +

    Consume the next input character:

    @@ -133933,10 +138636,12 @@ dictionary StorageEventInit : EventInit {
    Anything else
    Ignore the character.
    +
    CDATA section state
    +

    Consume the next input character:

    @@ -133951,6 +138656,7 @@ dictionary StorageEventInit : EventInit {
    Anything else
    Emit the current input character as a character token.
    +

    U+0000 NULL characters are handled in the tree construction stage, as part of the in foreign content insertion mode, which @@ -133958,6 +138664,7 @@ dictionary StorageEventInit : EventInit {

    CDATA section bracket state
    +

    Consume the next input character:

    @@ -133969,10 +138676,12 @@ dictionary StorageEventInit : EventInit {
    Emit a U+005D RIGHT SQUARE BRACKET character token. Reconsume in the CDATA section state.
    +
    CDATA section end state
    +

    Consume the next input character:

    @@ -133987,11 +138696,13 @@ dictionary StorageEventInit : EventInit {
    Emit two U+005D RIGHT SQUARE BRACKET character tokens. Reconsume in the CDATA section state.
    +
    Character reference state
    +

    Set the temporary buffer to the empty string. Append a U+0026 AMPERSAND (&) character to the temporary buffer. Consume the next input character:

    @@ -134010,10 +138721,12 @@ dictionary StorageEventInit : EventInit {
    Flush code points consumed as a character reference. Reconsume in the return state.
    +
    Named character reference state
    +

    Consume the maximum number of characters possible, where the consumed characters are one of the identifiers in the first column of the named character references table. Append each character to the temporary buffer when it's consumed.

    @@ -134054,6 +138767,7 @@ dictionary StorageEventInit : EventInit {
    Flush code points consumed as a character reference. Switch to the ambiguous ampersand state.
    +
    @@ -134072,6 +138786,7 @@ dictionary StorageEventInit : EventInit {
    Ambiguous ampersand state
    +

    Consume the next input character:

    @@ -134091,9 +138806,11 @@ dictionary StorageEventInit : EventInit {
    Anything else
    Reconsume in the return state.
    +
    Numeric character reference state
    +

    Set the character reference code to zero (0).

    @@ -134110,10 +138827,12 @@ dictionary StorageEventInit : EventInit {
    Anything else
    Reconsume in the decimal character reference start state.
    +
    Hexadecimal character reference start state
    +

    Consume the next input character:

    @@ -134127,10 +138846,12 @@ dictionary StorageEventInit : EventInit { parse error. Flush code points consumed as a character reference. Reconsume in the return state.
    +
    Decimal character reference start state
    +

    Consume the next input character:

    @@ -134144,10 +138865,12 @@ dictionary StorageEventInit : EventInit { parse error. Flush code points consumed as a character reference. Reconsume in the return state.
    +
    Hexadecimal character reference state
    +

    Consume the next input character:

    @@ -134179,10 +138902,12 @@ dictionary StorageEventInit : EventInit { parse error. Reconsume in the numeric character reference end state.
    +
    Decimal character reference state
    +

    Consume the next input character:

    @@ -134202,10 +138927,12 @@ dictionary StorageEventInit : EventInit { parse error. Reconsume in the numeric character reference end state.
    +
    Numeric character reference end state
    +

    Check the character reference code:

      @@ -134281,6 +139008,7 @@ dictionary StorageEventInit : EventInit { code point equal to the character reference code to the temporary buffer. Flush code points consumed as a character reference. Switch to the return state.

      +
    @@ -134306,6 +139034,7 @@ dictionary StorageEventInit : EventInit {
    +

    As each token is emitted from the tokenizer, the user agent must follow the appropriate steps from the following list, known as the tree construction dispatcher:

    @@ -134328,10 +139057,14 @@ dictionary StorageEventInit : EventInit {
    Process the token according to the rules given in the section for parsing tokens in foreign content.
    +
    +

    The next token is the token that is about to be processed by the tree construction dispatcher (even if the token is subsequently just ignored).

    +
    +

    A node is a MathML text integration point if it is one of the following elements:

    @@ -134342,7 +139075,9 @@ dictionary StorageEventInit : EventInit {
  • A MathML ms element
  • A MathML mtext element
  • +
    +

    A node is an HTML integration point if it is one of the following elements:

      @@ -134356,8 +139091,9 @@ dictionary StorageEventInit : EventInit {
    • An SVG desc element
    • An SVG title element
    +
    -

    If the node in question is the If the node in question is the context element passed to the HTML fragment parsing algorithm, then the start tag token for that element is the "fake" token created during by that HTML fragment parsing algorithm.

    @@ -134381,6 +139117,7 @@ dictionary StorageEventInit : EventInit {

    While the parser is processing a token, it can enable or disable foster parenting. This affects the following algorithm.

    +

    The appropriate place for inserting a node, optionally using a particular override target, is the position in an element returned by running the following steps:

    @@ -134465,9 +139202,11 @@ dictionary StorageEventInit : EventInit {

    Return the adjusted insertion location.

    +

    +

    To create an element for a token, given a token token, a string namespace, and a Node object intendedParent:

    @@ -134587,9 +139326,11 @@ dictionary StorageEventInit : EventInit {
  • Return element.

  • +

    +

    To insert an element at the adjusted insertion location with an element element:

    @@ -134615,11 +139356,13 @@ dictionary StorageEventInit : EventInit {

    If the adjusted insertion location cannot accept more elements, e.g., because it's a Document that already has an element child, then element is dropped on the floor.

    +
    +

    To insert a foreign element, given a token token, a string namespace, and a boolean onlyAddToElementStack:

    @@ -134641,16 +139384,22 @@ dictionary StorageEventInit : EventInit {
  • Return element.

  • +
    +

    To insert an HTML element given a token token: insert a foreign element given token, the HTML namespace, and false.

    +

    +

    When the steps below require the user agent to adjust MathML attributes for a token, then, if the token has an attribute named definitionurl, change its name to definitionURL (note the case difference).

    +
    +

    When the steps below require the user agent to adjust SVG attributes for a token, then, for each attribute on the token whose attribute name is one of the ones in the first column of the following table, change the attribute's name to the name given in the corresponding cell in @@ -134719,7 +139468,9 @@ dictionary StorageEventInit : EventInit { ychannelselector yChannelSelector zoomandpan zoomAndPan +

    +

    When the steps below require the user agent to adjust foreign attributes for a token, then, if any of the attributes on the token match the strings given in the first column of the following table, let the attribute be a namespaced attribute, with the prefix being the string @@ -134745,9 +139496,11 @@ dictionary StorageEventInit : EventInit { xmlns (none) xmlns XMLNS namespace xmlns:xlink xmlns xlink XMLNS namespace +


    +

    When the steps below require the user agent to insert a character while processing a token, the user agent must run the following steps:

    @@ -134779,6 +139532,7 @@ dictionary StorageEventInit : EventInit { the newly created node at the adjusted insertion location.

    +
    @@ -134824,6 +139578,7 @@ document.body.appendChild(text);
    +

    When the steps below require the user agent to insert a comment while processing a comment token, optionally with an explicit insertion position position, the user agent must run the following steps:

    @@ -134844,9 +139599,11 @@ document.body.appendChild(text);
  • Insert the newly created node at the adjusted insertion location.

  • +
    Parsing elements that contain only text
    +

    The generic raw text element parsing algorithm and the generic RCDATA element parsing algorithm consist of the following steps. These algorithms are always invoked in response to a start tag token.

    @@ -134865,10 +139622,12 @@ document.body.appendChild(text);
  • Then, switch the insertion mode to "text".

  • +
    Closing elements that have implied end tags
    +

    When the steps below require the UA to generate implied end tags, then, while the current node is a dd element, a dt element, an li element, an optgroup element, an option element, a @@ -134879,7 +139638,9 @@ document.body.appendChild(text);

    If a step requires the UA to generate implied end tags but lists an element to exclude from the process, then the UA must perform the above steps as if that element was not in the above list.

    +
    +

    When the steps below require the UA to generate all implied end tags thoroughly, then, while the current node is a caption element, a colgroup element, a dd element, a dt element, an @@ -134889,6 +139650,7 @@ document.body.appendChild(text); tfoot element, a th element, a thead element, or a tr element, the UA must pop the current node off the stack of open elements.

    +
    @@ -134900,6 +139662,7 @@ document.body.appendChild(text);

    A Document object has an associated parser cannot change the mode flag (a boolean). It is initially false.

    +

    When the user agent is to apply the rules for the "initial" insertion mode, the user agent must handle the token as follows:

    @@ -135039,10 +139802,12 @@ document.body.appendChild(text); html">before html", then reprocess the token.

    +
    The "before html" insertion mode
    +

    When the user agent is to apply the rules for the "before html" insertion mode, the user agent must handle the token as follows:

    @@ -135095,6 +139860,7 @@ document.body.appendChild(text); head", then reprocess the token.

    +

    The document element can end up being removed from the Document object, e.g. by scripts; nothing in particular happens in such cases, content continues being @@ -135103,6 +139869,7 @@ document.body.appendChild(text);

    The "before head" insertion mode
    +

    When the user agent is to apply the rules for the "before head" insertion mode, the user agent must handle the token as follows:

    @@ -135170,10 +139937,12 @@ document.body.appendChild(text);

    Reprocess the current token.

    +
    The "in head" insertion mode
    +

    When the user agent is to apply the rules for the "in head" insertion mode, the user agent must handle the token as follows:

    @@ -135501,10 +140270,12 @@ document.body.appendChild(text);

    Reprocess the token.

    +
    The "in head noscript" insertion mode
    +

    When the user agent is to apply the rules for the "in head noscript" insertion mode, the user agent must handle the token as follows:

    @@ -135571,10 +140342,12 @@ document.body.appendChild(text);

    Reprocess the token.

    +
    The "after head" insertion mode
    +

    When the user agent is to apply the rules for the "after head" insertion mode, the user agent must handle the token as follows:

    @@ -135670,10 +140443,12 @@ document.body.appendChild(text);

    Reprocess the current token.

    +
    The "in body" insertion mode
    +

    When the user agent is to apply the rules for the "in body" insertion mode, the user agent must handle the token as follows:

    @@ -136740,7 +141515,9 @@ document.body.appendChild(text); +
    +

    When the steps above say the user agent is to close a p element, it means that the user agent must run the following steps:

    @@ -136754,8 +141531,10 @@ document.body.appendChild(text);
  • Pop elements from the stack of open elements until a p element has been popped from the stack.

  • +
    +

    The adoption agency algorithm, which takes as its only argument a token token for which the algorithm is being run, consists of the following steps:

    @@ -136897,6 +141676,7 @@ document.body.appendChild(text); +

    This algorithm's name, the "adoption agency algorithm", comes from the way it causes elements to change parents, and is in contrast with The "text" insertion mode +

    The "in table" insertion mode
    +

    When the user agent is to apply the rules for the "in table" insertion mode, the user agent must handle the token as follows:

    @@ -137241,11 +142024,14 @@ document.body.appendChild(text); parenting.

    +
    +

    When the steps above require the UA to clear the stack back to a table context, it means that the UA must, while the current node is not a table, template, or html element, pop elements from the stack of open elements.

    +

    This is the same list of elements as used in the has an element in table scope steps.

    @@ -137257,6 +142043,7 @@ document.body.appendChild(text);
    The "in table text" insertion mode
    +

    When the user agent is to apply the rules for the "in table text" insertion mode, the user agent must handle the token as follows:

    @@ -137302,10 +142089,12 @@ document.body.appendChild(text); reprocess the token.

    +
    The "in caption" insertion mode
    +

    When the user agent is to apply the rules for the "in caption" insertion mode, the user agent must handle the token as follows:

    @@ -137376,10 +142165,12 @@ document.body.appendChild(text); body">in body" insertion mode.

    +
    The "in column group" insertion mode
    +

    When the user agent is to apply the rules for the "in column group" insertion mode, the user agent must handle the token as follows:

    @@ -137463,10 +142254,12 @@ document.body.appendChild(text);

    Reprocess the token.

    +
    The "in table body" insertion mode
    +

    When the user agent is to apply the rules for the "in table body" insertion mode, the user agent must handle the token as follows:

    @@ -137550,11 +142343,14 @@ document.body.appendChild(text); table">in table" insertion mode.

    +
    +

    When the steps above require the UA to clear the stack back to a table body context, it means that the UA must, while the current node is not a tbody, tfoot, thead, template, or html element, pop elements from the stack of open elements.

    +

    The current node being an html element after this process is a fragment case.

    @@ -137562,6 +142358,7 @@ document.body.appendChild(text);
    The "in row" insertion mode
    +

    When the user agent is to apply the rules for the "in row" insertion mode, the user agent must handle the token as follows:

    @@ -137655,11 +142452,14 @@ document.body.appendChild(text); table">in table" insertion mode.

    +
    +

    When the steps above require the UA to clear the stack back to a table row context, it means that the UA must, while the current node is not a tr, template, or html element, pop elements from the stack of open elements.

    +

    The current node being an html element after this process is a fragment case.

    @@ -137667,6 +142467,7 @@ document.body.appendChild(text);
    The "in cell" insertion mode
    +

    When the user agent is to apply the rules for the "in cell" insertion mode, the user agent must handle the token as follows:

    @@ -137733,7 +142534,9 @@ document.body.appendChild(text); body">in body" insertion mode.

    +
    +

    Where the steps above say to close the cell, they mean to run the following algorithm:

    @@ -137754,6 +142557,7 @@ document.body.appendChild(text); fragment case, or