Re: HTML4 Diffs - Object, again

On Sun, 27 Jun 2010 05:48:16 +0100, Leif Halvard Silli  
<xn--mlform-iua@målform.no> wrote:

> 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.

Note that analogous use of <INS> and <DEL> is explicitly forbidden in  
HTML4:

http://www.w3.org/TR/html401/struct/text.html#h-9.4

Given that I think it was not intention to have "wildcard" elements in  
HTML 4 that allow violation of content model "if you want to have it  
there".


Assuming it's not simply limitation of DTD and omission in the spec, my  
theory is that <object>, <button> and <map> were expected to be rendered  
as inline-block (replaced) elements, and given HTML4's strong correlation  
of display model and content model, it made sense to allow block content  
in these elements.

<p>foo<object style="display:inline-block">bar<br>baz</object>quz</p>

However, in current implementations <object> fallback is rendered as if  
<object> was inline:

<p>foo<object data="http://example.invalid">bar<br>baz</object>quz</p>

so that reason is gone.


Personally I don't like the error message suggesting insertion of  
<object>, because it's misleading. It's extremely unlikely that author  
wanted to embed an object, put fallback in, but forgot the <object>  
element itself.

It seems to me that this error message is just unfortunate side-effect of  
validator's implementation rather than deliberately chosen authoring  
advice.

Such error is much more likely to be triggered by unclosed inline element  
or author's misunderstanding of HTML content model. Validator should  
suggest to close inline element or explain that block elements are not  
allowed in inlines, instead of suggesting a fudge that only hides true  
cause of the error.

-- 
regards, Kornel Lesiński

Received on Sunday, 27 June 2010 14:13:35 UTC