Files
sousa-gecko/testing/web-platform/tests/css/css-images/parsing/image-function-computed.html
T
Jason Leo b0b2507693 Bug 2039011 [wpt PR 59815] - Implement image(<color>) functional notation, a=testonly
Automatic update from web-platform-tests
Implement image(<color>) functional notation

Adds the CSS Images Level 4 image() function in its color-only form [1],
a solid-color image with no natural dimensions. Implemented as a
CSSColorImageValue subclass of CSSConstantGradientValue, reusing the
existing solid-color image machinery (already used by
cross-fade(<color>)) and overriding only the serialization. Gated behind
the CSSImageFunction runtime flag.

ChromeStatus: https://chromestatus.com/feature/5121011285622784

[1]: https://drafts.csswg.org/css-images-4/#funcdef-image

Bug: 510426954
Change-Id: I0c5e0fa98e41a70cd9f17716f7c0357e352597e6
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/7831826
Commit-Queue: Jason Leo <cgqaq@chromium.org>
Reviewed-by: Rune Lillesveen <futhark@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1629193}

--

wpt-commits: d9065cfb9ed97b9d3d44e9d63a097e3b78a5cf92
wpt-pr: 59815
2026-05-14 20:45:46 +00:00

18 lines
810 B
HTML

<!DOCTYPE html>
<meta charset="utf-8">
<title>CSS Images Module Level 4: computed value of image(&lt;color&gt;)</title>
<link rel="author" title="Jason Leo" href="mailto:cgqaq@chromium.org">
<link rel="help" href="https://drafts.csswg.org/css-images-4/#image-notation">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="/css/support/computed-testcommon.js"></script>
<div id="target"></div>
<script>
// The computed value resolves the inner <color>.
test_computed_value("background-image", "image(red)", "image(rgb(255, 0, 0))");
test_computed_value("background-image", "image(rgba(0, 128, 255, 0.5))",
"image(rgba(0, 128, 255, 0.5))");
test_computed_value("background-image", "image(transparent)",
"image(rgba(0, 0, 0, 0))");
</script>