| <!DOCTYPE html> |
| <meta charset="UTF-8"> |
| <title>font-size-adjust interpolation</title> |
| <link rel="help" href="https://drafts.csswg.org/css-fonts-3/#propdef-font-size-adjust"> |
| <meta name="assert" content="font-size-adjust supports animation as a number"> |
| |
| <script src="/resources/testharness.js"></script> |
| <script src="/resources/testharnessreport.js"></script> |
| <script src="/css/support/interpolation-testcommon.js"></script> |
| |
| <style type="text/css"> |
| .container { |
| font-size: 20px; |
| line-height: 1; |
| } |
| |
| .parent { |
| font-size-adjust: 3; |
| } |
| |
| .target { |
| display: inline-block; |
| font-size-adjust: 1; |
| } |
| |
| .expected { |
| color: green; |
| margin-right: 30px; |
| } |
| </style> |
| |
| <body> |
| <template id="target-template"> |
| <span class="container"> |
| <div class="target">x</span> |
| </div> |
| </template> |
| </body> |
| |
| <script> |
| test_interpolation({ |
| property: 'font-size-adjust', |
| from: neutralKeyframe, |
| to: '2', |
| }, [ |
| {at: -2, expect: '0'}, |
| {at: -0.3, expect: '0.7'}, |
| {at: 0, expect: '1'}, |
| {at: 0.3, expect: '1.3'}, |
| {at: 0.6, expect: '1.6'}, |
| {at: 1, expect: '2'}, |
| {at: 1.5, expect: '2.5'}, |
| ]); |
| |
| test_no_interpolation({ |
| property: 'font-size-adjust', |
| from: 'initial', |
| to: '2', |
| }); |
| |
| test_interpolation({ |
| property: 'font-size-adjust', |
| from: 'inherit', |
| to: '2', |
| }, [ |
| {at: -2, expect: '5'}, |
| {at: -0.3, expect: '3.3'}, |
| {at: 0, expect: '3'}, |
| {at: 0.3, expect: '2.7'}, |
| {at: 0.6, expect: '2.4'}, |
| {at: 1, expect: '2'}, |
| {at: 1.5, expect: '1.5'}, |
| ]); |
| |
| test_interpolation({ |
| property: 'font-size-adjust', |
| from: 'unset', |
| to: '2', |
| }, [ |
| {at: -2, expect: '5'}, |
| {at: -0.3, expect: '3.3'}, |
| {at: 0, expect: '3'}, |
| {at: 0.3, expect: '2.7'}, |
| {at: 0.6, expect: '2.4'}, |
| {at: 1, expect: '2'}, |
| {at: 1.5, expect: '1.5'}, |
| ]); |
| |
| |
| test_interpolation({ |
| property: 'font-size-adjust', |
| from: '0', |
| to: '1.2' |
| }, [ |
| {at: -2, expect: '0'}, |
| {at: -0.3, expect: '0'}, |
| {at: 0, expect: '0'}, |
| {at: 0.3, expect: '0.36'}, |
| {at: 0.6, expect: '0.72'}, |
| {at: 1, expect: '1.2'}, |
| {at: 1.5, expect: '1.8'}, |
| ]); |
| |
| test_no_interpolation({ |
| property: 'font-size-adjust', |
| from: 'none', |
| to: '1.2' |
| }); |
| |
| test_interpolation({ |
| property: 'font-size-adjust', |
| from: '0.2', |
| to: '1.2' |
| }, [ |
| {at: -2, expect: '0'}, // CSS font-size-adjust can't be negative. |
| {at: -0.3, expect: '0'}, |
| {at: 0, expect: '0.2'}, |
| {at: 0.3, expect: '0.5'}, |
| {at: 0.6, expect: '0.8'}, |
| {at: 1, expect: '1.2'}, |
| {at: 1.5, expect: '1.7'}, |
| ]); |
| </script> |