Creating <IFRAME SRC="about:blank"> and document.writing to it fails [frame]

VERIFIED DUPLICATE of bug 22681

Status

()

Core
DOM
P3
normal
VERIFIED DUPLICATE of bug 22681
18 years ago
16 years ago

People

(Reporter: Martin Honnen, Assigned: Alexandru Savulov)

Tracking

({dom1})

Trunk
Future
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment)

(Reporter)

Description

18 years ago
I am creating a blank iframe and then try to document.write to it. I get an 
error that the iframe's document has no properties. If I use setTimeout with a 
one millisecond delay it works but I can't quite believe that that (incredible 
small) delay is necessary to access the document and hope it is possible to make 
it immediately available.

<HTML>
<HEAD>
<SCRIPT>
var n = -1;
function createBlankIframe () {
  n++;
  var iframe = document.createElement('IFRAME');
  iframe.id = iframe.name = 'iframe' + n;
  iframe.src = 'about:blank';
  document.body.appendChild(iframe);
}
function writeToIframe() {
  var ifrWin = window.frames['iframe' + n];
  ifrWin.document.open();
  ifrWin.document.write('<H1>Kibology<\/H1>');
  ifrWin.document.close();
}
</SCRIPT>
</HEAD>
<BODY>
<BUTTON ONCLICK="createBlankIframe(); writeToIframe();">
create blank iframe and write to it
</BUTTON>
<BUTTON ONCLICK="createBlankIframe();">
create blank iframe
</BUTTON>
<BUTTON ONCLICK="writeToIframe()">
write to iframe
</BUTTON>
<BUTTON ONCLICK="createBlankIframe(); setTimeout('writeToIframe();', 1)">
create blank iframe and write delayed to it
</BUTTON>
<BR>
</BODY>
</HTML>
(Reporter)

Comment 1

18 years ago
Created attachment 7397 [details]
bug demo (1st button gives error, 2nd + 3rd work, 4th works too)
I think this is really a dup of bug #17351, that bug is about the same problem
but that bug uses window.open(...) in stead if <iframe src="...">, I'll leave
this open to track that this is fixed when #17351 is fixed...
Status: NEW → ASSIGNED

Updated

18 years ago
QA Contact: gerardok → desale

Updated

18 years ago
Target Milestone: --- → M19

Comment 3

18 years ago
NS 4 look better whitout this thing
now it looks like IE

Comment 4

18 years ago
Bug #17351 is marked fixed, but that doesn't seem to be affecting this bug.  I 
still get null as the document property of an iframe with no src.
Reassigning to Eric Pollmann since we talked about this and we had some ideas on
how to solve this, Eric, feel free to either dupe this against one of the other
bugs on the same issue or Future this, or whatever...
Assignee: jst → pollmann
Status: ASSIGNED → NEW
OS: Windows 98 → All
Hardware: PC → All
This bug has been marked "future" because the original netscape engineer working
on this is over-burdened. If you feel this is an error, that you or another
known resource will be working on this bug,or if it blocks your work in some way
-- please attach your concern to the bug for reconsideration.
Status: NEW → ASSIGNED
Target Milestone: M19 → Future

Comment 7

17 years ago
dup of bug 22681?
Keywords: dom1

Comment 8

17 years ago
Updating QA contact to Shivakiran Tummala.
QA Contact: desale → stummala

Comment 9

17 years ago
Is this why the LinuxToday page renders incorrectly?
   <http://linuxtoday.com>
Note the long gray box on the left, which is, in fact, an IFRAME in which the
SRC attribute resolves to a piece of Javascript code. If this appears to be a
different bug, i will post a new bug and write a minimal test case.

It seems that this page rendered correctly a few months ago.

Comment 10

17 years ago
I believe Jesse was right back in november, this is most likely a dup of bug 22681.
Bulk reassigning form bugs to Alex
Assignee: pollmann → alexsavulov
Status: ASSIGNED → NEW
(Assignee)

Updated

16 years ago
Summary: Creating <IFRAME SRC="about:blank"> and document.writing to it fails → Creating <IFRAME SRC="about:blank"> and document.writing to it fails [frame]

Comment 12

16 years ago
Does this still happen? If not, it was probably a dup of (fixed) bug 22681.
(Reporter)

Comment 13

16 years ago
The test case
  http://bugzilla.mozilla.org/attachment.cgi?id=7397&action=view
works for me with M 0.9.7.
I resolve as duplicate of 22681

*** This bug has been marked as a duplicate of 22681 ***
Status: NEW → RESOLVED
Last Resolved: 16 years ago
Resolution: --- → DUPLICATE

Comment 14

16 years ago
no, this bug cannot be marked dup of bug 22681, because bug 22681 was resolved 
as dup of this bug.

Comment 15

16 years ago
I have some trouble understanding your logic on this one, Sivakiran :-)
bug 22681 was never marked as a dup of this one as far as I can tell, and bug
22681 is fixed (apart from an edge case which is why the bug is still open)

Comment 16

16 years ago
this is a dupe of bug 22681, did not i say so before :-)

Comment 17

16 years ago
verified dup, marking as verified
Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.