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 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147
|
<!DOCTYPE html>
<title>animation-trigger shorthand</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">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="/css/support/shorthand-testcommon.js"></script>
<script src="/css/support/parsing-testcommon.js"></script>
<script src="/css/support/computed-testcommon.js"></script>
<div id="target" style="font-size:10px"></div>
<script>
test_shorthand_value('animation-trigger',
'view() once contain 0% contain 100% cover 0% cover 100%',
{
'animation-trigger-type': 'once',
'animation-trigger-timeline': 'view()',
'animation-trigger-range-start': 'contain',
'animation-trigger-range-end': 'contain',
'animation-trigger-exit-range-start': 'cover',
'animation-trigger-exit-range-end': 'cover',
});
test_shorthand_value('animation-trigger',
'view() once contain 20% contain 80% cover 10% cover 90%',
{
'animation-trigger-type': 'once',
'animation-trigger-timeline': 'view()',
'animation-trigger-range-start': 'contain 20%',
'animation-trigger-range-end': 'contain 80%',
'animation-trigger-exit-range-start': 'cover 10%',
'animation-trigger-exit-range-end': 'cover 90%',
});
test_shorthand_value('animation-trigger',
'view() once contain 0% contain 100% cover 0%',
{
'animation-trigger-type': 'once',
'animation-trigger-timeline': 'view()',
'animation-trigger-range-start': 'contain',
'animation-trigger-range-end': 'contain',
'animation-trigger-exit-range-start': 'cover',
'animation-trigger-exit-range-end': 'cover',
});
test_shorthand_value('animation-trigger',
'view() once contain 20% contain 80% cover 10%',
{
'animation-trigger-type': 'once',
'animation-trigger-timeline': 'view()',
'animation-trigger-range-start': 'contain 20%',
'animation-trigger-range-end': 'contain 80%',
'animation-trigger-exit-range-start': 'cover 10%',
'animation-trigger-exit-range-end': 'cover',
});
test_shorthand_value('animation-trigger',
'view() once contain 0% contain 100% cover',
{
'animation-trigger-type': 'once',
'animation-trigger-timeline': 'view()',
'animation-trigger-range-start': 'contain',
'animation-trigger-range-end': 'contain',
'animation-trigger-exit-range-start': 'cover',
'animation-trigger-exit-range-end': 'cover',
});
test_shorthand_value('animation-trigger',
'view() alternate contain 0% contain 100%',
{
'animation-trigger-type': 'alternate',
'animation-trigger-timeline': 'view()',
'animation-trigger-range-start': 'contain',
'animation-trigger-range-end': 'contain',
'animation-trigger-exit-range-start': 'auto',
'animation-trigger-exit-range-end': 'auto',
});
test_shorthand_value('animation-trigger',
'view() alternate contain 20% contain 80%',
{
'animation-trigger-type': 'alternate',
'animation-trigger-timeline': 'view()',
'animation-trigger-range-start': 'contain 20%',
'animation-trigger-range-end': 'contain 80%',
'animation-trigger-exit-range-start': 'auto',
'animation-trigger-exit-range-end': 'auto',
});
test_shorthand_value('animation-trigger',
'view() alternate contain 0%',
{
'animation-trigger-type': 'alternate',
'animation-trigger-timeline': 'view()',
'animation-trigger-range-start': 'contain',
'animation-trigger-range-end': 'contain',
'animation-trigger-exit-range-start': 'auto',
'animation-trigger-exit-range-end': 'auto',
});
test_shorthand_value('animation-trigger',
'view() alternate contain 10%',
{
'animation-trigger-type': 'alternate',
'animation-trigger-timeline': 'view()',
'animation-trigger-range-start': 'contain 10%',
'animation-trigger-range-end': 'contain',
'animation-trigger-exit-range-start': 'auto',
'animation-trigger-exit-range-end': 'auto',
});
test_shorthand_value('animation-trigger',
'view() alternate contain',
{
'animation-trigger-type': 'alternate',
'animation-trigger-timeline': 'view()',
'animation-trigger-range-start': 'contain',
'animation-trigger-range-end': 'contain',
'animation-trigger-exit-range-start': 'auto',
'animation-trigger-exit-range-end': 'auto',
});
test_shorthand_value('animation-trigger', 'view() alternate',
{
'animation-trigger-type': 'alternate',
'animation-trigger-timeline': 'view()',
'animation-trigger-range-start': 'normal',
'animation-trigger-range-end': 'normal',
'animation-trigger-exit-range-start': 'auto',
'animation-trigger-exit-range-end': 'auto',
});
test_shorthand_value('animation-trigger', 'repeat',
{
'animation-trigger-type': 'repeat',
'animation-trigger-timeline': 'auto',
'animation-trigger-range-start': 'normal',
'animation-trigger-range-end': 'normal',
'animation-trigger-exit-range-start': 'auto',
'animation-trigger-exit-range-end': 'auto',
});
test_computed_value('animation-trigger',
'view() once contain 0% contain 100% cover 0% cover 100%',
'view() once contain contain cover cover');
test_computed_value('animation-trigger',
'view() once contain 20% contain 80% cover 10% cover 90%');
test_computed_value('animation-trigger',
'view() once contain 20% contain 80% cover 0%',
'view() once contain 20% contain 80% cover cover');
test_computed_value('animation-trigger',
'view() once contain 20% contain 80% cover 10%',
'view() once contain 20% contain 80% cover 10% cover');
test_computed_value('animation-trigger',
'view() once contain 0% contain 100%',
'view() once contain contain auto auto');
test_computed_value('animation-trigger',
'view() once',
'view() once normal normal auto auto');
</script>
|