mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-09-02 15:46:33 +00:00
LibWeb: Correct serialization of steps() easing functions
This commit is contained in:
parent
7fe110225b
commit
8cd514d83c
Notes:
github-actions[bot]
2024-11-18 22:39:58 +00:00
Author: https://github.com/shlyakpavel
Commit: 8cd514d83c
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/2422
3 changed files with 51 additions and 2 deletions
|
@ -0,0 +1,35 @@
|
|||
<!DOCTYPE html>
|
||||
<script src="../../include.js"></script>
|
||||
<script>
|
||||
test(() => {
|
||||
const div = document.createElement('div');
|
||||
div.style.width = '50px';
|
||||
div.style.height = '50px';
|
||||
div.style.backgroundColor = 'red';
|
||||
div.style.animation = 'test-animation 2s infinite';
|
||||
|
||||
document.body.appendChild(div);
|
||||
|
||||
const testCases = [
|
||||
{ input: 'steps(1, jump-none)' },
|
||||
{ input: 'steps(1, start)' },
|
||||
{ input: 'steps(1)' }, // Equivalent to steps(1, end)
|
||||
{ input: 'steps(4, jump-both)' },
|
||||
{ input: 'steps(2, jump-start)' },
|
||||
{ input: 'steps(3, end)' }, // Implicitly steps(3)
|
||||
{ input: 'steps(5, start)' },
|
||||
{ input: 'steps(6, jump-none)' },
|
||||
{ input: 'steps(10, jump-both)' },
|
||||
{ input: 'steps(1, jump-end)' }, // Implicitly steps(1)
|
||||
];
|
||||
|
||||
testCases.forEach(({ input }) => {
|
||||
div.style.animationTimingFunction = input;
|
||||
const computed = getComputedStyle(div).animationTimingFunction;
|
||||
|
||||
println(`Input: ${input}, Computed: ${computed}`);
|
||||
});
|
||||
|
||||
document.body.removeChild(div);
|
||||
});
|
||||
</script>
|
Loading…
Add table
Add a link
Reference in a new issue