|
| 1 | +<!DOCTYPE html> |
| 2 | +<html> |
| 3 | +<head> |
| 4 | + <meta charset="UTF-8"> |
| 5 | + <title>rule-color interpolation with repeaters</title> |
| 6 | + <link rel=" author" title=" Javier Contreras" href=" mailto:[email protected]" > |
| 7 | + <link rel="help" href="https://drafts.csswg.org/css-gaps-1/#column-row-rule-color"> |
| 8 | + <script src="/resources/testharness.js"></script> |
| 9 | + <script src="/resources/testharnessreport.js"></script> |
| 10 | + <script src="/css/support/interpolation-testcommon.js"></script> |
| 11 | + <style> |
| 12 | + .parent { |
| 13 | + row-rule-style: solid; |
| 14 | + row-rule-color: white; |
| 15 | + } |
| 16 | + |
| 17 | + .target { |
| 18 | + row-gap: 40px; |
| 19 | + column-gap: 40px; |
| 20 | + row-rule-width: 10px; |
| 21 | + row-rule-style: solid; |
| 22 | + row-rule-color: black repeat(2, red blue) black; |
| 23 | + flex-wrap: wrap; |
| 24 | + column-rule-width: 10px; |
| 25 | + column-rule-style: solid; |
| 26 | + column-rule-color: repeat(2, black red); |
| 27 | + } |
| 28 | + </style> |
| 29 | +</head> |
| 30 | +<body> |
| 31 | + <script> |
| 32 | + // Valid Interpolations: |
| 33 | + test_interpolation({ |
| 34 | + property: 'row-rule-color', |
| 35 | + from: neutralKeyframe, |
| 36 | + to: 'red repeat(2, black black) blue', |
| 37 | + }, [ |
| 38 | + { at: -0.3, expect: 'black repeat(2, red blue) black' }, |
| 39 | + { at: 0, expect: 'black repeat(2, red blue) black' }, |
| 40 | + { at: 0.3, expect: 'rgb(77, 0, 0) repeat(2, rgb(179, 0, 0) rgb(0, 0, 179)) rgb(0, 0, 77)' }, |
| 41 | + { at: 0.6, expect: 'rgb(153, 0, 0) repeat(2, rgb(102, 0, 0) rgb(0, 0, 102)) rgb(0, 0, 153)' }, |
| 42 | + { at: 1, expect: 'rgb(255, 0, 0) repeat(2, rgb(0, 0, 0) rgb(0, 0, 0)) rgb(0, 0, 255)' }, |
| 43 | + { at: 1.5, expect: 'rgb(255, 0, 0) repeat(2, rgb(0, 0, 0) rgb(0, 0, 0)) rgb(0, 0, 255)' }, |
| 44 | + ]); |
| 45 | + test_interpolation({ |
| 46 | + property: 'column-rule-color', |
| 47 | + from: neutralKeyframe, |
| 48 | + to: 'repeat(2, red black)', |
| 49 | + }, [ |
| 50 | + { at: -0.3, expect: 'repeat(2, black red)' }, |
| 51 | + { at: 0, expect: 'repeat(2, black red)' }, |
| 52 | + { at: 0.3, expect: 'repeat(2, rgb(77, 0, 0) rgb(179, 0, 0))' }, |
| 53 | + { at: 0.6, expect: 'repeat(2, rgb(153, 0, 0) rgb(102, 0, 0))' }, |
| 54 | + { at: 1, expect: 'repeat(2, red black)' }, |
| 55 | + { at: 1.5, expect: 'repeat(2, red black)' }, |
| 56 | + ]); |
| 57 | + test_interpolation({ |
| 58 | + property: 'column-rule-color', |
| 59 | + from: 'repeat(auto, black black)', |
| 60 | + to: 'repeat(auto, blue red)', |
| 61 | + }, [ |
| 62 | + { at: -0.3, expect: 'repeat(auto, black black)' }, |
| 63 | + { at: 0, expect: 'repeat(auto, black black)' }, |
| 64 | + { at: 0.3, expect: 'repeat(auto, rgb(0, 0, 77) rgb(77, 0, 0))' }, |
| 65 | + { at: 0.6, expect: 'repeat(auto, rgb(0, 0, 153) rgb(153, 0, 0))' }, |
| 66 | + { at: 1, expect: 'repeat(auto, rgb(0, 0, 255) rgb(255, 0, 0))' }, |
| 67 | + { at: 1.5, expect: 'repeat(auto, rgb(0, 0, 255) rgb(255, 0, 0)' }, |
| 68 | + ]); |
| 69 | + |
| 70 | + // // Shouldn't interpolate, length of the list is different: |
| 71 | + test_no_interpolation({ |
| 72 | + property: 'row-rule-color', |
| 73 | + from: neutralKeyframe, |
| 74 | + to: 'repeat(2, blue blue) white', |
| 75 | + }); |
| 76 | + test_no_interpolation({ |
| 77 | + property: 'row-rule-color', |
| 78 | + from: neutralKeyframe, |
| 79 | + to: 'repeat(2, red red) repeat(2, blue blue)', |
| 80 | + }); |
| 81 | + |
| 82 | + // // Shouldn't interpolate, repeaters are not compatible: |
| 83 | + test_no_interpolation({ |
| 84 | + property: 'column-rule-color', |
| 85 | + from: neutralKeyframe, |
| 86 | + to: 'repeat(3, white white)', |
| 87 | + }); |
| 88 | + test_no_interpolation({ |
| 89 | + property: 'column-rule-color', |
| 90 | + from: neutralKeyframe, |
| 91 | + to: 'repeat(2, yellow orange green)', |
| 92 | + }); |
| 93 | + test_no_interpolation({ |
| 94 | + property: 'row-rule-color', |
| 95 | + from: neutralKeyframe, |
| 96 | + to: 'black repeat(3, red white) blue', |
| 97 | + }); |
| 98 | + test_no_interpolation({ |
| 99 | + property: 'row-rule-color', |
| 100 | + from: neutralKeyframe, |
| 101 | + to: 'white repeat(2, blue blue blue) yellow', |
| 102 | + }); |
| 103 | + test_no_interpolation({ |
| 104 | + property: 'column-rule-color', |
| 105 | + from: 'repeat(auto, red black)', |
| 106 | + to: 'repeat(3, black red)', |
| 107 | + }); |
| 108 | + test_no_interpolation({ |
| 109 | + property: 'column-rule-color', |
| 110 | + from: 'repeat(auto, black black)', |
| 111 | + to: 'repeat(auto, red white yellow)', |
| 112 | + }); |
| 113 | + |
| 114 | + // // Shouldn't interpolate, repeater and a color are not compatible: |
| 115 | + test_no_interpolation({ |
| 116 | + property: 'column-rule-color', |
| 117 | + from: neutralKeyframe, |
| 118 | + to: 'white', |
| 119 | + }); |
| 120 | + </script> |
| 121 | +</body> |
0 commit comments