Libweb: Invalidate layout for the value-attribute of li-elements

This commit is contained in:
InvalidUsernameException 2025-05-10 19:08:25 +02:00 committed by Andreas Kling
parent 370098514a
commit 029bcf13fd
Notes: github-actions[bot] 2025-05-10 23:15:26 +00:00
6 changed files with 38 additions and 4 deletions

View file

@ -27,6 +27,17 @@ void HTMLLIElement::initialize(JS::Realm& realm)
Base::initialize(realm);
}
void HTMLLIElement::attribute_changed(FlyString const& local_name, Optional<String> const& old_value, Optional<String> const& value, Optional<FlyString> const& namespace_)
{
Base::attribute_changed(local_name, old_value, value, namespace_);
if (local_name == HTML::AttributeNames::value) {
if (auto* owner = list_owner()) {
owner->set_needs_layout_tree_update(true, DOM::SetNeedsLayoutTreeUpdateReason::HTMLOListElementOrdinalValues);
}
}
}
// https://html.spec.whatwg.org/multipage/grouping-content.html#dom-li-value
WebIDL::Long HTMLLIElement::value()
{