mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 01:27:34 +00:00
LibWeb: Fix off-by-one in CSS calc() "negate" operation
When negating a number, we should subtract it from 0, not 1. :^)
This commit is contained in:
parent
587c44cfbb
commit
e81d4ca1ac
7 changed files with 38 additions and 12 deletions
15
Tests/LibWeb/Layout/input/calc-negate-length.html
Normal file
15
Tests/LibWeb/Layout/input/calc-negate-length.html
Normal file
|
@ -0,0 +1,15 @@
|
|||
<!doctype html><style>
|
||||
body {
|
||||
background: #444;
|
||||
}
|
||||
.container {
|
||||
width: 100px;
|
||||
background: green;
|
||||
height: 50px;
|
||||
}
|
||||
.foo {
|
||||
width: calc(100% - 1px);
|
||||
background: black;
|
||||
height: 50px;
|
||||
}
|
||||
</style><div class=container><div class=foo>
|
|
@ -1,4 +1,7 @@
|
|||
<style>
|
||||
* {
|
||||
font: 16px SerenitySans;
|
||||
}
|
||||
.grid-container {
|
||||
display: grid;
|
||||
background-color: lightsalmon;
|
||||
|
|
|
@ -1,4 +1,7 @@
|
|||
<style>
|
||||
* {
|
||||
font: 16px SerenitySans;
|
||||
}
|
||||
.container {
|
||||
display: grid;
|
||||
background-color: lightsalmon;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue