Truly independent web browser
<!DOCTYPE html>
<script src="../include.js"></script>
<style>
@keyframes parent-color { from, to { color: rgb(200, 0, 0); } }
@keyframes ended-opacity { from { opacity: 0; } to { opacity: 1; } }
@keyframes live-background { from, to { background-color: green; } }
#parent { animation: parent-color 1000s linear infinite paused; }
#child {
background-color: white;
opacity: 0.25;
animation: ended-opacity 1000ms linear none paused, live-background 1000s linear infinite paused;
}
</style>
<div id="parent"><div id="child"></div></div>
<script>
test(() => {
const child = document.getElementById("child");
child.getAnimations().find(animation => animation.animationName === "ended-opacity").currentTime = 1500;
const style = getComputedStyle(child);
println(`inherited value: ${style.color}`);
println(`ended own value: ${style.opacity}`);
println(`running own value: ${style.backgroundColor}`);
println(`remaining child effects: ${child.getAnimations().map(animation => animation.animationName).join(",")}`);
});
</script>