mirror of
https://github.com/servo/servo.git
synced 2025-08-06 14:10:11 +01:00
Update web-platform-tests to revision 3bac98b37f29ec287e115fcecff566eb081131a8
This commit is contained in:
parent
6ff2524781
commit
57ea61dc86
64 changed files with 1309 additions and 347 deletions
|
@ -11,14 +11,12 @@
|
|||
return keyframe === neutralKeyframe;
|
||||
}
|
||||
|
||||
// For all the CSS interpolation methods, we set the animation duration very
|
||||
// very long so that any advancement in time that does happen is irrelevant
|
||||
// in terms of the progress value. In particular, the animation duration is
|
||||
// 2e9s which is ~63 years.
|
||||
// We then set the delay to be *negative* half the duration, so we are
|
||||
// immediately at the halfway point of the animation. Finally, we using an
|
||||
// easing function that maps halfway (0.5) to whatever progress we actually
|
||||
// want.
|
||||
// For the CSS interpolation methods, we set the animation duration long
|
||||
// enough that any advancement in time during the test is irrelevant in terms
|
||||
// of the progress. We then set the delay to be negative half the duration, so
|
||||
// we are immediately at the halfway point of the animation. Finally, we use
|
||||
// an easing function that maps halfway to whatever progress we actually want.
|
||||
|
||||
var cssAnimationsInterpolation = {
|
||||
name: 'CSS Animations',
|
||||
supportsProperty: function() {return true;},
|
||||
|
@ -233,12 +231,15 @@
|
|||
var property = interpolationTest.options.property;
|
||||
var from = interpolationTest.options.from;
|
||||
var to = interpolationTest.options.to;
|
||||
var comparisonFunction = interpolationTest.options.comparisonFunction;
|
||||
|
||||
if ((interpolationTest.options.method && interpolationTest.options.method != interpolationMethod.name)
|
||||
|| !interpolationMethod.supportsProperty(property)
|
||||
|| !interpolationMethod.supportsValue(from)
|
||||
|| !interpolationMethod.supportsValue(to)) {
|
||||
return;
|
||||
}
|
||||
|
||||
var testText = `${interpolationMethod.name}: property <${property}> from ${keyframeText(from)} to ${keyframeText(to)}`;
|
||||
var testContainer = createElement(interpolationMethodContainer, 'div');
|
||||
createElement(testContainer);
|
||||
|
@ -246,6 +247,14 @@
|
|||
if (expectations === expectNoInterpolation) {
|
||||
expectations = interpolationMethod.nonInterpolationExpectations(from, to);
|
||||
}
|
||||
|
||||
// Setup a standard equality function if an override is not provided.
|
||||
if (!comparisonFunction) {
|
||||
comparisonFunction = (actual, expected) => {
|
||||
assert_equals(normalizeValue(actual), normalizeValue(expected));
|
||||
};
|
||||
}
|
||||
|
||||
return expectations.map(function(expectation) {
|
||||
var actualTargetContainer = createTargetContainer(testContainer, 'actual');
|
||||
var expectedTargetContainer = createTargetContainer(testContainer, 'expected');
|
||||
|
@ -270,9 +279,9 @@
|
|||
assert_true(CSS.supports(property, underlying), '\'underlying\' value should be supported');
|
||||
}
|
||||
|
||||
assert_equals(
|
||||
normalizeValue(getComputedStyle(target).getPropertyValue(property)),
|
||||
normalizeValue(expectedValue));
|
||||
comparisonFunction(
|
||||
getComputedStyle(target).getPropertyValue(property),
|
||||
expectedValue);
|
||||
}, `${testText} at (${expectation.at}) should be [${sanitizeUrls(expectedValue)}]`);
|
||||
};
|
||||
return target;
|
||||
|
@ -314,6 +323,7 @@
|
|||
container.remove();
|
||||
interpolationTests = [];
|
||||
}
|
||||
|
||||
window.test_interpolation = test_interpolation;
|
||||
window.test_no_interpolation = test_no_interpolation;
|
||||
window.neutralKeyframe = neutralKeyframe;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue