Closed
Bug 235757
Opened 21 years ago
Closed 15 years ago
IFRAME children is missing from DOM
Categories
(Core :: DOM: HTML Parser, defect)
Core
DOM: HTML Parser
Tracking
()
RESOLVED
INVALID
People
(Reporter: rail, Unassigned)
References
Details
Attachments
(1 file)
1.12 KB,
text/html
|
Details |
User-Agent:
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:) Gecko/20040226
I have a document with two divs and two iframes.
Clicking on the divs is supposed to show one of the iframes and hide the other.
However, this fails in mozilla because it cannot find the second iframe.
Works fine in iE and Netscape 6.2
Reproducible: Always
Steps to Reproduce:
The following is the code that shows the problem
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD>
<TITLE> New Document </TITLE>
<META NAME="Generator" CONTENT="EditPlus">
<META NAME="Author" CONTENT="">
<META NAME="Keywords" CONTENT="">
<META NAME="Description" CONTENT="">
<style>
#tocframe {
display: none;
height: 100%;
width: 100%;
z-order: -1;
}
#framesearch {
display: none;
height: 100%;
width: 100%;
}
</style>
<script>
function showToc()
{
document.getElementById("framesearch").style.display
= "none";
document.getElementById("tocframe").style.display
= "block";
}
function showSearch()
{
alert("showing search " + document.getElementById
("framesearch"));
document.getElementById("framesearch").style.display
= "block";
alert("showing search");
document.getElementById("tocframe").style.display
= "none";
}
</script>
</HEAD>
<BODY>
<div onClick="showToc()">
show toc
</div>
<div onClick="showSearch()">
show search
</div>
<iframe id="framesearch" src="blanknav.html" />
<iframe id="tocframe" src="testswap.html" />
</BODY>
</HTML>
Actual Results:
The alert will show that the value returned is null
Expected Results:
I want the iframe returned.
Reporter | ||
Comment 1•21 years ago
|
||
It contains just html.
You can change the extension and use it.
Comment 2•21 years ago
|
||
To parser. The unclosed outer iframe means we never parse the inner one for
some reason.... it's not in the DOM.
That said, closing your tags would be a good idea if you want them to work; if
we fix this bug the inner iframe will be a chld of the outer one, and the script
will still not work the way you want it to.
Assignee: general → parser
Component: DOM → HTML: Parser
Reporter | ||
Comment 3•21 years ago
|
||
(In reply to comment #2)
> To parser. The unclosed outer iframe means we never parse the inner one for
> some reason.... it's not in the DOM.
> That said, closing your tags would be a good idea if you want them to work;
if
> we fix this bug the inner iframe will be a chld of the outer one, and the
script
> will still not work the way you want it to.
The iframe is closed man.
The line is
<iframe id="framesearch" src="blanknav.html" />
it has a />
which means close.
Do you mean, I need to specify </iframe> explicitly.
Roshan
Comment 4•21 years ago
|
||
In HTML, <foo/> is the same as <foo> with some random junk.
You are probably confusing this with XML, in which the syntax is different.
Reporter | ||
Comment 5•21 years ago
|
||
Ok that worked for me.
Thanks,
Roshan
Comment 6•21 years ago
|
||
bz: didn't we go through this on a recent bug? IFRAME, for some bizarre reason,
has a content model that includes IFRAME, so nesting in this case is the right
thing to do...INVALID?
Reporter | ||
Comment 7•21 years ago
|
||
Just a note.
I was looking up the HTML 4 spec.
It clearly states that nested content for an iframe should only be displayed
by a user agent that doesn't support iframes.
Judging by that, I think the current behaviour is correct where it doesn't put
it into the DOM.
However, this is not the behaviour for other HTML elements.
This can cause confusion.
I guess the best option would be to maybe document this quirk somewhere.
In most cases, IE is used as a reference although it has the worst standards
support I have seen.
In my case even Netscape 6.2 worked that's why I was bewildered when it didn't
work in Firefox, which I use as my default browser both at home and work.
As far as this bug goes, you can close it.
Comment 8•21 years ago
|
||
Confirming what I believe is a valid bug. The IFRAME children should be
in the DOM just as the alternate content for OBJECT for example.
Severity: major → minor
Status: UNCONFIRMED → NEW
Ever confirmed: true
OS: Windows XP → All
Hardware: PC → All
Summary: getElementById doesn't find the second iframe → IFRAME children is missing from DOM
Comment 9•21 years ago
|
||
Might be related to bug 147070.
Updated•15 years ago
|
Assignee: parser → nobody
QA Contact: ian → parser
Comment 10•15 years ago
|
||
INVALID per HTML5: /> doesn't close an iframe, and iframe's content is parsed like the content of <textarea>.
Status: NEW → RESOLVED
Closed: 15 years ago
Resolution: --- → INVALID
You need to log in
before you can comment on or make changes to this bug.
Description
•