mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-12-08 06:09:58 +00:00
LibWeb: Handle calc in multi-argument rotate property interpolation
Previously we assumed the angle would always be an `AngleStyleValue` but it can also be a `CalculatedStyleValue` Fixes #6870
This commit is contained in:
parent
025274cd86
commit
46abc0e8e2
Notes:
github-actions[bot]
2025-11-23 08:44:43 +00:00
Author: https://github.com/Calme1709
Commit: 46abc0e8e2
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/6854
Reviewed-by: https://github.com/gmta ✅
2 changed files with 19 additions and 2 deletions
|
|
@ -415,7 +415,7 @@ static RefPtr<StyleValue const> interpolate_rotate(DOM::Element& element, Calcul
|
|||
from_axis.set_z(from_transform.values()[2]->as_number().number());
|
||||
from_angle_value = from_transform.values()[3];
|
||||
}
|
||||
float from_angle = from_angle_value->as_angle().angle().to_radians();
|
||||
float from_angle = Angle::from_style_value(from_angle_value, {}).to_radians();
|
||||
|
||||
FloatVector3 to_axis { 0, 0, 1 };
|
||||
auto to_angle_value = to_transform.values()[0];
|
||||
|
|
@ -425,7 +425,7 @@ static RefPtr<StyleValue const> interpolate_rotate(DOM::Element& element, Calcul
|
|||
to_axis.set_z(to_transform.values()[2]->as_number().number());
|
||||
to_angle_value = to_transform.values()[3];
|
||||
}
|
||||
float to_angle = to_angle_value->as_angle().angle().to_radians();
|
||||
float to_angle = Angle::from_style_value(to_angle_value, {}).to_radians();
|
||||
|
||||
auto from_axis_angle = [](FloatVector3 const& axis, float angle) -> FloatVector4 {
|
||||
auto normalized = axis.normalized();
|
||||
|
|
|
|||
|
|
@ -0,0 +1,17 @@
|
|||
<!DOCTYPE html>
|
||||
<style>
|
||||
@keyframes foo {
|
||||
from {
|
||||
rotate: 1 1 1 calc(0deg);
|
||||
}
|
||||
|
||||
to {
|
||||
rotate: 1 1 1 calc(90deg);
|
||||
}
|
||||
}
|
||||
|
||||
#foo {
|
||||
animation: foo 1s infinite;
|
||||
}
|
||||
</style>
|
||||
<div id="foo"></div>
|
||||
Loading…
Add table
Add a link
Reference in a new issue