From cc19dd3fb07ca50cfc804d5bd1d76105bc74e5ec Mon Sep 17 00:00:00 2001 From: Jelle Raaijmakers Date: Fri, 22 Aug 2025 11:03:42 +0200 Subject: [PATCH] LibWeb: Simplify getting the document's root element in elementFromPoint --- Libraries/LibWeb/DOM/Document.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Libraries/LibWeb/DOM/Document.cpp b/Libraries/LibWeb/DOM/Document.cpp index 57037fe6b39..9038b72608d 100644 --- a/Libraries/LibWeb/DOM/Document.cpp +++ b/Libraries/LibWeb/DOM/Document.cpp @@ -5625,8 +5625,8 @@ Element const* Document::element_from_point(double x, double y) return static_cast(hit_test_result->dom_node()); // 3. If the document has a root element, return the root element and terminate these steps. - if (auto const* document_root_element = first_child_of_type(); document_root_element) - return document_root_element; + if (auto const* root_element = document_element()) + return root_element; // 4. Return null. return nullptr;