ladybird/Tests
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
..
AK AK: Remove custom deleters from OwnPtr 2026-06-13 22:49:15 +02:00
ClangPlugins LibGC: Default-construct RootHashMap from the global heap 2026-05-20 20:37:55 +02:00
LibCompress LibCompress: Remove PackBitsDecoder 2026-06-12 22:37:49 +02:00
LibCore LibThreading: Remove BackgroundAction 2026-06-05 20:00:12 +02:00
LibCrypto LibCrypto: Restore cached tag when a failed ASN1 read is rolled back 2026-06-09 08:02:44 +01:00
LibDatabase LibDatabase: Allow String values to contain embedded null bytes 2026-02-14 10:25:33 -05:00
LibDevTools LibDevTools: Allow editing Web Storage 2026-06-11 16:08:33 +01:00
LibDiff AK: Remove unused include from MemoryStream 2026-02-17 12:38:51 +00:00
LibDNS Tests/LibDNS: Make TestDNSResolver independent of live DNS 2026-06-17 18:27:33 +02:00
LibGC LibGC: Introduce ConservativeHashTable 2026-05-28 21:16:23 +02:00
LibGfx LibGfx: Reject a BMP V5 ICC profile offset that points out of bounds 2026-06-15 20:19:33 +09:00
LibHTTP LibWeb: Preserve JS bytecode in memory cache 2026-06-06 09:15:09 +02:00
LibIPC LibIPC: Don’t dispatch queued messages when sync IPC peer disconnects 2026-05-24 10:00:31 +02:00
LibJS LibJS: Evaluate ToNumber for out-of-bounds typed array writes 2026-06-17 21:24:33 +02:00
LibMedia LibMedia: Rename timing getters in AudioBlock 2026-06-06 19:58:17 -05:00
LibRegex LibRegex: Inline \w and \d ranges in legacy positive char classes 2026-04-21 16:36:38 +02:00
LibTest CMake: Rename serenity_* helper functions/macros to ladybird_* 2025-07-03 23:19:41 +02:00
LibTextCodec LibTextCodec: Stop buffering invalid UTF-8 tails 2026-05-18 14:08:22 +02:00
LibThreading LibThreading: Remove BackgroundAction 2026-06-05 20:00:12 +02:00
LibTLS Meta: Rename and merge some lagom_* and ladybird_* 2026-05-05 22:08:24 +02:00
LibUnicode LibUnicode: Add an ASCII fast path for line break segmentation 2026-05-05 18:59:07 +02:00
LibURL LibURL: Let Host use PublicSuffixData star rule matching 2026-06-16 06:14:07 +02:00
LibWasm LibJS: Isolate ArrayBuffer backing stores 2026-06-10 14:50:10 +02:00
LibWeb LibWeb: Transfer animation ownership to AnimatedBitmapDecodedImageData 2026-06-18 10:44:25 +02:00
LibWebView Tests: Wait for session history convergence in UI history assertions 2026-06-18 10:23:49 +02:00
LibXML CMake: Rename serenity_* helper functions/macros to ladybird_* 2025-07-03 23:19:41 +02:00
Meta Meta: Handle juxtaposition in CSS value parsing code generation 2026-05-13 11:26:20 +01:00
CMakeLists.txt Tests: Add a LibDevTools test suite 2026-05-27 08:55:02 +01:00