Commit ab99903
Linear gradients: clamp stops at same position instead of replacing them
https://bugs.webkit.org/show_bug.cgi?id=306400
rdar://169063497
Reviewed by Simon Fraser.
When all color stops in a linear gradient are at the same position,
they should create a hard color transition at that clamped position,
preserving all stop colors to maintain proper color interpolation.
Previously, LinearGradientAdapter::normalizeStopsAndEndpointsOutsideRange
would clamp all stops to offset 1, but this didn't properly handle cases
where stops were at positions outside the [0, 1] range.
The fix clamps the offset to the [0, 1] range while preserving all color
stops at that position, allowing the gradient renderer to correctly handle
the hard transition with proper color interpolation when needed.
NOTE - the test name includes `radial` but in actual, it is for
`linear-gradient`.
* Source/WebCore/style/values/images/StyleGradient.cpp:
(WebCore::Style::LinearGradientAdapter::normalizeStopsAndEndpointsOutsideRange):
* LayoutTests/TestExpectations: Progressions
Canonical link: https://commits.webkit.org/306823@main1 parent cf5db81 commit ab99903
File tree
2 files changed
+5
-5
lines changed- LayoutTests
- Source/WebCore/style/values/images
2 files changed
+5
-5
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5360 | 5360 | | |
5361 | 5361 | | |
5362 | 5362 | | |
5363 | | - | |
5364 | | - | |
5365 | 5363 | | |
5366 | 5364 | | |
5367 | 5365 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | | - | |
| 2 | + | |
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
| |||
205 | 205 | | |
206 | 206 | | |
207 | 207 | | |
208 | | - | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
209 | 211 | | |
210 | | - | |
| 212 | + | |
211 | 213 | | |
212 | 214 | | |
213 | 215 | | |
| |||
0 commit comments