Closed Bug 451256 Opened 16 years ago Closed 16 years ago

Visiting page without title after visiting a page with a title keeps the title of the previous page

Categories

(Core :: DOM: Core & HTML, defect, P2)

x86
Windows XP
defect

Tracking

()

VERIFIED FIXED

People

(Reporter: martijn.martijn, Assigned: roc)

References

(Blocks 1 open bug, )

Details

(Keywords: regression, verified1.9.1)

Attachments

(1 file, 1 obsolete file)

This has to be a regression from bug 118704.

To reproduce:
- Visit this page
- Visit a page without a title, for instance: http://martijn.martijn.googlepages.com/scrollbar.css

Result:
The title of this page is still shown in in the window titlebar in the new, title-less page.
That's weird. The tab title *does* change. This is probably a chrome bug that I just exposed.
Attached patch fix (obsolete) — Splinter Review
The tab title is set OK because it changes to "Loading" and then eventually we reset it again. The window title is not changed to "Loading" so we just never change it since no DOMTitleChanged event is fired.

This patch makes us update the window title (and also the tab title, if necessary) in onLocationChange, which fires when the tab's docshell switches to a new contentviewer. I think this is logical. We could fire additional DOMTitleChanged events but that seems less clean to me since document titles aren't really changing, we're just switching which document is displayed.
Assignee: nobody → roc
Status: NEW → ASSIGNED
Attachment #334594 - Flags: review?(gavin.sharp)
Flags: blocking1.9.1?
Attached patch different fixSplinter Review
Gavin just wanted to revert to the old behaviour, where we dispatch DOMTitleChanged in nsContentSink::DidBuildModelImpl if no event has already been dispatched. I'm not sure that's entirely logical but I can see the advantage of compatibility so here it is.
Attachment #334594 - Attachment is obsolete: true
Attachment #334630 - Flags: superreview?(jst)
Attachment #334630 - Flags: review?(jst)
Attachment #334594 - Flags: review?(gavin.sharp)
Attachment #334630 - Flags: superreview?(jst)
Attachment #334630 - Flags: superreview+
Attachment #334630 - Flags: review?(jst)
Attachment #334630 - Flags: review+
Pushed f50234e5a17b.
Status: ASSIGNED → RESOLVED
Closed: 16 years ago
Resolution: --- → FIXED
I thought about writing a test for this. The problem is, you really need a chrome event listener on the iframe's docshell, which is a bit of a pain.
Blocks: 470641
Flags: blocking1.9.1? → blocking1.9.1+
Keywords: fixed1.9.1
Priority: -- → P2
Verified.

Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.1b3pre) Gecko/20090130 Shiretoko/3.1b3pre
Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: