Closed Bug 303075 Opened 20 years ago Closed 20 years ago

tabbrowser.xml : getBrowser().removeProgressListener just resets the progressListener to null

Categories

(Firefox :: Tabbed Browser, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
Firefox1.5

People

(Reporter: bugs, Assigned: tonglebeak)

References

Details

Attachments

(2 files)

User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8b4) Gecko/20050802 Firefox/1.0+ Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8b4) Gecko/20050802 Firefox/1.0+ Trunk only. I don't know if this is covered by bug 297155 ... <method name="removeProgressListener"> ... for (var i = 0; i < this.mProgressListeners.length; i++) { if (this.mProgressListeners[i] == aListener) { this.mProgressListeners.[i] = null; break; } } ... this will set the progress listener to null and will break '<method name="setIcon">', because there is no 'onLinkIconAvailable' in 'p'. (error message in JavaScript Console) <method name="removeProgressListener"> ... this.mProgressListeners.splice(i, 1); break; ... </method> fixes the problems for me. (just for testing) So, adding a progressListener and removing it will force the throbber to never stop, because 'onLinkIconAvailable' in 'p' (which is null) is not present. Reproducible: Always Expected Results: Remove everything from "mProgressListeners"
Summary: tabbrowser.xml : gteBrowser().removeProgressListener just resets the progressListener to null → tabbrowser.xml : getBrowser().removeProgressListener just resets the progressListener to null
Damn! This is a bad bug report! I just wanted to say, that adding and removing a progressListener (e.g. from an extension) will cause a 'null' in 'mProgressListeners', leading to never ending 'throbbers' and 'statusbar-progressmeters'.
Attached file Testcase
Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8b4) Gecko/20050802 Firefox/1.0+ ID:2005080207 WFM. I allow the js to run, but everything still loads a-ok for me. Reporter, try reproducing with a clean profile.
(In reply to comment #3) > WFM. I allow the js to run, but everything still loads a-ok for me. > > Reporter, try reproducing with a clean profile. You need to save the testcase in the local disk.
Doesn't matter if I save it to my computer or not, I still get the same warnings and I give access to what I'm being warned about, and still no problems for me.
Sorry here, my js console said nothing, but after browsing for 5 minutes I finally took notice to the hiccups. Sorry. This is confirmed Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8b4) Gecko/20050802 Firefox/1.0+ ID:2005080207
(In reply to comment #4) > > You need to save the testcase in the local disk. > Sorry. I forgot the "saving to local disk".
OS: Windows XP → All
Hardware: PC → All
Version: unspecified → Trunk
Flags: blocking1.8b4?
Status: UNCONFIRMED → NEW
Ever confirmed: true
Attached patch patchSplinter Review
This patch reflects comment 0. The reporter is correct: using splice() is the proper way to remove array elements. Else, the null entry will still be in the array, and then this mess is caused. This has been tested, and it works.
Attachment #191505 - Flags: review?(mconnor)
Attachment #191505 - Flags: review?(mconnor)
Attachment #191505 - Flags: review+
Attachment #191505 - Flags: approval1.8b4+
Flags: blocking1.8b4? → blocking1.8b4+
mconnor, can you shephard this in?
Assignee: nobody → mconnor
Checking in tabbrowser.xml; /cvsroot/mozilla/toolkit/content/widgets/tabbrowser.xml,v <-- tabbrowser.xml new revision: 1.98; previous revision: 1.97 done
Assignee: mconnor → tonglebeak
Target Milestone: --- → Firefox1.1
Status: NEW → RESOLVED
Closed: 20 years ago
Resolution: --- → FIXED
No longer blocks: 519216
Depends on: 519216
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: