Closed
Bug 238696
Opened 21 years ago
Closed 21 years ago
URL bar does not update if 2nd ProgressListener added to <browser>
Categories
(Core :: DOM: UI Events & Focus Handling, defect)
Core
DOM: UI Events & Focus Handling
Tracking
()
RESOLVED
FIXED
People
(Reporter: mcs, Assigned: Brade)
References
Details
(Keywords: fixed1.7)
Attachments
(3 files, 2 obsolete files)
2.13 KB,
patch
|
neil
:
review+
jag+mozilla
:
superreview+
chofmann
:
approval1.7+
|
Details | Diff | Splinter Review |
1.71 KB,
patch
|
Details | Diff | Splinter Review | |
2.35 KB,
patch
|
bryner
:
review+
|
Details | Diff | Splinter Review |
I have a sidebar that adds a listener to the tabbed browser, like so:
top.getBrowser().addProgressListener(mySidebarProgressListener,
Components.interfaces.nsIWebProgress.NOTIFY_LOCATION);
But there is a bad side effect: the URL bar text never updates once my sidebar
is loaded. For example, if I click on a link in the browser I expect the URL
bar to show the URL of the new page once it loads -- but it does not change at all.
This bug only occurs when there are no tabs; if there is more than one tab open,
the problem goes away.
Reporter | ||
Comment 1•21 years ago
|
||
This may be related to the changes made for bug 144533.
Assignee | ||
Comment 2•21 years ago
|
||
Assignee: events → brade
Status: NEW → ASSIGNED
Assignee | ||
Comment 3•21 years ago
|
||
Reporter | ||
Comment 4•21 years ago
|
||
I did not do a very good of searching the open bugs. This looks like a
duplicated of bug 216900.
Comment 5•21 years ago
|
||
Comment on attachment 144776 [details] [diff] [review]
patch v1 with -w
>+ // Transition from one listener to mTabListeners.
>+ // Remove the progress listeners from the active browser's filter.
>+ var p = this.mProgressListeners[0];
>+ if (p)
>+ this.mTabFilters[0].removeProgressListener(p);
>+
>+ // Wire up a progress listener to our filter.
>+ const listener = this.mTabProgressListener(this.mCurrentTab,
>+ this.mCurrentBrowser,
>+ false);
>+ this.mTabFilters[0].addProgressListener(listener,
>+ Components.interfaces.nsIWebProgress.NOTIFY_ALL);
>+ this.mTabListeners[0] = listener;
When you do later enter tabbed mode, this will stomp over the work you've done
here - it tries to remove the progressListner[0] again and adds a new tab
listener; that happens to work because the tab filter does no error checking.
(Of course, if the filter did some basic error checking then this bug would
never have arisen in the first place...)
Assignee | ||
Comment 6•21 years ago
|
||
Assignee | ||
Updated•21 years ago
|
Attachment #144774 -
Attachment is obsolete: true
Attachment #144776 -
Attachment is obsolete: true
Assignee | ||
Comment 7•21 years ago
|
||
Assignee | ||
Comment 8•21 years ago
|
||
*** Bug 216900 has been marked as a duplicate of this bug. ***
Assignee | ||
Updated•21 years ago
|
Attachment #144847 -
Flags: superreview?(jag)
Attachment #144847 -
Flags: review?(neil.parkwaycc.co.uk)
Comment 9•21 years ago
|
||
Brade: Should this bug affect also site icon in URL Bar (bug 231427, testcase B
in comment #4)?
Comment 10•21 years ago
|
||
Comment on attachment 144847 [details] [diff] [review]
patch v2 (simpler)
>+ // If we are adding a 2nd progress listener, we need to go to mTabbedMode
Looks ungrammatical to me; "we need to enter tabbed mode" perhaps?
>+ if (this.mTabFilters.length == 0) {
As discussed on IRC, I thought of a possible reason why the progress listeners
aren't spliced in which case you wouldn't need this change.
Attachment #144847 -
Flags: review?(neil.parkwaycc.co.uk) → review+
Comment 11•21 years ago
|
||
I like the second patch much better.
Do we still need this?
if (this.mTabFilters.length == 0) {
It looks like you need that guard if you have multiple progress listeners on the
tab browser while not in tabbed mode. Actually, you'd need something better,
namely the ability to register the 2nd etc. progress listeners with the filter,
but the filter only supports one listener currently. However, because of the
first part of your patch, we won't go into this block of code anymore for the
second progress listener.
Assignee | ||
Comment 12•21 years ago
|
||
jag--my thinking was that the check would still be needed if someone did this:
addProgressListener, removeProgressListener, addProgressListener
I didn't see the point in creating a new filter and clobbering the first filter.
Strictly speaking, that piece is unrelated to this bug. I'm happy to remove it
since I don't think it will impact the current browser (which gets first stab at
adding the listener). It just seemed like a correctness thing (since I was in
the vicinity). :-)
jag--let me know if you
(1) want a new patch without that last section,
(2) if you prefer a conditional review on removing it or
(3) you are ok with leaving it in
Assignee | ||
Comment 13•21 years ago
|
||
Adam Hauner (Comment 9)--I don't think bug 231427 really applies in this case.
This code would only be triggered early if you are in a single browser window
and have a sidebar or other extension that adds a 2nd progress listener. I
*think* that the problem in that bug is that the favicon wasn't loaded initially
or something but I am far from an expert on that. I recommend we keep that
issue out of this bug. :-)
Comment 14•21 years ago
|
||
Comment on attachment 144847 [details] [diff] [review]
patch v2 (simpler)
Hmmm... The 0 length check seems right then. It just looks a little clunky.
Maybe we should really just remove the filter in the no tabs mode when we
remove the progress listener.
I'd say check it in as is, maybe add your comment to the 0 check? sr=jag.
Attachment #144847 -
Flags: superreview?(jag) → superreview+
Assignee | ||
Updated•21 years ago
|
Attachment #144847 -
Flags: approval1.7?
Comment 15•21 years ago
|
||
Comment on attachment 144847 [details] [diff] [review]
patch v2 (simpler)
a=chofmann for 1.7
Attachment #144847 -
Flags: approval1.7? → approval1.7+
Assignee | ||
Comment 16•21 years ago
|
||
fix checked in
Status: ASSIGNED → RESOLVED
Closed: 21 years ago
Resolution: --- → FIXED
Comment 17•21 years ago
|
||
Shouldn't this fix be put into the mozilla/toolkit version of tabbrowser.xml?
Who knows what future extension might try to add another listener.
Assignee | ||
Comment 18•21 years ago
|
||
Yes, this bug should be fixed in mozilla/toolkit. I don't have a tree to test
that though. Should I reopen this bug and reassign to someone else or file a
new bug or ?
Assignee | ||
Comment 19•21 years ago
|
||
Assignee | ||
Comment 20•21 years ago
|
||
Comment on attachment 146516 [details] [diff] [review]
patch for firefox
This is the patch ported over; would appreciate it if someone could test it.
Reviews please! :-)
Attachment #146516 -
Flags: superreview?(bugs)
Attachment #146516 -
Flags: review?(dveditz)
Comment 21•21 years ago
|
||
Comment on attachment 146516 [details] [diff] [review]
patch for firefox
looks fine to me but I'm not a peer in toolkit. You only need one review in
toolkit so I'll add bryner and you can take whichever one you get.
Attachment #146516 -
Flags: review?(dveditz) → review?(bryner)
Updated•21 years ago
|
Attachment #146516 -
Flags: review?(bryner) → review+
Comment 22•21 years ago
|
||
I don't see this in the list of 1.7 branch checkins. Can someone please land
this on the 1.7 branch or if it's already there, add the fixed1.7 keyword? Thanks.
Assignee | ||
Comment 23•21 years ago
|
||
This patch (for mozilla) was landed before the 1.7 branch was created. The
patch for firefox landed May 6, 2004 on the trunk (rev 1.38).
Keywords: fixed1.7
Updated•20 years ago
|
Attachment #146516 -
Flags: superreview?(bugs)
Updated•6 years ago
|
Component: Event Handling → User events and focus handling
You need to log in
before you can comment on or make changes to this bug.
Description
•