mirror of
https://github.com/fergalmoran/ladybird.git
synced 2025-12-24 02:09:28 +00:00
LibWeb: Don't crash when input with no associated text node loses focus
This commit is contained in:
committed by
Tim Ledbetter
parent
5010e42cd3
commit
56441fe3e6
@@ -1187,11 +1187,12 @@ void HTMLInputElement::did_receive_focus()
|
||||
|
||||
void HTMLInputElement::did_lose_focus()
|
||||
{
|
||||
if (m_text_node)
|
||||
if (m_text_node) {
|
||||
m_text_node->invalidate_style(DOM::StyleInvalidationReason::DidLoseFocus);
|
||||
|
||||
if (auto* paintable = m_text_node->paintable())
|
||||
paintable->set_selected(false);
|
||||
if (auto* paintable = m_text_node->paintable())
|
||||
paintable->set_selected(false);
|
||||
}
|
||||
|
||||
if (m_placeholder_text_node)
|
||||
m_placeholder_text_node->invalidate_style(DOM::StyleInvalidationReason::DidLoseFocus);
|
||||
|
||||
Reference in New Issue
Block a user