Skip to content

Commit 8e67c54

Browse files
lilleschromium-wpt-export-bot
authored andcommitted
Make SVG scroll-animation tests not rely on dirty-tree snapshot
An HTML PR[1] is attempting to move snapshotting of post-layout state to where the layout tree is actually clean. The test changes here makes them valid both when timelines are updated before the rendering update, and when they are only updated post-layout. [1] whatwg/html#11613 Bug: 384523570 Change-Id: I3332e29c26171815c50fe2a0f16be56fd47276be
1 parent 24a1af8 commit 8e67c54

File tree

3 files changed

+12
-9
lines changed

3 files changed

+12
-9
lines changed

scroll-animations/view-timelines/svg-graphics-element-001.html

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,10 @@
3636
const anim = target.getAnimations()[0];
3737
await anim.ready;
3838
assert_equals(getComputedStyle(target).stroke, 'rgb(0, 0, 254)');
39-
scroller.scrollTop =
40-
0.5*(scroller.scrollHeight - scroller.clientHeight);
41-
await waitForNextFrame();
39+
await runAndWaitForFrameUpdate(() => {
40+
scroller.scrollTop =
41+
0.5*(scroller.scrollHeight - scroller.clientHeight);
42+
});
4243
assert_equals(getComputedStyle(target).stroke, 'rgb(0, 64, 127)');
4344
}, 'View timeline attached to SVG graphics element');
4445
</script>

scroll-animations/view-timelines/svg-graphics-element-002.html

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,10 @@
3838
const anim = target.getAnimations()[0];
3939
await anim.ready;
4040
assert_equals(getComputedStyle(target).stroke, 'rgb(0, 0, 254)');
41-
scroller.scrollTop =
42-
0.5*(scroller.scrollHeight - scroller.clientHeight);
43-
await waitForNextFrame();
41+
await runAndWaitForFrameUpdate(() => {
42+
scroller.scrollTop =
43+
0.5*(scroller.scrollHeight - scroller.clientHeight);
44+
});
4445
assert_equals(getComputedStyle(target).stroke, 'rgb(0, 64, 127)');
4546
}, 'View timeline attached to SVG graphics element');
4647
</script>

scroll-animations/view-timelines/svg-graphics-element-003.html

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,9 +39,10 @@
3939
const anim = target.getAnimations()[0];
4040
await anim.ready;
4141
assert_equals(getComputedStyle(target).color, 'rgb(0, 0, 254)');
42-
scroller.scrollTop =
43-
0.5*(scroller.scrollHeight - scroller.clientHeight);
44-
await waitForNextFrame();
42+
await runAndWaitForFrameUpdate(() => {
43+
scroller.scrollTop =
44+
0.5*(scroller.scrollHeight - scroller.clientHeight);
45+
});
4546
assert_equals(getComputedStyle(target).color, 'rgb(0, 64, 127)');
4647
}, 'View timeline attached to SVG graphics element');
4748
</script>

0 commit comments

Comments
 (0)