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

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

Received on Monday, 30 September 2013 10:21:16 UTC