ladybird/Tests/LibWeb/Text/input/WebAnimations/misc/animation-preferred-properties.html
Callum Law 12581fa995 LibWeb: Resolve conflicts in compute_keyframe_values correctly
As conflict resolution depends on whether the property was set directly
or via a shorthand, we have to store the non-expanded values in the
resolved keyframe properties.
2025-06-23 15:19:07 +01:00

36 lines
1 KiB
HTML

<!DOCTYPE html>
<html>
<script src="../../include.js"></script>
<script>
test(() => {
const target = document.createElement("div");
document.body.append(target);
const anim = target.animate(
{
marginTop: "100px",
margin: "200px",
borderTop: "100px solid red",
border: "200px solid red",
},
{ duration: 1, easing: "step-start" }
);
const cs = getComputedStyle(target);
if (cs.marginTop !== "100px") {
println(`Fail! Longhands should be preferred over shorthands, ${cs.marginTop}`);
return;
}
if (cs.borderTopWidth !== "100px") {
println(
`Fail! Longhands with fewer properties should be preferred over those with more ${cs.borderTopWidth}`
);
return;
}
println("Pass!");
});
</script>
</html>