From d0076aaa24ce222381a12aeacecb189c85ff33ba Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Sun, 14 Apr 2024 09:31:36 +0200 Subject: [PATCH] LibWeb: Remove unnecessary Document::force_layout() API The only remaining client of this API can simply not call it, and let normal DOM layout invalidation happen. --- Userland/Libraries/LibWeb/DOM/Document.cpp | 6 ------ Userland/Libraries/LibWeb/DOM/Document.h | 2 -- Userland/Services/WebContent/ConnectionFromClient.cpp | 5 ----- 3 files changed, 13 deletions(-) diff --git a/Userland/Libraries/LibWeb/DOM/Document.cpp b/Userland/Libraries/LibWeb/DOM/Document.cpp index f7e022b5e5f..cff8665e072 100644 --- a/Userland/Libraries/LibWeb/DOM/Document.cpp +++ b/Userland/Libraries/LibWeb/DOM/Document.cpp @@ -1007,12 +1007,6 @@ void Document::set_needs_layout() schedule_layout_update(); } -void Document::force_layout() -{ - tear_down_layout_tree(); - update_layout(); -} - void Document::invalidate_layout() { tear_down_layout_tree(); diff --git a/Userland/Libraries/LibWeb/DOM/Document.h b/Userland/Libraries/LibWeb/DOM/Document.h index 00a6b2bf8f2..f79d2d07237 100644 --- a/Userland/Libraries/LibWeb/DOM/Document.h +++ b/Userland/Libraries/LibWeb/DOM/Document.h @@ -207,8 +207,6 @@ public: Color visited_link_color() const; void set_visited_link_color(Color); - void force_layout(); - void update_style(); void update_layout(); void update_paint_and_hit_testing_properties_if_needed(); diff --git a/Userland/Services/WebContent/ConnectionFromClient.cpp b/Userland/Services/WebContent/ConnectionFromClient.cpp index 2a6558bdabe..2b3f15df094 100644 --- a/Userland/Services/WebContent/ConnectionFromClient.cpp +++ b/Userland/Services/WebContent/ConnectionFromClient.cpp @@ -743,11 +743,6 @@ void ConnectionFromClient::remove_dom_node(u64 page_id, i32 node_id) dom_node->remove(); - // FIXME: When nodes are removed from the DOM, the associated layout nodes become stale and still - // remain in the layout tree. This has to be fixed, this just causes everything to be recomputed - // which really hurts performance. - active_document->force_layout(); - async_did_finish_editing_dom_node(page_id, previous_dom_node->unique_id()); }