ladybird/Tests/LibWeb/Text/data
Callum Law 8ebdaeab69 LibWeb: Transfer animation ownership to AnimatedBitmapDecodedImageData
Previously animation ownership was a messy split between
`AnimatedBitmapDecodedImageData` and the consumers (i.e.
`ImageStyleValueResource`, `HTMLImageElement`, and `SVGImageElement`)
with `AnimatedBitmapDecodedImageData` owning the frames and a current
frame index, and the consumers owning the rest of the state (e.g. loop
count, timers to drive the animation forward, their own current index).

This had a couple of main issues:
 - While `AnimatedDecodedImageData` partially synchronized animations by
   dropping unexpected advancement notifications, this didn't apply to
   other animation state which meant, for instance, that a later started
   consumer could drive the animation of an earlier one past the max
   loop count (albeit without invalidating the earlier consumer).
 - Multiple consumers didn't share frame timings, meaning animations
   could be up to a full frame out of sync visually.
 - Animations were paused depending on whether there were any consumers,
   this is different to the behavior in other browsers (where they
   continue regardless of whether there are any consumers).
 - It was an overgeneralization of how animations need to work - only
   `AnimatedBitmapDecodedImageData` works with an indexed frame model,
   with animated SVGs (although not yet implemented) relying on their
   internal event loop to be driven forward.

Given the above the new approach implemented in this commit is:
 - The API for `DecodedImageData` is animation system agnostic, only
   exposing `default_frame`, `current_frame`, and `restart_animation`
   methods not reliant on providing a specific frame index.
 - `AnimatedBitmapDecodedImageData` owns its own timer, loop count,
   etc. The animation starts when the first consumer registers and ends
   when the document is hidden or becomes inactive (or completes in the
   case of finite animations).
 - Consumers are invalidated by `AnimatedBitmapDecodedImageData` when
   required.

Tests have been added for:
 - Animations being paused when the document becomes inactive and
   restarted when it becomes active again.
 - Frame timings being synchronized across consumers.
 - Restarts triggered by `HTMLImageElement` applying to all consumers.
 - Processing ending once a non-infinite animation plays to completion.

The tests to ensure animations are cancelled when consumers are removed
(e.g. `animated-background-image-timer-stops-when-hidden.html`) have
been updated to assert the inverse since animation state is now per
resource not per consumer.
2026-06-18 10:44:25 +02:00
..
base LibWeb: Make a elements honor base element's target 2025-02-16 09:21:52 +01:00
bad.xml LibXML: Include line and column numbers in parse error messages 2024-08-03 18:23:36 +02:00
blank.html Meta: Add DOCTYPEs to most text tests 2025-03-20 11:50:49 +01:00
document.xml Tests/LibWeb: Add a test for iframe load event when src has xml type 2024-04-18 08:10:05 +00:00
external-module.mjs LibWeb: Get Page from principal realm during resource loading 2024-11-24 15:29:47 -07:00
greeter.wasm LibWeb: Add Wasm Web-API streaming compilation and instantiation 2024-11-01 10:42:24 -07:00
history-pushstate-iframe.html Meta: Add DOCTYPEs to most text tests 2025-03-20 11:50:49 +01:00
iframe-hashchange-event.html LibWeb: Add hashchange event support 2024-04-15 01:02:51 -07:00
iframe-nav-before-load-page-a.html LibWeb: Don't force replace history handling for iframe src changes 2026-04-04 11:30:55 +02:00
iframe-nav-before-load-page-b.html LibWeb: Don't force replace history handling for iframe src changes 2026-04-04 11:30:55 +02:00
iframe-popstate-event.html Meta: Add DOCTYPEs to most text tests 2025-03-20 11:50:49 +01:00
iframe-reload.html Meta: Add DOCTYPEs to most text tests 2025-03-20 11:50:49 +01:00
iframe-replace-push-then-back.html LibWeb: Fix session history replacement for superseded navigations 2026-03-29 03:11:14 +02:00
iframe-test-content-1.html Meta: Add DOCTYPEs to most text tests 2025-03-20 11:50:49 +01:00
iframe-test-content-2.html Meta: Add DOCTYPEs to most text tests 2025-03-20 11:50:49 +01:00
iframe-unload-event.html LibWeb: Do not destroy document until whole subtree completed unloading 2024-04-20 10:22:14 +02:00
iframe-with-border-radius-svg.html Meta: Add DOCTYPEs to most text tests 2025-03-20 11:50:49 +01:00
import-1.css LibWeb/CSS: Wait for resources to load to fire <style> load event 2026-02-12 16:23:12 +01:00
import-2.css LibWeb/CSS: Wait for resources to load to fire <style> load event 2026-02-12 16:23:12 +01:00
invalid_utf8_corrupt.svg LibWeb+LibXML: Make Listener::set_source(ByteString) fallible 2025-10-02 02:25:28 +02:00
local-storage-iframe.html Tests: Use unique local storage key in local storage test 2026-01-15 09:39:00 +01:00
loop-count-2.gif LibWeb: Transfer animation ownership to AnimatedBitmapDecodedImageData 2026-06-18 10:44:25 +02:00
mime-types.json LibWeb/XHR: Ensure type set on blob responses 2025-02-16 19:08:45 +00:00
navigation-navigate-iframe.html Meta: Add DOCTYPEs to most text tests 2025-03-20 11:50:49 +01:00
ParentNode-querySelector-All-content.html LibWeb: Don't allow trailing commas in selector lists 2024-11-23 09:49:33 +01:00
session-storage-event-iframe.html LibWeb/HTML: Fire storage events to windows without a Storage 2026-03-16 13:55:07 +01:00
test-iframe-content.html Meta: Add DOCTYPEs to most text tests 2025-03-20 11:50:49 +01:00
video-gc-frame.html Meta: Add DOCTYPEs to most text tests 2025-03-20 11:50:49 +01:00
window-barprops-popout-window.html LibWeb: Add Extended Tests for Window BarProps 2025-03-29 02:35:27 +00:00
window-opener-post-message.html LibWeb: Protect against null navigables in lineage chain more thoroughly 2026-02-08 14:51:25 -05:00