<?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>227615</bug_id>
          
          <creation_ts>2021-07-02 03:14:48 -0700</creation_ts>
          <short_desc>animation-fill-mode does not correctly apply viewport-based units</short_desc>
          <delta_ts>2026-03-26 15:14:32 -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>All</rep_platform>
          <op_sys>All</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          <see_also>https://github.com/web-platform-tests/wpt/pull/58793</see_also>
          <bug_file_loc>https://will.harris.ch/tcr-animation-fill-mode.html</bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords>HasReduction, InRadar</keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Will Harris">will-web-webkitbugs</reporter>
          <assigned_to name="Ahmad Saleem">ahmad.saleem792</assigned_to>
          <cc>ahmad.saleem792</cc>
    
    <cc>dino</cc>
    
    <cc>graouts</cc>
    
    <cc>koivisto</cc>
    
    <cc>smoley</cc>
    
    <cc>webkit-bug-importer</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1774401</commentid>
    <comment_count>0</comment_count>
    <who name="Will Harris">will-web-webkitbugs</who>
    <bug_when>2021-07-02 03:14:48 -0700</bug_when>
    <thetext>If an animation is applied with an &quot;animation-fill-mode&quot;, and the values in the first/last animation frame are expressed using viewport units (vw, vh), the affected element will not be correctly positioned if the viewport is subsequently resized after the animation has ended (e.g. desktop browser when resizing, mobile browser when orientation is changed).

The attached test case reduction shows the issue. It contains three divs, all positioned with viewport units:

- one reference div, unanimated
- one div animated without &quot;animation-fill-mode&quot;
- one div animated with &quot;animation-fill-mode&quot;

The animated divs share the same animation and CSS positioning. The only difference is that the last div&apos;s animation also uses a fill mode.

When the browser window is resized, the top two divs move correctly, and remain aligned with a reference marker line. The last div does not move as expected to respect the changed viewport size.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1774402</commentid>
    <comment_count>1</comment_count>
    <who name="Will Harris">will-web-webkitbugs</who>
    <bug_when>2021-07-02 03:16:16 -0700</bug_when>
    <thetext>Chrome and Firefox show what I would consider the correct behaviour.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1774403</commentid>
    <comment_count>2</comment_count>
    <who name="Radar WebKit Bug Importer">webkit-bug-importer</who>
    <bug_when>2021-07-02 03:23:53 -0700</bug_when>
    <thetext>&lt;rdar://problem/80075191&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1777312</commentid>
    <comment_count>3</comment_count>
    <who name="Smoley">smoley</who>
    <bug_when>2021-07-15 13:23:19 -0700</bug_when>
    <thetext>It looks like the test case failed to attach. Please try adding it again.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1777497</commentid>
    <comment_count>4</comment_count>
    <who name="Will Harris">will-web-webkitbugs</who>
    <bug_when>2021-07-16 06:40:50 -0700</bug_when>
    <thetext>Sorry, test case added in the URL field:

https://will.harris.ch/tcr-animation-fill-mode.html</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1791458</commentid>
    <comment_count>5</comment_count>
    <who name="Antoine Quint">graouts</who>
    <bug_when>2021-09-08 07:38:50 -0700</bug_when>
    <thetext>Thanks for filing this., I can reproduce the issue with STP 131.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2014400</commentid>
    <comment_count>6</comment_count>
    <who name="Ahmad Saleem">ahmad.saleem792</who>
    <bug_when>2024-02-16 01:24:59 -0800</bug_when>
    <thetext>It is still reproducible in STP188 using attached test case where while animation is running, if you change window size, the last div is stuck.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2193429</commentid>
    <comment_count>7</comment_count>
    <who name="Ahmad Saleem">ahmad.saleem792</who>
    <bug_when>2026-03-25 02:02:42 -0700</bug_when>
    <thetext>Pull request: https://github.com/WebKit/WebKit/pull/61312</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2194030</commentid>
    <comment_count>8</comment_count>
    <who name="EWS">ews-feeder</who>
    <bug_when>2026-03-26 11:46:39 -0700</bug_when>
    <thetext>Committed 310007@main (243e5fe708ed): &lt;https://commits.webkit.org/310007@main&gt;

Reviewed commits have been landed. Closing PR #61312 and removing active labels.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2194082</commentid>
    <comment_count>9</comment_count>
    <who name="Ahmad Saleem">ahmad.saleem792</who>
    <bug_when>2026-03-26 15:14:32 -0700</bug_when>
    <thetext>Submitted web-platform-tests pull request: https://github.com/web-platform-tests/wpt/pull/58793</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>