-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
LibWeb/CSS: Recalculate calc() numeric type when resolving percentages
Previously, `percentage_of` would be called on the previous value, potentially changing its numeric type, yet this potential change was never reflected as the old numeric type was always used. Now, the numeric type will be re-calculated every time after the percentage is resolved. As well, VERIFY checks have been placed to uphold the requirements for the numeric types to match what the actual values are.
- Loading branch information
Showing
3 changed files
with
28 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 change: 1 addition & 0 deletions
1
Tests/LibWeb/Text/expected/css/singular-percentage-calc-crash.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
PASS! (Didn't crash) |
12 changes: 12 additions & 0 deletions
12
Tests/LibWeb/Text/input/css/singular-percentage-calc-crash.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
<script src="../include.js"></script> | ||
<style> | ||
div { | ||
transform: translateX(calc(10%)) | ||
} | ||
</style> | ||
<div></div> | ||
<script> | ||
test(() => { | ||
println(`PASS! (Didn't crash)`); | ||
}); | ||
</script> |