Changeset 241852 in webkit


Ignore:
Timestamp:
Feb 20, 2019 4:48:37 PM (5 years ago)
Author:
dino@apple.com
Message:

Rotation animations sometimes use the wrong origin (affects apple.com)
https://bugs.webkit.org/show_bug.cgi?id=194878
<rdar://problem/43908047>

Reviewed by Simon Fraser.

Source/WebCore:

Some versions of CoreAnimation apply additive animations in reverse
order. Detect this and reverse the list of animations we provide.

Update the existing animations/additive-transform-animations.html test to
be a ref-test that would identify this failure. Previously it relied on
a pixel test.

  • platform/graphics/ca/GraphicsLayerCA.cpp: Use

HAVE_CA_WHERE_ADDITIVE_TRANSFORMS_ARE_REVERSED to decide whether or
not to flip the list of animations (and mark the correct ones as
additive).

(WebCore::GraphicsLayerCA::appendToUncommittedAnimations):
(WebCore::GraphicsLayerCA::createTransformAnimationsFromKeyframes):

Source/WTF:

  • wtf/Platform.h: Add HAVE(CA_WHERE_ADDITIVE_TRANSFORMS_ARE_REVERSED).

LayoutTests:

Update an old pixel test to be a new ref test, and remove all the old platform-specific
-expected versions.

  • animations/additive-transform-animations-expected.png: Removed.
  • animations/additive-transform-animations.html:
  • legacy-animation-engine/animations/additive-transform-animations-expected.png: Removed.
  • legacy-animation-engine/animations/additive-transform-animations.html:
  • platform/gtk/animations/additive-transform-animations-expected.png: Removed.
  • platform/gtk/animations/additive-transform-animations-expected.txt: Removed.
  • platform/gtk/legacy-animation-engine/animations/additive-transform-animations-expected.png: Removed.
  • platform/gtk/legacy-animation-engine/animations/additive-transform-animations-expected.txt: Removed.
  • platform/ios/animations/additive-transform-animations-expected.txt: Removed.
  • platform/ios/legacy-animation-engine/animations/additive-transform-animations-expected.txt: Removed.
  • platform/mac/animations/additive-transform-animations-expected.txt: Removed.
  • platform/mac/legacy-animation-engine/animations/additive-transform-animations-expected.txt: Removed.
  • platform/win/animations/additive-transform-animations-expected.txt: Removed.
  • platform/win/legacy-animation-engine/animations/additive-transform-animations-expected.txt: Removed.
  • platform/wincairo/animations/additive-transform-animations-expected.txt: Removed.
  • platform/wincairo/legacy-animation-engine/animations/additive-transform-animations-expected.txt: Removed.
  • platform/wpe/animations/additive-transform-animations-expected.txt: Removed.
  • platform/wpe/legacy-animation-engine/animations/additive-transform-animations-expected.txt: Removed.
Location:
trunk
Files:
16 deleted
7 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r241840 r241852  
     12019-02-20  Dean Jackson  <dino@apple.com>
     2
     3        Rotation animations sometimes use the wrong origin (affects apple.com)
     4        https://bugs.webkit.org/show_bug.cgi?id=194878
     5        <rdar://problem/43908047>
     6
     7        Reviewed by Simon Fraser.
     8
     9        Update an old pixel test to be a new ref test, and remove all the old platform-specific
     10        -expected versions.
     11
     12        * animations/additive-transform-animations-expected.png: Removed.
     13        * animations/additive-transform-animations.html:
     14        * legacy-animation-engine/animations/additive-transform-animations-expected.png: Removed.
     15        * legacy-animation-engine/animations/additive-transform-animations.html:
     16        * platform/gtk/animations/additive-transform-animations-expected.png: Removed.
     17        * platform/gtk/animations/additive-transform-animations-expected.txt: Removed.
     18        * platform/gtk/legacy-animation-engine/animations/additive-transform-animations-expected.png: Removed.
     19        * platform/gtk/legacy-animation-engine/animations/additive-transform-animations-expected.txt: Removed.
     20        * platform/ios/animations/additive-transform-animations-expected.txt: Removed.
     21        * platform/ios/legacy-animation-engine/animations/additive-transform-animations-expected.txt: Removed.
     22        * platform/mac/animations/additive-transform-animations-expected.txt: Removed.
     23        * platform/mac/legacy-animation-engine/animations/additive-transform-animations-expected.txt: Removed.
     24        * platform/win/animations/additive-transform-animations-expected.txt: Removed.
     25        * platform/win/legacy-animation-engine/animations/additive-transform-animations-expected.txt: Removed.
     26        * platform/wincairo/animations/additive-transform-animations-expected.txt: Removed.
     27        * platform/wincairo/legacy-animation-engine/animations/additive-transform-animations-expected.txt: Removed.
     28        * platform/wpe/animations/additive-transform-animations-expected.txt: Removed.
     29        * platform/wpe/legacy-animation-engine/animations/additive-transform-animations-expected.txt: Removed.
     30
    1312019-02-20  Said Abou-Hallawa  <sabouhallawa@apple.com>
    232
  • trunk/LayoutTests/animations/additive-transform-animations.html

    r236541 r241852  
    1 <!DOCTYPE html>
    2 
    3 <html>
    4 <head>
    5   <style type="text/css">
    6     .box {
    7       height: 100px;
    8       width: 100px;
    9       background-color: blue;
    10     }
    11    
    12     #box {
    13       -webkit-animation: anim 2s linear both;
    14     }
    15    
    16     @-webkit-keyframes anim {
    17         from { -webkit-transform: rotate(0deg) translate(-100px, 0); }
    18         to   { -webkit-transform: rotate(180deg) translate(300px, 0); }
     1<style>
     2    #original {
     3        position: absolute;
     4        top: 100px;
     5        left: 100px;
     6        width: 100px;
     7        height: 100px;
     8        background-color: blue;
    199    }
    2010
    21     #result {
    22       opacity: 0; /* hide in pixel result */
     11    #rotator {
     12        position: absolute;
     13        top: 100px;
     14        left: 100px;
     15        width: 100px;
     16        height: 100px;
     17        background-color: red;
     18        animation: animation 5s infinite linear;
    2319    }
    24   </style>
    25   <script src="resources/animation-test-helpers.js" type="text/javascript"></script>
    26   <script type="text/javascript">
    27     const expectedValues = [
    28       // [time, element-id, property, expected-value, tolerance]
    29       ["anim",  1, "box",  "webkitTransform", [0, 1, -1, 0, 0, 100], 0.002],
    30     ];
    31    
    32     const doPixelTest = true;
    33     const disablePauseAnimationAPI = false;
    34     runAnimationTest(expectedValues, null, null, disablePauseAnimationAPI, doPixelTest);
    35   </script>
    36 </head>
    37 <body>
    3820
    39 <div class="box" id="box"></div>
    40 <div id="result"></div>
     21    #cover {
     22        position: absolute;
     23        top: 150px;
     24        left: 50px;
     25        width: 200px;
     26        height: 150px;
     27        background-color: green;
     28    }
    4129
    42 </body>
    43 </html>
     30    @keyframes animation {
     31        from { transform: rotate(40deg) translate(50%, 50%) }
     32        to { transform: rotate(60deg) translate(50%, 50%) }
     33    }
     34</style>
     35<p>You should not see any of the rotating red rectangle</p>
     36<div id="original"></div>
     37<div id="rotator"></div>
     38<div id="cover"></div>
  • trunk/LayoutTests/legacy-animation-engine/animations/additive-transform-animations.html

    r235960 r241852  
    1 <!DOCTYPE html><!-- webkit-test-runner [ experimental:WebAnimationsCSSIntegrationEnabled=false ] -->
    2 
    3 <html>
    4 <head>
    5   <style type="text/css">
    6     .box {
    7       height: 100px;
    8       width: 100px;
    9       background-color: blue;
    10     }
    11    
    12     #box {
    13       -webkit-animation: anim 2s linear both;
    14     }
    15    
    16     @-webkit-keyframes anim {
    17         from { -webkit-transform: rotate(0deg) translate(-100px, 0); }
    18         to   { -webkit-transform: rotate(180deg) translate(300px, 0); }
     1<style><!-- webkit-test-runner [ experimental:WebAnimationsCSSIntegrationEnabled=false ] -->
     2    #original {
     3        position: absolute;
     4        top: 100px;
     5        left: 100px;
     6        width: 100px;
     7        height: 100px;
     8        background-color: blue;
    199    }
    2010
    21     #result {
    22       opacity: 0; /* hide in pixel result */
     11    #rotator {
     12        position: absolute;
     13        top: 100px;
     14        left: 100px;
     15        width: 100px;
     16        height: 100px;
     17        background-color: red;
     18        animation: animation 5s infinite linear;
    2319    }
    24   </style>
    25   <script src="resources/animation-test-helpers.js" type="text/javascript"></script>
    26   <script type="text/javascript">
    27     const expectedValues = [
    28       // [time, element-id, property, expected-value, tolerance]
    29       ["anim",  1, "box",  "webkitTransform", [0, 1, -1, 0, 0, 100], 0.002],
    30     ];
    31    
    32     const doPixelTest = true;
    33     const disablePauseAnimationAPI = false;
    34     runAnimationTest(expectedValues, null, null, disablePauseAnimationAPI, doPixelTest);
    35   </script>
    36 </head>
    37 <body>
    3820
    39 <div class="box" id="box"></div>
    40 <div id="result"></div>
     21    #cover {
     22        position: absolute;
     23        top: 150px;
     24        left: 50px;
     25        width: 200px;
     26        height: 150px;
     27        background-color: green;
     28    }
    4129
    42 </body>
    43 </html>
     30    @keyframes animation {
     31        from { transform: rotate(40deg) translate(50%, 50%) }
     32        to { transform: rotate(60deg) translate(50%, 50%) }
     33    }
     34</style>
     35<p>You should not see any of the rotating red rectangle</p>
     36<div id="original"></div>
     37<div id="rotator"></div>
     38<div id="cover"></div>
  • trunk/Source/WTF/ChangeLog

    r241841 r241852  
     12019-02-20  Dean Jackson  <dino@apple.com>
     2
     3        Rotation animations sometimes use the wrong origin (affects apple.com)
     4        https://bugs.webkit.org/show_bug.cgi?id=194878
     5        <rdar://problem/43908047>
     6
     7        Reviewed by Simon Fraser.
     8
     9        * wtf/Platform.h: Add HAVE(CA_WHERE_ADDITIVE_TRANSFORMS_ARE_REVERSED).
     10
    1112019-02-20  Andy Estes  <aestes@apple.com>
    212
  • trunk/Source/WTF/wtf/Platform.h

    r241299 r241852  
    14401440#endif
    14411441
     1442#if (PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 101500) || PLATFORM(IOS_FAMILY)
     1443#define HAVE_CA_WHERE_ADDITIVE_TRANSFORMS_ARE_REVERSED 1
     1444#endif
     1445
    14421446#ifdef __APPLE__
    14431447#define HAVE_FUNC_USLEEP 1
  • trunk/Source/WebCore/ChangeLog

    r241851 r241852  
     12019-02-20  Dean Jackson  <dino@apple.com>
     2
     3        Rotation animations sometimes use the wrong origin (affects apple.com)
     4        https://bugs.webkit.org/show_bug.cgi?id=194878
     5        <rdar://problem/43908047>
     6
     7        Reviewed by Simon Fraser.
     8
     9        Some versions of CoreAnimation apply additive animations in reverse
     10        order. Detect this and reverse the list of animations we provide.
     11
     12        Update the existing animations/additive-transform-animations.html test to
     13        be a ref-test that would identify this failure. Previously it relied on
     14        a pixel test.
     15
     16        * platform/graphics/ca/GraphicsLayerCA.cpp: Use
     17            HAVE_CA_WHERE_ADDITIVE_TRANSFORMS_ARE_REVERSED to decide whether or
     18            not to flip the list of animations (and mark the correct ones as
     19            additive).
     20        (WebCore::GraphicsLayerCA::appendToUncommittedAnimations):
     21        (WebCore::GraphicsLayerCA::createTransformAnimationsFromKeyframes):
     22
    1232019-02-20  Don Olmstead  <don.olmstead@sony.com>
    224
  • trunk/Source/WebCore/platform/graphics/ca/GraphicsLayerCA.cpp

    r241751 r241852  
    30873087{
    30883088    TransformOperation::OperationType transformOp = isMatrixAnimation ? TransformOperation::MATRIX_3D : operations->operations().at(animationIndex)->type();
     3089#if !PLATFORM(WIN) && !HAVE(CA_WHERE_ADDITIVE_TRANSFORMS_ARE_REVERSED)
    30893090    bool additive = animationIndex > 0;
     3091#else
     3092    int numAnimations = isMatrixAnimation ? 1 : operations->size();
     3093    bool additive = animationIndex < numAnimations - 1;
     3094#endif
    30903095    bool isKeyframe = valueList.size() > 2;
    30913096
     
    31243129    int numAnimations = isMatrixAnimation ? 1 : operations->size();
    31253130
    3126 #if !PLATFORM(WIN)
     3131#if !PLATFORM(WIN) && !HAVE(CA_WHERE_ADDITIVE_TRANSFORMS_ARE_REVERSED)
    31273132    for (int animationIndex = 0; animationIndex < numAnimations; ++animationIndex) {
    31283133#else
    3129     // QuartzCore on Windows expects animation lists to be applied in reverse order (<rdar://problem/9112233>).
     3134    // Some versions of CA require animation lists to be applied in reverse order (<rdar://problem/43908047> and <rdar://problem/9112233>).
    31303135    for (int animationIndex = numAnimations - 1; animationIndex >= 0; --animationIndex) {
    31313136#endif
Note: See TracChangeset for help on using the changeset viewer.