Bug 1565533 [wpt PR 17756] - CSS: Parsing tests for align-* and justify-* properties, a=testonly

Automatic update from web-platform-tests
CSS: Parsing tests for align-* and justify-* properties

Check that CSS Alignment properties accept only the values permitted
by the spec
https://drafts.csswg.org/css-align-3/#property-index

Change-Id: I93b00ac2280ca4991c24b3ee35a17047e165b8a5
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1694928
Reviewed-by: Anders Hartvoll Ruud <andruud@chromium.org>
Commit-Queue: Eric Willigers <ericwilligers@chromium.org>
Cr-Commit-Position: refs/heads/master@{#676203}

--

wpt-commits: 9234a033ce9a341afec6574ddc0f2ec13c9dd35f
wpt-pr: 17756
This commit is contained in:
Eric Willigers 2019-07-22 10:24:10 +00:00 коммит произвёл James Graham
Родитель 5c56253834
Коммит 17938ecbb7
12 изменённых файлов: 436 добавлений и 0 удалений

Просмотреть файл

@ -0,0 +1,35 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>CSS Box Alignment Level 3: parsing align-content with invalid values</title>
<link rel="help" href="https://drafts.csswg.org/css-align-3/#propdef-align-content">
<meta name="assert" content="align-content supports only the grammar 'normal | <baseline-position> | <content-distribution> | <overflow-position>? <content-position>'.">
<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("align-content", "auto");
test_invalid_value("align-content", "baseline last");
test_invalid_value("align-content", "center baseline");
test_invalid_value("align-content", "first");
test_invalid_value("align-content", "flex-start flex-end");
test_invalid_value("align-content", "last");
test_invalid_value("align-content", "left");
test_invalid_value("align-content", "legacy center");
test_invalid_value("align-content", "legacy left");
test_invalid_value("align-content", "legacy");
test_invalid_value("align-content", "normal baseline");
test_invalid_value("align-content", "right legacy");
test_invalid_value("align-content", "safe self-end");
test_invalid_value("align-content", "safe");
test_invalid_value("align-content", "self-end unsafe");
test_invalid_value("align-content", "self-start");
test_invalid_value("align-content", "start safe");
test_invalid_value("align-content", "unsafe right");
test_invalid_value("align-content", "unsafe");
</script>
</body>
</html>

Просмотреть файл

@ -0,0 +1,39 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>CSS Box Alignment Level 3: parsing align-content with valid values</title>
<link rel="help" href="https://drafts.csswg.org/css-align-3/#propdef-align-content">
<meta name="assert" content="align-content supports the full grammar 'normal | <baseline-position> | <content-distribution> | <overflow-position>? <content-position>'.">
<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("align-content", "normal");
// <baseline-position> = [ first | last ]? baseline
test_valid_value("align-content", "baseline");
test_valid_value("align-content", "first baseline", "baseline");
test_valid_value("align-content", "last baseline");
// <content-distribution> = space-between | space-around | space-evenly | stretch
test_valid_value("align-content", "space-between");
test_valid_value("align-content", "space-around");
test_valid_value("align-content", "space-evenly");
test_valid_value("align-content", "stretch");
// <overflow-position>? <content-position>
// <overflow-position> = unsafe | safe
// <content-position> = center | start | end | flex-start | flex-end
test_valid_value("align-content", "center");
test_valid_value("align-content", "start");
test_valid_value("align-content", "end");
test_valid_value("align-content", "flex-start");
test_valid_value("align-content", "flex-end");
test_valid_value("align-content", "unsafe end");
test_valid_value("align-content", "safe flex-start");
</script>
</body>
</html>

Просмотреть файл

@ -0,0 +1,36 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>CSS Box Alignment Level 3: parsing align-items with invalid values</title>
<link rel="help" href="https://drafts.csswg.org/css-align-3/#propdef-align-items">
<meta name="assert" content="align-items supports only the grammar 'normal | stretch | <baseline-position> | [ <overflow-position>? <self-position> ]'.">
<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("align-items", "auto");
test_invalid_value("align-items", "baseline last");
test_invalid_value("align-items", "center baseline");
test_invalid_value("align-items", "first");
test_invalid_value("align-items", "flex-start flex-end");
test_invalid_value("align-items", "last");
test_invalid_value("align-items", "left");
test_invalid_value("align-items", "legacy center");
test_invalid_value("align-items", "legacy left");
test_invalid_value("align-items", "legacy");
test_invalid_value("align-items", "normal baseline");
test_invalid_value("align-items", "right legacy");
test_invalid_value("align-items", "safe");
test_invalid_value("align-items", "self-end unsafe");
test_invalid_value("align-items", "space-around");
test_invalid_value("align-items", "space-between");
test_invalid_value("align-items", "space-evenly");
test_invalid_value("align-items", "start safe");
test_invalid_value("align-items", "unsafe right");
test_invalid_value("align-items", "unsafe");
</script>
</body>
</html>

Просмотреть файл

@ -0,0 +1,36 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>CSS Box Alignment Level 3: parsing align-items with valid values</title>
<link rel="help" href="https://drafts.csswg.org/css-align-3/#propdef-align-items">
<meta name="assert" content="align-items supports the full grammar 'normal | stretch | <baseline-position> | [ <overflow-position>? <self-position> ]'.">
<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("align-items", "normal");
test_valid_value("align-items", "stretch");
// <baseline-position> = [ first | last ]? baseline
test_valid_value("align-items", "baseline");
test_valid_value("align-items", "first baseline", "baseline");
test_valid_value("align-items", "last baseline");
// <overflow-position>? <self-position>
// <overflow-position> = unsafe | safe
// <self-position> = center | start | end | self-start | self-end | flex-start | flex-end
test_valid_value("align-items", "center");
test_valid_value("align-items", "start");
test_valid_value("align-items", "end");
test_valid_value("align-items", "self-start");
test_valid_value("align-items", "self-end");
test_valid_value("align-items", "flex-start");
test_valid_value("align-items", "flex-end");
test_valid_value("align-items", "unsafe center");
test_valid_value("align-items", "safe self-end");
</script>
</body>
</html>

Просмотреть файл

@ -0,0 +1,35 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>CSS Box Alignment Level 3: parsing align-self with invalid values</title>
<link rel="help" href="https://drafts.csswg.org/css-align-3/#propdef-align-self">
<meta name="assert" content="align-self supports only the grammar 'auto | normal | stretch | <baseline-position> | <overflow-position>? <self-position>'.">
<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("align-self", "baseline last");
test_invalid_value("align-self", "center baseline");
test_invalid_value("align-self", "first");
test_invalid_value("align-self", "flex-start flex-end");
test_invalid_value("align-self", "last");
test_invalid_value("align-self", "left");
test_invalid_value("align-self", "legacy center");
test_invalid_value("align-self", "legacy left");
test_invalid_value("align-self", "legacy");
test_invalid_value("align-self", "normal baseline");
test_invalid_value("align-self", "right legacy");
test_invalid_value("align-self", "safe");
test_invalid_value("align-self", "self-end unsafe");
test_invalid_value("align-self", "space-around");
test_invalid_value("align-self", "space-between");
test_invalid_value("align-self", "space-evenly");
test_invalid_value("align-self", "start safe");
test_invalid_value("align-self", "unsafe right");
test_invalid_value("align-self", "unsafe");
</script>
</body>
</html>

Просмотреть файл

@ -0,0 +1,37 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>CSS Box Alignment Level 3: parsing align-self with valid values</title>
<link rel="help" href="https://drafts.csswg.org/css-align-3/#propdef-align-self">
<meta name="assert" content="align-self supports the full grammar 'auto | normal | stretch | <baseline-position> | <overflow-position>? <self-position>'.">
<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("align-self", "auto");
test_valid_value("align-self", "normal");
test_valid_value("align-self", "stretch");
// <baseline-position> = [ first | last ]? baseline
test_valid_value("align-self", "baseline");
test_valid_value("align-self", "first baseline", "baseline");
test_valid_value("align-self", "last baseline");
// <overflow-position>? <self-position>
// <overflow-position> = unsafe | safe
// <self-position> = center | start | end | self-start | self-end | flex-start | flex-end
test_valid_value("align-self", "center");
test_valid_value("align-self", "start");
test_valid_value("align-self", "end");
test_valid_value("align-self", "self-start");
test_valid_value("align-self", "self-end");
test_valid_value("align-self", "flex-start");
test_valid_value("align-self", "flex-end");
test_valid_value("align-self", "unsafe center");
test_valid_value("align-self", "safe self-end");
</script>
</body>
</html>

Просмотреть файл

@ -0,0 +1,36 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>CSS Box Alignment Level 3: parsing justify-content with invalid values</title>
<link rel="help" href="https://drafts.csswg.org/css-justify-3/#propdef-justify-content">
<meta name="assert" content="justify-content supports only the grammar 'normal | <content-distribution> | <overflow-position>? [ <content-position> | left | right ]'.">
<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("justify-content", "auto");
test_invalid_value("justify-content", "baseline last");
test_invalid_value("justify-content", "baseline");
test_invalid_value("justify-content", "center baseline");
test_invalid_value("justify-content", "first baseline");
test_invalid_value("justify-content", "first");
test_invalid_value("justify-content", "flex-start flex-end");
test_invalid_value("justify-content", "last baseline");
test_invalid_value("justify-content", "last");
test_invalid_value("justify-content", "legacy center");
test_invalid_value("justify-content", "legacy left");
test_invalid_value("justify-content", "legacy");
test_invalid_value("justify-content", "normal baseline");
test_invalid_value("justify-content", "right legacy");
test_invalid_value("justify-content", "safe self-end");
test_invalid_value("justify-content", "safe");
test_invalid_value("justify-content", "self-end unsafe");
test_invalid_value("justify-content", "self-start");
test_invalid_value("justify-content", "start safe");
test_invalid_value("justify-content", "unsafe");
</script>
</body>
</html>

Просмотреть файл

@ -0,0 +1,36 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>CSS Box Alignment Level 3: parsing justify-content with valid values</title>
<link rel="help" href="https://drafts.csswg.org/css-justify-3/#propdef-justify-content">
<meta name="assert" content="justify-content supports the full grammar 'normal | <content-distribution> | <overflow-position>? [ <content-position> | left | right ]'.">
<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("justify-content", "normal");
// <content-distribution> = space-between | space-around | space-evenly | stretch
test_valid_value("justify-content", "space-between");
test_valid_value("justify-content", "space-around");
test_valid_value("justify-content", "space-evenly");
test_valid_value("justify-content", "stretch");
// <overflow-position>? [ <content-position> | left | right ]
// <overflow-position> = unsafe | safe
// <content-position> = center | start | end | flex-start | flex-end
test_valid_value("justify-content", "center");
test_valid_value("justify-content", "start");
test_valid_value("justify-content", "end");
test_valid_value("justify-content", "flex-start");
test_valid_value("justify-content", "flex-end");
test_valid_value("justify-content", "unsafe end");
test_valid_value("justify-content", "safe flex-start");
test_valid_value("justify-content", "left");
test_valid_value("justify-content", "unsafe right");
</script>
</body>
</html>

Просмотреть файл

@ -0,0 +1,30 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>CSS Box Alignment Level 3: parsing justify-items with invalid values</title>
<link rel="help" href="https://drafts.csswg.org/css-justify-3/#propdef-justify-items">
<meta name="assert" content="justify-items supports only the grammar 'normal | stretch | <baseline-position> | <overflow-position>? [ <self-position> | left | right ] | legacy | legacy && [ left | right | center ]'.">
<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("justify-items", "auto");
test_invalid_value("justify-items", "baseline last");
test_invalid_value("justify-items", "center baseline");
test_invalid_value("justify-items", "first");
test_invalid_value("justify-items", "flex-start flex-end");
test_invalid_value("justify-items", "last");
test_invalid_value("justify-items", "normal baseline");
test_invalid_value("justify-items", "safe");
test_invalid_value("justify-items", "self-end unsafe");
test_invalid_value("justify-items", "space-around");
test_invalid_value("justify-items", "space-between");
test_invalid_value("justify-items", "space-evenly");
test_invalid_value("justify-items", "start safe");
test_invalid_value("justify-items", "unsafe");
</script>
</body>
</html>

Просмотреть файл

@ -0,0 +1,44 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>CSS Box Alignment Level 3: parsing justify-items with valid values</title>
<link rel="help" href="https://drafts.csswg.org/css-justify-3/#propdef-justify-items">
<meta name="assert" content="justify-items supports the full grammar 'normal | stretch | <baseline-position> | <overflow-position>? [ <self-position> | left | right ] | legacy | legacy && [ left | right | center ]'.">
<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("justify-items", "normal");
test_valid_value("justify-items", "stretch");
// <baseline-position> = [ first | last ]? baseline
test_valid_value("justify-items", "baseline");
test_valid_value("justify-items", "first baseline", "baseline");
test_valid_value("justify-items", "last baseline");
// <overflow-position>? [ <self-position> | left | right ]
// <overflow-position> = unsafe | safe
// <self-position> = center | start | end | self-start | self-end | flex-start | flex-end
test_valid_value("justify-items", "center");
test_valid_value("justify-items", "start");
test_valid_value("justify-items", "end");
test_valid_value("justify-items", "self-start");
test_valid_value("justify-items", "self-end");
test_valid_value("justify-items", "flex-start");
test_valid_value("justify-items", "flex-end");
test_valid_value("justify-items", "unsafe center");
test_valid_value("justify-items", "safe self-end");
test_valid_value("justify-items", "right");
test_valid_value("justify-items", "safe left");
// legacy | legacy && [ left | right | center ]
test_valid_value("justify-items", "legacy");
test_valid_value("justify-items", "left legacy", "legacy left");
test_valid_value("justify-items", "right legacy", "legacy right");
test_valid_value("justify-items", "center legacy", "legacy center");
</script>
</body>
</html>

Просмотреть файл

@ -0,0 +1,33 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>CSS Box Alignment Level 3: parsing justify-self with invalid values</title>
<link rel="help" href="https://drafts.csswg.org/css-justify-3/#propdef-justify-self">
<meta name="assert" content="justify-self supports only the grammar 'auto | normal | stretch | <baseline-position> | <overflow-position>? [ <self-position> | left | right ]'.">
<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("justify-self", "baseline last");
test_invalid_value("justify-self", "center baseline");
test_invalid_value("justify-self", "first");
test_invalid_value("justify-self", "flex-start flex-end");
test_invalid_value("justify-self", "last");
test_invalid_value("justify-self", "legacy center");
test_invalid_value("justify-self", "legacy left");
test_invalid_value("justify-self", "legacy");
test_invalid_value("justify-self", "normal baseline");
test_invalid_value("justify-self", "right legacy");
test_invalid_value("justify-self", "safe");
test_invalid_value("justify-self", "self-end unsafe");
test_invalid_value("justify-self", "space-around");
test_invalid_value("justify-self", "space-between");
test_invalid_value("justify-self", "space-evenly");
test_invalid_value("justify-self", "start safe");
test_invalid_value("justify-self", "unsafe");
</script>
</body>
</html>

Просмотреть файл

@ -0,0 +1,39 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>CSS Box Alignment Level 3: parsing justify-self with valid values</title>
<link rel="help" href="https://drafts.csswg.org/css-justify-3/#propdef-justify-self">
<meta name="assert" content="justify-self supports the full grammar 'auto | normal | stretch | <baseline-position> | <overflow-position>? [ <self-position> | left | right ]'.">
<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("justify-self", "auto");
test_valid_value("justify-self", "normal");
test_valid_value("justify-self", "stretch");
// <baseline-position> = [ first | last ]? baseline
test_valid_value("justify-self", "baseline");
test_valid_value("justify-self", "first baseline", "baseline");
test_valid_value("justify-self", "last baseline");
// <overflow-position>? [ <self-position> | left | right ]
// <overflow-position> = unsafe | safe
// <self-position> = center | start | end | self-start | self-end | flex-start | flex-end
test_valid_value("justify-self", "center");
test_valid_value("justify-self", "start");
test_valid_value("justify-self", "end");
test_valid_value("justify-self", "self-start");
test_valid_value("justify-self", "self-end");
test_valid_value("justify-self", "flex-start");
test_valid_value("justify-self", "flex-end");
test_valid_value("justify-self", "unsafe center");
test_valid_value("justify-self", "safe self-end");
test_valid_value("justify-self", "left");
test_valid_value("justify-self", "unsafe right");
</script>
</body>
</html>