Re: //head/object

Henri Sivonen, Tue, 4 May 2010 11:35:22 +0300:
> On May 3, 2010, at 17:55, Toby Inkster wrote:
>> I was thinking of using <object> in <head> as a way of embedding RDFa
>> or microdata without disturbing the appearance of the page.
> That doesn't seem like a legitimate use case of <object> to me. 
> Rather, it seems like a way of exploiting the limitations of 
> DTD-based validation.
> If you are using <object> for a purpose other 
> than embedding an external resource, you are misusing <object> that 
> already does too many things.

You have two claims here:

1) to use <object> as a container element should be forbidden
2) even HTML4 agrees with that it should be forbidden, it is only 
   a loophole in DTD based validation which causes HTML4 and 
   XHTML1.x validators to not display an error whenever one uses
    <object> without either the @type or the @data attribute.

To the latter: 
* So if it *is* possible to express such a thing in a DTD (I don't know 
if it is), then I suppose you consider that as a proof of the opposite? 
Are there any DTD experts that can tell us? 
* HTML4 several times mentions that something is not possible to 
express in a DTD, but still defines a rule for it. Thus even if it is 
impossible in a DTD, this may not be a  good argument.

To the former: 
Why should it be forbidden? 

<object> has many times been taken as an example of were XHTML2 was 
heading: All elements would be able to serve the role as embedding 
element, as mark-up container element - or both. It has been said that 
HTML5, by allowing <a> to enclose e.g. a <table>, took inspiration from 
XHTML2 - this way allowing "impossible" elements to become links. 
Likewise, by using <object> as the sole direct child of e.g. a <p> 
element, one can say that XHTML2's radical content model is still 
partly alive. E.g. this would allow me to have captioned images inside 
a paragraph:

<p>Lorem ipsum. 
      <img src="*" alt="">

Of course, an alternative to the above, would be to allow <figure> to 
be both inline and block level. THe above is anyhow currently illegal 
in HTML5. And not only because it contains no @data or @type attribute. 
But because it contains, as HTML5 sees it, an illegal nesting. [1] 

Though the illegal nesting did not hinder Lachlan from presenting a 
Change Proposal for Issue-107, where he offered one <p> element which, 
according to how HTMl5 currently sees it, was nested inside another <p> 
element. Even Ian himself did not react, but instead said that he would 
be happy to add Lachlans example! [2]

So, that this nesting should be illegal, cannot be very well founded. 
And shows that <object> is not very well defined in HTML5, as it 
stands. So there is plenty of room for bugs. [3]

>> Filing a bug against html5-diffs seems to beg the bigger question of
>> whether <object> should be allowed inside <head>. I can't find any
>> record of this having been discussed - the HTML5 draft spec seems to
>> have just accepted the behaviour of Opera, Gecko and WebKit, even
>> though it goes against the HTML 4 specification, and against Internet
>> Explorer's behaviour.
> What HTML 4 said doesn't really matter. What Opera, Gecko, WebKit and 
> IE do does. When there's a 3 vs. 1 situation with 3 on the side of 
> parser simplicity, I think the spec should follow the 3.

That math is very difficult/inconsistent ...  And HTML 4 does really 

But anyway, as it stands, then <object> is defined as having a 
transparent content model. I don't think that transparent is the 
correct content model for <object>. At least not with the current 
definition of what that means. However, as long as the content model 
remains transparent, then it would at least be conceivable to allow an 
<object> inside <head> to contain anything that <head> is allowed to 
contain (we should probably not allow it to contain <title> though.) I 
don't know if that would help you, Toby?

The outline which <object> creates anyhow has to be defined - it cannot 
work the same way that it works for <a>. And when the outline w.r.t. 
<object> becomes defined (see bug 9658 [4]), then I don't see any 
hindrance for making <object> an element which can be used as a pure 
mark-up container, both inside <body> and inside <head>. (The 
alternative is to make <figure> able to appear inline.)

leif halvard silli

Received on Wednesday, 5 May 2010 04:45:56 UTC