mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 03:47:35 +00:00
LibWeb: Null check fonts after parsing them in CRC2D.font assignment
Fixes an issue where setting CRC2D.font to an unparseable value would assert due to a null dereference.
This commit is contained in:
parent
ef6a78518f
commit
f34cc0b8e3
3 changed files with 14 additions and 1 deletions
11
Tests/LibWeb/Text/input/canvas/basic.html
Normal file
11
Tests/LibWeb/Text/input/canvas/basic.html
Normal file
|
@ -0,0 +1,11 @@
|
|||
<script src="../include.js"></script>
|
||||
<script>
|
||||
test(() => {
|
||||
let canvas = document.createElement("canvas");
|
||||
let context = canvas.getContext("2d");
|
||||
context.font = '20px SerenitySans';
|
||||
println(context.font);
|
||||
context.font = '!!!'; // Invalid value, should be ignored.
|
||||
println(context.font);
|
||||
});
|
||||
</script>
|
Loading…
Add table
Add a link
Reference in a new issue