1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 10:28:10 +00:00

LibWeb: Let HTMLCanvasElement.getContext() return null for unknown types

Currently we would assert. Also make it case sensitive.
This commit is contained in:
Linus Groh 2020-05-20 23:37:29 +01:00 committed by Andreas Kling
parent 50c0944767
commit abb33d425e
2 changed files with 8 additions and 10 deletions

View file

@ -76,7 +76,7 @@ RefPtr<LayoutNode> HTMLCanvasElement::create_layout_node(const StyleProperties*
CanvasRenderingContext2D* HTMLCanvasElement::get_context(String type)
{
ASSERT(type.to_lowercase() == "2d");
ASSERT(type == "2d");
if (!m_context)
m_context = CanvasRenderingContext2D::create(*this);
return m_context;