Files
sousa-gecko/testing/web-platform/tests/jpegxl/html-img.html
T
Helmut Januschka dc334a8ed1 Bug 2023198 [wpt PR 58481] - Add JPEG XL interop-2026 coverage and decoder tests, a=testonly
Automatic update from web-platform-tests
Add JPEG XL interop-2026 coverage and decoder tests

Introduce automated interop WPT coverage and strengthen Blink JXL decoder unit tests for orientation, ICC/CMYK, and high bit-depth fixtures.

Bug: 484065185
Change-Id: Ie5f33c477b616e03b3f3a21d006c6ae1da09294e
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/7572466
Commit-Queue: Philip Jägenstedt <foolip@chromium.org>
Reviewed-by: Philip Jägenstedt <foolip@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1598968}

--

wpt-commits: e1d141414f248bfe6653ca049bf70db7146ecf8d
wpt-pr: 58481
2026-03-23 08:18:24 +00:00

38 lines
1.3 KiB
HTML

<!DOCTYPE html>
<title>JPEG XL integration: img and picture/source</title>
<link rel="help" href="https://github.com/web-platform-tests/interop-jpegxl">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<img id="plain" src="resources/3x3_srgb_lossless.jxl" alt="plain img">
<picture id="pic">
<source srcset="resources/3x3_srgb_lossless.jxl" type="image/jxl">
<img id="picture-img" src="resources/3x3_srgb_lossless.png" alt="picture fallback">
</picture>
<script>
promise_test(async () => {
const plain = document.getElementById('plain');
if (!plain.complete) {
await new Promise((resolve, reject) => {
plain.onload = resolve;
plain.onerror = () => reject(new Error('plain img failed'));
});
}
assert_true(plain.currentSrc.endsWith('.jxl'));
assert_greater_than(plain.naturalWidth, 0);
}, '<img> decodes JPEG XL');
promise_test(async () => {
const img = document.getElementById('picture-img');
if (!img.complete) {
await new Promise((resolve, reject) => {
img.onload = resolve;
img.onerror = () => reject(new Error('picture img failed'));
});
}
assert_true(img.currentSrc.endsWith('.jxl'));
assert_greater_than(img.naturalWidth, 0);
}, '<picture>/<source> selects and decodes JPEG XL source');
</script>