mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-04-26 01:35:08 +02:00
When a transform animation involves a non-invertible matrix (e.g. a matrix3d with zero Z-scale), the spec requires falling back to discrete interpolation. Currently we drop the transform entirely, producing "none" at all progress values. A following commit will fix this.
26 lines
1001 B
HTML
26 lines
1001 B
HTML
<!DOCTYPE html>
|
|
<div id="target" style="width: 100px; height: 100px;"></div>
|
|
<script src="../include.js"></script>
|
|
<script>
|
|
test(() => {
|
|
// matrix3d with a zero Z-scale produces a non-invertible (singular) matrix.
|
|
// Per spec, when one of the matrices for interpolation is non-invertible,
|
|
// the animation must fall back to discrete interpolation.
|
|
const anim = target.animate([
|
|
{ transform: "matrix3d(2,0,0,0, 0,2,0,0, 0,0,0,0, 0,0,0,1)" },
|
|
{ transform: "scale(1)" },
|
|
], 1000);
|
|
anim.pause();
|
|
|
|
// At progress < 0.5, discrete interpolation should use the "from" value.
|
|
anim.currentTime = 200;
|
|
const at02 = getComputedStyle(target).transform;
|
|
println("at 0.2: " + at02);
|
|
|
|
// At progress >= 0.5, discrete interpolation should use the "to" value.
|
|
anim.currentTime = 800;
|
|
const at08 = getComputedStyle(target).transform;
|
|
println("at 0.8: " + at08);
|
|
});
|
|
</script>
|