mirror of
https://github.com/servo/servo.git
synced 2025-08-07 06:25:32 +01:00
Update web-platform-tests to revision b'468d01bbd84da2babf265c6af46947be68713440'
This commit is contained in:
parent
35e95f55a1
commit
58e8ee674b
9438 changed files with 266112 additions and 106976 deletions
|
@ -8,18 +8,39 @@
|
|||
#target::selection,
|
||||
#target::target-text,
|
||||
#target::spelling-error,
|
||||
#target::grammar-error {
|
||||
#target::grammar-error,
|
||||
#target::highlight(foo) {
|
||||
background-color: green;
|
||||
color: lime;
|
||||
}
|
||||
#target::highlight(bar) {
|
||||
background-color: blue;
|
||||
color: yellow;
|
||||
}
|
||||
</style>
|
||||
<div id="target"></div>
|
||||
<script>
|
||||
for (const pseudo of ["::selection", "::target-text", "::spelling-error", "::grammar-error"]) {
|
||||
for (const pseudo of ["::selection", "::target-text", "::spelling-error", "::grammar-error", "::highlight(foo)"]) {
|
||||
test(() => {
|
||||
let style = getComputedStyle(target, pseudo);
|
||||
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 ${pseudo}`);
|
||||
|
||||
for (illFormedPseudo of [`${pseudo}:`, `${pseudo})`, `${pseudo}(`, `${pseudo}(foo)`, `${pseudo}()`, `:${pseudo}`, `${pseudo}.`]) {
|
||||
test(() => {
|
||||
let style = getComputedStyle(target, illFormedPseudo);
|
||||
let defaultStyle = getComputedStyle(target);
|
||||
assert_equals(style.backgroundColor, defaultStyle.backgroundColor, "Background color is element's default.");
|
||||
assert_equals(style.color, defaultStyle.color, "Color is element's default.");
|
||||
}, `getComputedStyle() for ${illFormedPseudo} should be element's default`);
|
||||
}
|
||||
}
|
||||
|
||||
const pseudo = "::highlight(bar)";
|
||||
test(() => {
|
||||
let style = getComputedStyle(target, pseudo);
|
||||
assert_equals(style.backgroundColor, "rgb(0, 0, 255)", "Background color is blue.");
|
||||
assert_equals(style.color, "rgb(255, 255, 0)", "Color is yellow.");
|
||||
}, `Different getComputedStyle() for ${pseudo} and same element`);
|
||||
</script>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue