Closed Bug 1800370 Opened 2 years ago Closed 2 years ago

Click listeners should not fire when a form-associate custom element is disabled

Categories

(Core :: DOM: UI Events & Focus Handling, defect)

Firefox 106
Desktop
All
defect

Tracking

()

VERIFIED FIXED
110 Branch
Tracking Status
firefox-esr102 --- wontfix
firefox107 --- wontfix
firefox108 --- wontfix
firefox109 --- wontfix
firefox110 --- verified

People

(Reporter: web, Assigned: edgar)

References

(Blocks 1 open bug)

Details

Attachments

(2 files)

Attached file index.html

User Agent: Mozilla/5.0 (X11; Linux x86_64; rv:106.0) Gecko/20100101 Firefox/106.0

Steps to reproduce:

Given a form-associate custom element with a click listener, those listener callbacks should not run on click when the element matches :disabled

for example, an <x-checkbox> (see attached) which toggle's it's checked attribute and sets form state when clicked should not run it's private #onClick listener when it's containing fieldset has the disabled attribute. Compare with Chromium's behaviour.

Actual results:

Click listeners ran

Expected results:

Click listeners should not run

Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:106.0) Gecko/20100101 Firefox/106.0

Hi,

I am able to reproduce the issue in release 106.0.5, beta 107.0 and the latest nightly 108.0a1 (2022-11-14) on Windows 10 as well.
Not a regression since in the older Fx versions the <x-checkbox> is not displayed at all, and until then, the issue is reproducible in all Fx versions tested.

Thanks for your input.

Severity: -- → S3
Status: UNCONFIRMED → NEW
Has STR: --- → yes
Component: Untriaged → DOM: UI Events & Focus Handling
Ever confirmed: true
OS: Unspecified → All
Product: Firefox → Core
Hardware: Unspecified → Desktop
Summary: elementinternals click listeners should not fire when element is disabled → Click listeners should not fire when a form-associate custom element is disabled
Assignee: nobody → echen
Pushed by echen@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/7aeaa20a812d
Make form-associate custom element behave the same as other form control element on event dispatching; r=smaug
Created web-platform-tests PR https://github.com/web-platform-tests/wpt/pull/37750 for changes under testing/web-platform/tests

Backed out for causing failures on /disabled-event-dispatch.tentative.html

[task 2023-01-04T02:59:19.889Z] 02:59:19     INFO - TEST-PASS | /html/semantics/disabled-elements/disabled-event-dispatch.tentative.html | Testing click events when clicking child of disabled my-control. 
[task 2023-01-04T02:59:19.889Z] 02:59:19     INFO - TEST-UNEXPECTED-TIMEOUT | /html/semantics/disabled-elements/disabled-event-dispatch.tentative.html | Testing click events when clicking disabled button. - Test timed out
[task 2023-01-04T02:59:19.890Z] 02:59:19     INFO - 
[task 2023-01-04T02:59:19.890Z] 02:59:19     INFO - TEST-UNEXPECTED-NOTRUN | /html/semantics/disabled-elements/disabled-event-dispatch.tentative.html | Testing click events when clicking disabled my-control. - expected PASS
[task 2023-01-04T02:59:19.891Z] 02:59:19     INFO - TEST-UNEXPECTED-TIMEOUT | /html/semantics/disabled-elements/disabled-event-dispatch.tentative.html | expected OK
[task 2023-01-04T02:59:19.891Z] 02:59:19     INFO - TEST-INFO took 10704ms
Flags: needinfo?(echen)
Upstream PR was closed without merging

Okay, adding new tests seems make the wpt timed out, probably need to mark it requiring longer timeout value.
https://treeherder.mozilla.org/jobs?repo=try&revision=8f50b5588df8b08012539b1b9334602b1e92d629

Flags: needinfo?(echen)
Pushed by echen@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/17987b7bb072
Make form-associate custom element behave the same as other form control element on event dispatching; r=smaug
Status: NEW → RESOLVED
Closed: 2 years ago
Resolution: --- → FIXED
Target Milestone: --- → 110 Branch
Upstream PR merged by moz-wptsync-bot
Regressions: 1808443

Verified - Fixed in latest Nightly 110.0a1 (2023-01-06) using Windows 10, macOS 12 and Ubuntu 20.

Status: RESOLVED → VERIFIED
Regressions: 1818287
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: