add support for apng and webp animated image decoding (#37637)

Add support for APNG animated image decoding. Rework `load_from_memory`
image decoding api, to handle all the image format that currently
supported.

Testing: This change should allow `apng` and `webp` format image start
moving, and should make some WPT test related to APNG pass.

Partially address: https://github.com/servo/servo/issues/37493

[wpt try
run](https://github.com/rayguo17/servo/actions/runs/15840339570)

cc @xiaochengh

Signed-off-by: rayguo17 <rayguo17@gmail.com>
This commit is contained in:
TIN TUN AUNG 2025-07-10 16:54:16 +08:00 committed by GitHub
parent ff050b71fa
commit f88dd2a12c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
21 changed files with 151 additions and 74 deletions

View file

@ -357193,6 +357193,19 @@
{}
]
],
"animated-webp-update.tentative.html": [
"d82d830205270d4bf32de3f01f3fe69afb44fad3",
[
"html/semantics/embedded-content/the-img-element/animated-webp-update.tentative.html",
[
[
"/html/semantics/embedded-content/the-img-element/animated-image-update-ref.tentative.html",
"=="
]
],
{}
]
],
"available-images.html": [
"779ff978689e4f5565b8d45d383efa75ac78b8b2",
[
@ -485994,6 +486007,10 @@
"7694add55e0c98ec3ee5d9110e5fb16b4d819137",
[]
],
"animated.webp": [
"ebe15f88496fd03725df2445034ef0f400af652c",
[]
],
"blue-10.png": [
"62949e08d87dfcdc0987eaef67692c7a1c16aa50",
[]

View file

@ -1,2 +0,0 @@
[fcTL-acTL-ordering.html]
expected: FAIL

View file

@ -1,2 +0,0 @@
[fcTL-blend-over-repeatedly.html]
expected: FAIL

View file

@ -1,2 +0,0 @@
[fcTL-blend-over-solid.html]
expected: FAIL

View file

@ -1,2 +0,0 @@
[fcTL-blend-source-solid.html]
expected: FAIL

View file

@ -1,2 +0,0 @@
[fcTL-blend-source-transparent.html]
expected: FAIL

View file

@ -1,2 +0,0 @@
[fcTL-dispose-background-final.html]
expected: FAIL

View file

@ -1,2 +0,0 @@
[fcTL-dispose-before-region-background.html]
expected: FAIL

View file

@ -1,2 +0,0 @@
[fcTL-dispose-in-region-previous.html]
expected: FAIL

View file

@ -1,2 +0,0 @@
[fcTL-dispose-previous-final.html]
expected: FAIL

View file

@ -1,2 +0,0 @@
[fcTL-dispose-previous-first.html]
expected: FAIL

View file

@ -1,2 +0,0 @@
[fcTL-dispose-previous.html]
expected: FAIL

View file

@ -1,2 +0,0 @@
[fdAT-1bit-PLTE.html]
expected: FAIL

View file

@ -1,2 +0,0 @@
[fdAT-2bit-PLTE-tRNS.html]
expected: FAIL

View file

@ -1,2 +0,0 @@
[fdAT-8bit-gray.html]
expected: FAIL

View file

@ -1,2 +0,0 @@
[fdAT-split-basic.html]
expected: FAIL

View file

@ -1,2 +0,0 @@
[fdAT-split-zero-length.html]
expected: FAIL

View file

@ -1,2 +0,0 @@
[first-frame-not-IDAT.html]
expected: FAIL

View file

@ -0,0 +1,21 @@
<!DOCTYPE html>
<html class="reftest-wait">
<head>
<title>Animated image active frame update when passing delay time</title>
<link rel="match" href="animated-image-update-ref.tentative.html" />
<link rel="author" title="Tin Tun Aung" href="mailto:rayguo17@gmail.com" />
<script src="/common/reftest-wait.js"></script>
</head>
<body>
<img id="image" src="resources/animated.webp" />
<script>
const image = document.getElementById("image");
requestAnimationFrame(() => {
setTimeout(() => {
takeScreenshot();
}, 150);
});
</script>
</body>
</html>

Binary file not shown.

After

Width:  |  Height:  |  Size: 152 B