Closed
Bug 365773
Opened 19 years ago
Closed 19 years ago
radiogroup.selectedItem = null fails if group is focused
Categories
(Toolkit :: UI Widgets, defect)
Toolkit
UI Widgets
Tracking
()
RESOLVED
FIXED
People
(Reporter: jwkbugzilla, Assigned: jwkbugzilla)
Details
Attachments
(2 files, 2 obsolete files)
2.28 KB,
application/vnd.mozilla.xul+xml
|
sayrer
:
first-review+
|
Details |
2.60 KB,
patch
|
jwkbugzilla
:
first-review+
|
Details | Diff | Splinter Review |
The radiogroup XUL tag implementation contains the following code in the selectedItem setter:
if (!alreadySelected && focused) {
// Only report if actual change
var myEvent = document.createEvent("Events");
myEvent.initEvent("RadioStateChange", true, true);
val.dispatchEvent(myEvent);
Problem: that val might be null and this case is not checked - the setter will throw an exception. Condition is that current document focus is on this radio group, otherwise focused will be false.
Assignee | ||
Comment 1•19 years ago
|
||
Assignee: nobody → trev
Status: NEW → ASSIGNED
Assignee | ||
Comment 2•19 years ago
|
||
Sorry, attached wrong file - now the correct testcase.
Attachment #250334 -
Attachment is obsolete: true
Assignee | ||
Comment 3•19 years ago
|
||
Trivial fix, selectedItem setter no longer throws an exception.
Neil, can you review this? You reviewed the previous patch in this area.
Attachment #250336 -
Flags: first-review?(neil)
Comment 4•19 years ago
|
||
Comment on attachment 250336 [details] [diff] [review]
Add missing check
Nit: scoping of myEvent "looks" incorrect. Please move it before if (val)
Note: Setting selectedItem to null seems to kill the focus and break keyboard navigation because focusedItem should not be null while the radiogroup has focus. (Aside: Why don't we have a focusedIndex property?)
Attachment #250336 -
Flags: first-review?(neil) → first-review+
Assignee | ||
Comment 5•19 years ago
|
||
Does it need a second review to be checked in?
Attachment #250336 -
Attachment is obsolete: true
Attachment #250344 -
Flags: first-review+
Updated•19 years ago
|
Whiteboard: [checkin needed]
Comment 6•19 years ago
|
||
mozilla/toolkit/content/widgets/radio.xml 1.24
mozilla/xpfe/global/resources/content/bindings/radio.xml 1.45
Status: ASSIGNED → RESOLVED
Closed: 19 years ago
Resolution: --- → FIXED
Whiteboard: [checkin needed]
Assignee | ||
Updated•19 years ago
|
Attachment #250335 -
Flags: first-review?(neil)
Comment 7•19 years ago
|
||
Comment on attachment 250335 [details]
mochitest compatible testcase
Sorry, I don't know the test harness.
Attachment #250335 -
Flags: first-review?(neil)
Assignee | ||
Comment 8•19 years ago
|
||
Comment on attachment 250335 [details]
mochitest compatible testcase
Robert, can you review this testcase?
Attachment #250335 -
Flags: first-review?(sayrer)
Updated•19 years ago
|
Attachment #250335 -
Flags: first-review?(sayrer) → first-review+
Comment 9•19 years ago
|
||
mozilla/testing/mochitest/tests/test_bug365773.xul 1.1
Flags: in-testsuite+
Version: unspecified → Trunk
Assignee | ||
Comment 10•19 years ago
|
||
Gavin, mozilla/testing/mochitest/tests/index.html needs to be updated as well when checking in testcases.
Comment 11•19 years ago
|
||
Ah, right, thanks for catching my mistake. I see Rob already fixed it.
You need to log in
before you can comment on or make changes to this bug.
Description
•