Closed
Bug 590353
Opened 15 years ago
Closed 15 years ago
Do not try to reset the default value if the element value isn't different from the value attribute
Categories
(Core :: DOM: Core & HTML, defect)
Core
DOM: Core & HTML
Tracking
()
RESOLVED
FIXED
mozilla2.0b7
| Tracking | Status | |
|---|---|---|
| blocking2.0 | --- | betaN+ |
People
(Reporter: mounir, Assigned: mounir)
References
Details
(Keywords: regression)
Attachments
(2 files)
|
565 bytes,
text/html
|
Details | |
|
9.83 KB,
patch
|
smaug
:
review+
|
Details | Diff | Splinter Review |
If during an onclick handler, the value of a checkbox (very likely a radio too) is changed, the checkbox will not be checked.
The reason seems to be because we go to ::SetValueInternal and then, because it's not a text control, we call ::SetAttr (then ::AfterSetAttr). And, because the dirty value flag is false, the value is reseted to the default value.
An easy fix would be to not reset the element to the default value if the checkedness flag is true but that would probably cause some minor differences with the current specifications.
Attached, a test case. When clicking on the checkbox, the expected behavior is to see "value: 0 checked: true" in the textarea (Firefox 3.6 does that). With Firefox 4 b4, it's "value: 0 checked: false".
| Assignee | ||
Updated•15 years ago
|
blocking2.0: --- → ?
Comment 1•15 years ago
|
||
Blocking and cc:ing Bret who found this bug! :)
Assignee: nobody → mounir.lamouri
blocking2.0: ? → betaN+
Comment 2•15 years ago
|
||
My girlfriend Lindsay found this bug, I was merely the messenger.
| Assignee | ||
Comment 3•15 years ago
|
||
Another test case has been written by Boris on bug 592228:
https://bugzilla.mozilla.org/attachment.cgi?id=470761
Summary: Changing the value of a checkbox during onclick happens to be a no op → Do not try to reset the default value if the element value isn't different from the value attribute
| Assignee | ||
Comment 5•15 years ago
|
||
Attachment #471724 -
Flags: review?(Olli.Pettay)
| Assignee | ||
Updated•15 years ago
|
Status: NEW → ASSIGNED
Comment 6•15 years ago
|
||
Comment on attachment 471724 [details] [diff] [review]
Patch v1
Ok, r+, although this code is getting harder and harder to understand.
Attachment #471724 -
Flags: review?(Olli.Pettay) → review+
| Assignee | ||
Comment 7•15 years ago
|
||
Thank you Bret and Lindsay for reporting this bug.
This will be fixed in Firefox 4 beta 6.
Push:
http://hg.mozilla.org/mozilla-central/rev/89977f3a769c
Status: ASSIGNED → RESOLVED
Closed: 15 years ago
Flags: in-testsuite+
Resolution: --- → FIXED
Target Milestone: --- → mozilla2.0b6
You need to log in
before you can comment on or make changes to this bug.
Description
•