diff --git a/source b/source index 9ac897e1d1d..e0735c43270 100644 --- a/source +++ b/source @@ -7070,19 +7070,19 @@ a.setAttribute('href', 'https://example.com/'); // change the content attribute match that of the document or environment settings object for legacy reasons. When that is not the case the URL parser can be used directly.

-

To parse a URL url, relative to either a - document or environment settings object, the user agent must use the - following steps. Parsing a URL either results in failure or a resulting URL string - and resulting URL record.

+

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

    -
  1. Let encoding be document's character encoding, if document was given, and environment - settings object's API URL character encoding otherwise.

  2. +
  3. Let encoding be environment's character encoding, if environment is a Document object; + otherwise environment's API URL character encoding.

  4. -
  5. Let baseURL be document's base - URL, if document was given, and environment settings object's - API base URL otherwise.

  6. +
  7. Let baseURL be environment's base + URL, if environment is a Document object; otherwise + environment's API base URL otherwise.

  8. Let urlRecord be the result of applying the URL parser to url, with baseURL and encoding.

  9. @@ -7096,6 +7096,17 @@ a.setAttribute('href', 'https://example.com/'); // change the content attribute urlRecord as the resulting URL record.

+

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

+ +
    +
  1. Parse a URL url, relative to environment. If that + returns failure, then return failure.

  2. + +
  3. Return the resulting URL string.

  4. +
+ @@ -7999,11 +8010,11 @@ a.setAttribute('href', 'https://example.com/'); // change the content attribute
  1. If contentAttributeValue is null, then return the empty string.

  2. -
  3. Parse contentAttributeValue relative to - the element's node document.

  4. +
  5. Let urlString be the result of parsing and serializing a URL + given contentAttributeValue, relative to element's node + document.

  6. -
  7. If that does not return failure, then return the resulting URL - string.

  8. +
  9. If urlString is not failure, then return urlString.

@@ -25158,18 +25169,14 @@ document.body.appendChild(wbr);
  • If targetNavigable is null, then return.

  • -
  • Parse a URL given subject's href attribute, relative to subject's node - document.

  • - -
  • -

    If that is successful, let url be the resulting URL string.

    +
  • Let urlString be the result of parsing and serializing a URL given + subject's href attribute value, relative to + subject's node document.

  • -

    Otherwise, if parsing the URL failed, then - return.

    - +
  • If urlString is failure, then return.

  • -
  • If hyperlinkSuffix is non-null, then append it to url.

  • +
  • If hyperlinkSuffix is non-null, then append it to + urlString.

  • Let referrerPolicy be the current state of subject's referrerpolicy content attribute.

  • @@ -25179,8 +25186,8 @@ document.body.appendChild(wbr); referrerPolicy to "no-referrer".

  • -

    Navigate targetNavigable to url - using subject's node document, with Navigate targetNavigable to + urlString using subject's node document, with referrerPolicy set to referrerPolicy and userInvolvement set to userInvolvement.

    @@ -25234,15 +25241,14 @@ document.body.appendChild(wbr); sandboxing flag set has the sandboxed downloads browsing context flag set, then return.

  • -
  • Parse a URL given subject's href attribute, relative to subject's node - document.

  • +
  • Let urlString be the result of parsing and serializing a URL given + subject's href attribute value, relative to + subject's node document.

  • -
  • If parsing the URL fails, then return.

    +
  • If urlString is failure, then return.

  • -
  • Otherwise, let url be the resulting URL string.

  • - -
  • If hyperlinkSuffix is non-null, then append it to url.

  • +
  • If hyperlinkSuffix is non-null, then append it to + urlString.

  • If userInvolvement is not "browser UI", @@ -25261,9 +25267,10 @@ document.body.appendChild(wbr);

  • Let continue be the result of firing a download request navigate event at navigation with destinationURL - set to url, userInvolvement - set to userInvolvement, and filename - set to filename.

  • + set to urlString, userInvolvement set to + userInvolvement, and filename set to + filename.

  • If continue is false, then return.

  • @@ -25277,10 +25284,10 @@ document.body.appendChild(wbr); safeguard the user from a potentially hostile download.

  • Let request be a new request whose - URL is url, - client is entry settings object, - initiator is "download", - destination is the empty string, and whose + URL is urlString, client is entry settings object, initiator is "download", destination is the empty string, and whose synchronous flag and use-URL-credentials flag are set.

  • Handle the result of fetching @@ -25485,9 +25492,9 @@ document.body.appendChild(wbr); data-x="">ping".

  • -

    Let target URL be the resulting URL string obtained from parsing the value of the element's href attribute and then:

    +

    Let target URL be the result of parsing and serializing a URL given + the element's href attribute value, relative to the + element's node document, and then:

    If the URL of the Document object @@ -30464,11 +30471,13 @@ was an English <a href="/wiki/Music_hall">music hall</a> singer, ...If selected source is not null, then:

      -
    1. Parse selected source, relative to the - element's node document. If that is not successful, then abort this inner set of - steps. Otherwise, let urlString be the resulting URL string.

    2. +
    3. Let urlString be the result of parsing and serializing a URL + given selected source, relative to the element's node + document.

    4. +
    5. If urlString is failure, then abort this inner set of steps.

    6. +
    7. Let key be a tuple consisting of urlString, the img element's crossorigin attribute's mode, and, if that mode is not No CORS, the node @@ -30576,10 +30585,11 @@ was an English <a href="/wiki/Music_hall">music hall</a> singer, ...

    8. +
    9. Let urlString be the result of parsing and serializing a URL given + selected source, relative to the element's node document.

    10. +
    11. -

      Parse selected source, relative to the element's - node document, and let urlString be the resulting URL - string. If that is not successful, then:

      +

      If urlString is failure, then:

      1. Abort the image request for the current request and the @@ -31530,9 +31540,11 @@ was an English <a href="/wiki/Music_hall">music hall</a> singer, ... -

      2. Parse selected source, relative to - the element's node document, and let urlString be the resulting URL - string. If that is not successful, then return.

      3. +
      4. ⌛ Let urlString be the result of parsing and serializing a + URL given selected source, relative to the element's node + document.

      5. + +
      6. ⌛ If urlString is failure, then return.

      7. ⌛ Let corsAttributeState be the state of the element's crossorigin content attribute.

      8. @@ -34904,11 +34916,23 @@ interface HTMLTrackElement : HTMLElement {
        -

        If the element has a src attribute whose value is not the - empty string and whose value, when the attribute was set, could be successfully parsed relative to the element's node document, then the - element's track URL is the resulting URL string. Otherwise, the element's - track URL is the empty string.

        +

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

        + +

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

          +
        1. Let trackURL be failure.

        2. + +
        3. Let value be the element's src attribute + value.

        4. + +
        5. If value is not the empty string, then set trackURL to the result of + parsing and serializing a URL given value, relative to the element's + node document.

        6. + +
        7. Set the element's track URL to trackURL if it is not failure; + otherwise to the empty string.

        8. +
        @@ -74199,33 +74223,30 @@ Demos: img, source, track, or video element
    -

    The value is the resulting URL string that results from parsing the value of the element's src attribute relative to - the node document of the element at the time the attribute is set, or the empty - string if there is no such attribute or if parsing it results - in an error.

    +

    The value is the result of parsing and serializing a URL given the element's + src attribute value, relative to the element's node + document, at the time the attribute is set, or the empty string if there is no such + attribute or the result is failure.

    If the element is an a, area, or link element
    -

    The value is the resulting URL string that results from parsing the value of the element's href attribute relative to - the node document of the element at the time the attribute is set, or the empty - string if there is no such attribute or if parsing it results - in an error.

    +

    The value is the result of parsing and serializing a URL given the element's + href attribute value, relative to the element's node + document, at the time the attribute is set, or the empty string if there is no such + attribute or the result is failure.

    If the element is an object element
    -

    The value is the resulting URL string that results from parsing the value of the element's data attribute relative to - the node document of the element at the time the attribute is set, or the empty - string if there is no such attribute or if parsing it results - in an error.

    +

    The value is the result of parsing and serializing a URL given the element's + data attribute value, relative to the element's node + document, at the time the attribute is set, or the empty string if there is no such + attribute or the result is failure.

    @@ -128717,11 +128738,11 @@ html, body { display: block; }

    When a body element has a background - attribute set to a non-empty value, the new value is expected to be parsed relative to the element's node document, and if this is - successful, the user agent is expected to treat the attribute as a presentational hint setting the element's 'background-image' property - to the resulting URL string.

    + attribute set to a non-empty value, the new value is expected to be parsed and serialized relative to the element's node + document, and if that does not return failure, the user agent is expected to treat the + attribute as a presentational hint setting the + element's 'background-image' property to the return value.

    When a body element has a bgcolor attribute set, the new value is expected to be parsed using the rules for parsing a legacy @@ -129563,10 +129584,11 @@ table {

    When a table, thead, tbody, tfoot, tr, td, or th element has a background attribute set to a non-empty value, the new value is - expected to be parsed relative to the element's node - document, and if this is successful, the user agent is expected to treat the attribute as a - presentational hint setting the element's - 'background-image' property to the resulting URL string.

    + expected to be parsed and serialized relative + to the element's node document, and if that does not return failure, the user agent + is expected to treat the attribute as a presentational + hint setting the element's 'background-image' property to the return + value.

    When a table, thead, tbody, tfoot, tr, td, or th element has a bgcolor