mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-05-05 06:32:30 +02:00
Tests: Add test for non-invertible transform animation fallback
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.
This commit is contained in:
committed by
Andreas Kling
parent
704269f664
commit
fa0a7d4a4a
Notes:
github-actions[bot]
2026-03-22 04:18:49 +00:00
Author: https://github.com/awesomekling Commit: https://github.com/LadybirdBrowser/ladybird/commit/fa0a7d4a4a6 Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/8560
@@ -0,0 +1,25 @@
|
||||
<!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>
|
||||
Reference in New Issue
Block a user