mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-04-25 17:25:08 +02:00
LibWeb: Clamp CSS numeric token values to float range
This matches the behavior of other browsers. We did the equivalent
change for <integer> in b86377b
We continue to store these as doubles for the extra precision.
This commit is contained in:
Notes:
github-actions[bot]
2026-04-22 13:26:16 +00:00
Author: https://github.com/Calme1709 Commit: https://github.com/LadybirdBrowser/ladybird/commit/d6dbabdf0e7 Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/8959 Reviewed-by: https://github.com/AtkinsSJ ✅
12
Tests/LibWeb/CSSTokenizer/expected/numeric-clamping.txt
Normal file
12
Tests/LibWeb/CSSTokenizer/expected/numeric-clamping.txt
Normal file
@@ -0,0 +1,12 @@
|
||||
Percentage(value=3.4028234663852886e+38, number_type=Number, source="1e39%", start=0:0, end=0:5)
|
||||
Whitespace(source="\n", start=0:5, end=1:0)
|
||||
Percentage(value=-3.4028234663852886e+38, number_type=Number, source="-1e39%", start=1:0, end=1:6)
|
||||
Whitespace(source="\n", start=1:6, end=2:0)
|
||||
Dimension(value=3.4028234663852886e+38, number_type=Number, unit="px", source="1e39px", start=2:0, end=2:6)
|
||||
Whitespace(source="\n", start=2:6, end=3:0)
|
||||
Dimension(value=-3.4028234663852886e+38, number_type=Number, unit="px", source="-1e39px", start=3:0, end=3:7)
|
||||
Whitespace(source="\n", start=3:7, end=4:0)
|
||||
Number(value=3.4028234663852886e+38, number_type=Number, source="1e39", start=4:0, end=4:4)
|
||||
Whitespace(source="\n", start=4:4, end=5:0)
|
||||
Number(value=-3.4028234663852886e+38, number_type=Number, source="-1e39", start=5:0, end=5:5)
|
||||
__EOF__(source="", start=5:5, end=5:5)
|
||||
6
Tests/LibWeb/CSSTokenizer/input/numeric-clamping.css
Normal file
6
Tests/LibWeb/CSSTokenizer/input/numeric-clamping.css
Normal file
@@ -0,0 +1,6 @@
|
||||
1e39%
|
||||
-1e39%
|
||||
1e39px
|
||||
-1e39px
|
||||
1e39
|
||||
-1e39
|
||||
Reference in New Issue
Block a user