<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugs.webkit.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4.1"
          urlbase="https://bugs.webkit.org/"
          
          maintainer="admin@webkit.org"
>

    <bug>
          <bug_id>251152</bug_id>
          
          <creation_ts>2023-01-25 08:15:00 -0800</creation_ts>
          <short_desc>color() function parsing incorrectly parses missing components</short_desc>
          <delta_ts>2023-03-24 14:34:58 -0700</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>CSS</component>
          <version>Other</version>
          <rep_platform>Unspecified</rep_platform>
          <op_sys>Unspecified</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc>https://wpt.fyi/results/css/css-color/parsing/color-invalid-color-function.html?label=master&amp;label=experimental&amp;product=chrome&amp;product=firefox&amp;product=safari&amp;aligned&amp;view=interop&amp;q=label%3Ainterop-2022-color%20or%20label%3Ainterop-2023-color</bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords>BrowserCompat, GoodFirstBug, InRadar</keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Emilio Cobos Álvarez (:emilio)">emilio</reporter>
          <assigned_to name="Tim Nguyen (:ntim)">ntim</assigned_to>
          <cc>chris</cc>
    
    <cc>heycam</cc>
    
    <cc>karlcow</cc>
    
    <cc>koivisto</cc>
    
    <cc>m_dubet</cc>
    
    <cc>ntim</cc>
    
    <cc>sam</cc>
    
    <cc>webkit-bug-importer</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1928143</commentid>
    <comment_count>0</comment_count>
    <who name="Emilio Cobos Álvarez (:emilio)">emilio</who>
    <bug_when>2023-01-25 08:15:00 -0800</bug_when>
    <thetext>color(srgb / 0.5) seems to parse on safari with the components zeroed out, but that seems wrong per spec. https://w3c.github.io/csswg-drafts/css-color-4/#funcdef-color only says the alpha is optional.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1928347</commentid>
    <comment_count>1</comment_count>
    <who name="Emilio Cobos Álvarez (:emilio)">emilio</who>
    <bug_when>2023-01-25 17:19:22 -0800</bug_when>
    <thetext>https://bugs.chromium.org/p/chromium/issues/detail?id=1410200 is the relevant chromium bug, for reference. I found this while reviewing patches to implement this in Firefox.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1928359</commentid>
    <comment_count>2</comment_count>
    <who name="Karl Dubost">karlcow</who>
    <bug_when>2023-01-25 18:19:49 -0800</bug_when>
    <thetext>After:

    document.body.style.color = color(srgb / 0.5)
    document.body.style.color


WebKit &apos;color(srgb 0 0 0 / 0.5)&apos;
Gecko  &apos;&apos;
Blink  &apos;color(srgb 0 0 0 / 0.5)&apos;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1928512</commentid>
    <comment_count>3</comment_count>
    <who name="Radar WebKit Bug Importer">webkit-bug-importer</who>
    <bug_when>2023-01-25 20:43:59 -0800</bug_when>
    <thetext>&lt;rdar://problem/104679823&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1928606</commentid>
    <comment_count>4</comment_count>
    <who name="Chris Lilley">chris</who>
    <bug_when>2023-01-26 07:58:31 -0800</bug_when>
    <thetext>This used to be correct per spec, long ago when color() also did custom color spaces and it was reasonable to omit some components and have them auto-filled with zero.

Now custom color spaces are in CSS Color 5, and clearly distinguished with a dashed-ident; while predefined color spaces are in CSS Color 4 and are wither an RGB space or an XYZ space. Both take 3 components, as the grammar makes clear.

There was some leftover prose about variable number of components, not up to date with the grammar change, which I just corrected.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1943813</commentid>
    <comment_count>5</comment_count>
    <who name="Tim Nguyen (:ntim)">ntim</who>
    <bug_when>2023-03-24 11:51:31 -0700</bug_when>
    <thetext>Pull request: https://github.com/WebKit/WebKit/pull/11940</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1943856</commentid>
    <comment_count>6</comment_count>
    <who name="EWS">ews-feeder</who>
    <bug_when>2023-03-24 14:34:49 -0700</bug_when>
    <thetext>Committed 262098@main (77b199a5f044): &lt;https://commits.webkit.org/262098@main&gt;

Reviewed commits have been landed. Closing PR #11940 and removing active labels.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>