Closed Bug 308098 Opened 19 years ago Closed 19 years ago

Richlistbox error shown in JS console when DownloadMgr is opened

Categories

(Toolkit :: Downloads API, defect)

x86
Windows XP
defect
Not set
normal

Tracking

()

VERIFIED FIXED
mozilla1.8final

People

(Reporter: nari_n_y, Assigned: zeniko)

Details

(Keywords: fixed1.8)

Attachments

(1 file, 1 obsolete file)

User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9a1) Gecko/20050911 Firefox/1.6a1
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9a1) Gecko/20050911 Firefox/1.6a1 ID:2005091116

JS console shows the error of NS_ERROR_INVALID_POINTER when downloadmgr is opened.



Reproducible: Always

Steps to Reproduce:
1.Open download manager
2.Open javascript-console
3.

Actual Results:  
JS console shows the following error as
Error: [Exception... "Component returned failure code: 0x80004003
(NS_ERROR_INVALID_POINTER) [nsIScrollBoxObject.ensureElementIsVisible]" 
nsresult: "0x80004003 (NS_ERROR_INVALID_POINTER)"  location: "JS frame ::
chrome://global/content/bindings/richlistbox.xml :: ensureElementIsVisible ::
line 350"  data: no]
Source File: chrome://global/content/bindings/richlistbox.xml
Line: 350

Expected Results:  
There should be no-error.
When download histry is listed in the downloadmgr, js console does not show any
errors. 
However, if the list in the DLmgr is empty, the js error is displayed.
I see this when the Download manager is opened but empty (only with
javascript.options.showInConsole to true):

Error: gDownloadManager has no properties
Source File: chrome://mozapps/content/downloads/downloads.js
Line: 698

Followed by three identical errors when I download a build:

Error: dialog has no properties
Source File: chrome://mozapps/content/downloads/unknownContentType.xul
Line: 1

This when I click Clean up or Remove:

Error: [Exception... "Component returned failure code: 0x80004003
(NS_ERROR_INVALID_POINTER) [nsIScrollBoxObject.ensureElementIsVisible]" 
nsresult: "0x80004003 (NS_ERROR_INVALID_POINTER)"  location: "JS frame ::
chrome://global/content/bindings/richlistbox.xml :: ensureElementIsVisible ::
line 350"  data: no]
Source File: chrome://global/content/bindings/richlistbox.xml
Line: 350

When I try to clear downloads that seem to stand still:

Error: gDownloadsView.clearSelection is not a function
Source File: chrome://mozapps/content/downloads/downloads.js
Line: 234
This build works: 1.9a1_2005090206 
And this one fails: 1.9a1_2005090222
Hm, I get also errors in BRANCH builds when I open the downloadmanager and when
I click Clean Up:

Error: [Exception... "Component returned failure code: 0x80004003
(NS_ERROR_INVALID_POINTER) [nsIScrollBoxObject.ensureElementIsVisible]" 
nsresult: "0x80004003 (NS_ERROR_INVALID_POINTER)"  location: "JS frame ::
chrome://global/content/bindings/richlistbox.xml :: ensureElementIsVisible ::
line 347"  data: no]
Source File: chrome://global/content/bindings/richlistbox.xml
Line: 347
Attached patch Simple fix (obsolete) — Splinter Review
This is a "regression" from bug 306522, where ensureSelectedElementIsVisible is
called without checking whether any element is actually selected. This patch
moves this test where it rather belongs (preventing further regressions of the
same kind).
Attachment #196072 - Flags: superreview?(bryner)
Attachment #196072 - Flags: review?(mconnor)
Comment on attachment 196072 [details] [diff] [review]
Simple fix

>-            this.scrollBoxObject.ensureElementIsVisible(aElement);
>+            if (aElement != null)
>+              this.scrollBoxObject.ensureElementIsVisible(aElement);

if (aElement) should be enough here, and no SR is required in toolkit.
Attachment #196072 - Flags: superreview?(bryner)
Attachment #196072 - Flags: review?(mconnor)
Attachment #196072 - Flags: review+
Assignee: nobody → zeniko
Status: UNCONFIRMED → NEW
Ever confirmed: true
Whiteboard: [checkin needed]
Target Milestone: --- → Firefox1.5
Attached patch Nit resolvedSplinter Review
Attachment #196072 - Attachment is obsolete: true
Attachment #196244 - Flags: approval1.8b5?
Checking in richlistbox.xml;
/cvsroot/mozilla/toolkit/content/widgets/richlistbox.xml,v  <--  richlistbox.xml
new revision: 1.20; previous revision: 1.19
done
Status: NEW → RESOLVED
Closed: 19 years ago
Resolution: --- → FIXED
Attachment #196244 - Flags: approval1.8b5? → approval1.8b5+
Checking in richlistbox.xml;
/cvsroot/mozilla/toolkit/content/widgets/richlistbox.xml,v  <--  richlistbox.xml
new revision: 1.13.2.6; previous revision: 1.13.2.5
done
Keywords: fixed1.8
Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9a1) Gecko/20050915
Firefox/1.6a1 ID:2005091517

Verified this fixed. Thanks!
Status: RESOLVED → VERIFIED
Whiteboard: [checkin needed]
Product: Firefox → Toolkit
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: