mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-05-05 06:32:30 +02:00
LibWeb: Make sure style is up-to-date in getAnimations()
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.
This commit is contained in:
committed by
Sam Atkins
parent
c412181683
commit
94b3b84dd8
Notes:
github-actions[bot]
2024-10-02 15:29:35 +00:00
Author: https://github.com/kalenikaliaksandr Commit: https://github.com/LadybirdBrowser/ladybird/commit/94b3b84dd80 Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/1600 Reviewed-by: https://github.com/AtkinsSJ ✅
@@ -0,0 +1,26 @@
|
||||
<!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>
|
||||
Reference in New Issue
Block a user