-
Notifications
You must be signed in to change notification settings - Fork 791
Expand file tree
/
Copy pathOverview.src.html
More file actions
1045 lines (913 loc) · 34.5 KB
/
Overview.src.html
File metadata and controls
1045 lines (913 loc) · 34.5 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
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
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>CSS Overflow Module Level 3</title>
<link rel=contents href="#contents">
<link rel=index href="#index">
<link rel="stylesheet" type="text/css" href="../default.css">
<link rel="stylesheet" type="text/css"
href="http://www.w3.org/StyleSheets/TR/W3C-[STATUS].css">
<style>
table.source-demo-pair {
width: 100%;
}
.in-cards-demo {
width: 13em;
height: 8em;
padding: 4px;
border: medium solid blue;
margin: 6px;
font: medium/1.3 Times New Roman, Times, serif;
white-space: nowrap;
}
.bouncy-columns-demo {
width: 6em;
height: 10em;
float: left;
margin: 1em;
font: medium/1.25 Times New Roman, Times, serif;
white-space: nowrap;
}
.bouncy-columns-demo.one {
background: aqua; color: black;
transform: rotate(-3deg);
}
.bouncy-columns-demo.two {
background: yellow; color: black;
transform: rotate(3deg);
}
.article-font-inherit-demo {
font: 1em/1.25 Times New Roman, Times, serif;
white-space: nowrap;
}
.article-font-inherit-demo.one {
width: 12em;
font-size: 1.5em;
margin-bottom: 1em;
height: 4em;
}
.article-font-inherit-demo.two {
width: 11em;
margin-left: 5em;
margin-right: 2em;
}
.dark-columns-demo {
width: 6em;
height: 10em;
float: left;
margin-right: 1em;
font: medium/1.25 Times New Roman, Times, serif;
white-space: nowrap;
}
.dark-columns-demo.one {
background: aqua; color: black;
}
.dark-columns-demo.one :link {
color: blue;
}
.dark-columns-demo.one :visited {
color: purple;
}
.dark-columns-demo.two {
background: navy; color: white;
}
.dark-columns-demo.two :link {
color: aqua;
}
.dark-columns-demo.two :visited {
color: fuchsia;
}
.article-max-lines-demo {
font: 1em/1.25 Times New Roman, Times, serif;
white-space: nowrap;
}
.article-max-lines-demo.one::first-letter {
font-size: 2em;
line-height: 0.9;
}
.article-max-lines-demo.one {
font-size: 1.5em;
width: 16em;
}
.article-max-lines-demo.two {
width: 11.5em;
float: left; margin-right: 1em;
}
.article-max-lines-demo.three {
width: 11.5em;
float: left;
}
</style>
</head>
<div class="head">
<!--logo-->
<h1>CSS Overflow Module Level 3</h1>
<h2 class="no-num no-toc">[LONGSTATUS] [DATE]</h2>
<dl>
<dt>This version:
<dd><a href="[VERSION]">http://www.w3.org/TR/[YEAR]/ED-css3-overflow-[CDATE]/</a>
<dt>Latest version:
<dd><a href="http://www.w3.org/TR/[SHORTNAME]/">http://www.w3.org/TR/[SHORTNAME]/</a>
<dt>Editor's draft:
<dd><a href="http://dev.w3.org/csswg/[SHORTNAME]/">http://dev.w3.org/csswg/[SHORTNAME]/</a>
<!--
<dt>Previous version:
<dd><a href="http://www.w3.org/PreviousVersionURI">
http://www.w3.org/PreviousVersionURI</a>
-->
<dt>Issue Tracking:</dt>
<dd>Maintained in document (only editor's draft is current)
<dt>Feedback:</dt>
<dd><a href="http://lists.w3.org/Archives/Public/www-style/">www-style@w3.org</a> with subject line “<kbd>[[SHORTNAME]] <var>… message topic …</var></kbd>”
<dt>Editors:
<dd class="h-card vcard">
<a class="p-name fn u-url url" rel="author"
href="http://dbaron.org/">L. David Baron</a>,
<a class="p-org org" href="http://www.mozilla.org/">Mozilla</a>
</dl>
<!--copyright-->
<hr title="Separator for header">
</div>
<h2 class="no-num no-toc" id="abstract">Abstract</h2>
<p>
<a href="http://www.w3.org/TR/CSS/">CSS</a> is
a language for describing
the rendering of structured documents (such as HTML and XML)
on screen, on paper, in speech, etc.
This module contains the features of CSS
relating to new mechanisms of overflow handling in visual media (e.g., screen or paper).
In interactive media,
it describes features that allow the overflow
from a fixed size container
to be handled by pagination (displaying one page at a time).
It also describes features, applying to all visual media,
that allow the contents of an element
to be spread across multiple fragments,
allowing the contents to flow across multiple regions
or to have different styles for different fragments.
</p>
<h2 class="no-num no-toc" id="status">Status of this document</h2>
<!--status-->
<p>The following features are at risk: …
<h2 class="no-num no-toc" id="contents">
Table of contents</h2>
<!--toc-->
<h2 id="intro">
Introduction</h2>
<p>
In CSS Level 1 [[CSS1]], placing more content than would fit
inside an element with a specified size
was generally an authoring error.
Doing so caused the content to extend
outside the bounds of the element,
which would likely cause
that content to overlap with other elements.
</p>
<p>
CSS Level 2 [[CSS21]] introduced the 'overflow' property,
which allows authors to have overflow be handled by scrolling,
which means it is no longer an authoring error.
It also allows authors to specify
that overflow is handled by clipping,
which makes sense when the author's intent
is that the content not be shown.
</p>
<p>
However, scrolling is not the only way
to present large amounts of content,
and may even not be the optimal way.
After all, the codex replaced the scroll
as the common format for large written works
because of its advantages.
</p>
<p>
This specification introduces
a mechanism for Web pages to specify
that an element of a page should handle overflow
through pagination rather than through scrolling.
</p>
<p>
This specification also extends the concept of overflow
in another direction.
Instead of requiring that authors specify a single area
into which the content of an element must flow,
this specification allows authors to specify multiple fragments,
each with their own dimensions and styles,
so that the content of the element can flow from one to the next,
using as many as needed to place the content without overflowing.
</p>
<p>
In both of these cases, implementations must
break the content in the block-progression dimension.
Implementations must do this is described
in the CSS Fragmentation Module [[!CSS3-BREAK]].
</p>
<h2 id="scrolling-overflow">Scrolling and hidden overflow</h2>
<p class="issue">
Move material from [[CSS21]] and [[CSS3BOX]] here.
</p>
<h2 id="paginated-overflow">Paginated overflow</h2>
<p class="issue">overflow:paginate or overflow:pages (or paged-x, paged-y, paged-x-controls, paged-y-controls as [[CSS3GCPM]] has?)</p>
<p class="issue">Ability to display N pages at once
rather than just one page at once?</p>
<p class="issue">
The current implementation of paginated overflow uses
the 'overflow'/'overflow-x'/'overflow-y' properties
rather than the 'overflow-style' property as proposed
in the [[CSS3GCPM]] draft
(which also matches the [[CSS3-MARQUEE]] proposal).
We should probably switch away from 'overflow-style',
but that's not 100% clear.
</p>
<h2 id="fragment-overflow">Fragment overflow</h2>
<p>
This section introduces and defines the meaning of
the new ''fragments'' value of the 'overflow' property.
</p>
<p>
When the computed value of 'overflow' for an element is ''fragments'',
and implementations would otherwise have created a box for the element,
then implementations must create a sequence of <dfn>fragment box</dfn>es
for that element.
(It is possible for an element with ''overflow: fragments''
to generate only one <i>fragment box</i>.
However, if an element's computed 'overflow' is not ''fragments'',
then its box is not a <i>fragment box</i>.)
Every <i>fragment box</i> is a fragmentation container,
and any overflow
that would cause that fragmentation container to fragment
causes another <i>fragment box</i> created as a next sibling
of the previous one.
<span class="issue">Or is it as though it's a next sibling of
the element? Need to figure out exactly how this interacts with
other box-level fixup.</span>
Additionally, if the <i>fragment box</i> is also
a multi-column box (as defined in [[!CSS3COL]]
<span class="issue">though it defines <i>multi-column element</i></span>)
any content that would lead to the creation of <i>overflow columns</i> [[!CSS3COL]]
instead is flown into an additional fragment box.
However, fragment boxes may themselves be broken
(due to fragmentation in a fragmentation context outside of them,
such as pages, columns, or other fragment boxes);
such breaking leads to fragments of the same fragment box
rather than multiple fragment boxes.
(This matters because fragment boxes may be styled by their index;
such breaking leads to multiple fragments of a fragment box
with a single index.
This design choice is so that
breaking a fragment box across pages does not break
the association of indices to particular pieces of content.)
<span class="issue">Should a forced break that breaks to
an outer fragmentation context cause a new fragment of a single
fragment box or a new fragment box?</span>
<span class="issue">Should we find a term other than
<i>fragment box</i> here to make this a little less confusing?</span>
</p>
<p class="issue">
What if we want to be able to style the pieces of an element
split within another type of fragmentation context?
These rules prevent ever using ''::nth-fragment()'' for that,
despite that the name seems the most logical name for such a feature.
</p>
<div class="example">
<table class="source-demo-pair"><tr><td><pre><!DOCTYPE HTML>
<title>Breaking content into
equal-sized cards</title>
<style>
.in-cards {
overflow: fragments;
width: 13em;
height: 8em;
padding: 4px;
border: medium solid blue;
margin: 6px;
font: medium/1.3 Times New
Roman, Times, serif;
}
</style>
<div class="in-cards">
In this example, the text in the div
is broken into a series of cards.
These cards all have the same style.
The presence of enough content to
overflow one of the cards causes
another one to be created. The second
card is created just like it's the
next sibling of the first.
</div></pre></td><td>
<div class="in-cards-demo">In this example, the text in the<br>div is broken into a series of<br>cards. These cards all have the<br>same style. The presence of<br>enough content to overflow<br>one of the cards causes another</div>
<div class="in-cards-demo">one to be created. The second<br>card is created just like it's the<br>next sibling of the first.</div>
</td></tr></table>
</div>
<p class="issue">
We should specify that ''overflow: fragments'' does not apply
to at least some table parts,
and perhaps other elements as well.
We need to determine exactly which ones.
</p>
<p class="issue">
This specification needs to say which type of
fragmentation context is created
so that it's clear which values of the 'break' property
cause breaks within this context.
We probably want ''break: regions'' to apply.
</p>
<p class="issue">
This specification needs a processing model
that will apply in cases where the layout containing the
fragments has characteristics that use the intrinsic size of the fragments
to change the amount of space available for them,
such as [[CSS3-GRID-LAYOUT]].
There has already been some work on such a processing model
in [[CSS3-REGIONS]],
and the work done on a model there,
and the editors of that specification,
should inform what happens in this specification.
</p>
<h3 id="fragment-styling">Fragment styling</h3>
<h4 id="fragment-pseudo-element">The ::nth-fragment() pseudo-element</h4>
<p>
The ::nth-fragment() pseudo-element is a pseudo-element
that describes some of the <i>fragment box</i>es generated by an element.
The argument to the pseudo-element takes the same syntax
as the argument to the :nth-child() pseudo-class
defined in [[!SELECT]], and has the same meaning
except that the number is relative to
<i>fragment box</i>es generated by the element
instead of siblings of the element.
</p>
<p class="note">
Selectors that allow addressing fragments
by counting from the end rather than the start
are intentionally not provided.
Such selectors would interfere with determining
the number of fragments.
</p>
<p class="issue">
Depending on future discussions,
this ''::nth-fragment(<var>an+b</var>)'' syntax
may be replaced with
the new ''::fragment:nth(<var>an+b</var>)'' syntax.
</p>
<h4 id="style-of-fragments">Styling of fragments</h4>
<p class="issue">
Should this apply to fragment overflow only,
or also to paginated overflow?
(If it applies,
then stricter property restrictions would be needed
for paginated overflow.)
</p>
<p>
In the absence of rules with ''::nth-fragment()'' pseudo-elements,
the computed style for each <i>fragment box</i>
is the computed style for the element
for which the <i>fragment box</i> was created.
However, the style for a <i>fragment box</i> is also influenced
by rules whose selector's <i>subject</i> [[!SELECT]]
has an ''::nth-fragment()'' pseudo-element,
if the 1-based number of the <i>fragment box</i> matches
that ''::nth-fragment()'' pseudo-element
and the selector (excluding the ''::nth-fragment()'' pseudo-element)
matches the element generating the fragments.
</p>
<p>
When determining the style of the <i>fragment box</i>,
these rules that match the fragment pseudo-element
cascade together with the rules that match the element,
with the fragment pseudo-element adding the specificity
of a pseudo-class to the specificity calculation.
<span class="issue">Does this need to be specified in
the cascading module as well?</span>
</p>
<div class="example">
<table class="source-demo-pair"><tr><td><pre><!DOCTYPE HTML>
<style>
.bouncy-columns {
overflow: fragments;
width: 6em;
height: 10em;
float: left;
margin: 1em;
font: medium/1.25 Times New
Roman, Times, serif;
}
.bouncy-columns::nth-fragment(1) {
background: aqua; color: black;
transform: rotate(-3deg);
}
.bouncy-columns::nth-fragment(2) {
background: yellow; color: black;
transform: rotate(3deg);
}
</style>
<div class="bouncy-columns">
<i>...</i>
</div></pre></td><td>
<div class="bouncy-columns-demo one">In this<br>example, the<br>text in the div<br>is broken into<br>a series of<br>columns. The<br>author<br>probably</div>
<div class="bouncy-columns-demo two">intended the<br>text to fill two<br>columns. But<br>if it happens to<br>fill three<br>columns, the<br>third column is<br>still created. It</div>
<div class="bouncy-columns-demo">just doesn't<br>have any<br>fragment-specific<br>styling because<br>the author<br>didn't give it<br>any.</div>
</td></tr></table>
</div>
<p>
Styling an ''::nth-fragment()'' pseudo-element with the 'overflow'
property does take effect;
if a <i>fragment box</i> has a
computed value of 'overflow' other than ''fragments''
then that fragment box is the last fragment.
However, overriding ''overflow'' on the first fragment
does not cause the <i>fragment box</i> not to exist;
whether there are fragment boxes at all is determined by
the computed value of overflow for the element.
</p>
<p>
Styling an ''::nth-fragment()'' pseudo-element with the 'content'
property has no effect;
the computed value of 'content' for the fragment box
remains the same as the computed value of content for the element.
</p>
<p>
Specifying ''display: none'' for a <i>fragment box</i> causes
the fragment box with that index not to be generated.
However, in terms of the indices
used for matching ''::nth-fragment()'' pseudo-elements
of later fragment boxes,
it still counts as though it was generated.
However, since it is not generated, it does not contain any content.
</p>
<p class="issue">
Would it make more sense to forbid ''display:none''?
Or perhaps to forbid 'display', 'position', 'float',
and similar (in addition to 'overflow')?
</p>
<p>
To match the model for other pseudo-elements
where the pseudo-elements live inside their corresponding element,
declarations in ''::nth-fragment()'' pseudo-elements override
declarations in rules without the pseudo-element.
The relative priority within such declarations is determined
by normal cascading order (see [[!CSS21]]).
</p>
<p>
Styles specified on ''::nth-fragment()'' pseudo-elements
do affect inheritance to content within the <i>fragment box</i>.
In other words, the content within the <i>fragment box</i> must
inherit from the fragment box's style (i.e., the pseudo-element style)
rather than directly from the element.
This means that elements split between fragment boxes may
have different styles for different parts of the element.
</p>
<p class="issue">
This inheritance rule allows specifying styles indirectly
(by using explicit ''inherit'' or using default inheritance
on properties that don't apply to '':first-letter'')
that can't be specified directly
(based on the rules in the next section).
This is a problem.
The restrictions that apply to styling inside fragments
should also apply to inheritance from fragments.
</p>
<div class="example">
<table class="source-demo-pair"><tr><td><pre><!DOCTYPE HTML>
<style>
.article {
overflow: fragments;
}
.article::nth-fragment(1) {
font-size: 1.5em;
margin-bottom: 1em;
height: 4em;
}
.article::nth-fragment(2) {
margin-left: 5em;
margin-right: 2em;
}
</style>
<div class="article">
The <code>font-size</code> property<i>...</i>
</div></pre></td><td>
<div class="article-font-inherit-demo one">The <code>font-size</code> property<br>specified on the fragment<br>is inherited into the</div>
<div class="article-font-inherit-demo two">descendants of the fragment.<br>This means that inherited<br>properties can be used<br>reliably on a fragment, as in<br>this example.</div>
</td></tr></table>
</div>
<h4 id="style-in-fragments">Styling inside fragments</h4>
<p class="issue">
Should this apply to fragment overflow only,
or also to paginated overflow,
or even to pagination across pages?
</p>
<p>
The ''::nth-fragment()'' pseudo-element
can also be used to style
content inside of a <i>fragment box</i>.
Unlike the ''::first-line'' and ''::first-letter'' pseudo-elements,
the ''::nth-fragment()'' pseudo-element can be applied
to parts of the selector other than the subject:
in particular, it can match ancestors of the subject.
However, the only CSS properties applied
by rules with such selectors
are those that apply
to the ''::first-letter'' pseudo-element.
</p>
<p>
To be more precise,
when a rule's selector has ''::nth-fragment()'' pseudo-elements
attached to parts of the selector other than the subject,
the declarations in that rule apply to
a fragment (or pseudo-element thereof) when:
</p>
<ol>
<li>
the declarations are for properties that apply to the
''::first-letter'' pseudo-element,
</li>
<li>
the declarations would apply to
that fragment (or pseudo-element thereof)
had those ''::nth-fragment()'' pseudo-elements been removed,
with a particular association between
each sequence of simple selectors and the element it matched,
and
</li>
<li>
for each removed ''::nth-fragment()'' pseudo-element,
the fragment lives within a <i>fragment box</i>
of the element associated in that association
with the selector that the pseudo-element was attached to,
and whose index matches the pseudo-element.
</li>
</ol>
<div class="example">
<table class="source-demo-pair"><tr><td><pre><!DOCTYPE HTML>
<style>
.dark-columns {
overflow: fragments;
width: 6em;
height: 10em;
float: left;
margin-right: 1em;
font: medium/1.25 Times New
Roman, Times, serif;
}
.dark-columns::nth-fragment(1) {
background: aqua; color: black;
}
.dark-columns::nth-fragment(1) :link {
color: blue;
}
.dark-columns::nth-fragment(1) :visited {
color: purple;
}
.dark-columns::nth-fragment(2) {
background: navy; color: white;
}
.dark-columns::nth-fragment(2) :link {
color: aqua;
}
.dark-columns::nth-fragment(2) :visited {
color: fuchsia;
}
</style>
<div class="dark-columns">
<i>...</i>
</div></pre></td><td>
<div class="dark-columns-demo one">In this<br><a href="http://en.wiktionary.org/wiki/example">example</a>, the<br>text flows<br>from one<br>light-colored<br>fragment into<br>another<br>dark-colored</div>
<div class="dark-columns-demo two">fragment. We<br>therefore want<br>different styles<br>for <a href="http://www.w3.org/Provider/Style/IntoContext.html">hyperlinks</a><br>in the different<br>fragments.</div>
</td></tr></table>
</div>
<h3 id="max-lines">The 'max-lines' property</h3>
<p>
Authors may wish to style the opening lines of an element
with different styles
by putting those opening lines in a separate fragment.
However, since it may be difficult to predict the exact height
occupied by those lines
in order to restrict the first fragment to that height,
this specification introduces a 'max-lines' property
that forces a fragment to break
after a specified number of lines.
This forces a break after the given number of lines
contained within the element or its descendants,
as long as those lines are in the same block formatting context.
</p>
<table class=propdef>
<tr>
<th>Name:
<td><dfn>max-lines</dfn>
<tr>
<th><a href="#values">Value</a>:
<td>none | <integer>
<tr>
<th>Initial:
<td>none
<tr>
<th>Applies to:
<td>fragment boxes
<tr>
<th>Inherited:
<td>no
<tr>
<th>Animatable:
<td>as <a href="http://www.w3.org/TR/css3-transitions/#animatable-types">integer</a>
<tr>
<th>Percentages:
<td>N/A
<tr>
<th>Media:
<td>visual
<tr>
<th>Computed value:
<td>specified value
<tr>
<th>Canonical order:
<td><abbr title="follows order of property value definition">per grammar</abbr>
</table>
<dl>
<dt>none
<dd>
<p>
Breaks occur only as specified elsewhere.
</p>
</dd>
<dt><integer>
<dd>
<p>
In addition to any breaks specified elsewhere,
a break is forced before any line that would exceed
the given number of lines
being placed inside the element
(excluding lines that are in
a different block formatting context from
the block formatting context to which
an unstyled child of the element would belong).
</p>
<p class="issue">
If there are multiple boundaries between this line
and the previous, where exactly (in terms of element
boundaries) is the break forced?
</p>
<p>
Only positive integers are accepted.
Zero or negative integers are a parse error.
</p>
</dd>
</dl>
<p class="issue">Should this apply to fragment overflow only, or also
to pagination?</p>
<div class="example">
<table class="source-demo-pair"><tr><td><pre><!DOCTYPE HTML>
<style>
.article {
overflow: fragments;
}
.article::first-letter {
font-size: 2em;
line-height: 0.9;
}
.article::nth-fragment(1) {
font-size: 1.5em;
max-lines: 3;
}
.article::nth-fragment(2) {
column-count: 2;
}
</style>
<div class="article">
<i>...</i>
</div></pre></td><td>
<div class="article-max-lines-demo one">The max-lines property allows<br>authors to use a larger font for the first<br>few lines of an article. Without the</div>
<div class="article-max-lines-demo two">max-lines property, authors<br>might have to use the<br>'height' property instead, but<br>that would leave a slight gap<br>if the author miscalculated<br>how much height a given<br>number of lines would<br>occupy (which might be</div>
<div class="article-max-lines-demo three">particularly hard if the author<br>didn't know what text would<br>be filling the space, exactly<br>what font would be used, or<br>exactly which platform's font<br>rendering would be used to<br>display the font).</div>
</td></tr></table>
</div>
<h2 id="static-media">Overflow in static media</h2>
<p class="issue">
This specification should define useful behavior
for all values of 'overflow'
in static media (such as print).
Current implementation behavior is quite poor and
produces unexpected results when authors have not considered
what will happen when
the content they produce for interactive media
is printed.
</p>
<h2 id="conformance">
Conformance</h2>
<h3 id="placement">
Module interactions</h3>
<p>This module extends the 'overflow'
feature defined in [[CSS21]] section 11.1.1. It defines additional
overflow handling mechanisms that implementations must implement as
described in this module in order to conform to this module.</p>
<p>No properties in this module apply to the <code>::first-line</code> or
<code>::first-letter</code> pseudo-elements.</p>
<h3 id="values">
Values</h3>
<p>This specification follows the
<a href="http://www.w3.org/TR/CSS21/about.html#property-defs">CSS property
definition conventions</a> from [[!CSS21]]. Value types not defined in
this specification are defined in CSS Level 2 Revision 1 [[!CSS21]].
Other CSS modules may expand the definitions of these value types: for
example [[CSS3COLOR]], when combined with this module, expands the
definition of the <color> value type as used in this specification.</p>
<p>In addition to the property-specific values listed in their definitions,
all properties defined in this specification also accept the
<a href="http://www.w3.org/TR/CSS21/cascade.html#value-def-inherit">inherit</a>
keyword as their property value. For readability it has not been repeated
explicitly.
<h3 id="conventions">
Document conventions</h3>
<p>Conformance requirements are expressed with a combination of
descriptive assertions and RFC 2119 terminology. The key words “MUST”,
“MUST NOT”, “REQUIRED”, “SHALL”, “SHALL NOT”, “SHOULD”, “SHOULD NOT”,
“RECOMMENDED”, “MAY”, and “OPTIONAL” in the normative parts of this
document are to be interpreted as described in RFC 2119.
However, for readability, these words do not appear in all uppercase
letters in this specification.
<p>All of the text of this specification is normative except sections
explicitly marked as non-normative, examples, and notes. [[!RFC2119]]</p>
<p>Examples in this specification are introduced with the words “for example”
or are set apart from the normative text with <code>class="example"</code>,
like this:
<div class="example">
<p>This is an example of an informative example.</p>
</div>
<p>Informative notes begin with the word “Note” and are set apart from the
normative text with <code>class="note"</code>, like this:
<p class="note">Note, this is an informative note.</p>
<h3 id="conformance-classes">
Conformance classes</h3>
<p>Conformance to CSS Overflow Module Level 3
is defined for three conformance classes:
<dl>
<dt><dfn title="style sheet!!as conformance class">style sheet</dfn>
<dd>A <a href="http://www.w3.org/TR/CSS21/conform.html#style-sheet">CSS
style sheet</a>.
<dt><dfn>renderer</dfn></dt>
<dd>A <a href="http://www.w3.org/TR/CSS21/conform.html#user-agent">UA</a>
that interprets the semantics of a style sheet and renders
documents that use them.
<dt><dfn id="authoring-tool">authoring tool</dfn></dt>
<dd>A <a href="http://www.w3.org/TR/CSS21/conform.html#user-agent">UA</a>
that writes a style sheet.
</dl>
<p>A style sheet is conformant to CSS Overflow Module Level 3
if all of its statements that use syntax defined in this module are valid
according to the generic CSS grammar and the individual grammars of each
feature defined in this module.
<p>A renderer is conformant to CSS Overflow Module Level 3
if, in addition to interpreting the style sheet as defined by the
appropriate specifications, it supports all the features defined
by CSS Overflow Module Level 3 by parsing them correctly
and rendering the document accordingly. However, the inability of a
UA to correctly render a document due to limitations of the device
does not make the UA non-conformant. (For example, a UA is not
required to render color on a monochrome monitor.)
<p>An authoring tool is conformant to CSS Overflow Module Level 3
if it writes style sheets that are syntactically correct according to the
generic CSS grammar and the individual grammars of each feature in
this module, and meet all other conformance requirements of style sheets
as described in this module.
<h3 id="partial">
Partial implementations</h3>
<p>So that authors can exploit the forward-compatible parsing rules to
assign fallback values, CSS renderers <strong>must</strong>
treat as invalid (and <a href="http://www.w3.org/TR/CSS21/conform.html#ignore">ignore
as appropriate</a>) any at-rules, properties, property values, keywords,
and other syntactic constructs for which they have no usable level of
support. In particular, user agents <strong>must not</strong> selectively
ignore unsupported component values and honor supported values in a single
multi-value property declaration: if any value is considered invalid
(as unsupported values must be), CSS requires that the entire declaration
be ignored.</p>
<h3 id="experimental">
Experimental implementations</h3>
<p>To avoid clashes with future CSS features, the CSS2.1 specification
reserves a <a href="http://www.w3.org/TR/CSS21/syndata.html#vendor-keywords">prefixed
syntax</a> for proprietary and experimental extensions to CSS.
<p>Prior to a specification reaching the Candidate Recommendation stage
in the W3C process, all implementations of a CSS feature are considered
experimental. The CSS Working Group recommends that implementations
use a vendor-prefixed syntax for such features, including those in
W3C Working Drafts. This avoids incompatibilities with future changes
in the draft.
</p>
<h3 id="testing">
Non-experimental implementations</h3>
<p>Once a specification reaches the Candidate Recommendation stage,
non-experimental implementations are possible, and implementors should
release an unprefixed implementation of any CR-level feature they
can demonstrate to be correctly implemented according to spec.
<p>To establish and maintain the interoperability of CSS across
implementations, the CSS Working Group requests that non-experimental
CSS renderers submit an implementation report (and, if necessary, the
testcases used for that implementation report) to the W3C before
releasing an unprefixed implementation of any CSS features. Testcases
submitted to W3C are subject to review and correction by the CSS
Working Group.
<p>Further information on submitting testcases and implementation reports
can be found from on the CSS Working Group's website at
<a href="http://www.w3.org/Style/CSS/Test/">http://www.w3.org/Style/CSS/Test/</a>.
Questions should be directed to the
<a href="http://lists.w3.org/Archives/Public/public-css-testsuite">public-css-testsuite@w3.org</a>
mailing list.
<h3 id="cr-exit-criteria">
CR exit criteria</h3>
<p class=issue>[Change or remove the following CR exit criteria if
the spec is not a module, but, e.g., a Note or a profile. This text was <a
href="http://www.w3.org/Style/CSS/Tracker/actions/44"> decided on 2008-06-04.</a>]</p>
<p>
For this specification to be advanced to Proposed Recommendation,
there must be at least two independent, interoperable implementations
of each feature. Each feature may be implemented by a different set of
products, there is no requirement that all features be implemented by
a single product. For the purposes of this criterion, we define the
following terms:
<dl>
<dt>independent <dd>each implementation must be developed by a
different party and cannot share, reuse, or derive from code
used by another qualifying implementation. Sections of code that
have no bearing on the implementation of this specification are
exempt from this requirement.
<dt>interoperable <dd>passing the respective test case(s) in the
official CSS test suite, or, if the implementation is not a Web
browser, an equivalent test. Every relevant test in the test
suite should have an equivalent test created if such a user
agent (UA) is to be used to claim interoperability. In addition
if such a UA is to be used to claim interoperability, then there
must one or more additional UAs which can also pass those
equivalent tests in the same way for the purpose of
interoperability. The equivalent tests must be made publicly
available for the purposes of peer review.
<dt>implementation <dd>a user agent which:
<ol class=inline>
<li>implements the specification.
<li>is available to the general public. The implementation may
be a shipping product or other publicly available version
(i.e., beta version, preview release, or “nightly build”).
Non-shipping product releases must have implemented the
feature(s) for a period of at least one month in order to
demonstrate stability.
<li>is not experimental (i.e., a version specifically designed
to pass the test suite and is not intended for normal usage
going forward).
</ol>
</dl>
<p>The specification will remain Candidate Recommendation for at least
six months.
<h2 class=no-num id="acknowledgments">
Acknowledgments</h2>
<p>
Thanks especially to the feedback from
Rossen Atanassov,
Bert Bos,
Tantek Çelik,
John Daggett,
fantasai,
Daniel Glazman,
Vincent Hardy,
Håkon Wium Lie,
Peter Linss,
Florian Rivoal,
Alan Stearns,
Steve Zilles,
and all the rest of the
<a href="http://lists.w3.org/Archives/Public/www-style/">www-style</a> community.