LibWeb: Dispatch pointer events to ::backdrop originating element

This commit is contained in:
Gingeh 2025-04-07 19:33:53 +10:00 committed by Sam Atkins
commit 972547635f
Notes: github-actions[bot] 2025-04-09 11:11:42 +00:00
7 changed files with 47 additions and 13 deletions

View file

@ -66,6 +66,12 @@ static DOM::Node* input_control_associated_with_ancestor_label_element(Painting:
static bool parent_element_for_event_dispatch(Painting::Paintable& paintable, GC::Ptr<DOM::Node>& node, Layout::Node*& layout_node)
{
layout_node = &paintable.layout_node();
if (layout_node->is_generated_for_backdrop_pseudo_element()) {
node = layout_node->pseudo_element_generator();
layout_node = node->layout_node();
}
auto* current_ancestor_node = node.ptr();
do {
if (is<HTML::FormAssociatedElement>(current_ancestor_node) && !dynamic_cast<HTML::FormAssociatedElement*>(current_ancestor_node)->enabled()) {
@ -73,7 +79,6 @@ static bool parent_element_for_event_dispatch(Painting::Paintable& paintable, GC
}
} while ((current_ancestor_node = current_ancestor_node->parent()));
layout_node = &paintable.layout_node();
while (layout_node && node && !node->is_element() && layout_node->parent()) {
layout_node = layout_node->parent();
if (layout_node->is_anonymous())