Bug 1364880: Test non-existent pseudo-element styles. r?bz draft
authorEmilio Cobos Álvarez <emilio@crisal.io>
Sat, 24 Jun 2017 07:51:16 +0200
changeset 600193 159ff7c48cceab0883b4440ddb46907427117cab
parent 600192 461ec96ab235b521478ef2fc6bf88599ee1cdcdc
child 634923 5de5c243691240186254e06612289828955f26bf
push id65682
push userbmo:emilio+bugs@crisal.io
push dateSat, 24 Jun 2017 09:03:52 +0000
reviewersbz
bugs1364880
milestone56.0a1
Bug 1364880: Test non-existent pseudo-element styles. r?bz MozReview-Commit-ID: 5DH6s2EyXii
testing/web-platform/tests/cssom/getComputedStyle-pseudo.html
--- 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>