diff --git a/source b/source index 7d1c237630b..c5608c9d542 100644 --- a/source +++ b/source @@ -3526,6 +3526,8 @@ a.setAttribute('href', 'https://example.com/'); // change the content attribute
  • The 'clear' property
  • The 'width' property
  • The 'height' property
  • +
  • The 'min-width' property
  • +
  • The 'min-height' property
  • The 'max-width' property
  • The 'max-height' property
  • The 'line-height' property
  • @@ -3613,6 +3615,7 @@ a.setAttribute('href', 'https://example.com/'); // change the content attribute @@ -30145,8 +30232,8 @@ was an English <a href="/wiki/Music_hall">music hall</a> singer, ...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, - it must run the following steps:

    + optionally with the restart animations flag set, optionally with the maybe omit + events flag set, it must run the following steps:

    1. @@ -30171,6 +30258,9 @@ was an English <a href="/wiki/Music_hall">music hall</a> singer, ...unavailable, set pending request to null, and return.

    2. +
    3. Let previous URL be the current request's current URL.

    4. +
    5. Let selected source be null and selected pixel density be undefined.

    6. If the element does not use srcset or picture and @@ -30230,8 +30320,9 @@ was an English <a href="/wiki/Music_hall">music hall</a> singer, ...

      Set current request's current URL to urlString.

    7. -
    8. Fire an event named load at the img element.

    9. +
    10. If maybe omit events is not set or previousURL is not equal to + urlString, then fire an event named + load at the img element.

    @@ -30275,10 +30366,21 @@ was an English <a href="/wiki/Music_hall">music hall</a> singer, ...

    Change the current request's current URL to the empty string.

    -
  • If the element has a src attribute or it uses srcset or picture, fire an event named error at the img element.

  • +
  • +

    If all of the following conditions are true:

    + + + +

    then fire an event named error at the img element.

    +
  • @@ -30308,8 +30410,9 @@ was an English <a href="/wiki/Music_hall">music hall</a> singer, ...

    Change the current request's current URL to selected source.

    -
  • Fire an event named error at the img element.

  • +
  • If maybe omit events is not set or previousURL is not equal to + selected source, then fire an event + named error at the img element.

  • @@ -30466,7 +30569,8 @@ was an English <a href="/wiki/Music_hall">music hall</a> singer, ...state to completely available.

    -
  • Queue an element task on the DOM manipulation task source +

  • If maybe omit events is not set or previousURL is not equal to + urlString, then queue an element task on the DOM manipulation task source given the img element to fire an event named load at the img element.

  • @@ -30522,8 +30626,9 @@ was an English <a href="/wiki/Music_hall">music hall</a> singer, ...
  • Abort the image request for image request.

  • -
  • Fire an event named error at the img element.

  • +
  • If maybe omit events is not set or previousURL is not equal to + urlString, then fire an event named + error at the img element.

  • @@ -30559,8 +30664,9 @@ was an English <a href="/wiki/Music_hall">music hall</a> singer, ...

    Add the image to the list of available images using the key key, with the ignore higher-layer caching flag set.

    -
  • Fire an event named load at the img element.

  • +
  • If maybe omit events is not set or previousURL is not equal to + urlString, then fire an event named + load at the img element.

  • @@ -30571,9 +30677,11 @@ was an English <a href="/wiki/Music_hall">music hall</a> singer, ...broken, abort the image request for the current request and the pending request, upgrade the pending request to the current request if image request is the pending request, and - then queue an element task on the DOM manipulation task source given - the img element to fire an event named - error at the img element.

    + then, if maybe omit events is not set or previousURL is not equal to + urlString, queue an element task on the DOM manipulation task + source given the img element to fire an + event named error at the img + element.

    @@ -30699,7 +30807,7 @@ was an English <a href="/wiki/Music_hall">music hall</a> singer, ...Creating a source set from attributes

    When asked to create a source set given a string default source, a string - srcset and a string sizes:

    + srcset, a string sizes, and an element or null img:

    1. Let source set be an empty source set.

    2. @@ -30709,7 +30817,7 @@ was an English <a href="/wiki/Music_hall">music hall</a> singer, ...srcset.

    3. Let source size be the result of parsing sizes.

    4. + data-x="parse a sizes attribute">parsing sizes with img.

    5. If default source is not the empty string and source set does not contain an image source with a pixel @@ -30737,6 +30845,9 @@ was an English <a href="/wiki/Music_hall">music hall</a> singer, ...elements with el's parent node's child elements, retaining relative order.

    6. +
    7. Let img be el if el is an img element, + otherwise null.

    8. +
    9. For each child in elements:

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

      Let el's source set be the result of creating a source set given default source, srcset, - and sizes.

    10. + and sizes, and img.

    11. Return.

      @@ -30805,8 +30916,9 @@ was an English <a href="/wiki/Music_hall">music hall</a> singer, ...match the environment, continue to the next child.

    12. -
    13. Parse child's sizes attribute, - and let source set's source size be the returned value.

    14. +
    15. Parse child's sizes attribute + with img, and let source set's source size be the returned + value.

    16. If child has a type attribute, and its value is an unknown or unsupported MIME type, continue to the next child.

    17. @@ -31077,55 +31189,76 @@ was an English <a href="/wiki/Music_hall">music hall</a> singer, ...Parsing a sizes attribute -

      When asked to parse a sizes attribute from an element, parse a - comma-separated list of component values from the value of the element's sizes - attribute (or the empty string, if the attribute is absent), and let unparsed sizes - list be the result.

      - -

      For each unparsed size in unparsed sizes list:

      +

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

        -
      1. Remove all consecutive <whitespace-token>s - from the end of unparsed size. - If unparsed size is now empty, - that is a parse error; - continue.

      2. +
      3. Let unparsed sizes list be the result of parsing a comma-separated list of component values from the + value of element's sizes attribute (or the empty string, if the + attribute is absent).

      4. -
      5. If the last component value in unparsed size - is a valid non-negative <source-size-value>, - let size be its value - and remove the component value from unparsed size. - Any CSS function other than the math functions is invalid. - Otherwise, there is a parse error; - continue.

      6. +
      7. Let size be null.

      8. -
      9. Remove all consecutive <whitespace-token>s - from the end of unparsed size. - If unparsed size is now empty, - return size and exit this algorithm. - If this was not the last item in unparsed sizes list, - that is a parse error.

      10. +
      11. +

        For each unparsed size in unparsed sizes list:

        -
      12. Parse the remaining component values in unparsed size - as a <media-condition>. - If it does not parse correctly, - or it does parse correctly but the <media-condition> evaluates to false, - continue.

      13. +
          +
        1. Remove all consecutive <whitespace-token>s + from the end of unparsed size. + If unparsed size is now empty, + then that is a parse error; + continue.

        2. -
        3. Return size and exit this algorithm.

        4. -
        +
      14. If the last component value in unparsed size + is a valid non-negative <source-size-value>, + then set size to its value + and remove the component value from unparsed size. + Any CSS function other than the math functions is invalid. + Otherwise, there is a parse error; + continue.

      15. + +
      16. Remove all consecutive <whitespace-token>s + from the end of unparsed size. + If unparsed size is now empty, + then return size. + If this was not the keyword auto and + it was not the last item in unparsed sizes list, + that is a parse error.

      17. + +
      18. Parse the remaining component values in unparsed size + as a <media-condition>. + If it does not parse correctly, + or it does parse correctly but the <media-condition> evaluates to false, + continue.

      19. -

        If the above algorithm exhausts unparsed sizes list without returning a - size value, then return 100vw.

        +
      20. If size is not auto, then return + size.

      21. +
      + + +
    18. Assert: size is null or auto.

    19. + +
    20. If img is null, or img's loading attribute is not in the Lazy state, or img is not being + rendered, or img's concrete object size ignoring natural + dimensions width is zero, then return 100vw.

    21. + +
    22. Return the concrete object size ignoring natural dimensions width of + img, in CSS pixels.

    23. +
    -

    While a valid source size list only contains a bare <source-size-value> +

    It is invalid to use a bare <source-size-value> that is a <length> (without an accompanying <media-condition>) - as the last entry in the <source-size-list>, - the parsing algorithm technically allows such at any point in the list, + as an entry in the <source-size-list> that is not the last entry. + However, the parsing algorithm allows it at any point in the <source-size-list>, and will accept it immediately as the size if the preceding entries in the list weren't used. This is to enable future extensions, - and protect against simple author errors such as a final trailing comma.

    + and protect against simple author errors such as a final trailing comma. + A bare auto keyword is allowed to have other entries + following it to provide a fallback for legacy user agents.

    Normalizing the source densities
    @@ -31167,11 +31300,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, if the user is not looking at the page any - more, the user agent might want to wait until the user has returned to the page before determining - which image to use, in case the environment changes again in the meantime.)

    +

    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, + if the user is not looking at the page any more, the user agent might want to wait until the user + has returned to the page before determining which image to use, in case the environment changes + again in the meantime.)

    User agents are encouraged to run this algorithm in particular when the user changes the viewport's size (e.g. by resizing the window or changing the page zoom), and when @@ -47300,10 +47434,10 @@ interface HTMLInputElement : HTMLElement {

    The IDL attributes width and height must return the rendered width and height of the - image, in CSS pixels, if an image is being rendered, and - is being rendered to a visual medium; or else the natural - width and height of the image, in CSS pixels, if an image is available but not being rendered to a visual medium; or else 0, + image, in CSS pixels, if an image is being rendered; or + else the natural width and height of the image, in + CSS pixels, if an image is available but not being rendered; or else 0, if no image is available. When the input element's type attribute is not in the Image Button state, then no image is