mirror of
https://github.com/fergalmoran/ladybird.git
synced 2026-01-04 07:36:50 +00:00
LibWeb: Return null if an unknown canvas context type is requested
This commit is contained in:
@@ -47,7 +47,8 @@ RefPtr<Layout::Node> HTMLCanvasElement::create_layout_node()
|
||||
|
||||
CanvasRenderingContext2D* HTMLCanvasElement::get_context(String type)
|
||||
{
|
||||
VERIFY(type == "2d");
|
||||
if (type != "2d")
|
||||
return nullptr;
|
||||
if (!m_context)
|
||||
m_context = CanvasRenderingContext2D::create(*this);
|
||||
return m_context;
|
||||
|
||||
Reference in New Issue
Block a user