Skip to content

Commit

Permalink
Merge 2613462 into eb2d647
Browse files Browse the repository at this point in the history
  • Loading branch information
gsnedders authored Jan 12, 2018
2 parents eb2d647 + 2613462 commit 1175099
Showing 1 changed file with 49 additions and 0 deletions.
49 changes: 49 additions & 0 deletions css/cssom/getComputedStyle-unsupported-pseudo-element.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
<!doctype html>
<meta charset="utf-8">
<title>CSSOM: getComputedStyle mustn't support other pseudo-elements</title>
<link rel="help" href="https://drafts.csswg.org/cssom/#dom-window-getcomputedstyle">
<script src=/resources/testharness.js></script>
<script src=/resources/testharnessreport.js></script>
<style>
#test { color: orange; }

#test p { color: rgb(0, 0, 10); }
#test p::first-line { color: rgb(0, 0, 100); }
#test p::first-letter { color: rgb(0, 200, 200); }

#test ol { color: rgb(1, 0, 10); }
#test li { color: rgb(1, 0, 100); }
#test li::marker { color: rgb(1, 200, 200); }

#test input { color: rgb(2, 0, 10); }
#test input::placeholder { color: rgb(2, 200, 200); }
</style>
<div id="test">
<p>Filler Text</p>
<ol>
<li>Filler Text</li>
</ol>
<input placeholder="Filler Text">
</div>
<script>
["::first-line", ":first-line"].forEach(function(pseudo) {
test(function() {
var p = document.querySelector('#test p');
assert_equals(getComputedStyle(p, pseudo).color, "rgb(0, 0, 10)");
}, "Right element color is returned for " + pseudo);
});
["::first-letter", ":first-letter"].forEach(function(pseudo) {
test(function() {
var p = document.querySelector('#test p');
assert_equals(getComputedStyle(p, pseudo).color, "rgb(0, 0, 10)");
}, "Right element color is returned for " + pseudo);
});
test(function() {
var li = document.querySelector('#test li');
assert_equals(getComputedStyle(li, "::marker").color, "rgb(1, 0, 100)");
}, "Right element color is returned for ::marker");
test(function() {
var input = document.querySelector('#test input');
assert_equals(getComputedStyle(input, "::placeholder").color, "rgb(2, 0, 10)");
}, "Right element color is returned for ::placeholder");
</script>

0 comments on commit 1175099

Please sign in to comment.