Update web-platform-tests to revision f915dfd69790e7ca09f9bef4eb08cd30163cb3e3

This commit is contained in:
WPT Sync Bot 2019-05-28 10:22:49 +00:00
parent 2ac916b5a1
commit fde011e73d
70 changed files with 1490 additions and 483 deletions

View file

@ -0,0 +1,31 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>CSS Logical Properties and Values: getComputedValue().borderBlockColor</title>
<link rel="help" href="https://drafts.csswg.org/css-logical/#propdef-border-block-color">
<meta name="assert" content="border-block-color is computed color(s).">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="/css/support/computed-testcommon.js"></script>
</head>
<body>
<div id="box"></div>
<div id="target"></div>
<style>
#target {
color: lime;
}
</style>
<script>
test_computed_value("border-block-start-color", "currentcolor", 'rgb(0, 255, 0)');
test_computed_value("border-block-start-color", "rgb(2, 3, 4)");
test_computed_value("border-block-end-color", "rgb(34, 51, 68)");
test_computed_value("border-block-end-color", "transparent", "rgba(0, 0, 0, 0)");
test_computed_value("border-block-color", "rgb(34, 51, 68)");
test_computed_value("border-block-color", "transparent rgb(2, 3, 4)", "rgba(0, 0, 0, 0) rgb(2, 3, 4)");
test_computed_value("border-block-color", "rgb(2, 3, 4) rgb(2, 3, 4)", "rgb(2, 3, 4)");
test_computed_value("border-block-color", "currentcolor lime", 'rgb(0, 255, 0)');
</script>
</body>
</html>

View file

@ -0,0 +1,31 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>CSS Logical Properties and Values: parsing border-block-color with invalid values</title>
<link rel="help" href="https://drafts.csswg.org/css-logical/#propdef-border-block-color">
<meta name="assert" content="border-block-color supports only the grammar '<color>{1,2}'.">
<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("border-block-start-color", "#12");
test_invalid_value("border-block-start-color", "auto");
test_invalid_value("border-block-start-color", "red green");
test_invalid_value("border-block-start-color", "rgb");
test_invalid_value("border-block-start-color", "rgb(1,2,3,4,5)");
test_invalid_value("border-block-start-color", "rgb(10%, 20, 30%)");
test_invalid_value("border-block-end-color", "#123456789");
test_invalid_value("border-block-end-color", "123");
test_invalid_value("border-block-end-color", "hsla(1,2,3,4,5)");
test_invalid_value("border-block-end-color", "red, green");
test_invalid_value("border-block-end-color", "rgb(1)");
test_invalid_value("border-block-end-color", "rgba(-2, 300, 400%, -0.5)");
test_invalid_value("border-block-color", "auto");
test_invalid_value("border-block-color", "lime, transparent");
test_invalid_value("border-block-color", "red green blue");
</script>
</body>
</html>

View file

@ -0,0 +1,23 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>CSS Logical Properties and Values: parsing border-block-color with valid values</title>
<link rel="help" href="https://drafts.csswg.org/css-logical/#propdef-border-block-color">
<meta name="assert" content="border-block-color supports the full grammar '<color>{1,2}'.">
<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("border-block-start-color", "currentcolor");
test_valid_value("border-block-start-color", "rgb(2, 3, 4)");
test_valid_value("border-block-end-color", "#234", "rgb(34, 51, 68)");
test_valid_value("border-block-end-color", "transparent");
test_valid_value("border-block-color", "#234", "rgb(34, 51, 68)");
test_valid_value("border-block-color", "transparent rgb(2, 3, 4)");
test_valid_value("border-block-color", "rgb(2, 3, 4) rgb(2, 3, 4)", "rgb(2, 3, 4)");
</script>
</body>
</html>

View file

@ -0,0 +1,30 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>CSS Logical Properties and Values: getComputedValue().borderBlockStyle</title>
<link rel="help" href="https://drafts.csswg.org/css-logical/#propdef-border-block-style">
<meta name="assert" content="border-block-style is specified keyword(s).">
<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("border-block-start-style", "dotted");
test_computed_value("border-block-start-style", "groove");
test_computed_value("border-block-start-style", "inset");
test_computed_value("border-block-start-style", "none");
test_computed_value("border-block-start-style", "solid");
test_computed_value("border-block-end-style", "dashed");
test_computed_value("border-block-end-style", "double");
test_computed_value("border-block-end-style", "hidden");
test_computed_value("border-block-end-style", "outset");
test_computed_value("border-block-end-style", "ridge");
test_computed_value("border-block-style", "dotted");
test_computed_value("border-block-style", "double groove");
test_computed_value("border-block-style", "hidden hidden", "hidden");
</script>
</body>
</html>

View file

@ -0,0 +1,22 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>CSS Logical Properties and Values: parsing border-block-style with invalid values</title>
<link rel="help" href="https://drafts.csswg.org/css-logical/#propdef-border-block-style">
<meta name="assert" content="border-block-style supports only the grammar '<line-style>{1,2}'.">
<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("border-block-start-style", "auto");
test_invalid_value("border-block-start-style", "hidden, outset");
test_invalid_value("border-block-end-style", "solid double");
test_invalid_value("border-block-style", "auto");
test_invalid_value("border-block-style", "groove, ridge");
test_invalid_value("border-block-style", "hidden inset dashed");
</script>
</body>
</html>

View file

@ -0,0 +1,30 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>CSS Logical Properties and Values: parsing border-block-style with valid values</title>
<link rel="help" href="https://drafts.csswg.org/css-logical/#propdef-border-block">
<meta name="assert" content="border-block-style supports the full grammar '<line-style>{1,2}'.">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="/css/support/parsing-testcommon.js"></script>
</head>
<body>
<script>
// none | hidden | dotted | dashed | solid | double | groove | ridge | inset | outset
test_valid_value("border-block-start-style", "dotted");
test_valid_value("border-block-start-style", "groove");
test_valid_value("border-block-start-style", "inset");
test_valid_value("border-block-start-style", "none");
test_valid_value("border-block-start-style", "solid");
test_valid_value("border-block-end-style", "dashed");
test_valid_value("border-block-end-style", "double");
test_valid_value("border-block-end-style", "hidden");
test_valid_value("border-block-end-style", "outset");
test_valid_value("border-block-end-style", "ridge");
test_valid_value("border-block-style", "dotted");
test_valid_value("border-block-style", "double groove");
test_valid_value("border-block-style", "hidden hidden", "hidden");
</script>
</body>
</html>

View file

@ -0,0 +1,76 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>CSS Logical Properties and Values: getComputedValue().borderBlockWidth</title>
<link rel="help" href="https://drafts.csswg.org/css-logical/#propdef-border-block-width">
<meta name="assert" content="border-block-width is absolute length; zero if the border block style is none or hidden.">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="/css/support/computed-testcommon.js"></script>
</head>
<body>
<div id="box"></div>
<div id="target"></div>
<style>
#box {
border-style: dotted; /* Avoid border-*-width computed style 0 */
border-top-width: thin;
border-right-width: medium;
border-bottom-width: thick;
}
#target {
font-size: 40px;
border-block-style: dotted; /* Avoid border-block-*-width computed style 0 */
}
</style>
<script>
'use strict';
const box = document.getElementById('box');
const thinWidth = getComputedStyle(box).borderTopWidth;
const mediumWidth = getComputedStyle(box).borderRightWidth;
const thickWidth = getComputedStyle(box).borderBottomWidth;
test_computed_value("border-block-start-width", "calc(10px + 0.5em)", "30px");
test_computed_value("border-block-start-width", "calc(10px - 0.5em)", "0px");
test_computed_value("border-block-start-width", "thin", thinWidth);
test_computed_value("border-block-start-width", "medium", mediumWidth);
test_computed_value("border-block-end-width", "calc(10px + 0.5em)", "30px");
test_computed_value("border-block-end-width", "calc(10px - 0.5em)", "0px");
test_computed_value("border-block-end-width", "thick", thickWidth);
test_computed_value("border-block-width", "10px");
test_computed_value("border-block-width", "10px 20px");
test_computed_value("border-block-width", "10px 10px", "10px");
test(() => {
box.style.borderBlockStartWidth = '10px';
box.style.borderBlockEndWidth = '10px';
box.style.borderBlockStartStyle = 'groove';
box.style.borderBlockEndStyle = 'solid';
assert_equals(getComputedStyle(box).borderBlockStartWidth, '10px');
assert_equals(getComputedStyle(box).borderBlockEndWidth, '10px');
assert_equals(getComputedStyle(box).borderBlockWidth, '10px');
box.style.borderBlockStartStyle = 'hidden';
box.style.borderBlockEndStyle = 'dashed';
assert_equals(getComputedStyle(box).borderBlockStartWidth, '0px');
assert_equals(getComputedStyle(box).borderBlockEndWidth, '10px');
assert_equals(getComputedStyle(box).borderBlockWidth, '0px 10px');
box.style.borderBlockStartStyle = 'inset';
box.style.borderBlockEndStyle = 'none';
assert_equals(getComputedStyle(box).borderBlockStartWidth, '10px');
assert_equals(getComputedStyle(box).borderBlockEndWidth, '0px');
assert_equals(getComputedStyle(box).borderBlockWidth, '10px 0px');
box.style.borderBlockStartStyle = 'none';
box.style.borderBlockEndStyle = 'hidden';
assert_equals(getComputedStyle(box).borderBlockStartWidth, '0px');
assert_equals(getComputedStyle(box).borderBlockEndWidth, '0px');
assert_equals(getComputedStyle(box).borderBlockWidth, '0px');
}, 'width is zero if the border block style is none or hidden');
</script>
</body>
</html>

View file

@ -0,0 +1,25 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>CSS Logical Properties and Values: parsing border-block-width with invalid values</title>
<link rel="help" href="https://drafts.csswg.org/css-logical/#propdef-border-block-width">
<meta name="assert" content="border-block-width supports only the grammar '<line-width>{1,2}'.">
<meta name="assert" content="Negative lengths are not allowed.">
<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("border-block-start-width", "-20px");
test_invalid_value("border-block-start-width", "auto");
test_invalid_value("border-block-start-width", "medium 40px");
test_invalid_value("border-block-end-width", "10");
test_invalid_value("border-block-end-width", "30%");
test_invalid_value("border-block-width", "thick, thin");
test_invalid_value("border-block-width", "10px 20px 30px");
</script>
</body>
</html>

View file

@ -0,0 +1,27 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>CSS Logical Properties and Values: parsing border-block-width with valid values</title>
<link rel="help" href="https://drafts.csswg.org/css-logical/#propdef-border-block-width">
<meta name="assert" content="border-block-width supports the full grammar '<line-width>{1,2}'.">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="/css/support/parsing-testcommon.js"></script>
</head>
<body>
<script>
// <length> | thin | medium | thick
test_valid_value("border-block-start-width", "10px");
test_valid_value("border-block-start-width", "calc(10px + 0.5em)");
test_valid_value("border-block-start-width", "thick");
test_valid_value("border-block-start-width", "thin");
test_valid_value("border-block-end-width", "0", "0px");
test_valid_value("border-block-end-width", "calc(10px - 0.5em)");
test_valid_value("border-block-end-width", "medium");
test_valid_value("border-block-width", "10px");
test_valid_value("border-block-width", "medium calc(10px + 0.5em)");
test_valid_value("border-block-width", "10px 10px", "10px");
</script>
</body>
</html>