Re: HTML element content models vs. components

On Wed, Sep 28, 2011 at 11:24 AM, Boris Zbarsky <bzbarsky@mit.edu> wrote:
> On 9/28/11 2:12 PM, Dimitri Glazkov wrote:
>>>>
>>>> C.) Just don't allow components to be used in places that have a special
>>>> content model.
>>>
>>> I prefer this one, because:
>>>
>>> 1. It is very simple.
>>>
>>> 2. It discourages people from using components in cases already handled
>>> by HTML.
>>
>> +1 as a first step. We can start with this and see how authors react.
>> I suspect that without actual running code and people trying things
>> out, we could be debating this for a very long time :)
>
> We already have authors requesting a way of binding a data-presentation
> component to a <table>.  Which has a special content model.

Man, I keep forgetting to put your table-as-chart use case on the
wiki. I'll put it up tomorrow.

>
>> Also, the "content model" is a bit of a loaded term. It's only about
>> what browsers actually do. IRL, it's perfectly ok to plop an<li>
>> element anywhere in your DOM tree. The only special-casing logic that
>> HTMLLiElement has is to deal with the rendering, as Morrita-san
>> already pointed out
>
> For <li>, this is correct.
>
> For <table>, you're screwed when using actual markup.  Take a look at
> http://software.hixie.ch/utilities/js/live-dom-viewer/saved/1158 and tell me
> where the table row and cell went in the DOM, please.

Yeah... Table is a difficult one.

>
>> This is not the case for all elements though.
>
> Yes.
>
>> And we won't weed out all edge cases by principled studying. We gotta
>> start simple and let
>> peeps run code! :)
>
> While avoiding design decisions that permanently lock out things we already
> know people want to do.

No argument here, we need to fix the obvious boogers.

BTW, When I said "running code", I don't necessarily mean "shipping code".

I think it will be very useful to circulate a one-off build of
Chromium that supports component model and let bleeding-edgers have at
it.

:DG<

>
> -Boris
>
>
>

Received on Wednesday, 28 September 2011 18:36:56 UTC