Bug 1364880: Test non-existent pseudo-element styles. r?bz
MozReview-Commit-ID: 5DH6s2EyXii
--- a/testing/web-platform/tests/cssom/getComputedStyle-pseudo.html
+++ b/testing/web-platform/tests/cssom/getComputedStyle-pseudo.html
@@ -35,9 +35,18 @@ test(function() {
});
}, "Resolution of width is correct for ::before and ::after pseudo-elements");
test(function() {
var contents = document.getElementById('contents');
[":before", ":after"].forEach(function(pseudo) {
assert_equals(getComputedStyle(contents, pseudo).width, "50px");
});
}, "Resolution of width is correct for ::before and ::after pseudo-elements of display: contents elements");
+test(function() {
+ var has_no_pseudos = document.body;
+ has_no_pseudos.style.position = "relative";
+ [":before", ":after"].forEach(function(pseudo) {
+ assert_equals(getComputedStyle(has_no_pseudos, pseudo).position, "static",
+ "Nonexistent " + pseudo + " pseudo-element shouldn't claim to have " +
+ "the same style as the originating element");
+ });
+}, "Resolution of nonexistent pseudo-element styles");
</script>