Truly independent web browser
<!DOCTYPE html>
<script src="../include.js"></script>
<div id="host"></div>
<script>
test(() => {
const shadowRoot = host.attachShadow({ mode: "open" });
shadowRoot.innerHTML = `
<style>
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
#target { opacity: 0.2; animation: fade 1s linear; }
</style>
<div id="target"></div>
`;
const target = shadowRoot.getElementById("target");
const animation = target.getAnimations()[0];
animation.pause();
animation.currentTime = 500;
println(`shown: ${target.getAnimations().length}, ${getComputedStyle(target).opacity}`);
host.style.display = "none";
internals.updateStyle();
println(`hidden: ${target.getAnimations().length}, ${getComputedStyle(target).opacity}`);
});
</script>