mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-04-26 17:55:07 +02:00
`EdgeStyleValues` which consist of an offset of a `calc()`s which resolves to 50% should be considered "centered" for `SerializationMode::ResolvedValue` for the purpose of omitting the position value from gradient serialization.
47 lines
1.1 KiB
HTML
47 lines
1.1 KiB
HTML
<!DOCTYPE html>
|
|
<style>
|
|
#a {
|
|
background-image: radial-gradient(at center center, red, blue);
|
|
}
|
|
|
|
#b {
|
|
background-image: radial-gradient(at 50% 50%, red, blue);
|
|
}
|
|
|
|
#c {
|
|
background-image: radial-gradient(at left 50% top 50%, red, blue);
|
|
}
|
|
|
|
#d {
|
|
background-image: radial-gradient(at right 50% bottom 50%, red, blue);
|
|
}
|
|
|
|
#e {
|
|
background-image: radial-gradient(at calc(50%) calc(50%), red, blue);
|
|
}
|
|
|
|
#f {
|
|
background-image: radial-gradient(at calc(sign(1em - 1px) * 50%) calc(sign(1em - 1px) * 50%), red, blue);
|
|
}
|
|
</style>
|
|
<div id="a"></div>
|
|
<div id="b"></div>
|
|
<div id="c"></div>
|
|
<div id="d"></div>
|
|
<div id="e"></div>
|
|
<div id="f"></div>
|
|
<script src="../include.js"></script>
|
|
<script>
|
|
test(() => {
|
|
for (const rule of document.styleSheets[0].cssRules) {
|
|
println(rule.cssText);
|
|
}
|
|
|
|
println("Computed:");
|
|
|
|
for (const el of [a, b, c, d, e, f]) {
|
|
println(`#${el.id}: ${getComputedStyle(el).backgroundImage}`);
|
|
}
|
|
});
|
|
</script>
|