Files
sousa-gecko/testing/web-platform/tests/css/css-images/linear-gradient-sibling-index.html
T
Rune Lillesveen e9e06db5bc Bug 1965769 [wpt PR 52437] - Pass node for tree counting conversions for gradients,
Automatic update from web-platform-tests
Pass node for tree counting conversions for gradients

Gradients (incorrectly) resolves computed values at paint time, which
means we need the Element available for the CSSToLengthConversionData.

We used to pass in a nullptr which would crash. Instead, pass the
LayoutObject's node (or the Document if null) down to the GetImage()
calls and use that node for tree counting if it is an element. Otherwise
fall back to the documentElement.

The correct solution is to compute gradients at computed value time, but
that's a larger project.

Bug: 410960656, 40620723

Change-Id: I97eafed237d5c148be05c53fe9fe3e3647b96fe0
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6523441
Reviewed-by: Anders Hartvoll Ruud <andruud@chromium.org>
Commit-Queue: Rune Lillesveen <futhark@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1458005}

--

wpt-commits: b4bde5be7d17944f07d19b4725dddfff6c8c3da0
wpt-pr: 52437

Differential Revision: https://phabricator.services.mozilla.com/D249330
2025-05-14 15:58:18 +00:00

20 lines
560 B
HTML

<!DOCTYPE html>
<title>CSS Images Test: Linear gradient with sibling-index()</title>
<link rel="help" href="https://drafts.csswg.org/css-images/#linear-gradients">
<link rel="help" href="https://drafts.csswg.org/css-values-5/#tree-counting">
<link rel="match" href="linear-gradient-sibling-index-ref.html">
<style>
.grad {
width: 100px;
height: 100px;
background: linear-gradient(blue calc(10px * sibling-index()), yellow);
}
</style>
<div>
<div></div>
<div class="grad"></div>
<div></div>
<div></div>
<div class="grad"></div>
</div>