Closed Bug 198251 Opened 21 years ago Closed 19 years ago

myFrameset.appendChild(d.createElement("frame")) doesn't display contents.

Categories

(Core :: DOM: Core & HTML, defect)

defect
Not set
major

Tracking

()

RESOLVED FIXED

People

(Reporter: hattons, Assigned: bzbarsky)

References

Details

(Keywords: testcase)

Attachments

(5 files)

User-Agent:       Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.4a) Gecko/20030315
Build Identifier: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.4a) Gecko/20030315

If I create frames with the DOM API calls and append them to a Frameset, they
are not visible.  There are different forms of this problem depending on whether
the file is saved as .html or .xhtml. In a .html file I can cause the frames to
display content if I .setAttribute("cols","*,*") after I append the new frames.
In .xhtml, this doesn't work.

Reproducible: Always

Steps to Reproduce:
1. Create a frameset using a tag including an onload=doLoad(this);
2. In the doLoad() create two frames and set the "src" attributes to good URLs.
3. load the page

Actual Results:  
The window remains empty.

Expected Results:  
I expect to see the contents of the URLs displayed in the frames.

This is really just a step toward what I really want to do, and that is to set
the location of the contentWindow properties of the frames with javascript.  No
matter what happens in the above example, I don't get a contentWindow object. 
This I find this to be fairly serious because it has the potential for wasting a
lot of time on the part of a developer who wants to do things this way.  It
should work, or be documented that it doesn't.

Example code forthcomming.
I'd rather not have to point at the first set of pages to prime the pump, but
the result is basically what I want. Notice I created the frameset and frames
with tags and not javascript.  This is also not xhtml.	This is the doctype:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN"
   "http://www.w3.org/TR/html4/frameset.dtd">
This file with a .xhtml extension never displays the content, nor does it
display the frame divider.  The confirm box allows you to choose to set the
cols before or after appending the frames.
If you click OK you set the cols before you append the frames and no content is
shown, nor is the border between the frames.  If you click cancel, the cols are
set last, and the frames are displayed with content.
Attachment #117741 - Attachment mime type: text/html → application/xhtml+xml
In XHTML (saved as .xhtml) you need to use createElementNS with the proper
namespace, not createElement (since createElement does not create an _HTML_
frame element).

So what is the bug about?  The fact that if you set cols first and then append
the frames things don't work?
This is really strange indeed. I will attach two testcases: the first one works
because I set the "cols" attribute on the frameset after appending the frame.
The second one doesn't work because I don't set the cols attribute. (on firebird0.6)
It's probably a reflow problem, but I'm amazed this hasn't been reported before.
I couldn't find any dup.
bz?
Status: UNCONFIRMED → NEW
Ever confirmed: true
Keywords: testcase
Priority: -- → P2
Target Milestone: --- → mozilla1.7alpha
Attached file Working testcase
Simple testcase: it works because we reflow manually by setting the cols
attribute (I think).
Attached file Non working testcase
This one doesn't work, the frame is not displayed. It is supposed to display
mozilla.org in a new frame.
Setting "cols" in this case actually causes a frame reconstruct (layout frame,
not HTML frame), not a reflow.  Which is why it works.

Now frame construction (layout objects) for <frame> is not handled in
nsCSSFrameConstructor; the frameset frame does that itself in its Init() method.
Which is why the other testcase fails.

Fixing this would involve pretty much completely rewriting how framesets are set
up and initialized.
given bz's comments I remove the priority and target milestone of this bug. If
someone wants to step up and fix it, you're welcome :-)
Marking All/All
OS: Linux → All
Priority: P2 → --
Hardware: PC → All
Target Milestone: mozilla1.7alpha → ---
*** Bug 229095 has been marked as a duplicate of this bug. ***
Depends on: 306660
Fixed by checkin for bug 306660
Assignee: general → bzbarsky
Status: NEW → RESOLVED
Closed: 19 years ago
Resolution: --- → FIXED
Component: DOM: HTML → DOM: Core & HTML
QA Contact: desale → general
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: