Bug 228995 - CSS keyframed animations don't respect edges in 4 value background-position
Summary: CSS keyframed animations don't respect edges in 4 value background-position
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Animations (show other bugs)
Version: Safari 14
Hardware: All macOS 11
: P2 Normal
Assignee: Simon Fraser (smfr)
URL:
Keywords: BrowserCompat, InRadar
Depends on:
Blocks:
 
Reported: 2021-08-11 04:47 PDT by Luca Casonato
Modified: 2021-09-06 09:34 PDT (History)
10 users (show)

See Also:


Attachments
Test case (398 bytes, text/html)
2021-08-26 11:42 PDT, Simon Fraser (smfr)
no flags Details
Patch (4.93 KB, patch)
2021-08-26 15:58 PDT, Simon Fraser (smfr)
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Luca Casonato 2021-08-11 04:47:00 PDT
The following example behaves as expected in Chrome and FF, but behaves incorrectly in Safari:

In Firefox and Chrome the Deno logo moves from the top right to the middle. In Safari the logo moves from the top left to the middle.


```html
<style>
  div {
    background-image: url(https://deno.land/logo.svg);
    background-size: 10px;
    background-repeat: no-repeat;
    height: 100px;
    width: 100px;

    animation: move 1s;
  }

  @keyframes move {
    from {
      background-position: right 0 top 0px;
    }

    to {
      background-position: right 50px top 10px;
    }
  }
</style>
<div></div>
```
Comment 1 Radar WebKit Bug Importer 2021-08-11 12:20:57 PDT
<rdar://problem/81807407>
Comment 2 Simon Fraser (smfr) 2021-08-26 11:42:02 PDT
Created attachment 436541 [details]
Test case
Comment 3 Simon Fraser (smfr) 2021-08-26 12:17:50 PDT
The issue here is that the style that results from the animation does not have m_backgroundXOrigin/m_backgroundYOrigin set in it.
Comment 4 Simon Fraser (smfr) 2021-08-26 15:58:19 PDT
Created attachment 436581 [details]
Patch
Comment 5 EWS 2021-08-26 20:53:02 PDT
Committed r281683 (241033@main): <https://commits.webkit.org/241033@main>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 436581 [details].
Comment 6 Arcady Goldmints-Orlov 2021-09-01 08:34:32 PDT
It appears that the test added in this change is flaky, mostly failing (but sometimes passing) on GTK and WPE, and mostly passing (but sometimes failing) on Mac/iOS: https://results.webkit.org/?suite=layout-tests&test=animations%2Fbackground-position.html
Comment 7 Carlos Alberto Lopez Perez 2021-09-06 09:34:09 PDT
(In reply to Arcady Goldmints-Orlov from comment #6)
> It appears that the test added in this change is flaky, mostly failing (but
> sometimes passing) on GTK and WPE, and mostly passing (but sometimes
> failing) on Mac/iOS:
> https://results.webkit.org/?suite=layout-tests&test=animations%2Fbackground-
> position.html

See bug 229764