From 62477674bacb9057376d53c190ec89f0d80ec5cf Mon Sep 17 00:00:00 2001 From: Joey Arhar Date: Thu, 16 Nov 2023 13:47:56 -0800 Subject: [PATCH] Revert "Add allow-discrete to non-interpolable WPTs" This reverts commit d43c0e4219504e68479d2c9e519ba0825cc11b28. Reason for revert: Affects results for interop2023 in an unfair way because transition-behavior is not part of interop2023: https://github.com/web-platform-tests/wpt/pull/42857#issuecomment-1815174433 Original change's description: > Add allow-discrete to non-interpolable WPTs > > This patch changes the test runner for animation tests in WPT to > additionally test transition-behavior:allow-discrete for any property > that we are running a non-interpolable or non-animatable test on. > > Change-Id: I7e13600c0182ab5e4839fea4e32e759673abe84e > Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4989757 > Reviewed-by: David Baron > Commit-Queue: Joey Arhar > Cr-Commit-Position: refs/heads/main@{#1222343} Change-Id: I1d067b0c79b1d16b8fdbd1e672f3db9d1befca74 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5038074 Bot-Commit: Rubber Stamper Commit-Queue: David Baron Reviewed-by: David Baron Cr-Commit-Position: refs/heads/main@{#1225735} --- css/support/interpolation-testcommon.js | 63 +------------------------ 1 file changed, 2 insertions(+), 61 deletions(-) diff --git a/css/support/interpolation-testcommon.js b/css/support/interpolation-testcommon.js index 211018ca053adf..115067465feed3 100644 --- a/css/support/interpolation-testcommon.js +++ b/css/support/interpolation-testcommon.js @@ -104,59 +104,6 @@ }, }; - var cssTransitionsInterpolationAllowDiscrete = { - name: 'CSS Transitions with transition-behavior:allow-discrete', - isSupported: function() {return true;}, - supportsProperty: function() {return true;}, - supportsValue: function() {return true;}, - setup: function(property, from, target) { - target.style.setProperty(property, isNeutralKeyframe(from) ? '' : from); - }, - nonInterpolationExpectations: function(from, to) { - return expectFlip(from, to, 0.5); - }, - notAnimatableExpectations: function(from, to, underlying) { - return expectFlip(from, to, -Infinity); - }, - interpolate: function(property, from, to, at, target, behavior) { - // Force a style recalc on target to set the 'from' value. - getComputedStyle(target).getPropertyValue(property); - target.style.transitionDuration = '100s'; - target.style.transitionDelay = '-50s'; - target.style.transitionTimingFunction = createEasing(at); - target.style.transitionProperty = property; - target.style.transitionBehavior = 'allow-discrete'; - target.style.setProperty(property, isNeutralKeyframe(to) ? '' : to); - }, - }; - - var cssTransitionAllInterpolationAllowDiscrete = { - name: 'CSS Transitions with transition-property:all and transition-behavor:allow-discrete', - isSupported: function() {return true;}, - // The 'all' value doesn't cover custom properties. - supportsProperty: function(property) {return property.indexOf('--') !== 0;}, - supportsValue: function() {return true;}, - setup: function(property, from, target) { - target.style.setProperty(property, isNeutralKeyframe(from) ? '' : from); - }, - nonInterpolationExpectations: function(from, to) { - return expectFlip(from, to, 0.5); - }, - notAnimatableExpectations: function(from, to, underlying) { - return expectFlip(from, to, -Infinity); - }, - interpolate: function(property, from, to, at, target, behavior) { - // Force a style recalc on target to set the 'from' value. - getComputedStyle(target).getPropertyValue(property); - target.style.transitionDuration = '100s'; - target.style.transitionDelay = '-50s'; - target.style.transitionTimingFunction = createEasing(at); - target.style.transitionProperty = 'all'; - target.style.transitionBehavior = 'allow-discrete'; - target.style.setProperty(property, isNeutralKeyframe(to) ? '' : to); - }, - }; - var webAnimationsInterpolation = { name: 'Web Animations', isSupported: function() {return 'animate' in Element.prototype;}, @@ -488,19 +435,13 @@ function test_not_animatable(options) { test_interpolation(options, expectNotAnimatable); } - function create_tests(addAllowDiscreteTests) { + function create_tests() { var interpolationMethods = [ cssTransitionsInterpolation, cssTransitionAllInterpolation, cssAnimationsInterpolation, webAnimationsInterpolation, ]; - if (addAllowDiscreteTests) { - interpolationMethods = [ - cssTransitionsInterpolationAllowDiscrete, - cssTransitionAllInterpolationAllowDiscrete, - ].concat(interpolationMethods); - } var container = createElement(document.body); var targets = createTestTargets(interpolationMethods, interpolationTests, compositionTests, container); // Separate interpolation and measurement into different phases to avoid O(n^2) of the number of targets. @@ -515,7 +456,7 @@ function test_interpolation(options, expectations) { interpolationTests.push({options, expectations}); - create_tests(expectations === expectNoInterpolation || expectations === expectNotAnimatable); + create_tests(); interpolationTests = []; } function test_composition(options, expectations) {