|
25 | 25 | CSS.registerProperty({name: '--registered-1-d', syntax: '<length>', initialValue: '4px', inherits: false});
|
26 | 26 |
|
27 | 27 | computedStyle = getComputedStyle(test1);
|
28 |
| - assert_equals(computedStyle.getPropertyValue('--registered-1-a'), ''); |
29 |
| - assert_equals(computedStyle.getPropertyValue('--registered-1-b'), ''); |
30 |
| - assert_equals(computedStyle.getPropertyValue('--registered-1-c'), '30px'); |
31 |
| - assert_equals(computedStyle.getPropertyValue('--registered-1-d'), '4px'); |
32 |
| - assert_equals(computedStyle.getPropertyValue('--unregistered-1-a'), ''); |
33 |
| - assert_equals(computedStyle.left, '50px'); |
34 |
| - assert_equals(computedStyle.top, '60px'); |
| 28 | + assert_equals(computedStyle.getPropertyValue('--registered-1-a'), '1px'); |
| 29 | + assert_equals(computedStyle.getPropertyValue('--registered-1-b'), '2px'); |
| 30 | + assert_equals(computedStyle.getPropertyValue('--registered-1-c'), '2px'); |
| 31 | + assert_equals(computedStyle.getPropertyValue('--registered-1-d'), '2px'); |
| 32 | + assert_equals(computedStyle.getPropertyValue('--unregistered-1-a'), '1px'); |
| 33 | + assert_equals(computedStyle.left, '1px'); |
| 34 | + assert_equals(computedStyle.top, '2px'); |
35 | 35 | }, "A var() cycle between two registered properties is handled correctly.");
|
36 | 36 | </script>
|
37 | 37 |
|
|
62 | 62 | CSS.registerProperty({name: '--registered-2-e', syntax: '<length>', initialValue: '5px', inherits: false});
|
63 | 63 |
|
64 | 64 | computedStyle = getComputedStyle(test2);
|
65 |
| - assert_equals(computedStyle.getPropertyValue('--registered-2-a'), ''); |
| 65 | + assert_equals(computedStyle.getPropertyValue('--registered-2-a'), '1px'); |
66 | 66 | assert_equals(computedStyle.getPropertyValue('--unregistered-2-a'), '');
|
67 | 67 |
|
68 |
| - assert_equals(computedStyle.getPropertyValue('--registered-2-b'), '30px'); |
69 |
| - assert_equals(computedStyle.getPropertyValue('--registered-2-c'), '3px'); |
| 68 | + assert_equals(computedStyle.getPropertyValue('--registered-2-b'), '1px'); |
| 69 | + assert_equals(computedStyle.getPropertyValue('--registered-2-c'), '1px'); |
70 | 70 | assert_equals(computedStyle.getPropertyValue('--registered-2-d'), '40px');
|
71 | 71 | assert_equals(computedStyle.getPropertyValue('--registered-2-e'), '5px');
|
72 |
| - assert_equals(computedStyle.getPropertyValue('--unregistered-2-b'), '50px'); |
73 |
| - assert_equals(computedStyle.getPropertyValue('--unregistered-2-c'), ''); |
| 72 | + assert_equals(computedStyle.getPropertyValue('--unregistered-2-b'), '1px'); |
| 73 | + assert_equals(computedStyle.getPropertyValue('--unregistered-2-c'), '1px'); |
74 | 74 | assert_equals(computedStyle.getPropertyValue('--unregistered-2-d'), '60px');
|
75 | 75 | assert_equals(computedStyle.getPropertyValue('--unregistered-2-e'), '');
|
76 |
| - assert_equals(computedStyle.left, '70px'); |
| 76 | + assert_equals(computedStyle.left, '1px'); |
77 | 77 | assert_equals(computedStyle.top, '80px');
|
78 | 78 | }, "A var() cycle between a registered properties and an unregistered property is handled correctly.");
|
79 | 79 | </script>
|
|
136 | 136 | assert_equals(computedStyle.getPropertyValue('--unregistered-4-a'), '');
|
137 | 137 |
|
138 | 138 | assert_equals(computedStyle.getPropertyValue('--registered-4-b'), 'meow');
|
139 |
| - assert_equals(computedStyle.getPropertyValue('--registered-4-c'), 'circle'); |
| 139 | + assert_equals(computedStyle.getPropertyValue('--registered-4-c'), ''); |
140 | 140 | assert_equals(computedStyle.getPropertyValue('--unregistered-4-b'), 'woof');
|
141 | 141 | assert_equals(computedStyle.getPropertyValue('--unregistered-4-c'), '');
|
142 | 142 | assert_equals(computedStyle.transitionProperty, 'water');
|
|
174 | 174 | let computedStyle = getComputedStyle(test5);
|
175 | 175 | assert_equals(computedStyle.getPropertyValue('--registered-5-a'), '');
|
176 | 176 | assert_equals(computedStyle.getPropertyValue('--registered-5-b'), '');
|
177 |
| - assert_equals(computedStyle.getPropertyValue('--registered-5-c'), 'foo'); |
178 |
| - assert_equals(computedStyle.getPropertyValue('--registered-5-d'), 'bar'); |
179 |
| - assert_equals(computedStyle.getPropertyValue('--registered-5-e'), 'baz'); |
| 177 | + assert_equals(computedStyle.getPropertyValue('--registered-5-c'), ''); |
| 178 | + assert_equals(computedStyle.getPropertyValue('--registered-5-d'), ''); |
| 179 | + assert_equals(computedStyle.getPropertyValue('--registered-5-e'), ''); |
180 | 180 | assert_equals(computedStyle.getPropertyValue('color'), 'rgb(0, 128, 0)');
|
181 |
| -}, "Invalid at computed-value time triggers 'unset' behavior"); |
| 181 | +}, "Custom properties with universal syntax become guaranteed-invalid when " + |
| 182 | + "invalid at computed-value time"); |
182 | 183 | </script>
|
0 commit comments