Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Let CSS Color handle CSS <color> value parsing #10175

Merged
merged 2 commits into from
Mar 5, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 1 addition & 25 deletions source
Original file line number Diff line number Diff line change
Expand Up @@ -3520,31 +3520,6 @@ a.setAttribute('href', 'https://example.com/'); // change the content attribute
parenthesis and a missing "blue" value) cannot be parsed, as closing the open construct does not
result in a viable value.</p>

<p>To <dfn id="parsed-as-a-css-color-value">parse a CSS &lt;color> value</dfn>, given a string
<var>input</var> with an optional element <var>element</var>, run these steps:</p>

<ol>
<li><p>Let <var>color</var> be the result of <span data-x="parse something according to a CSS
grammar">parsing</span> <var>input</var> as a CSS <span>&lt;color></span>.
<ref>CSSCOLOR</ref></p></li>

<li><p>If <var>color</var> is failure, then return failure.</p></li>

<li>
<p>If <var>color</var> is <span>'currentcolor'</span>, then:</p>

<ol>
<li><p>If <var>element</var> is not given, then set <var>color</var> to <span>opaque
black</span>.</p></li>

<li><p>Otherwise, set <var>color</var> to the computed value of the <span>'color'</span>
property of <var>element</var>.</p></li>
</ol>
</li>

<li><p>Return <var>color</var>.</p></li>
</ol>

<p>The following terms and features are defined in <cite>Cascading Style Sheets</cite>
(<cite>CSS</cite>): <ref>CSS</ref></p>

Expand Down Expand Up @@ -3649,6 +3624,7 @@ a.setAttribute('href', 'https://example.com/'); // change the content attribute
<li><dfn data-x-href="https://drafts.csswg.org/css-color/#valdef-color-srgb">'srgb'</dfn> color space</li>
<li><dfn data-x-href="https://drafts.csswg.org/css-color/#valdef-color-display-p3">'display-p3'</dfn> color space</li>
<li><dfn data-x-href="https://drafts.csswg.org/css-color/#valdef-color-profile-rendering-intent-relative-colorimetric">'relative-colorimetric'</dfn> rendering intent</li>
<li><dfn id="parsed-as-a-css-color-value" data-x-href="https://drafts.csswg.org/css-color/#parse-a-css-color-value">parse a CSS &lt;color> value</dfn></li>
</ul>

<p>The following terms are defined in <cite>CSS Images</cite>: <ref>CSSIMAGES</ref></p>
Expand Down
Loading