<?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>208465</bug_id>
          
          <creation_ts>2020-03-02 12:49:33 -0800</creation_ts>
          <short_desc>ExtendedColor doesn&apos;t work with animation</short_desc>
          <delta_ts>2021-12-27 11:33:59 -0800</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>Animations</component>
          <version>WebKit Nightly Build</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="Dean Jackson">dino</reporter>
          <assigned_to name="Sam Weinig">sam</assigned_to>
          <cc>dino</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>1624681</commentid>
    <comment_count>0</comment_count>
    <who name="Dean Jackson">dino</who>
    <bug_when>2020-03-02 12:49:33 -0800</bug_when>
    <thetext>We never implemented code to have ExtendedColors animate. I remember it being unclear what should happen if you are animating between Color Spaces, but we did address this for gradients.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1624682</commentid>
    <comment_count>1</comment_count>
    <who name="Radar WebKit Bug Importer">webkit-bug-importer</who>
    <bug_when>2020-03-02 12:49:51 -0800</bug_when>
    <thetext>&lt;rdar://problem/59963499&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1624683</commentid>
    <comment_count>2</comment_count>
    <who name="Simon Fraser (smfr)">simon.fraser</who>
    <bug_when>2020-03-02 12:50:56 -0800</bug_when>
    <thetext>Convert the endpoints into the deeper of the two colorspaces and then interpolate?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1624684</commentid>
    <comment_count>3</comment_count>
    <who name="Simon Fraser (smfr)">simon.fraser</who>
    <bug_when>2020-03-02 12:51:42 -0800</bug_when>
    <thetext>Relevant: https://github.com/w3c/csswg-drafts/issues/4647</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1826678</commentid>
    <comment_count>4</comment_count>
      <attachid>447925</attachid>
    <who name="Simon Fraser (smfr)">simon.fraser</who>
    <bug_when>2021-12-23 18:14:08 -0800</bug_when>
    <thetext>Created attachment 447925
P3 color interpolation</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1826962</commentid>
    <comment_count>5</comment_count>
      <attachid>448003</attachid>
    <who name="Sam Weinig">sam</who>
    <bug_when>2021-12-27 11:18:24 -0800</bug_when>
    <thetext>Created attachment 448003
Test case with computed output</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1826964</commentid>
    <comment_count>6</comment_count>
    <who name="Sam Weinig">sam</who>
    <bug_when>2021-12-27 11:33:59 -0800</bug_when>
    <thetext>There are two things that need to done here:

1. Support animations of colors with a larger gamut than sRGB animating without eager gamut mapping them to sRGB. 

For consistency with precedent and gradients, I propose we use the unbounded sRGB (aka ExtendedSRGB in the engine) color space as the interpolation space. This has the effect that animating between two colors outside of the sRGB gamut would produce some computed color() functions with less than 0 or greater than 1 for component values (e.g. color(srgb 1.0930663624351615, -0.22674197356975417, -0.15013458093711937) for color(display-p3 1 0 0)).

As a general rule, I would like for us to avoid basing interpolation results on input colors, as I think that can lead to confusion to users, especially when coupled with things like CSS variables. For that reason, I don&apos;t think trying to give computed results in the color(display-p3 ...) form makes sense here.

The one exception to that rule is that I think we should special case the situation when the legacy color formats (srgb(), #fff, etc.) are used as both keyframes, and continue to return clamped 8-bit results. This would ensure that we don&apos;t break existing content that may be depending on that. 


2. Specifying which interpolation color space to use for an animation.

Gradients now support an additional parameter to specify the interpolation color space (https://drafts.csswg.org/css-images-4/#linear-gradients) using an optional &lt;color-interpolation-method&gt; production. 

I think we should extend CSS animations (and WebAnimations) to allow specifying per-keyframe pair interpolation color spaces. Exactly how that should work, where one would specify it, and whether it would be for all colors or per-color taking property (e.g. separate interpolation color space for background-color and color) will need to be worked out.

We will keep this bug about #1 and use https://bugs.webkit.org/show_bug.cgi?id=234702 for #2.</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="0"
              isprivate="0"
          >
            <attachid>447925</attachid>
            <date>2021-12-23 18:14:08 -0800</date>
            <delta_ts>2021-12-23 18:14:08 -0800</delta_ts>
            <desc>P3 color interpolation</desc>
            <filename>p3-color-animation.html</filename>
            <type>text/html</type>
            <size>572</size>
            <attacher name="Simon Fraser (smfr)">simon.fraser</attacher>
            
              <data encoding="base64">PCFET0NUWVBFIGh0bWw+CjxodG1sPgo8aGVhZD4KICAgIDxtZXRhIG5hbWU9InZpZXdwb3J0IiBj
b250ZW50PSJ3aWR0aD1kZXZpY2Utd2lkdGgsIGluaXRpYWwtc2NhbGU9MSwgc2hyaW5rLXRvLWZp
dD1ubyI+CiAgICA8c3R5bGU+CiAgICAgICAgLmJveCB7CiAgICAgICAgICAgIHdpZHRoOiAxMDBw
eDsKICAgICAgICAgICAgaGVpZ2h0OiAxMDBweDsKICAgICAgICAgICAgYmFja2dyb3VuZC1jb2xv
cjogYmx1ZTsKICAgICAgICAgICAgYW5pbWF0aW9uOiBmYWRlIDJzIGFsdGVybmF0ZSBpbmZpbml0
ZTsKICAgICAgICB9CiAgICAgICAgCiAgICAgICAgQGtleWZyYW1lcyBmYWRlIHsKICAgICAgICAg
ICAgZnJvbSB7IGJhY2tncm91bmQtY29sb3I6IGNvbG9yKGRpc3BsYXktcDMgMSAwLjUgMSk7IH0K
ICAgICAgICAgICAgdG8gICB7IGJhY2tncm91bmQtY29sb3I6IGNvbG9yKGRpc3BsYXktcDMgMC4y
IDAuOCAxKTsgfQogICAgICAgIH0KICAgICAgICAKICAgIDwvc3R5bGU+CjwvaGVhZD4KPGJvZHk+
CiAgICA8ZGl2IGNsYXNzPSJib3giPgogICAgICAgIAogICAgPC9kaXY+CjwvYm9keT4KPC9odG1s
Pgo=
</data>

          </attachment>
          <attachment
              isobsolete="0"
              ispatch="0"
              isprivate="0"
          >
            <attachid>448003</attachid>
            <date>2021-12-27 11:18:24 -0800</date>
            <delta_ts>2021-12-27 11:18:24 -0800</delta_ts>
            <desc>Test case with computed output</desc>
            <filename>animate.html</filename>
            <type>text/html</type>
            <size>1036</size>
            <attacher name="Sam Weinig">sam</attacher>
            
              <data encoding="base64">PCFET0NUWVBFIGh0bWw+CjxodG1sPgo8aGVhZD4KICAgIDxtZXRhIGNoYXJzZXQ9InV0Zi04Ij4K
PC9oZWFkPgo8Ym9keT4KPHNjcmlwdD4KY29uc3QgZnJvbUNvbG9yID0gImNvbG9yKGRpc3BsYXkt
cDMgMSAwIDApIjsKY29uc3QgdG9Db2xvciA9ICJjb2xvcihkaXNwbGF5LXAzIDAgMCAxKSI7Cgpj
b25zdCBleHBsYW5hdGlvbiA9IGRvY3VtZW50LmNyZWF0ZUVsZW1lbnQoImRpdiIpCmV4cGxhbmF0
aW9uLmlubmVySFRNTCA9IGBBbmltYXRpb24gZnJvbSA8c3BhbiBzdHlsZT0iY29sb3I6JHtmcm9t
Q29sb3J9Ij4ke2Zyb21Db2xvcn08L3NwYW4+IHRvIDxzcGFuIHN0eWxlPSJjb2xvcjoke3RvQ29s
b3J9Ij4ke3RvQ29sb3J9PC9zcGFuPiA8aHI+YApkb2N1bWVudC5ib2R5LmFwcGVuZChleHBsYW5h
dGlvbikKCmNvbnN0IHJlZkVsZW1lbnQgPSBkb2N1bWVudC5jcmVhdGVFbGVtZW50KCJkaXYiKTsK
ZG9j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