forked from w3c/csswg-drafts
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathOverview.bs
More file actions
386 lines (269 loc) · 10.9 KB
/
Overview.bs
File metadata and controls
386 lines (269 loc) · 10.9 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
<h1>CSS Generated Content for Paged Media Module Level 4</h1>
<pre class='metadata'>
Status: ED
Shortname: css-gcpm-4
Level: 4
Group: csswg
ED: http://dev.w3.org/csswg/css-gcpm-4/
Editor: Dave Cramer, Hachette Livre, dauwhe@gmail.com
Editor: Daniel Glazman, Disruptive Innovations, daniel.glazman@disruptive-innovations.com
Abstract: Level 4 of GCPM proposes a region-based approach to footnotes and running heads.
!Issue Tracking: <a href="https://www.w3.org/Bugs/Public/enter_bug.cgi?product=CSS&component=Generated%20Content%20for%20Paged%20Media">W3C Bugzilla</a>
Ignored Terms:
Warning: Not Ready
</pre>
<h2 class="no-num" id="introduction">
Introduction
</h2>
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().
This module proposes a unified approach to paginated layout based on [[CSS3-REGIONS]] and [[CSS3-PAGE-TEMPLATE]]. Additional properties will be introduced as necessary.
<!--page areas-->
<h2 id="running-headers-and-footers">
Running headers and footers
</h2>
[[CSS3PAGE]] describes the sixteen page margin boxes which can be used for running headers and footers, but does not describe a mechanism for inserting content in those boxes.
[[CSS3GCPM]] provides for copying the string values of elements into the existing page margin boxes.
The existing mechanisms do not cover many use cases.
<h3 id="copy-into-heading">Copying a flow: the 'copy-into' property</h3>
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.
<p class="note">Use cases for running heads can be found in [[LATINREQ] http://w3c.github.io/dpub-pagination/#content</p>
<pre class="propdef">
Name: <dfn id="copy-into-property">copy-into</dfn>
Value: none | [ [ <custom-ident> <content-level>] [, <custom-ident> <content-level>]* ]?
Initial: none
Applies To: all elements and pseudo-elements, but not ::first-line or ::first-letter.
Inherited: no
Media: visual
Computed value: as specified
</pre>
The 'copy-into' property contains one or more pairs, each consisting of a custom identifier followed by a content-level keyword describing how to construct the value of the named content fragment.
''content-level'' expands to the following values:
<pre class="prod">
<dfn id="content-list">content-list</dfn> = element | content | text | attr(<identifier>) | counter() | counters()
</pre>
<dl>
<dt>element</dt>
<dd>the entire element is copied into the named content fragment</dd>
<dt>contents</dt>
<dd>only the element’s contents are copied into the named content fragment. This is the default if ''content-level'' is not specified.
</dd>
<dt>text</dt>
<dd>only the element’s text (including normally collapsed white space) is copied into the named content fragment.
</dd>
</dl>
<div class="example">
<pre>
h1 {
copy-into: chapter-title element;
font-size: 1.5em;
}
@page {
@top-center {
content: chapter-title '.';
font-size: .9em;
font-variant: small-caps;
}
}
</pre>
</div>
<h3 id="flow-persist-heading">Choosing among multiple values on a page</h3>
<pre class="propdef">
Name: <dfn id="flow-persist-property">flow-persist</dfn>
Value: ( normal | persist | static ), ( start | first | last | first-except)?
Initial: normal
Applies To: all elements with a value of 'flow-from' other than none.
Inherited: no
Media: visual
Computed value: as specified
</pre>
<div class="example">
Example using 'copy-from' syntax
<pre>
h1 {
copy-into: chapter-title;
}
@page:left {
@top-left {
content: copy-from(chapter-title, first);
}
}
@page:right {
@top-right {
content: copy-from(chapter-title, last);
}
}
</pre>
</div>
<div class="example">
Example using selectors syntax
<pre>
h1:first-of-page {
copy-into: chapter-title-left;
}
h1:last-of-page {
copy-into: chapter-title-right;
}
@page:left {
@top-left {
content: chapter-title-left;
}
}
@page:right {
@top-right {
content: chapter-title-right;
}
}
</pre>
</div>
<h2 id="page-area-head">Creating Page Areas</h2>
[[CSS3-PAGE-TEMPLATE]] introduces @template and @slot rules. We propose to allow the use of @slot in the @page context, to allow greater flexibility than the page margin boxes in [[CSS3PAGE]]. These slots can also be used for sidenotes, pull quotes, footnotes, and many other document features.
<div class="example">
<pre>
@page body {
@slot center-header {
top: 0px;
left: 1em;
right: 1em;
height: 2em;
flow-from: header;
flow-persist: persist;
wrap-flow: clear;
}
}
</pre>
</div>
<p class="issue">Is there a need for both @page and @template?</p>
<h2 id="footnotes">
Footnotes
</h2>
Ancillary content may be moved to the bottom or side of a page. A footnote is created when such content moves to the bottom of the page, leaving a reference indicator.
<h3 id="footnote-terms">Terminology</h3>
Footnotes are complex objects, so it will be helpful to define some terms before proceeding.
<figure>
<img src="images/footnote-diagram.001.jpg" width="480" alt="page with footnotes"/>
<figcaption>Footnote terminology</figcaption>
</figure>
<dl>
<dt>footnote element</dt>
<dd>The element containing the content of the footnote, which will be removed from the flow and displayed as a footnote.</dd>
<dt>footnote marker (also known as footnote number)</dt>
<dd>A number or symbol adjacent to the footnote body, identifying the particular footnote. The footnote marker should use the same number or symbol as the corresponding footnote call, although the marker may contain additional punctuation.</dd>
<dt>footnote body</dt>
<dd>The footnote marker is placed before the footnote element, and together they represent the footnote body, which will be placed in the footnote area.</dd>
<dt>footnote call (also known as footnote reference)</dt>
<dd>A number or symbol, found in the main text, which points to the footnote body.</dd>
<dt>footnote area</dt>
<dd>The page area used to display footnotes.</dd>
<dt>footnote rule (also known as footnote separator)</dt>
<dd>A horizontal rule is often used to separate the footnote area from the rest of the page. The separator (and the entire footnote area) cannot be rendered on a page with no footnotes.</dd>
</dl>
<h3 id="footnotes-as-regions">Footnotes as Regions</h3>
<div class="example">
HTML:
<pre style="word-wrap: break-word; white-space: pre-wrap;">
<p>Though the body was erect, the head was thrown back so that the closed eyes were pointed towards the needle of the tell-tale that swung from a beam in the ceiling..<span class="reference"><span class="footnote">The cabin-compass is called the tell-tale, because without going to the compass at the helm, the Captain, while below, can inform himself of the course of the ship.</span></span></p>
</pre>
CSS:
<pre>
span.footnote {
flow-into: footnote;
flow-policy: copy;
display: block;
}
span.footnote::before {
content: counter(footnote) '. ';
}
span.reference::before {
content: counter(footnote);
font-variant-position: super;
}
@page {
@slot footnote {
flow-from: footnote;
required-flow: footnote;
position: absolute;
left: 54pt;
bottom: 0pt;
width: 352pt;
height: auto;
border-top: .25pt solid black;
vertical-align: bottom;
wrap-flow: clear;
}
}
</pre>
</div>
<p class="issue">The above HTML contains two nested spans for the footnote, as CSS has no mechanism to leave a reference object where something was removed from the flow.</p>
<p class="issue">Would it be possible to specify <code>flow-into: none</code> on <code>span.footnote::after</code>? [[CSS3-REGIONS]] forbids the flow-into property on pseudo-elements, but should that be changed?</p>
<div class="example">
Inline footnote
<pre>
span.footnote {
flow-into: footnote;
display: inline;
}
</pre>
</div>
<!--<h2>Flow Properties from PGT (for reference)</h2>
<p class="note">For convenience, here are definitions of the flow properties used by [[EPUB-PGT]].</p>
<h3>flow-options</h3>
<pre class="propdef">
Name: <dfn id="flow-options-pgt">flow-options</dfn>
Values: none | [ exclusive || last || static
Initial: none
Applies To: elements for which 'flow-into' property was specified
Inherited: no
Media: visual
Computed value: as specified
</pre>
<dl>
<dt>exclusive</dt>
<dd>When content is selected for a partition, elements marked as exclusive are
considered first. Only one exclusive element is used for a single partition and one
element is always consumed (and removed from the flow if it is not also marked as
<span class="val">static</span>).</dd>
<dt>static</dt>
<dd>When an element is consumed in a partition, it is removed from the flow, unless it
is marked as <span class="val">static</span>. Static elements are placed in the flow
again when they are consumed.</dd>
<dt>last</dt>
<dd>When this option is applied to elements which are also marked <span class="val"
>exclusive</span>, the last of them is flowed in the next available
partition.</dd>
</dl>
<h3>flow-linger</h3>
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.
<pre class="propdef">
Name: <dfn id="flow-linger-pgt">flow-linger</dfn>
Values: none | <integer>
Initial: none
Applies To: elements for which 'flow-into' property was specified
Inherited: no
Media: visual
Computed value: as specified
</pre>
<h3>flow-priority</h3>
<pre class="propdef">
Name: <dfn id="flow-priority-pgt">flow-priority</dfn>
Values: <integer>
Initial: 0
Applies To:
Inherited: no
Media: visual
Computed value: as specified
</pre>
<h3>flow-consume</h3>
<pre class="propdef">
Name: <dfn id="flow-consume-pgt">flow-consume</dfn>
Values: some | all
Initial: all for body flow; some for all other flows
Applies To:
Inherited: no
Media: visual
Computed value: as specified
</pre>
-->
<h2 class="no-num" id="acknowledgments">
Acknowledgments
</h2>
Tab Atkins, Jr., Brak Kemper, Håkon Wium Lie, Liam Quin, Peter Sorotokin, Alan Stearns