Skip to content

Commit

Permalink
Revert "Add allow-discrete to non-interpolable WPTs"
Browse files Browse the repository at this point in the history
This reverts commit d43c0e4219504e68479d2c9e519ba0825cc11b28.

Reason for revert:
Affects results for interop2023 in an unfair way because transition-behavior is not part of interop2023:
#42857 (comment)

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 <dbaron@chromium.org>
> Commit-Queue: Joey Arhar <jarhar@chromium.org>
> 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 <rubber-stamper@appspot.gserviceaccount.com>
Commit-Queue: David Baron <dbaron@chromium.org>
Reviewed-by: David Baron <dbaron@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1225735}
  • Loading branch information
josepharhar authored and chromium-wpt-export-bot committed Nov 16, 2023
1 parent 44a891a commit 6247767
Showing 1 changed file with 2 additions and 61 deletions.
63 changes: 2 additions & 61 deletions css/support/interpolation-testcommon.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;},
Expand Down Expand Up @@ -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.
Expand All @@ -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) {
Expand Down

0 comments on commit 6247767

Please sign in to comment.