diff --git a/Tests/LibWeb/Layout/expected/textarea-reset.txt b/Tests/LibWeb/Layout/expected/textarea-reset.txt new file mode 100644 index 00000000000..5f8f365afa6 --- /dev/null +++ b/Tests/LibWeb/Layout/expected/textarea-reset.txt @@ -0,0 +1,26 @@ +Viewport <#document> at (0,0) content-size 800x600 children: not-inline + BlockContainer at (0,0) content-size 800x600 [BFC] children: not-inline + BlockContainer at (8,8) content-size 784x34 children: not-inline + BlockContainer at (8,8) content-size 784x34 children: inline + frag 0 from BlockContainer start: 0, length: 0, rect: [11,11 185.875x28] baseline: 13.296875 + TextNode <#text> + BlockContainer at (11,11) content-size 185.875x28 inline-block [BFC] children: not-inline + BlockContainer
at (11,11) content-size 185.875x17 children: not-inline + BlockContainer
at (11,11) content-size 185.875x17 children: inline + frag 0 from TextNode start: 0, length: 14, rect: [11,11 108.453125x17] baseline: 13.296875 + "Original value" + TextNode <#text> + TextNode <#text> + BlockContainer <(anonymous)> at (8,58) content-size 784x0 children: inline + TextNode <#text> + TextNode <#text> + +ViewportPaintable (Viewport<#document>) [0,0 800x600] + PaintableWithLines (BlockContainer) [0,0 800x600] + PaintableWithLines (BlockContainer) [8,8 784x34] overflow: [8,8 784x50] + PaintableWithLines (BlockContainer
#form) [8,8 784x34] + PaintableWithLines (BlockContainer +
+ diff --git a/Userland/Libraries/LibWeb/HTML/HTMLTextAreaElement.cpp b/Userland/Libraries/LibWeb/HTML/HTMLTextAreaElement.cpp index c49bb17f064..1995b52ce3a 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLTextAreaElement.cpp +++ b/Userland/Libraries/LibWeb/HTML/HTMLTextAreaElement.cpp @@ -96,7 +96,10 @@ void HTMLTextAreaElement::reset_algorithm() // and set the raw value of element to its child text content. set_raw_value(child_text_content()); - update_placeholder_visibility(); + if (m_text_node) { + m_text_node->set_text_content(m_raw_value); + update_placeholder_visibility(); + } } void HTMLTextAreaElement::form_associated_element_was_inserted()