"ASSERTION: Ensure row is visible called with a negative number!" with listbox.ensureElementIsVisible(null)

RESOLVED FIXED

Status

()

RESOLVED FIXED
11 years ago
9 years ago

People

(Reporter: jruderman, Unassigned)

Tracking

(Blocks: 1 bug, {assertion, testcase})

Trunk
x86
Mac OS X
assertion, testcase
Points:
---
Bug Flags:
in-testsuite +

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(2 attachments)

185 bytes, application/vnd.mozilla.xul+xml
Details
657 bytes, patch
bzbarsky
: review+
Details | Diff | Splinter Review
(Reporter)

Description

11 years ago
Created attachment 306671 [details]
testcase

###!!! ASSERTION: Ensure row is visible called with a negative number!: 'aRowIndex >= 0', file /Users/jruderman/trunk/mozilla/layout/xul/base/src/nsListBoxBodyFrame.cpp, line 550


The stack makes me suspicious that NS_InvokeByIndex_P isn't doing the right thing.  Why does only EnsureIndexIsVisible appear on the stack instead of EnsureElementIsVisible?

#2  0x0139373f in Break (aMsg=0xbfffb7dc "###!!! ASSERTION: Ensure row is visible called with a negative number!: 'aRowIndex >= 0', file /Users/jruderman/trunk/mozilla/layout/xul/base/src/nsListBoxBodyFrame.cpp, line 550") at /Users/jruderman/trunk/mozilla/xpcom/base/nsDebugImpl.cpp:474
#3  0x01393a64 in NS_DebugBreak_P (aSeverity=1, aStr=0x1856f488 "Ensure row is visible called with a negative number!", aExpr=0x1856f478 "aRowIndex >= 0", aFile=0x1856f2bc "/Users/jruderman/trunk/mozilla/layout/xul/base/src/nsListBoxBodyFrame.cpp", aLine=550) at /Users/jruderman/trunk/mozilla/xpcom/base/nsDebugImpl.cpp:358
#4  0x180b6a34 in nsListBoxBodyFrame::EnsureIndexIsVisible (this=0x24e6978, aRowIndex=-1) at /Users/jruderman/trunk/mozilla/layout/xul/base/src/nsListBoxBodyFrame.cpp:550
#5  0x18098cb8 in nsListBoxObject::EnsureIndexIsVisible (this=0x3d64f1c0, aRowIndex=-1) at /Users/jruderman/trunk/mozilla/layout/xul/base/src/nsListBoxObject.cpp:119
#6  0x0139aeea in NS_InvokeByIndex_P (that=0x3d64f1c0, methodIndex=7, paramCount=1, params=0xbfffbea4) at /Users/jruderman/trunk/mozilla/xpcom/reflect/xptcall/src/md/unix/xptcinvoke_unixish_x86.cpp:179
#7  0x02a44f63 in XPCWrappedNative::CallMethod (ccx=@0xbfffc0ec, mode=CALL_METHOD) at /Users/jruderman/trunk/mozilla/js/src/xpconnect/src/xpcwrappednative.cpp:2369
#8  0x02a4caa8 in XPC_WN_CallMethod (cx=0x3c799230, obj=0x3bd9f360, argc=1, argv=0x24f0d6c, vp=0xbfffc220) at /Users/jruderman/trunk/mozilla/js/src/xpconnect/src/xpcwrappednativejsops.cpp:1470
#9  0x010660ab in js_Invoke (cx=0x3c799230, argc=1, vp=0x24f0d64, flags=0) at /Users/jruderman/trunk/mozilla/js/src/jsinterp.c:1419

Comment 1

11 years ago
(In reply to comment #0)
>Why does only EnsureIndexIsVisible appear on the stack instead of  EnsureElementIsVisible?
Reading the exception in the error console would have been a dead giveaway:

Error: uncaught exception: [Exception... "Component returned failure code: 0x80070057 (NS_ERROR_ILLEGAL_VALUE) [nsIListBoxObject.ensureIndexIsVisible]"  nsresult: "0x80070057 (NS_ERROR_ILLEGAL_VALUE)"  location: "JS frame :: chrome://global/content/bindings/listbox.xml :: ensureIndexIsVisible :: line 778"  data: no]

      <method name="ensureIndexIsVisible">
        <parameter name="index"/>
        <body>
          return this.listBoxObject.ensureIndexIsVisible(index);
        </body>
      </method>

      <method name="ensureElementIsVisible">
        <parameter name="element"/>
        <body>
          return this.ensureIndexIsVisible(this.listBoxObject.getIndexOfItem(element));
        </body>
      </method>

The assertion is bogus, as a -1 index is not an unexpected error.

Updated

10 years ago
Component: XP Toolkit/Widgets: XUL → XUL
QA Contact: xptoolkit.xul → xptoolkit.widgets
(Reporter)

Comment 2

9 years ago
Created attachment 396626 [details] [diff] [review]
remove bogus assertion
Attachment #396626 - Flags: review?(bzbarsky)
Attachment #396626 - Flags: review?(bzbarsky) → review+
(Reporter)

Comment 3

9 years ago
Patch checked in: http://hg.mozilla.org/mozilla-central/rev/13ede33fb54b
Status: NEW → RESOLVED
Last Resolved: 9 years ago
Resolution: --- → FIXED
(Reporter)

Comment 4

9 years ago
Crashtest: http://hg.mozilla.org/mozilla-central/rev/f4622261cce8
Flags: in-testsuite+
You need to log in before you can comment on or make changes to this bug.