Bug 1390702 - Part 5: Rewrite handling of CSSPseudoElements to improve readability. r?birtles draft
authorDaisuke Akatsuka <dakatsuka@mozilla.com>
Tue, 05 Sep 2017 20:16:47 +0900
changeset 659036 b24d1f760a002a86bcfffc8efa1e818c1f292647
parent 659035 f6a7e489c6f7dcd9f14caca11125ccec07dbab61
child 729861 fbfcd3e1fb3637f562ed6debaae0e4a8bb19b6b0
push id77991
push userbmo:dakatsuka@mozilla.com
push dateTue, 05 Sep 2017 11:17:17 +0000
reviewersbirtles
bugs1390702
milestone57.0a1
Bug 1390702 - Part 5: Rewrite handling of CSSPseudoElements to improve readability. r?birtles MozReview-Commit-ID: 8oJVE70CZRl
testing/web-platform/tests/web-animations/animation-model/animation-types/property-list.js
--- 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