1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99
|
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>CSS Animations: parsing animation-trigger-timeline with invalid values</title>
<!-- TODO(crbug.com/390314945): Replace with spec link when the spec lands. -->
<link rel="help" href="https://github.com/w3c/csswg-drafts/issues/8942 ">
<meta name="assert" content="animation-trigger-type supports only the grammar '<single-animation-trigger-timeline> #'.">
<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('animation-trigger-timeline', 'initial');
test_valid_value('animation-trigger-timeline', 'inherit');
test_valid_value('animation-trigger-timeline', 'unset');
test_valid_value('animation-trigger-timeline', 'revert');
test_valid_value('animation-trigger-timeline', 'auto');
test_valid_value('animation-trigger-timeline', 'none');
test_valid_value('animation-trigger-timeline', 'auto, auto');
test_valid_value('animation-trigger-timeline', 'none, none');
test_valid_value('animation-trigger-timeline', 'auto, none');
test_valid_value('animation-trigger-timeline', 'none, auto');
test_valid_value('animation-trigger-timeline', '--test');
test_valid_value('animation-trigger-timeline', '--test1, --test2');
test_valid_value('animation-trigger-timeline', '--test1, --test2, none, --test3, auto');
test_invalid_value('animation-trigger-timeline', 'test1');
test_invalid_value('animation-trigger-timeline', '10px');
test_invalid_value('animation-trigger-timeline', 'auto auto');
test_invalid_value('animation-trigger-timeline', 'none none');
test_invalid_value('animation-trigger-timeline', 'foo bar');
test_invalid_value('animation-trigger-timeline', '"foo" "bar"');
test_invalid_value('animation-trigger-timeline', 'rgb(1, 2, 3)');
test_invalid_value('animation-trigger-timeline', '#fefefe');
test_invalid_value('animation-trigger-timeline', '"test"');
// https://drafts.csswg.org/scroll-animations-1/#scroll-notation
//
// animation-trigger-timeline: scroll(<axis>? <scroller>?);
// <axis> = block | inline | x | y
// <scroller> = root | nearest | self
test_valid_value('animation-trigger-timeline', 'scroll()');
test_valid_value('animation-trigger-timeline', ' scroll() ', 'scroll()');
test_valid_value('animation-trigger-timeline', 'scroll(block)', 'scroll()');
test_valid_value('animation-trigger-timeline', 'scroll(inline)');
test_valid_value('animation-trigger-timeline', 'scroll(x)');
test_valid_value('animation-trigger-timeline', 'scroll(y)');
test_valid_value('animation-trigger-timeline', 'scroll(root)');
test_valid_value('animation-trigger-timeline', 'scroll(nearest)', 'scroll()');
test_valid_value('animation-trigger-timeline', 'scroll(self)');
test_valid_value('animation-trigger-timeline', 'scroll(inline nearest)', 'scroll(inline)');
test_valid_value('animation-trigger-timeline', 'scroll(nearest inline)', 'scroll(inline)');
test_valid_value('animation-trigger-timeline', 'scroll(block self)', 'scroll(self)');
test_valid_value('animation-trigger-timeline', 'scroll(self block)', 'scroll(self)');
test_valid_value('animation-trigger-timeline', 'scroll(y root)', 'scroll(root y)');
test_invalid_value('animation-trigger-timeline', 'scroll(abc root)');
test_invalid_value('animation-trigger-timeline', 'scroll(abc)');
test_invalid_value('animation-trigger-timeline', 'scroll(y abc)');
test_invalid_value('animation-trigger-timeline', 'scroll("string")');
// https://drafts.csswg.org/scroll-animations-1/#view-notation
test_valid_value('animation-trigger-timeline', 'view()');
test_valid_value('animation-trigger-timeline', ' view() ', 'view()');
test_valid_value('animation-trigger-timeline', 'view(block)', 'view()');
test_valid_value('animation-trigger-timeline', 'view(inline)');
test_valid_value('animation-trigger-timeline', 'view(x)');
test_valid_value('animation-trigger-timeline', 'view(y)');
test_valid_value('animation-trigger-timeline', 'view(y 1px 2px)');
test_valid_value('animation-trigger-timeline', 'view(y 1px)');
test_valid_value('animation-trigger-timeline', 'view(y auto)', 'view(y)');
test_valid_value('animation-trigger-timeline', 'view(y auto auto)', 'view(y)');
test_valid_value('animation-trigger-timeline', 'view(y auto 1px)');
test_valid_value('animation-trigger-timeline', 'view(1px 2px y)', 'view(y 1px 2px)');
test_valid_value('animation-trigger-timeline', 'view(1px y)', 'view(y 1px)');
test_valid_value('animation-trigger-timeline', 'view(auto x)', 'view(x)');
test_valid_value('animation-trigger-timeline', 'view(1px 2px)');
test_valid_value('animation-trigger-timeline', 'view(1px)');
test_valid_value('animation-trigger-timeline', 'view(1px 1px)', 'view(1px)');
test_valid_value('animation-trigger-timeline', 'view(1px auto)');
test_valid_value('animation-trigger-timeline', 'view(auto calc(1% + 1px))');
test_valid_value('animation-trigger-timeline', 'view(2em calc(1% + 1em))');
test_valid_value('animation-trigger-timeline', 'view(auto)', 'view()');
test_valid_value('animation-trigger-timeline', 'view(auto auto)', 'view()');
test_invalid_value('animation-trigger-timeline', 'view(y 1px 2px 3px)');
test_invalid_value('animation-trigger-timeline', 'view(1px y 3px)');
test_invalid_value('animation-trigger-timeline', 'view(1px 2px 3px)');
test_invalid_value('animation-trigger-timeline', 'view(abc block)');
test_invalid_value('animation-trigger-timeline', 'view(abc)');
test_invalid_value('animation-trigger-timeline', 'view(y abc)');
test_invalid_value('animation-trigger-timeline', 'view("string")');
</script>
</body>
</html>
|