LibWeb: Use the GC::RootVector deduction guides where helpful
Some checks are pending
CI / Lagom (arm64, Sanitizer_CI, false, macOS, macos-15, Clang) (push) Waiting to run
CI / Lagom (x86_64, Fuzzers_CI, false, Linux, blacksmith-16vcpu-ubuntu-2404, Clang) (push) Waiting to run
CI / Lagom (x86_64, Sanitizer_CI, false, Linux, blacksmith-16vcpu-ubuntu-2404, GNU) (push) Waiting to run
CI / Lagom (x86_64, Sanitizer_CI, true, Linux, blacksmith-16vcpu-ubuntu-2404, Clang) (push) Waiting to run
Package the js repl as a binary artifact / build-and-package (arm64, macOS, macOS-universal2, macos-15) (push) Waiting to run
Package the js repl as a binary artifact / build-and-package (x86_64, Linux, Linux-x86_64, blacksmith-8vcpu-ubuntu-2404) (push) Waiting to run
Run test262 and test-wasm / run_and_update_results (push) Waiting to run
Lint Code / lint (push) Waiting to run
Label PRs with merge conflicts / auto-labeler (push) Waiting to run
Push notes / build (push) Waiting to run

This commit is contained in:
Andreas Kling 2025-05-29 00:16:26 +02:00 committed by Alexander Kalenik
commit 00ad2bd758
Notes: github-actions[bot] 2025-05-29 01:48:04 +00:00

View file

@ -4623,11 +4623,7 @@ void Document::queue_intersection_observer_task()
m_intersection_observer_task_queued = false;
// 2. Let notify list be a list of all IntersectionObservers whose root is in the DOM tree of document.
Vector<GC::Root<IntersectionObserver::IntersectionObserver>> notify_list;
notify_list.try_ensure_capacity(m_intersection_observers.size()).release_value_but_fixme_should_propagate_errors();
for (auto& observer : m_intersection_observers) {
notify_list.append(GC::make_root(observer));
}
auto notify_list = GC::RootVector { heap(), m_intersection_observers.values() };
// 3. For each IntersectionObserver object observer in notify list, run these steps:
for (auto& observer : notify_list) {
@ -4709,10 +4705,7 @@ void Document::run_the_update_intersection_observations_steps(HighResolutionTime
// 2. For each observer in observer list:
// NOTE: We make a copy of the intersection observers list to avoid modifying it while iterating.
GC::RootVector<GC::Ref<IntersectionObserver::IntersectionObserver>> intersection_observers(heap());
intersection_observers.ensure_capacity(m_intersection_observers.size());
for (auto& observer : m_intersection_observers)
intersection_observers.append(observer);
auto intersection_observers = GC::RootVector { heap(), m_intersection_observers.values() };
for (auto& observer : intersection_observers) {
// 1. Let rootBounds be observers root intersection rectangle.
@ -5829,11 +5822,7 @@ size_t Document::broadcast_active_resize_observations()
// 2. For each observer in document.[[resizeObservers]] run these steps:
// NOTE: We make a copy of the resize observers list to avoid modifying it while iterating.
GC::RootVector<GC::Ref<ResizeObserver::ResizeObserver>> resize_observers(heap());
resize_observers.ensure_capacity(m_resize_observers.size());
for (auto const& observer : m_resize_observers)
resize_observers.append(observer);
auto resize_observers = GC::RootVector { heap(), m_resize_observers };
for (auto const& observer : resize_observers) {
// 1. If observer.[[activeTargets]] slot is empty, continue.
if (observer->active_targets().is_empty()) {