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
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

@ -3298,10 +3298,10 @@ size_t Element::number_of_owned_list_items() const
}
// https://html.spec.whatwg.org/multipage/grouping-content.html#list-owner
Element const* Element::list_owner() const
Element* Element::list_owner() const
{
// Any element whose computed value of 'display' is 'list-item' has a list owner, which is determined as follows:
if (!computed_properties()->display().is_list_item())
if (!computed_properties() || !computed_properties()->display().is_list_item())
return nullptr;
// 1. If the element is not being rendered, return null; the element has no list owner.
@ -3332,7 +3332,7 @@ Element const* Element::list_owner() const
}
return IterationDecision::Continue;
});
return ancestor;
return const_cast<Element*>(ancestor.ptr());
}
// https://html.spec.whatwg.org/multipage/grouping-content.html#ordinal-value

View file

@ -468,7 +468,7 @@ public:
}
size_t number_of_owned_list_items() const;
Element const* list_owner() const;
Element* list_owner() const;
size_t ordinal_value() const;
void set_pointer_capture(WebIDL::Long pointer_id);