LibWeb: Return the same DataTransfer.types() array if unmodified

This commit is contained in:
Tim Ledbetter 2025-09-05 22:19:09 +01:00 committed by Jelle Raaijmakers
commit 3099459504
Notes: github-actions[bot] 2025-09-12 10:31:31 +00:00
3 changed files with 6 additions and 1 deletions

View file

@ -74,6 +74,8 @@ void DataTransfer::visit_edges(JS::Cell::Visitor& visitor)
Base::visit_edges(visitor);
visitor.visit(m_items);
visitor.visit(m_item_list);
VISIT_CACHED_ATTRIBUTE(types);
}
void DataTransfer::set_drop_effect(String const& drop_effect)
@ -374,6 +376,7 @@ void DataTransfer::update_data_transfer_types_list()
}
// 3. Set the DataTransfer object's types array to the result of creating a frozen array from L.
set_cached_types(nullptr);
m_types = move(types);
}