summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/css/css-transitions/all-with-discrete.tentative.html
blob: 37946717b4c1df8d523cfcae8498a87975f9c30b (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
<!DOCTYPE html>
<link rel=author href="mailto:jarhar@chromium.org">
<link rel=help href="https://github.com/w3c/csswg-drafts/issues/4441">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="/css/css-animations/support/testcommon.js"></script>

<div class=testcase id=discrete>Allow discrete</div>
<div class=testcase id=normal>No discrete</div>

<style>
.testcase {
  float: left;
  width: 100px;
  height: 100px;
  transition: all 1s;
}
#discrete {
  transition-behavior: allow-discrete;
}
.animated {
  float: right;
}
</style>

<script>
promise_test(async () => {
  await waitForAnimationFrames(2);
  // Regression test for https://crbug.com/1518561
  normal.classList.add('animated');
  const normalAnims = normal.getAnimations();
  assert_equals(normalAnims.length, 0,
                "Started a discrete property transition on a normal element");

  discrete.classList.add('animated');
  const anims = discrete.getAnimations();
  assert_equals(anims.length, 1,
                "Did not start a discrete-property transition");
  assert_equals(anims[0].transitionProperty, 'float');
}, 'transition:all with transition-behavior:allow-discrete should animate discrete properties.');
</script>