[whatwg] <p> elements containing other block-level elements

Lachlan Hunt lachlan.hunt at lachy.id.au
Fri Apr 8 04:54:09 PDT 2005


Ian Hickson wrote:
> To get truly nested elements, only the XML parser would be an option.
> 
> The question is whether:
> 
>  a) We don't allow any of this.

I don't think progress should be held up any more than it already is by 
broken browsers, so let's not let a limitation with HTML affect an XHTML 
implementation.

>  b) We allow it in XML and the DOM but disallow it in the HTML 
>     serialisation

Yes, this makes the most sense to me.

>  c) We allow it in XML and the DOM and say that authors may do it in HTML
>     but that parsers must (effectively) misunderstand them

It makes no sense to allow authors to do something and then force all 
implementations to remain intentionally broken.

>  d) We allow it in XML and the DOM and say that authors may use the 
>     <object> hack to us it in HTML

This is exactly the same as b, except it's encouraging the use of 
non-semantic hacks.

> I don't see any other realistic options. I don't like c. I'm reluctant to 
> do a. For me, that leaves b and d.

That leaves b as the only valid choice, IMHO.

> Of b and d I prefer b. That, along with embedding MathML and other XML 
> vocabularies, would be a reason to migrate to XML, if we consider that a 
> good thing.

Absolutely!  Given the incredibly broken SGML/HTML implementations that 
will never get any better, Migrating to XML is certainly the best way to 
actually progress into the future.  I'm sure no-one wants to be stuck 
with HTML forever, which is really more of a lost-cause when it comes to 
any real enhancements.

>>The content model for any block element allowed inside paragraphs should 
>>be tweaked to not allow paragraphs when it's inside a paragraph, because 
>>nested paragraphs don't make sense.
> 
> Agreed. (Including inside nested <tables> and <li>s, I assume? But 
> obviously excluding inside nested <blockquote>s.)

I don't think the spec should limit nested content too much because, as 
is shown by the <p><blockquote><p/></blockquote></p> example, there are 
valid reasons to nest paragraphs, and possibly others we haven't thought of.

Also, as history has shown, HTML4 never thought lists within paragraphs 
would be needed, though they are now allowed.  By placing too much 
restriction on the content models, we risk locking out legitimate 
use-cases which we haven't thought of, but which authors may find in the 
future.  I'm not saying we should just allow anything within anything, 
but we should be careful about being too restrictive.

-- 
Lachlan Hunt
http://lachy.id.au/
http://GetFirefox.com/     Rediscover the Web
http://GetThunderbird.com/ Reclaim your Inbox




More information about the whatwg mailing list