Skip to content

Commit 6677517

Browse files
authored
1 parent 6084ade commit 6677517

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

scroll-animations/css/animation-range-ignored.html

+4-6
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@
144144
assert_percents_equal(
145145
anim.currentTime, 100/6,
146146
'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);
148148

149149
// Step 3: Try to update the range start via CSS. This change must be
150150
// ignored since previously set programmatically.
@@ -154,8 +154,7 @@
154154
assert_percents_equal(
155155
anim.currentTime, 100/6,
156156
'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,
159158
'Margin-left unaffected by change to ignored CSS property');
160159

161160
}, 'Animation API call rangeStart overrides animation-range-start');
@@ -214,7 +213,7 @@
214213
assert_percents_equal(
215214
anim.currentTime, 100/6,
216215
'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);
218217

219218
// Step 3: Try to update the range end via CSS. This change must be
220219
// ignored since previously set programmatically.
@@ -224,8 +223,7 @@
224223
assert_percents_equal(
225224
anim.currentTime, 100/6,
226225
'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,
229227
'Margin-left unaffected by change to ignored CSS property');
230228

231229
}, 'Animation API call rangeEnd overrides animation-range-end');

0 commit comments

Comments
 (0)