mirror of
https://github.com/servo/servo.git
synced 2025-08-31 01:58:23 +01:00
Update web-platform-tests to revision 58b72393db0bd273bb93268c33666cf893feb985
This commit is contained in:
parent
43a4f01647
commit
64e0a52537
12717 changed files with 59835 additions and 59820 deletions
|
@ -0,0 +1,94 @@
|
|||
<!doctype html>
|
||||
<meta charset="utf-8">
|
||||
<title>CSSOM: Correct resolution of resolved value for display-affected pseudo-elements</title>
|
||||
<link rel="help" href="https://drafts.csswg.org/cssom/#dom-window-getcomputedstyle">
|
||||
<link rel="help" href="https://drafts.csswg.org/cssom/#resolved-values">
|
||||
<link rel="author" title="Emilio Cobos Álvarez" href="mailto:emilio@crisal.io">
|
||||
<script src=/resources/testharness.js></script>
|
||||
<script src=/resources/testharnessreport.js></script>
|
||||
<style>
|
||||
#test { width: 100px; }
|
||||
|
||||
#contents {
|
||||
display: contents;
|
||||
border: 10px solid red;
|
||||
}
|
||||
|
||||
#test::before,
|
||||
#test::after,
|
||||
#contents::before,
|
||||
#contents::after,
|
||||
#flex::before,
|
||||
#flex::after {
|
||||
content: " ";
|
||||
width: 50%;
|
||||
height: 10px;
|
||||
display: block;
|
||||
}
|
||||
#none {
|
||||
display: none;
|
||||
}
|
||||
#none::before,
|
||||
#none::after {
|
||||
content: "Foo";
|
||||
}
|
||||
#flex {
|
||||
display: flex;
|
||||
}
|
||||
#flex-no-pseudo {
|
||||
display: flex;
|
||||
}
|
||||
</style>
|
||||
<div id="test">
|
||||
<div id="contents"></div>
|
||||
<div id="none"></div>
|
||||
<div id="flex"></div>
|
||||
<div id="flex-no-pseudo"></div>
|
||||
</div>
|
||||
<script>
|
||||
test(function() {
|
||||
var div = document.getElementById('test');
|
||||
[":before", ":after"].forEach(function(pseudo) {
|
||||
assert_equals(getComputedStyle(div, pseudo).width, "50px");
|
||||
});
|
||||
}, "Resolution of width is correct for ::before and ::after pseudo-elements");
|
||||
test(function() {
|
||||
var contents = document.getElementById('contents');
|
||||
[":before", ":after"].forEach(function(pseudo) {
|
||||
assert_equals(getComputedStyle(contents, pseudo).width, "50px");
|
||||
});
|
||||
}, "Resolution of width is correct for ::before and ::after pseudo-elements of display: contents elements");
|
||||
test(function() {
|
||||
var has_no_pseudos = document.body;
|
||||
has_no_pseudos.style.position = "relative";
|
||||
[":before", ":after"].forEach(function(pseudo) {
|
||||
assert_equals(getComputedStyle(has_no_pseudos, pseudo).position, "static",
|
||||
"Nonexistent " + pseudo + " pseudo-element shouldn't claim to have " +
|
||||
"the same style as the originating element");
|
||||
assert_equals(getComputedStyle(has_no_pseudos, pseudo).width, "auto",
|
||||
"Nonexistent " + pseudo + " pseudo-element shouldn't claim to have " +
|
||||
"definite size");
|
||||
});
|
||||
}, "Resolution of nonexistent pseudo-element styles");
|
||||
test(function() {
|
||||
var none = document.getElementById('none');
|
||||
[":before", ":after"].forEach(function(pseudo) {
|
||||
assert_equals(getComputedStyle(none, pseudo).content, "\"Foo\"",
|
||||
"Pseudo-styles of display: none elements should be correct");
|
||||
});
|
||||
}, "Resolution of pseudo-element styles in display: none elements");
|
||||
test(function() {
|
||||
var flex = document.getElementById('flex');
|
||||
[":before", ":after"].forEach(function(pseudo) {
|
||||
assert_equals(getComputedStyle(flex, pseudo).display, "block",
|
||||
"Pseudo-styles of display: flex elements should get blockified");
|
||||
});
|
||||
}, "Item-based blockification of pseudo-elements");
|
||||
test(function() {
|
||||
var flexNoPseudo = document.getElementById('flex-no-pseudo');
|
||||
[":before", ":after"].forEach(function(pseudo) {
|
||||
assert_equals(getComputedStyle(flexNoPseudo, pseudo).display, "block",
|
||||
"Pseudo-styles of display: flex elements should get blockified");
|
||||
});
|
||||
}, "Item-based blockification of nonexistent pseudo-elements");
|
||||
</script>
|
Loading…
Add table
Add a link
Reference in a new issue