Files
ladybird/Tests/LibWeb/Text/input/css/animation-opacity-invalid-var.html
Andreas Kling be56df8d4f LibWeb: Handle guaranteed-invalid values in animation keyframes
When a CSS animation keyframe uses var() referencing a nonexistent or
invalid custom property, variable substitution produces a
guaranteed-invalid value. The animation keyframe processing code did not
handle this case, allowing the value to reach compute_opacity() (and
similar functions) which would hit VERIFY_NOT_REACHED().

Fix this by skipping guaranteed-invalid values in
compute_keyframe_values, matching how the regular cascading code treats
them.

This fixes a crash on chess.com.
2026-03-21 08:41:13 -05:00

14 lines
371 B
HTML

<!DOCTYPE html>
<html>
<div id="foo"></div>
<script src="../include.js"></script>
<script>
test(() => {
const anim = foo.animate([{ opacity: "var(--nonexistent)" }, { opacity: "1" }], 1000);
anim.pause();
anim.currentTime = 500;
println(getComputedStyle(foo).opacity);
});
</script>
</html>