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

On Thu, 7 Apr 2005, Henri Sivonen wrote:
> 
> The problem with allowing the HTML flavor and XHTML flavor diverge is 
> that one could no longer use HTML and XHTML serializations 
> interchangeably in apps that do not suffer from the HTML DOM legacy and 
> otherwise could treat the HTML-XHTML distinction as something you deal 
> with on the IO boundary.
> 
> I use Java XML tools for producing HTML. I use XHTML internally and 
> serialize as HTML. This works great with XHTML 1.0 and HTML 4.01. If the 
> HTML flavor of What WG HTML and the XHTML flavor diverge, I'd need to 
> spec that only an HTML-compatible subset of What WG XHTML that doesn't 
> nest elements in ways prohibited on the text/html side may be put into 
> an app that outputs text/html.

This is a very interesting point.

One possible hack is to say that when you serialise this kind of stuff to 
HTML, you have to wrap the problematic elements in <object> tags, so that 
for example this XML:

   <p>
    <ol>...</ol>
   </p>

...is serialised to HTML as:

   <p>
    <object><ol>...</ol></object>
   </p>

...or some such. That's rather ugly though, and would make serialising a 
more costly process. Or we could just say that people should pretend that 
browsers will parse it as intended:

   <p>
   <ol>...</ol>

...but that seems unclean at best (and won't style right either).   


I don't know what the good solution is.


On the other hand, there already are other big differences between HTML5 
and XHTML5 (or whatever we end up calling them). For instance, in the 
XHTML variant you can use embedded MathML. Is this just a case like that?


> I don't know whether this is a reason enough not to allow the XHTML 
> flavor diverge, but I think there is a need to at least specifically 
> flag anything that is not text/html-compatible.

Yeah, there will definitely need to be summaries of this kind of 
information somewhere in the spec.

-- 
Ian Hickson               U+1047E                )\._.,--....,'``.    fL
http://ln.hixie.ch/       U+263A                /,   _.. \   _\  ;`._ ,.
Things that are impossible just take longer.   `._.-(,_..'--(,_..'`-.;.'

Received on Thursday, 7 April 2005 18:00:41 UTC