mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 05:38:11 +00:00
LibWeb: Reset canvas elements when their width/height attribute are set
This commit is contained in:
parent
88ef1bff38
commit
b4a8be5dc9
1 changed files with 6 additions and 0 deletions
|
@ -38,11 +38,17 @@ unsigned HTMLCanvasElement::height() const
|
|||
void HTMLCanvasElement::set_width(unsigned value)
|
||||
{
|
||||
set_attribute(HTML::AttributeNames::width, String::number(value));
|
||||
m_bitmap = nullptr;
|
||||
if (m_context)
|
||||
m_context->reset_to_default_state();
|
||||
}
|
||||
|
||||
void HTMLCanvasElement::set_height(unsigned value)
|
||||
{
|
||||
set_attribute(HTML::AttributeNames::height, String::number(value));
|
||||
m_bitmap = nullptr;
|
||||
if (m_context)
|
||||
m_context->reset_to_default_state();
|
||||
}
|
||||
|
||||
RefPtr<Layout::Node> HTMLCanvasElement::create_layout_node(NonnullRefPtr<CSS::StyleProperties> style)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue