mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-28 11:49:44 +00:00
LibWeb: Be less aggressive in marking elements as not being named
When an element's ID is removed we only want to remove it from `m_potentially_named_elements` if it is not also considered a potentially named element due to it's name content attribute.
This commit is contained in:
parent
2f9957c618
commit
64f09b520d
Notes:
github-actions[bot]
2025-05-22 14:57:08 +00:00
Author: https://github.com/Calme1709
Commit: 64f09b520d
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/4842
Reviewed-by: https://github.com/gmta ✅
3 changed files with 131 additions and 1 deletions
|
@ -5440,7 +5440,7 @@ void Document::element_id_changed(Badge<DOM::Element>, GC::Ref<DOM::Element> ele
|
|||
|
||||
if (element->id().has_value())
|
||||
insert_in_tree_order(m_potentially_named_elements, element);
|
||||
else
|
||||
else if (!element->name().has_value())
|
||||
(void)m_potentially_named_elements.remove_first_matching([element](auto& e) { return e == element; });
|
||||
|
||||
auto new_id = element->id();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue