Bug 1419221 - Create element for the target of getUnanimatedComputedStyle(). r?birtles
Before this patch, we had been only testing the null element case.
MozReview-Commit-ID: DYB8DtGBIwC
--- a/dom/base/test/file_domwindowutils_animation.html
+++ b/dom/base/test/file_domwindowutils_animation.html
@@ -92,31 +92,36 @@ function test_getUnanimatedComputedStyle
}
checkUnanimatedComputedStyle(property, initialStyle, "::before",
expectedInitialStyle, expectedInitialStyle,
pseudoAnimation, "Animation at pseudo");
deleteStyle();
});
});
+ const div = document.createElement("div");
+ document.body.appendChild(div);
+
SimpleTest.doesThrow(
() => utils.getUnanimatedComputedStyle(div, null, "background"),
"NS_ERROR_INVALID_ARG",
"Shorthand property should throw");
SimpleTest.doesThrow(
() => utils.getUnanimatedComputedStyle(div, null, "invalid"),
"NS_ERROR_INVALID_ARG",
"Invalid property should throw");
SimpleTest.doesThrow(
() => utils.getUnanimatedComputedStyle(null, null, "opacity"),
"NS_ERROR_INVALID_ARG",
"Null element should throw");
+ div.remove();
+
next();
window.close();
}
function checkUnanimatedComputedStyle(property, initialStyle, pseudoType,
expectedBeforeAnimation,
expectedDuringAnimation,
animate, animationType) {