Bug 1523562 [wpt PR 14786] - [css-scroll-snap] Parsing scroll-margin*, a=testonly

Automatic update from web-platform-tests
[css-scroll-snap] Parsing scroll-margin*

Test parsing and serialization of the properties
scroll-margin* and scroll-snap*

https://drafts.csswg.org/css-scroll-snap-1/#property-index

--
scroll-margin* reject all percentages

--
Consolidate scroll-margin parsing tests

Consolidate longhand tests into the shorthand parsing test files.

--

wpt-commits: 0e46b25f365f3a3774acf7f46425570eafdf6a4f, 4cbc3f96262a22111b03343ca171fb8fbfcedc31, a090d4a741d89176effd4a9402edd296553de64c
wpt-pr: 14786
This commit is contained in:
Eric Willigers 2019-01-31 18:31:23 +00:00 коммит произвёл James Graham
Родитель 767655b5d6
Коммит 86b259918f
12 изменённых файлов: 335 добавлений и 0 удалений

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

@ -0,0 +1,32 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>CSS Scroll Snap Test: scroll-margin-block with invalid values</title>
<link rel="help" href="https://drafts.csswg.org/css-scroll-snap-1/#propdef-scroll-margin-block">
<meta name="assert" content="scroll-margin-block supports only the grammar '<length>{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("scroll-margin-block-start", "auto");
test_invalid_value("scroll-margin-block-start", "20%");
test_invalid_value("scroll-margin-block-start", "-30%");
test_invalid_value("scroll-margin-block-start", "1px 2px");
test_invalid_value("scroll-margin-block-end", "auto");
test_invalid_value("scroll-margin-block-end", "20%");
test_invalid_value("scroll-margin-block-end", "-30%");
test_invalid_value("scroll-margin-block-end", "1px 2px");
test_invalid_value("scroll-margin-block", "auto");
test_invalid_value("scroll-margin-block", "20%");
test_invalid_value("scroll-margin-block", "-30%");
test_invalid_value("scroll-margin-block", "1px 2px 3px");
</script>
</body>
</html>

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

@ -0,0 +1,28 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>CSS Scroll Snap Test: scroll-margin-block with valid values</title>
<link rel="help" href="https://drafts.csswg.org/css-scroll-snap-1/#propdef-scroll-margin-block">
<meta name="assert" content="scroll-margin-block supports the full grammar '<length>{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("scroll-margin-block-start", "-10px");
test_valid_value("scroll-margin-block-start", "calc(2em + 3ex)");
test_valid_value("scroll-margin-block-end", "-10px");
test_valid_value("scroll-margin-block-end", "calc(2em + 3ex)");
test_valid_value("scroll-margin-block", "-10px");
test_valid_value("scroll-margin-block", "calc(2em + 3ex)");
test_valid_value("scroll-margin-block", "1px 2px");
</script>
</body>
</html>

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

@ -0,0 +1,32 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>CSS Scroll Snap Test: scroll-margin-inline with invalid values</title>
<link rel="help" href="https://drafts.csswg.org/css-scroll-snap-1/#propdef-scroll-margin-inline">
<meta name="assert" content="scroll-margin-inline supports only the grammar '<length>{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("scroll-margin-inline-start", "auto");
test_invalid_value("scroll-margin-inline-start", "20%");
test_invalid_value("scroll-margin-inline-start", "-30%");
test_invalid_value("scroll-margin-inline-start", "1px 2px");
test_invalid_value("scroll-margin-inline-end", "auto");
test_invalid_value("scroll-margin-inline-end", "20%");
test_invalid_value("scroll-margin-inline-end", "-30%");
test_invalid_value("scroll-margin-inline-end", "1px 2px");
test_invalid_value("scroll-margin-inline", "auto");
test_invalid_value("scroll-margin-inline", "20%");
test_invalid_value("scroll-margin-inline", "-30%");
test_invalid_value("scroll-margin-inline", "1px 2px 3px");
</script>
</body>
</html>

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

@ -0,0 +1,27 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>CSS Scroll Snap Test: scroll-margin-inline with valid values</title>
<link rel="help" href="https://drafts.csswg.org/css-scroll-snap-1/#propdef-scroll-margin-inline">
<meta name="assert" content="scroll-margin-inline supports the full grammar '<length>{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("scroll-margin-inline-start", "-10px");
test_valid_value("scroll-margin-inline-start", "calc(2em + 3ex)");
test_valid_value("scroll-margin-inline-end", "-10px");
test_valid_value("scroll-margin-inline-end", "calc(2em + 3ex)");
test_valid_value("scroll-margin-inline", "-10px");
test_valid_value("scroll-margin-inline", "calc(2em + 3ex)");
test_valid_value("scroll-margin-inline", "1px 2px");
</script>
</body>
</html>

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

@ -0,0 +1,44 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>CSS Scroll Snap Test: scroll-margin with invalid values</title>
<link rel="help" href="https://drafts.csswg.org/css-scroll-snap-1/#propdef-scroll-margin">
<meta name="assert" content="scroll-margin supports only the grammar '<length>{1,4}'.">
<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("scroll-margin-top", "auto");
test_invalid_value("scroll-margin-top", "20%");
test_invalid_value("scroll-margin-top", "-30%");
test_invalid_value("scroll-margin-top", "1px 2px");
test_invalid_value("scroll-margin-right", "auto");
test_invalid_value("scroll-margin-right", "20%");
test_invalid_value("scroll-margin-right", "-30%");
test_invalid_value("scroll-margin-right", "1px 2px");
test_invalid_value("scroll-margin-bottom", "auto");
test_invalid_value("scroll-margin-bottom", "20%");
test_invalid_value("scroll-margin-bottom", "-30%");
test_invalid_value("scroll-margin-bottom", "1px 2px");
test_invalid_value("scroll-margin-left", "auto");
test_invalid_value("scroll-margin-left", "20%");
test_invalid_value("scroll-margin-left", "-30%");
test_invalid_value("scroll-margin-left", "1px 2px");
test_invalid_value("scroll-margin", "auto");
test_invalid_value("scroll-margin", "20%");
test_invalid_value("scroll-margin", "-30%");
test_invalid_value("scroll-margin", "1px 2px 3px 4px 5px");
</script>
</body>
</html>

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

@ -0,0 +1,38 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>CSS Scroll Snap Test: scroll-margin with valid values</title>
<link rel="help" href="https://drafts.csswg.org/css-scroll-snap-1/#propdef-scroll-margin">
<meta name="assert" content="scroll-margin supports the full grammar '<length>{1,4}'.">
<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("scroll-margin-top", "-10px");
test_valid_value("scroll-margin-top", "calc(2em + 3ex)");
test_valid_value("scroll-margin-right", "-10px");
test_valid_value("scroll-margin-right", "calc(2em + 3ex)");
test_valid_value("scroll-margin-bottom", "-10px");
test_valid_value("scroll-margin-bottom", "calc(2em + 3ex)");
test_valid_value("scroll-margin-left", "-10px");
test_valid_value("scroll-margin-left", "calc(2em + 3ex)");
test_valid_value("scroll-margin", "-10px");
test_valid_value("scroll-margin", "calc(2em + 3ex)");
test_valid_value("scroll-margin", "1px 2px");
test_valid_value("scroll-margin", "1px 2px 3px");
test_valid_value("scroll-margin", "1px 2px 3px 4px");
</script>
</body>
</html>

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

@ -0,0 +1,19 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>CSS Scroll Snap Test: scroll-snap-align with invalid values</title>
<link rel="help" href="https://drafts.csswg.org/css-scroll-snap-1/#propdef-scroll-snap-align">
<meta name="assert" content="scroll-snap-align supports only the grammar '[ none | start | end | center ]{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("scroll-snap-align", "auto");
test_invalid_value("scroll-snap-align", "start end center");
</script>
</body>
</html>

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

@ -0,0 +1,23 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>CSS Scroll Snap Test: scroll-snap-align with valid values</title>
<link rel="help" href="https://drafts.csswg.org/css-scroll-snap-1/#propdef-scroll-snap-align">
<meta name="assert" content="scroll-snap-align supports the full grammar '[ none | start | end | center ]{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("scroll-snap-align", "none");
test_valid_value("scroll-snap-align", "start");
test_valid_value("scroll-snap-align", "end");
test_valid_value("scroll-snap-align", "center");
test_valid_value("scroll-snap-align", "start none");
test_valid_value("scroll-snap-align", "center end");
</script>
</body>
</html>

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

@ -0,0 +1,19 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>CSS Scroll Snap Test: scroll-snap-stop with invalid values</title>
<link rel="help" href="https://drafts.csswg.org/css-scroll-snap-1/#propdef-scroll-snap-stop">
<meta name="assert" content="scroll-snap-stop supports only the grammar 'normal | always'.">
<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("scroll-snap-stop", "auto");
test_invalid_value("scroll-snap-stop", "normal always");
</script>
</body>
</html>

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

@ -0,0 +1,18 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>CSS Scroll Snap Test: scroll-snap-stop with valid values</title>
<link rel="help" href="https://drafts.csswg.org/css-scroll-snap-1/#propdef-scroll-snap-stop">
<meta name="assert" content="scroll-snap-stop supports the full grammar 'normal | always'.">
<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("scroll-snap-stop", "normal");
test_valid_value("scroll-snap-stop", "always");
</script>
</body>
</html>

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

@ -0,0 +1,29 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>CSS Scroll Snap Test: scroll-snap-type with invalid values</title>
<link rel="help" href="https://drafts.csswg.org/css-scroll-snap-1/#propdef-scroll-snap-type">
<meta name="assert" content="scroll-snap-type supports only the grammar 'none | [ x | y | block | inline | both ] [ mandatory | proximity ]?'.">
<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("scroll-snap-type", "auto");
test_invalid_value("scroll-snap-type", "x y");
test_invalid_value("scroll-snap-type", "block mandatory inline");
test_invalid_value("scroll-snap-type", "mandatory");
test_invalid_value("scroll-snap-type", "proximity");
test_invalid_value("scroll-snap-type", "mandatory inline");
test_invalid_value("scroll-snap-type", "proximity both");
test_invalid_value("scroll-snap-type", "mandatory x");
test_invalid_value("scroll-snap-type", "proximity y");
test_invalid_value("scroll-snap-type", "mandatory block");
test_invalid_value("scroll-snap-type", "proximity mandatory");
</script>
</body>
</html>

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

@ -0,0 +1,26 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>CSS Scroll Snap Test: scroll-snap-type with valid values</title>
<link rel="help" href="https://drafts.csswg.org/css-scroll-snap-1/#propdef-scroll-snap-type">
<meta name="assert" content="scroll-snap-type supports the full grammar 'none | [ x | y | block | inline | both ] [ mandatory | proximity ]?'.">
<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("scroll-snap-type", "none");
test_valid_value("scroll-snap-type", "x");
test_valid_value("scroll-snap-type", "y");
test_valid_value("scroll-snap-type", "block");
test_valid_value("scroll-snap-type", "inline");
test_valid_value("scroll-snap-type", "both");
test_valid_value("scroll-snap-type", "y mandatory");
test_valid_value("scroll-snap-type", "inline proximity");
</script>
</body>
</html>