mirror of
https://github.com/RGBCube/serenity
synced 2025-07-28 13:47:46 +00:00
LibWeb: Bounds-check parsed CSS types
This reintroduces bounds-checking for the CSS `<angle>`, `<frequency>`,
`<integer>`, `<length>`, `<number>`, `<percentage>`, `<resolution>`,
and `<time>` types.
I regressed this around 6b8f484114
when
changing how we parsed StyleValues.
This is an improvement from before though, since we now allow the bounds
of a dimension type to have units.
Added a test to make sure we don't regress this again. :^)
This commit is contained in:
parent
51f75d7071
commit
1f2629f132
3 changed files with 37 additions and 14 deletions
8
Tests/LibWeb/Layout/expected/negative-max-size.txt
Normal file
8
Tests/LibWeb/Layout/expected/negative-max-size.txt
Normal file
|
@ -0,0 +1,8 @@
|
|||
Viewport <#document> at (0,0) content-size 800x600 children: not-inline
|
||||
BlockContainer <html> at (0,0) content-size 800x35.46875 [BFC] children: not-inline
|
||||
BlockContainer <body> at (8,8) content-size 784x19.46875 children: not-inline
|
||||
BlockContainer <div> at (9,9) content-size 782x17.46875 children: inline
|
||||
line 0 width: 147.1875, height: 17.46875, bottom: 17.46875, baseline: 13.53125
|
||||
frag 0 from TextNode start: 0, length: 20, rect: [9,9 147.1875x17.46875]
|
||||
"Well, hello friends!"
|
||||
TextNode <#text>
|
9
Tests/LibWeb/Layout/input/negative-max-size.html
Normal file
9
Tests/LibWeb/Layout/input/negative-max-size.html
Normal file
|
@ -0,0 +1,9 @@
|
|||
<!doctype html><style>
|
||||
* {
|
||||
font: 16px SerenitySans;
|
||||
}
|
||||
div {
|
||||
border: 1px solid black;
|
||||
max-width: -90px;
|
||||
}
|
||||
</style><div>Well, hello friends!</div>
|
Loading…
Add table
Add a link
Reference in a new issue