mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-12-07 21:59:54 +00: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:
parent
b786935169
commit
83fb690bce
Notes:
github-actions[bot]
2025-10-10 07:04:46 +00:00
Author: https://github.com/kalenikaliaksandr
Commit: 83fb690bce
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/6433
Reviewed-by: https://github.com/gmta ✅
1 changed files with 4 additions and 4 deletions
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue