| <!DOCTYPE html> |
| <title>Tests basics of the 'anchor-scroll' property</title> |
| <link rel="help" href="https://drafts.csswg.org/css-anchor-1/#propdef-anchor-scroll"> |
| <link rel="author" href="mailto:xiaochengh@chromium.org"> |
| <script src="/resources/testharness.js"></script> |
| <script src="/resources/testharnessreport.js"></script> |
| <script src="/css/support/parsing-testcommon.js"></script> |
| <script src="/css/support/computed-testcommon.js"></script> |
| <script src="/css/support/inheritance-testcommon.js"></script> |
| <script src="/css/support/interpolation-testcommon.js"></script> |
| |
| <div id="container"> |
| <div id="target"></div> |
| </div> |
| |
| <script> |
| // anchor-scroll: none | default | <anchor-element> |
| test_valid_value('anchor-scroll', 'none'); |
| test_valid_value('anchor-scroll', 'default'); |
| test_valid_value('anchor-scroll', 'implicit'); |
| test_valid_value('anchor-scroll', '--foo'); |
| test_invalid_value('anchor-scroll', 'foo-bar'); |
| test_invalid_value('anchor-scroll', '--foo --bar') |
| test_invalid_value('anchor-scroll', '--foo, --bar') |
| test_invalid_value('anchor-scroll', '100px'); |
| test_invalid_value('anchor-scroll', '100%'); |
| |
| // Computed value: as specified |
| test_computed_value('anchor-scroll', 'none'); |
| test_computed_value('anchor-scroll', 'default'); |
| test_computed_value('anchor-scroll', 'implicit'); |
| test_computed_value('anchor-scroll', '--foo'); |
| |
| // Initial: default |
| // Inherited: no |
| assert_not_inherited('anchor-scroll', 'default', '--foo'); |
| |
| // Animation type: discrete |
| test_no_interpolation({ |
| property: 'anchor-scroll', |
| from: '--foo', |
| to: 'none', |
| }); |
| </script> |