RE: [css3-page] page counters and scope

My comments intercalated below.

Best wishes,

Melinda

> Grant, Melinda wrote:
> >  
> > fantasai said:
> >>    1. Apply any counter-reset and counter-increment rules 
> to the page box,
> >>       creating and incrementing counters as if all page 
> boxes, including
> >>       this one, were sibling elements in a document. These 
> counters are in
> >>       the @page counter scope, and do not affect content 
> in the document.
> > 
> > The last sentence would preclude using page numbers within the 
> > document's contents.  I think we want to allow page references.
> 
> Right, so, "and are not affected by counter increments and 
> resets in the document"
> instead, and "However if an out-of-scope counter is used in 
> the counter() or
> counters() notation in the document, and that counter exists 
> in the @page counter scope, then the counter()/counters() 
> notation refers to the counter in the @page counter scope for 
> this page."
> 
> Does that work?

Yes, I think so, thanks.

> > 
> >>       The effect of @page counter rules at breaks in 
> overflowing content
> >>       is undefined. (This because some implementations 
> print incrementally,
> >>       and can't back up to make counter increments apply 
> to earlier 
> >> content.)
> > 
> > I think in general overflowing content should break predictably and 
> > follow the counting rules, because a lot of documents print 
> in overflow mode.
> > Maybe we could carve out a more narrow exception, if one is needed?
> 
> Yeah, probably. The case I'm concerned about is when a 
> counter is used on a page before a previous element ends, e.g.
> 
> <div style="counter-reset: foo">
>    <span style="content: counter(foo);"/>
>    <div style="height: 2em;">
>      Lots of content that spills across 3 pages
>    </div>
>    <span style="content: counter(foo);"/> </div>
> 
> Where both spans fall on the first page.

I guess the first question is what the 'correct' value for the span counter under the overflow should be. Assuming the snippet commences on page 1 (and is all in normal flow), I would intuitively expect the second span counter to say '1', since we're counting pages.  (Even though in terms of document order, it comes after content that may be on page 3.)

Other opinions?

> >>    3. Copy counters in scope at all break points, in 
> document order,
> >>       into the @page counter scope, obscuring any counters 
> of the same name
> >>       there. (In CSS3, this step is not required.)
> > 
> > Presumably you mean just page counters here and below in #4...?
> 
> No, I mean document counters here and in #4.

Hmm, let me rephrase.  I assume you mean document counters which are reset or incremented within a page context, and not all document counters?

> > I find 'all break points' a bit confusing...  I don't think 
> you mean 
> > all page break points, so I assume you must mean the point 
> where each 
> > element breaks?  Does my following rewording attempt 
> capture your intent?
> > 	3. Copy all counters manipulated within page contexts 
> that are in 
> > scope for any element split by the page break, in document 
> order, ...?
> 
> Yeah, except the in document order part. If an element breaks 
> in two places at this page break, we want the counter values 
> from the second break.

OK, I was trying to better understand what you're proposing for #3.  Your initial proposal was:
>	3. Copy counters in scope at all break points, in document order, into the @page counter scope, 
> obscuring any counters of the same name there. (In CSS3, this step is not required.)

I asked if the following was equivalent (or tried to):
	3. Copy all counters manipulated within page contexts that are in scope for any element split by the page break, in document order, into the @page counter scope, obscuring any counters of the same name there.  (In CSS3, this step is not required.)

So I'm confused now when you say "except for the in document order part."  Are you suggesting a change to your original proposal?  How would you determine which element split point is the second if not by document order?  And I thought your initial proposal said that we wanted all the counters from all the element split points, not just the second or last...?

:~)

Received on Thursday, 23 April 2009 20:32:28 UTC