summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/scroll-animations/css/view-timeline-attachment-computed-tentative.html
blob: dd244e137bb28d8b1d577d6f474ad49ab5c12519 (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
<!DOCTYPE html>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="/css/support/computed-testcommon.js"></script>
<style>
  #outer { view-timeline-attachment: defer; }
  #target { view-timeline-attachment: ancestor; }
</style>
<div id="outer">
  <div id="target"></div>
</div>
<script>
test_computed_value('view-timeline-attachment', 'initial', 'local');
test_computed_value('view-timeline-attachment', 'inherit', 'defer');
test_computed_value('view-timeline-attachment', 'unset', 'local');
test_computed_value('view-timeline-attachment', 'revert', 'local');
test_computed_value('view-timeline-attachment', 'local');
test_computed_value('view-timeline-attachment', 'defer');
test_computed_value('view-timeline-attachment', 'ancestor');
test_computed_value('view-timeline-attachment', 'local, defer');
test_computed_value('view-timeline-attachment', 'defer, ancestor');
test_computed_value('view-timeline-attachment', 'local, defer, ancestor');
test_computed_value('view-timeline-attachment', 'local, local, local, local');

test(() => {
  let style = getComputedStyle(document.getElementById('target'));
  assert_not_equals(Array.from(style).indexOf('view-timeline-attachment'), -1);
}, 'The view-timeline-attachment property shows up in CSSStyleDeclaration enumeration');

test(() => {
  let style = document.getElementById('target').style;
  assert_not_equals(style.cssText.indexOf('view-timeline-attachment'), -1);
}, 'The view-timeline-attachment property shows up in CSSStyleDeclaration.cssText');

</script>