Setting CanvasRenderingContext2D.filter when the canvas has no layout node crashes with null deref #3661
Labels
bug
Something isn't working
reduction of web content
Issue has a simplified reduction based on real-world web content.
web compatibility
Example:
Found on https://jigsawpuzzles.io/
This is caused by this code having an incorrect assumption that
update_layout
will make layout nodes non-null. However, this is not the case for elements not in the DOM yet, or hasdisplay: none;
set.ladybird/Libraries/LibWeb/HTML/CanvasRenderingContext2D.cpp
Lines 959 to 961 in a4ee3fb
This doesn't seem like it can be fixed by returning if the layout node is null, because it's possible that
filter
is only set/used whilst the canvas has no layout node. For example, a fingerprinting script could do this, where it never appends the canvas to the DOM.The text was updated successfully, but these errors were encountered: