forked from w3c/csswg-drafts
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathOverview.src.html
More file actions
2102 lines (1789 loc) · 83.5 KB
/
Overview.src.html
File metadata and controls
2102 lines (1789 loc) · 83.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 PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<html><head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta http-equiv="Content-Style-Type" content="text/css">
<meta http-equiv="Content-Language" content="en">
<meta name="author" lang="tr" content="Tantek Çelik">
<title>CSS Basic User Interface Module Level 3 (CSS3 UI)</title>
<link href="../default.css" rel="stylesheet" type="text/css" title="Default">
<style type="text/css">
.subtoc ul,.subtoc ol { list-style-type: none }
ol.objectives { list-style: decimal }
ol.issues { list-style: decimal }
.html4ss { font-size:90%}
h1 {font-size:200%; clear:both}
h2 {font-size:170%; clear:both}
h3 {font-size:150%; clear:both}
h4 {font-size:130%}
h5 {font-size:120%}
h6 {font-size:110%}
h1+h2 {page-break-before: avoid}
h2 {page-break-before: always}
dd p:first-child { margin-top:0 }
</style>
<link rel="stylesheet" type="text/css"
href="http://www.w3.org/StyleSheets/TR/W3C-ED">
<!-- toggle to W3C-WD for TR publication, W3C-ED for editing -->
</head>
<body class="h-entry">
<div class="head">
<a href="http://www.w3.org/"><img height="48" width="72" alt="W3C"
src="http://www.w3.org/Icons/w3c_home">
</a>
<h1 class="p-name">CSS Basic User Interface Module Level 3 (CSS3 UI)</h1>
<h2 class="no-num no-toc">[LONGSTATUS] <time class="dt-updated" datetime="[CDATE]">[DATE]</time></h2>
<dl>
<dt>This version:</dt>
<!-- TR "This version". Update "WD" below as needed to CR/PR/REC -->
<!-- <dd><a href="http://www.w3.org/TR/[YEAR]/WD-[SHORTNAME]-[CDATE]/">
http://www.w3.org/TR/[YEAR]/WD-[SHORTNAME]-[CDATE]/</a>
</dd> -->
<!-- editor's draft "This version" -->
<dd><a class="u-url" href="http://dev.w3.org/csswg/css3-ui/">
http://dev.w3.org/csswg/css3-ui/</a>
</dd>
<dt>Latest version:</dt>
<dd><a href="http://www.w3.org/TR/[SHORTNAME]/"
>http://www.w3.org/TR/[SHORTNAME]/</a></dd>
<dt>Editor's draft:</dt>
<dd><a href="http://dev.w3.org/csswg/css3-ui/"
>http://dev.w3.org/csswg/css3-ui/</a></dd>
<dt>Previous version:</dt>
<dd><a rel="previous"
href="http://www.w3.org/TR/2012/WD-css3-ui-20120117/"
>http://www.w3.org/TR/2012/WD-css3-ui-20120117/</a></dd>
<dt>Issues Tracking:</dt>
<dd><a rel="issues" href="http://wiki.csswg.org/spec/css3-ui"
>http://wiki.csswg.org/spec/css3-ui</a></dd>
<dt>Feedback:</dt>
<dd><a href="mailto:www-style@w3.org?subject=%5Bcss-ui%5D%20feedback">www-style@w3.org</a>
with subject line “<kbd>[css-ui] <var>… message topic …</var></kbd>”
(<a rel="discussion" href="http://lists.w3.org/Archives/Public/www-style/">archives</a>)
</dd>
<dt>Editor:</dt>
<dd class="p-author h-card vcard">
<a lang="tr" class="p-name fn u-url url" rel="author"
href="http://tantek.com">
Tantek Çelik</a>
(<a class="company h-org org" href="http://www.mozilla.org/">Mozilla
Foundation</a>,
and before at
<a href="http://www.microsoft.com/">Microsoft Corporation</a>)
<<a class="u-email email" href="mailto:tantek@cs.stanford.edu"
>tantek@cs.stanford.edu</a>>
</dd>
</dl>
<!--copyright-->
<hr title="Separator for header">
</div>
<h2 class="no-num no-toc" id="abstract">Abstract</h2>
<p>This section is <em>informative</em>.</p>
<p>
<span class="p-summary">
This specification describes user interface related selectors, properties and values that are proposed for CSS level 3 to style HTML and XML (including XHTML).
It includes and extends user interface related features from the selectors, properties and values of CSS level 2 revision 1 and Selectors specifications.
</span>
CSS (Cascading Style Sheets) is a language for describing
the rendering of HTML and XML documents on screen, on paper, in speech, etc.
It uses various selectors, properties and values to style basic user interface elements in a document.
</p>
<h2 style="page-break-before:auto" class="no-num no-toc" id="status">Status of this document</h2>
<!--status-->
<p>This specification is a <strong>Last Call Working
Draft</strong>, although it was previously a Candidate Recommendation.
It has been returned to Last Call Working Draft
because this draft removes features
that were not implemented sufficiently to advance
to Proposed Recommendation,
and had not been previously listed as at risk,
as <a href="http://www.w3.org/2005/10/Process-20051014/tr.html#cfi"
>required</a>
by the W3C Process.
This draft also adds a couple of new properties and values.
See <a href="#changes">Appendix C. Changes</a> for further details.
<!-- This specification may advance directly to Proposed
Recommendation following the last call, depending on comments and
implementation reports. -->
All persons are encouraged to review this
document and send comments to the <a
href="http://lists.w3.org/Archives/Public/www-style/">www-style
mailing list</a> as described above. The <strong>deadline for
comments</strong>
is four weeks after the date of publication in the header or
14 February 2012, whichever is sooner.
</p>
<h3 class="no-num no-toc" id="crec">Candidate Recommendation Exit Criteria</h3>
<p>For this specification to enter the Proposed Recommendation stage,
the following conditions shall be met:</p>
<ol>
<li>
<p>There must be at least two interoperable implementations
for every feature. For the purposes of this criterion,
we define the following terms:</p>
<dl>
<dt>feature</dt>
<dd>
<p>
A section or subsection of the specification.
</p>
</dd>
<dt>interoperable</dt>
<dd>
<p>passing the respective test cases in the test suite, or,
if the implementation is not a web browser, equivalent tests.
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.</p>
</dd>
<dt>implementation</dt>
<dd>
<p>a user agent which:</p>
<ol class=inline>
<li>implements the feature.</li>
<li>is available (i.e. publicly downloadable or available
through some other public point of sale mechanism). This is the
"show me" requirement.</li>
<li>is shipping (i.e. development, private or unofficial
versions are insufficient).</li>
<li>is not experimental (i.e. is intended for a wide audience
and could be used on a daily basis).</li>
</ol>
</dd>
</dl>
</li>
<li><p>A minimum of six months of the CR period must have elapsed.
This is to ensure that enough time is given for any remaining major
errors to be caught.</p></li>
<li><p>The CR period will be extended if implementations are slow to
appear.</p></li>
<li><p>Features that are <em>at risk</em> (see the below list)
will be dropped (thus reducing the list of "all" features
mentioned above)
if two or more interoperable implementations of those features
are not found by the end of the CR period,
or if sufficient and adequate tests
(by judgment of the Working Group)
have not been produced
for those features by the end of the CR period.</p></li>
</ol>
<p>A <a href="/Style/CSS/Test/">test suite</a> and a <a
href="/Style/css3-updates/css3-ui-implementations">report on
implementations</a> will be provided before the document becomes a
Proposed Recommendation.
</p>
<h3 class="no-num no-toc" id="atrisk">Features at risk</h3>
<p>The Working Group has identified the following features as at risk
of being removed from CSS Basic User Interface Module Level 3
when exiting CR.
Implementors are urged to implement these features,
if they wish to see these features remain in this specification.
All other features are either defined in a normative reference
(e.g. CSS 2.1 [[!CSS21]] or Selectors [[!SELECT]])
or are believed to have two or more implementations,
and thus will not be dropped without returning to last call.</p>
<ul>
<!--
At risk due to only one implementation, or obsolete dependency:
XForms is defunct on the web.
<li>XForms needs: :default :valid :invalid :in-range :out-of-range :required :optional :read-only :read-write ::value ::choices ::repeat-item ::repeat-index</li>
<li>box-sizing: padding-box - only FF supports in prefixed version</li>
<li>ime-mode: new - not sure about IE5+ vs FF3+ interop
</li>
<li>nav-index, nav-up, nav-down, nav-right, nav-left, properties
implemented for sure only by Opera, http://www.opera.com/docs/specs/presto22/#css
possibly obsolete: Tasman v1 internal implementation
possibly current: MSTV Tasman
required (depended on) by non-web DVB-HTML, ATSC standards
- unknown if any DVB-HTML or ATSC simulators
</li>
Not at risk:
<li>CSS2.1: :hover :active :focus</li>
<li>Selectors: :enabled :disabled :checked</li>
<li>:indeterminate implemented by FF3.6, IE9, Opera 10.6, Saf3</li>
<li>box-sizing implemented by IE5/Mac, Opera
-moz-box-sizing implemented by Mozilla
</li>
<li>outline, outline-width, outline-color, outline-style all in CSS 2.1</li>
<li>outline-offset property
implemented by Safari 1.2
</li>
<li>cursor property:
CSS2.1: auto | default | help | pointer | wait | crosshair | text |
e-resize | n-resize | ne-resize | nw-resize | s-resize | se-resize | sw-resize | w-resize
IE5/Mac implements: none | progress | cell
IE6/Windows implements: <uri> | progress | not-allowed | no-drop | vertical-text | all-scroll | col-resize | row-resize | move |
Mozilla implements: progress | cell(as -moz-cell) | alias(as -moz-alias) | copy(as -moz-copy) | context-menu(as -moz-context-menu) |
freedesktop.org copied all the cursors from the CSS3-UI LC Working Draft
by FredrikHoeglund - 14 Oct 2003
http://freedesktop.org/Standards/cursor-spec
</li>
<li>'cursor' property values: ew-resize | ns-resize | nesw-resize | nwse-resize
implemented by Firefox and Safari
</li>
<li>'resize' property
implemented by Firefox 4 and Safari
</li>
-->
<li>::value ::choices ::repeat-item ::repeat-index pseudo-elements</li>
<li>'box-sizing' property value: padding-box</li>
<li>'content' property value: icon</li>
<li>'icon' property</li>
<li>'ime-mode' property</li>
<li>'nav-index', 'nav-up', 'nav-down', 'nav-right', 'nav-left'
properties</li>
<li>'text-overflow' property value: <string></li>
<li>'text-overflow' property 2-value syntax and definition.</li>
</ul>
<h2 class="no-num no-toc" id="summary">Overview</h2>
<p>This section is <em>informative</em>.</p>
<p>This document is one of the "modules" for the upcoming CSS3
specification. It not only describes the user interface related
properties and values that already exist in
<a href="http://www.w3.org/TR/REC-CSS1">CSS1</a> [[CSS1]]
and <a href="http://www.w3.org/TR/CSS21">CSS2.1</a> [[!CSS21]], but introduces
new properties and values for CSS3 as well.
The Working Group doesn't expect that all implementations of CSS3 will implement
all properties or values. Instead, there will probably be a small number of variants of CSS3, so-called "profiles".
</p>
<p>This document is the result of the merging of relevant parts of
the following Recommendations and Working Drafts, and the addition of some new features.
</p>
<ul>
<li>Cascading Style Sheets, level 2, revision 1 [[!CSS21]]</li>
<li><a href="http://www.w3.org/TR/2000/WD-css3-userint-20000216">User Interface for CSS3 (16 February 2000)</a> [[CSSUI]]</li>
</ul>
<p>This specification contains:
</p>
<ul>
<li>Pseudo-classes and pseudo-elements to style
user interface states and element fragments respectively.
</li>
<li>Additions to the user interface features in
<a href="http://www.w3.org/TR/CSS21">CSS2.1</a>.</li>
<li>Directional focus navigation properties.</li>
<li>A mechanism to allow the styling of elements as icons for accessibility.</li>
</ul>
<h2 class="no-num no-toc" id="contents">Table of Contents</h2>
<!--toc-->
<hr>
<h2 id="intro">Introduction</h2>
<p>
CSS3 is a set of modules, divided up and profiled in order to
simplify the specification,
and to allow implementors the flexibility of supporting
the particular modules appropriate for their implementations.
</p>
<p>
This module describes selectors and CSS properties which enable authors
to style user interface related states, element fragments, properties
and values.
</p>
<p><a href="http://www.w3.org/TR/REC-CSS1#anchor-pseudo-classes">Section 2.1 of CSS1</a> [[CSS1]]
and <a href="http://www.w3.org/TR/CSS2/ui.html">Chapter 18 of CSS2</a> [[CSS2]]
introduced several user interface related pseudo-classes, properties and values.
<a href="http://www.w3.org/TR/css3-selectors/#UIstates">Section 6.6.4 of Selectors</a> [[!SELECT]] also describes several additional user interface related pseudo-classes (and one pseudo-element).
</p>
<p>
This Working Draft extends them to provide the ability, through CSS,
to style elements based upon additional user interface states,
to style fragments of user interface elements, and to alter the
dynamic presentation of elements in ways previously only available through specific HTML4/XHTML1 elements and attributes.
</p>
<h3 id="purpose">Purpose</h3>
<p>The purpose of this specification is to achieve the following objectives:
</p>
<ul>
<li>Extend the user interface features in CSS2.1.</li>
<li>Provide additional CSS mechanisms to augment or replace other
dynamic presentation related features in HTML4/XHTML1.</li>
<li>Introduce directional navigation properties to assist in the construction of
user interfaces which make use of a directional navigation model.</li>
<li>Introduce properties and values to specify icon presentations for
elements to enhance accessibility.</li>
</ul>
<h2>Conformance</h2>
<h3>Definitions</h3>
<p>The key words <span class="index-def" title="MUST">"MUST"</span>,
<span class="index-def" title="MUST NOT">"MUST NOT"</span>, <span
class="index-def" title="REQUIRED">"REQUIRED"</span>, <span
class="index-def" title="SHALL">"SHALL"</span>, <span
class="index-def" title="SHALL NOT">"SHALL NOT"</span>, <span
class="index-def" title="SHOULD">"SHOULD"</span>, <span
class="index-def" title="SHOULD NOT">"SHOULD NOT"</span>, <span
class="index-def" title="RECOMMENDED">"RECOMMENDED"</span>, <span
class="index-def" title="MAY">"MAY"</span>, and <span
class="index-def" title="OPTIONAL">"OPTIONAL"</span> in this document
are to be interpreted as described in RFC 2119 (see [[!RFC2119]]).
However, for readability, these words do not typically appear
in all uppercase letters in this specification.
</p>
<p>Additional key words, e.g. "User agent (UA)", are
<a href="http://www.w3.org/TR/CSS21/conform.html#defs">defined
by CSS 2.1</a> ([[!CSS21]], section 3.1).</p>
<h3>Classes of products</h3>
<p>The following classes of products (many of which overlap)
should consider implementing this specification:</p>
<ul>
<li>Web browsers</li>
<li>User agents that implement one or more of the following types of
content: HTML ([[HTML401]], [[HTML5]]), XHTML ([[XHTML10]],
[[XHTML11]]), XForms (e.g. [[XFORMS11]]), SVG (e.g. [[SVG10]],
[[SVG11]]) or other content languages that contain forms controls
or are intended for user interaction
</li>
<li>User agents that implement one or more levels or modules of CSS
(e.g. [[CSS1]], [[!CSS21]])</li>
</ul>
<h3>Extensions</h3>
<p>This specification does not define
any explicit extension mechanisms.
If an implementation needs to extend the functionality
of this specification, it must follow any/all guidelines
and requirements of extensions as defined in CSS2.1, e.g.
<a href="http://www.w3.org/TR/CSS21/syndata.html#vendor-keywords"
>Vendor-specific extensions</a>
([[!CSS21]], section 4.1.2.1).
</p>
<h2>Dependencies on other modules</h2>
<p>
This CSS3 module depends on the following other specifications.
</p>
<ul>
<li>[[!SELECT]]</li>
<li>[[!CSS3COLOR]]</li>
<li>[[!CSS21]]</li>
</ul>
<!--
<p>It has non-normative (informative) references to the following
other specifications:</p>
<ul>
</ul>
-->
<p>
The following work is related to the CSS Basic User Interface Module Level 3 (CSS3 Basic UI).
</p>
<ul>
<li>[[HTML401]]</li>
<li>[[HTML5]]</li>
<li>[[UAAG10]]</li>
<li>[[XML10]]</li>
<li>[[XHTML10]]</li>
<li>[[XHTML11]]</li>
<li>[[XFORMS11]]</li>
</ul>
<p>This specification does not define what is a form element.</p>
<h2>User Interface Selectors</h2>
<h3 id="pseudo-classes">User interface states: pseudo-classes</h3>
<p>The Selectors specification <a href="http://www.w3.org/TR/css3-selectors/#UIstates">defines several user interface selectors</a> ([[!SELECT]], sections 6.6.1 and 6.6.4) which represent
user interface states:</p>
<ul><li id="psuedo-hover"><a href="http://www.w3.org/TR/css3-selectors/#useraction-pseudos">:hover</a></li>
<li id="pseudo-active"><a href="http://www.w3.org/TR/css3-selectors/#useraction-pseudos">:active</a></li>
<li id="pseudo-focus"><a href="http://www.w3.org/TR/css3-selectors/#useraction-pseudos">:focus</a></li>
<li id="pseudo-enabled"><a href="http://www.w3.org/TR/css3-selectors/#enableddisabled">:enabled</a></li>
<li id="pseudo-disabled"><a href="http://www.w3.org/TR/css3-selectors/#enableddisabled">:disabled</a></li>
<li id="pseudo-checked"><a href="http://www.w3.org/TR/css3-selectors/#checked">:checked</a></li>
<li id="pseudo-indeterminate"><a href="http://www.w3.org/TR/css3-selectors/#indeterminate">:indeterminate</a></li>
</ul>
<p>These pseudo-classes as defined by [[!SELECT]] are
included in this specification by reference.</p>
<p>CSS 2.1 [[!CSS21]] specifies additional details
for some of the selectors mentioned, above and beyond Selectors.
</p>
<h4 id="active">:active details</h4>
<p>In addition, on systems with more than one mouse button,
:active is clarified to apply only to the primary
or primary activation button (typically the "left" mouse button),
and any aliases thereof.
</p>
<h4 id="indeterminate">
The indeterminate-value pseudo-class '':indeterminate''</h4>
<p>The <code>:indeterminate</code> pseudo-class applies
to UI elements whose value is in an indeterminate state.
For example, radio and checkbox elements
can be toggled between checked and unchecked states,
but are sometimes in an indeterminate state,
neither checked nor unchecked.
Similarly a progress meter can be in an indeterminate state
when the percent completion is unknown.
</p>
<p>Like the <code>:checked</code> pseudo-class,
<code>:indeterminate</code> applies to all media.
Components of a radio-group initialized with no pre-selected choice,
for example, would be <code>:indeterminate</code>
even in a static display.
</p>
<h4 class="no-num no-toc">New user interface state pseudo-classes</h4>
<p>In addition to the above-mentioned pseudo-classes, this specification introduces several new pseudo-classes to define additional user interface states.
</p>
<ul>
<li>:default</li>
<li>:valid</li>
<li>:invalid</li>
<li>:in-range</li>
<li>:out-of-range</li>
<li>:required</li>
<li>:optional</li>
<li>:read-only</li>
<li>:read-write</li>
</ul>
<p>Specifically, these new states (except for :default) are provided as a way to style elements which are in the respective states as defined by XForms [[XFORMS11]].</p>
<h4 id="pseudo-default">:default</h4>
<p>The :default selector applies to the one or more UI elements
that are the default among a set of similar elements.
This selector typically applies to context menu items,
buttons, and select lists/menus.
</p>
<p>
One example is the default submit button among a set of buttons. Another example is the default option from a popup menu. Multiple elements in a select-many group could have multiple :default elements, like a selection of pizza toppings for example.
</p>
<h4 id="pseudo-validity"><span id="pseudo-valid">:valid</span>
and <span id="pseudo-invalid">:invalid</span></h4>
<p>An element is :valid or :invalid when it is,
respectively, valid or invalid with respect to data validity semantics
defined by a different specification (e.g. [[XFORMS11]]).
An element which lacks data validity semantics is neither :valid nor :invalid. This is different from an element which otherwise has no constraints. Such an element would always be :valid.
</p>
<h4 id="pseudo-range"><span id="pseudo-in-range">:in-range</span> and <span id="pseudo-out-of-range">:out-of-range</span></h4>
<p>
The :in-range and :out-of-range pseudo-classes apply only to elements that have range limitations. An element is :in-range or :out-of-range when the value that the element is bound to is in range or out of range of the presentation (e.g. visual or spoken representation) of the element respectively. An element that lacks data range limits or is not a form control is neither :in-range nor
:out-of-range. E.g. a slider element with a value of 11 presented as a slider control that only represents the values from 1-10 is :out-of-range. Another example is a menu element with a value of "E" that happens to be presented as a popup menu that only has choices "A", "B" and "C".
</p>
<h4 id="pseudo-required-value"><span id="pseudo-required">:required</span>
and <span id="pseudo-optional">:optional</span></h4>
<p>A form element is :required or :optional if a value for it
is, respectively, required or optional before the form it belongs to is submitted. Elements that are not form elements are neither required nor optional.
</p>
<h4 id="pseudo-ro-rw"><span id="pseudo-read-only">:read-only</span>
and <span id="pseudo-read-write">:read-write</span></h4>
<p>An element whose contents are not user-alterable is :read-only.
However, elements whose contents are user-alterable (such as text input fields) are considered to be in a :read-write state. In typical documents,
most elements are :read-only. However it may be possible (e.g. in the context of an editor) for any element to become :read-write.</p>
<h3 id="pseudo-elements">User interface element fragments: pseudo-elements</h3>
<p>
In addition to the above-mentioned pseudo-element,
this specification introduces four new pseudo-elements
to provide access to additional user interface element fragments.
</p>
<ul><li>::value</li>
<li>::choices</li>
<li>::repeat-item</li>
<li>::repeat-index</li>
</ul>
<p>Specifically, these new pseudo-elements are provided
as a way to style user interface fragments
as defined by XForms [[XFORMS11]].</p>
<p class="note">
Note: The ::value, ::choices, ::repeat-item, and ::repeat-index
pseudo-elements are all at risk.
</p>
<h4 id="pseudo-value">::value</h4>
<p>A form element may contain both a label for its data value,
and the data value itself. For such elements, the ::value pseudo-element
selects the representation of just the data value itself, in order to
style its appearance.
</p>
<div class="example"><p style="display:none">Example(s):</p>
<h4 class="no-num no-toc">fictional markup and illustration</h4>
<p>
Here is an example which illustrates the ::value of a text input field with fictional markup which is then styled with CSS.
</p>
<h5 class="no-num no-toc">sample XForms fragment with fictional markup:</h5>
<pre><code>
<input>
<label>Zip code<label>
<em><input::value/></em>
</input>
</code></pre>
<h5 class="no-num no-toc">sample CSS:</h5>
<pre><code class="css">
input { border:dashed }
label { border:dotted }
input::value { border:solid }
</code></pre>
<h5 class="no-num no-toc">an HTML+CSS approximation of this example</h5>
<p>
<span style="border:dashed;display:inline-block;padding:10px">
<label
style="border:dotted;display:inline-block;padding:2px;margin:0;font-size:1em"
>Zip code</label>
<input type="text"
style="border:solid;display:inline-block;padding:2px;margin:0;font-size:1em"
value="94117">
</span>
</p>
<p>Spacing (in the form of padding) has been added to the above approximation to separate the borders and make the individual (pseudo-)elements easier to distinguish.
</p>
</div>
<p>The ::value pseudo-element is similar to an inline-level element, but with certain restrictions.
The following properties apply to <code>::value</code>
pseudo-element: font properties, color property, background properties,
'word-spacing', 'letter-spacing', 'text-decoration', 'vertical-align',
'text-transform', 'line-height'. UAs may apply other properties as well.
</p>
<h4 id="pseudo-choices">::choices</h4>
<p>Similarly, a form element which represents a list of options may contain
both a label for the list, and the list of choices itself. For such elements, the ::choices pseudo-element selects the representation of just the list of choices themselves, in order to style their appearance.
</p>
<p>A list of radio buttons can also be selected with the ::choices pseudo-element, and the currently chosen radio button can be selected with the ::value pseudo-element.</p>
<h4 id="pseudo-repeat-item">::repeat-item</h4>
<p>
The ::repeat-item pseudo-element represents a single item from a repeating sequence. It is generated as a parent to all the elements in a single repeating item. Each ::repeat-item is associated with a particular instance data node, and is affected by the model item properties (e.g. '<code>relevant</code>') found there, as the related style properties will cascade to the child elements.
</p>
<h4 id="pseudo-repeat-index">::repeat-index</h4>
<p>
The ::repeat-index pseudo-element represents the current item of a repeating sequence. It takes the place of the ::repeat-item as a parent of all the elements in the index repeating item.
</p>
<div class="note"><p>
<em><strong>Note.</strong>
Any style declarations that an author wants to apply to all repeat items, including the index, must be done so by using both ::repeat-item and ::repeat-index selectors. Styles that are only applied to ::repeat-item will not automatically be applied to the respective ::repeat-index.
</em></p>
</div>
<div class="example"><p style="display:none">Example(s):</p>
<h4 class="no-num no-toc">::repeat-item and ::repeat-index fictional markup</h4>
<p>
Here is an example that illustrates both ::repeat-item and ::repeat-index, since they are often both available and used at the same time. Assume appropriate namespace declarations were made in a header somewhere preceding the code in the example.
</p>
<p>The following markup snippet uses XHTML and XForms:</p>
<pre><code lang="x-xhtml">
<html:table xforms:repeat-nodeset="...">
<html:tr>
<html:td><xforms:input ref="..."/><xforms:input ref="..."/></html:td>
</html:tr>
</html:table>
</code></pre>
<p>
The following style rules are used to style all the repeated items and the current repeated item.
</p>
<pre><code class="css" lang="x-css">
html|tr::repeat-item { outline: medium solid; color:gray }
html|tr::repeat-index { outline: medium dashed; color:black }
</code></pre>
<p>
The following fictional markup shows the state of the above markup when through user interaction the XForm contains three of the repeated items, where the third item is current.
</p>
<pre><code lang="x-xhtml">
<html:table xforms:repeat-nodeset="...">
<em><html:tr::repeat-item></em>
<html:tr>
<html:td><xforms:input ref="..."/><xforms:input ref="..."/></html:td>
</html:tr>
<em></html:tr::repeat-item></em>
<em><html:tr::repeat-item></em>
<html:tr>
<html:td><xforms:input ref="..."/><xforms:input ref="..."/></html:td>
</html:tr>
<em></html:tr::repeat-item></em>
<em><html:tr::repeat-index></em>
<html:tr>
<html:td><xforms:input ref="..."/><xforms:input ref="..."/></html:td>
</html:tr>
<em></html:tr::repeat-index></em>
</html:table>
</code></pre>
</div>
<div class="note"><p>
<em><strong>Note.</strong>
The ::repeat-index pseudo-element takes the place of the ::repeat-item rather than being nested inside as a separate element. Thus just like :link or :visited are mutually exclusive for selecting hyperlinks, only one will exist and apply to a particular repeated item at any point.</em></p>
</div>
<h2>Element icons</h2>
<h3><span class="property">'content'</span> property addition</h3>
<table class="propdef"><tbody>
<tr><th>Name:</th><td><dfn>content</dfn></td></tr>
<tr><th>New Value(s):</th><td title="">icon</td></tr>
<tr><th>Initial:</th><td>same as CSS 2.1</td></tr>
<tr><th>Applies to:</th><td>same as CSS 2.1</td></tr>
<tr><th>Inherited:</th><td>same as CSS 2.1</td></tr>
<tr><th>Percentages:</th><td>same as CSS 2.1</td></tr>
<tr><th>Media:</th><td>same as CSS 2.1</td></tr>
<tr><th>Computed value:</th><td>the keyword '<span class="value" title="">icon</span>' if specified as such, otherwise same as CSS 2.1</td></tr>
<tr><th>Animatable:</th><td>no</td></tr>
</tbody></table>
<dl>
<dt>icon</dt>
<dd>The (pseudo-)element is replaced in its entirety by the resource referenced by its <span class="property">'icon'</span> property, and treated as a replaced element.
</dd>
</dl>
<p class="note"><em><strong>Note.</strong>
It is expected that the next draft of the CSS3 Generated Content module [[CSS3GENCON]] will include and superset this functionality.
</em></p>
<p class="note">
Note: The 'icon' value is at risk.
</p>
<h3><span class="property">'icon'</span> property</h3>
<table class="propdef"><tbody>
<tr><th>Name:</th><td><dfn>icon</dfn></td></tr>
<tr><th>Value:</th><td>auto | <uri> [, <uri>]* | inherit</td></tr>
<tr><th>Initial:</th><td>auto</td></tr>
<tr><th>Applies to:</th><td>all elements</td></tr>
<tr><th>Inherited:</th><td>no</td></tr>
<tr><th>Percentages:</th><td>N/A</td></tr>
<tr><th>Media:</th><td>all</td></tr>
<tr><th>Computed value:</th><td>as specified, except with any relative URLs converted to absolute</td></tr>
<tr><th>Animatable:</th><td>no</td></tr>
</tbody></table>
<dl>
<dt>auto</dt>
<dd>Use a default generic icon provided by the user agent.</dd>
<dt><uri></dt>
<dd>URIs (see [[!URI]], [[!RFC1738]] and [[!RFC1808]]) provide a way of identifying resources. The <uri> value(s) in this property refer to one or more icons in a comma delimited list. The user agent loads the referenced icons one by one until it finds one that it is able to render. This permits the usage of multiple different icon formats for various platforms, and various media for that matter.</dd>
</dl>
<p>The <span class="property">'icon'</span> property provides the author the ability to style any arbitrary element with an iconic equivalent. An element's icon is not used/rendered unless the <span class="property">'content'</span> property is set to the value '<span class="value" title="">icon</span>' (see above). Documents whose elements have icons assigned to them can be more easily viewed by users who find too much text distracting.
</p>
<div class="example"><p style="display:none">Example(s):</p>
<h4 class="no-num no-toc">Representing elements with icons</h4>
<p>This example uses the above icon features to display icons in place of images and objects.</p>
<pre><code class="css">
img,object { content:icon }
/* note that the CSS3 Generated Content module [[CSS3GENCON]]
expands the <span class="property">'content'</span> property to apply to all elements. */
img { icon:url(imgicon.png); }
/* provide a custom icon for images */
object { icon:url(objicon.png); }
/* provide a different custom icon for objects */
</code></pre>
</div>
<p class="note">
Note: The 'icon' property is at risk.
</p>
<h2>Box Model addition</h2>
<h3 id="box-sizing"><span class="property">'box-sizing'</span> property</h3>
<table class="propdef"><tbody>
<tr><th>Name:</th><td><dfn>box-sizing</dfn></td></tr>
<tr><th>Value:</th><td>
content-box |
padding-box |
border-box |
inherit</td></tr>
<tr><th>Initial:</th><td>content-box</td></tr>
<tr><th>Applies to:</th><td>all elements that accept width or height</td></tr>
<tr><th>Inherited:</th><td>no</td></tr>
<tr><th>Percentages:</th><td>N/A</td></tr>
<tr><th>Media:</th><td>visual</td></tr>
<tr><th>Computed value:</th><td>specified value</td></tr>
<tr><th>Animatable:</th><td>no</td></tr>
</tbody></table>
<dl>
<dt>content-box</dt>
<dd>This is the behavior of width and height as specified by CSS2.1.
The specified width and height (and respective min/max properties) apply to the width and height respectively of the content box of the element. The padding
and border of the element are laid out and drawn outside the
specified width and height.</dd>
<dt>padding-box</dt>
<dd>
The specified width and height (and respective min/max properties)
on this element determine the padding box of the element.
That is, any padding specified on the element is laid out and
drawn inside this specified width and height.
The content width and height are calculated by
subtracting the padding widths of the respective sides
from the specified <span class="property">'width'</span> and
<span class="property">'height'</span> properties.
As the content width and height
<a href="http://www.w3.org/TR/CSS21/visudet.html#the-width-property">
cannot be negative</a> ([[!CSS21]], section 10.2),
this computation is floored at 0.
</dd>
<dt>border-box</dt>
<dd>The specified width and height (and respective min/max properties) on this element determine the border box of the element. That is, any padding or border
specified on the element is laid out and drawn inside this specified
width and height. The content width and height are calculated by
subtracting the border and padding widths of the respective sides
from the specified <span class="property">'width'</span> and <span class="property">'height'</span> properties. As the content width and height <a href="http://www.w3.org/TR/CSS21/visudet.html#the-width-property">cannot be negative</a> ([[!CSS21]], section 10.2), this computation is floored at 0.
<p class="note"><em><strong>Note.</strong>
This is the behavior of width and height as commonly implemented by legacy HTML user agents for replaced elements and input elements.</em>
</p>
</dd>
</dl>
<div class="example"><p style="display:none">Example(s):</p>
<h4 class="no-num no-toc">Using box-sizing to evenly share space</h4>
<p>This example uses box-sizing to evenly horizontally split two divs with fixed size borders inside a div container, which would otherwise require additional markup.
</p>
<h5 class="no-num no-toc">sample CSS:</h5>
<pre><code class="css">
div.container {
width:38em;
border:1em solid black;
}
div.split {
box-sizing:border-box;
width:50%;
border:1em silver ridge;
float:left;
}
</code></pre>
<h5 class="no-num no-toc">sample HTML fragment:</h5>
<pre><code>
<div class="container">
<div class="split">This div occupies the left half.</div>
<div class="split">This div occupies the right half.</div>
</div>
</code></pre>
<h5 class="no-num no-toc">demonstration of sample CSS and HTML:</h5>
<div style="width:38em; border:1em solid black"><div style="box-sizing:border-box; width:50%; border:1em silver ridge; float:left">This div should occupy the left half.</div><div style="box-sizing:border-box; width:50%; border:1em silver ridge; float:left">This div should occupy the right half.</div>The two divs above should appear side by side, each (including borders) 50% of the content width of their container. If instead they are stacked one on top of the other then your browser does not support <span class="property">'box-sizing'</span>.
</div>
</div>
<p class="note">
Note: The 'padding-box' value is at risk.
</p>
<h2>Outline properties</h2>
<p>At times, style sheet authors may want to create outlines around
visual objects such as buttons, active form fields, image maps, etc.,
to make them stand out. Outlines differ from borders in the following
ways:</p>
<ol>
<li>Outlines do not take up space. </li>
<li>Outlines may be non-rectangular. </li>
</ol>
<p>The outline properties control the style of these dynamic outlines.
</p>
<h3 id="outline"><span class="property">'outline'</span> property</h3>
<table class="propdef" id="propdef-outline"><tbody>
<tr><th>Name:</th><td><dfn>outline</dfn></td></tr>
<tr><th>Value:</th><td>
[ <span class=property><'outline-color'></span> || <span class=property><'outline-style'></span> ||
<span class=property><'outline-width'></span> ] |
inherit
</td></tr>
<tr><th>Initial:</th><td>see individual properties</td></tr>
<tr><th>Applies to:</th><td>all elements</td></tr>
<tr><th>Inherited:</th><td>no</td></tr>
<tr><th>Percentages:</th><td>N/A</td></tr>
<tr><th>Media:</th><td>visual</td></tr>
<tr><th>Computed value:</th><td>see individual properties</td></tr>
<tr><th>Animatable:</th><td>see individual properties</td></tr>
</tbody></table>
<h3 id="outline-width"><span class="property">'outline-width'</span> property</h3>
<table class="propdef" id="propdef-outline-width"><tbody>
<tr><th>Name:</th><td><dfn>outline-width</dfn></td></tr>
<tr><th>Value:</th><td><a href="http://www.w3.org/TR/CSS21/box.html#value-def-border-width" class="noxref"><span class="value-inst-border-width"><border-width></span></a> | inherit</td></tr>
<tr><th>Initial:</th><td>medium</td></tr>
<tr><th>Applies to:</th><td>all elements</td></tr>
<tr><th>Inherited:</th><td>no</td></tr>
<tr><th>Percentages:</th><td>N/A</td></tr>
<tr><th>Media:</th><td>visual</td></tr>
<tr><th>Computed value:</th><td>absolute length; '0' if the outline style is 'none'.</td></tr>
<tr><th>Animatable:</th><td>as <a href="http://dev.w3.org/csswg/css3-transitions/#animtype-length">length</a></td></tr>
</tbody></table>
<h3 id="outline-style"><span class="property">'outline-style'</span> property</h3>
<table class="propdef" id="propdef-outline-style"><tbody>
<tr><th>Name:</th><td><dfn>outline-style</dfn></td></tr>
<tr><th>Value:</th><td>auto | <a href="http://www.w3.org/TR/CSS21/box.html#value-def-border-style" class="noxref"><span class="value-inst-border-style"><border-style></span></a> | inherit</td></tr>
<tr><th>Initial:</th><td>none</td></tr>
<tr><th>Applies to:</th><td>all elements</td></tr>
<tr><th>Inherited:</th><td>no</td></tr>
<tr><th>Percentages:</th><td>N/A</td></tr>
<tr><th>Media:</th><td>visual</td></tr>
<tr><th>Computed value:</th><td>specified value</td></tr>
<tr><th>Animatable:</th><td>no</td></tr>
</tbody></table>
<h3 id="outline-color"><span class="property">'outline-color'</span> property</h3>
<table class="propdef" id="propdef-outline-color"><tbody>
<tr><th>Name:</th><td><dfn>outline-color</dfn></td></tr>
<tr><th>Value:</th><td><a href="http://www.w3.org/TR/css3-color/#colorunits" class="noxref"><span class="value-inst-color"><color></span></a> | invert | inherit</td></tr>
<tr><th>Initial:</th><td>invert</td></tr>
<tr><th>Applies to:</th><td>all elements</td></tr>
<tr><th>Inherited:</th><td>no</td></tr>
<tr><th>Percentages:</th><td>N/A</td></tr>
<tr><th>Media:</th><td>visual</td></tr>
<tr><th>Computed value:</th><td>The computed value for '<span class="value">invert</span>' is '<span class="value">invert</span>'. For <color> values, the computed value is as defined for the [[!CSS3COLOR]] <span class="property">'color'</span> property.</td></tr>
<tr><th>Animatable:</th><td>as <a href="http://dev.w3.org/csswg/css3-transitions/#animtype-color">color</a></td></tr>
</tbody></table>
<p>The outline created with the outline properties is drawn "over" a
box, i.e., the outline is always on top, and doesn't influence the
position or size of the box, or of any other boxes. Therefore,
displaying or suppressing outlines does not cause reflow.
</p>
<p>Outlines may be non-rectangular.
For example, if the element is broken across several lines, the
outline should be an outline or minimum set of outlines that encloses all
the element's boxes. Each part of the outline should be fully connected
rather than open on some sides (as borders on inline elements are when
lines are broken). The parts of the outline are not required to be
rectangular. The position of the outline may be affected by
descendant boxes. User agents should use an algorithm for determining
the outline that encloses a region appropriate for conveying the
concept of focus to the user.
</p>
<p>The <span class=property>'outline-width'</span> property accepts
the same values as <a href="http://www.w3.org/TR/CSS21/box.html#propdef-border-width" class="noxref"><span
class="propinst-border-width">'border-width'</span></a> ([[!CSS21]], section 8.5.1).
</p>
<p>The <span class=property>'outline-style'</span> property accepts
the same values as
<a href="http://www.w3.org/TR/CSS21/box.html#propdef-border-style"
class="noxref"
><span class="propinst-border-style"
>'border-style'</span></a>
([[!CSS21]], section 8.5.3), except that
'<span class="value">hidden</span>' is not a legal outline style.
In addition, in CSS3,
<span class=property>'outline-style'</span>
accepts the value '<span class="value">auto</span>'.
The '<span class="value">auto</span>' value permits the user agent
to render a custom outline style,
typically a style which is either a user interface default
for the platform, or perhaps a style that is richer
than can be described in detail in CSS,
e.g. a rounded edge outline with semi-translucent outer pixels
that appears to glow.
As such, this specification does not define how the
<span class="property">'outline-color'</span>
is incorporated or used (if at all) when rendering
'<span class="value">auto</span>' style outlines.
User agents may treat '<span class="value">auto</span>' as
'<span class="value">solid</span>'.
</p>
<p>The <span class="property">'outline-color'</span> property
accepts all colors, as well as the keyword '<dfn>invert</dfn>'. 'Invert' is expected to perform a color inversion on the pixels on the screen. This is a
common trick to ensure the focus border is visible, regardless of
color background.
</p>
<p>
Conformant UAs may ignore the '<span class="value">invert</span>' value on platforms that do not support color inversion of the pixels on the screen. If the UA does not support the '<span class="value">invert</span>' value then the initial value of the <span class="property">'outline-color'</span>
property is the '<span class="value">currentColor</span>' [[!CSS3COLOR]] keyword.
</p>