Bug 3524 - View Source shows nothing when creating a window with no URL using js
Summary: View Source shows nothing when creating a window with no URL using js
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKit Misc. (show other bugs)
Version: 412
Hardware: Mac OS X 10.4
: P2 Normal
Assignee: Maciej Stachowiak
URL:
Keywords: HasReduction, InRadar
: 3523 4753 (view as bug list)
Depends on:
Blocks:
 
Reported: 2005-06-14 04:57 PDT by Rob Buis
Modified: 2017-11-18 00:26 PST (History)
6 users (show)

See Also:


Attachments
Isolated test case (282 bytes, text/html)
2005-06-15 06:01 PDT, Anders Carlsson
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Rob Buis 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.
Comment 1 Joost de Valk (AlthA) 2005-06-14 05:53:27 PDT
Confirmed, works on firefox, doesn't on current ToT.
Comment 2 Joost de Valk (AlthA) 2005-06-14 05:54:00 PDT
*** Bug 3523 has been marked as a duplicate of this bug. ***
Comment 3 Anders Carlsson 2005-06-15 06:01:36 PDT
Created attachment 2359 [details]
Isolated test case

Here's an isolated test case that shows the bug.
Comment 4 Anders Carlsson 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.
Comment 5 John Sullivan 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.
Comment 6 John Sullivan 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.)
Comment 7 John Sullivan 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.
Comment 8 Ruud Altenburg 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. 
Comment 9 John Sullivan 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.
Comment 10 John Sullivan 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.
Comment 11 John Sullivan 2005-06-16 11:47:34 PDT
The radar bug that tracks this View Source issue is 4150996.
Comment 12 John Sullivan 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.
Comment 13 Alexey Proskuryakov 2006-02-08 12:35:52 PST
*** Bug 4753 has been marked as a duplicate of this bug. ***
Comment 14 Eric Seidel (no email) 2012-12-30 17:09:44 PST
"view source" is simply disabled for Chrome in this case.
Comment 15 Maciej Stachowiak 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.