forked from w3c/csswg-drafts
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathOverview.html
More file actions
5796 lines (4115 loc) · 183 KB
/
Copy pathOverview.html
File metadata and controls
5796 lines (4115 loc) · 183 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 PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<html lang=en>
<head><meta content="text/html; charset=utf-8" http-equiv=Content-Type>
<title>CSS Text Level 3</title>
<link href=default.css rel=stylesheet type="text/css">
<style type="text/css">
.data, .proptable {
margin: 1em auto;
border-collapse: collapse;
border: solid #005A9B;
}
.data caption {
width: 100%;
text-align: center;
}
.data td, .data th,
.proptable td, .proptable th {
border: thin solid;
padding: 0.2em;
text-align: center;
}
.data thead th[scope="row"],
.proptable thead th[scope="row"] {
text-align: right;
background: #A4C8E2;
color: inherit;
}
.data thead,
.proptable thead {
background: #EEEEEE;
color: inherit;
}
.data tbody th:first-child,
.proptable tbody th:first-child {
text-align: right;
background: #EEEEEE;
color: inherit;
}
.data thead,
.data tbody,
.data tfoot,
.data colgroup {
border: solid;
}
table.propdef {
table-layout: auto;
}
.propdef th {
font-style: italic;
font-weight: normal;
text-align: left;
width: 3em;
}
dt dfn code {
font-size: inherit;
}
</style>
<style type="text/css">
.egbidiwsaA,.egbidiwsbB,.egbidiwsaB,.egbidiwsbC
{ white-space:pre;font-size:80%;font-family:monospace; vertical-align:2px; margin:1px }
.egbidiwsaA { background:lime;padding:2px; }
.egbidiwsbB { border:2px solid blue }
.egbidiwsaB { background:yellow;border:2px dotted white }
.egbidiwsbC { border:2px dotted red }
.char { border: 1px dotted gray; }
tt[lang="ja"] { font-family: "MS Gothic", "Osaka", monospace }
</style>
<link href="http://www.w3.org/StyleSheets/TR/W3C-ED.css" rel=stylesheet
type="text/css">
<body>
<div class=head> <!--begin-logo-->
<p><a href="http://www.w3.org/"><img alt=W3C height=48
src="http://www.w3.org/Icons/w3c_home" width=72></a> <!--end-logo-->
<h1>CSS Text Level 3</h1>
<h2 class="no-num no-toc" id=longstatus-date>Editor's Draft 14 December
2010</h2>
<dl>
<dt>This version:
<dd><a href="http://dev.w3.org/csswg/css3-text/Overview.html">$Date:
2010/11/03 13:39:38 $ (CVS $Revision$)</a> <!--<dd><a
href="http://www.w3.org/TR/2010/WD-css3-text-20101005/">http://www.w3.org/TR/2010/WD-css3-text-20101005/</a></dd> -->
<dt>Latest version:
<dd><a
href="http://www.w3.org/TR/css3-text/">http://www.w3.org/TR/css3-text/</a>
<dt>Previous version:
<dd><a
href="http://www.w3.org/TR/2010/WD-css3-text-20101005/">http://www.w3.org/TR/2010/WD-css3-text-20101005/</a>
<dt>Editors:
<dd><a href="http://fantasai.inkedblade.net/contact">Elika J. Etemad</a>
(Invited Expert)
<dd><a href="mailto:kojiishi@gluesoft.co.jp">Koji Ishii</a> (<a
href="http://www.antenna.co.jp/">Antenna House</a>)
<dd><a href="mailto:murakami@antenna.co.jp">Shinyu Murakami</a> (<a
href="http://www.antenna.co.jp/">Antenna House</a>)
</dl>
<!--begin-copyright-->
<p class=copyright><a
href="http://www.w3.org/Consortium/Legal/ipr-notice#Copyright"
rel=license>Copyright</a> © 2010 <a
href="http://www.w3.org/"><acronym title="World Wide Web
Consortium">W3C</acronym></a><sup>®</sup> (<a
href="http://www.csail.mit.edu/"><acronym title="Massachusetts Institute
of Technology">MIT</acronym></a>, <a href="http://www.ercim.eu/"><acronym
title="European Research Consortium for Informatics and
Mathematics">ERCIM</acronym></a>, <a
href="http://www.keio.ac.jp/">Keio</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>
<h2 class="no-num no-toc" id=abstract>Abstract</h2>
<p>This CSS3 module defines properties for text manipulation and specifies
their processing model. It covers line breaking, justification and
alignment, white space handling, text decoration and text transformation.
<h2 class="no-num no-toc" id=status>Status of This Document</h2>
<p><em>This section describes the status of this document at the time of
its publication. Other documents may supersede this document. A list of
current W3C publications and the latest revision of this technical report
can be found in the <a href="http://www.w3.org/TR/">W3C technical reports
index at http://www.w3.org/TR/.</a></em>
<p>Publication as a Working Draft does not imply endorsement by the W3C
Membership. This is a draft document and may be updated, replaced or
obsoleted by other documents at any time. It is inappropriate to cite this
document as other than work in progress.
<p>This CSS module has been produced as a combined effort of the <a
href="http://www.w3.org/International/Activity">W3C Internationalization
Activity</a>, and the <a href="http://www.w3.org/Style/Activity">Style
Activity</a> and is maintained by the <a
href="http://www.w3.org/Style/CSS/members">CSS Working Group</a>. It also
includes contributions made by participants in the <a
href="http://www.w3.org/Style/XSL/Group/">XSL Working Group</a> (<a
href="http://cgi.w3.org/MemberAccess/AccessRequest">members only</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>This Text module and a separate (upcoming) Writing Modes module replace
and obsolete the <a
href="http://www.w3.org/TR/2003/CR-css3-text-20030514/">May 2003 CSS3 Text
Module Candidate Recommendation</a>. Since this is a thorough overhaul of
the previous CR, a <a href="#changes">list of changes</a> has been
provided.
<p><strong>Feedback on this draft should be posted to the (<a
href="http://lists.w3.org/Archives/Public/www-style/">archived</a>) public
mailing list <a
href="mailto:www-style@w3.org">www-style@w3.org</a></strong> (see <a
href="http://www.w3.org/Mail/Request">instructions</a>) <strong>with
<kbd>[css3-text]</kbd> in the subject line.</strong> You are strongly
encouraged to complain if you see something stupid in this draft. The
editors will do their best to respond to all feedback.
<p><strong>If you have implemented properties from the <a
href="http://www.w3.org/TR/2003/CR-css3-text-20030514/">May 2003 CSS3 Text
CR</a></strong> <em>please</em> let us know so we can take that into
account as we redraft the spec. You can post to <a
href="http://lists.w3.org/Archives/Public/www-style/">www-style</a>
(public), post to the <a
href="http://lists.w3.org/Archives/Member/w3c-css-wg/">CSS WG mailing
list</a> (<a
href="http://cgi.w3.org/MemberAccess/AccessRequest">Member-restricted</a>),
or <a href="http://fantasai.inkedblade.net/contact">email fantasai
directly</a> (personal).
<p>The following features are at risk and may be cut from the spec during
its CR period: the ‘<a href="#text-outline0"><code
class=property>text-outline</code></a>’ property, the ‘<code
class=css>unrestricted</code>’ value of ‘<a
href="#text-wrap0"><code class=property>text-wrap</code></a>’, the
‘<a href="#hanging-punctuation0"><code
class=property>hanging-punctuation</code></a>’ and ‘<a
href="#punctuation-trim0"><code
class=property>punctuation-trim</code></a>’ properties
<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>
<li><a href="#conformance"><span class=secno>2. </span> Conformance</a>
<ul class=toc>
<li><a href="#partial-impl"><span class=secno>2.1. </span> Partial and
Experimental Implementations</a>
</ul>
<li><a href="#transforming"><span class=secno>3. </span> Transforming
Text</a>
<ul class=toc>
<li><a href="#text-transform"><span class=secno>3.1. </span>
Transforming Text: the ‘<code
class=property>text-transform</code>’ property</a>
</ul>
<li><a href="#white-space-processing"><span class=secno>4. </span> White
Space Processing</a>
<ul class=toc>
<li><a href="#white-space-collapsing"><span class=secno>4.1. </span>
White Space Collapsing: the ‘<code
class=property>white-space-collapsing</code>’ property</a>
<li><a href="#white-space-rules"><span class=secno>4.2. </span> The
White Space Processing Rules</a>
<ul class=toc>
<li><a href="#egbidiwscollapse"><span class=secno>4.2.1. </span>
Example of bidirectionality with white space collapsing</a>
<li><a href="#line-break-transform"><span class=secno>4.2.2. </span>
Line Break Transformation Rules</a>
<li><a href="#white-space-summary"><span class=secno>4.2.3. </span>
Informative Summary of White Space Collapsing Effects</a>
</ul>
<li><a href="#white-space"><span class=secno>4.3. </span> White Space
and Text Wrapping Shorthand: the ‘<code
class=property>white-space</code>’ property</a>
</ul>
<li><a href="#line-breaking"><span class=secno>5. </span> Line Breaking
and Word Boundaries</a>
<ul class=toc>
<li><a href="#line-break"><span class=secno>5.1. </span> Line Breaking
Restrictions Strictness: the ‘<code
class=property>line-break</code>’ property</a>
<li><a href="#word-break"><span class=secno>5.2. </span> Word Breaking
Rules: the ‘<code class=property>word-break</code>’
property</a>
</ul>
<li><a href="#wrapping"><span class=secno>6. </span> Text Wrapping</a>
<ul class=toc>
<li><a href="#text-wrap"><span class=secno>6.1. </span> Text Wrap
Settings: the ‘<code class=property>text-wrap</code>’
property</a>
<ul class=toc>
<li><a href="#example-suppress"><span class=secno>6.1.1.
</span>Example of using ‘<code class=css>text-wrap:
suppress</code>’ in presenting a footer</a>
</ul>
<li><a href="#word-wrap"><span class=secno>6.2. </span> Emergency
Wrapping: the ‘<code class=property>word-wrap</code>’
property</a>
</ul>
<li><a href="#justification"><span class=secno>7. </span> Alignment and
Justification</a>
<ul class=toc>
<li><a href="#text-align"><span class=secno>7.1. </span> Text Alignment:
the ‘<code class=property>text-align</code>’ property</a>
<li><a href="#text-align-last"><span class=secno>7.2. </span> Last Line
Alignment: the ‘<code
class=property>text-align-last</code>’ property</a>
<li><a href="#text-justify"><span class=secno>7.3. </span> Justification
Method: the ‘<code class=property>text-justify</code>’
property</a>
</ul>
<li><a href="#spacing"><span class=secno>8. </span> Spacing</a>
<ul class=toc>
<li><a href="#word-spacing"><span class=secno>8.1. </span> Word Spacing:
the ‘<code class=property>word-spacing</code>’ property</a>
<li><a href="#letter-spacing"><span class=secno>8.2. </span> Tracking:
the ‘<code class=property>letter-spacing</code>’
property</a>
<li><a href="#punctuation-trim"><span class=secno>8.3. </span> Fullwidth
Punctuation Kerning: the ‘<code
class=property>punctuation-trim</code>’ property</a>
<li><a href="#text-autospace"><span class=secno>8.4. </span> Adding
space: the ‘<code class=property>text-autospace</code>’
property</a>
</ul>
<li><a href="#edge-effects"><span class=secno>9. </span> Edge Effects</a>
<ul class=toc>
<li><a href="#text-indent"><span class=secno>9.1. </span> First Line
Indentation: the ‘<code class=property>text-indent</code>’
property</a>
<li><a href="#hanging-punctuation"><span class=secno>9.2. </span>
Hanging Punctuation: the ‘<code
class=property>hanging-punctuation</code>’ property</a>
</ul>
<li><a href="#decoration"><span class=secno>10. </span> Text
Decoration</a>
<ul class=toc>
<li><a href="#line-decoration"><span class=secno>10.1. </span> Line
Decoration: Underline, Overline, and Strike-Through</a>
<ul class=toc>
<li><a href="#text-decoration-line"><span class=secno>10.1.1. </span>
Text Decoration Lines: the ‘<code
class=property>text-decoration-line</code>’ property</a>
<li><a href="#text-decoration-color"><span class=secno>10.1.2. </span>
Text Decoration Color: the ‘<code
class=property>text-decoration-color</code>’ property</a>
<li><a href="#text-decoration-style"><span class=secno>10.1.3. </span>
Text Decoration Style: the ‘<code
class=property>text-decoration-style</code>’ property</a>
<li><a href="#text-decoration"><span class=secno>10.1.4. </span> Text
Decoration Shorthand: the ‘<code
class=property>text-decoration</code>’ property</a>
<li><a href="#text-decoration-skip"><span class=secno>10.1.5. </span>
Text Decoration Line Continuity: the ‘<code
class=property>text-decoration-skip</code>’ property</a>
<li><a href="#text-underline-position"><span class=secno>10.1.6.
</span> Text Underline Position: the ‘<code
class=property>text-underline-position</code>’ property</a>
</ul>
<li><a href="#emphasis-marks"><span class=secno>10.2. </span> Emphasis
Marks</a>
<ul class=toc>
<li><a href="#text-emphasis-style"><span class=secno>10.2.1. </span>
Emphasis Mark Style: the ‘<code
class=property>text-emphasis-style</code>’ property</a>
<li><a href="#text-emphasis-color"><span class=secno>10.2.2. </span>
Emphasis Mark Color: the ‘<code
class=property>text-emphasis-color</code>’ property</a>
<li><a href="#text-emphasis"><span class=secno>10.2.3. </span>
Emphasis Mark Shorthand: the ‘<code
class=property>text-emphasis</code>’ property</a>
<li><a href="#text-emphasis-position"><span class=secno>10.2.4.
</span> Emphasis Mark Position: the ‘<code
class=property>text-emphasis-position</code>’ property</a>
</ul>
<li><a href="#text-shadow"><span class=secno>10.3. </span> Text Shadows:
the ‘<code class=property>text-shadow</code>’ property</a>
<li><a href="#text-outline"><span class=secno>10.4. </span> Text
Outlines: the ‘<code class=property>text-outline</code>’
property</a>
</ul>
<li><a href="#ui"><span class=secno>11. </span>This section should move to
CSS3 UI</a>
<ul class=toc>
<li><a href="#text-overflow"><span class=secno>11.1. </span> Overflow
Ellipsis: the ‘<code class=property>text-overflow</code>’
property</a>
</ul>
<li class=no-num><a href="#changes">Changes</a>
<ul class=toc>
<li class=no-num><a href="#changes-2003"> Changes from the May 2003 CSS3
Text <abbr title="Candidate Recommendation">CR</abbr></a>
<li class=no-num><a href="#recent-changes"> Changes from the March 2007
CSS3 Text <abbr title="Working Draft">WD</abbr></a>
</ul>
<li class=no-num><a href="#acknowledgements"> Acknowledgements</a>
<li class=no-num><a href="#appendix-a-references">Appendix A:
References</a>
<ul class=toc>
<li class=no-num><a href="#normative-ref">Normative references</a>
<li class=no-num><a href="#informative-ref">Informative references</a>
</ul>
<li class=no-num><a href="#appendix-b-property-index"> Appendix B:
Property index</a>
<li class=no-num><a href="#default-stylesheet">Appendix C: Default UA
Stylesheet</a>
<li class=no-num><a href="#index">Index</a>
</ul>
<!--end-toc-->
<h2 id=intro><span class=secno>1. </span> Introduction</h2>
<p>[document here]
<h2 id=conformance><span class=secno>2. </span> Conformance</h2>
<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. All of the text of this specification is
normative except sections explicitly marked as non-normative, examples,
and notes. <a href="#RFC2119"
rel=biblioentry>[RFC2119]<!--{{!RFC2119}}--></a>
<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>Conformance to CSS Text Level 3 is defined for three classes:
<dl>
<dt><dfn id=style-sheet 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 id=renderer>renderer</dfn>
<dd>A UA that interprets the semantics of a style sheet and renders
<span>documents</span> that use them.
<dt><dfn id=authoring-tool>authoring tool</dfn>
<dd>A UA that writes a style sheet.
</dl>
<p>A style sheet is conformant to CSS Text Level 3 if all of its
declarations that use properties defined in this module have values that
are valid according to the generic CSS grammar and the individual grammars
of each property as given in this module.
<p>A renderer is conformant to CSS Text Level 3 if, in addition to
interpreting the style sheet as defined by the appropriate specifications,
it supports all the properties defined by CSS Text 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 Text Level 3 if it writes
syntactically correct style sheets, according to the generic CSS grammar
and the individual grammars of each property in this module.
<h3 id=partial-impl><span class=secno>2.1. </span> Partial and Experimental
Implementations</h3>
<p>UAs must treat as invalid any properties or values they do not support.
Experimental implementations of a feature should support only a
vendor-prefixed syntax for the property/value.
<h2 id=transforming><span class=secno>3. </span> Transforming Text</h2>
<h3 id=text-transform><span class=secno>3.1. </span> <a name=caps-prop></a>
Transforming Text: the ‘<a href="#text-transform0"><code
class=property>text-transform</code></a>’ property</h3>
<table class=propdef>
<tbody>
<tr>
<th>Name:
<td><dfn id=text-transform0>text-transform</dfn>
<tr>
<th>Value:
<td>none | [ [ capitalize | uppercase | lowercase ] || fullwidth ||
large-kana ]
<tr>
<th>Initial:
<td>none
<tr>
<th>Applies to:
<td>all elements
<tr>
<th>Inherited:
<td>yes
<tr>
<th>Percentages:
<td>N/A
<tr>
<th>Media:
<td>visual
<tr>
<th>Computed value:
<td>as specified
</table>
<p>This property transforms text for the styling purpose. Values have the
following meanings:
<dl>
<dt><dfn id=none title="text-transform:none"><code>none</code></dfn>
<dd>No effects.
<dt><dfn id=capitalize
title="text-transform:capitalize"><code>capitalize</code></dfn>
<dd>Puts all words in titlecase.
<dt><dfn id=uppercase
title="text-transform:uppercase"><code>uppercase</code></dfn>
<dd>Puts all characters in uppercase.
<dt><dfn id=lowercase
title="text-transform:lowercase"><code>lowercase</code></dfn>
<dd>Puts all characters in lowercase.
<dt><dfn id=fullwidth
title="text-transform:fullwidth"><code>fullwidth</code></dfn>
<dd>Puts all characters in fullwidth form. If the character does not have
corresponding fullwidth form, it is left as is. This value is typically
used to typeset Latin characters and digits like ideographic characters.
<p class=issue>should try fallback if the glyph is missing. should it
also check fullwidth variants before falling back to next font?
<dt><dfn id=large-kana
title="text-transform:large-kana"><code>large-kana</code></dfn>
<dd>Converts all small Kana characters to normal Kana. This value is
typically used for ruby annotation text, where all small Kana should be
drawn as large Kana.
<p class=issue>need to work on interoperability with OpenType and CSS3
Fonts font-variant:ruby
</dl>
<p>Although limited, the case mapping process has some language
dependencies. Some well known examples are Turkish and Greek. If the
content language is known then any such language-specific rules must be
used.
<p>The case mapping rules for the character repertoire specified by the
Unicode Standard can be found on the Unicode Consortium Web site. <a
href="#UNICODE" rel=biblioentry>[UNICODE]<!--{{!UNICODE}}--></a> Only
characters belonging to bicameral scripts are affected.
<p>The definition of fullwidth and halfwidth forms can be found on the
Unicode consortium web site at <a href="#UAX11"
rel=biblioentry>[UAX11]<!--{{!UAX11}}--></a>.
<div class=example>
<p>The following example converts the ASCII characters in abbreviations in
Japanese to their fullwidth variants so that they lay out and line break
like ideographs:
<pre>abbr:lang(ja) { text-transform: fullwidth; }</pre>
</div>
<h2 id=white-space-processing><span class=secno>4. </span> White Space
Processing</h2>
<p>The source text of a document often contains formatting that is not
relevant to the final rendering: for example, breaking the source into
segments (lines) for ease of editing or adding white space characters such
as tabs and spaces to indent the source code. CSS white space processing
allows the author to control interpretation of such formatting: to
preserve or collapse it away when rendering the document.
<p>Segments in the document source can be separated by a carriage return
(U+000D), a linefeed (U+000A) or both (U+000D U+000A), or by some other
mechanism that identifies the beginning and end of document segments, such
as the SGML RECORD-START and RECORD-END tokens. If no segmentation rules
are specified for the document language, each line feed (U+000A), carriage
return (U+000D) and CRLF sequence (U+000D U+000A) in the text is
considered a segment break. (This default rule also applies to generated
content.) In CSS, each such segment break is treated as a single line feed
character (U+000A).
<p>White space processing in CSS interprets white space characters for
rendering: it has no effect on the underlying document data. In the
context of CSS, the document white space set is defined to be any space
characters (Unicode value U+0020), tab characters (U+0009), and line feeds
(U+000A).
<p class=note>Note that the document parser may have not only normalized
segment breaks, but also collapsed other space characters or otherwise
processed white space according to markup rules. Because CSS processing
occurs <em>after</em> the parsing stage, it is not possible to restore
these characters for styling. Therefore, some of the behavior specified
below can be affected by these limitations and may be user agent
dependent.
<p>Control characters other than U+0009 (tab), U+000A (line feed), U+0020
(space), and U+202x (bidi formatting characters) are treated as characters
to render in the same way as any normal character. <span
class=issue>Copied from CSS2.1 but this has got to be wrong.</span>
<h3 id=white-space-collapsing><span class=secno>4.1. </span> White Space
Collapsing: the ‘<a href="#white-space-collapsing0"><code
class=property>white-space-collapsing</code></a>’ property</h3>
<p class=issue>This section is still under discussion and may change in
future drafts.
<table class=propdef>
<tbody>
<tr>
<th>Name:
<td><dfn id=white-space-collapsing0>white-space-collapsing</dfn>
<tr>
<th>Value:
<td>collapse | discard | [ [preserve | preserve-breaks] && trim-inner ]
<tr>
<th>Initial:
<td>collapse
<tr>
<th>Applies to:
<td>all elements
<tr>
<th>Inherited:
<td>yes
<tr>
<th>Percentages:
<td>N/A
<tr>
<th>Media:
<td>visual
<tr>
<th>Computed value:
<td>specified value
</table>
<p class=issue>Rename to white-space-trim or white-space-adjust?
white-space-collapsing has an ‘<code
class=property>ing</code>’ and is confusing with XSL
<p>This property declares whether and how <a
href="#white-space-processing">white space</a> inside the element is
collapsed. Values have the following meanings, which must be interpreted
according to the <a href="#white-space-rules">white space processing
rules</a>:
<dl>
<dt><dfn id=collapse0
title="white-space-collapsing:collapse"><code>collapse</code></dfn>
<dd>This value directs user agents to collapse sequences of white space
into a single character (or <a href="#line-break-transform">in some
cases</a>, no character).
<dt><dfn id=preserve
title="white-space-collapsing:preserve"><code>preserve</code></dfn>
<dd>This value prevents user agents from collapsing sequences of white
space. Segment breaks are preserved as forced line breaks.
<dt><dfn id=preserve-breaks
title="white-space-collapsing:preserve-breaks"><code>preserve-breaks</code></dfn>
<dd>This value collapses white space as for ‘<code
class=css>collapse</code>’, but preserves segment breaks as forced
line breaks.
<dt><dfn id=discard
title="white-space-collapsing:discard"><code>discard</code></dfn>
<dd>This value directs user agents to "discard" all white space in the
element.
<dt><dfn id=trim-inner
title="white-space-collapsing:trim-inner"><code>trim-inner</code></dfn>
<dd>This value directs UAs to discard all whitespace at the beginning of a
block up to and including the last line break before the first
non-white-space character in the block as well as to discard all white
space at the end of a block starting with the first line break after the
last non-white-space character in the block.
</dl>
<h3 id=white-space-rules><span class=secno>4.2. </span> The White Space
Processing Rules</h3>
<p>For each inline (including anonymous inlines), white space characters
are handled as follows, ignoring bidi formatting characters as if they
were not there:
<ul>
<li id=collapse>
<p>If <span class=property>‘<a
href="#white-space-collapsing0"><code
class=property>white-space-collapsing</code></a>’</span> is set to
‘<code class=property>collapse</code>’ or ‘<code
class=property>preserve-breaks</code>’, white space characters are
considered <dfn id=collapsible>collapsible</dfn> and are processed by
performing the following steps:</p>
<ol>
<li>All spaces and tabs immediately following a line feed character are
removed. (This has the effect of discarding all white space at the
start of a line but preserving a trailing space if one exists at the
end.)
<li>If <span class=property>‘<a
href="#white-space-collapsing0"><code
class=property>white-space-collapsing</code></a>’</span> is not
‘<code class=property>preserve-breaks</code>’, line feed
characters are transformed for rendering according to the <a
href="#line-break-transform">line break transformation rules</a>.
<li>Every tab (U+0009) is converted to a space (U+0020)
<li>Any space (U+0020) following another collapsible space
(U+0020)—even a space before the inline—is removed.
However, if removing this space would eliminate a line breaking
opportunity in the text, that opportunity is still considered to exist.
</ol>
<li>
<p>If <span class=property>‘<a
href="#white-space-collapsing0"><code
class=property>white-space-collapsing</code></a>’</span> is set to
‘<code class=property>preserve</code>’, any sequence of
spaces (U+0020) unbroken by an element boundary is treated as a sequence
of non-breaking spaces. However, a line breaking opportunity exists at
the end of the sequence.
<li>
<p>If <span class=property>‘<a
href="#white-space-collapsing0"><code
class=property>white-space-collapsing</code></a>’</span> is set to
‘<code class=property>discard</code>’, the first white space
character in every white space sequence is converted to a zero width
non-joiner (U+200C) and the rest of the sequence is removed.</p>
</ul>
<p>Then, the entire block is rendered. Inlines are laid out, taking bidi
reordering into account, and wrapping as specified by the <span
class=property>‘<a href="#text-wrap0"><code
class=property>text-wrap</code></a>’</span> property.
<p>As each line is laid out,
<ol>
<li>A sequence of collapsible spaces (U+0020) at the beginning of a line
is removed.
<li>Each tab (U+0009) is rendered as a horizontal shift that lines up the
start edge of the next glyph with the next tab stop. Tab stops occur at
points that are multiples of 8 times the width of a space (U+0020)
rendered in the block's font from the block's starting content edge.
<li>A sequence of collapsible spaces (U+0020) at the end of a line is
removed.
<li>If spaces (U+0020) or tabs (U+0009) at the end of a line are
non-collapsible but have ‘<a href="#text-wrap0"><code
class=property>text-wrap</code></a>’ set to ‘<code
class=property>normal</code>’ or ‘<code
class=property>suppress</code>’ the UA may visually collapse them.
</ol>
<div class=example>
<h4 id=egbidiwscollapse><span class=secno>4.2.1. </span> Example of
bidirectionality with white space collapsing</h4>
<p>Consider the following markup fragment, taking special note of spaces
(with varied backgrounds and borders for emphasis and identification):</p>
<pre><code><ltr>A<span class=egbidiwsaA> </span><rtl><span class=egbidiwsbB> </span>B<span class=egbidiwsaB> </span></rtl><span class=egbidiwsbC> </span>C</ltr></code></pre>
<p>where the <code><ltr></code> element represents a left-to-right
embedding and the <code><rtl></code> element represents a
right-to-left embedding. If the ‘<a
href="#white-space-collapsing0"><code
class=property>white-space-collapsing</code></a>’ property is set
to ‘<code class=property>collapse</code>’, the above
processing model would result in the following:</p>
<ul style="line-height:1.3">
<li>The space before the B (<span class=egbidiwsbB> </span>) would
collapse with the space after the A (<span
class=egbidiwsaA> </span>).
<li>The space before the C (<span class=egbidiwsbC> </span>) would
collapse with the space after the B (<span
class=egbidiwsaB> </span>).
</ul>
<p>This would leave two spaces, one after the A in the left-to-right
embedding level, and one after the B in the right-to-left embedding
level. This is then ordered according to the Unicode bidirectional
algorithm, with the end result being:</p>
<pre>A<span class=egbidiwsaA> </span><span class=egbidiwsaB> </span>BC</pre>
<p>Note that there are two spaces between A and B, and none between B and
C. This is best avoided by putting spaces outside the element instead of
just inside the opening and closing tags and, where practical, by relying
on implicit bidirectionality instead of explicit embedding levels.</p>
</div>
<h4 id=line-break-transform><span class=secno>4.2.2. </span> Line Break
Transformation Rules</h4>
<p>When line feeds are <a href="#collapse">collapsible</a>, they are either
transformed into a space (U+0020) or removed depending on the script
context before and after the line break.
<p>The script context is determined by the Unicode-given script value <a
href="#UAX24" rel=biblioentry>[UAX24]<!--{{!UAX24}}--></a> of the first
character that side of the line feed. However, characters such as
punctuation that belong to the COMMON and INHERITED scripts are ignored in
this check; the next character is examined instead. The UA must not
examine characters outside the block and may limit its examination to as
few as four characters on each side of the line feed. If the check fails
to find an acceptable script value (i.e. it has hit the check limits),
then the script context is neutral.
<p class=note>Note that the white space processing rules have already
removed any tabs and spaces after the line feed before these checks take
place.
<ul>
<li>If the character immediately before or immediately after the line feed
is the zero width space character (U+200B), then the line feed is
removed.
<li>Otherwise, if the script context on one side of the line feed is Han,
Yi, Hiragana, or Katakana and the context on the other side is Han, Yi,
Hiragana, Katakana, or neutral, then the line feed is removed.
<p class=issue>IE removes line feed not only between two Hiragana but
also Hiragana and fullwidth alphabets. Firefox, Opera, and Safari does
not remove line breaks even between two Hiragana. Should fullwidth Latin
be considered in this rule?</p>
<li>Otherwise, if ‘<a href="#text-autospace0"><code
class=property>text-autospace</code></a>’ property is set to add
extra spaces for the combination of the character before the line feed
and after, then the line break is removed.
<p class=issue>Any feedback on this behavior is appreciated. Now that we
have text-autospace property, it makes sense to favor it than inserting
spaces. However, we also want to preserve backward compatibility as much
as possible. That is the reason why the line feed should be removed only
if text-autospace inserts spaces instead.
<li>Otherwise, the line feed is converted to a space (U+0020).
</ul>
<p class=issue>Comments on how well this would work in practice would be
very much appreciated, particularly from people who work with Thai and
similar scripts.
<h4 id=white-space-summary><span class=secno>4.2.3. </span> Informative
Summary of White Space Collapsing Effects</h4>
<ul>
<li>Consecutive white space collapses into a single space.
<li>A sequence of line breaks and other white space between two
ideographic characters collapses into nothing unless there is a space
before the first line break in the sequence.
<li>A zero width space immediately before or anywhere after a line break
causes the entire sequence of white space beginning with the line break
to collapse into a zero width space.
</ul>
<h3 id=white-space><span class=secno>4.3. </span> White Space and Text
Wrapping Shorthand: the ‘<a href="#white-space0"><code
class=property>white-space</code></a>’ property</h3>
<table class=propdef>
<tbody>
<tr>
<th>Name:
<td><dfn id=white-space0>white-space</dfn>
<tr>
<th>Value:
<td>normal | pre | nowrap | pre-wrap | pre-line
<tr>
<th>Initial:
<td>not defined for shorthand properties
<tr>
<th>Applies to:
<td>all elements
<tr>
<th>Inherited:
<td>yes
<tr>
<th>Percentages:
<td>N/A
<tr>
<th>Media:
<td>visual
<tr>
<th>Computed value:
<td>see individual properties
</table>
<p>The ‘<a href="#white-space0"><code
class=property>white-space</code></a>’ property is a shorthand for
the <a href="#white-space-collapsing">‘<code
class=property>white-space-collapsing</code>’</a> and <a
href="#text-wrap">‘<code class=property>text-wrap</code>’</a>
properties. Not all combinations are represented. Values have the
following meanings:
<dl>
<dt><dfn id=normal title="white-space:normal"><code>normal</code></dfn>