|
11 | 11 | <meta content="CSS Generated Content for Paged Media Module" |
12 | 12 | name=dcterms.title> |
13 | 13 | <meta content=text name=dcterms.type> |
14 | | - <meta content=2013-09-07 name=dcterms.date> |
| 14 | + <meta content=2013-09-08 name=dcterms.date> |
15 | 15 | <meta content="Håkon Wium Lie" name=dcterms.creator> |
16 | 16 | <meta content=W3C name=dcterms.publisher> |
17 | 17 | <meta content="http://dev.w3.org/csswg/css3-gcpm/" name=dcterms.identifier> |
|
42 | 42 |
|
43 | 43 | <h1>CSS Generated Content for Paged Media Module</h1> |
44 | 44 |
|
45 | | - <h2 class="no-num no-toc" id=w3c-working>Editor's Draft 7 September 2013</h2> |
| 45 | + <h2 class="no-num no-toc" id=w3c-working>Editor's Draft 8 September 2013</h2> |
46 | 46 |
|
47 | 47 | <dl> |
48 | 48 | <dt>This version: |
49 | 49 |
|
50 | 50 | <dd><a |
51 | | - href="http://dev.w3.org/csswg/css3-gcpm/">http://www.w3.org/TR/2013/ED-css3-gcpm-20130907/</a> |
| 51 | + href="http://dev.w3.org/csswg/css3-gcpm/">http://www.w3.org/TR/2013/ED-css3-gcpm-20130908/</a> |
52 | 52 |
|
53 | 53 | <dt>Latest version: |
54 | 54 |
|
@@ -309,6 +309,10 @@ <h2 class="no-num no-toc" id=table-of-contents><a name=contents>Table of |
309 | 309 |
|
310 | 310 | <li><a href="#selecting-pages"><span class=secno>17. </span>Selecting |
311 | 311 | pages</a> |
| 312 | + <ul class=toc> |
| 313 | + <li><a href="#page-groups-"><span class=secno>17.1. </span>Page groups |
| 314 | + </a> |
| 315 | + </ul> |
312 | 316 |
|
313 | 317 | <li><a href="#selecting-lines"><span class=secno>18. </span>Selecting |
314 | 318 | lines</a> |
@@ -4476,114 +4480,128 @@ <h2 id=regions-and-exclusions-examples><span class=secno>16. </span>Regions |
4476 | 4480 |
|
4477 | 4481 | <h2 id=selecting-pages><span class=secno>17. </span>Selecting pages</h2> |
4478 | 4482 |
|
4479 | | - <p>In CSS 2.0, <a |
| 4483 | + <p>In CSS2, <a |
4480 | 4484 | href="http://www.w3.org/TR/CSS2/page.html#page-selectors">first, left and |
4481 | 4485 | right pages</a> can be selected. This specification adds support for |
4482 | | - selecting the nth page of a certiain type. |
4483 | | - |
4484 | | - <p>The ‘<code class=property>first-page</code>’ pseudo-element is |
4485 | | - similar to the ‘<code class=property>first-letter</code>’ and ‘<code |
4486 | | - class=property>first-line</code>’ elements; it is used to apply styling |
4487 | | - to the part of an element that ends up on the starting page for that |
4488 | | - element. If the whole element appears on the starting page, ‘<code |
4489 | | - class=property>first-page</code>’ applies to the whole element. The |
4490 | | - following properties apply to :first-page pseudo-elements: column |
4491 | | - properties, background properties, margin properties, border properties, |
4492 | | - and padding properties. UAs may apply other properties as well. |
| 4486 | + selecting the nth page. <!-- |
| 4487 | +<p>The 'first-page' pseudo-element is similar to the 'first-letter' |
| 4488 | +and 'first-line' elements; it is used to apply styling to the part of |
| 4489 | +an element that ends up on the starting page for that element. If the |
| 4490 | +whole element appears on the starting page, 'first-page' applies to |
| 4491 | +the whole element. The following properties apply to :first-page |
| 4492 | +pseudo-elements: column properties, background properties, margin |
| 4493 | +properties, border properties, and padding properties. UAs may apply |
| 4494 | +other properties as well. |
| 4495 | +--> |
4493 | 4496 |
|
4494 | 4497 | <div class=example> |
4495 | | - <p>In this example, there will be one column on the starting page of each |
4496 | | - chapter, while subsequent pages will have two columns: |
| 4498 | + <p>In this example, the first page of an article will have a pink |
| 4499 | + background, and the second will be lime: |
4497 | 4500 |
|
4498 | 4501 | <pre> |
4499 | | - div.chapter { columns: 2 } |
4500 | | - div.chapter::first-page { columns: 1 } |
| 4502 | +@page funky:nth(1) { background: pink } |
| 4503 | +@page funky:nth(2) { background: lime } |
| 4504 | +article { page: funky } |
4501 | 4505 | </pre> |
4502 | 4506 | </div> |
4503 | 4507 |
|
| 4508 | + <p>The grammar of allowed arguments to nth() is the same as the <a |
| 4509 | + href="http://www.w3.org/TR/css3-selectors/#nth-child-pseudo">nth-child() |
| 4510 | + pseudo-class</a>. |
| 4511 | + |
4504 | 4512 | <div class=example> |
4505 | | - <p>In this example, padding is added on the left side on the starting page |
4506 | | - of each chapter: |
| 4513 | + <p>In this example, pages in a document will alternate between pink and |
| 4514 | + lime backgrounds: |
4507 | 4515 |
|
4508 | 4516 | <pre> |
4509 | | - div.chapter { break-before: left } |
4510 | | - div.chapter::first-page { padding-left: 4em } |
| 4517 | +@page :nth(odd) { background: pink } |
| 4518 | +@page :nth(even)) { background: lime } |
4511 | 4519 | </pre> |
4512 | 4520 | </div> |
4513 | 4521 |
|
4514 | | - <p>As a generalization of the ‘<code class=property>first-page</code>’ |
4515 | | - pseudo-element, the ‘<code class=css>page()</code>’ pseudo-selector |
4516 | | - allows other pages to be selected. |
| 4522 | + <h3 id=page-groups-><span class=secno>17.1. </span>Page groups</h3> |
4517 | 4523 |
|
4518 | | - <div class=example> |
4519 | | - <pre> |
4520 | | -div.chapter::page(2) /* second page of the element */ |
4521 | | -div.chapter::page(2n) /* even pages of the element */ |
4522 | | -div.chapter::page(2-4) /* select page 2, 3, and 4 */ |
4523 | | -div.chapter::page(2)::column(2) /* second column, but only if it appears on the second page */ |
4524 | | -</pre> |
4525 | | - </div> |
4526 | | - <!-- |
4527 | | -nth page in the document, or the nth named page. |
| 4524 | + <p>Named pages can appear in sequence, stemming from different elements. A |
| 4525 | + sequnce of named pages is called a <em>page group</em>. The ‘<a |
| 4526 | + href="#page-group"><code class=property>page-group</code></a>’ property |
| 4527 | + expresses whether an element starts a new page group or not. |
4528 | 4528 |
|
| 4529 | + <table class=propdef> |
| 4530 | + <tbody> |
| 4531 | + <tr> |
| 4532 | + <td><em>Name:</em> |
4529 | 4533 |
|
4530 | | -<div class=example> |
4531 | | -<p>This example sets the background color of the second page in the document: |
| 4534 | + <td><dfn id=page-group>page-group</dfn> |
4532 | 4535 |
|
4533 | | -<pre> |
4534 | | -@page :nth(2) { |
4535 | | - background: green; |
4536 | | -} |
4537 | | -<pre> |
4538 | | -</div> |
| 4536 | + <tr> |
| 4537 | + <td><em>Value:</em> |
4539 | 4538 |
|
4540 | | -<div class=example> |
4541 | | -<p>This example sets the background color of the second page of all chapters in a document: |
| 4539 | + <td>auto | start |
4542 | 4540 |
|
4543 | | -<pre> |
4544 | | -@page chapter { |
4545 | | - background: yellow; |
4546 | | -} |
4547 | | -@page chapter:nth(2) { |
4548 | | - background: green; |
4549 | | -} |
4550 | | -div.chapter { |
4551 | | - page: chapter; |
4552 | | -} |
4553 | | -<pre> |
4554 | | -</div> |
| 4541 | + <tr> |
| 4542 | + <td><em>Initial:</em> |
4555 | 4543 |
|
4556 | | -<p>The arguments to the nth() functional notation is the same as for the <a href="http://www.w3.org/TR/css3-selectors/#nth-child-pseudo">nth-child()</a> pseudo-class. |
| 4544 | + <td>auto |
4557 | 4545 |
|
4558 | | -<div class="example"> |
4559 | | -<pre> |
4560 | | -@page chapter:nth(2n+1) { |
4561 | | - background: green; |
4562 | | -} |
4563 | | -</pre> |
4564 | | -</div> |
| 4546 | + <tr> |
| 4547 | + <td><em>Applies to:</em> |
4565 | 4548 |
|
4566 | | -<p>Even when a named page is not defined through an <code>@page <em>name</em> { .. }</code> construct, the name can still be used with :nth(). |
| 4549 | + <td>elements with ‘<code class=property>page</code>’ value other |
| 4550 | + than auto |
4567 | 4551 |
|
4568 | | -<div class="example"> |
4569 | | -<p>Even when the first line is commented out, the second page of all chapters in the document will be green. |
| 4552 | + <tr> |
| 4553 | + <td><em>Inherited:</em> |
4570 | 4554 |
|
4571 | | -<pre> |
4572 | | -/* @page chapter { ... } */ |
| 4555 | + <td>no |
4573 | 4556 |
|
4574 | | -@page chapter:nth(2) { |
4575 | | - background: green; |
4576 | | -} |
| 4557 | + <tr> |
| 4558 | + <td><em>Percentages:</em> |
4577 | 4559 |
|
4578 | | -div.chapter { page: chapter } |
4579 | | -</pre> |
4580 | | -</div> |
| 4560 | + <td>N/A |
4581 | 4561 |
|
| 4562 | + <tr> |
| 4563 | + <td><em>Media:</em> |
4582 | 4564 |
|
4583 | | -<h3>Page pseudo-elements</h3> |
| 4565 | + <td>paged |
4584 | 4566 |
|
4585 | | -<p class=issue>This may no longer be needed du to generic page selectors |
4586 | | ---> |
| 4567 | + <tr> |
| 4568 | + <td><em>Computed value:</em> |
| 4569 | + |
| 4570 | + <td>as specified |
| 4571 | + </table> |
| 4572 | + |
| 4573 | + <p>This property determines whether the element starts a new page group or |
| 4574 | + not. |
| 4575 | + |
| 4576 | + <dl> |
| 4577 | + <dt>auto |
| 4578 | + |
| 4579 | + <dd>The element only starts a new page group if ‘<code |
| 4580 | + class=property>page</code>’ has a named page different from the the |
| 4581 | + previous element. |
| 4582 | + |
| 4583 | + <dt>start |
| 4584 | + |
| 4585 | + <dd>The element starts a new page group. |
| 4586 | + </dl> |
| 4587 | + |
| 4588 | + <div class=example> |
| 4589 | + <p>In this example, each article starts a new page group so that the first |
| 4590 | + page of each article has a pink background. |
| 4591 | + |
| 4592 | + <pre> |
| 4593 | +@page funky:first-page { |
| 4594 | + background: pink; |
| 4595 | +} |
| 4596 | +article { |
| 4597 | + page: funky; |
| 4598 | + page-group: start; |
| 4599 | +} |
| 4600 | +</pre> |
| 4601 | + |
| 4602 | + <p>Without the ‘<code class=css>page-group: start</code>’ declaration, |
| 4603 | + only the first page of the first article would be pink. |
| 4604 | + </div> |
4587 | 4605 |
|
4588 | 4606 | <h2 id=selecting-lines><span class=secno>18. </span>Selecting lines</h2> |
4589 | 4607 |
|
@@ -4754,6 +4772,9 @@ <h2 class=no-num id=index>Index</h2> |
4754 | 4772 | <li>named strings, <a href="#named-strings0" |
4755 | 4773 | title="section 1."><strong>1.</strong></a> |
4756 | 4774 |
|
| 4775 | + <li>page-group, <a href="#page-group" |
| 4776 | + title="section 17.1."><strong>17.1.</strong></a> |
| 4777 | + |
4757 | 4778 | <li>running elements, <a href="#running-elements0" |
4758 | 4779 | title="section 1."><strong>1.</strong></a> |
4759 | 4780 |
|
@@ -4933,6 +4954,21 @@ <h2 class=no-num id=property-index>Property index</h2> |
4933 | 4954 |
|
4934 | 4955 | <td>visual, paged |
4935 | 4956 |
|
| 4957 | + <tr> |
| 4958 | + <th><a class=property href="#page-group">page-group</a> |
| 4959 | + |
| 4960 | + <td>auto | start |
| 4961 | + |
| 4962 | + <td>auto |
| 4963 | + |
| 4964 | + <td>elements with ‘page’ value other than auto |
| 4965 | + |
| 4966 | + <td>no |
| 4967 | + |
| 4968 | + <td>N/A |
| 4969 | + |
| 4970 | + <td>paged |
| 4971 | + |
4936 | 4972 | <tr> |
4937 | 4973 | <th><a class=property href="#string-set">string-set</a> |
4938 | 4974 |
|
|
0 commit comments