Closed Bug 351655 Opened 19 years ago Closed 19 years ago

Firefox seems to require closing tag on iframe but there is no such requirement

Categories

(Firefox :: General, defect)

1.5.0.x Branch
x86
Windows XP
defect
Not set
normal

Tracking

()

RESOLVED DUPLICATE of bug 158667

People

(Reporter: dsilvia, Unassigned)

Details

User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.0.6) Gecko/20060728 Firefox/1.5.0.6 Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.0.6) Gecko/20060728 Firefox/1.5.0.6 An iframe tag of the form: <iframe src="some-file" ... /> is legal. However, in Firefox, all remaining code in the document is invalidated. Here's and example: dummy.html: <html> <head> <title></title> </head> <body> <p>Howdy!</p> </body> </html> iframeWithCloseTag.html: <html> <head> <title></title> </head> <body> <iframe src="dummy.html"></iframe> <iframe src="dummy.html"></iframe> <p>Did we get here?</p> </body> </html> iframeWithoutCloseTag: <html> <head> <title></title> </head> <body> <iframe src="dummy.html" /> <iframe src="dummy.html" /> <p>Did we get here?</p> </body> </html> Opening iframeWithCloseTag.html in Firefox does what you'd expect and if you look at the Page Source, the syntax highlighting is there. Opening iframeWithoutCloseTag.html will only show the first iframe and when you open Page Source, the syntax highlighting stops at the '/>' of the first iframe. btw, leaving the '/' out entirely which should also be legal (in ancient HTML) does the same thing. Reproducible: Always Steps to Reproduce: 1. Cut'n'paste the example code 2. Open in Firefox 3. Look at results and Page Source Actual Results: Alternate closing for iframe tag is not accepted. Balance of code is not processed. Expected Results: Should see all of code processed just as with a separate closing tag.
Version: unspecified → 1.5.0.x Branch
<iframe> requires closing tag. see http://www.w3schools.com/tags/tag_iframe.asp -> Invalid
Status: UNCONFIRMED → RESOLVED
Closed: 19 years ago
Resolution: --- → INVALID
Version: 1.5.0.x Branch → unspecified
I strongly disagree. Try looking at w3.org specs instead of a simple example from an outside source. btw, the example does not say the tag is required. See: http://www.w3.org/TR/html4/present/frames.html#h-16.5 and compare to the reference to the alternate object tag: http://www.w3.org/TR/html4/struct/objects.html#edef-OBJECT I researched this _very_ carefully before submitting a bug report.
Status: RESOLVED → UNCONFIRMED
Resolution: INVALID → ---
Version: unspecified → 1.5.0.x Branch
Also note that '/>' is a valid alternate for '</...>' and does constitute a closing tag. However, the bottom line still is that a closing tag is not a requirement, so even '>' should be honored. I won't quibble that issue, however, as long as current standards are met and currently the overriding (all inclusive) form would be whatever is legal in xml which would be either <iframe...></iframe> or <iframe... />. Also, try HTML tidy on it and see what you get. The results for <iframe... /> may well surprise you! You'll find that w3schools.com is _very_ limited and by no means authoritative in deciding well-formedness and/or validity. They're just examples that work pretty much across the board but are very limited in scope and comprehensive definition. It might be better in future not to use them as an authoritative reference.
(In reply to bug 158667 comment #5) > verified invalid. The XHTML 1.0 Recommendation, Appendix C, says: > Given an empty instance of an element whose content model is not EMPTY (for > example, an empty title or paragraph) do not use the minimized form (e.g. use > <p> </p> and not <p />). > The same recommendation says: > However, XHTML Documents which follow the guidelines set forth in Appendix C, > "HTML Compatibility Guidelines" may be labeled with the Internet Media Type > "text/html", as they are compatible with most HTML browsers. This document > makes no recommendation about MIME labeling of other XHTML documents. > The document in question does not follow Appendix C, so it may not be labeled as > text/html (since it is not in fact valid HTML). Not shure if that resolves the dispute or not but seems very simmilar.
Yes, but it's not empty! It has content. We're not talking <iframe />, we're talking <iframe src= ... />. Besides, an empty frame would make absolutely no sense whereas an empty paragraph is useful for formatting. You'll also find references to <br></br> which is the current correct form, however, in this case it is recommended that <br /> be used by the recommendations. At any rate, in looking at XMLSpy, Stylus Studio, WeBuilder, HTMLkit, IE (I know...), HTMLtidy, or just about any other well built agent you'll find they recognize all 3 forms while Firefox only recognizes one. Now the stricter xml type agents don't like the <iframe...> by itself form, but they'll let you use it. True, nearly all agents that do completion choose <iframe... ></iframe>, but if you put in the slash (that is, <iframe... />) they won't do the completion. No matter how you slice it, it amounts to a bug, imho, and wants fixing. If you choose not to fix it, that's your prerogative (agents are free to interpret the recommendations however they wish). But don't say it's invalid, say you just won't fix it.
Marking this INVALID was based on bug 221411 (maybe I should have mentioned this) Try the HTML validator to check if your page is valid or not. this code is not valid: <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html><head><title>iframes</title></head> <body> <iframe src="iframe1.html" width="200" height="400"/> </body> </html> the error is that there is no closing tag for <iframe>. if you add </iframe> you get a valid HTML page. So </iframe> is required on HTML. about XHTML I'm not sure but basing on comment #4 and bug 158667 I think that this should be marked as INVALID.
Sending XHTML as text/html Considered Harmful http://www.hixie.ch/advocacy/xhtml
(In reply to comment #2) > See: > > http://www.w3.org/TR/html4/present/frames.html#h-16.5 I assume you intend us to see the spec bug that the chapter on frames doesn't have the explanatory "Start tag: required, End tag: required" text, but the overriding, normative part is "<!ELEMENT IFRAME - - (%flow;)*" - both start and end tags are "-" which means they are required. You can still sometimes get away with omitting required end tags for things where they can be inferred, by starting another element that can't be contained in the unclosed element, but since the content of iframe can be anything, you'll only close it with </body> or </html>. Comment 5 sounds like you're missing the point of "empty" as it applies to elements: empty elements like img *cannot* have content, meaning that <img src="...">foo</img> is an image, the text node "foo", and something broken and meaningless, while in <iframe src="...">foo</iframe> "foo" isn't shown by agents that understand and are displaying frames, and is shown by agents that have never heard of iframe or have frame support disabled. So, since "<iframe src="..."> la la la going on about my business </body>" should hide everything after the iframe open tag, that leaves us with just the question of whether or not "/>" closes an element in purported XHTML that's served as text/html, for which you can see literally hundreds of bugs all saying "no" - the W3C's HTML WG intended that XHTML-as-text/html would be treated alike by things which understood both and by things that only understood SGML-HTML, where <iframe src="..." /> is an iframe open tag with a minimized attribute with the invalid name "/". *** This bug has been marked as a duplicate of 158667 ***
Status: UNCONFIRMED → RESOLVED
Closed: 19 years ago19 years ago
Resolution: --- → DUPLICATE
You need to log in before you can comment on or make changes to this bug.