Re: [css3-gcpm] [css3-page] Named page lists

Also sprach fantasai:

 > > I support the idea of changing 'page' from being inherited to not
 > > being inherited. If we do so, we can probably address the issue that
 > > the named page lists in GCPM is (unsuccessfully) trying to address;
 > > setting a different style on the first page in a series of pages. For
 > > example, the chapter title is often printed on the first page of the
 > > chapter and the chapter title should therefore not be printed in the
 > > running header of that first page. One could then write:
 > > 
 > >   div.chapter { page: chapter }
 > >   h2 { string-set: title content() }
 > >   @page chapter:left { @top-left { content: string(title) }}
 > >   @page chapter:first { @top-left { content: none }}
 > > 
 > > This code feels right to me, but it wouldn't work as long as 'page' is
 > > inherited (because 'chapter:first' in practice would match all pages).
 > 
 > Currently if two consecutive elements have different values for 'page',
 > there is a forced break. However if two consecutive elements have the
 > same value for 'page', there is no forced break. Under this proposal,
 > how would you distinguish between continuing the same section and starting
 > a new one?

By making elements with an 'page: auto' (which is the initial value)
look to the nearest ancester with a non-auto value.

Let's look at Example XXI:

  @page narrow { size: 9cm 18cm }
  @page rotated { size: landscape }
  div { page: narrow }
  table { page: rotated }

  <div>
  <table>...</table>
  <table>...</table>
  <p>This text is rendered on a 'narrow' page</p>
  </div>

If we change 'page' from being inherited to not, the 'page' value on
the p element will be 'auto' instead of 'narrow'. By looking to the
nearest ancestor with none-auto value, we find 'narrow' on the div
element, which is used.

In practice, this equals inheritance so there should be no behavior
changes wrt. page breaks.

The benefit of making this change is that we can use non-auto values
on the 'page' property as a marker for the start of a "page group".
The first page of a "page group" can be styled in this manner:

  div.chapter { page: chapter }
  @page chapter:first { ... }

An alternative to this solution is to explicitly mark the start of
page groups. Prince has added support for a property called
'prince-page-group' for this purpose [1]. The example above could then
be written:

  div.chapter { page: chapter; prince-page-group: start }
  @page chapter:first { ... }

I don't like this solution -- it uses one property more than
necessary.

[1] http://www.princexml.com/doc/6.0/properties/prince-page-group/

-h&kon
              Håkon Wium Lie                          CTO °þe®ª
howcome@opera.com                  http://people.opera.com/howcome

Received on Friday, 11 July 2008 15:15:45 UTC