Skip to content

[css-transforms] Bunch of bugs in the interpolation algorithms #483

@Manishearth

Description

@Manishearth

Found by @canaltinova and me while implementing in Servo

  • In 2d recomposition, the "Translate matrix" step should just be matrix[3][0] = translate[0] and matrix[3][1] = translate[0] I think. Otherwise the decomposed+recomposed matrix at t=0 for skew+translate is off. This is what webkit does
  • In both interpolation steps, (3D, and 2D) matrix = multiply(matrix, rotationMatrix) should be multiplied the other way around (eg as in Gecko's code). Otherwise rotate+translate is off.
  • Imterpolation for 3d uses min and max with the wrong numbers; this will unconditionally set the product to -1 and transform the thing to the point at infinity or some other invisible location.
  • The algorithm needs rotate axes to be normalized, but the spec doesn't explicitly say this. We should probably specify that the computed value be normalized or at least mention it with the primitives
  • Recomposing a 3d matrix should mention that the returned matrix is initialized to an identity
  • Interpolation for 3d uses dot as a variable, probably means product

cc @dirkschulze

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions