- From: Refstrup, Jacob Grundtvig <jacob.refstrup@hp.com>
- Date: Fri, 11 Jul 2008 15:39:53 +0000
- To: Håkon Wium Lie <howcome@opera.com>, fantasai <fantasai.lists@inkedblade.net>
- CC: "www-style@w3.org" <www-style@w3.org>
Håkon wrote: > 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. > I think you need additional logic (perhaps not completely intuitive) to deal with :first page rules. One of the examples that you refered to had: > > div.chapter { page: chapter } > > h2 { string-set: title content() } > > @page chapter:left { @top-left { content: string(title) }} > > @page chapter:first { @top-left { content: none }} With the following document fragment: <div class="chapter"> <h2>Chapter 1 heading</h2> This is the prose of the 1st chapter. Flows into 2nd page. </div> <div class="chapter"> <h2>Chapter 2 heading</h2> This is the prose of the 1st chapter. </div> It would seem that the author would want the first page of each chapter to have title in the top-left page margin. Imagine this document generating two pages -- they'll both be named 'chapter'; but in this case we want chapter:first to match both of them. Therefore when checking for <named-page>:first you'd have to go back to the nearest ancestor with a page valid other than 'auto' and match first iff the current page is the first page for that ancestor to appear. - Jacob
Received on Friday, 11 July 2008 15:41:01 UTC