mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-25 02:12:39 +00:00
We previously only invalidated the cached color-stop data when the painted area's size changed. However, multiple elements can use the same gradient and be the same size, but have different parameters that affect the gradient stop positions, for example if a stop has an em position. This can also change for the same element over time. The new cache instead uses these parameters as the cache key. So we recompute the cache if lengths would resolve differently, or the area's size is different. The included test fails without this change.
24 lines
No EOL
672 B
HTML
24 lines
No EOL
672 B
HTML
<!DOCTYPE html>
|
|
<style>
|
|
div {
|
|
width: 250px;
|
|
height: 250px;
|
|
border: 1px solid black;
|
|
}
|
|
.linear-gradient.a {
|
|
background: linear-gradient(transparent, blue 10px);
|
|
}
|
|
.linear-gradient.b {
|
|
background: linear-gradient(transparent, blue 100px);
|
|
}
|
|
.radial-gradient.a {
|
|
background: radial-gradient(transparent, blue 10px);
|
|
}
|
|
.radial-gradient.b {
|
|
background: radial-gradient(transparent, blue 100px);
|
|
}
|
|
</style>
|
|
<div class="linear-gradient a"></div>
|
|
<div class="linear-gradient b"></div>
|
|
<div class="radial-gradient a"></div>
|
|
<div class="radial-gradient b"></div> |