mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-29 20:29:18 +00:00
LibWeb: Ensure inert elements are not visible for hit testing
This commit is contained in:
parent
8547c1a743
commit
cb405c773b
Notes:
github-actions[bot]
2025-02-21 12:43:19 +00:00
Author: https://github.com/tcl3
Commit: cb405c773b
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/3475
Reviewed-by: https://github.com/AtkinsSJ ✅
4 changed files with 67 additions and 1 deletions
|
@ -83,6 +83,17 @@ CSS::ImmutableComputedValues const& Paintable::computed_values() const
|
|||
return m_layout_node->computed_values();
|
||||
}
|
||||
|
||||
bool Paintable::visible_for_hit_testing() const
|
||||
{
|
||||
// https://html.spec.whatwg.org/multipage/interaction.html#inert-subtrees
|
||||
// When a node is inert:
|
||||
// - Hit-testing must act as if the 'pointer-events' CSS property were set to 'none'.
|
||||
if (auto dom_node = this->dom_node(); dom_node && dom_node->is_inert())
|
||||
return false;
|
||||
|
||||
return computed_values().pointer_events() != CSS::PointerEvents::None;
|
||||
}
|
||||
|
||||
void Paintable::set_dom_node(GC::Ptr<DOM::Node> dom_node)
|
||||
{
|
||||
m_dom_node = dom_node;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue