Closed Bug 632389 Opened 12 years ago Closed 12 years ago

Renders <p> outside of its enclosing <a>


(Core :: DOM: HTML Parser, defect)

Not set





(Reporter: christofer, Unassigned)




(Whiteboard: [fixed by the HTML5 parser])

User-Agent:       Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_6_6; sv-se) AppleWebKit/533.19.4 (KHTML, like Gecko) Version/5.0.3 Safari/533.19.4
Build Identifier: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.6; sv-SE; rv: Gecko/20101203 Firefox/3.6.13

The page is rendered with php and the source code always looks correct. But sometimes Firefox renders one <p> outside of its enclosing <a> and adding additional <a> tags. Reloading the page will make the page render correctly most of the time.


Reproducible: Sometimes

Steps to Reproduce:
1. Visit the URL
2. Brows the categories until the bug appears. It might take some time. 
Actual Results:  
The <p> is rendered outside if its enclosing <a> and additional <a> tags are rendered

This is what firebug display when the bug occurs:

	<a href="?content=47486">
		<img src="" onerror="this.src='images/fallback.png'">
			<span class="rating">

			<span class="arrow">▴</span>
	</a><p><a href="?content=47486">Mat och dryck</a></p>
<a href="?content=47486">							</a>


This is what the source looks like:

<li >
	<a href="?content=47486">
		<img onerror="this.src='images/fallback.png'"  src="" />
		<span class="rating">

		<span class="arrow">&#9652;</span>
		<p>Mat och dryck</p>

<a><p> </p></a> is invalid markup per HTML4 spec (block element p inside inline element a not allowed). 
Please test with Fx 4 beta (new HTML5 parser implemented).
Component: General → HTML: Parser
Product: Firefox → Core
QA Contact: general → parser
This is a known bug in the old HTML parser, fixed in the HTML5 parser.
Whiteboard: DUPEME
I didn't find a bug to dupe this against quickly enough.
Closed: 12 years ago
Resolution: --- → FIXED
Whiteboard: DUPEME → [fixed by the HTML5 parser]
Is there any way to work around this until Fx 4 is released?
Don't use invalid markup?
(In reply to comment #4)
> Is there any way to work around this until Fx 4 is released?

I'm not aware of workarounds.

(In reply to comment #5)
> Don't use invalid markup?

It's valid HTML5.
You need to log in before you can comment on or make changes to this bug.