From 264ac8ef2ee5dd28d89fbaf87648e14d0833acfa Mon Sep 17 00:00:00 2001
From: Anne van Kesteren 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.Legacy colors
-
Let input be the string being parsed.
If input is the empty string, then return an error.
If input is the empty string, then return failure.
Strip leading and trailing ASCII whitespace from input.
If input is an ASCII case-insensitive match for the
- string "transparent
", then return an error.
If input is an ASCII case-insensitive match for "transparent
", then return failure.
If input is an ASCII case-insensitive match for one of the
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
".00
".
If input's code point length is greater than 128, truncate input, leaving only the first 128 characters.
If the first character in input is a U+0023 NUMBER SIGN character (#), - remove it.
If the first character in input is U+0023 (#), then remove it.
Replace any character in input that is not an ASCII hex digit with the character U+0030 DIGIT ZERO (0).
While input's code point length is zero or not a multiple of - three, append a U+0030 DIGIT ZERO (0) character to input.
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.
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.
If length is still greater than two, truncate each component, leaving only the first two characters in each.
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
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 When a When a 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
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.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.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.
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.
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.
Otherwise, if the element has a parent element that is a frameset
element,
then return the frame border color of that element.