Re: What <object> represents in different views (detailed review of Semantics)

2007-09-02 00:18:07 +0200 Sander Tekelenburg <st@isoc.nl> wrote:
> At 21:10 +0200 UTC, on 2007-09-01, Simon Pieters wrote:
> 
>> (This is part of my detailed review of the Semantics and structure of HTML
>> elements section.)
>> 
>> The spec says about <object>:
>> 
>>      In the absence of other factors (such as style sheets), user agents
>>      must show the user what the object element represents. Thus, the
>>      contents of object elements act as fallback content, to be used only
>>      when referenced resources can't be shown (e.g. because it returned a
>>      404 error). This allows multiple object elements to be nested inside
>>      each other, targeting multiple user agents with different capabilities,
>>      with the user agent picking the best one it supports.
> 
> {frown} how does the UA decide on "best"?
> 
>> However, what about the case where the UA supports the primary format but
>> it can't be "shown" in a particular view (e.g. an image when reading the
>> document aloud)? Shouldn't the fallback be used in such cases, just like
>> alt="" would be used for <img>?
> 
> That's certainly what most would expect, yes. I don't know why the spec
> specifically and only lists 404s as an excuse to fallback. Surely the reason
> a resource isn't presented is irrelevant? When it isn't presented, the UA
> must fallback to the <object>'s contents.

I agree about the 404. And the way OBJECT is implemented means that one must generally use fake DATA="URIs" and fake TYPE="mime" in order to  get the browsers to show the replacement content instead of the (theoretical) embedded conent.

E.g. in HTML4, using e.g. something like 

[example:] <p><object><p>test</p><table>[…]</object></p>

you can actually nest things which are otherwise unnestable, like P inside P, or TABLE inside P. But the problem is that you, without going trough the above mentioned hoops, cannot get all the browsers to reliably show the replacment content.

I made a test page, which amongst other things shows this <http://www.malform.no/prov/content-model/index.html>. E.g. if you look at the table in the OBJECT section of the page, you will see that it is not visible  in Safari (because I forgot to apply the "hoops" there.  The hoops  I otherwise used looked like this:

<object data="data:image/x-unsupported,TEST" type="image/x-unsupported" >

It appears that these hoops doesn't work in Internet Explorer, though ... I must look for better hoops. Actually, It appears IE works best without the hoops.

I will just mention that there perhaps is doubt about how replacement content like this should be displayed. The iCab interpretetation seems to be that the OBJECT element should be _replaced_ by its fallback content.  Thus, when the code is as in the example above, this leads to iCab interpreting the code as <P><P><TABLE></P></P>, without the OBJECT, and thus it tries to repair the invalid code ...
-- 
leif halvard silli

Received on Monday, 3 September 2007 02:17:54 UTC