mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-09 09:39:39 +00:00
LibWeb: Preserve order of HTMLCollection property names
The supported property names should be ordered in "tree order", though m_cached_name_to_element_mappings doesn't preserve this ordering, which breaks Object.getOwnPropertyNames. Fixes at least the following WPT tests: - https://wpt.live/dom/nodes/Element-children.html - https://wpt.live/dom/collections/HTMLCollection-live-mutations.window.html - https://wpt.live/dom/collections/HTMLCollection-supported-property-names.html
This commit is contained in:
parent
193c0dcafc
commit
d00adabc3c
Notes:
github-actions[bot]
2024-10-04 21:44:52 +00:00
Author: https://github.com/scorpion-26 🔰
Commit: d00adabc3c
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/1631
Reviewed-by: https://github.com/tcl3 ✅
4 changed files with 13 additions and 2 deletions
|
@ -61,7 +61,7 @@ private:
|
|||
|
||||
mutable u64 m_cached_dom_tree_version { 0 };
|
||||
mutable Vector<JS::NonnullGCPtr<Element>> m_cached_elements;
|
||||
mutable OwnPtr<HashMap<FlyString, JS::NonnullGCPtr<Element>>> m_cached_name_to_element_mappings;
|
||||
mutable OwnPtr<OrderedHashMap<FlyString, JS::NonnullGCPtr<Element>>> m_cached_name_to_element_mappings;
|
||||
|
||||
JS::NonnullGCPtr<ParentNode> m_root;
|
||||
Function<bool(Element const&)> m_filter;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue