mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-09-21 16:58:58 +00:00
LibWeb: Simplify getting the document's root element in elementFromPoint
This commit is contained in:
parent
518c048eb4
commit
cc19dd3fb0
Notes:
github-actions[bot]
2025-08-26 08:27:12 +00:00
Author: https://github.com/gmta
Commit: cc19dd3fb0
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/5952
1 changed files with 2 additions and 2 deletions
|
@ -5625,8 +5625,8 @@ Element const* Document::element_from_point(double x, double y)
|
|||
return static_cast<Element*>(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<Element>(); document_root_element)
|
||||
return document_root_element;
|
||||
if (auto const* root_element = document_element())
|
||||
return root_element;
|
||||
|
||||
// 4. Return null.
|
||||
return nullptr;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue