1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 11:18:11 +00:00

LibWeb: Ensure DOM events on slottables are properly propagated

Most events on a slottable are composed, meaning they propagate from the
slottable and through its shadow tree before bubbling up to the parent
of the slottable.
This commit is contained in:
Timothy Flynn 2023-09-05 15:15:28 -04:00 committed by Andreas Kling
parent d67d93f870
commit e4d3a9aa68
2 changed files with 32 additions and 7 deletions

View file

@ -929,7 +929,11 @@ void Node::detach_layout_node(Badge<Layout::TreeBuilder>)
EventTarget* Node::get_parent(Event const&)
{
// FIXME: returns the nodes assigned slot, if node is assigned, and nodes parent otherwise.
// A nodes get the parent algorithm, given an event, returns the nodes assigned slot, if node is assigned;
// otherwise nodes parent.
if (auto assigned_slot = assigned_slot_for_node(*this))
return assigned_slot.ptr();
return parent();
}