Self-closing a tag not being parsed correctly

RESOLVED DUPLICATE of bug 162653

Status

()

Core
HTML: Parser
RESOLVED DUPLICATE of bug 162653
7 years ago
7 years ago

People

(Reporter: David H., Unassigned)

Tracking

Firefox Tracking Flags

(Not tracked)

Details

(URL)

(Reporter)

Description

7 years ago
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

Comment 1

7 years ago
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

Updated

7 years ago
Status: UNCONFIRMED → RESOLVED
Last Resolved: 7 years ago
Resolution: --- → DUPLICATE
Duplicate of bug: 571700

Updated

7 years ago
Duplicate of bug: 342773

Comment 4

7 years ago
Finally found the right bug to dup against...
See bug 162653 comment 2
Duplicate of bug: 162653
You need to log in before you can comment on or make changes to this bug.