-
Notifications
You must be signed in to change notification settings - Fork 708
/
Copy pathOverview.html
1116 lines (1110 loc) · 96.9 KB
/
Overview.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
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 content="text/html; charset=utf-8" http-equiv="Content-Type">
<title>CSS Pseudo-Elements Module Level 4</title>
<meta content="exploring" name="csswg-work-status">
<meta content="WD" name="w3c-status">
<link href="../default.css" rel="stylesheet" type="text/css">
<link href="../csslogo.ico" rel="shortcut icon" type="image/x-icon">
<link href="https://www.w3.org/StyleSheets/TR/W3C-WD" rel="stylesheet" type="text/css">
<meta content="Bikeshed 1.0.0" name="generator">
</head>
<body class="h-entry">
<div class="head">
<p data-fill-with="logo"><a class="logo" href="http://www.w3.org/"> <img alt="W3C" height="48" src="https://www.w3.org/Icons/w3c_home" width="72"> </a></p>
<h1 class="p-name no-ref" id="title">CSS Pseudo-Elements Module Level 4</h1>
<h2 class="no-num no-toc no-ref heading settled" id="subtitle"><span class="content">W3C First Public Working Draft, <time class="dt-updated" datetime="2015-01-15">15 January 2015</time></span></h2>
<div data-fill-with="spec-metadata">
<dl>
<dt>This version:
<dd><a class="u-url" href="http://www.w3.org/TR/2015/WD-css-pseudo-4-20150115/">http://www.w3.org/TR/2015/WD-css-pseudo-4-20150115/</a>
<dt>Latest version:
<dd><a href="http://www.w3.org/TR/css-pseudo-4/">http://www.w3.org/TR/css-pseudo-4/</a>
<dt>Editor's Draft:
<dd><a href="http://dev.w3.org/csswg/css-pseudo-4/">http://dev.w3.org/csswg/css-pseudo-4/</a>
<dt>Feedback:
<dd><span><a href="mailto:www-style@w3.org?subject=%5Bcss-pseudo%5D%20YOUR%20TOPIC%20HERE">www-style@w3.org</a> with subject line “<kbd>[css-pseudo] <var>… message topic …</var></kbd>” (<a href="http://lists.w3.org/Archives/Public/www-style/" rel="discussion">archives</a>)</span>
<dt>Issue Tracking:
<dd><a href="https://github.com/w3c/csswg-drafts/issues/">GitHub</a>
<dd><a href="#issues-index">Inline In Spec</a>
<dt class="editor">Editors:
<dd class="editor p-author h-card vcard"><span class="p-name fn">Daniel Glazman</span> (<span class="p-org org">Disruptive Innovations</span>)
<dd class="editor p-author h-card vcard"><a class="p-name fn u-url url" href="http://fantasai.inkedblade.net/contact">fantasai</a> (<span class="p-org org">Invited Expert</span>)
<dd class="editor p-author h-card vcard"><a class="p-name fn u-email email" href="mailto:stearns@adobe.com">Alan Stearns</a> (<span class="p-org org">Adobe Systems Inc.</span>)
<dt>Issues List:
<dd><span><a href="http://dev.w3.org/csswg/css-pseudo/#issues-index">Tracked in Editor’s Draft</a></span>
</dl>
</div>
<div data-fill-with="warning"></div>
<p class="copyright" data-fill-with="copyright"><a href="http://www.w3.org/Consortium/Legal/ipr-notice#Copyright">Copyright</a> © 2015 <a href="http://www.w3.org/"><abbr title="World Wide Web Consortium">W3C</abbr></a><sup>®</sup> (<a href="http://www.csail.mit.edu/"><abbr title="Massachusetts Institute of Technology">MIT</abbr></a>, <a href="http://www.ercim.eu/"><abbr title="European Research Consortium for Informatics and Mathematics">ERCIM</abbr></a>, <a href="http://www.keio.ac.jp/">Keio</a>, <a href="http://ev.buaa.edu.cn/">Beihang</a>). 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>
<hr title="Separator for header">
</div>
<h2 class="no-num no-toc no-ref heading settled" id="abstract"><span class="content">Abstract</span></h2>
<div class="p-summary" data-fill-with="abstract">
<p>This CSS module defines pseudo-elements, abstract elements that represent portions of the CSS render tree that can be selected and styled.</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.
</div>
<h2 class="no-num no-toc no-ref heading settled" id="status"><span class="content">Status of this document</span></h2>
<div data-fill-with="status">
<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>
<p>This document is a <b>First Public Working Draft</b>. </p>
<p>Publication as a First Public 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>
<p>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> (see <a href="http://www.w3.org/Mail/Request">instructions</a>) is preferred
for discussion of this specification. When sending e-mail, please put the
text “css-pseudo” in the subject, preferably like this:
“[css-pseudo] <em>…summary of comment…</em>” </p>
<p>This document was produced by the <a href="http://www.w3.org/Style/CSS/members">CSS Working Group</a> (part of
the <a href="http://www.w3.org/Style/">Style Activity</a>). </p>
<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>
<p>This document is governed by the <a href="http://www.w3.org/2014/Process-20140801/" id="w3c_process_revision">1 August 2014 W3C Process Document</a>. </p>
<p></p>
</div>
<div data-fill-with="at-risk"></div>
<h2 class="no-num no-toc no-ref heading settled" id="contents"><span class="content">Table of Contents</span></h2>
<div data-fill-with="table-of-contents" role="navigation">
<ul class="toc" role="directory">
<li><a href="#intro"><span class="secno">1</span> <span class="content">Introduction</span></a>
<li>
<a href="#typographic-pseudos"><span class="secno">2</span> <span class="content"> Typographic Pseudo-elements</span></a>
<ul class="toc">
<li>
<a href="#first-line-pseudo"><span class="secno">2.1</span> <span class="content"> The ::first-line pseudo-element</span></a>
<ul class="toc">
<li><a href="#first-text-line"><span class="secno">2.1.1</span> <span class="content"> Finding the First Formatted Line</span></a>
<li><a href="#first-line-styling"><span class="secno">2.1.2</span> <span class="content"> Styling the First Line Pseudo-element</span></a>
<li><a href="#first-line-inheritance"><span class="secno">2.1.3</span> <span class="content"> Inheritance and the <span class="css">::first-line</span> Pseudo-element</span></a>
</ul>
<li>
<a href="#first-letter-pseudo"><span class="secno">2.2</span> <span class="content"> The ::first-letter pseudo-element</span></a>
<ul class="toc">
<li><a href="#application-in-css"><span class="secno">2.2.1</span> <span class="content"> Finding the First Letter</span></a>
<li><a href="#first-letter-styling"><span class="secno">2.2.2</span> <span class="content"> Styling the <span class="css">::first-letter</span> Pseudo-element</span></a>
</ul>
</ul>
<li>
<a href="#highlight-pseudos"><span class="secno">3</span> <span class="content"> Highlight Pseudo-elements</span></a>
<ul class="toc">
<li><a href="#highlight-selectors"><span class="secno">3.1</span> <span class="content"> Selecting Highlighted Content: the <span class="css">::selection</span>, <span class="css">::spelling-error</span>, and <span class="css">::grammar-error</span> pseudo-elements</span></a>
<li><a href="#highlight-styling"><span class="secno">3.2</span> <span class="content"> Styling Highlights</span></a>
<li><a href="#highlight-bounds"><span class="secno">3.3</span> <span class="content"> Area of a Highlight</span></a>
<li><a href="#highlight-cascade"><span class="secno">3.4</span> <span class="content"> Cascading and Per-Element Highlight Styles</span></a>
<li><a href="#highlight-painting"><span class="secno">3.5</span> <span class="content"> Painting the Highlight</span></a>
<li><a href="#highlight-security"><span class="secno">3.6</span> <span class="content"> Security Considerations</span></a>
</ul>
<li>
<a href="#treelike"><span class="secno">4</span> <span class="content"> Tree-Abiding Pseudo-elements</span></a>
<ul class="toc">
<li><a href="#generated-content"><span class="secno">4.1</span> <span class="content"> Generated Content Pseudo-elements: <span class="css">::before</span> and <span class="css">::after</span></span></a>
<li><a href="#marker-pseudo"><span class="secno">4.2</span> <span class="content"> List Markers: the <span class="css">::marker</span> pseudo-element</span></a>
<li><a href="#placeholder-pseudo"><span class="secno">4.3</span> <span class="content"> Placeholder Input: the <span class="css">::placeholder</span> pseudo-element</span></a>
</ul>
<li><a href="#interactions"><span class="secno">5</span> <span class="content"> Overlapping Pseudo-element Interactions</span></a>
<li>
<a href="#cssom"><span class="secno">6</span> <span class="content"> Additions to the CSS Object Model</span></a>
<ul class="toc">
<li><a href="#CSSPseudoElement-interface"><span class="secno">6.1</span> <span class="content"> Interface CSSPseudoElement</span></a>
<li><a href="#CSSPseudoElementList-interface"><span class="secno">6.2</span> <span class="content"> Interface CSSPseudoElementList</span></a>
<li><a href="#window-interface"><span class="secno">6.3</span> <span class="content"> Addition to the <code>window</code> interface</span></a>
</ul>
<li><a href="#acknowledgements"><span class="secno"></span> <span class="content"> Acknowledgements</span></a>
<li>
<a href="#conformance"><span class="secno"></span> <span class="content"> Conformance</span></a>
<ul class="toc">
<li><a href="#conventions"><span class="secno"></span> <span class="content"> Document conventions</span></a>
<li><a href="#conformance-classes"><span class="secno"></span> <span class="content"> Conformance classes</span></a>
<li><a href="#partial"><span class="secno"></span> <span class="content"> Partial implementations</span></a>
<li><a href="#experimental"><span class="secno"></span> <span class="content"> Experimental implementations</span></a>
<li><a href="#testing"><span class="secno"></span> <span class="content"> Non-experimental implementations</span></a>
</ul>
<li>
<a href="#index"><span class="secno"></span> <span class="content">Index</span></a>
<ul class="toc">
<li><a href="#index-defined-here"><span class="secno"></span> <span class="content">Terms defined by this specification</span></a>
<li><a href="#index-defined-elsewhere"><span class="secno"></span> <span class="content">Terms defined by reference</span></a>
</ul>
<li>
<a href="#references"><span class="secno"></span> <span class="content">References</span></a>
<ul class="toc">
<li><a href="#normative"><span class="secno"></span> <span class="content">Normative References</span></a>
<li><a href="#informative"><span class="secno"></span> <span class="content">Informative References</span></a>
</ul>
<li><a href="#idl-index"><span class="secno"></span> <span class="content">IDL Index</span></a>
<li><a href="#issues-index"><span class="secno"></span> <span class="content">Issues Index</span></a>
</ul>
</div>
<main>
<h2 class="heading settled" data-level="1" id="intro"><span class="secno">1. </span><span class="content">Introduction</span><a class="self-link" href="#intro"></a></h2>
<p><em>This section is informative.</em></p>
<p><i>Pseudo-elements</i> represent abstract elements of the document
beyond those elements explicitly created by the document language.
Since they are not restricted to fitting into the document tree,
the can be used the select and style portions of the document
that do not necessarily map to the document’s tree structure.
For instance, the <a class="css" data-link-type="maybe" href="#selectordef-first-line">::first-line</a> pseudo-element can
select content on the first formatted line of an element <em>after</em> text wrapping,
allowing just that line to be styled differently
from the rest of the paragraph.</p>
<p>Each pseudo-element is associated with an <i>originating element</i> and has syntax of the form <span class="css">::name-of-pseudo</span>.
This module defines the pseudo-elements that exist in CSS
and how they can be styled.
For more information on pseudo-elements in general,
and on their syntax and interaction with other <i>selectors</i>,
see <a data-link-type="biblio" href="#biblio-selectors4">[SELECTORS4]</a>.</p>
<h2 class="heading settled" data-level="2" id="typographic-pseudos"><span class="secno">2. </span><span class="content"> Typographic Pseudo-elements</span><a class="self-link" href="#typographic-pseudos"></a></h2>
<h3 class="heading settled" data-level="2.1" id="first-line-pseudo"><span class="secno">2.1. </span><span class="content"> The ::first-line pseudo-element</span><a class="self-link" href="#first-line-pseudo"></a></h3>
<p>The <dfn class="css" data-dfn-type="selector" data-export="" id="selectordef-first-line">::first-line<a class="self-link" href="#selectordef-first-line"></a></dfn> pseudo-element describes the contents of
the <i>first formatted line</i> of its <i>originating element</i>.</p>
<div class="example" id="example-209e7dc9">
<a class="self-link" href="#example-209e7dc9"></a> The rule below means
“change the letters of the first line of every <code>p</code> element to uppercase”:
<pre>p::first-line { text-transform: uppercase }</pre>
<p>The selector <span class="css">p::first-line</span> does not match any real document element.
It does match a pseudo-element that conforming user agents
will insert at the beginning of every <code>p</code> element.</p>
</div>
<p class="note" role="note">Note: Note that the length of the first line depends on a number of factors,
including the width of the page, the font size, etc.</p>
<div class="example" id="example-a0a743c3">
<a class="self-link" href="#example-a0a743c3"></a> For example, given an ordinary HTML <a data-link-type="biblio" href="#biblio-html5">[HTML5]</a> paragraph such as:
<pre><P>This is a somewhat long HTML
paragraph that will be broken into several
lines. The first line will be identified
by a fictional tag sequence. The other lines
will be treated as ordinary lines in the
paragraph.</P>
</pre>
<p>The lines might be broken as follows:</p>
<pre>THIS IS A SOMEWHAT LONG HTML PARAGRAPH THAT
will be broken into several lines. The first
line will be identified by a fictional tag
sequence. The other lines will be treated as
ordinary lines in the paragraph.
</pre>
<p>This paragraph might be “rewritten” by user agents
to include a <dfn data-dfn-type="dfn" data-noexport="" id="fictional-tag-sequence">fictional tag sequence<a class="self-link" href="#fictional-tag-sequence"></a></dfn> to represent <a class="css" data-link-type="maybe" href="#selectordef-first-line">::first-line</a>.
This <i>fictional tag sequence</i> helps to show how properties are inherited.</p>
<pre><P><b><P::first-line></b> This is a somewhat long HTML
paragraph that <b></P::first-line></b> will be broken into several
lines. The first line will be identified
by a fictional tag sequence. The other lines
will be treated as ordinary lines in the
paragraph.</P>
</pre>
</div>
<p>If a pseudo-element breaks up a real element,
the desired effect can often be described by a <i>fictional tag sequence</i> that closes and then re-opens the element.</p>
<div class="example" id="example-bac4a557">
<a class="self-link" href="#example-bac4a557"></a> Thus, if we mark up the previous paragraph with a <code>span</code> element encompassing the first sentence:
<pre><P><b><SPAN class="test"></b> This is a somewhat long HTML
paragraph that will be broken into several
lines.<b></SPAN></b> The first line will be identified
by a fictional tag sequence. The other lines
will be treated as ordinary lines in the
paragraph.</P>
</pre>
<p>the user agent could simulate start and end tags for <code>span</code> when inserting the <i>fictional tag sequence</i> for <a class="css" data-link-type="maybe" href="#selectordef-first-line">::first-line</a> to get the correct inheritance behavior.</p>
<pre><P><P::first-line><b><SPAN class="test"></b> This is a somewhat long HTML
paragraph that will <b></SPAN></b></P::first-line><b><SPAN class="test"></b> be broken into several
lines.<b></SPAN></b> The first line will be identified
by a fictional tag sequence. The other lines
will be treated as ordinary lines in the
paragraph.</P>
</pre>
</div>
<h4 class="heading settled" data-level="2.1.1" id="first-text-line"><span class="secno">2.1.1. </span><span class="content"> Finding the First Formatted Line</span><a class="self-link" href="#first-text-line"></a></h4>
<p>In CSS, the <a class="css" data-link-type="maybe" href="#selectordef-first-line">::first-line</a> pseudo-element
can only have an effect when attached to a <i>block container</i>.
The <dfn data-dfn-type="dfn" data-export="" id="first-formatted-line">first formatted line<a class="self-link" href="#first-formatted-line"></a></dfn> of an element
must occur inside a block-level descendant in the same flow
(i.e., a block-level descendant that is not out-of-flow due to floating or positioning).</p>
<div class="example" id="example-7018f958"><a class="self-link" href="#example-7018f958"></a> For example, the first line of the <code>DIV</code> in <code><DIV><P>This line...</P></DIV></code> is the first line of the <code>P</code> (assuming that both <code>P</code> and <code>DIV</code> are blocks). </div>
<p>The first line of a table-cell or inline-block
cannot be the first formatted line of an ancestor element.
Thus, in <code><DIV><P STYLE="display: inline-block">Hello<BR>Goodbye</P> etcetera</DIV></code> the first formatted line of the <code>DIV</code> is not the line "Hello".</p>
<p class="note" role="note">Note: Note that the first line of the <code>p</code> in this fragment: <code><p><br>First...</code> doesn’t contain any letters (assuming the default style for <code>br</code>).
The word "First" is not on the first formatted line.</p>
<p>A user agent must act as if the fictional start tags of a <a class="css" data-link-type="maybe" href="#selectordef-first-line">::first-line</a> pseudo-element
were nested just inside the innermost enclosing block-level element.</p>
<div class="example" id="example-8dd21d66">
<a class="self-link" href="#example-8dd21d66"></a> For example, the <i>fictional tag sequence</i> for
<pre><DIV>
<P>First paragraph</P>
<P>Second paragraph</P>
</DIV>
</pre>
<p>is</p>
<pre><DIV>
<P><DIV::first-line><P::first-line>First paragraph</P::first-line></DIV::first-line></P>
<P><P::first-line>Second paragraph</P::first-line></P>
</DIV>
</pre>
</div>
<h4 class="heading settled" data-level="2.1.2" id="first-line-styling"><span class="secno">2.1.2. </span><span class="content"> Styling the First Line Pseudo-element</span><a class="self-link" href="#first-line-styling"></a></h4>
<p>The <a class="css" data-link-type="maybe" href="#selectordef-first-line">::first-line</a> pseudo-element’s generated box
behaves similar to that of an inline-level element, but with certain restrictions.
The following CSS properties apply to a <a class="css" data-link-type="maybe" href="#selectordef-first-line">::first-line</a> pseudo-element:</p>
<ul>
<li>all font properties (see <a data-link-type="biblio" href="#biblio-css3-fonts">[CSS3-FONTS]</a>)
<li>the <a class="property" data-link-type="propdesc" href="http://www.w3.org/TR/css3-color/#color0">color</a> and <a class="property" data-link-type="propdesc" href="https://drafts.csswg.org/css-color-4/#propdef-opacity">opacity</a> properties (see <a data-link-type="biblio" href="#biblio-css3color">[CSS3COLOR]</a>)
<li>all background properties (see <a data-link-type="biblio" href="#biblio-css3bg">[CSS3BG]</a>)
<li>any typesetting properties that apply to inline elements (see <a data-link-type="biblio" href="#biblio-css3text">[CSS3TEXT]</a>)
<li>all text decoration properties (see <a data-link-type="biblio" href="#biblio-css3-text-decor">[CSS3-TEXT-DECOR]</a>)
<li>any inline layout properties that apply to inline elements (see <a data-link-type="biblio" href="#biblio-css3line">[CSS3LINE]</a>)
<li>any other properties defined to apply to <a class="css" data-link-type="maybe" href="#selectordef-first-letter">::first-letter</a> by their respective specifications
</ul>
User agents may apply other properties as well.
<h4 class="heading settled" data-level="2.1.3" id="first-line-inheritance"><span class="secno">2.1.3. </span><span class="content"> Inheritance and the <a class="css" data-link-type="maybe" href="#selectordef-first-line">::first-line</a> Pseudo-element</span><a class="self-link" href="#first-line-inheritance"></a></h4>
<p>During CSS inheritance, the portion of a child element that occurs on the first line
only inherits properties applicable to the <a class="css" data-link-type="maybe" href="#selectordef-first-line">::first-line</a> pseudo-element
from the <a class="css" data-link-type="maybe" href="#selectordef-first-line">::first-line</a> pseudo-element.
For all other properties inheritence is
from the non-pseudo-element parent of the first line pseudo element.
(The portion of a child element that does not occur on the first line
always inherits from the parent of that child.)</p>
<h3 class="heading settled" data-level="2.2" id="first-letter-pseudo"><span class="secno">2.2. </span><span class="content"> The ::first-letter pseudo-element</span><a class="self-link" href="#first-letter-pseudo"></a></h3>
<p>The <dfn class="css" data-dfn-type="selector" data-export="" id="selectordef-first-letter">::first-letter<a class="self-link" href="#selectordef-first-letter"></a></dfn> pseudo-element represents
the first <i>typographic letter unit</i><a data-link-type="biblio" href="#biblio-css3text">[CSS3TEXT]</a> on the <i>first formatted line</i> of its <i>originating element</i>,
if it is not preceded by any other content
(such as images or inline tables) on its line.
The <a class="css" data-link-type="maybe" href="#selectordef-first-letter">::first-letter</a> pseudo-element can be used
to create “initial caps” and “drop caps”,
which are common typographic effects.</p>
<div class="example" id="example-e0bd2aa2">
<a class="self-link" href="#example-e0bd2aa2"></a> For example, the following rule creates a 2-line drop-letter
on every paragraph following a level-2 header,
using the <a class="property" data-link-type="propdesc">initial-letter</a> property defined in <a data-link-type="biblio" href="#biblio-css3line">[CSS3LINE]</a>:
<pre>h2 + p::first-letter { initial-letter: 2; }
</pre>
</div>
<p>Punctuation (i.e, characters that belong to the Punctuation (<code>P*</code>) <i>Unicode general category</i><a data-link-type="biblio" href="#biblio-uax44">[UAX44]</a>)
that precedes or follows the first <i>typographic letter unit</i> must also be included
in the <a class="css" data-link-type="maybe" href="#selectordef-first-letter">::first-letter</a> pseudo-element.</p>
<div class="figure"><img alt="Quotes that precede the first letter should be included." src="http://www.w3.org/TR/selectors/first-letter2.png"></div>
<p>As explained in <a data-link-type="biblio" href="#biblio-css3text">[CSS3TEXT]</a>,
a <i>typographic letter unit</i> can include more than one Unicode codepoint.
For example, combining characters must be kept with their base character.
Also, languages may have additional rules
about how to treat certain letter combinations.
In Dutch, for example, if the letter combination "ij" appears at the beginning of an element,
both letters should be considered within the <a class="css" data-link-type="maybe" href="#selectordef-first-letter">::first-letter</a> pseudo-element. <a data-link-type="biblio" href="#biblio-uax29">[UAX29]</a> The UA should tailor its definition of <i>typographic letter unit</i> to reflect the first-letter traditions of the <i>originating element</i>’s content language.</p>
<p class="issue" id="issue-703eb1d7"><a class="self-link" href="#issue-703eb1d7"></a> This is actually a problem in cases where the originating element is an ancestor
with a different content. What <em>should</em> we say here?</p>
<p class="note" role="note">Note: Note that the first <i>typographic letter unit</i> may in fact
be a digit, e.g., the “6” in “67 million dollars is a lot of money.”</p>
<p>If the characters that would form the <a class="css" data-link-type="maybe" href="#selectordef-first-letter">::first-letter</a> are not in the same element, such as "‘<code class="css">T" in <code><p>'<em>T...</code>,
the user agent may create a <a class="css" data-link-type="maybe" href="#selectordef-first-letter">::first-letter</a> pseudo-element
from one of the elements, both elements, or simply not create a pseudo-element.</code> Additionally, if the first letter(s) of the block
are not at the start of the line (for example due to bidirectional reordering),
then the user agent need not create the pseudo-element(s).</p>
<p>The <a class="css" data-link-type="maybe" href="#selectordef-first-letter">::first-letter</a> pseudo-element is contained within any <a class="css" data-link-type="maybe" href="#selectordef-first-line">::first-line</a> pseudo-elements, and thus inherits from <a class="css" data-link-type="maybe" href="#selectordef-first-line">::first-line</a>.</p>
<h4 class="heading settled" data-level="2.2.1" id="application-in-css"><span class="secno">2.2.1. </span><span class="content"> Finding the First Letter</span><a class="self-link" href="#application-in-css"></a></h4>
<p>The first letter must occur on the <i>first formatted line</i>.
For example, in this HTML fragment: <code><p><br>First...</code> the first line doesn’t contain any letters
and <a class="css" data-link-type="maybe" href="#selectordef-first-letter">::first-letter</a> doesn’t match anything.
In particular, it does not match the “F” of “First”.</p>
<p>In CSS, the <a class="css" data-link-type="maybe" href="#selectordef-first-letter">::first-letter</a> pseudo-element
only applies to block containers. <span class="note" role="note">A future version of this specification
may allow this pseudo-element to apply to more display types.</span> The <a class="css" data-link-type="maybe" href="#selectordef-first-letter">::first-letter</a> pseudo-element can be used
with all such elements that contain text,
or that have a descendant in the same flow that contains text.
A user agent should act as if the fictional start tag
of the ::first-letter pseudo-element
is just before the first text of the element,
even if that first text is in a descendant.</p>
<div class="example" id="example-7f507aaf">
<a class="self-link" href="#example-7f507aaf"></a> Example:
The <i>fictional tag sequence</i> for this HTML fragment:
<pre><div>
<p>The first text.
</pre>
<p>is:</p>
<pre><div>
<p><div::first-letter><p::first-letter>T</...></...>he first text.
</pre>
</div>
<p>In CSS the first letter of a table-cell or inline-block
cannot be the first letter of an ancestor element.
Thus, in <code><DIV><P STYLE="display: inline-block">Hello<BR>Goodbye</P> etcetera</DIV></code> the first letter of the <code>DIV</code> is not the letter "H".
In fact, the <code>DIV</code> doesn’t have a first letter.
If an element is a list item (<a class="css" data-link-type="propdesc" href="http://www.w3.org/TR/CSS21/visuren.html#propdef-display">display: list-item</a>),
the <a class="css" data-link-type="maybe" href="#selectordef-first-letter">::first-letter</a> applies
to the first letter in the principal box <em>after</em> the marker.
User-Agents may ignore <a class="css" data-link-type="maybe" href="#selectordef-first-letter">::first-letter</a> on list items with <a class="css" data-link-type="propdesc" href="http://www.w3.org/TR/css3-lists/#propdef-list-style-position">list-style-position: inside</a>.
If an element has <a class="css" data-link-type="maybe" href="#selectordef-before">::before</a> or <a class="css" data-link-type="maybe" href="#selectordef-after">::after</a> content,
the <a class="css" data-link-type="maybe" href="#selectordef-first-letter">::first-letter</a> applies to the first letter of the
element <em>including</em> that content.</p>
<div class="example" id="example-c5754cfa"><a class="self-link" href="#example-c5754cfa"></a> Example:
After the rule <span class="css">p::before {content: "Note: "}</span>, the
selector <span class="css">p::first-letter</span> matches the "N" of "Note". </div>
<h4 class="heading settled" data-level="2.2.2" id="first-letter-styling"><span class="secno">2.2.2. </span><span class="content"> Styling the <a class="css" data-link-type="maybe" href="#selectordef-first-letter">::first-letter</a> Pseudo-element</span><a class="self-link" href="#first-letter-styling"></a></h4>
<p>In CSS a ::first-letter pseudo-element is similar to an inline-level element
if its <a class="property" data-link-type="propdesc" href="http://www.w3.org/TR/CSS21/visuren.html#propdef-float">float</a> property is <a class="css" data-link-type="maybe" href="https://drafts.csswg.org/css-page-floats/#valdef-float-none">none</a>;
otherwise, it is similar to a floated element.
The following properties that apply to <a class="css" data-link-type="maybe" href="#selectordef-first-letter">::first-letter</a> pseudo-elements:</p>
<ul>
<li>all font properties (see <a data-link-type="biblio" href="#biblio-css3-fonts">[CSS3-FONTS]</a>)
<li>the <a class="property" data-link-type="propdesc" href="http://www.w3.org/TR/css3-color/#color0">color</a> and <a class="property" data-link-type="propdesc" href="https://drafts.csswg.org/css-color-4/#propdef-opacity">opacity</a> properties (see <a data-link-type="biblio" href="#biblio-css3color">[CSS3COLOR]</a>)
<li>all background properties (see <a data-link-type="biblio" href="#biblio-css3bg">[CSS3BG]</a>)
<li>any typesetting properties that apply to inline elements (see <a data-link-type="biblio" href="#biblio-css3text">[CSS3TEXT]</a>)
<li>all text decoration properties (see <a data-link-type="biblio" href="#biblio-css3-text-decor">[CSS3-TEXT-DECOR]</a>)
<li>any inline layout properties that apply to inline elements (see <a data-link-type="biblio" href="#biblio-css3line">[CSS3LINE]</a>)
<li>margin and padding properties (see <a data-link-type="biblio" href="#biblio-css21">[CSS21]</a>)
<li>border properties and <a class="property" data-link-type="propdesc" href="http://www.w3.org/TR/css3-background/#box-shadow">box-shadow</a> (see <a data-link-type="biblio" href="#biblio-css3bg">[CSS3BG]</a>)
<li>any other properties defined to apply to <a class="css" data-link-type="maybe" href="#selectordef-first-letter">::first-letter</a> by their respective specifications
</ul>
<p>User agents may apply other properties as well.</p>
<p class="note" role="note">Note: In previous levels of CSS,
User Agents were allowed to choose a line height, width and height based on the shape of the letter,
approximate font sizes,
or to take the glyph outline into account when formatting.
This possibility has been intentionally removed,
as it proved to be a poor solution for the intended use case (Drop Caps),
yet caused interoperability problems.</p>
<div class="example" id="example-845918ec">
<a class="self-link" href="#example-845918ec"></a> Example:
This CSS and HTML example shows a possible rendering of an initial cap.
Note that the fictional start tag of the first letter
is inside the <span>span</span>,
and thus the font weight of the first letter is normal,
not bold as the <span>span</span>:
<pre>p { line-height: 1.1 }
p::first-letter { font-size: 3em; font-weight: normal }
span { font-weight: bold }
...
<p><span>Het hemelsche</span> gerecht heeft zich ten lange lesten<br>
Erbarremt over my en mijn benaeuwde vesten<br>
En arme burgery, en op mijn volcx gebed<br>
En dagelix geschrey de bange stad ontzet.
</pre>
<div class="figure"><img alt="Image illustrating the ::first-letter pseudo-element" src="http://www.w3.org/TR/selectors/initial-cap.png"></div>
</div>
<div class="example" id="example-e4341976">
<a class="self-link" href="#example-e4341976"></a> The following CSS will make a drop cap initial letter span about two lines:
<pre><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN">
<HTML>
<HEAD>
<TITLE>Drop cap initial letter</TITLE>
<STYLE type="text/css">
P { font-size: 12pt; line-height: 1.2 }
P::first-letter { font-size: 200%; font-weight: bold; float: left }
SPAN { text-transform: uppercase }
</STYLE>
</HEAD>
<BODY>
<P><SPAN>The first</SPAN> few words of an article
in The Economist.</P>
</BODY>
</HTML>
</pre>
<p>This example might be formatted as follows:</p>
<div class="figure"><img alt="Image illustrating the combined effect of the ::first-letter
and ::first-line pseudo-elements" src="http://www.w3.org/TR/selectors/first-letter.png"></div>
<p>The <i>fictional tag sequence</i> is:</p>
<pre><P>
<SPAN>
<P::first-letter>
T
</P::first-letter>he first
</SPAN>
few words of an article in the Economist.
</P>
</pre>
<p>Note that the <a class="css" data-link-type="maybe" href="#selectordef-first-letter">::first-letter</a> pseudo-element tags abut the
content (i.e., the initial character), while the ::first-line
pseudo-element start tag is inserted right after the start tag of the
block element.</p>
</div>
<h2 class="heading settled" data-level="3" id="highlight-pseudos"><span class="secno">3. </span><span class="content"> Highlight Pseudo-elements</span><a class="self-link" href="#highlight-pseudos"></a></h2>
<h3 class="heading settled" data-level="3.1" id="highlight-selectors"><span class="secno">3.1. </span><span class="content"> Selecting Highlighted Content: the <a class="css" data-link-type="maybe" href="#selectordef-selection">::selection</a>, <a class="css" data-link-type="maybe" href="#selectordef-spelling-error">::spelling-error</a>, and <a class="css" data-link-type="maybe" href="#selectordef-grammar-error">::grammar-error</a> pseudo-elements</span><a class="self-link" href="#highlight-selectors"></a></h3>
<p>The <dfn data-dfn-type="dfn" data-noexport="" id="highlight-pseudo_elements">highlight pseudo-elements<a class="self-link" href="#highlight-pseudo_elements"></a></dfn> represent portions of a document that have been highlighted in some way.</p>
<dl>
<dt><dfn class="css" data-dfn-type="selector" data-export="" id="selectordef-selection">::selection<a class="self-link" href="#selectordef-selection"></a></dfn>
<dd>
The <a class="css" data-link-type="selector" href="#selectordef-selection">::selection</a> pseudo-element represents
the portion of a document that has been highlighted by the user.
This also applies, for example, to selected text within an editable text field.
<p class="issue" id="issue-43364a12"><a class="self-link" href="#issue-43364a12"></a> Active vs. inactive selections are often styled differently. Currently no way to distinguish.</p>
<dt><dfn class="css" data-dfn-type="selector" data-export="" id="selectordef-spelling-error">::spelling-error<a class="self-link" href="#selectordef-spelling-error"></a></dfn>
<dd> The <a class="css" data-link-type="selector" href="#selectordef-spelling-error">::spelling-error</a> pseudo-element represents
a portion of text that has been flagged by the user agent as misspelled.
<dt><dfn class="css" data-dfn-type="selector" data-export="" id="selectordef-grammar-error">::grammar-error<a class="self-link" href="#selectordef-grammar-error"></a></dfn>
<dd> The <a class="css" data-link-type="selector" href="#selectordef-grammar-error">::grammar-error</a> pseudo-element represents
a portion of text that has been flagged by the user agent as grammatically incorrect.
</dl>
<p class="note" role="note">Note: A future level of CSS may introduce ways to create
custom highlight pseudo-elements.</p>
<h3 class="heading settled" data-level="3.2" id="highlight-styling"><span class="secno">3.2. </span><span class="content"> Styling Highlights</span><a class="self-link" href="#highlight-styling"></a></h3>
<p>The following properties apply to the <a data-link-type="dfn" href="#highlight-pseudo_elements">highlight pseudo-elements</a>:</p>
<ul>
<li><a class="property" data-link-type="propdesc" href="http://www.w3.org/TR/css3-color/#color0">color</a>
<li><a class="property" data-link-type="propdesc" href="http://www.w3.org/TR/css3-background/#background-color">background-color</a>
<li><a class="property" data-link-type="propdesc" href="http://www.w3.org/TR/css3-ui/#propdef-cursor">cursor</a>
<li><a class="property" data-link-type="propdesc" href="http://www.w3.org/TR/css3-ui/#propdef-outline">outline</a> and its longhands
<li><a class="property" data-link-type="propdesc" href="http://www.w3.org/TR/css-text-decor-3/#text-decoration">text-decoration</a> and its associated properties
<li><a class="property" data-link-type="propdesc" href="http://www.w3.org/TR/css-text-decor-3/#text-emphasis-color">text-emphasis-color</a>
<li><a class="property" data-link-type="propdesc" href="http://www.w3.org/TR/css-text-decor-3/#text-shadow">text-shadow</a>
</ul>
<p class="issue" id="issue-7be57116"><a class="self-link" href="#issue-7be57116"></a> Are there any other properties that should be included here?
[Caret-color should be added once we have it.]</p>
<p class="note" role="note">Note: Historically (and at the time of writing)
only <a class="property" data-link-type="propdesc" href="http://www.w3.org/TR/css3-color/#color0">color</a> and <a class="property" data-link-type="propdesc" href="http://www.w3.org/TR/css3-background/#background-color">background-color</a> have been interoperably supported.</p>
<p>If <a class="property" data-link-type="propdesc" href="http://www.w3.org/TR/css3-color/#color0">color</a> is not specified, the text (and text decoration)'s
unselected color must be used for the highlight.
(As usual, the initial <a class="property" data-link-type="propdesc" href="http://www.w3.org/TR/css3-background/#background-color">background-color</a> is <a class="css" data-link-type="maybe" href="https://drafts.csswg.org/css-color-4/#valdef-color-transparent">transparent</a>.)
Issue: Can we reuse <span class="css">currentColor</span> for this, now that it computes to itself?</p>
<p>The UA should use the OS-default highlight colors
when neither <a class="property" data-link-type="propdesc" href="http://www.w3.org/TR/css3-color/#color0">color</a> nor <a class="property" data-link-type="propdesc" href="http://www.w3.org/TR/css3-background/#background-color">background-color</a> has been specified by the author.</p>
<p class="note" role="note">Note: This paired-cascading behavior
does not allow <a href="http://lists.w3.org/Archives/Public/www-style/2008Oct/0268.html">using the normal cascade</a> to represent the OS default selection colors.
However it has been interoperably implemented in browsers
and is thus probably a Web-compatibility requirement.</p>
<p>The <a class="property" data-link-type="propdesc" href="http://www.w3.org/TR/css3-color/#color0">color</a> property specifies the color of both the text
and all line decorations (underline, overline, line-through)
applied to the text.
Note: Because <a class="property" data-link-type="propdesc" href="http://www.w3.org/TR/css-text-decor-3/#text-emphasis-color">text-emphasis-color</a> defaults to <span class="css">currrentColor</span>,
it will by default also set the color of the the emphasis marks.</p>
<h3 class="heading settled" data-level="3.3" id="highlight-bounds"><span class="secno">3.3. </span><span class="content"> Area of a Highlight</span><a class="self-link" href="#highlight-bounds"></a></h3>
<p>For each instance of highlighting
there exists a <dfn data-dfn-type="dfn" data-noexport="" id="root-highlight-overlay">root highlight overlay<a class="self-link" href="#root-highlight-overlay"></a></dfn> which is a tesselated overlay
over the entire tree,
the actively-highlighted portions of which are represented
by the corresponding <a data-link-type="dfn" href="#highlight-pseudo_elements">highlight pseudo-element</a>.
The <a class="css" data-link-type="maybe" href="#selectordef-selection">::selection</a> overlay is drawn
over the <a class="css" data-link-type="maybe" href="#selectordef-spelling-error">::spelling-error</a> overlay
which is drawn over the <a class="css" data-link-type="maybe" href="#selectordef-grammar-error">::grammar-error</a> overlay. </p>
<p>Each box owns a piece of the overlay corresponding to any text or replaced content
directly contained by the box.</p>
<ul>
<li> For text, the corresponding overlay must cover at least the entire em box
and may extend further above/below the em box to the line box edges.
Spacing between two characters may also be part of the overlay,
in which case it belongs to the innermost element that contains both characters
and is selected when both characters are selected.
<li> For replaced content, the associated overlay must cover at least the entire replaced object,
and may extend outward to include the element’s entire content box.
<li> The overlay may also include other other areas within the border-box of an element;
in this case, those areas belong to the innermost such element that contains the area.
</ul>
<p class="issue" id="issue-b6466947"><a class="self-link" href="#issue-b6466947"></a> See <a href="http://lists.w3.org/Archives/Public/www-style/2008Nov/0022.html">F2F minutes</a>, <a href="http://lists.w3.org/Archives/Public/www-style/2008Oct/0268.html">dbaron’s message</a>, <a href="http://lists.w3.org/Archives/Public/www-style/2010May/0247.html">Daniel’s thread</a>, <a href="http://lists.w3.org/Archives/Public/www-style/2010May/0261.html">Gecko notes</a>, <a href="http://lists.w3.org/Archives/Public/www-style/2010May/0366.html">Opera notes</a>, <a href="http://lists.w3.org/Archives/Public/www-style/2010May/0280.html">Webkit notes</a></p>
<p class="issue" id="issue-271a1b90"><a class="self-link" href="#issue-271a1b90"></a> Not sure if this is the correct way of describing the way things work.</p>
<h3 class="heading settled" data-level="3.4" id="highlight-cascade"><span class="secno">3.4. </span><span class="content"> Cascading and Per-Element Highlight Styles</span><a class="self-link" href="#highlight-cascade"></a></h3>
<p>Each element draws its own portion of the <a data-link-type="dfn" href="#root-highlight-overlay">root highlight overlay</a>,
which receives the styles specified by the <a data-link-type="dfn" href="#highlight-pseudo_elements">highlight pseudo-element</a> styles
for which it or one of its ancestors is the <i>originating element</i>.
When multiple styles conflict,
the winning style is the one belonging to the innermost element
after cascading.</p>
<div class="example" id="example-7d56356a">
<a class="self-link" href="#example-7d56356a"></a> For example, if the following rules were applied:
<pre>p::selection { background: green; color: yellow; }
em::selection { color: orange; }
</pre>
<p>to the following markup:</p>
<pre><p>Highlight this <em>and this</em>.</p>
</pre>
<p>The highlight would be green throughout,
with a yellow text outside the <code><em></code> element
and a orange text inside it.</p>
</div>
<p class="issue" id="issue-ff621186"><a class="self-link" href="#issue-ff621186"></a> This could alternately be described in terms of inheritance.
The observable differences would be in how <a class="css" data-link-type="maybe" href="http://www.w3.org/TR/css-cascade-3/#valdef-all-inherit">inherit</a> and <a class="css" data-link-type="maybe" href="http://www.w3.org/TR/css-cascade-3/#valdef-all-unset">unset</a> behave.
Should it inherit from the parent <a class="css" data-link-type="maybe" href="#selectordef-selection">::selection</a> or the <i>originating element</i>?
Opera does the former, Gecko/Blink the latter.</p>
<p class="advisement"> Authors wanting multiple selections styles should use <strong><span class="css">:root::selection</span></strong> for their document-wide selection style,
since this will allow clean overriding in descendants.
(<a class="css" data-link-type="maybe" href="#selectordef-selection">::selection</a> alone would apply to every element in the tree,
overriding the more specific styles of any ancestors.) </p>
<h3 class="heading settled" data-level="3.5" id="highlight-painting"><span class="secno">3.5. </span><span class="content"> Painting the Highlight</span><a class="self-link" href="#highlight-painting"></a></h3>
<p>The <a class="css" data-link-type="maybe" href="#selectordef-selection">::selection</a> pseudo element draws its background
over the selected portion of the element,
immediately below any positioned descendants
(i.e. just before step 8 in <a href="http://www.w3.org/TR/CSS21/zindex.html">CSS2.1§E.2</a>).
It also suppresses the drawing of any selected text
(and any text decorations applied to that text)
and instead redraws that text
(and its decorations)
over that background
using the specified <a class="property" data-link-type="propdesc" href="http://www.w3.org/TR/css3-color/#color0">color</a>.</p>
<p class="issue" id="issue-b85c3e18"><a class="self-link" href="#issue-b85c3e18"></a> What should happen with text shadows?
Drawing them in their original color is disconcerting if that color is not a shade of gray.</p>
<p>For non-replaced content, the UA must honor the <a class="property" data-link-type="propdesc" href="http://www.w3.org/TR/css3-color/#color0">color</a> and <a class="property" data-link-type="propdesc" href="http://www.w3.org/TR/css3-background/#background-color">background-color</a> (including their alpha channels) as specified.
However, for replaced content, the UA should create a semi-transparent wash
to coat the content so that it can show through the selection.
This wash should be of the specified <a class="property" data-link-type="propdesc" href="http://www.w3.org/TR/css3-background/#background-color">background-color</a> if that is not <a class="css" data-link-type="maybe" href="https://drafts.csswg.org/css-color-4/#valdef-color-transparent">transparent</a>,
else the specified <a class="property" data-link-type="propdesc" href="http://www.w3.org/TR/css3-color/#color0">color</a>;
however the UA may adjust the alpha channel if it is opaque.</p>
<h3 class="heading settled" data-level="3.6" id="highlight-security"><span class="secno">3.6. </span><span class="content"> Security Considerations</span><a class="self-link" href="#highlight-security"></a></h3>
<p>Because the styling of spelling and grammar errors
can leak information about the contents of a user’s dictionary
(which can include the user’s name and even includes the contents of his/her address book!)
UAs that implement <a class="css" data-link-type="maybe" href="#selectordef-spelling-error">::spelling-error</a> and <a class="css" data-link-type="maybe" href="#selectordef-grammar-error">::grammar-error</a> must prevent pages from being able to read
the styling of such highlighted segments.</p>
<h2 class="heading settled" data-level="4" id="treelike"><span class="secno">4. </span><span class="content"> Tree-Abiding Pseudo-elements</span><a class="self-link" href="#treelike"></a></h2>
<p>These pseudo-elements always fit within the box tree.</p>
<h3 class="heading settled" data-level="4.1" id="generated-content"><span class="secno">4.1. </span><span class="content"> Generated Content Pseudo-elements: <a class="css" data-link-type="maybe" href="#selectordef-before">::before</a> and <a class="css" data-link-type="maybe" href="#selectordef-after">::after</a></span><a class="self-link" href="#generated-content"></a></h3>
<p>When their computed <a class="property" data-link-type="propdesc" href="https://drafts.csswg.org/css-content-3/#propdef-content">content</a> value is not <a class="css" data-link-type="maybe" href="https://drafts.csswg.org/css-content-3/#valdef-content-none">none</a>,
these pseudo-elements generate boxes
as if they were immediate children of their <i>originating element</i>,
and can be styled exactly like any normal document-sourced element in the document tree.
They <i data-lt="inheritance">inherit</i> any inheritable properties from their <i>originating element</i>;
non-inheritable properties take their <i>initial values</i> as usual. <a data-link-type="biblio" href="#biblio-css3cascade">[CSS3CASCADE]</a></p>
<dl>
<dt><dfn class="css" data-dfn-type="selector" data-export="" id="selectordef-before">::before<a class="self-link" href="#selectordef-before"></a></dfn>
<dd>Represents a styleable child pseudo-element
immediately before the <i>originating element</i>’s actual content.
<dt><dfn class="css" data-dfn-type="selector" data-export="" id="selectordef-after">::after<a class="self-link" href="#selectordef-after"></a></dfn>
<dd>Represents a styleable child pseudo-element
immediately after the <i>originating element</i>’s actual content.
</dl>
<div class="example" id="example-5af1d6e7">
<a class="self-link" href="#example-5af1d6e7"></a> For example, the following rule inserts the string “Note: ”
before the content of every <code><p></code> element
whose <code>class</code> attribute has the value <code>note</code>:
<pre>p.note::before { content: "Note: " }</pre>
<p>Since the initial value of <a class="property" data-link-type="propdesc" href="http://www.w3.org/TR/CSS21/visuren.html#propdef-display">display</a> is <a class="css" data-link-type="maybe" href="https://drafts.csswg.org/css-display-3/#valdef-display-inline">inline</a>,
this will generate an inline box.
Like other inline children of <code><p></code>,
it will participate in <code><p></code>’s inline formatting context,
potentially sharing a line with other content.</p>
</div>
<p>As with the content of regular elements,
the generated content of <a class="css" data-link-type="maybe" href="#selectordef-before">::before</a> and <span class="css">:after</span> pseudo-elements
may be included in any <a class="css" data-link-type="maybe" href="#selectordef-first-line">::first-line</a> and <a class="css" data-link-type="maybe" href="#selectordef-first-letter">::first-letter</a> pseudo-elements
applied to its <i>originating element</i>.</p>
<p>For compatibility with existing style sheets written against CSS Level 2 <a data-link-type="biblio" href="#biblio-css21">[CSS21]</a>,
user agents must also accept the previous one-colon notation
(<code>:before</code> and <code>:after</code>)
for these pseudo-elements. </p>
<h3 class="heading settled" data-level="4.2" id="marker-pseudo"><span class="secno">4.2. </span><span class="content"> List Markers: the <a class="css" data-link-type="maybe" href="#selectordef-marker">::marker</a> pseudo-element</span><a class="self-link" href="#marker-pseudo"></a></h3>
<p>The <dfn class="css" data-dfn-type="selector" data-export="" id="selectordef-marker">::marker<a class="self-link" href="#selectordef-marker"></a></dfn> pseudo-element represents
the automatically generated marker box of a list item.
(See <a class="css" data-link-type="propdesc" href="http://www.w3.org/TR/CSS21/visuren.html#propdef-display">display: list-item</a>.)</p>
<p>The following CSS properties apply to a <a class="css" data-link-type="maybe" href="#selectordef-first-line">::first-line</a> pseudo-element:</p>
<ul>
<li>all font properties (see <a data-link-type="biblio" href="#biblio-css3-fonts">[CSS3-FONTS]</a>)
<li>the <a class="property" data-link-type="propdesc" href="http://www.w3.org/TR/css3-color/#color0">color</a> property (see <a data-link-type="biblio" href="#biblio-css3color">[CSS3COLOR]</a>)
<li>the <a class="property" data-link-type="propdesc" href="http://www.w3.org/TR/css-writing-modes-3/#propdef-text-combine-upright">text-combine-upright</a> property (see <a data-link-type="biblio" href="#biblio-css3-writing-modes">[CSS3-WRITING-MODES]</a>)
</ul>
<p class="note" role="note"> It is expected that future specifications will extend this list of properties;
however at the moment marker box layout is not fully defined,
so only these properties are allowed. </p>
<p>UAs must add the following rule to their default style sheet:</p>
<pre>::marker { font-variant-numeric: tabular-nums; }</pre>
<h3 class="heading settled" data-level="4.3" id="placeholder-pseudo"><span class="secno">4.3. </span><span class="content"> Placeholder Input: the <a class="css" data-link-type="maybe" href="#selectordef-placeholder">::placeholder</a> pseudo-element</span><a class="self-link" href="#placeholder-pseudo"></a></h3>
<p>The <dfn class="css" data-dfn-type="selector" data-export="" id="selectordef-placeholder">::placeholder<a class="self-link" href="#selectordef-placeholder"></a></dfn> pseudo-element represents
placeholder text in an input field:
text that represents the input
and provides a hint to the user on how to fill out the form.
For example, a date-input field
might have the placeholder text “YYYY/MM/DD”
to clarify that numeric dates are to be entered in year-month-day order.</p>
<p>All properties that apply to the <a class="css" data-link-type="maybe" href="#selectordef-first-line">::first-line</a> pseudo-element
also apply to the <a class="css" data-link-type="maybe" href="#selectordef-placeholder">::placeholder</a> pseudo-element.</p>
<p>In interactive media, placeholder text is often hidden once the user has entered input;
however this is not a requirement, and both the input value and the placeholder text may be visible simultaneously.
The exact behavior is UA-defined.
Note that in static media (such as print)
placeholder text will be present even after the user has entered input.</p>
<p class="issue" id="issue-68e6c4d7"><a class="self-link" href="#issue-68e6c4d7"></a> Current bikeshedding, based on implementations and discussions,
appears to select from the list <code>::placeholder</code>, <code>::placeholder-text</code>, <code>::input-placeholder</code>.
The WG is going with <code>::placeholder</code>.
If there are other opinions that provide some kind of argument to the contrary,
they should go to <a href="http://lists.w3.org/Archives/Public/www-style/">www-style@w3.org</a>.</p>
<p class="issue" id="issue-44dd3703"><a class="self-link" href="#issue-44dd3703"></a> Authors seem to want <a class="property" data-link-type="propdesc" href="http://www.w3.org/TR/css-text-3/#text-align">text-align</a> on the list of supported properties.
See e.g. <a href="http://css-tricks.com/almanac/selectors/p/placeholder/">comments here</a>.</p>
<h2 class="heading settled" data-level="5" id="interactions"><span class="secno">5. </span><span class="content"> Overlapping Pseudo-element Interactions</span><a class="self-link" href="#interactions"></a></h2>
<div class="example" id="overlapping-example">
<a class="self-link" href="#overlapping-example"></a> Recall that
<ul>
<li> the contents of <a class="css" data-link-type="maybe" href="#selectordef-before">::before</a> and <a class="css" data-link-type="maybe" href="#selectordef-after">::after</a> are selected
exactly as if they were normal elements in the document source tree
<li> the <a class="css" data-link-type="maybe" href="#selectordef-first-letter">::first-letter</a> boundaries are tightly wrapped around the first letter text,
and <a class="css" data-link-type="maybe" href="#selectordef-first-letter">::first-letter</a> is constrained to exist solely on the first formatted line.
<li> the <a class="css" data-link-type="maybe" href="#selectordef-first-line">::first-line</a> start is inserted inserted just inside the containing block’s element boundary,
and its end after the close of all content on the line
</ul>
<p>The following CSS and HTML example
illustrates how overlapping pseudo-elements interact:</p>
<pre>p { color: red; font-size: 12pt }
p::first-letter { color: green; font-size: 200% }
p::first-line { color: blue }
<P>Some text that ends up on two lines</P>
</pre>
<p>The first letter of each P element will be green with a font size of ’24pt'.
The rest of the first formatted line will be blue
while the rest of the paragraph will be red.</p>
<p>Assuming that a line break will occur before the word "ends",
the <i>fictional tag sequence</i> for this fragment might be:</p>
<pre><P>
<P::first-line>
<P::first-letter>
S
</P::first-letter>ome text that
</P::first-line>
ends up on two lines
</P>
</pre>
</div>
<h2 class="heading settled" data-level="6" id="cssom"><span class="secno">6. </span><span class="content"> Additions to the CSS Object Model</span><a class="self-link" href="#cssom"></a></h2>
<p>Pseudo-elements should be reachable by script,
stylable from script,
and available as event targets.</p>
<p class="note" role="note"><span class="note-prefix">Note </span>We may extend this
section in the future to allow creation of pseudo-elements from script. </p>
<p class="issue" id="issue-116a9e33"><a class="self-link" href="#issue-116a9e33"></a> This entire section is a starting point for discussion.
Feedback is welcome.
Implementations, at this point, are not,
as we are not yet sure of our approach.</p>
<h3 class="heading settled" data-level="6.1" id="CSSPseudoElement-interface"><span class="secno">6.1. </span><span class="content"> Interface CSSPseudoElement</span><a class="self-link" href="#CSSPseudoElement-interface"></a></h3>
<p>The <code>CSSPseudoElement</code> interface
allows pseudo-elements to be styleable from script
and makes them event targets.</p>
<div class="issue" id="issue-b008e095"><a class="self-link" href="#issue-b008e095"></a> The approach in this draft
is to start with a bare minimum
for the CSSPseudoElement interface
and build up from there.
Another more radical approach
could take everything that’s common
between a pseudo-element and a node
and create a new base class
for both Node and CSSPseudoElement. </div>
<pre class="idl">interface <dfn class="idl-code" data-dfn-type="interface" data-export="" id="csspseudoelement">CSSPseudoElement<a class="self-link" href="#csspseudoelement"></a></dfn> {
readonly attribute DOMString <dfn class="idl-code" data-dfn-for="CSSPseudoElement" data-dfn-type="attribute" data-export="" data-readonly="" data-type="DOMString " id="dom-csspseudoelement-type">type<a class="self-link" href="#dom-csspseudoelement-type"></a></dfn>;
readonly attribute <a data-link-type="idl-name" href="http://www.w3.org/TR/cssom/#cssstyledeclaration">CSSStyleDeclaration</a> <dfn class="idl-code" data-dfn-for="CSSPseudoElement" data-dfn-type="attribute" data-export="" data-readonly="" data-type="CSSStyleDeclaration " id="dom-csspseudoelement-style">style<a class="self-link" href="#dom-csspseudoelement-style"></a></dfn>;
};
<a data-link-type="idl-name" href="#csspseudoelement">CSSPseudoElement</a> implements <a data-link-type="idl-name" href="https://dom.spec.whatwg.org/#eventtarget">EventTarget</a>;
</pre>
<p>The <dfn data-dfn-type="dfn" data-noexport="" id="dom-csspseudochild-type">type<a class="self-link" href="#dom-csspseudochild-type"></a></dfn> attribute
is a string representing the type of the pseudo-element.
This can be one of the following values:</p>
<dl>
<dt>‘before’
<dd>The pseudo-element was created before the element’s contents.
<dt>‘after’
<dd>The pseudo-element was created after the element’s contents.
<dt>‘letter’
<dd>The pseudo-element is the first letter of the element.
<dt>‘line’
<dd>The pseudo-element is the first line of the element.
<dt>‘selection’
<dd>The selection pseudo-element for the element.
</dl>
<p>The <dfn data-dfn-type="dfn" data-noexport="" id="dom-csspseudochild-style">style<a class="self-link" href="#dom-csspseudochild-style"></a></dfn> attribute
is a <code>CSSStyleDeclaration</code><a data-link-type="biblio" href="#biblio-cssom">[CSSOM]</a> that allows directly setting style information (inline styles) onto the pseudo-element.
Inline styles on a <code>CSSPseudoElement</code> have precedence over all
style rules styling that pseudo-element.</p>
<p class="issue" id="issue-65c50c19"><a class="self-link" href="#issue-65c50c19"></a> This should cascade like actual inline styles, not be a different thing.</p>
<p>The <a href="http://www.w3.org/TR/DOM-Level-2-Events/events.html#Events-EventTarget"><code>EventTarget</code></a> interface <a data-link-type="biblio" href="#biblio-dom-level-2-events">[DOM-LEVEL-2-EVENTS]</a> must be implemented by all instances of <code>CSSPseudoElement</code> as a conformance requirement of this module.</p>
<h3 class="heading settled" data-level="6.2" id="CSSPseudoElementList-interface"><span class="secno">6.2. </span><span class="content"> Interface CSSPseudoElementList</span><a class="self-link" href="#CSSPseudoElementList-interface"></a></h3>
<p>The <code>CSSPseudoElementList</code> represents an ordered collection
of <code>CSSPseudoElement</code> instances.</p>
<pre class="idl">interface <dfn class="idl-code" data-dfn-type="interface" data-export="" id="csspseudoelementlist">CSSPseudoElementList<a class="self-link" href="#csspseudoelementlist"></a></dfn> {
readonly attribute unsigned long <dfn class="idl-code" data-dfn-for="CSSPseudoElementList" data-dfn-type="attribute" data-export="" data-readonly="" data-type="unsigned long " id="dom-csspseudoelementlist-length">length<a class="self-link" href="#dom-csspseudoelementlist-length"></a></dfn>;
<a data-link-type="idl-name" href="#csspseudoelement">CSSPseudoElement</a> <dfn class="idl-code" data-dfn-for="CSSPseudoElementList" data-dfn-type="method" data-export="" data-lt="item(index)" id="dom-csspseudoelementlist-item">item<a class="self-link" href="#dom-csspseudoelementlist-item"></a></dfn>(unsigned long <dfn class="idl-code" data-dfn-for="CSSPseudoElementList/item(index)" data-dfn-type="argument" data-export="" id="dom-csspseudoelementlist-item-index-index">index<a class="self-link" href="#dom-csspseudoelementlist-item-index-index"></a></dfn>);
<a data-link-type="idl-name" href="#csspseudoelement">CSSPseudoElement</a> <dfn class="idl-code" data-dfn-for="CSSPseudoElementList" data-dfn-type="method" data-export="" data-lt="getByType(type)" id="dom-csspseudoelementlist-getbytype">getByType<a class="self-link" href="#dom-csspseudoelementlist-getbytype"></a></dfn>(DOMString <dfn class="idl-code" data-dfn-for="CSSPseudoElementList/getByType(type)" data-dfn-type="argument" data-export="" id="dom-csspseudoelementlist-getbytype-type-type">type<a class="self-link" href="#dom-csspseudoelementlist-getbytype-type-type"></a></dfn>);
// replies null if no pseudo-element exists for
// the requested type
};
</pre>
<p>The <dfn data-dfn-type="dfn" data-noexport="" id="dom-csspseudochildlist-length">length<a class="self-link" href="#dom-csspseudochildlist-length"></a></dfn> attribute
represents the number of <code>CSSPseudoElement</code> in the
collection or zero if it is empty.
The method <dfn data-dfn-type="dfn" data-noexport="" id="dom-csspseudochildlist-item">item()<a class="self-link" href="#dom-csspseudochildlist-item"></a></dfn> is used to retrieve a <code>CSSPseudo</code><code>Element</code> by index.
It takes one parameter being the requested index into the collection.
Its return value is the <code>CSSPseudo</code><code>Element</code> at the requested index in the collection
or null if that is not a valid index.</p>
<p>The method <dfn data-dfn-type="dfn" data-noexport="" id="dom-csspseudochildlist-getbytype">getByType()<a class="self-link" href="#dom-csspseudochildlist-getbytype"></a></dfn> is used to retrieve a <code>CSSPseudo</code><code>Element</code> by its type.
Its return value is the <code>CSSPseudo</code><code>Element</code> in the collection that matches the type
or null if there is no <code>CSSPseudo</code><code>Element</code> in the collection for that type.</p>
<h3 class="heading settled" data-level="6.3" id="window-interface"><span class="secno">6.3. </span><span class="content"> Addition to the <code>window</code> interface</span><a class="self-link" href="#window-interface"></a></h3>
<p>A new method is added to the <code>Window</code> interface to retrieve
pseudo-elements created by a given element for a given type:</p>
<pre class="idl">partial interface <a class="idl-code" data-link-type="interface" href="https://html.spec.whatwg.org/multipage/browsers.html#window">Window</a> {
<a data-link-type="idl-name" href="#csspseudoelementlist">CSSPseudoElementList</a> <dfn class="idl-code" data-dfn-for="Window" data-dfn-type="method" data-export="" data-lt="getPseudoElements(elt, type)" id="dom-window-getpseudoelements">getPseudoElements<a class="self-link" href="#dom-window-getpseudoelements"></a></dfn>(<a data-link-type="idl-name" href="https://dom.spec.whatwg.org/#element">Element</a> <dfn class="idl-code" data-dfn-for="Window/getPseudoElements(elt, type)" data-dfn-type="argument" data-export="" id="dom-window-getpseudoelements-elt-type-elt">elt<a class="self-link" href="#dom-window-getpseudoelements-elt-type-elt"></a></dfn>,
DOMString <dfn class="idl-code" data-dfn-for="Window/getPseudoElements(elt, type)" data-dfn-type="argument" data-export="" id="dom-window-getpseudoelements-elt-type-type">type<a class="self-link" href="#dom-window-getpseudoelements-elt-type-type"></a></dfn>);
};
</pre>
<p>The <dfn data-dfn-type="dfn" data-noexport="" id="dom-window-getpseudochildren"><code>getPseudoElements()</code><a class="self-link" href="#dom-window-getpseudochildren"></a></dfn> method
is used to retrieve all <code>CSSPseudoElement</code> instances
created by the element <code>elt</code> for the type <code>type</code>.
Its return value is a <code>CSSPseudoElementList</code>,
potentially empty if no pseudo-element exists for the given element and the given type.</p>
<h2 class="no-num heading settled" id="acknowledgements"><span class="content"> Acknowledgements</span><a class="self-link" href="#acknowledgements"></a></h2>
<p>The editors would like to thank the following individuals for their
contributions, either during the conception of the specification or during
its development and specification review process:
Tab Atkins,
David Baron,
Razvan Caliman,
Chris Coyier,
Anders Grimsrud,
Vincent Hardy.</p>
</main>
<h2 class="no-ref no-num heading settled" id="conformance"><span class="content"> Conformance</span><a class="self-link" href="#conformance"></a></h2>
<h3 class="no-ref heading settled" id="conventions"><span class="content"> Document conventions</span><a class="self-link" href="#conventions"></a></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>
<p>All of the text of this specification is normative except sections
explicitly marked as non-normative, examples, and notes. <a data-link-type="biblio" href="#biblio-rfc2119">[RFC2119]</a></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: </p>
<div class="example" id="example-f839f6c8">
<a class="self-link" href="#example-f839f6c8"></a>
<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>
<p class="note" role="note">Note, this is an informative note.</p>
<p>Advisements are normative sections styled to evoke special attention and are
set apart from other normative text with <code><strong class="advisement"></code>, like
this: <strong class="advisement"> UAs MUST provide an accessible alternative. </strong></p>
<h3 class="no-ref heading settled" id="conformance-classes"><span class="content"> Conformance classes</span><a class="self-link" href="#conformance-classes"></a></h3>
<p>Conformance to this specification
is defined for three conformance classes: </p>
<dl>
<dt>style sheet
<dd>A <a href="http://www.w3.org/TR/CSS21/conform.html#style-sheet">CSS
style sheet</a>.
<dt>renderer
<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>authoring tool
<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 this specification
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>
<p>A renderer is conformant to this specification
if, in addition to interpreting the style sheet as defined by the
appropriate specifications, it supports all the features defined
by this specification 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>
<p>An authoring tool is conformant to this specification
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. </p>
<h3 class="no-ref heading settled" id="partial"><span class="content"> Partial implementations</span><a class="self-link" href="#partial"></a></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 class="no-ref heading settled" id="experimental"><span class="content"> Experimental implementations</span><a class="self-link" href="#experimental"></a></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>
<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 class="no-ref heading settled" id="testing"><span class="content"> Non-experimental implementations</span><a class="self-link" href="#testing"></a></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>
<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>
<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. </p>
<h2 class="no-num heading settled" id="index"><span class="content">Index</span><a class="self-link" href="#index"></a></h2>
<h3 class="no-num heading settled" id="index-defined-here"><span class="content">Terms defined by this specification</span><a class="self-link" href="#index-defined-here"></a></h3>
<ul class="indexlist">
<li><a href="#selectordef-after">::after</a><span>, in §4.1</span>
<li><a href="#selectordef-before">::before</a><span>, in §4.1</span>
<li><a href="#csspseudoelement">CSSPseudoElement</a><span>, in §6.1</span>
<li><a href="#csspseudoelementlist">CSSPseudoElementList</a><span>, in §6.2</span>
<li><a href="#dom-window-getpseudoelements-elt-type-elt">elt</a><span>, in §6.3</span>
<li><a href="#fictional-tag-sequence">fictional tag sequence</a><span>, in §2.1</span>
<li><a href="#first-formatted-line">first formatted line</a><span>, in §2.1.1</span>
<li><a href="#selectordef-first-letter">::first-letter</a><span>, in §2.2</span>
<li><a href="#selectordef-first-line">::first-line</a><span>, in §2.1</span>
<li><a href="#dom-csspseudochildlist-getbytype">getByType()</a><span>, in §6.2</span>
<li><a href="#dom-csspseudoelementlist-getbytype">getByType(type)</a><span>, in §6.2</span>
<li><a href="#dom-window-getpseudochildren">getPseudoElements()</a><span>, in §6.3</span>
<li><a href="#dom-window-getpseudoelements">getPseudoElements(elt, type)</a><span>, in §6.3</span>
<li><a href="#selectordef-grammar-error">::grammar-error</a><span>, in §3.1</span>
<li><a href="#highlight-pseudo_elements">highlight pseudo-elements</a><span>, in §3.1</span>
<li><a href="#dom-csspseudoelementlist-item-index-index">index</a><span>, in §6.2</span>
<li><a href="#dom-csspseudochildlist-item">item()</a><span>, in §6.2</span>
<li><a href="#dom-csspseudoelementlist-item">item(index)</a><span>, in §6.2</span>
<li>
length
<ul>
<li><a href="#dom-csspseudoelementlist-length">attribute for CSSPseudoElementList</a><span>, in §6.2</span>
<li><a href="#dom-csspseudochildlist-length">definition of</a><span>, in §6.2</span>
</ul>
<li><a href="#selectordef-marker">::marker</a><span>, in §4.2</span>
<li><a href="#selectordef-placeholder">::placeholder</a><span>, in §4.3</span>
<li><a href="#root-highlight-overlay">root highlight overlay</a><span>, in §3.3</span>
<li><a href="#selectordef-selection">::selection</a><span>, in §3.1</span>
<li><a href="#selectordef-spelling-error">::spelling-error</a><span>, in §3.1</span>
<li>
style
<ul>
<li><a href="#dom-csspseudoelement-style">attribute for CSSPseudoElement</a><span>, in §6.1</span>
<li><a href="#dom-csspseudochild-style">definition of</a><span>, in §6.1</span>
</ul>
<li>
type
<ul>
<li><a href="#dom-csspseudoelement-type">attribute for CSSPseudoElement</a><span>, in §6.1</span>
<li><a href="#dom-csspseudochild-type">definition of</a><span>, in §6.1</span>
<li><a href="#dom-csspseudoelementlist-getbytype-type-type">argument for CSSPseudoElementList/getByType(type)</a><span>, in §6.2</span>
<li><a href="#dom-window-getpseudoelements-elt-type-type">argument for Window/getPseudoElements(elt, type)</a><span>, in §6.3</span>
</ul>
</ul>
<h3 class="no-num heading settled" id="index-defined-elsewhere"><span class="content">Terms defined by reference</span><a class="self-link" href="#index-defined-elsewhere"></a></h3>
<ul class="indexlist">
<li>
<a data-link-type="biblio" href="#biblio-css-backgrounds-3">[css-backgrounds-3]</a> defines the following terms:
<ul>
<li><a href="http://www.w3.org/TR/css3-background/#background-color">background-color</a>
<li><a href="http://www.w3.org/TR/css3-background/#box-shadow">box-shadow</a>
</ul>
<li>
<a data-link-type="biblio" href="#biblio-css-cascade-3">[css-cascade-3]</a> defines the following terms:
<ul>
<li><a href="http://www.w3.org/TR/css-cascade-3/#valdef-all-inherit">inherit</a>
<li><a href="http://www.w3.org/TR/css-cascade-3/#valdef-all-unset">unset</a>
</ul>
<li>
<a data-link-type="biblio" href="#biblio-css-color-3">[css-color-3]</a> defines the following terms:
<ul>
<li><a href="http://www.w3.org/TR/css3-color/#color0">color</a>
</ul>
<li>
<a data-link-type="biblio" href="#biblio-css-color-4">[css-color-4]</a> defines the following terms:
<ul>
<li><a href="https://drafts.csswg.org/css-color-4/#propdef-opacity">opacity</a>
<li><a href="https://drafts.csswg.org/css-color-4/#valdef-color-transparent">transparent</a>
</ul>
<li>
<a data-link-type="biblio" href="#biblio-css-content-3">[css-content-3]</a> defines the following terms:
<ul>
<li><a href="https://drafts.csswg.org/css-content-3/#propdef-content">content</a>
<li><a href="https://drafts.csswg.org/css-content-3/#valdef-content-none">none</a>
</ul>
<li>
<a data-link-type="biblio" href="#biblio-css-display-3">[css-display-3]</a> defines the following terms:
<ul>
<li><a href="https://drafts.csswg.org/css-display-3/#valdef-display-inline">inline</a>
</ul>
<li>
<a data-link-type="biblio" href="#biblio-css-lists-3">[css-lists-3]</a> defines the following terms:
<ul>
<li><a href="http://www.w3.org/TR/css3-lists/#propdef-list-style-position">list-style-position</a>
</ul>
<li>
<a data-link-type="biblio" href="#biblio-css-page-floats-3">[css-page-floats-3]</a> defines the following terms:
<ul>
<li><a href="https://drafts.csswg.org/css-page-floats/#valdef-float-none">none</a>
</ul>
<li>
<a data-link-type="biblio" href="#biblio-css-text-3">[css-text-3]</a> defines the following terms:
<ul>
<li><a href="http://www.w3.org/TR/css-text-3/#text-align">text-align</a>
</ul>
<li>
<a data-link-type="biblio" href="#biblio-css-text-decor-3">[css-text-decor-3]</a> defines the following terms:
<ul>
<li><a href="http://www.w3.org/TR/css-text-decor-3/#text-decoration">text-decoration</a>
<li><a href="http://www.w3.org/TR/css-text-decor-3/#text-emphasis-color">text-emphasis-color</a>
<li><a href="http://www.w3.org/TR/css-text-decor-3/#text-shadow">text-shadow</a>
</ul>
<li>
<a data-link-type="biblio" href="#biblio-css-ui-3">[css-ui-3]</a> defines the following terms:
<ul>
<li><a href="http://www.w3.org/TR/css3-ui/#propdef-cursor">cursor</a>
<li><a href="http://www.w3.org/TR/css3-ui/#propdef-outline">outline</a>
</ul>
<li>
<a data-link-type="biblio" href="#biblio-css-writing-modes-3">[css-writing-modes-3]</a> defines the following terms:
<ul>
<li><a href="http://www.w3.org/TR/css-writing-modes-3/#propdef-text-combine-upright">text-combine-upright</a>
</ul>
<li>
<a data-link-type="biblio" href="#biblio-css21">[CSS21]</a> defines the following terms:
<ul>
<li><a href="http://www.w3.org/TR/CSS21/visuren.html#propdef-display">display</a>
<li><a href="http://www.w3.org/TR/CSS21/visuren.html#propdef-float">float</a>
</ul>
<li>
<a data-link-type="biblio" href="#biblio-cssom-1">[cssom]</a> defines the following terms:
<ul>
<li><a href="http://www.w3.org/TR/cssom/#cssstyledeclaration">CSSStyleDeclaration</a>
</ul>
<li>
<a data-link-type="biblio" href="#biblio-dom-ls">[dom-ls]</a> defines the following terms:
<ul>
<li><a href="https://dom.spec.whatwg.org/#element">Element</a>
<li><a href="https://dom.spec.whatwg.org/#eventtarget">EventTarget</a>
</ul>
<li>
<a data-link-type="biblio" href="#biblio-html">[HTML]</a> defines the following terms:
<ul>
<li><a href="https://html.spec.whatwg.org/multipage/browsers.html#window">Window</a>
</ul>
</ul>
<h2 class="no-num heading settled" id="references"><span class="content">References</span><a class="self-link" href="#references"></a></h2>
<h3 class="no-num heading settled" id="normative"><span class="content">Normative References</span><a class="self-link" href="#normative"></a></h3>
<dl>
<dt id="biblio-css21"><a class="self-link" href="#biblio-css21"></a>[CSS21]
<dd>Bert Bos; et al. <a href="http://www.w3.org/TR/CSS2">Cascading Style Sheets Level 2 Revision 1 (CSS 2.1) Specification</a>. 7 June 2011. REC. URL: <a href="http://www.w3.org/TR/CSS2">http://www.w3.org/TR/CSS2</a>
<dt id="biblio-css3text"><a class="self-link" href="#biblio-css3text"></a>[CSS3TEXT]
<dd>Elika Etemad; Koji Ishii. <a href="http://www.w3.org/TR/css-text-3/">CSS Text Module Level 3</a>. 10 October 2013. LCWD. URL: <a href="http://www.w3.org/TR/css-text-3/">http://www.w3.org/TR/css-text-3/</a>
<dt id="biblio-dom-level-2-events"><a class="self-link" href="#biblio-dom-level-2-events"></a>[DOM-Level-2-Events]
<dd>Tom Pixley. <a href="http://www.w3.org/TR/DOM-Level-2-Events/">Document Object Model (DOM) Level 2 Events Specification</a>. 13 November 2000. REC. URL: <a href="http://www.w3.org/TR/DOM-Level-2-Events/">http://www.w3.org/TR/DOM-Level-2-Events/</a>
<dt id="biblio-html"><a class="self-link" href="#biblio-html"></a>[HTML]
<dd>Ian Hickson. <a href="https://html.spec.whatwg.org/multipage/">HTML Standard</a>. Living Standard. URL: <a href="https://html.spec.whatwg.org/multipage/">https://html.spec.whatwg.org/multipage/</a>
<dt id="biblio-uax44"><a class="self-link" href="#biblio-uax44"></a>[UAX44]