To reproduce: 1. go to http://ip30.eti.uva.nl/zma3d/sittidae.html 2. Click on either small/medium/large size 3. The popped up window doesnt get a title, just "Untitled" Works in FireFox, so I assume it is valid js. The js method to create the doc is: xWin.document.write("<html><head><title>" + pagetitle + "</title>... Cheers, Rob.
Confirmed, works on firefox, doesn't on current ToT.
*** Bug 3523 has been marked as a duplicate of this bug. ***
Created attachment 2359 [details] Isolated test case Here's an isolated test case that shows the bug.
Both the test case and the web page work in MiniBrowser which is shipped with Xcode as a WebKit example, which makes it look like the bug might be in Safari itself.
Comment on attachment 2359 [details] Isolated test case Two more aspects of this test case seem broken, at least in Safari: (1) "View Source" on the javascript-created window shows nothing at all (2) Reload on the javascript-created window hits an assertion on debug builds.
Also, in the test case, there's no URL showing in the address bar at all for the javascript-created window. (In Firefox it shows the URL of the originating page, which is differently wrong.)
I've confirmed that the missing title is a Safari-specific issue. It's related to the missing URL, but I haven't figured out yet whether the missing URL is a Safari-specific issue or not. We don't use Bugzilla for Safari- specific issues since Safari isn't open source, but I'll leave this one open for now until I determine whether any of the other aspects of this bug are WebKit issues.
FYI: I have reported this issue a long time ago as a regression in Safari (using the Report a bug... option). Safari 1.0.2 displays the title but NOT the source.
OK, thanks Ruud. I'll look for an old Radar bug about this. I think not displaying the source is closely related to not displaying the title and not showing any URL.
I couldn't find any existing Radar bug on this issue; presumably I didn't do the right search. I wrote up new radar bugs to represent the various problems here. Most of them seem to be Safari-specific bugs. The only one that currently seems to be a WebKit bug is the fact that View Source shows an empty window. I'm seeing [[datasource representation] documentSource] return nil here. So I'm going to repurpose this bug report to represent the empty Source bug, since Safari-specific bugs aren't tracked in Bugzilla.
The radar bug that tracks this View Source issue is 4150996.
[WebHTMLRepresentation documentSource] returns a string created from [_private->dataSource data]. [WebDataSource data] returns a field that's set in [WebDataSource _setData:], called from [WebDataSource _setPrimaryLoadComplete:]. In this case the "primary load" is meaningless, as it's just opening a window with an empty URL. There is no data there. The only contents of the page are created by document.write() calls, but this content doesn't make it into the datasource's data field. I'm not an expert in this area, and I haven't investigated how else the data field is used. We either need to make it contain document.write()-generated code, or make the documentSource call work a different way for this case at least. I'm handing this off to Chris, but if anyone else wants to work on it they should feel free.
*** Bug 4753 has been marked as a duplicate of this bug. ***
"view source" is simply disabled for Chrome in this case.
Classic View Source is gone. The Web Inspector lets you see them DOM now. I'd consider this fixed.