Re: HTML element content models vs. components

On Wed, Sep 28, 2011 at 3:39 PM, Roland Steiner
<rolandsteiner@chromium.org>wrote:

> Expanding on the general web component discussion, one area that hasn't
> been touched on AFAIK is how components fit within the content model of HTML
> elements.
> Take for example a list (
> http://www.whatwg.org/specs/web-apps/current-work/multipage/grouping-content.html#the-ul-element
> ):
>
> <ol> and <ul> have "Zero or more <li> elements" as content model, while
> <li> is specified to only be usable within <ol>, <ul> and <menu>.
>
> Now it is not inconceivable that someone would like to create a component
> <x-li> that acts as a list item, but expands on it. In order to allow this,
> the content model for <ol>, <ul>, <menu> would need to be changed to
> accomodate this. I can see this happening in a few ways:
>

In my understanding, this is what its style should care about.
If the element (in a component case, the host element) is styled as
"display: list-item",
It can behave as a part of the list.

In general, we can interpret its rendering result by thinking about
flattened DOM in XBL term.
After flattening, there is (should be) nothing special for component
rendering.

Does this make sense?



>
> A.) allow elements derived from a certain element to always take their
> place within element content models.
>
> In this case, only components whose host element is derived from <li> would
> be allowed within <ol>, <ul>, <menu>, whether or not it is rendered (q.v.
> the "Should the shadow host element be rendered?" thread on this ML).
>
>
> B.) allow all components within all elements.
>
> While quite broad, this may be necessary in case the host element isn't
> rendered and perhaps derivation isn't used. Presumably the shadow DOM in
> this case contains one - or even several - <li> elements as topmost elements
> in the tree.
>
>
> C.) Just don't allow components to be used in places that have a special
> content model.
>
>
> Thoughts?
>
> - Roland
>



-- 
morrita

Received on Wednesday, 28 September 2011 06:58:58 UTC