Skip to content

Commit

Permalink
[cssom] Test that getComputedStyle with an unknown/invalid pseudo-ele…
Browse files Browse the repository at this point in the history
…ment throws.

This tests the resolution in w3c/csswg-drafts#2149.
  • Loading branch information
emilio committed Apr 11, 2018
1 parent 7967c43 commit 21380d0
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions css/cssom/getComputedStyle-pseudo.html
Original file line number Diff line number Diff line change
Expand Up @@ -109,4 +109,9 @@
"display: contents in " + pseudo + " should reflect other non-inherited properties in CSSOM");
});
}, "display: contents on pseudo-elements");
test(function() {
var div = document.getElementById('test');
assert_throws(new TypeError(), () => getComputedStyle(div, "totallynotapseudo"),
"getComputedStyle with an unknown pseudo-element throws");
}, "Unknown pseudo-elements throw");
</script>

0 comments on commit 21380d0

Please sign in to comment.