From 8f00e2e7f51903c3881349f63f8823a7d14dba97 Mon Sep 17 00:00:00 2001 From: Chase Knowlden Date: Tue, 19 Nov 2024 21:01:07 -0500 Subject: [PATCH] LibWeb: Clear active targets before invoking them --- Libraries/LibWeb/DOM/Document.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Libraries/LibWeb/DOM/Document.cpp b/Libraries/LibWeb/DOM/Document.cpp index eefd4d6ab00..2736b1e084a 100644 --- a/Libraries/LibWeb/DOM/Document.cpp +++ b/Libraries/LibWeb/DOM/Document.cpp @@ -5203,11 +5203,11 @@ size_t Document::broadcast_active_resize_observations() shallowest_target_depth = target_depth; } - // 4. Invoke observer.[[callback]] with entries. - observer->invoke_callback(entries); - - // 5. Clear observer.[[activeTargets]]. + // 4. Clear observer.[[activeTargets]]. observer->active_targets().clear(); + + // 5. Invoke observer.[[callback]] with entries. + observer->invoke_callback(entries); } return shallowest_target_depth;