mirror of
https://github.com/servo/servo.git
synced 2025-08-11 00:15:32 +01:00
Update web-platform-tests to revision 0a45e9baf952da4787f81ca93d34dfad3ca24d33
This commit is contained in:
parent
1d217b7f0f
commit
5097f12054
108 changed files with 1154 additions and 315 deletions
|
@ -0,0 +1,20 @@
|
|||
<!doctype html>
|
||||
<meta charset="utf-8">
|
||||
<title>CSS Pseudo-Elements Test: ::target-text parsing</title>
|
||||
<link rel="help" href="https://drafts.csswg.org/css-pseudo/#selectordef-target-text">
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<script src="/css/support/parsing-testcommon.js"></script>
|
||||
<script>
|
||||
test_valid_selector("::target-text");
|
||||
test_valid_selector(".a::target-text");
|
||||
test_valid_selector("div ::target-text");
|
||||
test_valid_selector("::part(my-part)::target-text");
|
||||
|
||||
test_invalid_selector("::before::target-text");
|
||||
test_invalid_selector("::target-text.a");
|
||||
test_invalid_selector("::target-text div");
|
||||
test_invalid_selector("::target-text::after");
|
||||
test_invalid_selector("::target-text:hover");
|
||||
test_invalid_selector(":not(::target-text)");
|
||||
</script>
|
|
@ -0,0 +1,22 @@
|
|||
<!doctype html>
|
||||
<meta charset="utf-8">
|
||||
<title>CSS Pseudo-Elements Test: ::target-text getComputedStyle</title>
|
||||
<link rel="help" href="https://drafts.csswg.org/css-pseudo/#selectordef-target-text">
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<style>
|
||||
#target::target-text {
|
||||
background-color: green;
|
||||
}
|
||||
#target::target-text {
|
||||
color: lime;
|
||||
}
|
||||
</style>
|
||||
<div id="target"></div>
|
||||
<script>
|
||||
test(() => {
|
||||
let style = getComputedStyle(target, "::target-text");
|
||||
assert_equals(style.backgroundColor, "rgb(0, 128, 0)", "Background color is green.");
|
||||
assert_equals(style.color, "rgb(0, 255, 0)", "Color is lime.");
|
||||
}, "getComputedStyle() for ::target-text");
|
||||
</script>
|
Loading…
Add table
Add a link
Reference in a new issue