Skip to content

Commit 7a5872c

Browse files
author
dauwhe
committed
[css-gcpm-4] Incorporate Brad Kemper's copy-into proposal from www-style
1 parent 98fb9ea commit 7a5872c

5 files changed

Lines changed: 94 additions & 189 deletions

File tree

css-gcpm-4/Overview.bs

Lines changed: 37 additions & 129 deletions
Original file line numberDiff line numberDiff line change
@@ -11,21 +11,17 @@ Abstract: Level 4 of GCPM proposes a region-based approach to footnotes and runn
1111
!Issue Tracking: <a href="https://www.w3.org/Bugs/Public/enter_bug.cgi?product=CSS&component=Generated%20Content%20for%20Paged%20Media">W3C Bugzilla</a>
1212
Ignored Terms:
1313
Warning: Not Ready
14-
1514
</pre>
1615

1716
<h2 class="no-num" id="introduction">
18-
Introduction
17+
Introduction
1918
</h2>
2019

2120
There have been many proposals for using CSS to move document content, often motivated by the desire for magazine- or book-style layout of footnotes, running heads, pull quotes, sidebars, and so on. [[CSS3GCPM]] used float: footnote and position: running(). The now-abandoned [[CSS3GENCON]] Working Draft used content: footnote. PrinceXML (and older GCPM drafts) has content: flow() and flow: static(). WHATWG CSS Books has flow: area().
2221

2322
This module proposes a unified approach to paginated layout based on [[CSS3-REGIONS]] and [[CSS3-PAGE-TEMPLATE]]. Additional properties will be introduced as necessary.
2423

2524

26-
27-
28-
<!--page areas-->
2925
<h2 id="running-headers-and-footers">
3026
Running headers and footers
3127
</h2>
@@ -40,7 +36,7 @@ The existing mechanisms do not cover many use cases.
4036

4137
Headers often contain document content, and it is desirable to both display that content normally (for example, as an <code>h1</code>) and to use the content in a running head. [[CSS3-REGIONS]] allows for an element to be moved to a ''named flow'', but doesn't allow for using the same content in two ways. The 'copy-into' property allows an element to be copied into a content fragment which can then be placed with the 'content' property.
4238

43-
<p class="note">Use cases for running heads can be found in [[LATINREQ] http://w3c.github.io/dpub-pagination/#content</p>
39+
<p class="note">Use cases for running heads can be found in [[LATINREQ]] http://w3c.github.io/dpub-pagination/#content</p>
4440

4541

4642

@@ -64,21 +60,14 @@ The 'copy-into' property contains one or more pairs, each consisting of a custom
6460

6561

6662
<dl>
67-
6863
<dt>element</dt>
6964
<dd>the entire element is copied into the named content fragment</dd>
7065

7166
<dt>contents</dt>
72-
73-
<dd>only the element’s contents are copied into the named content fragment. This is the default if ''content-level'' is not specified.
74-
75-
</dd>
67+
<dd>only the element’s contents are copied into the named content fragment. This is the default if ''content-level'' is not specified.</dd>
7668

7769
<dt>text</dt>
78-
79-
<dd>only the element’s text (including normally collapsed white space) is copied into the named content fragment.
80-
</dd>
81-
70+
<dd>only the element’s text (including normally collapsed white space) is copied into the named content fragment.</dd>
8271
</dl>
8372

8473
<div class="example">
@@ -101,41 +90,25 @@ h1 {
10190

10291
<h3 id="flow-persist-heading">Choosing among multiple values on a page</h3>
10392

93+
<h4 id="page-selector-pseudo-classes">Page selector pseudo-classes</h4>
10494

95+
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.
10596

97+
<dl>
10698

99+
<dt><dfn>:nth-of-page(n)</dfn></dt>
100+
<dd>The element is the nth matched element on the page.</dd>
107101

102+
<dt><dfn>:first-of-page</dfn></dt>
103+
<dd>Same as :nth-of-page(n), but where n = 1 (it is the first matched element on the page).</dd>
108104

109-
<!--
110-
<pre class="propdef">
111-
Name: <dfn id="flow-persist-property">flow-persist</dfn>
112-
Value: ( normal | persist | static ), ( start | first | last | first-except)?
113-
Initial: normal
114-
Applies To: all elements with a value of 'flow-from' other than none.
115-
Inherited: no
116-
Media: visual
117-
Computed value: as specified
118-
</pre>
119-
-->
120-
121-
122-
123-
124-
<h4>Page selector pseudo-classes</h4>
125-
126-
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.
127-
128-
:: : :nth-of-page(n)
129-
:: The element is the nth matched element on the page.
130-
131-
:: : :first-of-page
132-
:: Same as :nth-of-page(n), but where n = 1 (it is the first matched element on the page).
105+
<dt><dfn>:last-of-page</dfn></dt>
106+
<dd>The element is the last matched element on the page.</dd>
133107

134-
:: : :last-of-page
135-
:: The element is the last matched element on the page.
108+
<dt><dfn>:start-of-page</dfn></dt>
109+
<dd>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.</dd>
136110

137-
:: : :start-of-page
138-
:: 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.
111+
</dl>
139112

140113

141114
<div class="example">
@@ -165,7 +138,9 @@ h1::after {
165138
</pre>
166139

167140

168-
The value of the named string “headerP1” will be “Chapter 1”, and the value of the named string “headerP2” will be “Voyage of the <i>Beagle</i>”. headerP2 will include the italic tags around "Beagle", 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: The Voyage of the <i>Horizon</i>.”</div>
141+
The value of the named string “headerP1” will be “Chapter 1”, and the value of the named string “headerP2” will be “Voyage of the <i>Beagle</i>”. headerP2 will include the italic tags around "Beagle", because the <code>content-type</code> defaults to ''copy-into/contents'', not ''copy-into/text''. The value of the named string “headerP3” will be “.”. The top-center content will be “Chapter 1: The Voyage of the <i>Horizon</i>.”
142+
143+
</div>
169144

170145
<div class="example">
171146
HTML:
@@ -177,10 +152,10 @@ HTML:
177152
CSS:
178153

179154
<pre>
180-
section { string-set: header attr(title) }
155+
section:first-of-page { copy-into: header attr(title) }
181156
</pre>
182157

183-
The value of the “header” string will be “Loomings”.
158+
The value of the “header” string will be “Loomings”, assuming that section intersected with the page.
184159
</div>
185160

186161

@@ -194,39 +169,42 @@ CSS:
194169
margin: 1.5cm;
195170

196171
@top-left {
197-
content: "first: " string(heading, first);
172+
content: "first: " heading1;
198173
}
199174
@top-center {
200-
content: "start: " string(heading, start);
175+
content: "start: " heading2;
201176
}
202177
@top-right {
203-
content: "last: " string(heading, last);
178+
content: "last: " heading3;
204179
}
205180
}
206181

207-
h2 { string-set: heading content() }
182+
h2:first-of-page { copy-into: heading1 }
183+
h2:start-of-page { copy-into: heading2 }
184+
h2:last-of-page { copy-into: heading3 }
208185
</pre>
186+
209187
The following figures show the first, start, and last assignments of the “heading” string on various pages.
188+
210189
<figure>
211-
<img src="using-strings-1.jpg" width="480" alt=""/>
212-
<figcaption>The <a href="#string-start">start</a> value is empty, as the string had not yet been set at the start of the page.</figcaption>
190+
<img src="images/using-strings-1.jpg" width="480" alt=""/>
191+
<figcaption>The <code>start</code> value is empty, as the string had not yet been set at the start of the page.</figcaption>
213192
</figure>
193+
214194
<figure>
215-
<img src="using-strings-2.jpg" width="480" alt=""/>
216-
<figcaption>Since the page starts with an h2, the <a href="#string-start">start</a> value is the value of that head.</figcaption>
195+
<img src="images/using-strings-2.jpg" width="480" alt=""/>
196+
<figcaption>Since the page starts with an h2, the <code>start</code> value is the value of that head.</figcaption>
217197
</figure>
198+
218199
<figure>
219-
<img src="using-strings-3.jpg" width="480" alt=""/>
220-
<figcaption>Since there’s not an h2 at the top of this page, the <a href="#string-start">start</a> value is the ''exit value'' of the previous page.</figcaption>
200+
<img src="images/using-strings-3.jpg" width="480" alt=""/>
201+
<figcaption>Since there’s not an h2 at the top of this page, the <code>start</code> value is the exit value of the previous page.</figcaption>
221202
</figure>
222203

223204
</div>
224205

225206

226207

227-
228-
229-
230208
<h2 id="page-area-head">Creating Page Areas</h2>
231209

232210

@@ -365,76 +343,6 @@ span.footnote {
365343

366344

367345

368-
<!--<h2>Flow Properties from PGT (for reference)</h2>
369-
370-
<p class="note">For convenience, here are definitions of the flow properties used by [[EPUB-PGT]].</p>
371-
372-
<h3>flow-options</h3>
373-
<pre class="propdef">
374-
Name: <dfn id="flow-options-pgt">flow-options</dfn>
375-
Values: none | [ exclusive || last || static
376-
Initial: none
377-
Applies To: elements for which 'flow-into' property was specified
378-
Inherited: no
379-
Media: visual
380-
Computed value: as specified
381-
</pre>
382-
383-
<dl>
384-
<dt>exclusive</dt>
385-
<dd>When content is selected for a partition, elements marked as exclusive are
386-
considered first. Only one exclusive element is used for a single partition and one
387-
element is always consumed (and removed from the flow if it is not also marked as
388-
<span class="val">static</span>).</dd>
389-
<dt>static</dt>
390-
<dd>When an element is consumed in a partition, it is removed from the flow, unless it
391-
is marked as <span class="val">static</span>. Static elements are placed in the flow
392-
again when they are consumed.</dd>
393-
<dt>last</dt>
394-
<dd>When this option is applied to elements which are also marked <span class="val"
395-
>exclusive</span>, the last of them is flowed in the next available
396-
partition.</dd>
397-
</dl>
398-
399-
<h3>flow-linger</h3>
400-
401-
The 'flow-linger' property determines how many pages an element is eligible for on a page. None means it stays eligible until consumed. <integer> must be positive and means number of pages. 1 means that it should be used on the same page it became eligible.
402-
403-
<pre class="propdef">
404-
Name: <dfn id="flow-linger-pgt">flow-linger</dfn>
405-
Values: none | &lt;integer&gt;
406-
Initial: none
407-
Applies To: elements for which 'flow-into' property was specified
408-
Inherited: no
409-
Media: visual
410-
Computed value: as specified
411-
</pre>
412-
413-
414-
415-
<h3>flow-priority</h3>
416-
<pre class="propdef">
417-
Name: <dfn id="flow-priority-pgt">flow-priority</dfn>
418-
Values: &lt;integer&gt;
419-
Initial: 0
420-
Applies To:
421-
Inherited: no
422-
Media: visual
423-
Computed value: as specified
424-
</pre>
425-
426-
<h3>flow-consume</h3>
427-
<pre class="propdef">
428-
Name: <dfn id="flow-consume-pgt">flow-consume</dfn>
429-
Values: some | all
430-
Initial: all for body flow; some for all other flows
431-
Applies To:
432-
Inherited: no
433-
Media: visual
434-
Computed value: as specified
435-
</pre>
436-
437-
-->
438346

439347

440348

0 commit comments

Comments
 (0)