mirror of
https://github.com/servo/servo.git
synced 2025-08-05 13:40:08 +01:00
style: Update the expected direction vector of rotate property in wpt.
For interpolations with the primitive rotate3d(), the direction vectors of the transform functions get normalized first. This should also be applied to rotate property. https://drafts.csswg.org/css-transforms-2/#interpolation-of-transform-functions Differential Revision: https://phabricator.services.mozilla.com/D52944
This commit is contained in:
parent
246433acfa
commit
9a43ad996f
1 changed files with 7 additions and 2 deletions
|
@ -1249,7 +1249,11 @@ impl Animate for ComputedRotate {
|
|||
match (self, other) {
|
||||
(&Rotate::None, &Rotate::None) => Ok(Rotate::None),
|
||||
(&Rotate::Rotate3D(fx, fy, fz, fa), &Rotate::None) => {
|
||||
// No need to normalize `none`, so animate angle directly.
|
||||
// We always normalize direction vector for rotate3d() first, so we should also
|
||||
// apply the same rule for rotate property. In other words, we promote none into
|
||||
// a 3d rotate, and normalize both direction vector first, and then do
|
||||
// interpolation.
|
||||
let (fx, fy, fz, fa) = transform::get_normalized_vector_and_angle(fx, fy, fz, fa);
|
||||
Ok(Rotate::Rotate3D(
|
||||
fx,
|
||||
fy,
|
||||
|
@ -1258,7 +1262,8 @@ impl Animate for ComputedRotate {
|
|||
))
|
||||
}
|
||||
(&Rotate::None, &Rotate::Rotate3D(tx, ty, tz, ta)) => {
|
||||
// No need to normalize `none`, so animate angle directly.
|
||||
// Normalize direction vector first.
|
||||
let (tx, ty, tz, ta) = transform::get_normalized_vector_and_angle(tx, ty, tz, ta);
|
||||
Ok(Rotate::Rotate3D(
|
||||
tx,
|
||||
ty,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue