LibWeb/HTML: Add fastpath to skip selectedness update on children change

We can definitely expand on this a bunch more, but using the metadata
provided in the children change notification we are able to skip
runnning the expensive selectedness algorithm on the <select> element.

This removes children changed from appearing in the profile of:

https://wpt.live/html/select/options-length-too-large.html
This commit is contained in:
Shannon Booth 2025-01-27 13:11:06 +13:00 committed by Andrew Kaster
parent 903c8860f8
commit 075c7ea63e
Notes: github-actions[bot] 2025-01-30 20:56:44 +00:00
2 changed files with 29 additions and 0 deletions

View file

@ -110,6 +110,7 @@ private:
virtual void computed_properties_changed() override;
virtual void children_changed(ChildrenChangedMetadata const*) override;
bool can_skip_children_changed_selectedness_update(ChildrenChangedMetadata const& metadata) const;
void update_cached_list_of_options() const;
void show_the_picker_if_applicable();