mirror of
https://github.com/fergalmoran/ladybird.git
synced 2026-01-04 07:36:50 +00:00
LibWeb: Don't proceed with Element.click() on disabled form controls
Fixes an infinite reload loop on some of the dom/events/ tests in WPT.
This commit is contained in:
committed by
Andreas Kling
parent
696ccc1aa9
commit
273593afba
@@ -496,7 +496,11 @@ JS::GCPtr<DOM::NodeList> HTMLElement::labels()
|
||||
// https://html.spec.whatwg.org/multipage/interaction.html#dom-click
|
||||
void HTMLElement::click()
|
||||
{
|
||||
// FIXME: 1. If this element is a form control that is disabled, then return.
|
||||
// 1. If this element is a form control that is disabled, then return.
|
||||
if (auto* form_control = dynamic_cast<FormAssociatedElement*>(this)) {
|
||||
if (!form_control->enabled())
|
||||
return;
|
||||
}
|
||||
|
||||
// 2. If this element's click in progress flag is set, then return.
|
||||
if (m_click_in_progress)
|
||||
|
||||
Reference in New Issue
Block a user