mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 05:37:34 +00:00
LibWeb: Add missing null check while dispatching mouseenter events
This commit is contained in:
parent
3408f7a3c5
commit
b4f9db84ca
1 changed files with 1 additions and 1 deletions
|
@ -954,7 +954,7 @@ void Document::set_hovered_node(Node* node)
|
||||||
// https://w3c.github.io/uievents/#mouseenter
|
// https://w3c.github.io/uievents/#mouseenter
|
||||||
if (m_hovered_node && (!old_hovered_node || !m_hovered_node->is_ancestor_of(*old_hovered_node))) {
|
if (m_hovered_node && (!old_hovered_node || !m_hovered_node->is_ancestor_of(*old_hovered_node))) {
|
||||||
// FIXME: Check if we need to dispatch these events in a specific order.
|
// FIXME: Check if we need to dispatch these events in a specific order.
|
||||||
for (auto target = m_hovered_node; target.ptr() != common_ancestor; target = target->parent()) {
|
for (auto target = m_hovered_node; target && target.ptr() != common_ancestor; target = target->parent()) {
|
||||||
// FIXME: Populate the event with mouse coordinates, etc.
|
// FIXME: Populate the event with mouse coordinates, etc.
|
||||||
target->dispatch_event(*UIEvents::MouseEvent::create(realm(), UIEvents::EventNames::mouseenter));
|
target->dispatch_event(*UIEvents::MouseEvent::create(realm(), UIEvents::EventNames::mouseenter));
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue