mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-09 02:21:53 +00:00
StyleComputer is responsible for assigning animation targets, so we have to make sure there are no pending style updates before querying animations of an element. This change also introduces a version of getAnimations() that does not check style updates and used by StyleComputer to avoid mutual recursion.
26 lines
597 B
HTML
26 lines
597 B
HTML
<!DOCTYPE html>
|
|
<script src="../../include.js"></script>
|
|
<style>
|
|
@keyframes test {
|
|
from {
|
|
background-color: green;
|
|
}
|
|
to {
|
|
background-color: yellow;
|
|
}
|
|
}
|
|
|
|
#animated {
|
|
width: 100px;
|
|
height: 100px;
|
|
background-color: green;
|
|
animation: test 2s infinite;
|
|
}
|
|
</style>
|
|
<div id="animated">This is a animated div</div>
|
|
<script>
|
|
const animationCount = document.getElementById("animated").getAnimations().length;
|
|
test(() => {
|
|
println(`animation count: ${animationCount}`);
|
|
});
|
|
</script>
|