mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-01 13:49:16 +00:00
LibWeb: Don't dispatch click events to disabled FormAssociatedElements
Disabled FormAssociatedElements also no longer receive focus when clicked.
This commit is contained in:
parent
c09b5b8df0
commit
e18501f67f
Notes:
sideshowbarker
2024-07-17 05:03:11 +09:00
Author: https://github.com/tcl3
Commit: e18501f67f
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/601
4 changed files with 25 additions and 10 deletions
|
@ -47,6 +47,13 @@ static JS::GCPtr<DOM::Node> dom_node_for_event_dispatch(Painting::Paintable& pai
|
|||
|
||||
static bool parent_element_for_event_dispatch(Painting::Paintable& paintable, JS::GCPtr<DOM::Node>& node, Layout::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()) {
|
||||
return false;
|
||||
}
|
||||
} 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();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue