-
Notifications
You must be signed in to change notification settings - Fork 3.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
49 additions
and
0 deletions.
There are no files selected for viewing
49 changes: 49 additions & 0 deletions
49
css/cssom/getComputedStyle-unsupported-pseudo-element.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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> |