[whatwg] Interpretation issue: can <section> be used for "extended paragraphs"?

Jukka K. Korpela jkorpela at cs.tut.fi
Thu Mar 10 10:18:16 PST 2011


Markus Ernst wrote:

> Would it cause serious issues to add the Phrasing Content category to
> these three elements [ol, ul, dl] thus allowing them inside the p element?

I'm afraid it would, and I think that's the reason why the content model 
hasn't been extended in HTML5.

Consider

<p>some text<ul>...</ul> <div>...</div>

HTML specs up to and including HTML 4.01 and ISO HTML accept this, and 
definitely so that the <ul> tag implies a preceding </p>. This means, for 
example, that if you have set a background color for the p element in a 
stylesheet, it only applies to the block containing "some text", not the ul 
element.

If p elements were allowed to contain ul elements, the browser would have to 
imply </p> when it sees <div> and would need to treat the ul element as part 
of the p element - even if this wasn't the author's intent. We cannot know. 
And unlike in current browsers, the background color for the p element would 
extend to the ul element.

So this would change the interpretation and, generally speaking, the 
rendering of existing pages, in a manner that cannot be assumed to have been 
the authors' intent.

Introducing a new paragraph concept, say <par> element, would not have this 
problem, but it would have problems of its own. And the good old <p> element 
might feel rather lonely and rejected - and oddly named.

-- 
Yucca, http://www.cs.tut.fi/~jkorpela/ 




More information about the whatwg mailing list