Disabled form controls (<button disabled>, <input disabled>, etc.)
were swallowing all mouse events in Chrome. The fix shipped permanently in M120 (Nov 2023)
after the SendMouseEventsDisabledFormControls flag was removed.
The code is done. What remains is updating the HTML spec to match reality.
The requirement is now layered in one PR:
This addresses the layering concern: event dispatch rules live with the algorithm that fires user-input events, not in generic DOM dispatch text.
| Event | On disabled control | Bubbles past disabled control | On children of disabled control |
|---|---|---|---|
click |
Blocked | No (path truncated) | Fires |
mousedown |
Blocked | No (path truncated) | Fires |
mouseup |
Blocked | No (path truncated) | Fires |
dblclick |
Blocked | No (path truncated) | Fires |
pointerdown |
Fires | Yes (normal) | Fires |
pointerup |
Fires | Yes (normal) | Fires |
pointermove |
Fires | Yes (normal) | Fires |
File: source (form-control and event-loop sections in whatwg/html)
A form control that is disabled must prevent any click,
mousedown, mouseup, and dblclick events
that are queued on the user interaction task source from being dispatched on the element
or from bubbling past the element to its ancestors.
pointerdown and pointerup, which are dispatched normally
regardless of the disabled state. Authors who wish to observe user interaction with
disabled form controls can use pointer event listeners.
Section: Enabling and disabling form controls
For events fired from the user interaction task source, disabled form controls suppress dispatch of some trusted mouse events as defined in the task source's integration requirements below.
pointerdown and pointerup, which are dispatched normally
regardless of the disabled state. Authors who wish to observe user interaction with
disabled form controls can use pointer event listeners.
Section: Generic task sources - user interaction task source
Events sent in response to user input (e.g., click events) must be fired
using tasks queued with the user interaction task source.
For trusted click, mousedown, mouseup, and
dblclick events that are fired from tasks queued with this task source: if the
event target is a form control that is disabled, or an option element
that is disabled, then the event must not be dispatched on that element; and if the
event target is a descendant of a form control that is disabled, then the event must
not be dispatched on that form control or any of its ancestors.
EventPath::AdjustForDisabledFormControl() truncates event path at disabled controlclick, mousedown, mouseup, dblclickdom.forms.always_allow_pointer_events.enabled shipped by default (Jan 2024)disabled-event-dispatch.tentative.html - 20/20 pass (Chrome)event-propagate-disabled.tentative.html - 256/256 pass (Chrome)disabled-event-dispatch-additional.tentative.html - 8/8 pass (Chrome)fieldset-event-propagation.tentative.html - 4/4 pass (Chrome).tentative) once spec lands