[webkit-changes] [WebKit/WebKit] 001401: REGRESSION (266316 at main): Disabled checkboxes chan...

Aditya Keerthi noreply at github.com
Mon Oct 16 13:29:58 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 001401163eab13ecfa88bb58726721ac450edb3c
      https://github.com/WebKit/WebKit/commit/001401163eab13ecfa88bb58726721ac450edb3c
  Author: Aditya Keerthi <akeerthi at apple.com>
  Date:   2023-10-16 (Mon, 16 Oct 2023)

  Changed paths:
    A LayoutTests/imported/w3c/web-platform-tests/html/semantics/disabled-elements/disabled-checkbox-click-expected.txt
    A LayoutTests/imported/w3c/web-platform-tests/html/semantics/disabled-elements/disabled-checkbox-click.html
    M Source/WebCore/dom/EventDispatcher.cpp

  Log Message:
  -----------
  REGRESSION (266316 at main): Disabled checkboxes change state when clicked
https://bugs.webkit.org/show_bug.cgi?id=263148
rdar://116927372

Reviewed by Chris Dumez and Brian Weinstein.

266316 at main enabled the `SendMouseEventsToDisabledFormControlsEnabled` setting,
originally implemented in 264098 at main.

Prior to that change, `EventDispatcher::dispatchEvent` was elided for disabled
form controls. Following the change, events can be dispatched on disabled
controls. If the event is trusted, the event path is shrunk to remove the
disabled control. This means that trusted mouse events are not dispatched on
the clicked control itself. However, `HTMLInputElement::willDispatchEvent` is
still called on the disabled control, which triggers the state change.

To fix, elide the call to `HTMLInputElement::willDispatchEvent` in
`EventDispatcher::dispatchEvent` when the node is a disabled control and the
event is trusted. Untrusted click events can still change the checked state of
checkboxes.

* LayoutTests/imported/w3c/web-platform-tests/html/semantics/disabled-elements/disabled-checkbox-click-expected.txt: Added.
* LayoutTests/imported/w3c/web-platform-tests/html/semantics/disabled-elements/disabled-checkbox-click.html: Added.
* Source/WebCore/dom/EventDispatcher.cpp:
(WebCore::EventDispatcher::dispatchEvent):

Canonical link: https://commits.webkit.org/269376@main




More information about the webkit-changes mailing list