- From: Håkon Wium Lie <howcome@opera.com>
- Date: Thu, 23 Feb 2012 17:03:36 +0100
- To: Alan Stearns <stearns@adobe.com>
- Cc: "www-style@w3.org Style" <www-style@w3.org>
Alan Stearns wrote:
> There's been a bunch of discussion about extending @page rules to provide
> master templates for paginated layout. That's where my thinking started as
> well, but currently I'm considering using master templates at an element
> level instead of for the entire document.
Indeed, element-level vs. document-level is an important axis. But in
your examples (below) you describe document-level templates, no?
> I like the ideas in GCPM for paged presentations, and there you can set
> overflow-style on a single element. I think it would be interesting to use
> that switch for turning on a paginated display and provide a means to
> associate such a paginated element with a master template.
Ok, so the "master templates" are defined globally, but can be
associated with single elements. Like named pages are associated with
elements through the 'page' property, right?
> A master template can define boxes (or slots) that can contain content - the
> content can come from the element, a named flow, or be generated content.
> Since these master templates apply to paginated elements, if the content
> associated with any slot overflows, a new paged view is created with
> additional boxes until all of the content is displayed.
Good, I like the auto-generation part. What master page is selected
for the overflow content? What if the content of two slots on a page
overflow, do they overflow onto the same page?
> Because I would like to make master templates work with the ideas from GCPM,
> I have a notion of an implicit master template with an implicit slot. The
> implicit master template has a single implicit slot that contains the
> paginated element's content. So the following four examples are equivalent -
> they all give the same rendering as specified in GCPM. Examples 2-4 would
> never actually be used without adding more boxes to the template.
>
> 1. (no master template defined)
> #content { overflow-style: paged-x; }
>
> 2. (template with implicit content slot)
> #content { overflow-style:paged-x; }
> @master-template { }
>
> 3. (template with explicit content slot)
> #content { overflow-style:paged-x; }
> @master-template {
> template-slots: content;
> <slot-syntax>(content) { }
> }
>
> 4. (template using an explicit region slot)
> #content { overflow-style:paged-x; }
> #content > * { flow-into: content-flow; }
> @master-template {
> template-slots: main;
> <slot-syntax>(main) {
> flow-from: content-flow;
> }
> }
It's a noble goal to try to alingn mechanisms. And I kind of follow
your code examples. But I don't understand what you try to do in (4):
take all elements (including all text?) from #content and put them
somewhere else? Or, is the use case to have the tex paginated, while
the image are shown somewhere else? (The selector '#content > *' would
select all <em> elements, too)
> I don't know what the correct syntax for addressing slots should be, so I'm
> using <slot-syntax> here as a stand-in. The template-slots descriptor lets
> you create named slots in the template and specify their order if that
> matters for positioning.
>
> Master templates can create more boxes to suit the intended design:
>
> A simple header for each page:
>
> #content { overflow-style:paged-x; }
> @master-template {
> template-slots: header, content;
> <slot-syntax>(header) {
> content: "title string";
> }
> <slot-syntax>(content) { }
> }
What's the purpose of 'template-slots' -- to define an order for the slots?
> A simple footer for each page:
>
> #content { overflow-style:paged-x; }
> @master-template {
> template-slots: content, footer;
> <slot-syntax>(content) { }
> <slot-syntax>(footer) {
> content: "author string";
> }
> }
If 'template-slots' define an order, chances are that the 'footer'
slot will get some content flowed into it. What will happen with
"author string" then?
> Displaying two articles side-by-side:
>
> .article1 { overflow-style:paged-x; }
> .article2 { flow-into:second-article; }
> @master-template {
> template-slots: content, right;
> <slot-syntax>(content) {
> width: 40%;
> padding: 5%
> float:left;
> }
> <slot-syntax>(right) {
> flow-from: second-article;
> width: 40%;
> padding: 5%
> float:right;
> }
> }
Hmm. In the above example you flow the second article into the 'right'
slot, while the 'content' slot presumable is empty? If so, why are
they both declared in 'template-slots'? I guess I don't understand what it does.
Another problem is how to define a sequence of slot that appear on
different pages.
-h&kon
Håkon Wium Lie CTO °þe®ª
howcome@opera.com http://people.opera.com/howcome
Received on Thursday, 23 February 2012 16:04:11 UTC