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
parent 9f3c3925e0
commit 6af7f7e0f5
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) {