summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/css/css-ui/animation/caret-color-composition.html
blob: 6c69578677896e2463331deba85731e13fd94a25 (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
45
46
47
48
49
50
51
52
53
<!DOCTYPE html>
<meta charset="UTF-8">
<title>caret-color composition</title>
<link rel="help" href="https://drafts.csswg.org/css-ui-3/#propdef-caret-color">
<meta name="assert" content="caret-color supports animation by computed value">

<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="/css/support/interpolation-testcommon.js"></script>

<body>
<style>
.target {
  display: inline-block;
  font-size: 60pt;
  color: rgb(50, 50, 50);
}

.expected {
  margin-right: 15px;
}
</style>
<body contenteditable>
<template id="target-template">T</template>
<script src="../interpolation/resources/interpolation-test.js"></script>
<script>
test_composition({
  property: 'caret-color',
  underlying: 'rgb(50, 50, 50)',
  addFrom: 'rgb(100, 100, 100)',
  addTo: 'rgb(200, 200, 200)',
}, [
  {at: -0.3, expect: 'rgb(120, 120, 120)'},
  {at: 0, expect: 'rgb(150, 150, 150)'},
  {at: 0.5, expect: 'rgb(200, 200, 200)'},
  {at: 1, expect: 'rgb(250, 250, 250)'},
  {at: 1.5, expect: 'rgb(255, 255, 255)'},
]);

test_composition({
  property: 'caret-color',
  underlying: 'auto',
  addFrom: 'rgb(100, 100, 100)',
  addTo: 'rgb(200, 200, 200)',
}, [
  {at: -0.3, expect: 'rgb(70, 70, 70)'},
  {at: 0, expect: 'rgb(100, 100, 100)'},
  {at: 0.5, expect: 'rgb(150, 150, 150)'},
  {at: 1, expect: 'rgb(200, 200, 200)'},
  {at: 1.5, expect: 'rgb(250, 250, 250)'},
]);
</script>
</body>