mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-10-23 00:19:18 +00:00
LibWeb: Clamp calculated steps()
interval count using normal system
Previously we were doing this ad-hoc later in the process but we now have the `calc` clamping system which can simplify things. This reveals some false-positives in that we don't handle relative lengths within these `calc`s but these are fixed in the next commit
This commit is contained in:
parent
06a57a280d
commit
ad41f053b8
Notes:
github-actions[bot]
2025-10-20 10:29:14 +00:00
Author: https://github.com/Calme1709
Commit: ad41f053b8
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/6459
Reviewed-by: https://github.com/AtkinsSJ ✅
5 changed files with 25 additions and 23 deletions
|
@ -137,15 +137,10 @@ String EasingStyleValue::Steps::to_string(SerializationMode mode) const
|
|||
return {};
|
||||
return CSS::to_string(this->position);
|
||||
}();
|
||||
auto intervals = number_of_intervals;
|
||||
if (mode == SerializationMode::ResolvedValue) {
|
||||
auto resolved_value = number_of_intervals.resolved({}).value_or(1);
|
||||
intervals = max(resolved_value, this->position == StepPosition::JumpNone ? 2 : 1);
|
||||
}
|
||||
if (position.has_value()) {
|
||||
builder.appendff("steps({}, {})", intervals.to_string(mode), position.value());
|
||||
builder.appendff("steps({}, {})", number_of_intervals.to_string(mode), position.value());
|
||||
} else {
|
||||
builder.appendff("steps({})", intervals.to_string(mode));
|
||||
builder.appendff("steps({})", number_of_intervals.to_string(mode));
|
||||
}
|
||||
}
|
||||
return MUST(builder.to_string());
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue