Rotation animations sometimes use the wrong origin (affects apple.com)
authordino@apple.com <dino@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 21 Feb 2019 00:48:37 +0000 (00:48 +0000)
committerdino@apple.com <dino@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 21 Feb 2019 00:48:37 +0000 (00:48 +0000)
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.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@241852 268f45cc-cd09-0410-ab3c-d52691b4dbfc

23 files changed:
LayoutTests/ChangeLog
LayoutTests/animations/additive-transform-animations-expected.png [deleted file]
LayoutTests/animations/additive-transform-animations.html
LayoutTests/legacy-animation-engine/animations/additive-transform-animations-expected.png [deleted file]
LayoutTests/legacy-animation-engine/animations/additive-transform-animations.html
LayoutTests/platform/gtk/animations/additive-transform-animations-expected.png [deleted file]
LayoutTests/platform/gtk/animations/additive-transform-animations-expected.txt [deleted file]
LayoutTests/platform/gtk/legacy-animation-engine/animations/additive-transform-animations-expected.png [deleted file]
LayoutTests/platform/gtk/legacy-animation-engine/animations/additive-transform-animations-expected.txt [deleted file]
LayoutTests/platform/ios/animations/additive-transform-animations-expected.txt [deleted file]
LayoutTests/platform/ios/legacy-animation-engine/animations/additive-transform-animations-expected.txt [deleted file]
LayoutTests/platform/mac/animations/additive-transform-animations-expected.txt [deleted file]
LayoutTests/platform/mac/legacy-animation-engine/animations/additive-transform-animations-expected.txt [deleted file]
LayoutTests/platform/win/animations/additive-transform-animations-expected.txt [deleted file]
LayoutTests/platform/win/legacy-animation-engine/animations/additive-transform-animations-expected.txt [deleted file]
LayoutTests/platform/wincairo/animations/additive-transform-animations-expected.txt [deleted file]
LayoutTests/platform/wincairo/legacy-animation-engine/animations/additive-transform-animations-expected.txt [deleted file]
LayoutTests/platform/wpe/animations/additive-transform-animations-expected.txt [deleted file]
LayoutTests/platform/wpe/legacy-animation-engine/animations/additive-transform-animations-expected.txt [deleted file]
Source/WTF/ChangeLog
Source/WTF/wtf/Platform.h
Source/WebCore/ChangeLog
Source/WebCore/platform/graphics/ca/GraphicsLayerCA.cpp

index d894e78..41f3376 100644 (file)
@@ -1,3 +1,33 @@
+2019-02-20  Dean Jackson  <dino@apple.com>
+
+        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.
+
+        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.
+
 2019-02-20  Said Abou-Hallawa  <sabouhallawa@apple.com>
 
         drawImage() clears the canvas if it's the source of the image and globalCompositeOperation is "copy"
diff --git a/LayoutTests/animations/additive-transform-animations-expected.png b/LayoutTests/animations/additive-transform-animations-expected.png
deleted file mode 100644 (file)
index 7ef45cf..0000000
Binary files a/LayoutTests/animations/additive-transform-animations-expected.png and /dev/null differ
index 8762512..a255e44 100644 (file)
@@ -1,43 +1,38 @@
-<!DOCTYPE html>
-
-<html>
-<head>
-  <style type="text/css">
-    .box {
-      height: 100px;
-      width: 100px;
-      background-color: blue;
-    }
-    
-    #box {
-      -webkit-animation: anim 2s linear both;
-    }
-    
-    @-webkit-keyframes anim {
-        from { -webkit-transform: rotate(0deg) translate(-100px, 0); }
-        to   { -webkit-transform: rotate(180deg) translate(300px, 0); }
+<style>
+    #original {
+        position: absolute;
+        top: 100px;
+        left: 100px;
+        width: 100px;
+        height: 100px;
+        background-color: blue;
     }
 
-    #result {
-      opacity: 0; /* hide in pixel result */
+    #rotator {
+        position: absolute;
+        top: 100px;
+        left: 100px;
+        width: 100px;
+        height: 100px;
+        background-color: red;
+        animation: animation 5s infinite linear;
     }
-  </style>
-  <script src="resources/animation-test-helpers.js" type="text/javascript"></script>
-  <script type="text/javascript">
-    const expectedValues = [
-      // [time, element-id, property, expected-value, tolerance]
-      ["anim",  1, "box",  "webkitTransform", [0, 1, -1, 0, 0, 100], 0.002],
-    ];
-    
-    const doPixelTest = true;
-    const disablePauseAnimationAPI = false;
-    runAnimationTest(expectedValues, null, null, disablePauseAnimationAPI, doPixelTest);
-  </script>
-</head>
-<body>
 
-<div class="box" id="box"></div>
-<div id="result"></div>
+    #cover {
+        position: absolute;
+        top: 150px;
+        left: 50px;
+        width: 200px;
+        height: 150px;
+        background-color: green;
+    }
 
-</body>
-</html>
+    @keyframes animation {
+        from { transform: rotate(40deg) translate(50%, 50%) }
+        to { transform: rotate(60deg) translate(50%, 50%) }
+    }
+</style>
+<p>You should not see any of the rotating red rectangle</p>
+<div id="original"></div>
+<div id="rotator"></div>
+<div id="cover"></div>
diff --git a/LayoutTests/legacy-animation-engine/animations/additive-transform-animations-expected.png b/LayoutTests/legacy-animation-engine/animations/additive-transform-animations-expected.png
deleted file mode 100644 (file)
index 7ef45cf..0000000
Binary files a/LayoutTests/legacy-animation-engine/animations/additive-transform-animations-expected.png and /dev/null differ
index 4c2a289..d8a1b10 100644 (file)
@@ -1,43 +1,38 @@
-<!DOCTYPE html><!-- webkit-test-runner [ experimental:WebAnimationsCSSIntegrationEnabled=false ] -->
-
-<html>
-<head>
-  <style type="text/css">
-    .box {
-      height: 100px;
-      width: 100px;
-      background-color: blue;
-    }
-    
-    #box {
-      -webkit-animation: anim 2s linear both;
-    }
-    
-    @-webkit-keyframes anim {
-        from { -webkit-transform: rotate(0deg) translate(-100px, 0); }
-        to   { -webkit-transform: rotate(180deg) translate(300px, 0); }
+<style><!-- webkit-test-runner [ experimental:WebAnimationsCSSIntegrationEnabled=false ] -->
+    #original {
+        position: absolute;
+        top: 100px;
+        left: 100px;
+        width: 100px;
+        height: 100px;
+        background-color: blue;
     }
 
-    #result {
-      opacity: 0; /* hide in pixel result */
+    #rotator {
+        position: absolute;
+        top: 100px;
+        left: 100px;
+        width: 100px;
+        height: 100px;
+        background-color: red;
+        animation: animation 5s infinite linear;
     }
-  </style>
-  <script src="resources/animation-test-helpers.js" type="text/javascript"></script>
-  <script type="text/javascript">
-    const expectedValues = [
-      // [time, element-id, property, expected-value, tolerance]
-      ["anim",  1, "box",  "webkitTransform", [0, 1, -1, 0, 0, 100], 0.002],
-    ];
-    
-    const doPixelTest = true;
-    const disablePauseAnimationAPI = false;
-    runAnimationTest(expectedValues, null, null, disablePauseAnimationAPI, doPixelTest);
-  </script>
-</head>
-<body>
 
-<div class="box" id="box"></div>
-<div id="result"></div>
+    #cover {
+        position: absolute;
+        top: 150px;
+        left: 50px;
+        width: 200px;
+        height: 150px;
+        background-color: green;
+    }
 
-</body>
-</html>
+    @keyframes animation {
+        from { transform: rotate(40deg) translate(50%, 50%) }
+        to { transform: rotate(60deg) translate(50%, 50%) }
+    }
+</style>
+<p>You should not see any of the rotating red rectangle</p>
+<div id="original"></div>
+<div id="rotator"></div>
+<div id="cover"></div>
diff --git a/LayoutTests/platform/gtk/animations/additive-transform-animations-expected.png b/LayoutTests/platform/gtk/animations/additive-transform-animations-expected.png
deleted file mode 100644 (file)
index 930f950..0000000
Binary files a/LayoutTests/platform/gtk/animations/additive-transform-animations-expected.png and /dev/null differ
diff --git a/LayoutTests/platform/gtk/animations/additive-transform-animations-expected.txt b/LayoutTests/platform/gtk/animations/additive-transform-animations-expected.txt
deleted file mode 100644 (file)
index 3d16a24..0000000
+++ /dev/null
@@ -1,12 +0,0 @@
-layer at (0,0) size 800x600
-  RenderView at (0,0) size 800x600
-layer at (0,0) size 800x134
-  RenderBlock {HTML} at (0,0) size 800x134
-    RenderBody {BODY} at (8,8) size 784x118
-layer at (8,8) size 100x100
-  RenderBlock {DIV} at (0,0) size 100x100 [bgcolor=#0000FF]
-layer at (8,108) size 784x18
-  RenderBlock {DIV} at (0,100) size 784x18
-    RenderText {#text} at (0,0) size 627x17
-      text run at (0,0) width 627: "PASS - \"webkitTransform\" property for \"box\" element at 1s saw something close to: 0,1,-1,0,0,100"
-    RenderBR {BR} at (626,0) size 1x17
diff --git a/LayoutTests/platform/gtk/legacy-animation-engine/animations/additive-transform-animations-expected.png b/LayoutTests/platform/gtk/legacy-animation-engine/animations/additive-transform-animations-expected.png
deleted file mode 100644 (file)
index c57f0f0..0000000
Binary files a/LayoutTests/platform/gtk/legacy-animation-engine/animations/additive-transform-animations-expected.png and /dev/null differ
diff --git a/LayoutTests/platform/gtk/legacy-animation-engine/animations/additive-transform-animations-expected.txt b/LayoutTests/platform/gtk/legacy-animation-engine/animations/additive-transform-animations-expected.txt
deleted file mode 100644 (file)
index 3d16a24..0000000
+++ /dev/null
@@ -1,12 +0,0 @@
-layer at (0,0) size 800x600
-  RenderView at (0,0) size 800x600
-layer at (0,0) size 800x134
-  RenderBlock {HTML} at (0,0) size 800x134
-    RenderBody {BODY} at (8,8) size 784x118
-layer at (8,8) size 100x100
-  RenderBlock {DIV} at (0,0) size 100x100 [bgcolor=#0000FF]
-layer at (8,108) size 784x18
-  RenderBlock {DIV} at (0,100) size 784x18
-    RenderText {#text} at (0,0) size 627x17
-      text run at (0,0) width 627: "PASS - \"webkitTransform\" property for \"box\" element at 1s saw something close to: 0,1,-1,0,0,100"
-    RenderBR {BR} at (626,0) size 1x17
diff --git a/LayoutTests/platform/ios/animations/additive-transform-animations-expected.txt b/LayoutTests/platform/ios/animations/additive-transform-animations-expected.txt
deleted file mode 100644 (file)
index 2328681..0000000
+++ /dev/null
@@ -1,12 +0,0 @@
-layer at (0,0) size 800x600
-  RenderView at (0,0) size 800x600
-layer at (0,0) size 800x136
-  RenderBlock {HTML} at (0,0) size 800x136
-    RenderBody {BODY} at (8,8) size 784x120
-layer at (8,8) size 100x100
-  RenderBlock {DIV} at (0,0) size 100x100 [bgcolor=#0000FF]
-layer at (8,108) size 784x20
-  RenderBlock {DIV} at (0,100) size 784x20
-    RenderText {#text} at (0,0) size 635x19
-      text run at (0,0) width 635: "PASS - \"webkitTransform\" property for \"box\" element at 1s saw something close to: 0,1,-1,0,0,100"
-    RenderBR {BR} at (634,0) size 1x19
diff --git a/LayoutTests/platform/ios/legacy-animation-engine/animations/additive-transform-animations-expected.txt b/LayoutTests/platform/ios/legacy-animation-engine/animations/additive-transform-animations-expected.txt
deleted file mode 100644 (file)
index 2328681..0000000
+++ /dev/null
@@ -1,12 +0,0 @@
-layer at (0,0) size 800x600
-  RenderView at (0,0) size 800x600
-layer at (0,0) size 800x136
-  RenderBlock {HTML} at (0,0) size 800x136
-    RenderBody {BODY} at (8,8) size 784x120
-layer at (8,8) size 100x100
-  RenderBlock {DIV} at (0,0) size 100x100 [bgcolor=#0000FF]
-layer at (8,108) size 784x20
-  RenderBlock {DIV} at (0,100) size 784x20
-    RenderText {#text} at (0,0) size 635x19
-      text run at (0,0) width 635: "PASS - \"webkitTransform\" property for \"box\" element at 1s saw something close to: 0,1,-1,0,0,100"
-    RenderBR {BR} at (634,0) size 1x19
diff --git a/LayoutTests/platform/mac/animations/additive-transform-animations-expected.txt b/LayoutTests/platform/mac/animations/additive-transform-animations-expected.txt
deleted file mode 100644 (file)
index a248c0a..0000000
+++ /dev/null
@@ -1,12 +0,0 @@
-layer at (0,0) size 800x600
-  RenderView at (0,0) size 800x600
-layer at (0,0) size 800x134
-  RenderBlock {HTML} at (0,0) size 800x134
-    RenderBody {BODY} at (8,8) size 784x118
-layer at (8,8) size 100x100
-  RenderBlock {DIV} at (0,0) size 100x100 [bgcolor=#0000FF]
-layer at (8,108) size 784x18
-  RenderBlock {DIV} at (0,100) size 784x18
-    RenderText {#text} at (0,0) size 635x18
-      text run at (0,0) width 635: "PASS - \"webkitTransform\" property for \"box\" element at 1s saw something close to: 0,1,-1,0,0,100"
-    RenderBR {BR} at (634,0) size 1x18
diff --git a/LayoutTests/platform/mac/legacy-animation-engine/animations/additive-transform-animations-expected.txt b/LayoutTests/platform/mac/legacy-animation-engine/animations/additive-transform-animations-expected.txt
deleted file mode 100644 (file)
index a248c0a..0000000
+++ /dev/null
@@ -1,12 +0,0 @@
-layer at (0,0) size 800x600
-  RenderView at (0,0) size 800x600
-layer at (0,0) size 800x134
-  RenderBlock {HTML} at (0,0) size 800x134
-    RenderBody {BODY} at (8,8) size 784x118
-layer at (8,8) size 100x100
-  RenderBlock {DIV} at (0,0) size 100x100 [bgcolor=#0000FF]
-layer at (8,108) size 784x18
-  RenderBlock {DIV} at (0,100) size 784x18
-    RenderText {#text} at (0,0) size 635x18
-      text run at (0,0) width 635: "PASS - \"webkitTransform\" property for \"box\" element at 1s saw something close to: 0,1,-1,0,0,100"
-    RenderBR {BR} at (634,0) size 1x18
diff --git a/LayoutTests/platform/win/animations/additive-transform-animations-expected.txt b/LayoutTests/platform/win/animations/additive-transform-animations-expected.txt
deleted file mode 100644 (file)
index 8d338a6..0000000
+++ /dev/null
@@ -1,12 +0,0 @@
-layer at (0,0) size 800x600
-  RenderView at (0,0) size 800x600
-layer at (0,0) size 800x134
-  RenderBlock {HTML} at (0,0) size 800x134
-    RenderBody {BODY} at (8,8) size 784x118
-layer at (8,8) size 100x100
-  RenderBlock {DIV} at (0,0) size 100x100 [bgcolor=#0000FF]
-layer at (8,108) size 784x18
-  RenderBlock {DIV} at (0,100) size 784x18
-    RenderText {#text} at (0,0) size 629x18
-      text run at (0,0) width 629: "PASS - \"webkitTransform\" property for \"box\" element at 1s saw something close to: 0,1,-1,0,0,100"
-    RenderBR {BR} at (629,0) size 0x18
diff --git a/LayoutTests/platform/win/legacy-animation-engine/animations/additive-transform-animations-expected.txt b/LayoutTests/platform/win/legacy-animation-engine/animations/additive-transform-animations-expected.txt
deleted file mode 100644 (file)
index 8d338a6..0000000
+++ /dev/null
@@ -1,12 +0,0 @@
-layer at (0,0) size 800x600
-  RenderView at (0,0) size 800x600
-layer at (0,0) size 800x134
-  RenderBlock {HTML} at (0,0) size 800x134
-    RenderBody {BODY} at (8,8) size 784x118
-layer at (8,8) size 100x100
-  RenderBlock {DIV} at (0,0) size 100x100 [bgcolor=#0000FF]
-layer at (8,108) size 784x18
-  RenderBlock {DIV} at (0,100) size 784x18
-    RenderText {#text} at (0,0) size 629x18
-      text run at (0,0) width 629: "PASS - \"webkitTransform\" property for \"box\" element at 1s saw something close to: 0,1,-1,0,0,100"
-    RenderBR {BR} at (629,0) size 0x18
diff --git a/LayoutTests/platform/wincairo/animations/additive-transform-animations-expected.txt b/LayoutTests/platform/wincairo/animations/additive-transform-animations-expected.txt
deleted file mode 100644 (file)
index b1ef5c0..0000000
+++ /dev/null
@@ -1,12 +0,0 @@
-layer at (0,0) size 800x600
-  RenderView at (0,0) size 800x600
-layer at (0,0) size 800x136
-  RenderBlock {HTML} at (0,0) size 800x136
-    RenderBody {BODY} at (8,8) size 784x120
-layer at (8,8) size 100x100
-  RenderBlock {DIV} at (0,0) size 100x100 [bgcolor=#0000FF]
-layer at (8,108) size 784x20
-  RenderBlock {DIV} at (0,100) size 784x20
-    RenderText {#text} at (0,0) size 602x19
-      text run at (0,0) width 602: "PASS - \"webkitTransform\" property for \"box\" element at 1s saw something close to: 0,1,-1,0,0,100"
-    RenderBR {BR} at (602,0) size 0x19
diff --git a/LayoutTests/platform/wincairo/legacy-animation-engine/animations/additive-transform-animations-expected.txt b/LayoutTests/platform/wincairo/legacy-animation-engine/animations/additive-transform-animations-expected.txt
deleted file mode 100644 (file)
index b1ef5c0..0000000
+++ /dev/null
@@ -1,12 +0,0 @@
-layer at (0,0) size 800x600
-  RenderView at (0,0) size 800x600
-layer at (0,0) size 800x136
-  RenderBlock {HTML} at (0,0) size 800x136
-    RenderBody {BODY} at (8,8) size 784x120
-layer at (8,8) size 100x100
-  RenderBlock {DIV} at (0,0) size 100x100 [bgcolor=#0000FF]
-layer at (8,108) size 784x20
-  RenderBlock {DIV} at (0,100) size 784x20
-    RenderText {#text} at (0,0) size 602x19
-      text run at (0,0) width 602: "PASS - \"webkitTransform\" property for \"box\" element at 1s saw something close to: 0,1,-1,0,0,100"
-    RenderBR {BR} at (602,0) size 0x19
diff --git a/LayoutTests/platform/wpe/animations/additive-transform-animations-expected.txt b/LayoutTests/platform/wpe/animations/additive-transform-animations-expected.txt
deleted file mode 100644 (file)
index 7aa45de..0000000
+++ /dev/null
@@ -1,12 +0,0 @@
-layer at (0,0) size 800x600
-  RenderView at (0,0) size 800x600
-layer at (0,0) size 800x134
-  RenderBlock {HTML} at (0,0) size 800x134
-    RenderBody {BODY} at (8,8) size 784x118
-layer at (8,8) size 100x100
-  RenderBlock {DIV} at (0,0) size 100x100 [bgcolor=#0000FF]
-layer at (8,108) size 784x18
-  RenderBlock {DIV} at (0,100) size 784x18
-    RenderText {#text} at (0,0) size 629x17
-      text run at (0,0) width 629: "PASS - \"webkitTransform\" property for \"box\" element at 1s saw something close to: 0,1,-1,0,0,100"
-    RenderBR {BR} at (629,0) size 0x17
diff --git a/LayoutTests/platform/wpe/legacy-animation-engine/animations/additive-transform-animations-expected.txt b/LayoutTests/platform/wpe/legacy-animation-engine/animations/additive-transform-animations-expected.txt
deleted file mode 100644 (file)
index 7aa45de..0000000
+++ /dev/null
@@ -1,12 +0,0 @@
-layer at (0,0) size 800x600
-  RenderView at (0,0) size 800x600
-layer at (0,0) size 800x134
-  RenderBlock {HTML} at (0,0) size 800x134
-    RenderBody {BODY} at (8,8) size 784x118
-layer at (8,8) size 100x100
-  RenderBlock {DIV} at (0,0) size 100x100 [bgcolor=#0000FF]
-layer at (8,108) size 784x18
-  RenderBlock {DIV} at (0,100) size 784x18
-    RenderText {#text} at (0,0) size 629x17
-      text run at (0,0) width 629: "PASS - \"webkitTransform\" property for \"box\" element at 1s saw something close to: 0,1,-1,0,0,100"
-    RenderBR {BR} at (629,0) size 0x17
index 36ee9ae..3525506 100644 (file)
@@ -1,3 +1,13 @@
+2019-02-20  Dean Jackson  <dino@apple.com>
+
+        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.
+
+        * wtf/Platform.h: Add HAVE(CA_WHERE_ADDITIVE_TRANSFORMS_ARE_REVERSED).
+
 2019-02-20  Andy Estes  <aestes@apple.com>
 
         [Xcode] Add SDKVariant.xcconfig to various Xcode projects
index df90f73..c00fe39 100644 (file)
 #define HAVE_CG_FONT_RENDERING_GET_FONT_SMOOTHING_DISABLED 1
 #endif
 
+#if (PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 101500) || PLATFORM(IOS_FAMILY)
+#define HAVE_CA_WHERE_ADDITIVE_TRANSFORMS_ARE_REVERSED 1
+#endif
+
 #ifdef __APPLE__
 #define HAVE_FUNC_USLEEP 1
 #endif
index 26d007b..7ceda86 100644 (file)
@@ -1,3 +1,25 @@
+2019-02-20  Dean Jackson  <dino@apple.com>
+
+        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.
+
+        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):
+
 2019-02-20  Don Olmstead  <don.olmstead@sony.com>
 
         [Win] Guard CF usage in RenderThemeWin
index 70c5f9e..c593900 100644 (file)
@@ -3086,7 +3086,12 @@ bool GraphicsLayerCA::createAnimationFromKeyframes(const KeyframeValueList& valu
 bool GraphicsLayerCA::appendToUncommittedAnimations(const KeyframeValueList& valueList, const TransformOperations* operations, const Animation* animation, const String& animationName, const FloatSize& boxSize, int animationIndex, Seconds timeOffset, bool isMatrixAnimation)
 {
     TransformOperation::OperationType transformOp = isMatrixAnimation ? TransformOperation::MATRIX_3D : operations->operations().at(animationIndex)->type();
+#if !PLATFORM(WIN) && !HAVE(CA_WHERE_ADDITIVE_TRANSFORMS_ARE_REVERSED)
     bool additive = animationIndex > 0;
+#else
+    int numAnimations = isMatrixAnimation ? 1 : operations->size();
+    bool additive = animationIndex < numAnimations - 1;
+#endif
     bool isKeyframe = valueList.size() > 2;
 
     RefPtr<PlatformCAAnimation> caAnimation;
@@ -3123,10 +3128,10 @@ bool GraphicsLayerCA::createTransformAnimationsFromKeyframes(const KeyframeValue
     bool isMatrixAnimation = listIndex < 0;
     int numAnimations = isMatrixAnimation ? 1 : operations->size();
 
-#if !PLATFORM(WIN)
+#if !PLATFORM(WIN) && !HAVE(CA_WHERE_ADDITIVE_TRANSFORMS_ARE_REVERSED)
     for (int animationIndex = 0; animationIndex < numAnimations; ++animationIndex) {
 #else
-    // QuartzCore on Windows expects animation lists to be applied in reverse order (<rdar://problem/9112233>).
+    // Some versions of CA require animation lists to be applied in reverse order (<rdar://problem/43908047> and <rdar://problem/9112233>).
     for (int animationIndex = numAnimations - 1; animationIndex >= 0; --animationIndex) {
 #endif
         if (!appendToUncommittedAnimations(valueList, operations, animation, animationName, boxSize, animationIndex, timeOffset, isMatrixAnimation)) {