Re: HTML4 Diffs - Object, again

L. David Baron, Sat, 26 Jun 2010 20:52:19 -0700:
> On Sunday 2010-06-27 04:59 +0200, Leif Halvard Silli wrote:
>> can you track down and put into the Differences document some data 
>> about _when_ and _why_ HTML5 changed the content model of <object>? 
>> 
>> Example of the issue:
>> 
>> <p>
>>      <object type="image/gif" data="image">
>>         <p>Foo.</p>
>>      </object>
>> </p>
>> 
>> The above is legal in HTML4, but illegal in HTML5.I've already a bug to 
>> get back the HTML4 content model: 
>> http://www.w3.org/Bugs/Public/show_bug.cgi?id=9657
> 
> I think the HTML4 model was just a spec bug resulting from the use
> of DTDs to express the restrictions of the language.  Why would you
> want <object> to let pages violate a whole bunch of the rules of the
> content model of the language?

HTML4 include 4 such code examples - which I don't think it would have 
included, if it only were a theoretical DTD kind of thing:

<P><OBJECT classid="http://foo.bar.com/poem_viewer"
           data="KublaKhan.txt">
<PARAM name="font" valuetype="object" value="#tribune">
<P>You're missing a really cool poem viewer ...
</OBJECT>
	.......
 <P><OBJECT data="navbar1.gif" type="image/gif" usemap="#map1">
     <MAP name="map1">
       <P>Navigate the site:
       <A href="guide.html" shape="rect" coords="0,0,118,28">Access 
Guide</a> |
       <A href="shortcut.html" shape="rect" 
coords="118,0,184,28">Go</A> |
       <A href="search.html" shape="circle" 
coords="184,200,60">Search</A> |
       <A href="top10.html" shape="poly" 
coords="276,0,276,28,100,200,50,50,276
,0">Top Ten</A>
     </MAP>
</OBJECT>
	........
<P><OBJECT data="navbar1.gif" type="image/gif" usemap="#map1">
   <P>This is a navigation bar.
   </OBJECT
	.........
<P>
<OBJECT data="navbar.png" type="image/png" usemap="#map1">
  <OBJECT data="navbar.gif" type="image/gif" usemap="#map1">
     <MAP name="map1">
     <P>Navigate the site:
      <A href="guide.html" shape="rect" coords="0,0,118,28">Access 
Guide</a> |
      <A href="shortcut.html" shape="rect" coords="118,0,184,28">Go</A> 
|
      <A href="search.html" shape="circle" 
coords="184,200,60">Search</A> |
      <A href="top10.html" shape="poly" 
coords="276,0,276,28,100,200,50,50,276,
0">Top Ten</A>
     </MAP>
  </OBJECT>
</OBJECT>
	

And also: Every time the HTML4 validator discover an element in an 
illegal context, it typically tells you to nest it inside a <object> or 
<map> or <button> if you want to have it there.

I find it hard to believe that all these things are side effects of the 
fact that HTML4 is expressed as a DTD. 

> I could understand saying that you want to allow nested paragraphs
> in general.

When would it have made sense to nest a <p> inside a <p>? What would 
you use it for? I can see that it is useful to have a <table> or list 
inside a paragraph - in HTML4 you can do this by placing it inside an 
<object>. But I do not see why paragraph inside a paragraph is useful - 
it seems illogical. 

>  (It's not compatible with text/html-parsing, though.)

This is because <p> does not need a closing tag, I assume.

> But why would you want to allow nested paragraphs only when there is
> an object element between them?

Because, technically, it then isn't a paragraph inside a paragraph. It 
is a paragraph inside an object inside an a paragraph. From a practical 
point of view, because <object> is supposed to have fallback, including 
long fallbacks and transcripts. With the HTML5 limitation, you would 
have to to this:

<p>Paragraph 1.
<div>Paragraph 2: <object data="image"><p>Fallback.</object></div>
<p>Paragraph 3.

Whereas the HTML4 model allows us to do the logical thing:

<p>Paragraph 1.
<p>Paragraph 2: <object data="image"><p>Fallback.</object>
<p>Paragraph 3.

The only advantage I see to the current HTML5 model is that it is more 
compatible with legacy Internet Explorer. (And, I admit that I thought 
this to be a reason by the limitation ...)

I do not understand the way you reason: You find the issue that nesting 
of <p> inside <p> is impossible, as suboptimal. Then why do you argue 
for the same limitations also when there is no such technical 
limitation?
-- 
leif halvard silli

Received on Sunday, 27 June 2010 04:49:22 UTC