Re: [css-page] Meaning of :first page selector (was: [css3-gcpm] Page groups, named pages, and :first)

On 9/30/13 6:20 AM, "Simon Sapin" <simon.sapin@exyr.org> wrote:


>Le 25/09/2013 20:20, Cramer, Dave a écrit :
>> On 9/25/13 12:46 PM, "Simon Sapin"<simon.sapin@exyr.org>  wrote:
>>> http://www.w3.org/TR/2013/WD-css3-page-20130314/#first-pseudo
>>>
>>> Do you think we should change the meaning of :first in the Paged Media
>>> spec and introduce the "page group" concept?
>> Yes. :first is too useful, and too easily understood, to restrict to the
>> first page of a document. Håkon's use case from 2008
>> (http://lists.w3.org/Archives/Public/www-style/2008Aug/0136.html)
>>applies
>> to us: If we have two chapters:
>>
>> <div class="chapter">
>>      <h1>Loomings</h1>
>>      ....
>>    </div>
>>
>>    <div class="chapter">
>>      <h1>Epilogue</h1>
>>      ....
>>    </div>
>>
>>
>> How do we use the chapter title for a running head on every page except
>> the first? A user of InDesign or Quark would create a chapter opening
>> master page. In XSL-FO, I think you can define a master for the first
>>page
>> in a sequence. As CSS typesetters, it seems natural to write:
>>
>> @page chapter:first { @top-center { content: normal; } }
>> @page chapter:left { @top-center { content: string(chapter-title) } }
>> etc.
>>
>> So we just need a way to say "Use the :first page for the first page of
>> this group." prince-page-group: start; does this.
>>
>> I would like to note that solutions that involve the content of margin
>> boxes (like first-except) don't meet all our use cases. A
>>chapter-opening
>> page may have a background-image, different margins, etc.
>
>Again, I definitely agree that that page selectors need to be more
>powerful, including to select the first page of a group. (For some
>definition of "group" that remains to be specified.)
>
>For 15 years since CSS 2.0 (which already had named pages), ':first' has
>been defined as "first page of the document":
>
>http://www.w3.org/TR/1998/REC-CSS2-19980512/page.html#q8
>
>Instead of changing it now, I¹d rather have a new page selector such as
>:first-of-group and possibly :nth-of-group() (together with :nth() which
>counts in the document.)
>
>As to how page groups are delimited, a boolean 'page-group' property
>does not seem very elegant. Perhaps an optional keyword on the 'page'
>property?
>
>--
>Simon Sapin


I see the latest GCPM draft has nth selectors and page-group. And so my
example would look like:

div.chapter {
 page: chapter;
 page-group: start;
}

@page chapter:nth(1) { @top-center { content: normal; } }
@page chapter:left { @top-center { content: string(chapter-title) } }

Are you suggesting something more like this?

div.chapter {
 page: chapter begin-group; /* or start-group?  or use sequence instead of
group?*/
}

@page chapter:nth-of-group(1) { @top-center { content: normal; } }
@page chapter:left { @top-center { content: string(chapter-title) } }

This seems reasonable to me. It does seem slightly awkward to separate
assigning the named page and indicating the sequence it should use.

Dave







This may contain confidential material. If you are not an intended recipient, please notify the sender, delete immediately, and understand that no disclosure or reliance on the information herein is permitted. Hachette Book Group may monitor email to and from our network.

Received on Wednesday, 2 October 2013 13:51:29 UTC