1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 20:47:45 +00:00

LibWeb/CSS: Resolve NumericCalculationNode to percentage when requested

When the caller of NumericCalculationNode::resolve() does not provide
a percentage_basis, it expects the method to return a raw percentage
value.

Fixes crashing on https://discord.com/login
This commit is contained in:
Aliaksandr Kalenik 2024-01-11 06:49:07 +01:00 committed by Andreas Kling
parent 1593ff2d4c
commit 225ed58f7e
3 changed files with 15 additions and 1 deletions

View file

@ -0,0 +1,11 @@
<!doctype html><script src="../include.js"></script><style>
body {
--saturation-factor: 1;
background: hsl(225, calc(var(--saturation-factor, 1) * 6.3%), 12.5%);
}
</style><body></body><script>
test(() => {
const bodyStyle = window.getComputedStyle(document.body);
println(bodyStyle.backgroundColor);
});
</script>