mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-10-26 09:59:43 +00:00
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.
36 lines
1 KiB
HTML
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>
|