Skip to content

Commit 83fb690

Browse files
kalenikaliaksandrgmta
authored andcommitted
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.
1 parent b786935 commit 83fb690

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

Libraries/LibWeb/Page/EventHandler.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -51,11 +51,11 @@ static GC::Ptr<DOM::Node> dom_node_for_event_dispatch(Painting::Paintable& paint
5151
{
5252
if (auto node = paintable.dom_node())
5353
return node;
54-
auto* layout_parent = paintable.layout_node().parent();
55-
while (layout_parent) {
56-
if (auto* node = layout_parent->dom_node())
54+
auto* parent = paintable.parent();
55+
while (parent) {
56+
if (auto node = parent->dom_node())
5757
return node;
58-
layout_parent = layout_parent->parent();
58+
parent = parent->parent();
5959
}
6060
return nullptr;
6161
}

0 commit comments

Comments
 (0)