Closed Bug 1540995 Opened 6 years ago Closed 5 years ago

calling click() on a label with disabled checkbox must not toggle its checked state

Categories

(Core :: DOM: Events, defect, P2)

65 Branch
defect

Tracking

()

RESOLVED FIXED
81 Branch
Tracking Status
firefox-esr68 --- wontfix
firefox-esr78 --- wontfix
firefox79 --- wontfix
firefox80 --- wontfix
firefox81 --- fixed

People

(Reporter: loic.laussel, Assigned: saschanaz)

References

(Blocks 2 open bugs, Regression, )

Details

(5 keywords)

Attachments

(1 file, 1 obsolete file)

User Agent: Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/73.0.3683.86 Safari/537.36

Steps to reproduce:

Here's a pen to test https://codepen.io/lausselloic/pen/pBJNmV
Tested on FF64, FF65 and FF66 till FF65 the checked state is updated, that wasn't the case on FF64

Actual results:

Checkbox state change when mycheck.check() is called

Expected results:

Checkbox doesn't change as it's disabled

Blocks: 329509
Has Regression Range: --- → yes
Has STR: --- → yes
Component: Untriaged → DOM: Events
Flags: needinfo?(mcaceres)
Product: Firefox → Core

Thanks, will take a look.

Flags: needinfo?(mcaceres)
Assignee: nobody → mcaceres
Status: UNCONFIRMED → ASSIGNED
Ever confirmed: true
Priority: -- → P2

This appears to be working (for me) in Nightly. Clicking the button checks the checkbox and the tick appears. The "checked" also returns either true or false.

Status: ASSIGNED → RESOLVED
Closed: 6 years ago
Resolution: --- → WORKSFORME

Hello, Not sure to understand what's "working" the expected result with the attached codepen is "Checkbox doesn't change as it's disabled" but you write it's checked in your test, so for me it's still KO

My bad, I got it backwards.

Summary: disabled checkbox state could be change with JS → disabled checkbox state must not change via click()
Status: RESOLVED → REOPENED
Resolution: WORKSFORME → ---
Summary: disabled checkbox state must not change via click() → disabled checkbox state must not toggle checked attribute via click()
Summary: disabled checkbox state must not toggle checked attribute via click() → calling click() on a disabled checkbox must not toggle its checked state

Code now checks if an input is both disabled for form events and disabled.

Taking this over from Marcos 😁

Assignee: mcaceres → saschanaz

(In reply to saschanaz from comment #9)

Taking this over from Marcos 😁

Thank you :D

I just filed an issue on HTML based on what I found about this bug: Every browser mutates the checkbox when dispatched a synthetic click event (but not when .click()).

Attachment #9063460 - Attachment is obsolete: true
See Also: → 1653797
Summary: calling click() on a disabled checkbox must not toggle its checked state → calling click() on a label with disabled checkbox must not toggle its checked state

This patch intentionally does not ignore all click events on <input>
as web compatibility requires <input type="checkbox"> and
<input type="radio"> to mutate from dispatchEvent().

Depends on D87022

Created web-platform-tests PR https://github.com/web-platform-tests/wpt/pull/25054 for changes under testing/web-platform/tests
Status: REOPENED → RESOLVED
Closed: 6 years ago5 years ago
Resolution: --- → FIXED
Target Milestone: --- → 81 Branch
Upstream PR merged by moz-wptsync-bot
No longer blocks: 329509
Flags: in-testsuite+
Regressed by: 329509
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: