-
Notifications
You must be signed in to change notification settings - Fork 707
/
Copy pathOverview.html
867 lines (725 loc) · 33 KB
/
Overview.html
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
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
<!DOCTYPE html>
<html lang=en>
<head profile="http://www.w3.org/2006/03/hcard">
<meta content="text/html; charset=UTF-8" http-equiv=Content-Type>
<title>CSS Pagination Templates Module Level 3</title>
<!--
<link href="http://purl.org/dc/terms/" rel="schema.dcterms">
<link href="http://www.w3.org/Consortium/Legal/ipr-notice#Copyright" rel="dcterms.rights">
-->
<meta content="CSS Pagination Templates Module Level 3" name=dcterms.title>
<meta content=text name=dcterms.type>
<meta content=2014-02-03 name=dcterms.date>
<meta content="Alan Stearns" name=dcterms.creator>
<meta content=W3C name=dcterms.publisher>
<meta content="http://dev.w3.org/csswg/css3-page-template/"
name=dcterms.identifier>
<link href="../shared/style/default.css" rel=stylesheet type="text/css"><!--link rel="stylesheet" type="text/css" href="https://www.w3.org/StyleSheets/TR/W3C-ED.css"-->
<link href="https://www.w3.org/StyleSheets/TR/w3c-unofficial.css"
rel=stylesheet type="text/css">
<style type="text/css">
body {
counter-reset: issue;
}
</style>
<link href="../shared/style/issues.css" rel=stylesheet type="text/css">
<link href="../shared/style/alternate-spec-style.css" id=st rel=stylesheet
title="alternate spec style" type="text/css">
<body>
<div class=head> <!--begin-logo-->
<p><a href="http://www.w3.org/"><img alt=W3C height=48
src="https://www.w3.org/Icons/w3c_home" width=72></a> <!--end-logo-->
<h1>CSS Pagination Templates Module Level 3</h1>
<h2 class="no-num no-toc">Editor's Draft 3 February 2014</h2>
<dl>
<dt>This version:
<!--<dd><a href="http://dev.w3.org/csswg/css3-page-template/">http://dev.w3.org/csswg/css3-page-template/</a>-->
<dd><a
href="//dev.w3.org/csswg/css3-page-template/">http://dev.w3.org/csswg/css3-page-template/</a>
<dt>Latest version:
<!--<dd><a href="http://www.w3.org/TR/css3-page-template/">http://www.w3.org/TR/css3-page-template/</a>-->
<dd><a
href="//www.w3.org/TR/css3-page-template/">http://www.w3.org/TR/css3-page-template/</a>
<dt>Editor's draft:
<dd><a
href="//dev.w3.org/csswg/css3-page-template/">http://dev.w3.org/csswg/css3-page-template/</a>
<!--
<dt>Previous version:
<dd><a href="http://www.w3.org/PreviousVersionURI">
http://www.w3.org/PreviousVersionURI</a>
-->
<dt>Feedback:
<dd><a
href="mailto:www-style@w3.org?subject=%5Bcss-page-template%5D%20feedback">www-style@w3.org</a>
with subject line “<kbd>[css-page-template] <var>… message topic
…</var></kbd>” (<a
href="http://lists.w3.org/Archives/Public/www-style/"
rel=discussion>archives</a>)
<dt>Editors:
<dd class=vcard><span class=fn>Alan Stearns</span>, <span class=org>Adobe
Systems, Inc.</span>, <span class=email>stearns@adobe.com</span>
</dl>
<!--begin-copyright-->
<p class=copyright><a
href="http://www.w3.org/Consortium/Legal/ipr-notice#Copyright"
rel=license>Copyright</a> © 2014 <a href="http://www.w3.org/"><abbr
title="World Wide Web Consortium">W3C</abbr></a><sup>®</sup> (<a
href="http://www.csail.mit.edu/"><abbr
title="Massachusetts Institute of Technology">MIT</abbr></a>, <a
href="http://www.ercim.eu/"><abbr
title="European Research Consortium for Informatics and Mathematics">ERCIM</abbr></a>,
<a href="http://www.keio.ac.jp/">Keio</a>, <a
href="http://ev.buaa.edu.cn/">Beihang</a>), All Rights Reserved. W3C <a
href="http://www.w3.org/Consortium/Legal/ipr-notice#Legal_Disclaimer">liability</a>,
<a
href="http://www.w3.org/Consortium/Legal/ipr-notice#W3C_Trademarks">trademark</a>
and <a
href="http://www.w3.org/Consortium/Legal/copyright-documents">document
use</a> rules apply.</p>
<!--end-copyright-->
<hr title="Separator for header">
</div>
<details class=annoying-warning open=open> <summary>Not Ready For
Implementation</summary>
<p> This spec is not yet ready for implementation. It exists in this
repository to record the ideas and promote discussion.
<p> Before attempting to implement this spec, please contact the CSSWG at
www-style@w3.org.
</details>
<h2 class="no-num no-toc" id=abstract>Abstract</h2>
<p>The Pagination Templates module describes templates that generate boxes
in CSS to display content in a paginated view. These templates define a
page containing one or more boxes with content assignments. As content
overflows additional pages are generated using template selection rules
until all of the content is displayed.
<h2 class="no-num no-toc" id=status>Status of this document</h2>
<!--begin-status-->
<p>This is a public copy of the editors' draft. It is provided for
discussion only and may change at any moment. Its publication here does
not imply endorsement of its contents by W3C. Don't cite this document
other than as work in progress.
<p>The (<a
href="http://lists.w3.org/Archives/Public/www-style/">archived</a>) public
mailing list <a
href="mailto:www-style@w3.org?Subject=%5Bcss3-page-template%5D%20PUT%20SUBJECT%20HERE">
www-style@w3.org</a> (see <a
href="http://www.w3.org/Mail/Request">instructions</a>) is preferred for
discussion of this specification. When sending e-mail, please put the text
“css3-page-template” in the subject, preferably like this:
“[<!---->css3-page-template<!---->] <em>…summary of comment…</em>”
<p>This document was produced by the <a
href="http://www.w3.org/Style/CSS/members">CSS Working Group</a> (part of
the <a href="http://www.w3.org/Style/">Style Activity</a>).
<p>This document was produced by a group operating under the <a
href="http://www.w3.org/Consortium/Patent-Policy-20040205/">5 February
2004 W3C Patent Policy</a>. W3C maintains a <a
href="http://www.w3.org/2004/01/pp-impl/32061/status"
rel=disclosure>public list of any patent disclosures</a> made in
connection with the deliverables of the group; that page also includes
instructions for disclosing a patent. An individual who has actual
knowledge of a patent which the individual believes contains <a
href="http://www.w3.org/Consortium/Patent-Policy-20040205/#def-essential">Essential
Claim(s)</a> must disclose the information in accordance with <a
href="http://www.w3.org/Consortium/Patent-Policy-20040205/#sec-Disclosure">section
6 of the W3C Patent Policy</a>.</p>
<!--end-status-->
<p>The following features are at risk: none
<nav id="toc">
<h2 class="no-num no-toc" id=contents>Table of contents</h2>
<!--begin-toc-->
<ul class=toc>
<li><a href="#intro"><span class=secno>1. </span>Introduction</a>
<ul class=toc>
<li><a href="#placement"><span class=secno>1.1. </span>Module
Interactions</a>
</ul>
<li><a href="#templates-and-slots"><span class=secno>2. </span>Pagination
Templates and Slots</a>
<li><a href="#conditional-templates"><span class=secno>3. </span>Template
Selection</a>
<ul class=toc>
<li><a href="#ordered-templates"><span class=secno>3.1. </span>Selecting
Templates by Page Order</a>
<li><a href="#selection-from-required-flows"><span class=secno>3.2.
</span>Selecting Templates from Required Flows</a>
<li><a href="#selection-from-available-content"><span class=secno>3.3.
</span>Selecting Templates from Available Content</a>
</ul>
<li><a href="#cssom"><span class=secno>4. </span>CSS Object Model</a>
<li><a href="#conformance"><span class=secno>5. </span>Conformance</a>
<li class=no-num><a href="#acknowledgments">Acknowledgments</a>
<li class=no-num><a href="#references">References</a>
<ul class=toc>
<li class=no-num><a href="#normative-references">Normative
references</a>
<li class=no-num><a href="#other-references">Other references</a>
</ul>
<li class=no-num><a href="#index">Index</a>
</ul>
<!--end-toc-->
</nav>
<h2 id=intro><span class=secno>1. </span>Introduction</h2>
<p><em>This section is not normative.</em>
<p>This module describes how to define pagination templates in CSS. In CSS
2.1 content displayed on-screen is assumed to be a single continuous
canvas. Pagination templates provide a mechanism for a ‘<code
class=property>paginated</code>’ experience that applies to on-screen
presentation as well as printed media. Pagination templates define boxes
in CSS where content is displayed as the user moves from page to page on
screen or prints the document. When content is laid out using pagination
templates, pages are generated as needed to accommodate all the content.
<div class="issue-marker wrapper">
<div class=issue-marker>
<div class=issue-details>The draft as it stands requires pagination to
present the repeated template layouts. Other methods of repeating
template layouts to accommodate content might be specified, but the
draft would need to be reviewed to remove all reliances on paged
displays.</div>
</div>
<div class=issue-marker>
<div class=issue-details>The terms ‘<code
class=property>template</code>’ and ‘<code
class=property>page</code>’ are overloaded in CSS, but they are the
words that most clearly describe the concept. Some alternates for the
main @ rule: template, page-template, view-template, page-master,
master-template, master. Other suggestions are welcome, but only if they
are more helpful than onelook.com (which suggested "Captain Submarine").</div>
</div>
<div class=issue-marker>
<div class=issue-details>This specification may be the best place to
define "continued here" or "continued on page x" generated content,
since this spec defines ways to skip pages (that basic pagination may
not).</div>
</div>
</div>
<p>Pagination templates consist of anonymous boxes called slots created by
CSS to contain content. Layouts that use pagination templates mainly
determine the size of these slots from the template definition instead of
the size of their content. When content does not fit into a template slot,
additional pages are created with more slots to contain the overflow
content.
<p>Multiple pagination templates can be defined for a given document. A
paginated element can use a single template or select from a set of
templates each time a new page needs to be generated. Which template is
used for a given page can be defined by a selector or by choosing a
template based on available content. Elements can further constrain the
applicable template set by listing a subset of templates that apply.
<h3 id=placement><span class=secno>1.1. </span>Module Interactions</h3>
<p>This module uses named flows and region chains defined in <a
href="#ref-CSS3-REGIONS">[CSS3-REGIONS]<!--{{CSS3-REGIONS}}--></a>.
<p>This module uses the overflow-style property from <a
href="#ref-CSS3GCPM">[CSS3GCPM]<!--{{CSS3GCPM}}--></a>.
<p>Some examples use positioning from <a
href="#ref-CSS3GRID">[CSS3GRID]<!--{{CSS3GRID}}--></a>.
<h2 id=templates-and-slots><span class=secno>2. </span>Pagination Templates
and Slots</h2>
<p>An @template rule defines and names a pagination template. Pagination
templates contain one or more slots to display content. These slots create
boxes for each page generated from a pagination template. An element can
use pagination templates if its ‘<code
class=property>overflow-style</code>’ property is set to any of the
paged-* values defined in css3-gcpm. If a document defines no pagination
templates, then there is an implicit pagination template with a single
slot containing the paginated element's contents.
<div class=issue-marker>
<div class=issue-details>Instead of a dependency on GCPM, this spec could
define what happens with a paginated view, without specifying how the
paginated view comes into existence. What happens when you apply ‘<code
class=css>overflow-style:paged-x</code>’ to an iframe or region?</div>
</div>
<p>The box created from an @template rule defaults to the size of the
paginated element's box.
<p>A slot is an anonymous box in a pagination template where content can be
placed. In an @template rule @slot rules create slots. The order of @slot
rules determines the order of the boxes in the pagination template. @slot
rules can define a name for the slot.
<p>Slots default to displaying the content of the paginated element. Slots
can instead contain generated content assigned with the content property.
Slots can also be assigned content from named flows.
<div class=example>
<p>An @template rule that creates header and footer slots around the
paginated element's content
<pre>
@template paged-display {
@slot header { content: "header string"; }
@slot content { }
@slot footer { content: "footer string"; }
}
</pre>
</div>
<p>If any slot in a particular page has overflow content, a new page is
created with a new set of slots to receive the overflow content. Slots
with the same named flow assignment form a region chain (within a
pagination template and/or across pages created from pagination
templates). When a new page is created a slot that has been assigned
element content or content from a named flow may not have any content left
to render. In this case the slot for the exhausted content source is not
instantiated.
<div class=issue-marker>
<div class=issue-details>If there is more than one slot with no ‘<code
class=property>content</code>’ or ‘<code
class=property>flow-from</code>’ assignment, does the element's content
use all of these slots like a region chain, or is only the last
unassigned slot used for content?</div>
</div>
<div class=example>
<p>The simplest example takes all of the content in the document and flows
it into a single pagination template with a single slot. This template
will display a viewport's worth of content at a time, and will create a
new slot on a new page each time content overflows.
<p>The three examples below are equivalent, but merely illustrate how
content from the element can be assigned to pagination template slots.
Actual use of templates would either define more slots or assign content
differently than the default.
<pre class=separate-pre>
body { overflow-style: paged-x; }</pre>
<pre class=separate-pre>
body { overflow-style: paged-x; }
@template paged-display {
@slot content { }
}</pre>
<pre class=separate-pre>
body { overflow-style: paged-x; }
body > * { flow-into: body-flow; }
@template paged-display {
@slot content { flow-from: body-flow; }
}</pre>
</div>
<div class=issue-marker>
<div class=issue-details>
<p>@slot rules are a first pass at defining CSS-created boxes. Other
means of creating and addressing pseudo-element slots have been
discussed on www-style. If @slot rules or pseudo-elements are used to
create template boxes, then OM for pseudo-elements must be defined
(scripting and events working with paginated content is a valid use
case).
<p>One argument against using pseudo-elements to create templates is that
this is defining structure in CSS. If nested slots are required, then
we're on a slippery slope towards re-inventing HTML inside of CSS.
<p>An alternative could use Shadow DOM to define the boxes. This gives us
structure and OM, but would need a declarative method of mapping content
to elements. One suggestion was to use @slot rules in a flat list for
the simple case, but start to rely on Shadow DOM for more complicated
cases. If this route is taken, then @slot rules probably aren't
required, as Shadow DOM can also handle the flat list case.
</div>
</div>
<p>Pagination templates can use declarations to determine the layout method
for slots. @slot rules can use sizing and positioning declarations.
<div class=example>
<p>A pagination template could contain two side-by-side slots that
paginate two separate articles. Side-by-side translations are often laid
out this way. This example fills the left side of the paged view with
content from an English article and the right side with content from a
French article. New pages and slots are created until the content from
both articles is exhausted. If one article is longer than the other then
in this simple example template the longer article will continue taking
up just its half of the page.
<p> <img alt="side-by-side flows on a page"
src="images/side-by-side-1.png" width=120> <span
style="font-size:50px">…</span> <img
alt="side-by-side flows with the left ending"
src="images/side-by-side-2.png" width=120> <img alt="only the right flow"
src="images/only-one-side-3.png" width=120> <span
style="font-size:50px">…</span>
<pre>
body { overflow-style: paged-x; }
.english { flow-into: english-flow; }
.french { flow-into: french-flow; }
@template side-by-side {
@slot left {
flow-from: english-flow;
width: 40%;
height: 90%;
padding: 5%;
float: left;
}
@slot right {
flow-from: french-flow;
width: 40%;
height: 90%;
padding: 5%
float: right;
}
}
<body>
<article class='english'>...content...</article>
<article class='french'>...contenu...</article>
</body>
</pre>
</div>
<div class=example>
<p>The example above could position the slots using grid layout rather
than floats. In this simple example the longer article will take up the
entire page once the shorter article is exhausted.
<p> <img alt="side-by-side flows on a page"
src="images/side-by-side-1.png" width=120> <span
style="font-size:50px">…</span> <img
alt="side-by-side flows with the left ending"
src="images/side-by-side-2.png" width=120> <img
alt="the right flow takes up the whole page" src="images/whole-page.png"
width=120> <span style="font-size:50px">…</span>
<pre>
body { overflow-style: paged-x; }
.english { flow-into: english-flow; }
.french { flow-into: french-flow; }
@template side-by-side {
display: grid;
grid-columns: 1fr 1fr;
@slot left {
flow-from: english-flow;
padding: 5%;
grid-column: 1;
}
@slot right {
flow-from: french-flow;
padding: 5%
grid-column: 2;
}
}
<body>
<article class='english'>...content...</article>
<article class='french'>...contenu...</article>
</body>
</pre>
</div>
<h2 id=conditional-templates><span class=secno>3. </span>Template Selection</h2>
<p>Multiple templates can be defined for a single document. An element that
uses pagination templates either selects a template from the entire
document set or a subset defined by the ‘<code
class=property>template-set</code>’ property. Each page view created
uses a single template. This template can be chosen from the applicable
set using a selector, by matching content to display using the ‘<code
class=property>required-flow</code>’ or ‘<code
class=property>available-content</code>’ declarations, or just taking
the last template found.
<div class=issue-marker>
<div class=issue-details>The following section describes selecting
templates with several mechanisms (selectors and declarations, and
presumably @template rules could be scoped by media queries). An
alternative could be to define all selection mechanisms like a media
query, where all of the selection mechanisms are outside the declaration
block. Attempting to define template rejection rather than selection
might also prove fruitful.</div>
</div>
<div class=example>
<p>In this example the divs are paginated using the last template found
from the set of templates that apply to the div. The first div uses
template three, the second div uses template two, and the third div uses
template one.
<pre>
div { overflow-style: paged-x; }
.either-one-or-two { template-set: one two; }
.only-one { template-set: one; }
@template one { ... }
@template two { ... }
@template three { ... }
<div class='any-template'> ... </div>
<div class='either-one-or-two'> ... </div>
<div class='only-one'> ... </div>
</pre>
</div>
<h3 id=ordered-templates><span class=secno>3.1. </span>Selecting Templates
by Page Order</h3>
<p>Selectors such as :first can be used on a pagination template to define
a separate template for pages that match the selector.
<div class="issue-marker wrapper">
<div class=issue-marker>
<div class=issue-details>Should :left and :right be allowed with a way of
displaying more than one page at a time in a viewport? Should :nth(x)
selectors be allowed?</div>
</div>
<div class=issue-marker>
<div class=issue-details>Describe how @template rules cascade with names
and selectors (or how they do not cascade, if that's preferable).</div>
</div>
</div>
<div class=example>
<p>Any of the side-by-side two-article examples from the previous section
could have an @template :first {} rule that defined a fancy layout for
the first page.
<pre>
@template side-by-side:first {
@slot left {
//fancy styling
flow-from: article1;
}
@slot right {
//fancy styling
flow-from: article2;
}
}
</pre>
</div>
<div class="issue-marker wrapper">
<div class=issue-marker>
<div class=issue-details>define "fancy."</div>
</div>
<div class=issue-marker>
<div class=issue-details>Depending on how template selection is defined,
there will likely be scenarios where degenerate template sets can either
fail to display all of the content or result in an infinite loop of page
generation. This first draft falls into the latter category (make a
:first template with a slot that overflows, but fail to include an
assignment for that slot's content in all other templates), so this will
need to be addressed with more selection rules.</div>
</div>
</div>
<h3 id=selection-from-required-flows><span class=secno>3.2.
</span>Selecting Templates from Required Flows</h3>
<p>The ‘<code class=property>required-flow</code>’ property can be used
in a pagination template to list named flows that must still have content
in order for the template to be used. If more than one template has a
‘<code class=property>required-flow</code>’ value that matches the
remaining flow content, the last template that matches will be used.
<div class=example>
<p>"Continued on" layout.
<p>These pagination templates will display an initial page with the
beginning of both the ‘<code class=property>lead-story</code>’ flow
and a ‘<code class=property>related-article</code>’ flow. If the lead
story has more content than will fit on that first page, the next page(s)
will show only content from that lead story. When the content from the
lead story is exhausted, then pages will follow with content from the
related article.
<p> <img alt="side-by-side flows on a page"
src="images/side-by-side-1.png" width=120> <img
alt="columns continuing just the first flow"
src="images/first-article-columns.png" width=120> <span
style="font-size:50px">…</span> <img
alt="columns ending the first flow" src="images/first-article-end.png"
width=120> <img alt="columns continuing the second flow"
src="images/second-article-columns.png" width=120> <span
style="font-size:50px">…</span>
<pre>
body { overflow-style: paged-x; }
.lead-story { flow-into: lead-flow; }
.related-article { flow-into: related-flow; }
@template related {
required-flow: related-flow;
@slot content {
flow-from: related-flow;
column-width: 20em;
}
}
@template lead {
required-flow: lead-flow;
@slot content {
flow-from: lead-flow;
column-width: 20em;
}
}
@template continued-on:first {
@slot lead {
flow-from: lead-flow;
width: 40%;
height: 90%;
padding: 5%;
float: left;
}
@slot related {
flow-from: related-flow;
width: 40%;
height: 90%;
padding: 5%
float: left;
}
}
<body>
<article class='lead-story'>...content...</article>
<article class='related-article'>...content...</article>
</body>
</pre>
</div>
<h3 id=selection-from-available-content><span class=secno>3.3.
</span>Selecting Templates from Available Content</h3>
<p>Pagination templates can be selected based on the order of content in
the DOM tree. Content may be split out into one or more named flows, but
the original order can be discovered in the DOM and used for template
selection.
<p>Pagination templates have a ‘<code class=property>primary</code>’
content flow. The primary flow for a pagination template is usually the
content of the paginated element. If no slot in the template displays the
element contents, then the primary flow of the pagination template is the
first named flow in its required-flow declaration.
<p>When selecting the pagination template for the next page, the primary
flow in the original markup can be scanned to determine whether any
out-of-flow content in other named flows was originally related to the
next page of primary flow. If this is the case, then those named flows
have ‘<code class=property>available</code>’ content for the purpose
of selecting an appropriate template that can display this content.
<p>Pagination templates can have an ‘<code
class=property>available-content</code>’ declaration listing the named
flows that must have available content for the template to be selected.
Templates with more ‘<code class=property>available-content</code>’
flow matches take precedence over fewer or no ‘<code
class=property>available-content</code>’ flow matches. If a template
with an ‘<code class=property>available-content</code>’ declaration is
chosen, only the available content in those flows is displayed in the
slots associated with those flows.
<div class=example>
<p>Clarification example (not meant to be a valid use case)
<p>Consider an article element that contains images scattered throughout.
Assign the images to a flow named ‘<code
class=property>images</code>’ and the rest of the article to a flow
named ‘<code class=property>text</code>’. Then define two pagination
templates - one that has slots only for the ‘<code
class=property>text</code>’ flow, and another that has slots for both
the ‘<code class=property>text</code>’ and ‘<code
class=property>images</code>’ flows. Both templates require the
‘<code class=property>text</code>’ flow, but the second template also
requires the ‘<code class=property>images</code>’ flow and has an
‘<code class=property>available-content</code>’ declaration listing
the ‘<code class=property>images</code>’ flow. Each time a page is
laid out, the original article element is scanned to see whether an image
element is in the next page's worth of content (determined by some
DOM-tree-scanning heuristic – not layout). If so, then that content
from the ‘<code class=property>images</code>’ flow is available for
the purpose of selecting a template.
</div>
<div class=example>
<p>Motivational example (meant as a use case)
<p>Assume you have an article that contains both pull quotes and images.
If only images <em>or</em> pull quotes would occur on a page, position
those elements in the center right of the template. But if both images
<em>and</em> pull quotes would appear, position the images in the top
left and the pull quotes in the bottom right.
<div class=issue-marker>
<div class=issue-details>code this example</div>
</div>
</div>
<h2 id=cssom><span class=secno>4. </span>CSS Object Model</h2>
<div class=issue-marker>
<div class=issue-details>There should be extensive OM defined to access
pages and slots. What page is being displayed should be available. Pages
and slots should accept event handlers. Anchors should navigate to the
appropriate page (as should search). What content fits in each slot and
page should be determinable. Lots to fill out here.</div>
</div>
<div class=example>
<p>Motivational example
<p>Given the side-by-side paginated template for French and English, allow
the user to click and drag the French text from the right to the left to
switch sides for both flows.
</div>
<h2 id=conformance><span class=secno>5. </span>Conformance</h2>
<h2 class=no-num id=acknowledgments>Acknowledgments</h2>
<p>The editor is grateful to the CSS working group for their feedback and
help with the genesis of this specification.
<p>In addition, the editor would like to thank the following individuals
for their contributions, either during the conception of CSS Pagination
Templates or during its development and specification review process:
<ul>
<li>Rossen Atanassov
<li>Tab Atkins
<li>Razvan Caliman
<li>Alexandru Chiculita
<li>Sylvain Galineau
<li>Vincent Hardy
<li>David Hyatt
<li>Brad Kemper
<li>Håkon Wium Lie
<li>Alex Mogilevsky
<li>Christoph Päper
<li>Peter Sorotokin
<li>Stephen Zilles
</ul>
<h2 class=no-num id=references>References</h2>
<h3 class=no-num id=normative-references>Normative references</h3>
<!--begin-normative-->
<!-- Sorted by label -->
<dl class=bibliography><!---->
</dl>
<!--end-normative-->
<h3 class=no-num id=other-references>Other references</h3>
<!--begin-informative-->
<!-- Sorted by label -->
<dl class=bibliography><!---->
<dt id=CSS3-REGIONS>[CSS3-REGIONS]
<dd>Vincent Hardy; Rossen Atanassov; Alan Stearns. <a
href="http://www.w3.org/TR/2013/WD-css3-regions-20130528/"><cite>CSS
Regions Module Level 1.</cite></a> 28 May 2013. W3C Working Draft. (Work
in progress.) URL: <a
href="http://www.w3.org/TR/2013/WD-css3-regions-20130528/">http://www.w3.org/TR/2013/WD-css3-regions-20130528/</a>
</dd>
<!---->
<dt id=CSS3GCPM>[CSS3GCPM]
<dd>Håkon Wium Lie. <a
href="http://www.w3.org/TR/2011/WD-css3-gcpm-20111129/"><cite>CSS
Generated Content for Paged Media Module.</cite></a> 29 November 2011.
W3C Working Draft. (Work in progress.) URL: <a
href="http://www.w3.org/TR/2011/WD-css3-gcpm-20111129/">http://www.w3.org/TR/2011/WD-css3-gcpm-20111129/</a>
</dd>
<!---->
<dt id=CSS3GRID>[CSS3GRID]
<dd>Alex Mogilevsky; Markus Mielke. <a
href="http://www.w3.org/TR/2007/WD-css3-grid-20070905"><cite>CSS Grid
Positioning Module Level 3.</cite></a> 5 September 2007. W3C Working
Draft. (Work in progress.) URL: <a
href="http://www.w3.org/TR/2007/WD-css3-grid-20070905">http://www.w3.org/TR/2007/WD-css3-grid-20070905</a>
</dd>
<!---->
</dl>
<!--end-informative-->
<h2 class=no-num id=index>Index</h2>
<!--begin-index-->
<ul class=indexlist></ul>
<!--end-index-->
<!-- template markup for issues pulled from Bugzilla -->
<!--
<script type="text/template" id="issue-template">
<div class="issue-marker" style="display:none" data-bug_id="{{bug_id}}" data-bug_status="{{bug_status}}">
<a href="https://www.w3.org/Bugs/Public/show_bug.cgi?id={{bug_id}}">Bug-{{bug_id}}</a>
<div class="issue-details">
<p class="short-desc">{{short_desc}}</p>
</div>
</div>
</script>
<script type="text/javascript" src="../shared/scripts/BugzillaTrackerUtil.js"></script>
<script type="text/javascript" src="../shared/scripts/BugzillaTracker.js"></script>
<script type="text/javascript">
checkSpecificationIssues('CSS', 'Page Template');
</script>
<div id="issue-manager">
<h2>Issue manager</h2>
<form action="#">
<label>
<input type="radio" name="issue-filter" value="all" checked/>
All issues
</label>
<label>
<input type="radio" name="issue-filter" value="updated" />
Updated issues
</label>
<label>
<input type="radio" name="issue-filter" value="new" />
New issues
</label>
</form>
-->
<!-- all the bugs are dumped the #issue-list after being retrieved and matched to the ones in the page -->
<!--
<div id="issue-list">
</div>
</div>
-->
<!-- Keep this comment at the end of the file
Local variables:
mode: sgml
sgml-declaration:"~/SGML/HTML4.decl"
sgml-default-doctype-name:"html"
sgml-minimize-attributes:t
sgml-nofill-elements:("pre" "style" "br")
sgml-live-element-indicator:t
sgml-omittag:nil
sgml-shorttag:nil
sgml-namecase-general:t
sgml-general-insert-case:lower
sgml-always-quote-attributes:t
sgml-indent-step:nil
sgml-indent-data:t
sgml-parent-document:nil
sgml-exposed-tags:nil
sgml-local-catalogs:nil
sgml-local-ecat-files:nil
End:
-->