Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(5)

Side by Side Diff: third_party/WebKit/LayoutTests/animations/custom-properties/color-type-interpolation.html

Issue 2564793002: Add smooth interpolation support for <color> custom properties (Closed)
Patch Set: Rebase Created 3 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/animations/custom-properties/color-type-interpolation-expected.txt » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 <!DOCTYPE html>
2 <meta charset="UTF-8">
3 <style>
4 .parent {
5 --color: blue;
6 }
7 .target {
8 --color: yellow;
9 color: lime;
10 }
11 </style>
12 <body alink="red" link="blue">
13 <script src="../interpolation/resources/interpolation-test.js"></script>
14 <script>
15 CSS.registerProperty({
16 name: '--color',
17 syntax: '<color>',
18 initialValue: 'black',
19 });
20
21 assertInterpolation({
22 property: '--color',
23 from: neutralKeyframe,
24 to: 'green',
25 }, [
26 {at: -0.3, is: 'rgb(255, 255, 0)'},
27 {at: 0, is: 'rgb(255, 255, 0)'},
28 {at: 0.3, is: 'rgb(179, 217, 0)'},
29 {at: 0.6, is: 'rgb(102, 179, 0)'},
30 {at: 1, is: 'rgb(0, 128, 0)'},
31 {at: 1.5, is: 'rgb(0, 65, 0)'},
32 ]);
33
34 assertInterpolation({
35 property: '--color',
36 from: 'initial',
37 to: 'green',
38 }, [
39 {at: -0.3, is: 'rgb(0, 0, 0)'},
40 {at: 0, is: 'rgb(0, 0, 0)'},
41 {at: 0.3, is: 'rgb(0, 38, 0)'},
42 {at: 0.6, is: 'rgb(0, 77, 0)'},
43 {at: 1, is: 'rgb(0, 128, 0)'},
44 {at: 1.5, is: 'rgb(0, 192, 0)'},
45 ]);
46
47 assertInterpolation({
48 property: '--color',
49 from: 'inherit',
50 to: 'green',
51 }, [
52 {at: -0.3, is: 'rgb(0, 0, 255)'},
53 {at: 0, is: 'rgb(0, 0, 255)'},
54 {at: 0.3, is: 'rgb(0, 38, 179)'},
55 {at: 0.6, is: 'rgb(0, 77, 102)'},
56 {at: 1, is: 'rgb(0, 128, 0)'},
57 {at: 1.5, is: 'rgb(0, 192, 0)'},
58 ]);
59
60 assertInterpolation({
61 property: '--color',
62 from: 'unset',
63 to: 'green',
64 }, [
65 {at: -0.3, is: 'rgb(0, 0, 0)'},
66 {at: 0, is: 'rgb(0, 0, 0)'},
67 {at: 0.3, is: 'rgb(0, 38, 0)'},
68 {at: 0.6, is: 'rgb(0, 77, 0)'},
69 {at: 1, is: 'rgb(0, 128, 0)'},
70 {at: 1.5, is: 'rgb(0, 192, 0)'},
71 ]);
72
73 assertInterpolation({
74 property: '--color',
75 from: 'black',
76 to: 'orange',
77 }, [
78 {at: -0.3, is: 'rgb(0, 0, 0)'},
79 {at: 0, is: 'rgb(0, 0, 0)'},
80 {at: 0.3, is: 'rgb(77, 50, 0)'},
81 {at: 0.6, is: 'rgb(153, 99, 0)'},
82 {at: 1, is: 'rgb(255, 165, 0)'},
83 {at: 1.5, is: 'rgb(255, 248, 0)'},
84 ]);
85
86 assertInterpolation({
87 property: '--color',
88 from: 'black',
89 to: 'currentcolor',
90 }, [
91 {at: -0.3, is: 'rgb(0, 0, 0)'},
92 {at: 0, is: 'rgb(0, 0, 0)'},
93 {at: 0.3, is: 'rgb(0, 77, 0)'},
94 {at: 0.6, is: 'rgb(0, 153, 0)'},
95 {at: 1, is: 'rgb(0, 255, 0)'},
96 {at: 1.5, is: 'rgb(0, 255, 0)'},
97 ]);
98
99 assertInterpolation({
100 property: '--color',
101 from: '-webkit-activelink',
102 to: 'green',
103 }, [
104 {at: -0.3, is: 'rgb(255, 0, 0)'},
105 {at: 0, is: 'rgb(255, 0, 0)'},
106 {at: 0.3, is: 'rgb(179, 38, 0)'},
107 {at: 0.6, is: 'rgb(102, 77, 0)'},
108 {at: 1, is: 'rgb(0, 128, 0)'},
109 {at: 1.5, is: 'rgb(0, 192, 0)'},
110 ]);
111
112 assertInterpolation({
113 property: '--color',
114 from: '-webkit-link',
115 to: 'green',
116 }, [
117 {at: -0.3, is: 'rgb(0, 0, 255)'},
118 {at: 0, is: 'rgb(0, 0, 255)'},
119 {at: 0.3, is: 'rgb(0, 38, 179)'},
120 {at: 0.6, is: 'rgb(0, 77, 102)'},
121 {at: 1, is: 'rgb(0, 128, 0)'},
122 {at: 1.5, is: 'rgb(0, 192, 0)'},
123 ]);
124 </script>
125 </body>
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/animations/custom-properties/color-type-interpolation-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698