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

Side by Side Diff: third_party/WebKit/LayoutTests/animations/custom-properties/registered-inheritance.html

Issue 2630503002: Add code path for registered custom properties in CSSInterpolationType (Closed)
Patch Set: Moar buttons Created 3 years, 11 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/registered-neutral-keyframe.html » ('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 <script src="../../resources/testharness.js"></script>
3 <script src="../../resources/testharnessreport.js"></script>
4 <style>
5 @keyframes test {
6 from {
7 --inherited: from;
8 --non-inherited: from;
9 }
10 to {
11 --inherited: to;
12 --non-inherited: to;
13 }
14 }
15 #container {
16 animation: test 1s;
17 }
18 </style>
19 <div id="container">
20 <div id="child"></div>
21 </div>
22 <script>
23 CSS.registerProperty({
24 name: '--inherited',
25 syntax: '*',
26 initialValue: 'initialValue',
27 inherits: true,
28 });
29 CSS.registerProperty({
30 name: '--non-inherited',
31 syntax: '*',
32 initialValue: 'initialValue',
33 inherits: false,
34 });
35
36 function read(element, property) {
37 return getComputedStyle(element).getPropertyValue(property);
38 }
39
40 test(() => {
41 container.style.animationDelay = '-0.25s';
42 assert_equals(read(container, '--inherited'), ' from', 'container at 25%');
43 assert_equals(read(child, '--inherited'), ' from', 'child at 25%');
44
45 container.style.animationDelay = '-0.75s';
46 assert_equals(read(container, '--inherited'), ' to', 'container at 75%');
47 assert_equals(read(child, '--inherited'), ' to', 'child at 75%');
48 }, 'CSS Animations on registered inherited custom properties should get inherite d');
49
50 test(() => {
51 container.style.animationDelay = '-0.25s';
52 assert_equals(read(container, '--non-inherited'), ' from', 'container at 25%') ;
53 assert_equals(read(child, '--non-inherited'), 'initialValue', 'child at 25%');
54
55 container.style.animationDelay = '-0.75s';
56 assert_equals(read(container, '--non-inherited'), ' to', 'container at 75%');
57 assert_equals(read(child, '--non-inherited'), 'initialValue', 'child at 75%');
58 }, 'CSS Animations on registered non-inherited custom properties should not get inherited');
59 </script>
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/animations/custom-properties/registered-neutral-keyframe.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698