Skip to content

Commit

Permalink
Review
Browse files Browse the repository at this point in the history
  • Loading branch information
annevk committed Sep 20, 2024
1 parent 327b2ae commit 264ac8e
Showing 1 changed file with 26 additions and 31 deletions.
57 changes: 26 additions & 31 deletions source
Original file line number Diff line number Diff line change
Expand Up @@ -6803,21 +6803,17 @@ a.setAttribute('href', 'https://example.com/'); // change the content attribute

<!--en-GB--><h4 id="colours">Legacy colors</h4>

<p>Some obsolete legacy attributes parse colors in a more complicated manner, using the
<p>Some obsolete legacy attributes parse colors using the
<!--en-GB--><dfn id="rules-for-parsing-a-legacy-colour-value">rules for parsing a legacy color
value</dfn>, 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.</p>
value</dfn>, given a string <var>input</var>. They will return either a CSS color or failure.</p>

<ol>
<li><p>Let <var>input</var> be the string being parsed.</p></li>

<li><p>If <var>input</var> is the empty string, then return an error.</p></li>
<li><p>If <var>input</var> is the empty string, then return failure.</p></li>

<li><p><span>Strip leading and trailing ASCII whitespace</span> from <var>input</var>.</p></li>

<li><p>If <var>input</var> is an <span>ASCII case-insensitive</span> match for the
string "<code data-x="">transparent</code>", then return an error.</p></li>
<li><p>If <var>input</var> is an <span>ASCII case-insensitive</span> match for "<code
data-x="">transparent</code>", then return failure.</p></li>

<li>
<p>If <var>input</var> is an <span>ASCII case-insensitive</span> match for one of the <span
Expand Down Expand Up @@ -6851,20 +6847,19 @@ a.setAttribute('href', 'https://example.com/'); // change the content attribute
</li>

<li><p>Replace any <span data-x="code point">code points</span> greater than U+FFFF in
<var>input</var> (i.e., any characters that are not in the basic multilingual plane) with the
two-character string "<code data-x="">00</code>".</p></li>
<var>input</var> (i.e., any characters that are not in the basic multilingual plane) with "<code
data-x="">00</code>".</p></li>

<li><p>If <var>input</var>'s <span>code point length</span> is greater than 128, truncate
<var>input</var>, leaving only the first 128 characters.</p></li>

<li><p>If the first character in <var>input</var> is a U+0023 NUMBER SIGN character (#),
remove it.</p></li>
<li><p>If the first character in <var>input</var> is U+0023 (#), then remove it.</p></li>

<li><p>Replace any character in <var>input</var> that is not an <span data-x="ASCII hex
digits">ASCII hex digit</span> with the character U+0030 DIGIT ZERO (0).</p></li>
digits">ASCII hex digit</span> with U+0030 (0).</p></li>

<li><p>While <var>input</var>'s <span>code point length</span> is zero or not a multiple of
three, append a U+0030 DIGIT ZERO (0) character to <var>input</var>.</p></li>
three, append U+0030 (0) to <var>input</var>.</p></li>

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

<li><p>While <var>length</var> is greater than two and the first character in each
component is a U+0030 DIGIT ZERO (0) character, remove that character and reduce <var>length</var> by one.</p></li>
component is U+0030 (0), remove that character and reduce <var>length</var> by one.</p></li>

<li><p>If <var>length</var> is <em>still</em> greater than two, truncate each component,
leaving only the first two characters in each.</p></li>
Expand Down Expand Up @@ -50287,8 +50282,8 @@ ldh-str = &lt; as defined in <a href="https://www.rfc-editor.org/rfc/rfc10
element's <span data-x="concept-fe-value">value</span> to a string representing the serialization
of a CSS color.</p>

<p class="note">In this state, there is always a CSS color picked, and there is no way to set the
value to the empty string.</p>
<p class="note">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.</p>

<p>The <dfn element-attr for="input"><code data-x="attr-input-alpha">alpha</code></dfn> attribute
is a <span>boolean attribute</span>. If present, it indicates the CSS color's alpha component can
Expand Down Expand Up @@ -50318,7 +50313,7 @@ ldh-str = &lt; as defined in <a href="https://www.rfc-editor.org/rfc/rfc10
data-x="attr-input-colorspace-display-p3">display-p3</code></dfn>
<td><dfn data-x="attr-input-colorspace-display-p3-state">Display P3</dfn>
<td>The CSS color is converted to the <span>'display-p3'</span> color space, e.g., "<code
data-x="">color(display-p3 0.84 0.19 0.72 / 0.6)</code>".
data-x="">color(display-p3 1.84 -0.19 0.72 / 0.6)</code>".
</table>

<p>The attribute's <i data-x="missing value default">missing value default</i> and <i
Expand Down Expand Up @@ -133733,33 +133728,33 @@ html, body { display: block; }</code></pre>

<p>When a <code>body</code> element has a <code data-x="attr-body-bgcolor">bgcolor</code>
attribute set, the new value is expected to be parsed using the <span>rules for parsing a legacy
color value</span>, and if that does not return an error, the user agent is expected to treat the
color value</span>, and if that does not return failure, the user agent is expected to treat the
attribute as a <span data-x="presentational hints">presentational hint</span> setting the
element's <span>'background-color'</span> property to the resulting color.</p>

<p>When a <code>body</code> element has a <code data-x="attr-body-text">text</code> attribute, its
value is expected to be parsed using the <span>rules for parsing a legacy color value</span>, and
if that does not return an error, the user agent is expected to treat the attribute as a <span
if that does not return failure, the user agent is expected to treat the attribute as a <span
data-x="presentational hints">presentational hint</span> setting the element's
<span>'color'</span> property to the resulting color.</p>

<p>When a <code>body</code> element has a <code data-x="attr-body-link">link</code> attribute, its
value is expected to be parsed using the <span>rules for parsing a legacy color value</span>, and
if that does not return an error, the user agent is expected to treat the attribute as a <span
if that does not return failure, the user agent is expected to treat the attribute as a <span
data-x="presentational hints">presentational hint</span> setting the <span>'color'</span> property
of any element in the <code>Document</code> matching the <code data-x="selector-link">:link</code>
<span>pseudo-class</span> to the resulting color.</p>

<p>When a <code>body</code> element has a <code data-x="attr-body-vlink">vlink</code> attribute,
its value is expected to be parsed using the <span>rules for parsing a legacy color value</span>,
and if that does not return an error, the user agent is expected to treat the attribute as a <span
and if that does not return failure, the user agent is expected to treat the attribute as a <span
data-x="presentational hints">presentational hint</span> setting the <span>'color'</span> property
of any element in the <code>Document</code> matching the <code
data-x="selector-visited">:visited</code> <span>pseudo-class</span> to the resulting color.</p>

<p>When a <code>body</code> element has an <code data-x="attr-body-alink">alink</code> attribute,
its value is expected to be parsed using the <span>rules for parsing a legacy color value</span>,
and if that does not return an error, the user agent is expected to treat the attribute as a <span
and if that does not return failure, the user agent is expected to treat the attribute as a <span
data-x="presentational hints">presentational hint</span> setting the <span>'color'</span> property
of any element in the <code>Document</code> matching the
<code data-x="selector-active">:active</code> <span>pseudo-class</span> and either the <code
Expand Down Expand Up @@ -133962,7 +133957,7 @@ br[clear=all i], br[clear=both i] { clear: both; }</code></pre>

<p>When a <code>font</code> element has a <code data-x="attr-font-color" undefined>color</code>
attribute, its value is expected to be parsed using the <span>rules for parsing a legacy color
value</span>, and if that does not return an error, the user agent is expected to treat the
value</span>, and if that does not return failure, the user agent is expected to treat the
attribute as a <span data-x="presentational hints">presentational hint</span> setting the
element's <span>'color'</span> property to the resulting color.</p>

Expand Down Expand Up @@ -134572,13 +134567,13 @@ table {
<p>When a <code>table</code>, <code>thead</code>, <code>tbody</code>, <code>tfoot</code>,
<code>tr</code>, <code>td</code>, or <code>th</code> element has a <code data-x="">bgcolor</code>
attribute set, the new value is expected to be parsed using the <span>rules for parsing a legacy
color value</span>, and if that does not return an error, the user agent is expected to treat the
color value</span>, and if that does not return failure, the user agent is expected to treat the
attribute as a <span data-x="presentational hints">presentational hint</span> setting the element's
<span>'background-color'</span> property to the resulting color.</p>

<p>When a <code>table</code> element has a <code data-x="attr-table-bordercolor">bordercolor</code>
attribute, its value is expected to be parsed using the <span>rules for parsing a legacy color
value</span>, and if that does not return an error, the user agent is expected to treat the
value</span>, and if that does not return failure, the user agent is expected to treat the
attribute as a <span data-x="presentational hints">presentational hint</span> setting the
element's <span>'border-top-color'</span>, <span>'border-right-color'</span>,
<span>'border-bottom-color'</span>, and <span>'border-left-color'</span> properties to the
Expand Down Expand Up @@ -134766,7 +134761,7 @@ hr[color], hr[noshade] { border-style: solid; }</code></pre>

<p>When an <code>hr</code> element has a <code data-x="attr-hr-color">color</code> attribute, its
value is expected to be parsed using the <span>rules for parsing a legacy color value</span>, and
if that does not return an error, the user agent is expected to treat the attribute as a <span
if that does not return failure, the user agent is expected to treat the attribute as a <span
data-x="presentational hints">presentational hint</span> setting the element's
<span>'color'</span> property to the resulting color.</p>

Expand Down Expand Up @@ -135958,7 +135953,7 @@ marquee {

<p>When a <code>marquee</code> element has a <code undefined data-x="attr-marquee-bgcolor">bgcolor</code>
attribute set, the value is expected to be parsed using the <span>rules for parsing a legacy color
value</span>, and if that does not return an error, the user agent is expected to treat the
value</span>, and if that does not return failure, the user agent is expected to treat the
attribute as a <span data-x="presentational hints">presentational hint</span> setting the element's
<span>'background-color'</span> property to the resulting color.</p>

Expand Down Expand Up @@ -136341,8 +136336,8 @@ progress { appearance: auto; }</code></pre>

<ol>
<li><p>If the element has a <code data-x="">bordercolor</code> attribute, and applying the
<span>rules for parsing a legacy color value</span> to that attribute's value does not result
in an error, then return the color so obtained.</p></li>
<span>rules for parsing a legacy color value</span> to that attribute's value does not return
failure, then return the color so obtained.</p></li>

<li><p>Otherwise, if the element has a parent element that is a <code>frameset</code> element,
then return the <span>frame border color</span> of that element.</p>
Expand Down

0 comments on commit 264ac8e

Please sign in to comment.