<?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>242185</bug_id>
          
          <creation_ts>2022-06-30 06:37:41 -0700</creation_ts>
          <short_desc>[web-animations] additive/accumulative color blending fails to yield intermediary out-of-bounds values</short_desc>
          <delta_ts>2022-09-26 01:10:18 -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>Animations</component>
          <version>WebKit Nightly Build</version>
          <rep_platform>Unspecified</rep_platform>
          <op_sys>Unspecified</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords>InRadar, WebExposed</keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          <blocked>235766</blocked>
    
    <blocked>235768</blocked>
    
    <blocked>235769</blocked>
    
    <blocked>235770</blocked>
    
    <blocked>189299</blocked>
          <everconfirmed>1</everconfirmed>
          <reporter name="Antoine Quint">graouts</reporter>
          <assigned_to name="Sam Weinig">sam</assigned_to>
          <cc>dino</cc>
    
    <cc>graouts</cc>
    
    <cc>sam</cc>
    
    <cc>webkit-bug-importer</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1879344</commentid>
    <comment_count>0</comment_count>
    <who name="Antoine Quint">graouts</who>
    <bug_when>2022-06-30 06:37:41 -0700</bug_when>
    <thetext>We have 28 FAIL results across these WPTs all due to the same issue:

    - web-animations/animation-model/animation-types/accumulation-per-property-001.html
    - web-animations/animation-model/animation-types/accumulation-per-property-002.html
    - web-animations/animation-model/animation-types/addition-per-property-001.html
    - web-animations/animation-model/animation-types/addition-per-property-002.html

These run this subtest from web-animations/animation-model/animation-types/property-types.js for `add` and `accumulate` composite operations for a variety of color CSS properties:

    test(t =&gt; {
      const idlName = propertyToIDL(property);
      const target = createTestElement(t, setup);
      target.style[idlName] = &apos;rgb(128, 128, 128)&apos;;
      const animation = target.animate(
        {
          [idlName]: [&apos;rgb(255, 0, 0)&apos;, &apos;rgb(0, 0, 255)&apos;],
        },
        { duration: 1000, composite }
      );
      testAnimationSamples(animation, idlName,
                           [{ time: 0,   expected: &apos;rgb(255, 128, 128)&apos; },
                            // The value at 50% is interpolated
                            // from &apos;rgb(128+255, 128, 128)&apos;
                            // to   &apos;rgb(128,     128, 128+255)&apos;.
                            { time: 500, expected: &apos;rgb(255, 128, 255)&apos; }]);
    }, `${property} supports animating as color of rgb() with overflowed `
       + &apos; from and to values&apos;);

The issue is that we always clamp values as we blend colors so we can&apos;t have the intermediary representations of rgb(128+255, 128, 128) and rgb(128, 128, 128+255) above for additive and accumulate.

Note that when we blend using `add` or `accumulate`, it will only ever be through some intermediary calls to `CSSPropertyAnimation::blendProperties()` made under `KeyframeEffect::setAnimatedPropertiesInStyle()` which will not produce web-facing values. Only at the end of that method do we call `CSSPropertyAnimation::blendProperties()` with a `replace` composite operation which would be expected to clamp.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1879366</commentid>
    <comment_count>1</comment_count>
      <attachid>460581</attachid>
    <who name="Antoine Quint">graouts</who>
    <bug_when>2022-06-30 08:13:29 -0700</bug_when>
    <thetext>Created attachment 460581
Test</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1881305</commentid>
    <comment_count>2</comment_count>
    <who name="Radar WebKit Bug Importer">webkit-bug-importer</who>
    <bug_when>2022-07-07 06:38:12 -0700</bug_when>
    <thetext>&lt;rdar://problem/96593559&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1900970</commentid>
    <comment_count>3</comment_count>
    <who name="Sam Weinig">sam</who>
    <bug_when>2022-09-24 19:43:58 -0700</bug_when>
    <thetext>Pull request: https://github.com/WebKit/WebKit/pull/4674</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1901114</commentid>
    <comment_count>4</comment_count>
    <who name="EWS">ews-feeder</who>
    <bug_when>2022-09-26 01:10:16 -0700</bug_when>
    <thetext>Committed 254850@main (35a0ba08385c): &lt;https://commits.webkit.org/254850@main&gt;

Reviewed commits have been landed. Closing PR #4674 and removing active labels.</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="0"
              isprivate="0"
          >
            <attachid>460581</attachid>
            <date>2022-06-30 08:13:29 -0700</date>
            <delta_ts>2022-06-30 08:13:29 -0700</delta_ts>
            <desc>Test</desc>
            <filename>additive-color-animation-out-of-bounds.html</filename>
            <type>text/html</type>
            <size>878</size>
            <attacher name="Antoine Quint">graouts</attacher>
            
              <data encoding="base64">PGJvZHk+CjxzY3JpcHQ+Cgpjb25zdCBkaXYgPSBkb2N1bWVudC5ib2R5LmFwcGVuZENoaWxkKGRv
Y3VtZW50LmNyZWF0ZUVsZW1lbnQoImRpdiIpKTsKCi8vIFNldCB0aGUgYmFzZSB2YWx1ZS4KZGl2
LnN0eWxlLmJhY2tncm91bmRDb2xvciA9ICJyZ2IoMTI4LCAxMjgsIDEyOCkiOwoKLy8gQ3JlYXRl
IGFuIGFkZGl0aXZlIGFuaW1hdGlvbiBhbmQgcGF1c2UgaXQuCmNvbnN0IGR1cmF0aW9uID0gMTAw
MDsKY29uc3Qga2V5ZnJhbWVzID0geyBiYWNrZ3JvdW5kQ29sb3I6IFsicmdiKDI1NSwgMCwgMCki
LCAicmdiKDAsIDAsIDI1NSkiXSB9Owpjb25zdCBvcHRpb25zID0geyBkdXJhdGlvbiwgY29tcG9z
aXRlOiAiYWRkIiB9Owpjb25zdCBhbmltYXRpb24gPSBkaXYuYW5pbWF0ZShrZXlmcmFtZXMsIG9w
dGlvbnMpOwphbmltYXRpb24ucGF1c2UoKT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