| <!DOCTYPE html> |
| <meta charset="UTF-8"> |
| <style> |
| .parent { |
| border-width: 30px; |
| } |
| .target { |
| width: 50px; |
| height: 50px; |
| background-color: black; |
| display: inline-block; |
| border: 2px solid orange; |
| margin: 18px; |
| border-width: 10px; |
| } |
| .expected { |
| background-color: green; |
| } |
| </style> |
| <body> |
| <script src="resources/interpolation-test.js"></script> |
| <script> |
| assertInterpolation({ |
| property: 'border-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'}, |
| ]); |
| |
| assertInterpolation({ |
| property: 'border-width', |
| from: 'initial', |
| to: '20px', |
| }, [ |
| {at: -0.3, is: '0px'}, |
| {at: 0, is: '3px'}, |
| {at: 0.3, is: '8px'}, |
| {at: 0.6, is: '13px'}, |
| {at: 1, is: '20px'}, |
| {at: 1.5, is: '28px'}, |
| ]); |
| |
| assertInterpolation({ |
| property: 'border-width', |
| from: 'inherit', |
| to: '20px', |
| }, [ |
| {at: -0.3, is: '0px'}, |
| {at: 0, is: '0px'}, |
| {at: 0.3, is: '6px'}, |
| {at: 0.6, is: '12px'}, |
| {at: 1, is: '20px'}, |
| {at: 1.5, is: '30px'}, |
| ]); |
| |
| assertInterpolation({ |
| property: 'border-width', |
| from: 'unset', |
| to: '20px', |
| }, [ |
| {at: -0.3, is: '0px'}, |
| {at: 0, is: '3px'}, |
| {at: 0.3, is: '8px'}, |
| {at: 0.6, is: '13px'}, |
| {at: 1, is: '20px'}, |
| {at: 1.5, is: '28px'}, |
| ]); |
| |
| assertInterpolation({ |
| property: 'border-width', |
| from: '0px', |
| to: '10px' |
| }, [ |
| {at: -0.3, is: '0px'}, // CSS border-width can't be negative. |
| {at: 0, is: '0px'}, |
| {at: 0.3, is: '3px'}, |
| {at: 0.6, is: '6px'}, |
| {at: 1, is: '10px'}, |
| {at: 1.5, is: '15px'} |
| ]); |
| |
| assertInterpolation({ |
| property: 'border-bottom-width', |
| from: 'thick', |
| to: '15px' |
| }, [ |
| {at: -2, is: '0px'}, // CSS border-bottom-width can't be negative. |
| {at: -0.3, is: '2px'}, |
| {at: 0, is: '5px'}, |
| {at: 0.3, is: '8px'}, |
| {at: 0.6, is: '11px'}, |
| {at: 1, is: '15px'}, |
| {at: 1.5, is: '20px'} |
| ]); |
| |
| assertInterpolation({ |
| property: 'border-left-width', |
| from: 'medium', |
| to: '13px' |
| }, [ |
| {at: -2, is: '0px'}, // CSS border-left-width can't be negative. |
| {at: -0.25, is: '1px'}, |
| {at: 0, is: '3px'}, |
| {at: 0.3, is: '6px'}, |
| {at: 0.6, is: '9px'}, |
| {at: 1, is: '13px'}, |
| {at: 1.5, is: '18px'} |
| ]); |
| |
| assertInterpolation({ |
| property: 'border-right-width', |
| from: 'thin', |
| to: '11px' |
| }, [ |
| {at: -2, is: '0px'}, // CSS border-right-width can't be negative. |
| {at: -0.3, is: '0px'}, // CSS border-right-width can't be negative. |
| {at: 0, is: '1px'}, |
| {at: 0.3, is: '4px'}, |
| {at: 0.6, is: '7px'}, |
| {at: 1, is: '11px'}, |
| {at: 1.5, is: '16px'} |
| ]); |
| |
| assertInterpolation({ |
| property: 'border-top-width', |
| from: '15px', |
| to: 'thick' |
| }, [ |
| {at: -2, is: '35px'}, |
| {at: -0.3, is: '18px'}, |
| {at: 0, is: '15px'}, |
| {at: 0.3, is: '12px'}, |
| {at: 0.6, is: '9px'}, |
| {at: 1, is: '5px'}, |
| {at: 1.5, is: '0px'} |
| ]); |
| </script> |
| </body> |