LibWeb: Support interpolation of mixed percentage dimension units

This commit is contained in:
Matthew Olsson 2024-05-25 13:24:18 -07:00 committed by Andreas Kling
commit e2cb25e35c
Notes: sideshowbarker 2024-07-16 23:55:09 +09:00
3 changed files with 109 additions and 1 deletions

View file

@ -0,0 +1,34 @@
<!DOCTYPE html>
<style>
div {
position: absolute;
animation: moveRight 2s linear;
}
@keyframes moveRight {
from {
left: 0;
}
to {
left: 100%;
transform: translateX(-100%);
}
}
</style>
<body>
<div id="foo"></div>
<script src="../../include.js"></script>
<script>
promiseTest(async () => {
const foo = document.getElementById("foo");
const timeline = internals.createInternalAnimationTimeline();
const anim = foo.getAnimations()[0];
anim.timeline = timeline;
timeline.setTime(1000);
await animationFrame();
const bounds = foo.getBoundingClientRect();
println(`box is moving in the correct direction: ${bounds.left > 0}`);
});
</script>
</body>