Skip to content

Commit 22be525

Browse files
author
dauwhe
committed
[css-gcpm-4] initial draft. Not ready for primetime.
1 parent 8c159a8 commit 22be525

File tree

3 files changed

+939
-0
lines changed

3 files changed

+939
-0
lines changed

css-gcpm-4/Overview.bs

Lines changed: 328 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,328 @@
1+
<h1>CSS Generated Content for Paged Media Module Level 4</h1>
2+
<pre class='metadata'>
3+
Status: ED
4+
Shortname: css-gcpm-4
5+
Level: 4
6+
Group: csswg
7+
ED: http://dev.w3.org/csswg/css-gcpm-4/
8+
Editor: Dave Cramer, Hachette Livre, dauwhe@gmail.com
9+
Editor: Daniel Glazman, Disruptive Innovations, daniel.glazman@disruptive-innovations.com
10+
Former Editor: Håkon Wium Lie, Opera Software
11+
Abstract: Level 4 of GCPM proposes a region-based approach to footnotes and running heads.
12+
!Issue Tracking: <a href="https://www.w3.org/Bugs/Public/enter_bug.cgi?product=CSS&component=Generated%20Content%20for%20Paged%20Media">W3C Bugzilla</a>
13+
Ignored Terms:
14+
Warning: Not Ready
15+
</pre>
16+
17+
<h2 class="no-num" id="introduction">
18+
Introduction
19+
</h2>
20+
21+
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().
22+
23+
This module proposes a unified approach to paginated layout based on [[CSS3-REGIONS]] and [[CSS3-PAGE-TEMPLATE]]. Additional properties will be introduced as necessary.
24+
25+
26+
27+
28+
<!--page areas-->
29+
<h2 id="running-headers-and-footers">
30+
Running headers and footers
31+
</h2>
32+
[[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.
33+
34+
[[CSS3GCPM]] provides for copying the string values of elements into the existing page margin boxes.
35+
36+
The existing mechanisms do not cover many use cases.
37+
38+
39+
<h3 id="flow-policy-heading">Copying a flow: the 'flow-policy' property</h3>
40+
41+
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]] only allows for an element to be moved to a ''named flow'', so we add the 'flow-policy' property to allow the same element to serve two roles.
42+
43+
<p class="note">Use cases for running heads can be found in [[LATINREQ] http://w3c.github.io/dpub-pagination/#content</p>
44+
45+
46+
47+
<pre class="propdef">
48+
Name: <dfn id="flow-policy-property">flow-policy</dfn>
49+
Value: extract | copy
50+
Initial: extract
51+
Applies To: all elements with a value of 'flow-into' other than none.
52+
Inherited: no
53+
Media: visual
54+
Computed value: as specified
55+
</pre>
56+
57+
<dl>
58+
59+
<dt>extract</dt>
60+
<dd>the element is taken out of its parent’s flow and placed into the named flow set by the value of the 'flow-into' property.</dd>
61+
62+
<dt>copy</dt>
63+
64+
<dd>the element remains into it's normal parent's flow but a copy of the element is also extracted from there and placed into the named flow set by the value of the 'flow-into' property.</dd>
65+
66+
</dl>
67+
68+
<div class="example">
69+
<pre>
70+
h1 {
71+
flow-into: chapter-title element;
72+
flow-policy: copy;
73+
font-size: 1.5em;
74+
}
75+
76+
@page {
77+
@top-center {
78+
flow-from: chapter-title;
79+
font-size: .9em;
80+
font-variant: small-caps;
81+
}
82+
}
83+
</pre>
84+
</div>
85+
86+
87+
<h3 id="flow-persist-heading">Making “sticky” headers: the 'flow-persist' property</h3>
88+
89+
An element flowed into a running head should appear on every page until the value of the element changes, at which point the new value should be used. We define the 'flow-persist' property to control how content is rendered in region chains (????).
90+
91+
92+
We also need to specify which element is used in a running head, when there are multiple possibilities. [[CSS3GCPM]] defines start, first, last, and first-except values.
93+
94+
95+
96+
97+
98+
99+
100+
101+
102+
103+
104+
105+
<pre class="propdef">
106+
Name: <dfn id="flow-persist-property">flow-persist</dfn>
107+
Value: ( normal | persist | static ), ( start | first | last | first-except)?
108+
Initial: normal
109+
Applies To: all elements with a value of 'flow-from' other than none.
110+
Inherited: no
111+
Media: visual
112+
Computed value: as specified
113+
</pre>
114+
115+
<dl>
116+
117+
<dt>normal</dt>
118+
<dd>Content from the named flow is rendered as described in [[CSS3-REGIONS]].</dd>
119+
120+
<dt>persist</dt>
121+
122+
<dd>Eligible content from the named flow is placed into the first box of the region chain as usual. If there is no eligible content on subsequent pages, the last-used content is used in the region box until new eligible content appears.
123+
124+
</dd>
125+
126+
<p class="issue">“That is not what I meant at all; That is not it, at all.” —T.S. Eliot</p>
127+
128+
129+
130+
131+
132+
<dt>static</dt>
133+
134+
<dd>The first instance of the element is used in every region associated with the region chain (this is the equivalent of flow-options: static in [[PGT]]).</dd>
135+
136+
</dl>
137+
138+
<p class="issue">Above definitions need work</p>
139+
140+
<dl>
141+
142+
<dt>first</dt>
143+
<dd>The value of the first assignment on the page is used. If there is no assignment on the page, the entry value is used. first is the default value.</dd>
144+
145+
<dt>start</dt>
146+
147+
<dd>If the element is the first element on the page, the value of the first assignment is used. Otherwise the entry value is used. The entry value may be empty if the element hasn’t yet appeared. </dd>
148+
149+
<dt>last</dt>
150+
151+
<dd>The exit value is used.</dd>
152+
153+
<dt>first-except</dt>
154+
155+
<dd>This is identical to first, except that the empty string is used on the page where the value is assigned.</dd>
156+
157+
</dl>
158+
159+
160+
161+
<div class="example">
162+
163+
<pre>
164+
h1 {
165+
flow-into: chapter-title element;
166+
flow-policy: copy;
167+
}
168+
169+
@page {
170+
@top-center {
171+
flow-from: chapter-title;
172+
flow-persist: persist start;
173+
}
174+
}
175+
176+
</pre>
177+
178+
The @top-center margin box will be populated with the content of the <code>h1</code>. The <code>h1</code> will also appear in the document in its normal place.
179+
</div>
180+
181+
<h2 id="page-area-head">Creating Page Areas</h2>
182+
183+
184+
[[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.
185+
186+
187+
<div class="example">
188+
189+
<pre>
190+
191+
@page body {
192+
@slot center-header {
193+
top: 0px;
194+
left: 1em;
195+
right: 1em;
196+
height: 2em;
197+
flow-from: header;
198+
flow-persist: persist;
199+
wrap-flow: clear;
200+
}
201+
}
202+
203+
</pre>
204+
205+
206+
</div>
207+
208+
209+
<p class="issue">Is there a need for both @page and @template?</p>
210+
211+
212+
213+
214+
215+
<h2 id="footnotes">
216+
Footnotes
217+
</h2>
218+
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.
219+
220+
221+
<h3 id="footnote-terms">Terminology</h3>
222+
223+
Footnotes are complex objects, so it will be helpful to define some terms before proceeding.
224+
225+
<figure>
226+
227+
228+
<img src="images/footnote-diagram.001.jpg" width="480" alt="page with footnotes"/>
229+
<figcaption>Footnote terminology</figcaption>
230+
</figure>
231+
232+
<dl>
233+
234+
235+
236+
<dt>footnote element</dt>
237+
<dd>The element containing the content of the footnote, which will be removed from the flow and displayed as a footnote.</dd>
238+
239+
<dt>footnote marker (also known as footnote number)</dt>
240+
<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>
241+
242+
<dt>footnote body</dt>
243+
<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>
244+
245+
<dt>footnote call (also known as footnote reference)</dt>
246+
<dd>A number or symbol, found in the main text, which points to the footnote body.</dd>
247+
248+
249+
<dt>footnote area</dt>
250+
<dd>The page area used to display footnotes.</dd>
251+
252+
<dt>footnote rule (also known as footnote separator)</dt>
253+
<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>
254+
255+
</dl>
256+
257+
<h3 id="footnotes-as-regions">Footnotes as Regions</h3>
258+
259+
260+
<div class="example">
261+
HTML:
262+
<pre style="word-wrap: break-word; white-space: pre-wrap;">
263+
&lt;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..&lt;span class="reference">&lt;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.&lt;/span>&lt;/span>&lt;/p>
264+
</pre>
265+
CSS:
266+
<pre>
267+
span.footnote {
268+
flow-into: footnote;
269+
flow-policy: copy;
270+
display: block;
271+
}
272+
273+
span.footnote::before {
274+
content: counter(footnote) '. ';
275+
}
276+
277+
span.reference::before {
278+
content: counter(footnote);
279+
font-variant-position: super;
280+
}
281+
282+
@page {
283+
@slot footnote {
284+
flow-from: footnote;
285+
required-flow: footnote;
286+
position: absolute;
287+
left: 54pt;
288+
bottom: 0pt;
289+
width: 352pt;
290+
height: auto;
291+
border-top: .25pt solid black;
292+
vertical-align: bottom;
293+
wrap-flow: clear;
294+
}
295+
}
296+
</pre>
297+
</div>
298+
299+
<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>
300+
301+
<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>
302+
303+
304+
305+
<div class="example">
306+
Inline footnote
307+
<pre>
308+
span.footnote {
309+
flow-into: footnote;
310+
display: inline;
311+
}
312+
</pre>
313+
</div>
314+
315+
316+
317+
318+
319+
320+
321+
322+
323+
<h2 class="no-num" id="acknowledgments">
324+
Acknowledgments
325+
</h2>
326+
327+
Tab Atkins, Jr., Håkon Wium Lie, Liam Quin, Peter Sorotokin, Alan Stearns
328+

0 commit comments

Comments
 (0)