Re: [css3-regions][css3-gcpm] Thoughts on Plan A and Plan B

On Feb 15, 2012, at 1:41 PM, Dimitri Glazkov wrote:

>> 
>> I think relevant features of a page templates spec would include:
>> 
>> (1) The ability to define categories of pages, e.g., page masters, "header",
>> "two-column page", "figure page", etc.
> 
> Isn't it's unnecessarily limiting to think of the templates as only
> page-level? Any non-toy web site will have nested layouts.

Not sure what your point is here. All I said was you have to be able to define categories of pages. I didn't say anything about what syntax would be used to define the categories. Maybe your point is that there is nothing special about pages vs. other boxes…. in which case, I say, ok sure, but not really my point?

You still have to be able to define and select categories at a page level, regardless of whether the syntax is more broadly applicable to other boxes.

> 
> I don't see it. With shadow DOM, I can define insertion points for
> where the contents go. This allows keeping the content and the
> template completely separate. So:
> 
> 1) a template would use elements to create the right layout and put
> insertion points wherever the content is presented;
> 2) page will just have content in it;
> 3) template is instantiated as shadow DOM for a template layout root element;
> 4) the page and template content is merged when rendered.
> 
> That seems elegant and scalable.

I think using explicit elements or shadow elements is the worst of the solutions I listed. While I put it on the list for completeness, it's not my preferred choice. I'd be careful about pushing a shadow DOM agenda with this feature, as I don't think it's a particularly good fit. There is value to being able to create anonymous boxes in CSS without backing them with DOM elements.

Sylvain brought up the Economist iPad app for example, and that app is basically a poster child for CSS3 GCPM. It can be nearly completely implemented using column spans and page floats. Even many of the fancy interactions brought up (the text zooming, the article headers, etc.) are possible with CSS3 GCPM.

With the .ibooks format, we've even been able to just use positioning as the layout scheme for the regions on each page with great success. Let's not pretend that super complicated layouts are required here for most sites.

I would personally expect the templates to go more in the direction of CSS multi-column in that they define declarative layouts built using anonymous boxes. If super-complex interactivity is required, or if the layouts need to be really complicated, then let the author just build it by hand using explicit elements and scripting.

I've looked at a lot of these magazine layouts (especially the iPad apps), and most of them can be done with CSS GCPM. Of those that can't, most of what remains can be done with simple page templates and anonymous boxes. The tiny percentage that remain that want crazy complex interactivity or dynamism can be handled with explicit elements and scripting IMO without having to use templates.

dave
(hyatt@apple.com)

Received on Wednesday, 15 February 2012 20:02:13 UTC