mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-04 15:19:42 +00:00
LibWeb/CSS: Fix reference bug when canonicalizing linear easing stops
+2 WPT tests
This commit is contained in:
parent
5e1e0d4e18
commit
21b531598d
Notes:
github-actions[bot]
2025-06-18 06:54:17 +00:00
Author: https://github.com/veeti
Commit: 21b531598d
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/5124
Reviewed-by: https://github.com/gmta ✅
4 changed files with 176 additions and 2 deletions
|
@ -81,7 +81,7 @@ EasingStyleValue::Linear::Linear(Vector<EasingStyleValue::Linear::Stop> stops)
|
|||
// the input progress value of any preceding control point,
|
||||
// set its input progress value to the largest input progress value of any preceding control point.
|
||||
double largest_input = 0;
|
||||
for (auto stop : stops) {
|
||||
for (auto& stop : stops) {
|
||||
if (stop.input.has_value()) {
|
||||
if (stop.input.value() < largest_input) {
|
||||
stop.input = largest_input;
|
||||
|
@ -97,7 +97,7 @@ EasingStyleValue::Linear::Linear(Vector<EasingStyleValue::Linear::Stop> stops)
|
|||
// between the preceding and following control points with input progress values.
|
||||
Optional<size_t> run_start_idx;
|
||||
for (size_t idx = 0; idx < stops.size(); idx++) {
|
||||
auto stop = stops[idx];
|
||||
auto& stop = stops[idx];
|
||||
if (stop.input.has_value() && run_start_idx.has_value()) {
|
||||
// Note: this stop is immediately after a run
|
||||
// set inputs of [start, idx-1] stops to be evenly spaced between start-1 and idx
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue