RESOLVED FIXED3524
View Source shows nothing when creating a window with no URL using js
https://bugs.webkit.org/show_bug.cgi?id=3524
Summary View Source shows nothing when creating a window with no URL using js
Rob Buis
Reported 2005-06-14 04:57:10 PDT
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.
Attachments
Isolated test case (282 bytes, text/html)
2005-06-15 06:01 PDT, Anders Carlsson
no flags
Joost de Valk (AlthA)
Comment 1 2005-06-14 05:53:27 PDT
Confirmed, works on firefox, doesn't on current ToT.
Joost de Valk (AlthA)
Comment 2 2005-06-14 05:54:00 PDT
*** Bug 3523 has been marked as a duplicate of this bug. ***
Anders Carlsson
Comment 3 2005-06-15 06:01:36 PDT
Created attachment 2359 [details] Isolated test case Here's an isolated test case that shows the bug.
Anders Carlsson
Comment 4 2005-06-15 06:03:44 PDT
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.
John Sullivan
Comment 5 2005-06-15 16:53:48 PDT
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.
John Sullivan
Comment 6 2005-06-15 16:58:06 PDT
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.)
John Sullivan
Comment 7 2005-06-15 17:18:26 PDT
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.
Ruud Altenburg
Comment 8 2005-06-16 00:56:13 PDT
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.
John Sullivan
Comment 9 2005-06-16 08:40:40 PDT
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.
John Sullivan
Comment 10 2005-06-16 11:46:59 PDT
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.
John Sullivan
Comment 11 2005-06-16 11:47:34 PDT
The radar bug that tracks this View Source issue is 4150996.
John Sullivan
Comment 12 2005-06-17 09:41:43 PDT
[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.
Alexey Proskuryakov
Comment 13 2006-02-08 12:35:52 PST
*** Bug 4753 has been marked as a duplicate of this bug. ***
Eric Seidel (no email)
Comment 14 2012-12-30 17:09:44 PST
"view source" is simply disabled for Chrome in this case.
Maciej Stachowiak
Comment 15 2017-11-18 00:26:51 PST
Classic View Source is gone. The Web Inspector lets you see them DOM now. I'd consider this fixed.
Note You need to log in before you can comment on or make changes to this bug.