summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/css/css-anchor-position/anchor-scroll-basics.html
blob: 6b2d96708bd44808f0cb7ce10a1b52e708e09eba (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
<!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>