Bug 1364880: Test non-existent pseudo-element styles. r=bz
authorEmilio Cobos Álvarez <emilio@crisal.io>
Sat, 24 Jun 2017 07:51:16 +0200
changeset 365933 ef997eeca061000b9830d8bd31863743be41ccce
parent 365932 461ec96ab235b521478ef2fc6bf88599ee1cdcdc
child 365934 46e569782344795d0c1cdd2df93fe1ce560c5f94
push id45443
push userecoal95@gmail.com
push dateSat, 24 Jun 2017 09:14:45 +0000
treeherderautoland@ef997eeca061 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbz
bugs1364880
milestone56.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 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>