Closed Bug 660108 Opened 13 years ago Closed 13 years ago

Self-closing a tag not being parsed correctly

Categories

(Core :: DOM: HTML Parser, defect)

x86_64
Windows 7
defect
Not set
normal

Tracking

()

RESOLVED DUPLICATE of bug 162653

People

(Reporter: oehr64, Unassigned)

References

()

Details

User-Agent:       Mozilla/5.0 (Windows NT 6.1; WOW64; rv:5.0) Gecko/20100101 Firefox/5.0
Build Identifier: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:5.0) Gecko/20100101 Firefox/5.0

Using a self-closing a tag (eg <a/> ) replicates itself until the a tag is closed again by a close tag ( </a> ). This can cause major issues in the layout of the site.

Here is an example:
http://oehr.evoboxes.net/atag/selfclosing1.html
http://oehr.evoboxes.net/atag/openandclose1.html

the only line that changes is line 29.
The example above isn't really practicable, so here's a proper example where self-closing a tags make sense:
http://oehr.evoboxes.net/atag/selfclosing2.html
http://oehr.evoboxes.net/atag/openandclose2.html

Taking a look at the parsed code in Firebug, it looks like this:
<a href="#0">
</a><ul><a href="#0"> 
	</a><li><a href="#0"></a><a href="#1">Link 1</a></li>
	<li><a href="#2">Link 2</a></li> 
	<li><a href="#3">Link 3</a></li> 
	<li><a href="#4">Link 4</a></li>
</ul>

Reproducible: Always
A trailing slash like in <a/> is ignored in HTML, that's XML syntax.
In other words: <a/> is the same as <a> in HTML.
-> INVALID
Status: UNCONFIRMED → RESOLVED
Closed: 13 years ago
Resolution: --- → DUPLICATE
Finally found the right bug to dup against...
See bug 162653 comment 2
You need to log in before you can comment on or make changes to this bug.