mirror of
https://github.com/servo/servo.git
synced 2025-08-03 12:40:06 +01:00
Update web-platform-tests to revision b'1d9b01e2fad6af3a057d571b1e088e15fa9bc8e6'
This commit is contained in:
parent
cfef75c99b
commit
bb34f95b33
1683 changed files with 37170 additions and 4252 deletions
|
@ -0,0 +1,21 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>CSS Text: getComputedStyle().whiteSpace</title>
|
||||
<link rel="help" href="https://www.w3.org/TR/css-text-3/#propdef-white-space">
|
||||
<meta name="assert" content="white-space computed value is specified keyword.">
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<script src="/css/support/computed-testcommon.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<div id="target"></div>
|
||||
<script>
|
||||
test_computed_value("white-space-collapse", "collapse");
|
||||
test_computed_value("white-space-collapse", "preserve");
|
||||
test_computed_value("white-space-collapse", "preserve-breaks");
|
||||
test_computed_value("white-space-collapse", "break-spaces");
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
|
@ -0,0 +1,23 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>CSS Text Module Test: parsing text-wrap with invalid values</title>
|
||||
<link rel="author" title="Tim Nguyen" href="https://github.com/nt1m">
|
||||
<link rel="help" href="https://drafts.csswg.org/css-text-4/#text-wrap">
|
||||
<meta name="assert" content="text-wrap supports only the grammar 'wrap | nowrap | balance | stable | pretty'.">
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<script src="/css/support/parsing-testcommon.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<script>
|
||||
test_invalid_value("white-space-collapse", "auto");
|
||||
test_invalid_value("white-space-collapse", "none");
|
||||
test_invalid_value("white-space-collapse", "collapse preserve");
|
||||
test_invalid_value("white-space-collapse", "preserve preserve-breaks");
|
||||
test_invalid_value("white-space-collapse", "delicious collapse");
|
||||
test_invalid_value("white-space-collapse", "5px");
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
|
@ -0,0 +1,26 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>CSS Text Module Test: parsing text-wrap with valid values</title>
|
||||
<link rel="author" title="Tim Nguyen" href="https://github.com/nt1m">
|
||||
<link rel="help" href="https://drafts.csswg.org/css-text-4/#text-wrap">
|
||||
<meta name="assert" content="text-wrap supports the full grammar 'wrap | nowrap | balance | stable | pretty'.">
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<script src="/css/support/parsing-testcommon.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<script>
|
||||
test_valid_value("white-space-collapse", "collapse");
|
||||
test_valid_value("white-space-collapse", "preserve");
|
||||
test_valid_value("white-space-collapse", "preserve-breaks");
|
||||
test_valid_value("white-space-collapse", "break-spaces");
|
||||
test_valid_value("white-space-collapse", "initial");
|
||||
test_valid_value("white-space-collapse", "inherit");
|
||||
test_valid_value("white-space-collapse", "unset");
|
||||
test_valid_value("white-space-collapse", "revert");
|
||||
test_valid_value("white-space-collapse", "revert-layer");
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
|
@ -0,0 +1,70 @@
|
|||
<!DOCTYPE html>
|
||||
<link rel="help" href="https://w3c.github.io/csswg-drafts/css-text-4/#propdef-white-space">
|
||||
<link rel="help" href="https://w3c.github.io/csswg-drafts/css-text-4/#propdef-text-wrap">
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<style>
|
||||
.balance {
|
||||
text-wrap: balance;
|
||||
}
|
||||
</style>
|
||||
<div id="balance" class="balance"></div>
|
||||
<script>
|
||||
test(() => {
|
||||
const target = document.getElementById('balance');
|
||||
assert_equals(getComputedStyle(target).textWrap, 'balance');
|
||||
}, "`text-wrap: balance` should be set");
|
||||
</script>
|
||||
|
||||
<style>
|
||||
#text-wrap-after-white-space {
|
||||
white-space: normal;
|
||||
text-wrap: balance;
|
||||
}
|
||||
</style>
|
||||
<div id="text-wrap-after-white-space"></div>
|
||||
<script>
|
||||
test(() => {
|
||||
const target = document.getElementById('text-wrap-after-white-space');
|
||||
assert_equals(getComputedStyle(target).textWrap, 'balance');
|
||||
}, "`text-wrap` should not be affected by previous `white-space`");
|
||||
</script>
|
||||
|
||||
<style>
|
||||
#white-space-after-text-wrap {
|
||||
text-wrap: balance;
|
||||
white-space: normal;
|
||||
}
|
||||
</style>
|
||||
<div id="white-space-after-text-wrap"></div>
|
||||
<script>
|
||||
test(() => {
|
||||
const target = document.getElementById('white-space-after-text-wrap');
|
||||
assert_equals(getComputedStyle(target).textWrap, 'wrap');
|
||||
}, "`white-space` should overwrite previous `text-wrap`");
|
||||
</script>
|
||||
|
||||
<style>
|
||||
.normal {
|
||||
white-space: normal;
|
||||
}
|
||||
</style>
|
||||
<div class="normal">
|
||||
<div id="parent-white-space" class="balance"></div>
|
||||
</div>
|
||||
<script>
|
||||
test(() => {
|
||||
const target = document.getElementById('parent-white-space');
|
||||
assert_equals(getComputedStyle(target).textWrap, 'balance');
|
||||
}, "`text-wrap` should not be affected by `white-space` on the parent");
|
||||
</script>
|
||||
|
||||
<div class="balance">
|
||||
<div id="parent-text-wrap" class="normal"></div>
|
||||
</div>
|
||||
<script>
|
||||
test(() => {
|
||||
const target = document.getElementById('parent-text-wrap');
|
||||
assert_equals(getComputedStyle(target).textWrap, 'wrap');
|
||||
}, "`white-space` should overwrite `text-wrap` on the parent");
|
||||
</script>
|
|
@ -0,0 +1,49 @@
|
|||
<!DOCTYPE html>
|
||||
<title>CSS Text Module Test: parsing white-space as a shorthand</title>
|
||||
<link rel="help" href="https://w3c.github.io/csswg-drafts/css-text-4/#propdef-white-space">
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<script src="/css/support/parsing-testcommon.js"></script>
|
||||
<script src="/css/support/computed-testcommon.js"></script>
|
||||
<div id="target"></div>
|
||||
<script>
|
||||
function test_valid_and_computed_value(property, specified, serialized) {
|
||||
test_valid_value(property, specified, serialized);
|
||||
test_computed_value(property, specified, serialized);
|
||||
}
|
||||
|
||||
test_valid_and_computed_value("white-space", "collapse", "normal");
|
||||
test_valid_and_computed_value("white-space", "wrap", "normal");
|
||||
test_valid_and_computed_value("white-space", "collapse wrap", "normal");
|
||||
test_valid_and_computed_value("white-space", "wrap collapse", "normal");
|
||||
|
||||
test_valid_and_computed_value("white-space", "preserve nowrap", "pre");
|
||||
test_valid_and_computed_value("white-space", "nowrap preserve", "pre");
|
||||
|
||||
test_valid_and_computed_value("white-space", "nowrap", "nowrap");
|
||||
test_valid_and_computed_value("white-space", "collapse nowrap", "nowrap");
|
||||
test_valid_and_computed_value("white-space", "nowrap collapse", "nowrap");
|
||||
|
||||
test_valid_and_computed_value("white-space", "preserve", "pre-wrap");
|
||||
test_valid_and_computed_value("white-space", "preserve wrap", "pre-wrap");
|
||||
test_valid_and_computed_value("white-space", "wrap preserve", "pre-wrap");
|
||||
|
||||
test_valid_and_computed_value("white-space", "break-spaces", "break-spaces");
|
||||
test_valid_and_computed_value("white-space", "break-spaces wrap", "break-spaces");
|
||||
test_valid_and_computed_value("white-space", "wrap break-spaces", "break-spaces");
|
||||
|
||||
test_valid_and_computed_value("white-space", "preserve-breaks", "pre-line");
|
||||
test_valid_and_computed_value("white-space", "preserve-breaks wrap", "pre-line");
|
||||
test_valid_and_computed_value("white-space", "wrap preserve-breaks", "pre-line");
|
||||
|
||||
// Combinations of existing values that are not pre-defined.
|
||||
test_valid_and_computed_value("white-space", "preserve-breaks nowrap", "preserve-breaks nowrap");
|
||||
test_valid_and_computed_value("white-space", "nowrap preserve-breaks", "preserve-breaks nowrap");
|
||||
|
||||
// Values not used in the pre-defined set.
|
||||
test_valid_and_computed_value("white-space", "balance", "balance");
|
||||
test_valid_and_computed_value("white-space", "collapse balance", "balance");
|
||||
test_valid_and_computed_value("white-space", "balance collapse", "balance");
|
||||
test_valid_and_computed_value("white-space", "preserve balance", "preserve balance");
|
||||
test_valid_and_computed_value("white-space", "balance preserve", "preserve balance");
|
||||
</script>
|
Loading…
Add table
Add a link
Reference in a new issue