W3C home > Mailing lists > Public > www-style@w3.org > July 2008

Re: [css3-gcpm] [css3-page] Named page lists

From: James Elmore <James.Elmore@cox.net>
Date: Sat, 12 Jul 2008 15:05:19 -0700
Message-Id: <8BA86A28-319B-4DE2-BB52-49C577D12D62@cox.net>
Cc: CSS <www-style@w3.org>
To: Håkon Wium Lie <howcome@opera.com>


On Jul 12, 2008, at 2:37 PM, Håkon Wium Lie wrote:

> Also sprach James Elmore:
>
>>> Generated Content for Paged Media [1] proposes a way to move  
>>> content.
>>> Consider this markup:
>>>
>>> <contrib contrib-type="author">
>>>   <name>
>>>     <surname>Knuth</surname>
>>>     <given-names>Donald E.</given-names>
>>>   </name>
>>>   <role>professor</role>
>>> </contrib>
>>>
>>> combined with this style sheet:
>>>
>>>   surname { float: to(lastname) }
>>>   given-names::after { content: from(lastname) ", " }
>>>
>>> will result in this presentation:
>>>
>>>   Donald E. Knuth, professor
>>>
>>> [1] http://www.w3.org/TR/css3-gcpm/
>>>
>>> Does this address your needs?
>>
>> Thanks for the reference, very interesting. This may be part of what
>> I am asking for, but not completely. This style allows the movement
>> of items from one place to another within a document (or a page).
>> With this, I could specify the element or contents that I wanted at
>> the end of the chapter, but I still don't see how to use it to place
>> that element at the end of a chapter or section.
>
> <div class="chapter">
>   <div class="move-to-end">...</div>
>   ....
> </div>
>
> div.move-to-end { float: to(end-of-chapter) }
> div.chapter::after { content: from(end-of-chapter) }
>
>> If this current discussion makes a clear way to specify styles or
>> content for the :first page, I would like to propose the addition
>> of :last page as well. Then it would be easy to incorporate the
>> elements I suggested in my last email at the end of every section. To
>> use your example, above, a reference work which includes shorter
>> sections each by a different author, could start with the title and
>> author on the :first page, and conclude with the author's name (and
>> possibly contact information) at the end (on the :last page).
>
> I'm not convinced by these use cases. If you want to move something to
> the end, I think you should move it to a place in the structure (e.g.,
> chapter or section, as per the example above), not to a certain page.
> The content you are moving may take up more than one page and the
> moved content will therefore not (only) be on the last page anymore.

The use case I really had in mind was having an icon at the end of  
each chapter. I remember several older books (can't place them  
specifically right now) which used this. It was not exactly a matter  
of relocating content, more like placing the same thing after each  
section.

If I want to place different things after each section, the obvious  
way is to place that content in the structure (DOM? XML parse tree?).  
But if I want the SAME thing after each division, it would be  
preferable to use styles, rather than repeat the same exact html.

It is, of course, possible to place something at the end of a div/ 
chapter/section using the ::after mechanism. It is equally possible  
to place elements/decorations/text/generated content at the start of  
a section with ::before. Since this is true, does that reduce the use  
case for :first page?

Thanks to your reminding me about ::before and ::after, most of my  
original question is answered. Thanks for that.

>
> If there is a good use case for setting different headers/footers on
> the last page, I may be convinced. Is there?
>
> It's slightly harder to implement :last than :first, because the
> formatter doesn't necessarily know that a page is the last until it
> has been formatted. Loops may occur.
>

I remember implementing loops where something which went first had to  
be handled and also ones where something had to be guaranteed to be  
last, the :last ones were usually harder. When possible, I recoded  
the loops to be left-associative rather than right, which simplified  
things. [If I'm not being clear about left- and right- associations,  
let me give one short example. A list of comma separated items can be  
coded as {item ,}* {item} or as {item} {, item}* The first example  
grows to the left and the second grows to the right.]

Loops may also occur -- as you mentioned before -- where the element  
will not fit in the space remaining on the page, which creates a new  
page. Now, will there be two of the elements?

> -h&kon
>               Håkon Wium Lie                          CTO °þe®ª
> howcome@opera.com                  http://people.opera.com/howcome
Received on Saturday, 12 July 2008 22:06:02 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Monday, 27 April 2009 13:55:10 GMT