<?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>223889</bug_id>
          
          <creation_ts>2021-03-29 11:36:48 -0700</creation_ts>
          <short_desc>Some WPT are failing because of colors being in the wrong format</short_desc>
          <delta_ts>2021-04-05 11:37:33 -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>Safari 14</version>
          <rep_platform>Unspecified</rep_platform>
          <op_sys>Unspecified</op_sys>
          <bug_status>NEW</bug_status>
          <resolution></resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords>InRadar</keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Tim Nguyen (:ntim)">ntim</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>graouts</cc>
    
    <cc>koivisto</cc>
    
    <cc>sam</cc>
    
    <cc>simon.fraser</cc>
    
    <cc>webkit-bug-importer</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1744804</commentid>
    <comment_count>0</comment_count>
    <who name="Tim Nguyen (:ntim)">ntim</who>
    <bug_when>2021-03-29 11:36:48 -0700</bug_when>
    <thetext>Example: 
https://webkit-search.igalia.com/webkit/source/LayoutTests/imported/w3c/web-platform-tests/css/css-backgrounds/parsing/background-image-computed.sub-expected.txt</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1744810</commentid>
    <comment_count>1</comment_count>
      <attachid>424555</attachid>
    <who name="Sam Weinig">sam</who>
    <bug_when>2021-03-29 11:47:15 -0700</bug_when>
    <thetext>Created attachment 424555
Minimal test case</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1744812</commentid>
    <comment_count>2</comment_count>
    <who name="Sam Weinig">sam</who>
    <bug_when>2021-03-29 11:48:48 -0700</bug_when>
    <thetext>Looks like something (likely CSSGradientValue) is not resolving color identifiers down to Colors before serializing.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1744857</commentid>
    <comment_count>3</comment_count>
    <who name="Sam Weinig">sam</who>
    <bug_when>2021-03-29 13:19:28 -0700</bug_when>
    <thetext>I haven&apos;t dropped into the debugger yet, but I am pretty sure this happening in ComputedStyleExtractor::valueForPropertyInStyle():

        case CSSPropertyBackgroundImage:
        case CSSPropertyWebkitMaskImage: {
            auto&amp; layers = propertyID == CSSPropertyWebkitMaskImage ? style.maskLayers() : style.backgroundLayers();
            if (!layers.next()) {
                if (layers.image())
                    return layers.image()-&gt;cssValue();
                return cssValuePool.createIdentifierValue(CSSValueNone);
            }
            auto list = CSSValueList::createCommaSeparated();
            for (auto* currLayer = &amp;layers; currLayer; currLayer = currLayer-&gt;next()) {
                if (currLayer-&gt;image())
                    list-&gt;append(currLayer-&gt;image()-&gt;cssValue());
                else
                    list-&gt;append(cssValuePool.createIdentifierValue(CSSValueNone));
            }
            return list;
        }


When the `layers.image()-&gt;cssValue()` call happens, the `image()`, which is of type CSSGradientValue, has not had its color styles resolved. You can see in the lines above it what a call with color resolving looks like:

        case CSSPropertyBackgroundColor:
            return m_allowVisitedStyle ? cssValuePool.createColorValue(style.visitedDependentColor(CSSPropertyBackgroundColor)) : currentColorOrValidColor(&amp;style, style.backgroundColor());


So, somehow, we need to resolve those colors.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1744859</commentid>
    <comment_count>4</comment_count>
    <who name="Sam Weinig">sam</who>
    <bug_when>2021-03-29 13:19:41 -0700</bug_when>
    <thetext>Antti, any ideas on a good pattern for this?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1747031</commentid>
    <comment_count>5</comment_count>
    <who name="Radar WebKit Bug Importer">webkit-bug-importer</who>
    <bug_when>2021-04-05 11:37:33 -0700</bug_when>
    <thetext>&lt;rdar://problem/76226756&gt;</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="0"
              isprivate="0"
          >
            <attachid>424555</attachid>
            <date>2021-03-29 11:47:15 -0700</date>
            <delta_ts>2021-03-29 11:47:15 -0700</delta_ts>
            <desc>Minimal test case</desc>
            <filename>testcase.html</filename>
            <type>text/html</type>
            <size>913</size>
            <attacher name="Sam Weinig">sam</attacher>
            
              <data encoding="base64">PHByZSBpZD0ibG9nIj48L3ByZT4KCjxzY3JpcHQ+CgogICAgZnVuY3Rpb24gbG9nKG1zZykKICAg
IHsKICAgICAgICBkb2N1bWVudC5nZXRFbGVtZW50QnlJZCgibG9nIikuYXBwZW5kKG1zZyArICJc
biIpOwogICAgfQoKICAgIGZ1bmN0aW9uIGNvbXB1dGVkU3R5bGUocHJvcGVydHksIHZhbHVlKQog
ICAgewogICAgICAgIHZhciBkaXYgPSBkb2N1bWVudC5jcmVhdGVFbGVtZW50KCJkaXYiKTsKICAg
ICAgICBkb2N1bWVudC5ib2R5LmFwcGVuZENoaWxkKGRpdik7CiAgICAgICAgZGl2LnN0eWxlLnNl
dFByb3BlcnR5KHByb3BlcnR5LCB2YWx1ZSk7CiAgICAgICAgdmFyIGNvbXB1dGVkVmFsdWUgPSBn
ZXRDb21wdXRlZFN0eWxlKGRpdikuZ2V0UHJvcGVydHlWYWx1ZShwcm9wZXJ0eSk7CiAgICAgICAg
ZG9jdW1lbnQuYm9keS5yZW1vdmVDaGlsZChkaXYpOwogICAgICAgIHJldHVybiBjb21wdXRlZFZh
bHVlOwogICAgfQoKICAgIGZ1bmN0aW9uIHRlc3RDb21wdXRlZFByb3BlcnR5KHByb3BlcnR5LCB2
YWx1ZSwgZXhwZWN0ZWQpCiAgICB7CiAgICAgICAgY29uc3QgcmVzdWx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