Closed Bug 363032 Opened 18 years ago Closed 18 years ago

###!!! ASSERTION: invalid arg: 'aIndex >= 0', file m:/trunk/mozilla/layout/generic/nsFrameList.cpp, line 300

Categories

(Core :: XUL, defect)

x86
Windows XP
defect
Not set
normal

Tracking

()

RESOLVED FIXED

People

(Reporter: WeirdAl, Assigned: WeirdAl)

References

Details

(Keywords: assertion, testcase)

Attachments

(2 files)

If a XUL deck's selectedIndex is set to -1, Gecko triggers this assertion. Stack trace coming up. This should be pretty easy to fix.
Keywords: assertion, testcase
Attached file stack trace
The JavaScript portion of this stack trace shows a binding setting a deck's selectedIndex to -1. Abusing the deck, maybe, but given how selectedIndex typically works, not entirely unreasonable.
Attached patch patch, v1Splinter Review
Assignee: nobody → ajvincent
Status: NEW → ASSIGNED
Attachment #247779 - Flags: superreview?(bzbarsky)
Attachment #247779 - Flags: review?(bzbarsky)
I'm swamped. Please ask someone else for review on this. One of the XUL peers (Neils) might be a good idea.
Comment on attachment 247779 [details] [diff] [review] patch, v1 trivial patch
Attachment #247779 - Flags: superreview?(neil)
Attachment #247779 - Flags: superreview?(bzbarsky)
Attachment #247779 - Flags: review?(neil)
Attachment #247779 - Flags: review?(bzbarsky)
Comment on attachment 247779 [details] [diff] [review] patch, v1 Two Neils are better than one ;-) One idea I had was that GetSelectedBox should use mIndex, while IndexChanged should set mIndex in between HideBox and ShowBox and call GetSelectedBox instead of GetBoxAt. The other idea I had was that GetSelectedIndex should return 0 or perhaps MAXINT for negative indices.
Attachment #247779 - Flags: review?(neil) → review?(enndeakin)
Comment on attachment 247779 [details] [diff] [review] patch, v1 Look's OK. Neil's first suggestion seems good too.
Attachment #247779 - Flags: review?(enndeakin) → review+
(In reply to comment #5) > The other idea I had was that GetSelectedIndex should return 0 or perhaps > MAXINT for negative indices. Wouldn't that have the result of meaning a deck's selectedIndex becomes 0 or a very large number, instead of -1, when the app author wants to make sure nothing is selected? Traditionally, -1 means no selection at all, on both XUL (tree.currentIndex, menulist.selectedIndex, and the aforementioned deck) and HTML (select.selectedIndex).
Comment on attachment 247779 [details] [diff] [review] patch, v1 Please file a followup bug, patch or both ;-)
Attachment #247779 - Flags: superreview?(neil) → superreview+
Checking in nsDeckFrame.cpp; /cvsroot/mozilla/layout/xul/base/src/nsDeckFrame.cpp,v <-- nsDeckFrame.cpp new revision: 1.78; previous revision: 1.77 done
Status: ASSIGNED → RESOLVED
Closed: 18 years ago
Flags: in-testsuite-
Resolution: --- → FIXED
Blocks: 363112
per comment 8, filed bug 363112.
Component: XP Toolkit/Widgets: XUL → XUL
QA Contact: xptoolkit.xul → xptoolkit.widgets
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: