Skip to content

Truly independent web browser

Tests/LibWeb: Update layout before counting frames after a listener

sideshowbarker86df34f9fb5d
diff --git a/Tests/LibWeb/Text/expected/css/invisible-animation-style-throttling.txt b/Tests/LibWeb/Text/expected/css/invisible-animation-style-throttling.txt
index 18cde6cbcb6..2fb84a18acb 100644
--- a/Tests/LibWeb/Text/expected/css/invisible-animation-style-throttling.txt
+++ b/Tests/LibWeb/Text/expected/css/invisible-animation-style-throttling.txt
@@ -2,7 +2,7 @@ hidden animation overlay builds: 0
hidden animation frame pump requests: 0
animation event listener uses iteration wake-ups: true
animation event listener skips past events: 0
-removing animation event listener stops frame pump: 1
+removing animation event listener stops frame pump: 0
computed style samples hidden animation: true
offscreen clipped animation overlay builds: 0
offscreen clipped animation frame pump requests: 0
diff --git a/Tests/LibWeb/Text/input/css/invisible-animation-style-throttling.html b/Tests/LibWeb/Text/input/css/invisible-animation-style-throttling.html
index 97628c46199..53c686f4fc4 100644
--- a/Tests/LibWeb/Text/input/css/invisible-animation-style-throttling.html
+++ b/Tests/LibWeb/Text/input/css/invisible-animation-style-throttling.html
@@ -46,10 +46,11 @@
println(`animation event listener uses iteration wake-ups: ${internals.getStyleInvalidationCounters().animationFramePumpRequests === 0 && internals.getStyleInvalidationCounters().compositorAnimationWakeupTimerActive}`);
println(`animation event listener skips past events: ${animationIterationEvents}`);
hidden.removeEventListener("animationiteration", animationIterationListener);
+ // The lines printed above left layout dirty, and a hidden animation can't skip its tick until layout is
+ // redone. So redo it before counting, as the listener phase above does.
+ internals.updateLayoutForTesting();
internals.resetStyleInvalidationCounters();
await animationOverlayBuildsOverFrames(4);
- // FIXME: Removing the listener should stop the frame pump (0 requests), but where the style engine owns
- // the document, the frames after it still request one.
println(`removing animation event listener stops frame pump: ${internals.getStyleInvalidationCounters().animationFramePumpRequests}`);
const beforeComputedStyle = internals.getStyleInvalidationCounters().animatedStyleOverlayBuilds;