LibWeb: Don't dispatch click events to disabled FormAssociatedElements

Disabled FormAssociatedElements also no longer receive focus when
clicked.
This commit is contained in:
Tim Ledbetter 2024-07-12 11:06:08 +01:00 committed by Andreas Kling
parent c09b5b8df0
commit e18501f67f
Notes: sideshowbarker 2024-07-17 05:03:11 +09:00
4 changed files with 25 additions and 10 deletions

View file

@ -778,9 +778,11 @@ void HTMLInputElement::create_button_input_shadow_tree()
{
auto shadow_root = heap().allocate<DOM::ShadowRoot>(realm(), document(), *this, Bindings::ShadowRootMode::Closed);
set_shadow_root(shadow_root);
auto text_container = MUST(DOM::create_element(document(), HTML::TagNames::span, Namespace::HTML));
MUST(text_container->set_attribute(HTML::AttributeNames::style, "display: inline-block; pointer-events: none;"_string));
m_text_node = heap().allocate<DOM::Text>(realm(), document(), value());
MUST(shadow_root->append_child(*m_text_node));
MUST(text_container->append_child(*m_text_node));
MUST(shadow_root->append_child(*text_container));
}
void HTMLInputElement::create_text_input_shadow_tree()