Closed Bug 268477 Opened 20 years ago Closed 20 years ago

Some self-closed <tag ... /> are not closed.

Categories

(Core :: DOM: HTML Parser, defect)

defect
Not set
minor

Tracking

()

RESOLVED DUPLICATE of bug 162653

People

(Reporter: steve, Unassigned)

References

()

Details

User-Agent: Mozilla/4.0 (compatible; MSIE 5.22; Mac_PowerPC) Build Identifier: <tag> ... </tag> can be replaced by <tag />, yet this self-closed shorthand is not always recognized. XHTML requires all tags to be closed. Reproducible: Always Steps to Reproduce: <html> <head> </head> <body> Before font tag<br /> <font color="red" size="5" /> After font tag -this should look no different since tag is self-closed.<br /> </body> </html> Actual Results: The closing / was ignored; it opened the <font> without closing it. No doubt this applies to many tags, not just <font>. Expected Results: <font...></font> should be identical to <font ... /> and should be treated as a 'no-op' (when there is nothing between tags, obviously). No browsers I've tested so far recognize self-closed tags, that is they all ignore the fact that they should close.
You have to serve the page as application/xhtml+xml to use that syntax. Otherwise, the page is treated as text/html, which means you have to follow the Appendix C rules of XHTML 1.0 for how to handle closing tags.
Status: UNCONFIRMED → RESOLVED
Closed: 20 years ago
Resolution: --- → INVALID
*** Bug 268826 has been marked as a duplicate of this bug. ***
*** Bug 268883 has been marked as a duplicate of this bug. ***
*** Bug 272870 has been marked as a duplicate of this bug. ***
*** Bug 277045 has been marked as a duplicate of this bug. ***
*** Bug 286218 has been marked as a duplicate of this bug. ***
Resolution: INVALID → DUPLICATE
You need to log in before you can comment on or make changes to this bug.