mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-05-05 06:32:30 +02:00
LibWeb: Remove usage of layout_node() in dom_node_for_event_dispatch
No need to go through layout node when paintable has a direct pointer to the DOM node.
This commit is contained in:
committed by
Jelle Raaijmakers
parent
b786935169
commit
83fb690bce
Notes:
github-actions[bot]
2025-10-10 07:04:46 +00:00
Author: https://github.com/kalenikaliaksandr Commit: https://github.com/LadybirdBrowser/ladybird/commit/83fb690bcea Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/6433 Reviewed-by: https://github.com/gmta ✅
@@ -51,11 +51,11 @@ static GC::Ptr<DOM::Node> dom_node_for_event_dispatch(Painting::Paintable& paint
|
||||
{
|
||||
if (auto node = paintable.dom_node())
|
||||
return node;
|
||||
auto* layout_parent = paintable.layout_node().parent();
|
||||
while (layout_parent) {
|
||||
if (auto* node = layout_parent->dom_node())
|
||||
auto* parent = paintable.parent();
|
||||
while (parent) {
|
||||
if (auto node = parent->dom_node())
|
||||
return node;
|
||||
layout_parent = layout_parent->parent();
|
||||
parent = parent->parent();
|
||||
}
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user