mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-05 07:41:01 +00:00
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
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:
parent
5c5283492b
commit
00ad2bd758
Notes:
github-actions[bot]
2025-05-29 01:48:04 +00:00
Author: https://github.com/awesomekling
Commit: 00ad2bd758
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/4899
Reviewed-by: https://github.com/Hendiadyoin1
Reviewed-by: https://github.com/shannonbooth
1 changed files with 3 additions and 14 deletions
|
@ -4623,11 +4623,7 @@ void Document::queue_intersection_observer_task()
|
||||||
m_intersection_observer_task_queued = false;
|
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.
|
// 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;
|
auto notify_list = GC::RootVector { heap(), m_intersection_observers.values() };
|
||||||
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));
|
|
||||||
}
|
|
||||||
|
|
||||||
// 3. For each IntersectionObserver object observer in notify list, run these steps:
|
// 3. For each IntersectionObserver object observer in notify list, run these steps:
|
||||||
for (auto& observer : notify_list) {
|
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:
|
// 2. For each observer in observer list:
|
||||||
|
|
||||||
// NOTE: We make a copy of the intersection observers list to avoid modifying it while iterating.
|
// 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());
|
auto intersection_observers = GC::RootVector { heap(), m_intersection_observers.values() };
|
||||||
intersection_observers.ensure_capacity(m_intersection_observers.size());
|
|
||||||
for (auto& observer : m_intersection_observers)
|
|
||||||
intersection_observers.append(observer);
|
|
||||||
|
|
||||||
for (auto& observer : intersection_observers) {
|
for (auto& observer : intersection_observers) {
|
||||||
// 1. Let rootBounds be observer’s root intersection rectangle.
|
// 1. Let rootBounds be observer’s root intersection rectangle.
|
||||||
|
@ -5829,11 +5822,7 @@ size_t Document::broadcast_active_resize_observations()
|
||||||
// 2. For each observer in document.[[resizeObservers]] run these steps:
|
// 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.
|
// 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());
|
auto resize_observers = GC::RootVector { heap(), m_resize_observers };
|
||||||
resize_observers.ensure_capacity(m_resize_observers.size());
|
|
||||||
for (auto const& observer : m_resize_observers)
|
|
||||||
resize_observers.append(observer);
|
|
||||||
|
|
||||||
for (auto const& observer : resize_observers) {
|
for (auto const& observer : resize_observers) {
|
||||||
// 1. If observer.[[activeTargets]] slot is empty, continue.
|
// 1. If observer.[[activeTargets]] slot is empty, continue.
|
||||||
if (observer->active_targets().is_empty()) {
|
if (observer->active_targets().is_empty()) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue