<?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>307788</bug_id>
          
          <creation_ts>2026-02-13 03:58:51 -0800</creation_ts>
          <short_desc>[scroll-animations] WPT test `view-timelines/contain-alignment.html` fails</short_desc>
          <delta_ts>2026-03-06 04:12:29 -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>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          <see_also>https://github.com/web-platform-tests/wpt/pull/57818</see_also>
          <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>
          
          <blocked>307797</blocked>
          <everconfirmed>1</everconfirmed>
          <reporter name="Antoine Quint">graouts</reporter>
          <assigned_to name="Antoine Quint">graouts</assigned_to>
          <cc>graouts</cc>
    
    <cc>karlcow</cc>
    
    <cc>webkit-bug-importer</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>2181243</commentid>
    <comment_count>0</comment_count>
    <who name="Antoine Quint">graouts</who>
    <bug_when>2026-02-13 03:58:51 -0800</bug_when>
    <thetext>We are failing https://wpt.fyi/results/scroll-animations/view-timelines/contain-alignment.html.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2181244</commentid>
    <comment_count>1</comment_count>
    <who name="Radar WebKit Bug Importer">webkit-bug-importer</who>
    <bug_when>2026-02-13 03:58:57 -0800</bug_when>
    <thetext>&lt;rdar://problem/170309501&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2182074</commentid>
    <comment_count>2</comment_count>
    <who name="Antoine Quint">graouts</who>
    <bug_when>2026-02-16 08:02:54 -0800</bug_when>
    <thetext>The test has an issue:

 @keyframes bg {
    from { background-color:  rgb(254, 0, 0); }
    to { background-color: rgb(0 254, 0); }
 }

Note the missing comma in the `to` value.

That said, once that is fixed, we still fail all of the tests at progress `0`.

If I add `console.log(element.getBoundingClientRect())` within the `forEach()` and comment out the assertions, you&apos;ll notice that for the &quot;c&quot; element we get these values:

== Firefox ==

left: 24
top: 141.3333282470703
width: 32
height: 42.66667175292969
​
== Chrome ==

left: 24
top: 141.3359375
width: 32
height: 42.6640625

== Safari ==

left: 24
top: 141.34375
width: 32
height: 42.671875

You&apos;ll notice how top/height are different in all browsers. Since Firefox doesn&apos;t yet have an implement for view timelines – at least not in the default configuration for Firefox Nightly – I can&apos;t comment on what this yields in the animation model, but for Chrome and Safari this yields the following state for the &quot;c&quot; element:

== Chrome ==

anim.currentTime: -0.0038549015072670014%
anim.effect.getComputedTiming().progress: 0

== Safari ==

anim.currentTime: -0.007709102323286032%
anim.effect.getComputedTiming().progress: null

I&apos;m not sure if this is something we should fix by adding a bit more tolerance at the &quot;before&quot;/&quot;after&quot; phase threshold, allowing for `-0.007709102323286032` to round to `0` and thus yield a progress of `0`, or if it&apos;s something we should fix at the layout level when querying the element&apos;s metrics in `ViewTimeline::cacheCurrentTime()`.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2182103</commentid>
    <comment_count>3</comment_count>
    <who name="Antoine Quint">graouts</who>
    <bug_when>2026-02-16 09:33:34 -0800</bug_when>
    <thetext>We can solve this by adding a little tolerance when computing the current time of an animation attached to a view timeline near the 0% and 100% thresholds. We&apos;ll compute that tolerance based on a fixed point value, such as 0.1pt.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2182106</commentid>
    <comment_count>4</comment_count>
    <who name="Antoine Quint">graouts</who>
    <bug_when>2026-02-16 09:46:51 -0800</bug_when>
    <thetext>Pull request: https://github.com/WebKit/WebKit/pull/58793</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2182127</commentid>
    <comment_count>5</comment_count>
    <who name="Antoine Quint">graouts</who>
    <bug_when>2026-02-16 11:00:30 -0800</bug_when>
    <thetext>Submitted web-platform-tests pull request: https://github.com/web-platform-tests/wpt/pull/57818</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2182323</commentid>
    <comment_count>6</comment_count>
    <who name="EWS">ews-feeder</who>
    <bug_when>2026-02-16 23:58:54 -0800</bug_when>
    <thetext>Committed 307693@main (915bfc026f21): &lt;https://commits.webkit.org/307693@main&gt;

Reviewed commits have been landed. Closing PR #58793 and removing active labels.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2187748</commentid>
    <comment_count>7</comment_count>
    <who name="EWS">ews-feeder</who>
    <bug_when>2026-03-06 04:12:29 -0800</bug_when>
    <thetext>Committed 305413.411@safari-7624-branch (57e7bb615f1b): &lt;https://commits.webkit.org/305413.411@safari-7624-branch&gt;

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

    </bug>

</bugzilla>