You need to
before you can comment on or make changes to this bug.
The page title (in both the title bar and tabs) seems to randomly disappear on certain websites, despite <title> being here in the source. The title displays fine while the page is loading, but once its done, it disappears.
Steps to reproduce:
1. Load the url linked in this bug
2. Refresh the page a couple times - the title should disappear. (Cmd + clicking a link on the page seems to be easier to reproduce for me though)
http://trac.webkit.org/projects/webkit/changeset/17352 appears to be the cause.
Why does the title tag look like this:
<title>Welcome to goComics Web Site featuring FoxTrot - Online Comics, Editorial Cartoons, Email Comics, Political Cartoons</title>
But when the page is loaded in Safari, the title bar looks like this:
Welcome to goComics Web Site featuring FoxTrot - Flash Player Installation
Is Flash modifying the title via DOM manipulation somehow!?
(In reply to comment #1)
> http://trac.webkit.org/projects/webkit/changeset/17352 appears to be the cause.
See also Bug 11853.
Created an attachment (id=11894) [details]
Screenshot of "Flash Player Installation" in the title
Screenshot of locally-built debug build of WebKit r18256 using Safari 2.0.4 (419.3) on Mac OS X 10.4.8 (8L127).
The change of title to mention Flash Player installation is explained by some JS in the source of the page:
// Stored value of document title used by the installation process to close the window that started the installation process
// This is necessary to remove browser windows that will still be utilizing the older version of the player after installation is complete
// DO NOT MODIFY THE FOLLOWING TWO LINES
document.title = document.title.slice(0, 47) + " - Flash Player Installation";
var MMdoctitle = document.title;
The title goes blank because somewhere along the lines a JS file related to advertising is loaded from <http://servedby.advertising.com/site=681019/size=160600/bnum=84894465/optn=1>:
document.write('<OBJECT classid=\'clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\' codebase=\'http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0\' WIDTH=160 HEIGHT=600>');
document.write('<PARAM NAME=movie VALUE=\'http://bannerfarm.ace.advertising.com/bannerfarm/96673/160x600.swf?clickTag=http://servedby.advertising.com/click/site=0000681019/mnum=0000370443&siteValue=0000681019\'>');
document.write('<PARAM NAME=quality VALUE=high>');
document.write('<PARAM NAME=wmode VALUE=opaque>');
document.write('<EMBED src=\'http://bannerfarm.ace.advertising.com/bannerfarm/96673/160x600.swf?clickTag=http://servedby.advertising.com/click/site=0000681019/mnum=0000370443&siteValue=0000681019\' quality=high wmode=opaque WIDTH=160 HEIGHT=600 TYPE=\'application/x-shockwave-flash\' PLUGINSPAGE=\'http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash\'></EMBED>');
I get the feeling it's supposed to be loaded in a popup window or perhaps an iframe rather than inline. It's not clear to me why the title affects the main document but none of the other changes do. After a few minutes of looking I can't see where it's loaded from. More investigation is needed.
I'll prepare a patch that makes our behaviour match Firefox.
Created an attachment (id=12616) [details]
No layout tests included, will add some after lunch. It doesn't seem like we'll be able to test for the first issue that I mentioned in comment 7, but the second should be testable.
(From update of attachment 12616 [details])
Please see the WHATWG specs for <title> as well:
They were based on reverse engineering existing browsers and looking at existing content and should represent the optimum possible implementation path. Feedback is, of course, welcome.
Change landed in r19038.
Reading over the specification that Ian linked it's quite clear our current behaviour doesn't match up. My change also introduced a layout test failure. I'm working on a more complete fix at the moment.
Closing this bug as patch was landed. Bug 12375 covers the layout test failure that was introduced.