forked from w3c/csswg-drafts
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathOverview.html
More file actions
4619 lines (3673 loc) · 204 KB
/
Overview.html
File metadata and controls
4619 lines (3673 loc) · 204 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<!DOCTYPE html>
<html lang=en>
<head>
<meta content="text/html; charset=utf-8" http-equiv=Content-Type>
<title>CSS Syntax Module Level 3 (CSS3 Syntax)</title>
<!--
<link href="http://purl.org/dc/terms/" rel="schema.dcterms">
<link href="http://www.w3.org/Consortium/Legal/ipr-notice#Copyright" rel="dcterms.rights">
-->
<meta content="CSS Syntax Module Level 3 (CSS3 Syntax)" name=dcterms.title>
<meta content=text name=dcterms.type>
<meta content=2013-06-19 name=dcterms.date>
<meta content="Tab Atkins Jr." name=dcterms.creator>
<meta content=W3C name=dcterms.publisher>
<meta content="http://dev.w3.org/csswg/css3-syntax/"
name=dcterms.identifier>
<link href="#contents" rel=contents>
<link href="#index" rel=index>
<link href="../default.css" rel=stylesheet type="text/css">
<link href="../csslogo.ico" rel="shortcut icon" type="image/x-icon">
<link href="http://www.w3.org/StyleSheets/TR/W3C-ED.css" rel=stylesheet
type="text/css">
<link href=railroad-diagrams.css rel=stylesheet type="text/css">
<body class=h-entry>
<div class=head> <!--begin-logo-->
<p><a href="http://www.w3.org/"><img alt=W3C height=48
src="http://www.w3.org/Icons/w3c_home" width=72></a> <!--end-logo-->
<h1 class=p-name>CSS Syntax Module Level 3</h1>
<h2 class="no-num no-toc" id=longstatus-date>Editor's Draft <time
class=dt-updated datetime=20130619>19 June 2013</time></h2>
<dl>
<dt>This version:
<dd> <a class=u-url
href="http://dev.w3.org/csswg/css3-syntax/">http://dev.w3.org/csswg/css3-syntax/</a>
<!--
<dt>Latest version:
<dd>
<a href="http://www.w3.org/TR/css3-syntax/">http://www.w3.org/TR/css3-syntax/</a>
-->
<dt>Editor's draft:
<dd> <a
href="http://dev.w3.org/csswg/css3-syntax/">http://dev.w3.org/csswg/css3-syntax/</a>
<dt>Previous version:
<dd> <a href="http://www.w3.org/TR/2003/WD-css3-syntax-20030813/"
rel=previous>http://www.w3.org/TR/2003/WD-css3-syntax-20030813/</a>
<dt>Issue Tracking:
<dd> <a
href="https://www.w3.org/Bugs/Public/buglist.cgi?product=CSS&component=Syntax">W3C
Bugzilla</a>
<dt>Feedback:
<dd> <a
href="mailto:www-style@w3.org?subject=%5Bcss-syntax%5D%20feedback">www-style@w3.org</a>
with subject line “<kbd>[css-syntax] <var>… message topic
…</var></kbd>” (<a
href="http://lists.w3.org/Archives/Public/www-style/"
rel=discussion>archives</a>)
<dt>Editors:
<dd class="p-author h-card vcard"> <a class="p-name fn u-url url"
href="http://www.xanthir.com/" rel=author>Tab Atkins Jr.</a> (<span
class="p-org org">Google, Inc.</span>), <span
class="u-email email">jackalmage@gmail.com</span>
</dl>
<!--begin-copyright-->
<p class=copyright><a
href="http://www.w3.org/Consortium/Legal/ipr-notice#Copyright"
rel=license>Copyright</a> © 2013 <a href="http://www.w3.org/"><abbr
title="World Wide Web Consortium">W3C</abbr></a><sup>®</sup> (<a
href="http://www.csail.mit.edu/"><abbr
title="Massachusetts Institute of Technology">MIT</abbr></a>, <a
href="http://www.ercim.eu/"><abbr
title="European Research Consortium for Informatics and Mathematics">ERCIM</abbr></a>,
<a href="http://www.keio.ac.jp/">Keio</a>, <a
href="http://ev.buaa.edu.cn/">Beihang</a>), All Rights Reserved. W3C <a
href="http://www.w3.org/Consortium/Legal/ipr-notice#Legal_Disclaimer">liability</a>,
<a
href="http://www.w3.org/Consortium/Legal/ipr-notice#W3C_Trademarks">trademark</a>
and <a
href="http://www.w3.org/Consortium/Legal/copyright-documents">document
use</a> rules apply.</p>
<!--end-copyright-->
<hr title="Separator for header">
</div>
<h2 class="no-num no-toc" id=abstract>Abstract</h2>
<p> <a href="http://www.w3.org/TR/CSS/">CSS</a> is a language for
describing the rendering of structured documents (such as HTML and XML) on
screen, on paper, in speech, etc. <span class=p-summary> This module
describes, in general terms, the basic structure and syntax of CSS
stylesheets. It defines, in detail, the syntax and parsing of CSS - how to
turn a stream of bytes into a meaningful stylesheet. </span>
<h2 class="no-num no-toc" id=status>Status of this document</h2>
<!--begin-status-->
<p>This is a public copy of the editors' draft. It is provided for
discussion only and may change at any moment. Its publication here does
not imply endorsement of its contents by W3C. Don't cite this document
other than as work in progress.
<p>The (<a
href="http://lists.w3.org/Archives/Public/www-style/">archived</a>) public
mailing list <a
href="mailto:www-style@w3.org?Subject=%5Bcss3-syntax%5D%20PUT%20SUBJECT%20HERE">
www-style@w3.org</a> (see <a
href="http://www.w3.org/Mail/Request">instructions</a>) is preferred for
discussion of this specification. When sending e-mail, please put the text
“css3-syntax” in the subject, preferably like this:
“[<!---->css3-syntax<!---->] <em>…summary of comment…</em>”
<p>This document was produced by the <a
href="http://www.w3.org/Style/CSS/members">CSS Working Group</a> (part of
the <a href="http://www.w3.org/Style/">Style Activity</a>).
<p>This document was produced by a group operating under the <a
href="http://www.w3.org/Consortium/Patent-Policy-20040205/">5 February
2004 W3C Patent Policy</a>. W3C maintains a <a
href="http://www.w3.org/2004/01/pp-impl/32061/status"
rel=disclosure>public list of any patent disclosures</a> made in
connection with the deliverables of the group; that page also includes
instructions for disclosing a patent. An individual who has actual
knowledge of a patent which the individual believes contains <a
href="http://www.w3.org/Consortium/Patent-Policy-20040205/#def-essential">Essential
Claim(s)</a> must disclose the information in accordance with <a
href="http://www.w3.org/Consortium/Patent-Policy-20040205/#sec-Disclosure">section
6 of the W3C Patent Policy</a>.</p>
<!--end-status-->
<p>The following features are at risk: …
<h2 class="no-num no-toc" id=contents> Table of contents</h2>
<!--begin-toc-->
<ul class=toc>
<li><a href="#intro"><span class=secno>1. </span> Introduction</a>
<ul class=toc>
<li><a href="#placement"><span class=secno>1.1. </span> Module
interactions</a>
</ul>
<li><a href="#syntax-description"><span class=secno>2. </span> Description
of CSS's Syntax</a>
<ul class=toc>
<li><a href="#error-handling"><span class=secno>2.1. </span> Error
Handling</a>
</ul>
<li><a href="#tokenizing-and-parsing-css"><span class=secno>3. </span>
Tokenizing and Parsing CSS</a>
<ul class=toc>
<li><a href="#overview-of-the-parsing-model"><span class=secno>3.1.
</span> Overview of the Parsing Model</a>
<li><a href="#the-input-byte-stream"><span class=secno>3.2. </span> The
input byte stream</a>
<li><a href="#preprocessing-the-input-stream"><span class=secno>3.3.
</span> Preprocessing the input stream</a>
</ul>
<li><a href="#tokenization"><span class=secno>4. </span> Tokenization</a>
<ul class=toc>
<li><a href="#token-diagrams"><span class=secno>4.1. </span> Token
Railroad Diagrams</a>
<li><a href="#definitions"><span class=secno>4.2. </span>
Definitions</a>
<li><a href="#tokenizer-algorithms"><span class=secno>4.3. </span>
Tokenizer Algorithms</a>
<ul class=toc>
<li><a href="#consume-a-token"><span class=secno>4.3.1. </span>
Consume a token</a>
<li><a href="#consume-a-numeric-token"><span class=secno>4.3.2.
</span> Consume a numeric token</a>
<li><a href="#consume-an-ident-like-token"><span class=secno>4.3.3.
</span> Consume an ident-like token</a>
<li><a href="#consume-a-string-token"><span class=secno>4.3.4. </span>
Consume a string token</a>
<li><a href="#consume-a-url-token"><span class=secno>4.3.5. </span>
Consume a url token</a>
<li><a href="#consume-a-unicode-range-token"><span class=secno>4.3.6.
</span> Consume a unicode-range token</a>
<li><a href="#consume-an-escaped-character"><span class=secno>4.3.7.
</span> Consume an escaped character</a>
<li><a href="#check-if-two-characters-are-a-valid-esca"><span
class=secno>4.3.8. </span> Check if two characters are a valid
escape</a>
<li><a href="#check-if-three-characters-would-start-an"><span
class=secno>4.3.9. </span> Check if three characters would start an
identifier</a>
<li><a href="#check-if-three-characters-would-start-a-"><span
class=secno>4.3.10. </span> Check if three characters would start a
number</a>
<li><a href="#consume-a-name"><span class=secno>4.3.11. </span>
Consume a name</a>
<li><a href="#consume-a-number"><span class=secno>4.3.12. </span>
Consume a number</a>
<li><a href="#convert-a-string-to-a-number"><span class=secno>4.3.13.
</span> Convert a string to a number</a>
<li><a href="#consume-the-remnants-of-a-bad-url"><span
class=secno>4.3.14. </span> Consume the remnants of a bad url</a>
<li><a href="#set-the-unicode-ranges-range"><span class=secno>4.3.15.
</span> Set the 〈unicode-range〉’s range</a>
</ul>
</ul>
<li><a href="#parsing"><span class=secno>5. </span> Parsing</a>
<ul class=toc>
<li><a href="#parser-diagrams"><span class=secno>5.1. </span> Parser
Railroad Diagrams</a>
<li><a href="#definitions0"><span class=secno>5.2. </span>
Definitions</a>
<li><a href="#parser-entry-points"><span class=secno>5.3. </span> Parser
Entry Points</a>
<ul class=toc>
<li><a href="#parse-a-stylesheet"><span class=secno>5.3.1. </span>
Parse a stylesheet</a>
<li><a href="#parse-a-list-of-rules"><span class=secno>5.3.2. </span>
Parse a list of rules</a>
<li><a href="#parse-a-rule"><span class=secno>5.3.3. </span> Parse a
rule</a>
<li><a href="#parse-a-declaration"><span class=secno>5.3.4. </span>
Parse a declaration</a>
<li><a href="#parse-a-list-of-declarations"><span class=secno>5.3.5.
</span> Parse a list of declarations</a>
<li><a href="#parse-a-component-value"><span class=secno>5.3.6.
</span> Parse a component value</a>
<li><a href="#parse-a-list-of-component-values"><span
class=secno>5.3.7. </span> Parse a list of component values</a>
</ul>
<li><a href="#parser-algorithms"><span class=secno>5.4. </span> Parser
Algorithms</a>
<ul class=toc>
<li><a href="#consume-a-list-of-rules"><span class=secno>5.4.1.
</span> Consume a list of rules</a>
<li><a href="#consume-an-at-rule"><span class=secno>5.4.2. </span>
Consume an at-rule</a>
<li><a href="#consume-a-qualified-rule"><span class=secno>5.4.3.
</span> Consume a qualified rule</a>
<li><a href="#consume-a-list-of-declarations"><span class=secno>5.4.4.
</span> Consume a list of declarations</a>
<li><a href="#consume-a-declaration"><span class=secno>5.4.5. </span>
Consume a declaration</a>
<li><a href="#consume-a-component-value"><span class=secno>5.4.6.
</span> Consume a component value</a>
<li><a href="#consume-a-simple-block"><span class=secno>5.4.7. </span>
Consume a simple block</a>
<li><a href="#consume-a-function"><span class=secno>5.4.8. </span>
Consume a function</a>
</ul>
</ul>
<li><a href="#anb"><span class=secno>6. </span> The <var>An+B</var>
microsyntax</a>
<ul class=toc>
<li><a href="#anb-syntax"><span class=secno>6.1. </span> Informal Syntax
Description</a>
<li><a href="#the-anb-type"><span class=secno>6.2. </span> The
<code><an+b></code> type</a>
</ul>
<li><a href="#rule-defs"><span class=secno>7. </span> Defining Grammars
for Rules and Other Values</a>
<ul class=toc>
<li><a href="#declaration-rule-list"><span class=secno>7.1. </span>
Defining Block Contents: the <var><declaration-list></var>,
<var><rule-list></var>, and <var><stylesheet></var>
productions</a>
</ul>
<li><a href="#serialization"><span class=secno>8. </span>Serialization</a>
<ul class=toc>
<li><a href="#serializing-anb"><span class=secno>8.1. </span>
Serializing <var><an+b></var></a>
</ul>
<li><a href="#changes"><span class=secno>9. </span>Changes from CSS 2.1
and Selectors Level 3</a>
<li><a href="#conformance"><span class=secno>10. </span> Conformance</a>
<ul class=toc>
<li><a href="#conventions"><span class=secno>10.1. </span> Document
conventions</a>
<li><a href="#conformance-classes"><span class=secno>10.2. </span>
Conformance classes</a>
</ul>
<li class=no-num><a href="#acknowledgments"> Acknowledgments</a>
<li class=no-num><a href="#references"> References</a>
<ul class=toc>
<li class=no-num><a href="#normative-references"> Normative
references</a>
<li class=no-num><a href="#other-references"> Other references</a>
</ul>
<li class=no-num><a href="#index"> Index</a>
<li class=no-num><a href="#property-index"> Property index</a>
</ul>
<!--end-toc-->
<h2 id=intro><span class=secno>1. </span> Introduction</h2>
<p><em>This section is not normative.</em>
<p> This module defines the abstract syntax and parsing of CSS stylesheets
and other things which use CSS syntax (such as the HTML <code>style</code>
attribute).
<p> It defines algorithms for converting a stream of codepoints (in other
words, text) into a stream of CSS tokens, and then further into CSS
objects such as stylesheets, rules, and declarations.
<h3 id=placement><span class=secno>1.1. </span> Module interactions</h3>
<p> This module defines the syntax and parsing of CSS stylesheets. It
supersedes the lexical scanner and grammar defined in CSS 2.1.
<h2 id=syntax-description><span class=secno>2. </span> Description of CSS's
Syntax</h2>
<p><em>This section is not normative.</em>
<p> A CSS document is a series of <a href="#qualified-rule0"><i>qualified
rules</i></a>, which are usually style rules that apply CSS properties to
elements, and <a href="#at-rule"><i>at-rules</i></a>, which define special
processing rules or values for the CSS document.
<p> A <dfn id=qualified-rule>qualified rule</dfn> starts with a prelude
then has a {}-wrapped block containing a sequence of declarations. The
meaning of the prelude varies based on the context that the rule appears
in - for style rules, it's a selector which specifies what elements the
declarations will apply to. Each declaration has a name, followed by a
colon and the declaration value. Declarations are separated by semicolons.
<div class=example>
<p> A typical rule might look something like this:
<pre>
p > a {
color: blue;
text-decoration: underline;
}</pre>
<p> In the above rule, "<code>p > a</code>" is the selector, which, if the
source document is HTML, selects any <code><a></code> elements that
are children of a <code><p></code> element.
<p> "<code>color: blue;</code>" is a declaration specifying that, for the
elements that match the selector, their ‘<code
class=property>color</code>’ property should have the value ‘<code
class=css>blue</code>’. Similiarly, their ‘<code
class=property>text-decoration</code>’ property should have the value
‘<code class=css>underline</code>’.
</div>
<p> <dfn id=at-rules title=at-rule>At-rules</dfn> are all different, but
they have a basic structure in common. They start with an "@" character
followed by their name. Some <a href="#at-rule"><i>at-rules</i></a> are
simple statements, with their name followed by more CSS values to specify
their behavior, and finally ended by a semicolon. Others are blocks; they
can have CSS values following their name, but they end with a {}-wrapped
block, similar to a <a href="#qualified-rule0"><i>qualified rule</i></a>.
Even the contents of these blocks are specific to the given <a
href="#at-rule"><i>at-rule</i></a>: sometimes they contain a sequence of
declarations, like a <a href="#qualified-rule0"><i>qualified rule</i></a>;
other times, they may contain additional blocks, or at-rules, or other
structures altogether.
<div class=example>
<p> Here are several examples of <a href="#at-rule"><i>at-rules</i></a>
that illustrate the varied syntax they may contain.
<pre>@import "my-styles.css";</pre>
<p> The ‘<code class=css>@import</code>’ <a
href="#at-rule"><i>at-rule</i></a> is a simple statement. After its name,
it takes a single string or ‘<code class=css>url()</code>’ function
to indicate the stylesheet that it should import.
<pre>
@page :left {
margin-left: 4cm;
margin-right: 3cm;
}</pre>
<p> The ‘<code class=css>@page</code>’ <a
href="#at-rule"><i>at-rule</i></a> consists of an optional page selector
(the ‘<code class=css>:left</code>’ pseudoclass), followed by a block
of properties that apply to the page when printed. In this way, it's very
similar to a normal <i>style rule</i>, except that its properties don't
apply to any "element", but rather the page itself.
<pre>
@media print {
body { font-size: 10pt }
}</pre>
<p> The ‘<code class=css>@media</code>’ <a
href="#at-rule"><i>at-rule</i></a> begins with a media type and a list of
optional media queries. Its block contains entire rules, which are only
applied when the ‘<code class=css>@media</code>’s conditions are
fulfilled.
</div>
<p> Property names and <a href="#at-rule"><i>at-rule</i></a> names are
always <b>identifiers</b>, which have to start with a letter or a hyphen
followed by a letter, and then can contain letters, numbers, hyphens, or
underscores. You can include any character at all, even ones that CSS uses
in its syntax, by escaping it with a backslash (\) or by using a
hexadecimal escape.
<p> The syntax of selectors is defined in the <a
href="http://www.w3.org/TR/selectors/">Selectors spec</a>. Similarly, the
syntax of the wide variety of CSS values is defined in the <a
href="http://www.w3.org/TR/css3-values/">Values & Units spec</a>. The
special syntaxes of individual <a href="#at-rule"><i>at-rules</i></a> can
be found in the specs that define them.
<h3 id=error-handling><span class=secno>2.1. </span> Error Handling</h3>
<p><em>This section is not normative.</em>
<p> When errors occur in CSS, the parser attempts to recover gracefully,
throwing away only the minimum amount of content before returning to
parsing as normal. This is because errors aren't always mistakes - new
syntax looks like an error to an old parser, and it's useful to be able to
add new syntax to the language without worrying about stylesheets that
include it being completely broken in older UAs.
<p> The precise error-recovery behavior is detailed in the parser itself,
but it's simple enough that a short description is fairly accurate:
<ul>
<li> At the "top level" of a stylesheet, an 〈at-keyword〉 starts an
at-rule. Anything else starts a qualified rule, and is included in the
rule's prelude. This may produce an invalid selector, but that's not the
concern of the CSS parser — at worst, it means the selector will match
nothing.
<li> Once an at-rule starts, nothing is invalid from the parser's
standpoint; it's all part of the at-rule's prelude. Encountering a
semicolon 〈;〉 ends the at-rule immediately, while encountering an
opening curly-brace 〈{〉 starts the at-rule's body. The at-rule seeks
forward, matching blocks (content surrounded by (), {}, or []) until it
finds a closing curly-brace 〈}〉 that isn't matched by anything else
or inside of another block. The contents of the at-rule are then
interpreted according to the at-rule's own grammar.
<li> Qualified rules work similarly, except that semicolons don't end
them; instead, they are just taken in as part of the rule's prelude. When
the first {} block is found, the contents are always interpreted as a
list of declarations.
<li> When interpreting a list of declarations, unknown syntax at any point
causes the parser to throw away whatever declaration it's currently
building, and seek forward until it finds a semicolon (or the end of the
block). It then starts fresh, trying to parse a declaration again.
<li> If the stylesheet ends while any rule, declaration, function, string,
etc. are still open, everything is automatically closed. This doesn't
make them invalid, though they may be incomplete and thus thrown away
when they are verified against their grammar.
</ul>
<h2 id=tokenizing-and-parsing-css><span class=secno>3. </span> Tokenizing
and Parsing CSS</h2>
<p> User agents must use the parsing rules described in this specification
to generate the CSSOM trees from text/css resources. Together, these rules
define what is referred to as the CSS parser.
<p> This specification defines the parsing rules for CSS documents, whether
they are syntactically correct or not. Certain points in the parsing
algorithm are said to be a <dfn id=parse-errors title="parse error">parse
errors</dfn>. The error handling for parse errors is well-defined: user
agents must either act as described below when encountering such problems,
or must abort processing at the first error that they encounter for which
they do not wish to apply the rules described below.
<p> Conformance checkers must report at least one parse error condition to
the user if one or more parse error conditions exist in the document and
must not report parse error conditions if none exist in the document.
Conformance checkers may report more than one parse error condition if
more than one parse error condition exists in the document. Conformance
checkers are not required to recover from parse errors, but if they do,
they must recover in the same way as user agents.
<h3 id=overview-of-the-parsing-model><span class=secno>3.1. </span>
Overview of the Parsing Model</h3>
<p> The input to the CSS parsing process consists of a stream of Unicode
code points, which is passed through a tokenization stage followed by a
tree construction stage. The output is a CSSStyleSheet object.
<p class=note> Implementations that do not support scripting do not have to
actually create a CSSOM CSSStyleSheet object, but the CSSOM tree in such
cases is still used as the model for the rest of the specification.
<h3 id=the-input-byte-stream><span class=secno>3.2. </span> The input byte
stream</h3>
<p> When parsing a stylesheet, the stream of Unicode code points that
comprises the input to the tokenization stage may be initially seen by the
user agent as a stream of bytes (typically coming over the network or from
the local file system). The bytes encode the actual characters according
to a particular character encoding, which the user agent must use to
decode the bytes into characters.
<p> To decode the stream of bytes into a stream of characters, UAs must
follow these steps.
<p> The algorithms to <a
href="http://encoding.spec.whatwg.org/#concept-encoding-get"><dfn
id=get-an-encoding>get an encoding</dfn></a> and <a
href="http://encoding.spec.whatwg.org/#decode"><dfn
id=decode>decode</dfn></a> are defined in the <a
href="http://encoding.spec.whatwg.org/">Encoding Standard</a>.
<p> First, determine the fallback encoding:
<ol>
<li> If HTTP or equivalent protocol defines an encoding (e.g. via the
charset parameter of the Content-Type header), <a
href="#get-an-encoding"><i>get an encoding</i></a> for the specified
value. If that does not return failure, use the return value as the
fallback encoding.
<li> Otherwise, check the byte stream. If the first several bytes match
the hex sequence
<pre>40 63 68 61 72 73 65 74 20 22 (not 22)* 22 3B</pre>
then <a href="#get-an-encoding"><i>get an encoding</i></a> for the
sequence of <code>(not 22)*</code> bytes, decoded per
<code>windows-1252</code>.
<p class=note> Note: Anything ASCII-compatible will do, so using
<code>windows-1252</code> is fine.
<p class=note> Note: The byte sequence above, when decoded as ASCII, is
the string "<code>@charset "…";</code>", where the "…" is the
sequence of bytes corresponding to the encoding's name.
<p> If the return value was <code>utf-16</code> or <code>utf-16be</code>,
use <code>utf-8</code> as the fallback encoding; if it was anything else
except failure, use the return value as the fallback encoding.
<p class=note> This mimics HTML <code><meta></code> behavior.
<li> Otherwise, <a href="#get-an-encoding"><i>get an encoding</i></a> for
the value of the <code>charset</code> attribute on the
<code><link></code> element or <code><?xml-stylesheet?></code>
processing instruction that caused the style sheet to be included, if
any. If that does not return failure, use the return value as the
fallback encoding.
<li> Otherwise, if the referring style sheet or document has an encoding,
use that as the fallback encoding.
<li> Otherwise, use <code>utf-8</code> as the fallback encoding.
</ol>
<p> Then, <a href="#decode"><i>decode</i></a> the byte stream using the
fallback encoding.
<p class=note> Note: the <a href="#decode"><i>decode</i></a> algorithm lets
the byte order mark (BOM) take precedence, hence the usage of the term
"fallback" above.
<p class=issue> Anne says that steps 3/4 should be an input to this
algorithm from the specs that define importing stylesheet, to make the
algorithm as a whole cleaner. Perhaps abstract it into the concept of an
"environment charset" or something?
<p class=issue> Should we only take the charset from the referring document
if it's same-origin?
<h3 id=preprocessing-the-input-stream><span class=secno>3.3. </span>
Preprocessing the input stream</h3>
<p> The input stream consists of the characters (individual unicode
code-points) pushed into it as the input byte stream is decoded.
<p> Before sending the input stream to the tokenizer, implementations must
make the following character substitutions:
<ul>
<li> Replace any U+000D CARRIAGE RETURN (CR) characters, U+000C FORM FEED
(FF) characters, or pairs of U+000D CARRIAGE RETURN (CR) followed by
U+000A LINE FEED (LF) by a single U+000A LINE FEED (LF) character.
<li> Replace any U+0000 NULL characters with U+FFFD REPLACEMENT CHARACTER
(�).
</ul>
<h2 id=tokenization><span class=secno>4. </span> Tokenization</h2>
<p> Implementations must act as if they used the following algorithms to
tokenize CSS. To transform a stream of characters into a stream of tokens,
repeatedly <a href="#consume-a-token0"><i>consume a token</i></a> until an
〈EOF〉 is encountered, collecting the returned tokens into a stream.
Each call to the <a href="#consume-a-token0"><i>consume a token</i></a>
algorithm returns a single token, so it can also be used "on-demand" to
tokenize a stream of characters <em>during</em> parsing, if so desired.
<p> The output of the tokenization step is a stream of zero or more of the
following tokens: 〈ident〉, 〈function〉, 〈at-keyword〉,
〈hash〉, 〈string〉, 〈bad-string〉, 〈url〉, 〈bad-url〉,
〈delim〉, 〈number〉, 〈percentage〉, 〈dimension〉,
〈unicode-range〉, 〈include-match〉, 〈dash-match〉,
〈prefix-match〉, 〈suffix-match〉, 〈substring-match〉,
〈column〉, 〈whitespace〉, 〈CDO〉, 〈CDC〉, 〈colon〉,
〈semicolon〉, 〈comma〉, 〈[〉, 〈]〉, 〈(〉, 〈)〉, 〈{〉,
and 〈}〉.
<ul>
<li> 〈ident〉, 〈function〉, 〈at-keyword〉, 〈hash〉,
〈string〉, and 〈url〉 tokens have a value composed of zero or more
characters. Additionally, hash tokens have a type flag set to either "id"
or "unrestricted". The type flag defaults to "unrestricted" if not
otherwise set.
<li> 〈delim〉 tokens have a value composed of a single character.
<li> 〈number〉, 〈percentage〉, and 〈dimension〉 tokens have a
representation composed of one or more character, and a numeric value.
〈number〉 and 〈dimension〉 tokens additionally have a type flag set
to either "integer" or "number". The type flag defaults to "integer" if
not otherwise set. 〈dimension〉 tokens additionally have a unit
composed of one or more characters.
<li> 〈unicode-range〉 tokens have a range of characters.
</ul>
<p class=note> The type flag of hash tokens is used in the Selectors syntax
<a href="#SELECT" rel=biblioentry>[SELECT]<!--{{SELECT}}--></a>. Only hash
tokens with the "id" type are valid <a
href="http://www.w3.org/TR/selectors/#id-selectors">ID selectors</a>.
<p class=note> As a technical note, the tokenizer defined here requires
only three characters of look-ahead. The tokens it produces are designed
to allow Selectors to be parsed with one token of look-ahead, and
additional tokens may be added in the future to maintain this invariant.
<h3 id=token-diagrams><span class=secno>4.1. </span> Token Railroad
Diagrams</h3>
<p> <em>This section is non-normative.</em>
<p> This section presents an informative view of the tokenizer, in the form
of railroad diagrams. Railroad diagrams are more compact than an explicit
parser, but often easier to read than an regular expression.
<p> These diagrams are <em>informative</em> and <em>incomplete</em>; they
describe the grammar of "correct" tokens, but do not describe
error-handling at all. They are provided solely to make it easier to get
an intuitive grasp of the syntax of each token.
<p> Diagrams with names between 〈〉 brackets represent tokens. The rest
are productions referred to by other diagrams. <!--
The "source" of these diagrams is in ./Diagrams.src.html
The generated SVG is copied here so that JavaScript is not required
to view the spec.
-->
<dl>
<dt id=comment-diagram>comment
<dd><svg class=railroad-diagram height=81 width=497><g
transform="translate(.5 .5)"><path
d="M 20 31 v 20 m 10 -20 v 20 m -10 -10 h 20.5"></path><path
d="M40 41h10"></path><g><path d="M50 41h0"></path><path
d="M86 41h0"></path><rect height=22 rx=10 ry=10 width=36 x=50
y=30></rect><text x=68 y=45>/*</text></g><path
d="M86 41h10"></path><g><path d="M96 41h0"></path><path
d="M400 41h0"></path><path
d="M96 41a10 10 0 0 0 10 -10v0a10 10 0 0 1 10 -10"></path><g><path
d="M116 21h264"></path></g><path
d="M380 21a10 10 0 0 1 10 10v0a10 10 0 0 0 10 10"></path><path
d="M96 41h20"></path><g><path d="M116 41h0"></path><path
d="M380 41h0"></path><path d="M116 41h10"></path><g><path
d="M126 41h0"></path><path d="M370 41h0"></path><rect height=22 width=244
x=126 y=30></rect><text x=248 y=45>anything but * followed by
/</text></g><path d="M370 41h10"></path><path
d="M126 41a10 10 0 0 0 -10 10v0a10 10 0 0 0 10 10"></path><g><path
d="M126 61h244"></path></g><path
d="M370 61a10 10 0 0 0 10 -10v0a10 10 0 0 0 -10 -10"></path></g><path
d="M380 41h20"></path></g><path d="M400 41h10"></path><g><path
d="M410 41h0"></path><path d="M446 41h0"></path><rect height=22 rx=10
ry=10 width=36 x=410 y=30></rect><text x=428 y=45>*/</text></g><path
d="M446 41h10"></path><path
d="M 456 41 h 20 m -10 -10 v 20 m 10 -20 v 20"></path></g></svg>
<dt id=newline-diagram>newline
<dd><svg class=railroad-diagram height=152 width=173><g
transform="translate(.5 .5)"><path
d="M 20 21 v 20 m 10 -20 v 20 m -10 -10 h 20.5"></path><g><path
d="M40 31h0"></path><path d="M132 31h0"></path><path
d="M40 31h20"></path><g><path d="M60 31h8"></path><path
d="M104 31h8"></path><rect height=22 rx=10 ry=10 width=36 x=68
y=20></rect><text x=86 y=35>\n</text></g><path
d="M112 31h20"></path><path
d="M40 31a10 10 0 0 1 10 10v10a10 10 0 0 0 10 10"></path><g><path
d="M60 61h0"></path><path d="M112 61h0"></path><rect height=22 rx=10
ry=10 width=52 x=60 y=50></rect><text x=86 y=65>\r\n</text></g><path
d="M112 61a10 10 0 0 0 10 -10v-10a10 10 0 0 1 10 -10"></path><path
d="M40 31a10 10 0 0 1 10 10v40a10 10 0 0 0 10 10"></path><g><path
d="M60 91h8"></path><path d="M104 91h8"></path><rect height=22 rx=10
ry=10 width=36 x=68 y=80></rect><text x=86 y=95>\r</text></g><path
d="M112 91a10 10 0 0 0 10 -10v-40a10 10 0 0 1 10 -10"></path><path
d="M40 31a10 10 0 0 1 10 10v70a10 10 0 0 0 10 10"></path><g><path
d="M60 121h8"></path><path d="M104 121h8"></path><rect height=22 rx=10
ry=10 width=36 x=68 y=110></rect><text x=86 y=125>\f</text></g><path
d="M112 121a10 10 0 0 0 10 -10v-70a10 10 0 0 1 10 -10"></path></g><path
d="M 132 31 h 20 m -10 -10 v 20 m 10 -20 v 20"></path></g></svg>
<dt id=whitespace-character-diagram>whitespace character
<dd><svg class=railroad-diagram height=122 width=197><g
transform="translate(.5 .5)"><path
d="M 20 21 v 20 m 10 -20 v 20 m -10 -10 h 20.5"></path><g><path
d="M40 31h0"></path><path d="M156 31h0"></path><path
d="M40 31h20"></path><g><path d="M60 31h8"></path><path
d="M128 31h8"></path><rect height=22 rx=10 ry=10 width=60 x=68
y=20></rect><text x=98 y=35>space</text></g><path
d="M136 31h20"></path><path
d="M40 31a10 10 0 0 1 10 10v10a10 10 0 0 0 10 10"></path><g><path
d="M60 61h20"></path><path d="M116 61h20"></path><rect height=22 rx=10
ry=10 width=36 x=80 y=50></rect><text x=98 y=65>\t</text></g><path
d="M136 61a10 10 0 0 0 10 -10v-10a10 10 0 0 1 10 -10"></path><path
d="M40 31a10 10 0 0 1 10 10v40a10 10 0 0 0 10 10"></path><g><path
d="M60 91h0"></path><path d="M136 91h0"></path><rect height=22 width=76
x=60 y=80></rect><text x=98 y=95>newline</text></g><path
d="M136 91a10 10 0 0 0 10 -10v-40a10 10 0 0 1 10 -10"></path></g><path
d="M 156 31 h 20 m -10 -10 v 20 m 10 -20 v 20"></path></g></svg>
<dt id=escape-diagram>escape
<dd><svg class=railroad-diagram height=122 width=521><g
transform="translate(.5 .5)"><path
d="M 20 21 v 20 m 10 -20 v 20 m -10 -10 h 20.5"></path><path
d="M40 31h10"></path><g><path d="M50 31h0"></path><path
d="M78 31h0"></path><rect height=22 rx=10 ry=10 width=28 x=50
y=20></rect><text x=64 y=35>\</text></g><path
d="M78 31h10"></path><g><path d="M88 31h0"></path><path
d="M480 31h0"></path><path d="M88 31h20"></path><g><path
d="M108 31h70"></path><path d="M390 31h70"></path><rect height=22
width=212 x=178 y=20></rect><text x=284 y=35>not newline or hex
digit</text></g><path d="M460 31h20"></path><path
d="M88 31a10 10 0 0 1 10 10v10a10 10 0 0 0 10 10"></path><g><path
d="M108 61h0"></path><path d="M460 61h0"></path><path
d="M108 61h10"></path><g><path d="M118 61h0"></path><path
d="M230 61h0"></path><path d="M118 61h10"></path><g><path
d="M128 61h0"></path><path d="M220 61h0"></path><rect height=22 width=92
x=128 y=50></rect><text x=174 y=65>hex digit</text></g><path
d="M220 61h10"></path><path
d="M128 61a10 10 0 0 0 -10 10v10a10 10 0 0 0 10 10"></path><g><path
d="M128 91h9.5"></path><path d="M210.5 91h9.5"></path><text class=comment
x=174 y=96>1-6 times</text></g><path
d="M220 91a10 10 0 0 0 10 -10v-10a10 10 0 0 0 -10 -10"></path></g><path
d="M230 61h10"></path><g><path d="M240 61h0"></path><path
d="M460 61h0"></path><path d="M240 61h20"></path><g><path
d="M260 61h180"></path></g><path d="M440 61h20"></path><path
d="M240 61a10 10 0 0 1 10 10v0a10 10 0 0 0 10 10"></path><g><path
d="M260 81h0"></path><path d="M440 81h0"></path><rect height=22 width=180
x=260 y=70></rect><text x=350 y=85>whitespace character</text></g><path
d="M440 81a10 10 0 0 0 10 -10v0a10 10 0 0 1 10 -10"></path></g></g><path
d="M460 61a10 10 0 0 0 10 -10v-10a10 10 0 0 1 10 -10"></path></g><path
d="M 480 31 h 20 m -10 -10 v 20 m 10 -20 v 20"></path></g></svg>
<dt id="〈whitespace〉-diagram">〈whitespace〉
<dd><svg class=railroad-diagram height=71 width=301><g
transform="translate(.5 .5)"><path
d="M 20 21 v 20 m 10 -20 v 20 m -10 -10 h 20.5"></path><path
d="M40 31h10"></path><g><path d="M50 31h0"></path><path
d="M250 31h0"></path><path d="M50 31h10"></path><g><path
d="M60 31h0"></path><path d="M240 31h0"></path><rect height=22 width=180
x=60 y=20></rect><text x=150 y=35>whitespace character</text></g><path
d="M240 31h10"></path><path
d="M60 31a10 10 0 0 0 -10 10v0a10 10 0 0 0 10 10"></path><g><path
d="M60 51h180"></path></g><path
d="M240 51a10 10 0 0 0 10 -10v0a10 10 0 0 0 -10 -10"></path></g><path
d="M250 31h10"></path><path
d="M 260 31 h 20 m -10 -10 v 20 m 10 -20 v 20"></path></g></svg>
<dt id="〈ident〉-diagram">〈ident〉
<dd><svg class=railroad-diagram height=110 width=729><g
transform="translate(.5 .5)"><path
d="M 20 31 v 20 m 10 -20 v 20 m -10 -10 h 20.5"></path><g><path
d="M40 41h0"></path><path d="M108 41h0"></path><path
d="M40 41h20"></path><g><path d="M60 41h28"></path></g><path
d="M88 41h20"></path><path
d="M40 41a10 10 0 0 1 10 10v0a10 10 0 0 0 10 10"></path><g><path
d="M60 61h0"></path><path d="M88 61h0"></path><rect height=22 rx=10 ry=10
width=28 x=60 y=50></rect><text x=74 y=65>-</text></g><path
d="M88 61a10 10 0 0 0 10 -10v0a10 10 0 0 1 10 -10"></path></g><g><path
d="M108 41h0"></path><path d="M344 41h0"></path><path
d="M108 41h20"></path><g><path d="M128 41h0"></path><path
d="M324 41h0"></path><rect height=22 width=196 x=128 y=30></rect><text
x=226 y=45>a-z A-Z _ or non-ASCII</text></g><path
d="M324 41h20"></path><path
d="M108 41a10 10 0 0 1 10 10v10a10 10 0 0 0 10 10"></path><g><path
d="M128 71h64"></path><path d="M260 71h64"></path><rect height=22
width=68 x=192 y=60></rect><text x=226 y=75>escape</text></g><path
d="M324 71a10 10 0 0 0 10 -10v-10a10 10 0 0 1 10 -10"></path></g><g><path
d="M344 41h0"></path><path d="M688 41h0"></path><path
d="M344 41a10 10 0 0 0 10 -10v0a10 10 0 0 1 10 -10"></path><g><path
d="M364 21h304"></path></g><path
d="M668 21a10 10 0 0 1 10 10v0a10 10 0 0 0 10 10"></path><path
d="M344 41h20"></path><g><path d="M364 41h0"></path><path
d="M668 41h0"></path><path d="M364 41h10"></path><g><path
d="M374 41h0"></path><path d="M658 41h0"></path><path
d="M374 41h20"></path><g><path d="M394 41h0"></path><path
d="M638 41h0"></path><rect height=22 width=244 x=394 y=30></rect><text
x=516 y=45>a-z A-Z 0-9 _ - or non-ASCII</text></g><path
d="M638 41h20"></path><path
d="M374 41a10 10 0 0 1 10 10v10a10 10 0 0 0 10 10"></path><g><path
d="M394 71h88"></path><path d="M550 71h88"></path><rect height=22
width=68 x=482 y=60></rect><text x=516 y=75>escape</text></g><path
d="M638 71a10 10 0 0 0 10 -10v-10a10 10 0 0 1 10 -10"></path></g><path
d="M658 41h10"></path><path
d="M374 41a10 10 0 0 0 -10 10v29a10 10 0 0 0 10 10"></path><g><path
d="M374 90h284"></path></g><path
d="M658 90a10 10 0 0 0 10 -10v-29a10 10 0 0 0 -10 -10"></path></g><path
d="M668 41h20"></path></g><path
d="M 688 41 h 20 m -10 -10 v 20 m 10 -20 v 20"></path></g></svg>
<dt id="〈function〉-diagram">〈function〉
<dd><svg class=railroad-diagram height=62 width=225><g
transform="translate(.5 .5)"><path
d="M 20 21 v 20 m 10 -20 v 20 m -10 -10 h 20.5"></path><path
d="M40 31h10"></path><g><path d="M50 31h0"></path><path
d="M126 31h0"></path><rect height=22 width=76 x=50 y=20></rect><text x=88
y=35>〈ident〉</text></g><path d="M126 31h10"></path><path
d="M136 31h10"></path><g><path d="M146 31h0"></path><path
d="M174 31h0"></path><rect height=22 rx=10 ry=10 width=28 x=146
y=20></rect><text x=160 y=35>(</text></g><path
d="M174 31h10"></path><path
d="M 184 31 h 20 m -10 -10 v 20 m 10 -20 v 20"></path></g></svg>
<dt id="〈at-keyword〉-diagram">〈at-keyword〉
<dd><svg class=railroad-diagram height=62 width=225><g
transform="translate(.5 .5)"><path
d="M 20 21 v 20 m 10 -20 v 20 m -10 -10 h 20.5"></path><path
d="M40 31h10"></path><g><path d="M50 31h0"></path><path
d="M78 31h0"></path><rect height=22 rx=10 ry=10 width=28 x=50
y=20></rect><text x=64 y=35>@</text></g><path d="M78 31h10"></path><path
d="M88 31h10"></path><g><path d="M98 31h0"></path><path
d="M174 31h0"></path><rect height=22 width=76 x=98 y=20></rect><text
x=136 y=35>〈ident〉</text></g><path d="M174 31h10"></path><path
d="M 184 31 h 20 m -10 -10 v 20 m 10 -20 v 20"></path></g></svg>
<dt id="〈hash〉-diagram">〈hash〉
<dd><svg class=railroad-diagram height=100 width=453><g
transform="translate(.5 .5)"><path
d="M 20 21 v 20 m 10 -20 v 20 m -10 -10 h 20.5"></path><path
d="M40 31h10"></path><g><path d="M50 31h0"></path><path
d="M78 31h0"></path><rect height=22 rx=10 ry=10 width=28 x=50
y=20></rect><text x=64 y=35>#</text></g><path d="M78 31h10"></path><path
d="M88 31h10"></path><g><path d="M98 31h0"></path><path
d="M402 31h0"></path><path d="M98 31h10"></path><g><path
d="M108 31h0"></path><path d="M392 31h0"></path><path
d="M108 31h20"></path><g><path d="M128 31h0"></path><path
d="M372 31h0"></path><rect height=22 width=244 x=128 y=20></rect><text
x=250 y=35>a-z A-Z 0-9 _ - or non-ASCII</text></g><path
d="M372 31h20"></path><path
d="M108 31a10 10 0 0 1 10 10v10a10 10 0 0 0 10 10"></path><g><path
d="M128 61h88"></path><path d="M284 61h88"></path><rect height=22
width=68 x=216 y=50></rect><text x=250 y=65>escape</text></g><path
d="M372 61a10 10 0 0 0 10 -10v-10a10 10 0 0 1 10 -10"></path></g><path
d="M392 31h10"></path><path
d="M108 31a10 10 0 0 0 -10 10v29a10 10 0 0 0 10 10"></path><g><path
d="M108 80h284"></path></g><path
d="M392 80a10 10 0 0 0 10 -10v-29a10 10 0 0 0 -10 -10"></path></g><path
d="M402 31h10"></path><path
d="M 412 31 h 20 m -10 -10 v 20 m 10 -20 v 20"></path></g></svg>
<dt id="〈string〉-diagram">〈string〉
<dd><svg class=railroad-diagram height=248 width=481><g
transform="translate(.5 .5)"><path
d="M 20 31 v 20 m 10 -20 v 20 m -10 -10 h 20.5"></path><g><path
d="M40 41h0"></path><path d="M440 41h0"></path><path
d="M40 41h20"></path><g><path d="M60 41h0"></path><path
d="M420 41h0"></path><path d="M60 41h10"></path><g><path
d="M70 41h0"></path><path d="M98 41h0"></path><rect height=22 rx=10 ry=10
width=28 x=70 y=30></rect><text x=84 y=45>"</text></g><path
d="M98 41h10"></path><g><path d="M108 41h0"></path><path
d="M372 41h0"></path><path
d="M108 41a10 10 0 0 0 10 -10v0a10 10 0 0 1 10 -10"></path><g><path
d="M128 21h224"></path></g><path
d="M352 21a10 10 0 0 1 10 10v0a10 10 0 0 0 10 10"></path><path
d="M108 41h20"></path><g><path d="M128 41h0"></path><path
d="M352 41h0"></path><path d="M128 41h10"></path><g><path
d="M138 41h0"></path><path d="M342 41h0"></path><path
d="M138 41h20"></path><g><path d="M158 41h0"></path><path
d="M322 41h0"></path><rect height=22 width=164 x=158 y=30></rect><text
x=240 y=45>not " \ or newline</text></g><path d="M322 41h20"></path><path
d="M138 41a10 10 0 0 1 10 10v10a10 10 0 0 0 10 10"></path><g><path
d="M158 71h48"></path><path d="M274 71h48"></path><rect height=22
width=68 x=206 y=60></rect><text x=240 y=75>escape</text></g><path
d="M322 71a10 10 0 0 0 10 -10v-10a10 10 0 0 1 10 -10"></path><path
d="M138 41a10 10 0 0 1 10 10v40a10 10 0 0 0 10 10"></path><g><path
d="M158 101h10"></path><path d="M312 101h10"></path><path
d="M168 101h10"></path><g><path d="M178 101h0"></path><path
d="M206 101h0"></path><rect height=22 rx=10 ry=10 width=28 x=178
y=90></rect><text x=192 y=105>\</text></g><path
d="M206 101h10"></path><path d="M216 101h10"></path><g><path
d="M226 101h0"></path><path d="M302 101h0"></path><rect height=22
width=76 x=226 y=90></rect><text x=264 y=105>newline</text></g><path
d="M302 101h10"></path></g><path
d="M322 101a10 10 0 0 0 10 -10v-40a10 10 0 0 1 10 -10"></path></g><path
d="M342 41h10"></path><path
d="M138 41a10 10 0 0 0 -10 10v59a10 10 0 0 0 10 10"></path><g><path
d="M138 120h204"></path></g><path
d="M342 120a10 10 0 0 0 10 -10v-59a10 10 0 0 0 -10 -10"></path></g><path
d="M352 41h20"></path></g><path d="M372 41h10"></path><g><path
d="M382 41h0"></path><path d="M410 41h0"></path><rect height=22 rx=10
ry=10 width=28 x=382 y=30></rect><text x=396 y=45>"</text></g><path
d="M410 41h10"></path></g><path d="M420 41h20"></path><path
d="M40 41a10 10 0 0 1 10 10v88a10 10 0 0 0 10 10"></path><g><path
d="M60 149h0"></path><path d="M420 149h0"></path><path
d="M60 149h10"></path><g><path d="M70 149h0"></path><path
d="M98 149h0"></path><rect height=22 rx=10 ry=10 width=28 x=70
y=138></rect><text x=84 y=153>'</text></g><path
d="M98 149h10"></path><g><path d="M108 149h0"></path><path
d="M372 149h0"></path><path
d="M108 149a10 10 0 0 0 10 -10v0a10 10 0 0 1 10 -10"></path><g><path
d="M128 129h224"></path></g><path
d="M352 129a10 10 0 0 1 10 10v0a10 10 0 0 0 10 10"></path><path
d="M108 149h20"></path><g><path d="M128 149h0"></path><path
d="M352 149h0"></path><path d="M128 149h10"></path><g><path
d="M138 149h0"></path><path d="M342 149h0"></path><path
d="M138 149h20"></path><g><path d="M158 149h0"></path><path
d="M322 149h0"></path><rect height=22 width=164 x=158 y=138></rect><text
x=240 y=153>not ' \ or newline</text></g><path
d="M322 149h20"></path><path
d="M138 149a10 10 0 0 1 10 10v10a10 10 0 0 0 10 10"></path><g><path
d="M158 179h48"></path><path d="M274 179h48"></path><rect height=22
width=68 x=206 y=168></rect><text x=240 y=183>escape</text></g><path
d="M322 179a10 10 0 0 0 10 -10v-10a10 10 0 0 1 10 -10"></path><path
d="M138 149a10 10 0 0 1 10 10v40a10 10 0 0 0 10 10"></path><g><path
d="M158 209h10"></path><path d="M312 209h10"></path><path