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

On 10/22/13 1:01 PM, "Tab Atkins Jr." <jackalmage@gmail.com> wrote:


>On Tue, Oct 22, 2013 at 10:38 AM, Håkon Wium Lie <howcome@opera.com>
>wrote:
>
>> Likewise, this selector:
>>
>>   @page funky:nth(2)
>>
>> should give us the second page of every funky page group.
>>
>> Thinking of it as pseduo-elements may make it easier to extend into:
>>
>>   @page funky:nth(2) p
>>
>> Where all p elements inside those pseud-elements are selected.
>
>If ::nth() is a pseudo-element, that's fine.  If it's a pseudo-class,
>it's not fine.  You're free to choose which way it works, but the
>syntax needs to match up properly - double colons for pseudo-elements.
>
>However, I don't think that ::nth() as a pseudo-element works.  You're
>still styling the page, not some other construct created by the
>browser.  It's just filtering, like a normal selector, and so is most
>like a pseudo-class.

css-page defines :first, :left, :right, and :blank as pseudo-classes, even
though these seem very different from the pseudo-classes defined in
Selectors 4.

>
>If some printer implementations have done this wrong, whatever, but
>don't infect the rest of the platform with inconsistent semantics in
>their selectors.  If you want the second funky page, use
>
>@page :nth-match(2 of funky) { ... }
>
>~TJ


But we're still facing the original problem, which was (in simplest form)
to match the first page of each chapter. Prince does:

div.Chapter { page: body; prince-page-group: start; }
@page body:first { Š } /* or @page body:nth(1) */

And we've heard objections to page-group for being a binary property, and
for changing the accepted meaning of :first. On the other hand, this
approach works and has been implemented :)

I wonder if we could avoid the idea of page-group by defining it away.
This is only an issue for named pages. When a named page is assigned (via
page: name; ) is there any reason to not start the equivalent of a
page-group? Then you could write:

div.Chapter { page: body; }
@page body:tab-approved-pseudo-class-to-be-defined-later(1) { Š } /* would
match the first page of every div.Chapter */


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, 23 October 2013 04:35:11 UTC