NOTE: The current preferred location for bug reports is the GitHub issue tracker.
Bug 764 - p tag errors
p tag errors
Classification: Unclassified
Component: HTML parser
All All
: P2 normal
Assigned To: Nobody
Depends on:
  Show dependency treegraph
Reported: 2010-09-19 22:53 CEST by vsx1015
Modified: 2010-09-20 02:26 CEST (History)
1 user (show)

See Also:


Note You need to log in before you can comment on or make changes to this bug.
Description vsx1015 2010-09-19 22:53:14 CEST
Get error: No p element in scope but a p end tag seen.

<section id="express-box">
<p><!-- p tag set -->
<li>HTML / XHTML / HTML5</li>
</p><!-- this p tag gets an error -->
<blockquote><p>Touch the book - lick the book...</p></blockquote>
Comment 1 Michael[tm] Smith 2010-09-20 02:17:05 CEST
This is expected behavior.

If you want to avoid it, you should use a <div> element there instead of a <p>. Because a <ul> element is not valid as a child <p> element.

So the reason you see that message is, the HTML parser is closing that <p> element before the <ul> element. That's what the HTML parsing algorithm says it must do: The <ul> start tag "implies" to the parser that it must close any open <p> elements.

So, when the parser subsequently finds the </p> end tag later in the tree, it reports an error because it no longer has any <p> element open ("in scope").
Comment 2 Michael[tm] Smith 2010-09-20 02:26:32 CEST
btw, if you want to examine how your browser actually parses that document fragment, you check that here: