mirror of
https://github.com/SerenityOS/serenity.git
synced 2025-01-23 18:02:05 -05:00
LibWeb: Don't assume we hit a layout node when handling mousedown events
Regression from the introduction of CSS pointer-events in
ec43f7a2b0
.
This commit is contained in:
parent
defe4d50ff
commit
fcff6b7160
1 changed files with 6 additions and 7 deletions
|
@ -184,19 +184,18 @@ bool EventHandler::handle_mousedown(const Gfx::IntPoint& position, unsigned butt
|
|||
}
|
||||
|
||||
NonnullRefPtr document = *m_frame.active_document();
|
||||
|
||||
// TODO: Allow selecting element behind if one on top has pointer-events set to none.
|
||||
auto result = layout_root()->hit_test(position, Layout::HitTestType::Exact);
|
||||
auto pointer_events = result.layout_node->computed_values().pointer_events();
|
||||
if (pointer_events == CSS::PointerEvents::None)
|
||||
return false;
|
||||
|
||||
RefPtr<DOM::Node> node;
|
||||
|
||||
{
|
||||
// TODO: Allow selecting element behind if one on top has pointer-events set to none.
|
||||
auto result = layout_root()->hit_test(position, Layout::HitTestType::Exact);
|
||||
if (!result.layout_node)
|
||||
return false;
|
||||
|
||||
auto pointer_events = result.layout_node->computed_values().pointer_events();
|
||||
if (pointer_events == CSS::PointerEvents::None)
|
||||
return false;
|
||||
|
||||
node = result.layout_node->dom_node();
|
||||
document->set_hovered_node(node);
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue