Bug 1390702 - Part 5: Rewrite handling of CSSPseudoElements to improve readability. r?birtles
MozReview-Commit-ID: 8oJVE70CZRl
--- a/testing/web-platform/tests/web-animations/animation-model/animation-types/property-list.js
+++ b/testing/web-platform/tests/web-animations/animation-model/animation-types/property-list.js
@@ -1468,26 +1468,26 @@ var gCSSProperties = {
'z-index': {
// https://drafts.csswg.org/css-position/#propdef-z-index
types: [
]
},
};
function testAnimationSamples(animation, idlName, testSamples) {
- var type = animation.effect.target.type;
- var target = type
- ? animation.effect.target.parentElement
- : animation.effect.target;
- testSamples.forEach(function(testSample) {
+ const type = animation.effect.target.type;
+ const target = animation.effect.target.constructor.name === 'CSSPseudoElement'
+ ? animation.effect.target.parentElement
+ : animation.effect.target;
+ testSamples.forEach(testSample => {
animation.currentTime = testSample.time;
assert_equals(getComputedStyle(target, type)[idlName],
testSample.expected,
- 'The value should be ' + testSample.expected +
- ' at ' + testSample.time + 'ms');
+ `The value should be ${testSample.expected}` +
+ ` at ${testSample.time}ms`);
});
}
function toOrderedArray(string) {
return string.split(/\s*,\s/).sort();
}
// This test is for some list-based CSS properties such as font-variant-settings