W3C home > Mailing lists > Public > www-style@w3.org > November 2014

Re: [css-gcpm] String-set issues

From: Brad Kemper <brad.kemper@gmail.com>
Date: Mon, 24 Nov 2014 09:14:50 -0800
Message-Id: <5E9EB23D-E7B3-4A7A-A82C-251C92E7C967@gmail.com>
Cc: www-style list <www-style@w3.org>, Dave Cramer <Dave.Cramer@hbgusa.com>
To: Dave Cramer <dauwhe@gmail.com>

On Nov 23, 2014, at 7:12 PM, Dave Cramer <dauwhe@gmail.com> wrote:

>> By default, the content fragment name would be global, as the named flow is
>> with 'flow-into'. But if one of the following pseudo-classes are used on the
>> subject of the selector, then the name is locally scoped to just the page
>> the element is on.
>> 
>> :nth-of-page(n)    The element is the nth matched element on the page.
>> :first-of-page       Same as :nth-of-page(n), but where n = 1 (it is the
>> first matched element on the page).
>> :last-of-page       The element is the last matched element on the page.
>> :start-of-page      The element is the first matched element on the page,
>> and neither it nor its ancestors have any previous siblings that appear on
>> the page.
>> 
>> The content property would be able to accept the named content fragment as
>> one of its value parts, just by using the identifier. It would not be part
>> of a region chain, unless the whole element containing the named content
>> fragment had "flow-into" something else.
>> 
>> So, for instance, here are Examples 1-3 of GCPM, re-written with this
>> syntax:
>> --------
>> HTML:
>> <h1>Loomings on the <b>Horizon</b></h1>
>> 
>> 
>> CSS:
>> h1::before { content: 'Chapter ' counter(chapterNumber); }
>> h1:first-of-page { copy-into: headerP1 counter(chapter),
>>                                              headerP2; }
>> h1::after { content: '.' copy-into: headerP3; }
>> @top-center {
>>  content: headerP1 ": " headerP2 headerP3;
>> }
>> 
>> The value of the named string ”°headerP1”± will be ”°Chapter 1", and the value
>> of the named string ”°headerP2”± will be "Loomings”±. headerP2 will include the
>> bold tags around "Horizon", because the <content-type> defaults to
>> 'contents', not 'text'. The value of the named string ”°headerP3”± will be
>> ".”±. The top-center content will be "Chapter 1: Loomings on the
>> <b>Horizon</b>."
>> 
>> ---------
>> HTML:
>> <section title="Loomings">
>> 
>> CSS:
>> section:first-of-page { copy-into: header attr(title) }
>> 
>> The value of the ”°header”± string will be ”°Loomings”±, assuming that section
>> intersected with the page.
>> 
>> -----------
>> CSS:
>> 
>> @page {
>>  size: 15cm 10cm;
>>  margin: 1.5cm;
>> 
>>  @top-left {
>>     content: "first: " heading1;
>>  }
>>  @top-center {
>>     content: "start: " heading2;
>>  }
>>  @top-right {
>>     content: "last: " heading3;
>>  }
>> 
>>  @bottom-center {
>>     content: "start: " author;
>>  }
>> }
>> 
>> h2:first-of-page { copy-into: heading1 }
>> h2:start-of-page { copy-into: heading2 }
>> h2:last-of-page { copy-into: heading3 }
>> META[author] { copy-into: author attr(author); }
>> 
>> The rendered examples would be the same as in the spec, except that the
>> author's name would appear at the bottom center of each page too.
> 
> We've started thinking along those lines in a very rough sketch of GCPM4 [1].

Note that normally, assigning content to a flow name is something that overrides any previous assigning of content to that name, but with 'flow-persist', you are saying that every flow name will have 4 times as many content flows as there are matching elements (with optimizations possible if all four page positions are not used for that flow name). My proposal makes similar demands.

I think my pseudo-class approach makes it a little more clear (or maybe just intuitive to me) that you are using the particular copy of the flow that is associated with a particular h2 in a particular position of a particular page, and not just the normal single cascaded value of the flow name.
Received on Monday, 24 November 2014 17:15:19 UTC

This archive was generated by hypermail 2.3.1 : Monday, 2 May 2016 14:39:26 UTC