Bug 1241784 - Part 4: Remove removeElement from testcommon.js. r=birtles
authorBoris Chiou <boris.chiou@gmail.com>
Sun, 06 Mar 2016 19:35:00 +0100
changeset 324948 2c532283a04f1170240f569b5297bce20adca292
parent 324947 e1a3f5ba34b31a6f042e897d072329cc75400069
child 324949 6cacb08f6f5ca0f3345288c5ed4d707352a22fe9
push id6048
push userkmoir@mozilla.com
push dateMon, 06 Jun 2016 19:02:08 +0000
treeherdermozilla-beta@46d72a56c57d [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbirtles
bugs1241784
milestone47.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1241784 - Part 4: Remove removeElement from testcommon.js. r=birtles
testing/web-platform/tests/web-animations/testcommon.js
--- a/testing/web-platform/tests/web-animations/testcommon.js
+++ b/testing/web-platform/tests/web-animations/testcommon.js
@@ -37,17 +37,17 @@ function newAnimation(animationTarget) {
 // removes the created element during test cleanup
 function createDiv(test, doc) {
   if (!doc) {
     doc = document;
   }
   var div = doc.createElement('div');
   doc.body.appendChild(div);
   test.add_cleanup(function() {
-    removeElement(div);
+    div.remove();
   });
   return div;
 }
 
 // Creates a style element with the specified rules, appends it to the document
 // head and removes the created element during test cleanup.
 // |rules| is an object. For example:
 // { '@keyframes anim': '' ,
@@ -86,21 +86,16 @@ function createPseudo(test, type) {
   assert_true(anims.length >= 1);
   var anim = anims[anims.length - 1];
   assert_equals(anim.effect.target.parentElement, div);
   assert_equals(anim.effect.target.type, '::' + type);
   anim.cancel();
   return anim.effect.target;
 }
 
-// Removes element
-function removeElement(element) {
-  element.parentNode.removeChild(element);
-}
-
 // Returns the type name of given object
 function type(object) {
   return Object.prototype.toString.call(object).slice(8, -1);
 }
 
 // Convert px unit value to a Number
 function pxToNum(str) {
   return Number(String(str).match(/^(-?[\d.]+)px$/)[1]);