LibWeb: Use unsafe_layout_node() when handling alt attribute changes

The layout node is only accessed to clear the cached alt value, so the
layout tree doesn't need to be up to date in this case.
This commit is contained in:
Tim Ledbetter 2026-03-17 07:20:17 +00:00 committed by Jelle Raaijmakers
parent 711fb81808
commit a4f6ce3662
Notes: github-actions[bot] 2026-03-17 08:08:06 +00:00
2 changed files with 9 additions and 2 deletions

View file

@ -1543,8 +1543,8 @@ void HTMLInputElement::form_associated_element_attribute_changed(FlyString const
} else if (name == HTML::AttributeNames::src) {
handle_src_attribute(value.value_or({})).release_value_but_fixme_should_propagate_errors();
} else if (name == HTML::AttributeNames::alt) {
if (layout_node() && type_state() == TypeAttributeState::ImageButton)
did_update_alt_text(as<Layout::ImageBox>(*layout_node()));
if (unsafe_layout_node() && type_state() == TypeAttributeState::ImageButton)
did_update_alt_text(as<Layout::ImageBox>(*unsafe_layout_node()));
} else if (name == HTML::AttributeNames::maxlength) {
handle_maxlength_attribute();
} else if (name == HTML::AttributeNames::multiple) {