LibWeb: Update placeholder visibility when the placeholder value changes

Otherwise, setting a placeholder on an element that previously did not
have a placeholder would have no visible effect.
This commit is contained in:
Timothy Flynn 2024-04-04 12:27:22 -04:00 committed by Andreas Kling
commit 6af7f7e0f5
Notes: sideshowbarker 2024-07-17 07:20:49 +09:00
3 changed files with 31 additions and 5 deletions

View file

@ -1085,8 +1085,10 @@ void HTMLInputElement::form_associated_element_attribute_changed(FlyString const
update_shadow_tree();
}
} else if (name == HTML::AttributeNames::placeholder) {
if (m_placeholder_text_node)
if (m_placeholder_text_node) {
m_placeholder_text_node->set_data(placeholder());
update_placeholder_visibility();
}
} else if (name == HTML::AttributeNames::readonly) {
handle_readonly_attribute(value);
} else if (name == HTML::AttributeNames::src) {