mirror of
https://github.com/servo/servo.git
synced 2025-08-07 06:25:32 +01:00
Update web-platform-tests to revision ac16628eb7eb601957382053011363d2bcf8ce44
This commit is contained in:
parent
ea7e753cea
commit
7e7c8873e4
4408 changed files with 664787 additions and 857286 deletions
|
@ -72,11 +72,11 @@ function testFirstLetterProperty(property, rule, expected, reason) {
|
|||
|
||||
for (var property in validProperties) {
|
||||
testFirstLetterProperty(property, validProperties[property], validProperties[property],
|
||||
"Whitelisted property " + property + " should be applied to first-letter pseudo elements.");
|
||||
property + " should be applied to first-letter pseudo elements.");
|
||||
}
|
||||
|
||||
for (var property in invalidProperties) {
|
||||
testFirstLetterProperty(property, invalidProperties[property], defaultComputedStyle[property],
|
||||
"Non-whitelisted property " + property + " should not be applied to first-letter pseudo elements.");
|
||||
property + " should not be applied to first-letter pseudo elements.");
|
||||
}
|
||||
</script>
|
|
@ -0,0 +1,24 @@
|
|||
<!DOCTYPE html>
|
||||
<meta charset="utf-8">
|
||||
<title>CSS Reference: ::marker pseudo elements styled with 'content' property</title>
|
||||
<link rel="author" title="Oriol Brufau" href="mailto:obrufau@igalia.com">
|
||||
<style>
|
||||
.symbol {
|
||||
list-style-type: disc;
|
||||
}
|
||||
.decimal {
|
||||
list-style-type: decimal;
|
||||
}
|
||||
.string {
|
||||
list-style-type: "string";
|
||||
}
|
||||
.content::marker {
|
||||
content: "content";
|
||||
}
|
||||
</style>
|
||||
<ol>
|
||||
<li class="symbol"><span><div>foo</div></span></li>
|
||||
<li class="decimal"><span><div>foo</div></span></li>
|
||||
<li class="string"><span><div>foo</div></span></li>
|
||||
<li class="content"><span><div>foo</div></span></li>
|
||||
</ol>
|
|
@ -0,0 +1,46 @@
|
|||
<!DOCTYPE html>
|
||||
<html class="reftest-wait">
|
||||
<meta charset="utf-8">
|
||||
<title>CSS Test: ::marker pseudo elements styled with 'content' property</title>
|
||||
<link rel="author" title="Oriol Brufau" href="mailto:obrufau@igalia.com">
|
||||
<link rel="match" href="marker-content-022-ref.html">
|
||||
<link rel="help" href="https://drafts.csswg.org/css-pseudo-4/#marker-pseudo">
|
||||
<link rel="help" href="https://drafts.csswg.org/css-lists/#list-style-position-outside">
|
||||
<meta name="assert" content="When a list item with an outside marker only has an inline child
|
||||
with a block grandchild, some browsers insert a newline between the marker and the block,
|
||||
and some don't. It's not clear what should happen, but this test checks that the behavior
|
||||
is consistent whether the block is inserted dynamically or was there from the beginning.">
|
||||
<style>
|
||||
.symbol {
|
||||
list-style-type: disc;
|
||||
}
|
||||
.decimal {
|
||||
list-style-type: decimal;
|
||||
}
|
||||
.string {
|
||||
list-style-type: "string";
|
||||
}
|
||||
.content::marker {
|
||||
content: "content";
|
||||
}
|
||||
</style>
|
||||
<ol>
|
||||
<li class="symbol"><span></span></li>
|
||||
<li class="decimal"><span></span></li>
|
||||
<li class="string"><span></span></li>
|
||||
<li class="content"><span></span></li>
|
||||
</ol>
|
||||
<script src="/common/reftest-wait.js"></script>
|
||||
<script>
|
||||
// Use a "load" event listener and requestAnimationFrame to ensure that
|
||||
// the markers will have been laid out.
|
||||
addEventListener("load", () => requestAnimationFrame(() => {
|
||||
const div = document.createElement("div");
|
||||
div.appendChild(document.createTextNode("foo"));
|
||||
for (let span of document.querySelectorAll("li > span")) {
|
||||
span.appendChild(div.cloneNode(true));
|
||||
}
|
||||
takeScreenshot();
|
||||
}), {once: true});
|
||||
</script>
|
||||
</html>
|
|
@ -0,0 +1,96 @@
|
|||
<!DOCTYPE html>
|
||||
<meta charset="utf-8">
|
||||
<title>CSS Pseudo-Elements Test: Hit testing ::marker</title>
|
||||
<link rel="help" href="https://drafts.csswg.org/css-pseudo-4/#marker-pseudo">
|
||||
<link rel="author" title="Oriol Brufau" href="mailto:obrufau@igalia.com">
|
||||
<meta name="assert" content="This test checks that hit-testing a ::marker, the APIs provide the nearest element ancestor." />
|
||||
<link rel="stylesheet" type="text/css" href="/fonts/ahem.css" />
|
||||
<style>
|
||||
ol {
|
||||
display: inline-block;
|
||||
padding-left: 100px;
|
||||
}
|
||||
li {
|
||||
font: 50px/100px Ahem;
|
||||
width: 50px;
|
||||
}
|
||||
.inside {
|
||||
list-style-position: inside;
|
||||
}
|
||||
.image {
|
||||
list-style-image: url("/images/green-100x50.png");
|
||||
}
|
||||
.string {
|
||||
list-style-type: "X";
|
||||
}
|
||||
.marker::marker {
|
||||
content: "X";
|
||||
}
|
||||
.nested {
|
||||
display: block;
|
||||
}
|
||||
.nested::before {
|
||||
content: '';
|
||||
display: list-item;
|
||||
}
|
||||
</style>
|
||||
<!-- The <li> are 50px wide, and the ::marker are at least 50px wide.
|
||||
Since they are outside, try to locate them at -40px to the left of
|
||||
the <li>, i.e. -65px from the center of the <li> -->
|
||||
<ol class="outside" data-x="-65">
|
||||
<li class="image"></li>
|
||||
<li class="string"></li>
|
||||
<li class="marker"></li>
|
||||
<li class="nested image"></li>
|
||||
<li class="nested string"></li>
|
||||
</ol>
|
||||
<!-- The <li> are 50px wide, and the inside ::marker are at least 50px,
|
||||
so locate them at the horizontal center of the <li> -->
|
||||
<ol class="inside" data-x="0">
|
||||
<li class="image"></li>
|
||||
<li class="string"></li>
|
||||
<li class="marker"></li>
|
||||
<li class="nested image"></li>
|
||||
<li class="nested string"></li>
|
||||
</ol>
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<script src="/resources/testdriver.js"></script>
|
||||
<script src="/resources/testdriver-actions.js"></script>
|
||||
<script src="/resources/testdriver-vendor.js"></script>
|
||||
<script>
|
||||
function check(event, li) {
|
||||
assert_equals(event.target, li, "event.target");
|
||||
if (event.path) {
|
||||
assert_equals(event.path[0], li, "event.path");
|
||||
}
|
||||
const el = document.elementFromPoint(event.clientX, event.clientY);
|
||||
assert_equals(el, li, "elementFromPoint");
|
||||
}
|
||||
(async function() {
|
||||
setup({ explicit_done: true });
|
||||
for (let list of document.querySelectorAll("ol")) {
|
||||
for (let li of list.querySelectorAll("li")) {
|
||||
const listener = e => check(e, li);
|
||||
async_test(function(t) {
|
||||
document.addEventListener("mousedown", t.step_func_done(listener));
|
||||
}, list.className + " " + li.className + " ::marker's content");
|
||||
async_test(function(t) {
|
||||
document.addEventListener("mouseup", t.step_func_done(listener));
|
||||
}, list.className + " " + li.className + " ::marker");
|
||||
await new test_driver.Actions()
|
||||
// Send an event at the vertical middle of the <li>, this should
|
||||
// hit the contents of the ::marker
|
||||
.pointerMove(+list.dataset.x, 0, {origin: li})
|
||||
.pointerDown()
|
||||
// The ::marker is 100px tall but its contents only 50px tall.
|
||||
// Send an event inside the ::marker but above its contents.
|
||||
.pointerMove(+list.dataset.x, -40, {origin: li})
|
||||
.pointerUp()
|
||||
.send();
|
||||
}
|
||||
}
|
||||
done();
|
||||
})();
|
||||
</script>
|
||||
|
|
@ -0,0 +1,66 @@
|
|||
<!DOCTYPE html>
|
||||
<meta charset="utf-8">
|
||||
<title>CSS Test: intrinsic contribution of ::marker</title>
|
||||
<link rel="author" title="Oriol Brufau" href="mailto:obrufau@igalia.com">
|
||||
<link rel="help" href="https://drafts.csswg.org/css-pseudo-4/#marker-pseudo">
|
||||
<link rel="help" href="https://drafts.csswg.org/css-sizing-3/#intrinsic">
|
||||
<meta name="assert" content="Checks that that outside markers have an intrinsic contribution of 0, and inside markers greater than 0.">
|
||||
<link rel="stylesheet" type="text/css" href="/fonts/ahem.css" />
|
||||
<style>
|
||||
li {
|
||||
font: 10px/1 Ahem;
|
||||
border: 5px solid orange;
|
||||
float: left;
|
||||
clear: left;
|
||||
}
|
||||
.inside {
|
||||
list-style-position: inside;
|
||||
}
|
||||
.symbol {
|
||||
list-style-type: disc;
|
||||
}
|
||||
.decimal {
|
||||
list-style-type: decimal;
|
||||
}
|
||||
.string {
|
||||
list-style-type: "string";
|
||||
}
|
||||
.content::marker {
|
||||
content: "content";
|
||||
}
|
||||
</style>
|
||||
<div id="log"></div>
|
||||
<ol class="outside">
|
||||
<li class="symbol" data-width="0"></li>
|
||||
<li class="decimal" data-width="0"></li>
|
||||
<li class="string" data-width="0"></li>
|
||||
<li class="content" data-width="0"></li>
|
||||
</ol>
|
||||
<ol class="inside">
|
||||
<li class="symbol" data-min-width="0"></li>
|
||||
<li class="decimal" data-width="30"></li>
|
||||
<li class="string" data-width="60"></li>
|
||||
<li class="content" data-width="70"></li>
|
||||
</ol>
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<script>
|
||||
"use strict";
|
||||
function check(item, msg) {
|
||||
test(function() {
|
||||
if (item.dataset.width) {
|
||||
assert_equals(item.clientWidth, +item.dataset.width, "clientWidth");
|
||||
} else {
|
||||
assert_greater_than(item.clientWidth, +item.dataset.minWidth, "clientWidth");
|
||||
}
|
||||
}, msg);
|
||||
}
|
||||
|
||||
for (let item of document.querySelectorAll(".outside > li")) {
|
||||
check(item, `Intrinsic contribution of outside ${item.className} marker`);
|
||||
}
|
||||
|
||||
for (let item of document.querySelectorAll(".inside > li")) {
|
||||
check(item, `Intrinsic contribution of inside ${item.className} marker`);
|
||||
}
|
||||
</script>
|
|
@ -0,0 +1,38 @@
|
|||
<!DOCTYPE html>
|
||||
<meta charset="utf-8">
|
||||
<title>CSS Reference: intrinsic contribution of ::marker</title>
|
||||
<link rel="author" title="Oriol Brufau" href="mailto:obrufau@igalia.com">
|
||||
<style>
|
||||
li {
|
||||
border: 5px solid;
|
||||
float: left;
|
||||
clear: left;
|
||||
}
|
||||
.inside {
|
||||
list-style-position: inside;
|
||||
}
|
||||
.symbol {
|
||||
list-style-type: disc;
|
||||
}
|
||||
.decimal {
|
||||
list-style-type: decimal;
|
||||
}
|
||||
.string {
|
||||
list-style-type: "string";
|
||||
}
|
||||
.content::marker {
|
||||
content: "content";
|
||||
}
|
||||
</style>
|
||||
<ol class="inside">
|
||||
<li class="symbol"></li>
|
||||
<li class="decimal"></li>
|
||||
<li class="string"></li>
|
||||
<li class="content"></li>
|
||||
</ol>
|
||||
<ol>
|
||||
<li class="symbol"></li>
|
||||
<li class="decimal"></li>
|
||||
<li class="string"></li>
|
||||
<li class="content"></li>
|
||||
</ol>
|
|
@ -0,0 +1,58 @@
|
|||
<!DOCTYPE html>
|
||||
<html class="reftest-wait">
|
||||
<meta charset="utf-8">
|
||||
<title>CSS Test: intrinsic contribution of ::marker</title>
|
||||
<link rel="author" title="Oriol Brufau" href="mailto:obrufau@igalia.com">
|
||||
<link rel="match" href="marker-intrinsic-contribution-002-ref.html">
|
||||
<link rel="help" href="https://drafts.csswg.org/css-pseudo-4/#marker-pseudo">
|
||||
<link rel="help" href="https://drafts.csswg.org/css-sizing-3/#intrinsic">
|
||||
<meta name="assert" content="Checks that that the intrinsic contribution of a ::marker is updated when 'list-style-position' changes.">
|
||||
<style>
|
||||
li {
|
||||
border: 5px solid;
|
||||
float: left;
|
||||
clear: left;
|
||||
}
|
||||
.inside {
|
||||
list-style-position: inside;
|
||||
}
|
||||
.symbol {
|
||||
list-style-type: disc;
|
||||
}
|
||||
.decimal {
|
||||
list-style-type: decimal;
|
||||
}
|
||||
.string {
|
||||
list-style-type: "string";
|
||||
}
|
||||
.content::marker {
|
||||
content: "content";
|
||||
}
|
||||
</style>
|
||||
<ol>
|
||||
<li class="symbol"></li>
|
||||
<li class="decimal"></li>
|
||||
<li class="string"></li>
|
||||
<li class="content"></li>
|
||||
</ol>
|
||||
<ol class="inside">
|
||||
<li class="symbol"></li>
|
||||
<li class="decimal"></li>
|
||||
<li class="string"></li>
|
||||
<li class="content"></li>
|
||||
</ol>
|
||||
<script src="/common/reftest-wait.js"></script>
|
||||
<script>
|
||||
"use strict";
|
||||
// Use a "load" event listener and requestAnimationFrame to ensure that
|
||||
// the markers will have been laid out.
|
||||
addEventListener("load", function() {
|
||||
requestAnimationFrame(() => {
|
||||
for (let list of document.querySelectorAll("ol")) {
|
||||
list.classList.toggle("inside");
|
||||
}
|
||||
takeScreenshot();
|
||||
});
|
||||
}, {once: true});
|
||||
</script>
|
||||
</html>
|
Loading…
Add table
Add a link
Reference in a new issue