mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-31 05:09:12 +00:00
LibWeb: Support interpolation of mixed percentage dimension units
This commit is contained in:
parent
ef766b0b5f
commit
e2cb25e35c
Notes:
sideshowbarker
2024-07-16 23:55:09 +09:00
Author: https://github.com/mattco98
Commit: e2cb25e35c
Pull-request: https://github.com/SerenityOS/serenity/pull/24444
Issue: https://github.com/SerenityOS/serenity/issues/23543
Reviewed-by: https://github.com/AtkinsSJ
3 changed files with 109 additions and 1 deletions
|
@ -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>
|
Loading…
Add table
Add a link
Reference in a new issue