From 264ac8ef2ee5dd28d89fbaf87648e14d0833acfa Mon Sep 17 00:00:00 2001 From: Anne van Kesteren Date: Fri, 20 Sep 2024 10:53:10 +0200 Subject: [PATCH] Review --- source | 57 ++++++++++++++++++++++++++------------------------------- 1 file changed, 26 insertions(+), 31 deletions(-) diff --git a/source b/source index 6d6bd3390fd..38c198a67b2 100644 --- a/source +++ b/source @@ -6803,21 +6803,17 @@ a.setAttribute('href', 'https://example.com/'); // change the content attribute

Legacy colors

-

Some obsolete legacy attributes parse colors in a more complicated manner, using the +

Some obsolete legacy attributes parse colors using the rules for parsing a legacy color - value, which are 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 CSS color or an error.

+ value, given a string input. They will return either a CSS color or failure.

    -
  1. Let input be the string being parsed.

  2. - -
  3. If input is the empty string, then return an error.

  4. +
  5. If input is the empty string, then return failure.

  6. Strip leading and trailing ASCII whitespace from input.

  7. -
  8. If input is an ASCII case-insensitive match for the - string "transparent", then return an error.

  9. +
  10. If input is an ASCII case-insensitive match for "transparent", then return failure.

  11. If input is an ASCII case-insensitive match for one of the

  12. Replace any code points greater than U+FFFF in - input (i.e., any characters that are not in the basic multilingual plane) with the - two-character string "00".

  13. + input (i.e., any characters that are not in the basic multilingual plane) with "00".

  14. If input's code point length is greater than 128, truncate input, leaving only the first 128 characters.

  15. -
  16. If the first character in input is a U+0023 NUMBER SIGN character (#), - remove it.

  17. +
  18. If the first character in input is U+0023 (#), then remove it.

  19. Replace any character in input that is not an ASCII hex digit with the character U+0030 DIGIT ZERO (0).

  20. + digits">ASCII hex digit with U+0030 (0).

  21. While input's code point length is zero or not a multiple of - three, append a U+0030 DIGIT ZERO (0) character to input.

  22. + three, append U+0030 (0) to input.

  23. Split input into three strings of equal code point length, to obtain three components. Let length be the code point length that all of @@ -6874,7 +6869,7 @@ a.setAttribute('href', 'https://example.com/'); // change the content attribute data-x="">length-8 characters in each component, and let length be 8.

  24. While length is greater than two and the first character in each - component is a U+0030 DIGIT ZERO (0) character, remove that character and reduce length by one.

  25. + component is U+0030 (0), remove that character and reduce length by one.

  26. If length is still greater than two, truncate each component, leaving only the first two characters in each.

  27. @@ -50287,8 +50282,8 @@ ldh-str = < as defined in value to a string representing the serialization of a CSS color.

    -

    In this state, there is always a CSS color picked, and there is no way to set the - value to the empty string.

    +

    In this state, there is always a CSS color picked, and there is no way for the end + user to set the value to the empty string.

    The alpha attribute is a boolean attribute. If present, it indicates the CSS color's alpha component can @@ -50318,7 +50313,7 @@ ldh-str = < as defined in display-p3 Display P3 The CSS color is converted to the 'display-p3' color space, e.g., "color(display-p3 0.84 0.19 0.72 / 0.6)". + data-x="">color(display-p3 1.84 -0.19 0.72 / 0.6)".

    The attribute's missing value default and

    When a body element has a bgcolor attribute set, the new value is expected to be parsed using the rules for parsing a legacy - color value, and if that does not return an error, the user agent is expected to treat the + color value, 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-color' property to the resulting color.

    When a body element has a text attribute, its value is expected to be parsed using the rules for parsing a legacy color value, and - if that does not return an error, the user agent is expected to treat the attribute as a presentational hint setting the element's 'color' property to the resulting color.

    When a body element has a link attribute, its value is expected to be parsed using the rules for parsing a legacy color value, and - if that does not return an error, the user agent is expected to treat the attribute as a presentational hint setting the 'color' property of any element in the Document matching the :link pseudo-class to the resulting color.

    When a body element has a vlink attribute, its value is expected to be parsed using the rules for parsing a legacy color value, - and if that does not return an error, the user agent is expected to treat the attribute as a presentational hint setting the 'color' property of any element in the Document matching the :visited pseudo-class to the resulting color.

    When a body element has an alink attribute, its value is expected to be parsed using the rules for parsing a legacy color value, - and if that does not return an error, the user agent is expected to treat the attribute as a presentational hint setting the 'color' property of any element in the Document matching the :active pseudo-class and either the

    When a font element has a color attribute, its value is expected to be parsed using the rules for parsing a legacy color - value, and if that does not return an error, the user agent is expected to treat the + value, and if that does not return failure, the user agent is expected to treat the attribute as a presentational hint setting the element's 'color' property to the resulting color.

    @@ -134572,13 +134567,13 @@ table {

    When a table, thead, tbody, tfoot, tr, td, or th element has a bgcolor attribute set, the new value is expected to be parsed using the rules for parsing a legacy - color value, and if that does not return an error, the user agent is expected to treat the + color value, 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-color' property to the resulting color.

    When a table element has a bordercolor attribute, its value is expected to be parsed using the rules for parsing a legacy color - value, and if that does not return an error, the user agent is expected to treat the + value, and if that does not return failure, the user agent is expected to treat the attribute as a presentational hint setting the element's 'border-top-color', 'border-right-color', 'border-bottom-color', and 'border-left-color' properties to the @@ -134766,7 +134761,7 @@ hr[color], hr[noshade] { border-style: solid; }

    When an hr element has a color attribute, its value is expected to be parsed using the rules for parsing a legacy color value, and - if that does not return an error, the user agent is expected to treat the attribute as a presentational hint setting the element's 'color' property to the resulting color.

    @@ -135958,7 +135953,7 @@ marquee {

    When a marquee element has a bgcolor attribute set, the value is expected to be parsed using the rules for parsing a legacy color - value, and if that does not return an error, the user agent is expected to treat the + value, 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-color' property to the resulting color.

    @@ -136341,8 +136336,8 @@ progress { appearance: auto; }
    1. If the element has a bordercolor attribute, and applying the - rules for parsing a legacy color value to that attribute's value does not result - in an error, then return the color so obtained.

    2. + rules for parsing a legacy color value to that attribute's value does not return + failure, then return the color so obtained.

    3. Otherwise, if the element has a parent element that is a frameset element, then return the frame border color of that element.