| <!DOCTYPE html> |
| <meta charset="UTF-8"> |
| <style> |
| .parent { |
| -webkit-mask-box-image-width: 30px; |
| } |
| .target { |
| width: 100px; |
| height: 100px; |
| background-color: black; |
| display: inline-block; |
| -webkit-mask-box-image-source: linear-gradient(45deg, rgba(0, 0, 0, 0), rgba(0, 0, 0, 1)); |
| -webkit-mask-box-image-width: 10px; |
| } |
| .expected { |
| background-color: green; |
| margin-right: 2px; |
| } |
| </style> |
| <body> |
| <script src="resources/interpolation-test.js"></script> |
| <script> |
| assertInterpolation({ |
| property: '-webkit-mask-box-image-width', |
| from: neutralKeyframe, |
| to: '20px', |
| }, [ |
| {at: -0.3, is: '7px'}, |
| {at: 0, is: '10px'}, |
| {at: 0.3, is: '13px'}, |
| {at: 0.6, is: '16px'}, |
| {at: 1, is: '20px'}, |
| {at: 1.5, is: '25px'}, |
| {at: 5, is: '60px'}, |
| {at: 10, is: '110px'}, |
| ]); |
| |
| assertNoInterpolation({ |
| property: '-webkit-mask-box-image-width', |
| from: 'initial', |
| to: '20px', |
| }); |
| |
| assertInterpolation({ |
| property: '-webkit-mask-box-image-width', |
| from: 'inherit', |
| to: '20px', |
| }, [ |
| {at: -0.3, is: '33px'}, |
| {at: 0, is: '30px'}, |
| {at: 0.3, is: '27px'}, |
| {at: 0.6, is: '24px'}, |
| {at: 1, is: '20px'}, |
| {at: 1.5, is: '15px'}, |
| {at: 5, is: '0px'}, |
| {at: 10, is: '0px'}, |
| ]); |
| |
| assertNoInterpolation({ |
| property: '-webkit-mask-box-image-width', |
| from: 'unset', |
| to: '20px', |
| }); |
| |
| assertInterpolation({ |
| property: '-webkit-mask-box-image-width', |
| from: '0px', |
| to: '20px' |
| }, [ |
| {at: -0.3, is: '0px'}, // CSS -webkit-mask-box-image-width can't be negative. |
| {at: 0, is: '0px'}, |
| {at: 0.3, is: '6px'}, |
| {at: 0.6, is: '12px'}, |
| {at: 1, is: '20px'}, |
| {at: 1.5, is: '30px'}, |
| {at: 5, is: '100px'}, |
| {at: 10, is: '200px'} |
| ]); |
| assertInterpolation({ |
| property: '-webkit-mask-box-image-width', |
| from: '0', |
| to: '20' |
| }, [ |
| {at: -0.3, is: '0'}, // CSS -webkit-mask-box-image-width can't be negative. |
| {at: 0, is: '0'}, |
| {at: 0.3, is: '6'}, |
| {at: 0.6, is: '12'}, |
| {at: 1, is: '20'}, |
| {at: 1.5, is: '30'}, |
| {at: 5, is: '100'}, |
| {at: 10, is: '200'} |
| ]); |
| </script> |
| </body> |