|
144 | 144 | assert_percents_equal(
|
145 | 145 | anim.currentTime, 100/6,
|
146 | 146 | 'animation\'s current time after bumping scroll position');
|
147 |
| - assert_equals(getComputedStyle(target).marginLeft, '50px'); |
| 147 | + assert_approx_equals(parseFloat(getComputedStyle(target).marginLeft), 50, 0.125); |
148 | 148 |
|
149 | 149 | // Step 3: Try to update the range start via CSS. This change must be
|
150 | 150 | // ignored since previously set programmatically.
|
|
154 | 154 | assert_percents_equal(
|
155 | 155 | anim.currentTime, 100/6,
|
156 | 156 | 'Current time unchanged after change to ignored CSS property');
|
157 |
| - assert_equals( |
158 |
| - getComputedStyle(target).marginLeft, '50px', |
| 157 | + assert_approx_equals(parseFloat(getComputedStyle(target).marginLeft), 50, 0.125, |
159 | 158 | 'Margin-left unaffected by change to ignored CSS property');
|
160 | 159 |
|
161 | 160 | }, 'Animation API call rangeStart overrides animation-range-start');
|
|
214 | 213 | assert_percents_equal(
|
215 | 214 | anim.currentTime, 100/6,
|
216 | 215 | 'animation\'s current time after bumping scroll position');
|
217 |
| - assert_equals(getComputedStyle(target).marginLeft, "50px"); |
| 216 | + assert_approx_equals(parseFloat(getComputedStyle(target).marginLeft), 50, 0.125); |
218 | 217 |
|
219 | 218 | // Step 3: Try to update the range end via CSS. This change must be
|
220 | 219 | // ignored since previously set programmatically.
|
|
224 | 223 | assert_percents_equal(
|
225 | 224 | anim.currentTime, 100/6,
|
226 | 225 | 'Current time unchanged after change to ignored CSS property');
|
227 |
| - assert_equals( |
228 |
| - getComputedStyle(target).marginLeft, '50px', |
| 226 | + assert_approx_equals(parseFloat(getComputedStyle(target).marginLeft), 50, 0.125, |
229 | 227 | 'Margin-left unaffected by change to ignored CSS property');
|
230 | 228 |
|
231 | 229 | }, 'Animation API call rangeEnd overrides animation-range-end');
|
|
0 commit comments