Bug 1506746 - Update expectation for rotate property for extrapolation in wpt. r=birtles
authorBoris Chiou <boris.chiou@gmail.com>
Mon, 18 Nov 2019 22:56:43 +0000
changeset 502508 3779e7b766fd91688914046f1efee1a3812f69b0
parent 502507 3c5118f00c7caf321cfbee83e3abe5aa9b75e80c
child 502509 e6305a1457f025d598507456b87945036b49bbab
push id114172
push userdluca@mozilla.com
push dateTue, 19 Nov 2019 11:31:10 +0000
treeherdermozilla-inbound@b5c5ba07d3db [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbirtles
bugs1506746
milestone72.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1506746 - Update expectation for rotate property for extrapolation in wpt. r=birtles Differential Revision: https://phabricator.services.mozilla.com/D52945
testing/web-platform/meta/css/css-transforms/animation/rotate-interpolation.html.ini
testing/web-platform/tests/css/css-transforms/animation/rotate-interpolation.html
testing/web-platform/tests/css/support/interpolation-testcommon.js
deleted file mode 100644
--- a/testing/web-platform/meta/css/css-transforms/animation/rotate-interpolation.html.ini
+++ /dev/null
@@ -1,13 +0,0 @@
-[rotate-interpolation.html]
-  [CSS Animations: property <rotate> from [1 1 0 90deg\] to [0 1 1 135deg\] at (2) should be [0.52 -0.29 -0.81 151.04deg\]]
-    expected: FAIL
-
-  [CSS Transitions with transition: all: property <rotate> from [1 1 0 90deg\] to [0 1 1 135deg\] at (2) should be [0.52 -0.29 -0.81 151.04deg\]]
-    expected: FAIL
-
-  [CSS Transitions: property <rotate> from [1 1 0 90deg\] to [0 1 1 135deg\] at (2) should be [0.52 -0.29 -0.81 151.04deg\]]
-    expected: FAIL
-
-  [Web Animations: property <rotate> from [1 1 0 90deg\] to [0 1 1 135deg\] at (2) should be [0.52 -0.29 -0.81 151.04deg\]]
-    expected: FAIL
-
--- a/testing/web-platform/tests/css/css-transforms/animation/rotate-interpolation.html
+++ b/testing/web-platform/tests/css/css-transforms/animation/rotate-interpolation.html
@@ -202,17 +202,26 @@ test_interpolation({
   from: '1 1 0 90deg',
   to: '0 1 1 135deg',
 }, [
   {at: -1, expect: '0.67 -0.06 -0.74 124.97deg'},
   {at: 0, expect: '0.71 0.71 0 90deg'},
   {at: 0.25, expect: '0.54 0.8 0.26 94.83deg'},
   {at: 0.75, expect: '0.17 0.78 0.61 118.68deg'},
   {at: 1, expect: '0 0.71 0.71 135deg'},
-  {at: 2, expect: '0.52 -0.29 -0.81 151.04deg'},
+  // The result in Blink is '0.52 -0.29 -0.81 151.04deg', and the result in
+  // Gecko is `-0.52 0.29 0.8 208.96deg`. Both of them can be represented as the
+  // same 3d rotation (but by an opposite direction vector and angle).
+  // The spec only mentions we should use Slerp to do interpolation for rotate
+  // property, but it seems the implementation detail for extrapolation are
+  // different (because this is not in the range of [0, 1]).
+  // For now, we make both results pass because their rendering results are the
+  // same.
+  {at: 2, expect: '0.52 -0.29 -0.81 151.04deg',
+          option: '-0.52 0.29 0.81 208.96deg'},
 ]);
 
 test_interpolation({
   property: 'rotate',
   from: '0 1 0 0deg',
   to: '1 0 0 450deg',
 }, [
   {at: -1, expect: '1 0 0 -450deg'},
--- a/testing/web-platform/tests/css/support/interpolation-testcommon.js
+++ b/testing/web-platform/tests/css/support/interpolation-testcommon.js
@@ -255,18 +255,19 @@
       comparisonFunction = (actual, expected) => {
         assert_equals(normalizeValue(actual), normalizeValue(expected));
       };
     }
 
     return expectations.map(function(expectation) {
       var actualTargetContainer = createTargetContainer(testContainer, 'actual');
       var expectedTargetContainer = createTargetContainer(testContainer, 'expected');
-      if (!isNeutralKeyframe(expectation.expect)) {
-        expectedTargetContainer.target.style.setProperty(property, expectation.expect);
+      var expectedStr = expectation.option || expectation.expect;
+      if (!isNeutralKeyframe(expectedStr)) {
+        expectedTargetContainer.target.style.setProperty(property, expectedStr);
       }
       var target = actualTargetContainer.target;
       interpolationMethod.setup(property, from, target);
       target.interpolate = function() {
         interpolationMethod.interpolate(property, from, to, expectation.at, target);
       };
       target.measure = function() {
         var expectedValue = getComputedStyle(expectedTargetContainer.target).getPropertyValue(property);
@@ -279,17 +280,17 @@
           }
           if (typeof underlying !== 'undefined') {
             assert_true(CSS.supports(property, underlying), '\'underlying\' value should be supported');
           }
 
           comparisonFunction(
               getComputedStyle(target).getPropertyValue(property),
               expectedValue);
-        }, `${testText} at (${expectation.at}) should be [${sanitizeUrls(expectation.expect)}]`);
+        }, `${testText} at (${expectation.at}) should be [${sanitizeUrls(expectedStr)}]`);
       };
       return target;
     });
   }
 
   function createTestTargets(interpolationMethods, interpolationTests, container) {
     var targets = [];
     for (var interpolationMethod of interpolationMethods) {