css3-syntax/Overview.html

Wed, 13 Feb 2013 18:35:14 -0800

author
Tab Atkins Jr. <jackalmage@gmail.com>
date
Wed, 13 Feb 2013 18:35:14 -0800
changeset 7465
550ce5a48ffb
parent 7464
a1add5340f0f
child 7466
b15ae85d44af
permissions
-rw-r--r--

[css3-syntax] Rewrite the charset determining step to be a little clearer, and closer to my normal language.

jackalmage@5473 1 <!DOCTYPE html>
jackalmage@5473 2
jackalmage@5473 3 <html lang=en>
jackalmage@6819 4 <head>
jackalmage@6670 5 <meta content="text/html; charset=utf-8" http-equiv=Content-Type>
jackalmage@5473 6 <title>CSS Syntax Module Level 3 (CSS3 Syntax)</title>
jackalmage@6819 7 <!--
jackalmage@6819 8 <link href="http://purl.org/dc/terms/" rel="schema.dcterms">
jackalmage@6819 9 <link href="http://www.w3.org/Consortium/Legal/ipr-notice#Copyright" rel="dcterms.rights">
jackalmage@6819 10 -->
jackalmage@6819 11
jackalmage@6819 12 <meta content="CSS Syntax Module Level 3 (CSS3 Syntax)" name=dcterms.title>
jackalmage@6819 13 <meta content=text name=dcterms.type>
jackalmage@7462 14 <meta content=2013-02-14 name=dcterms.issued>
jackalmage@6819 15 <meta content="http://dev.w3.org/csswg/css3-syntax/" name=dcterms.creator>
jackalmage@6819 16 <meta content=W3C name=dcterms.publisher>
jackalmage@7462 17 <meta content="http://www.w3.org/TR/2013/ED-css3-syntax-20130214/"
jackalmage@6819 18 name=dcterms.identifier>
jackalmage@5473 19 <link href="#contents" rel=contents>
jackalmage@5473 20 <link href="#index" rel=index>
jackalmage@5473 21 <link href="../default.css" rel=stylesheet type="text/css">
jackalmage@7275 22 <link href="../csslogo.ico" rel="shortcut icon" type="image/x-icon">
jackalmage@5473 23 <link href="http://www.w3.org/StyleSheets/TR/W3C-ED.css" rel=stylesheet
jackalmage@6670 24 type="text/css">
simon@7048 25 <link href=railroad-diagrams.css rel=stylesheet type="text/css">
jackalmage@5473 26
jackalmage@5473 27 <body>
jackalmage@5473 28 <div class=head> <!--begin-logo-->
jackalmage@5473 29 <p><a href="http://www.w3.org/"><img alt=W3C height=48
jackalmage@5473 30 src="http://www.w3.org/Icons/w3c_home" width=72></a> <!--end-logo-->
jackalmage@5473 31
jackalmage@5473 32 <h1>CSS Syntax Module Level 3</h1>
jackalmage@5473 33
jackalmage@7462 34 <h2 class="no-num no-toc" id=longstatus-date>Editor's Draft 14 February
jackalmage@7192 35 2013</h2>
jackalmage@5473 36
jackalmage@5473 37 <dl>
jackalmage@5473 38 <dt>This version:
jackalmage@5473 39
jackalmage@5549 40 <dd> <a
jackalmage@5549 41 href="http://dev.w3.org/csswg/css3-syntax/">http://dev.w3.org/csswg/css3-syntax/</a>
jackalmage@5549 42 <!--
jackalmage@5549 43 <dt>Latest version:
jackalmage@5549 44 <dd>
jackalmage@5549 45 <a href="http://www.w3.org/TR/css3-syntax/">http://www.w3.org/TR/css3-syntax/</a>
jackalmage@5549 46 -->
jackalmage@5473 47
jackalmage@5549 48 <dt>Editor's draft:
jackalmage@5549 49
jackalmage@5549 50 <dd> <a
jackalmage@5549 51 href="http://dev.w3.org/csswg/css3-syntax/">http://dev.w3.org/csswg/css3-syntax/</a>
jackalmage@5473 52
jackalmage@5549 53 <dt>Previous version:
jackalmage@5549 54
jackalmage@5549 55 <dd> <a
jackalmage@5549 56 href="http://www.w3.org/TR/2003/WD-css3-syntax-20030813/">http://www.w3.org/TR/2003/WD-css3-syntax-20030813/</a>
jackalmage@5473 57
jackalmage@5473 58 <dt>Issue Tracking:
jackalmage@5473 59
jackalmage@5549 60 <dd> <a
jackalmage@5549 61 href="https://www.w3.org/Bugs/Public/buglist.cgi?product=CSS&component=Syntax">W3C
jackalmage@5549 62 Bugzilla</a>
jackalmage@5473 63
jackalmage@5473 64 <dt>Feedback:
jackalmage@5473 65
jackalmage@5549 66 <dd> <a
jackalmage@5473 67 href="http://lists.w3.org/Archives/Public/www-style/">www-style@w3.org</a>
jackalmage@5898 68 with subject line “<kbd>[css3-syntax] <var>… message topic
jackalmage@5898 69 …</var></kbd>”
jackalmage@5473 70
jackalmage@5473 71 <dt>Editors:
jackalmage@5473 72
jackalmage@5473 73 <dd class="h-card vcard"> <a class="p-name fn u-url url"
jackalmage@5549 74 href="http://www.xanthir.com/" rel=author>Tab Atkins Jr.</a> (<span
jackalmage@5549 75 class="p-org org">Google, Inc.</span>), <span
jackalmage@5549 76 class="u-email email">jackalmage@gmail.com</span>
jackalmage@5473 77 </dl>
jackalmage@5473 78 <!--begin-copyright-->
jackalmage@5473 79 <p class=copyright><a
jackalmage@5473 80 href="http://www.w3.org/Consortium/Legal/ipr-notice#Copyright"
jackalmage@7169 81 rel=license>Copyright</a> © 2013 <a href="http://www.w3.org/"><abbr
jackalmage@5898 82 title="World Wide Web Consortium">W3C</abbr></a><sup>®</sup> (<a
jackalmage@5473 83 href="http://www.csail.mit.edu/"><abbr
jackalmage@5473 84 title="Massachusetts Institute of Technology">MIT</abbr></a>, <a
jackalmage@5473 85 href="http://www.ercim.eu/"><abbr
jackalmage@5473 86 title="European Research Consortium for Informatics and Mathematics">ERCIM</abbr></a>,
jackalmage@7245 87 <a href="http://www.keio.ac.jp/">Keio</a>, <a
jackalmage@7245 88 href="http://ev.buaa.edu.cn/">Beihang</a>), All Rights Reserved. W3C <a
jackalmage@5473 89 href="http://www.w3.org/Consortium/Legal/ipr-notice#Legal_Disclaimer">liability</a>,
jackalmage@5473 90 <a
jackalmage@5473 91 href="http://www.w3.org/Consortium/Legal/ipr-notice#W3C_Trademarks">trademark</a>
jackalmage@5473 92 and <a
jackalmage@5473 93 href="http://www.w3.org/Consortium/Legal/copyright-documents">document
jackalmage@5473 94 use</a> rules apply.</p>
jackalmage@5473 95 <!--end-copyright-->
jackalmage@5473 96 <hr title="Separator for header">
jackalmage@5473 97 </div>
jackalmage@5473 98
jackalmage@5473 99 <h2 class="no-num no-toc" id=abstract>Abstract</h2>
jackalmage@5473 100
jackalmage@5473 101 <p> <a href="http://www.w3.org/TR/CSS/">CSS</a> is a language for
jackalmage@5473 102 describing the rendering of structured documents (such as HTML and XML) on
jackalmage@5473 103 screen, on paper, in speech, etc. This module describes, in general terms,
jackalmage@5473 104 the basic structure and syntax of CSS stylesheets. It defines, in detail,
jackalmage@5473 105 the syntax and parsing of CSS - how to turn a stream of bytes into a
jackalmage@5473 106 meaningful stylesheet.
jackalmage@5473 107
jackalmage@5473 108 <h2 class="no-num no-toc" id=status>Status of this document</h2>
jackalmage@5473 109 <!--begin-status-->
jackalmage@5473 110
jackalmage@5473 111 <p>This is a public copy of the editors' draft. It is provided for
jackalmage@5473 112 discussion only and may change at any moment. Its publication here does
jackalmage@5473 113 not imply endorsement of its contents by W3C. Don't cite this document
jackalmage@5473 114 other than as work in progress.
jackalmage@5473 115
jackalmage@5473 116 <p>The (<a
jackalmage@5473 117 href="http://lists.w3.org/Archives/Public/www-style/">archived</a>) public
jackalmage@5473 118 mailing list <a
jackalmage@5549 119 href="mailto:www-style@w3.org?Subject=%5Bcss3-syntax%5D%20PUT%20SUBJECT%20HERE">
jackalmage@5473 120 www-style@w3.org</a> (see <a
jackalmage@5473 121 href="http://www.w3.org/Mail/Request">instructions</a>) is preferred for
jackalmage@5473 122 discussion of this specification. When sending e-mail, please put the text
jackalmage@5898 123 “css3-syntax” in the subject, preferably like this:
jackalmage@5898 124 “[<!---->css3-syntax<!---->] <em>…summary of comment…</em>”
jackalmage@5473 125
jackalmage@5473 126 <p>This document was produced by the <a href="/Style/CSS/members">CSS
jackalmage@5473 127 Working Group</a> (part of the <a href="/Style/">Style Activity</a>).
jackalmage@5473 128
jackalmage@5473 129 <p>This document was produced by a group operating under the <a
jackalmage@5473 130 href="/Consortium/Patent-Policy-20040205/">5 February 2004 W3C Patent
jackalmage@5473 131 Policy</a>. W3C maintains a <a href="/2004/01/pp-impl/32061/status"
jackalmage@5473 132 rel=disclosure>public list of any patent disclosures</a> made in
jackalmage@5473 133 connection with the deliverables of the group; that page also includes
jackalmage@5473 134 instructions for disclosing a patent. An individual who has actual
jackalmage@5473 135 knowledge of a patent which the individual believes contains <a
jackalmage@5473 136 href="/Consortium/Patent-Policy-20040205/#def-essential">Essential
jackalmage@5473 137 Claim(s)</a> must disclose the information in accordance with <a
jackalmage@5473 138 href="/Consortium/Patent-Policy-20040205/#sec-Disclosure">section 6 of the
jackalmage@5473 139 W3C Patent Policy</a>.</p>
jackalmage@5473 140 <!--end-status-->
jackalmage@5473 141
jackalmage@5898 142 <p>The following features are at risk: …
jackalmage@5473 143
jackalmage@5473 144 <h2 class="no-num no-toc" id=contents> Table of contents</h2>
jackalmage@5473 145 <!--begin-toc-->
jackalmage@5473 146
jackalmage@5473 147 <ul class=toc>
jackalmage@5473 148 <li><a href="#intro"><span class=secno>1. </span> Introduction</a>
jackalmage@5473 149 <ul class=toc>
jackalmage@5473 150 <li><a href="#placement"><span class=secno>1.1. </span> Module
jackalmage@5473 151 interactions</a>
jackalmage@5473 152 </ul>
jackalmage@5473 153
jackalmage@5473 154 <li><a href="#syntax-description"><span class=secno>2. </span> Description
jackalmage@5473 155 of CSS's Syntax</a>
jackalmage@5473 156
jackalmage@6563 157 <li><a href="#tokenizing-and-parsing-css"><span class=secno>3. </span>
jackalmage@6563 158 Tokenizing and Parsing CSS</a>
jackalmage@5473 159 <ul class=toc>
jackalmage@5473 160 <li><a href="#overview-of-the-parsing-model"><span class=secno>3.1.
jackalmage@5473 161 </span> Overview of the Parsing Model</a>
jackalmage@5473 162
jackalmage@5473 163 <li><a href="#the-input-byte-stream"><span class=secno>3.2. </span> The
jackalmage@5473 164 input byte stream</a>
jackalmage@5473 165 <ul class=toc>
jackalmage@6922 166 <li><a href="#preprocessing-the-input-stream"><span class=secno>3.2.1.
jackalmage@5473 167 </span> Preprocessing the input stream</a>
jackalmage@5473 168 </ul>
jackalmage@7224 169 </ul>
jackalmage@7224 170
jackalmage@7224 171 <li><a href="#tokenization"><span class=secno>4. </span> Tokenization</a>
jackalmage@7224 172 <ul class=toc>
jackalmage@7224 173 <li><a href="#token-diagrams"><span class=secno>4.1. </span> Token
jackalmage@7224 174 Railroad Diagrams</a>
jackalmage@7224 175
jackalmage@7224 176 <li><a href="#tokenizer-flags"><span class=secno>4.2. </span> Tokenizer
jackalmage@7224 177 Flags</a>
jackalmage@7224 178
jackalmage@7224 179 <li><a href="#definitions"><span class=secno>4.3. </span>
jackalmage@7224 180 Definitions</a>
jackalmage@7224 181
jackalmage@7224 182 <li><a href="#tokenizer-state-machine"><span class=secno>4.4. </span>
jackalmage@7224 183 Tokenizer State Machine</a>
jackalmage@5473 184 <ul class=toc>
jackalmage@7224 185 <li><a href="#data-state"><span class=secno>4.4.1. </span> Data
jackalmage@5473 186 state</a>
jackalmage@5473 187
jackalmage@7224 188 <li><a href="#double-quote-string-state"><span class=secno>4.4.2.
jackalmage@5473 189 </span> Double-quote-string state</a>
jackalmage@5473 190
jackalmage@7224 191 <li><a href="#single-quote-string-state"><span class=secno>4.4.3.
jackalmage@5473 192 </span> Single-quote-string state</a>
jackalmage@5473 193
jackalmage@7224 194 <li><a href="#hash-state"><span class=secno>4.4.4. </span> Hash
jackalmage@5473 195 state</a>
jackalmage@5473 196
jackalmage@7224 197 <li><a href="#hash-rest-state"><span class=secno>4.4.5. </span>
jackalmage@5473 198 Hash-rest state</a>
jackalmage@5473 199
jackalmage@7224 200 <li><a href="#comment-state"><span class=secno>4.4.6. </span> Comment
jackalmage@5473 201 state</a>
jackalmage@5473 202
jackalmage@7224 203 <li><a href="#at-keyword-state"><span class=secno>4.4.7. </span>
jackalmage@5473 204 At-keyword state</a>
jackalmage@5473 205
jackalmage@7224 206 <li><a href="#at-keyword-rest-state"><span class=secno>4.4.8. </span>
jackalmage@5473 207 At-keyword-rest state</a>
jackalmage@5473 208
jackalmage@7224 209 <li><a href="#ident-state"><span class=secno>4.4.9. </span> Ident
jackalmage@6871 210 state</a>
jackalmage@6871 211
jackalmage@7224 212 <li><a href="#ident-rest-state"><span class=secno>4.4.10. </span>
jackalmage@6871 213 Ident-rest state</a>
jackalmage@5473 214
jackalmage@5486 215 <li><a href="#transform-function-whitespace-state"><span
jackalmage@7224 216 class=secno>4.4.11. </span> Transform-function-whitespace state</a>
jackalmage@7224 217
jackalmage@7224 218 <li><a href="#number-state"><span class=secno>4.4.12. </span> Number
jackalmage@5473 219 state</a>
jackalmage@5473 220
jackalmage@7224 221 <li><a href="#number-rest-state"><span class=secno>4.4.13. </span>
jackalmage@5473 222 Number-rest state</a>
jackalmage@5473 223
jackalmage@7224 224 <li><a href="#number-fraction-state"><span class=secno>4.4.14. </span>
jackalmage@5473 225 Number-fraction state</a>
jackalmage@5473 226
jackalmage@7224 227 <li><a href="#dimension-state"><span class=secno>4.4.15. </span>
jackalmage@5473 228 Dimension state</a>
jackalmage@5473 229
jackalmage@7224 230 <li><a href="#sci-notation-state"><span class=secno>4.4.16. </span>
jackalmage@5481 231 Sci-notation state</a>
jackalmage@5481 232
jackalmage@7224 233 <li><a href="#url-state"><span class=secno>4.4.17. </span> URL
jackalmage@5473 234 state</a>
jackalmage@5473 235
jackalmage@7224 236 <li><a href="#url-double-quote-state"><span class=secno>4.4.18.
jackalmage@5473 237 </span> URL-double-quote state</a>
jackalmage@5473 238
jackalmage@7224 239 <li><a href="#url-single-quote-state"><span class=secno>4.4.19.
jackalmage@5473 240 </span> URL-single-quote state</a>
jackalmage@5473 241
jackalmage@7224 242 <li><a href="#url-end-state"><span class=secno>4.4.20. </span> URL-end
jackalmage@5473 243 state</a>
jackalmage@5473 244
jackalmage@7224 245 <li><a href="#url-unquoted-state"><span class=secno>4.4.21. </span>
jackalmage@5473 246 URL-unquoted state</a>
jackalmage@5473 247
jackalmage@7224 248 <li><a href="#bad-url-state"><span class=secno>4.4.22. </span> Bad-URL
jackalmage@5986 249 state</a>
jackalmage@5986 250
jackalmage@7224 251 <li><a href="#unicode-range-state"><span class=secno>4.4.23. </span>
jackalmage@5473 252 Unicode-range state</a>
jackalmage@5473 253 </ul>
jackalmage@5486 254
jackalmage@7224 255 <li><a href="#consume-an-escaped-character"><span class=secno>4.5.
jackalmage@7224 256 </span> Consume an escaped character</a>
jackalmage@7224 257
jackalmage@7224 258 <li><a href="#set-the-unicode-range-tokens-range"><span class=secno>4.6.
jackalmage@7224 259 </span> Set the unicode-range token's range</a>
jackalmage@7224 260
jackalmage@7224 261 <li><a href="#changes-from-css-2.1-tokenizer"><span class=secno>4.7.
jackalmage@6008 262 </span> Changes from CSS 2.1 Tokenizer</a>
jackalmage@7224 263 </ul>
jackalmage@7224 264
jackalmage@7224 265 <li><a href="#parsing"><span class=secno>5. </span> Parsing</a>
jackalmage@7224 266 <ul class=toc>
jackalmage@7224 267 <li><a href="#parser-flags"><span class=secno>5.1. </span> Parser
jackalmage@7224 268 Flags</a>
jackalmage@7224 269
jackalmage@7224 270 <li><a href="#definitions0"><span class=secno>5.2. </span>
jackalmage@7224 271 Definitions</a>
jackalmage@7224 272
jackalmage@7444 273 <li><a href="#parser-entry-points"><span class=secno>5.3. </span> Parser
jackalmage@7444 274 Entry Points</a>
jackalmage@5498 275 <ul class=toc>
jackalmage@7444 276 <li><a href="#parse-a-stylesheet"><span class=secno>5.3.1. </span>
jackalmage@7444 277 Parse a stylesheet</a>
jackalmage@7444 278
jackalmage@7444 279 <li><a href="#parse-a-rule"><span class=secno>5.3.2. </span> Parse a
jackalmage@7444 280 rule</a>
jackalmage@7444 281
jackalmage@7444 282 <li><a href="#parse-a-list-of-declarations"><span class=secno>5.3.3.
jackalmage@7444 283 </span> Parse a list of declarations</a>
jackalmage@7444 284
jackalmage@7444 285 <li><a href="#parse-a-component-value"><span class=secno>5.3.4.
jackalmage@7444 286 </span> Parse a component value</a>
jackalmage@7444 287
jackalmage@7444 288 <li><a href="#parse-a-list-of-component-values"><span
jackalmage@7444 289 class=secno>5.3.5. </span> Parse a list of component values</a>
jackalmage@7444 290
jackalmage@7444 291 <li><a href="#parse-a-comma-separated-list-of-componen"><span
jackalmage@7444 292 class=secno>5.3.6. </span> Parse a comma-separated list of component
jackalmage@7444 293 values</a>
jackalmage@7444 294
jackalmage@7444 295 <li><a href="#parse-anb-notation"><span class=secno>5.3.7. </span>
jackalmage@7444 296 Parse an+b notation</a>
jackalmage@5498 297 </ul>
jackalmage@6008 298
jackalmage@7444 299 <li><a href="#parser-algorithms"><span class=secno>5.4. </span> Parser
jackalmage@7444 300 Algorithms</a>
jackalmage@7444 301 <ul class=toc>
jackalmage@7444 302 <li><a href="#consume-a-list-of-rules"><span class=secno>5.4.1.
jackalmage@7444 303 </span> Consume a list of rules</a>
jackalmage@7444 304
jackalmage@7444 305 <li><a href="#consume-an-at-rule"><span class=secno>5.4.2. </span>
jackalmage@7444 306 Consume an at-rule</a>
jackalmage@7444 307
jackalmage@7444 308 <li><a href="#consume-an-at-statement"><span class=secno>5.4.3.
jackalmage@7444 309 </span> Consume an at-statement</a>
jackalmage@7444 310
jackalmage@7444 311 <li><a href="#consume-a-qualified-rule"><span class=secno>5.4.4.
jackalmage@7444 312 </span> Consume a qualified rule</a>
jackalmage@7444 313
jackalmage@7444 314 <li><a href="#consume-a-list-of-declarations"><span class=secno>5.4.5.
jackalmage@7444 315 </span> Consume a list of declarations</a>
jackalmage@7444 316
jackalmage@7444 317 <li><a href="#consume-a-declaration"><span class=secno>5.4.6. </span>
jackalmage@7444 318 Consume a declaration</a>
jackalmage@7444 319
jackalmage@7444 320 <li><a href="#consume-a-component-value"><span class=secno>5.4.7.
jackalmage@7444 321 </span> Consume a component value</a>
jackalmage@7444 322
jackalmage@7444 323 <li><a href="#consume-a-component-value-with-the-hashl"><span
jackalmage@7444 324 class=secno>5.4.8. </span> Consume a component value with the
jackalmage@7444 325 hashless color quirk</a>
jackalmage@7444 326
jackalmage@7444 327 <li><a href="#consume-a-component-value-with-the-unitl"><span
jackalmage@7444 328 class=secno>5.4.9. </span> Consume a component value with the
jackalmage@7444 329 unitless length quirk</a>
jackalmage@7444 330
jackalmage@7444 331 <li><a href="#consume-a-simple-block"><span class=secno>5.4.10.
jackalmage@7444 332 </span> Consume a simple block</a>
jackalmage@7444 333
jackalmage@7444 334 <li><a href="#consume-a-function"><span class=secno>5.4.11. </span>
jackalmage@7444 335 Consume a function</a>
jackalmage@7444 336 </ul>
jackalmage@7444 337
jackalmage@7444 338 <li><a href="#changes-from-css-2.1-core-grammar"><span class=secno>5.5.
jackalmage@6008 339 </span> Changes from CSS 2.1 Core Grammar</a>
jackalmage@5473 340 </ul>
jackalmage@5473 341
jackalmage@7444 342 <li><a href="#serialization"><span class=secno>6. </span>Serialization</a>
jackalmage@7444 343
jackalmage@7444 344 <li><a href="#conformance"><span class=secno>7. </span> Conformance</a>
jackalmage@5473 345 <ul class=toc>
jackalmage@7444 346 <li><a href="#conventions"><span class=secno>7.1. </span> Document
jackalmage@5473 347 conventions</a>
jackalmage@5473 348
jackalmage@7444 349 <li><a href="#conformance-classes"><span class=secno>7.2. </span>
jackalmage@5473 350 Conformance classes</a>
jackalmage@5473 351 </ul>
jackalmage@5473 352
jackalmage@5473 353 <li class=no-num><a href="#acknowledgments"> Acknowledgments</a>
jackalmage@5473 354
jackalmage@5473 355 <li class=no-num><a href="#references"> References</a>
jackalmage@5473 356 <ul class=toc>
jackalmage@5473 357 <li class=no-num><a href="#normative-references"> Normative
jackalmage@5473 358 references</a>
jackalmage@5473 359
jackalmage@5473 360 <li class=no-num><a href="#other-references"> Other references</a>
jackalmage@5473 361 </ul>
jackalmage@5473 362
jackalmage@5473 363 <li class=no-num><a href="#index"> Index</a>
jackalmage@5473 364
jackalmage@5473 365 <li class=no-num><a href="#property-index"> Property index</a>
jackalmage@5473 366 </ul>
jackalmage@5473 367 <!--end-toc-->
jackalmage@5473 368
jackalmage@5473 369 <h2 id=intro><span class=secno>1. </span> Introduction</h2>
jackalmage@5473 370
jackalmage@5473 371 <p><em>This section is not normative.</em>
jackalmage@5473 372
jackalmage@7275 373 <p> This module defines the abstract syntax and parsing of CSS stylesheets
jackalmage@7275 374 and other things which use CSS syntax (such as the HTML <code>style</code>
jackalmage@7275 375 attribute).
jackalmage@7275 376
jackalmage@7275 377 <p> It defines algorithms for converting a stream of codepoints (in other
jackalmage@7275 378 words, text) into a stream of CSS tokens, and then further into CSS
jackalmage@7275 379 objects such as stylesheets, rules, and declarations.
jackalmage@5473 380
jackalmage@5473 381 <h3 id=placement><span class=secno>1.1. </span> Module interactions</h3>
jackalmage@5473 382
jackalmage@5473 383 <p> This module defines the syntax and parsing of CSS stylesheets. It
jackalmage@5473 384 supersedes the lexical scanner and grammar defined in CSS 2.1.
jackalmage@5473 385
jackalmage@5473 386 <h2 id=syntax-description><span class=secno>2. </span> Description of CSS's
jackalmage@5473 387 Syntax</h2>
jackalmage@5473 388
jackalmage@5549 389 <p><em>This section is not normative.</em>
jackalmage@5549 390
jackalmage@7444 391 <p> A CSS document is a series of <a href="#style-rule"><i>style
jackalmage@7276 392 rules</i></a>, which apply CSS properties to elements in the source
jackalmage@7276 393 document, and <a href="#at-rule"><i>at-rules</i></a>, which define special
jackalmage@7276 394 processing rules or values for the CSS document.
jackalmage@7276 395
jackalmage@7276 396 <p> A <dfn id=style-rule>style rule</dfn> starts with a selector (defined
jackalmage@7276 397 by the <a href="http://www.w3.org/TR/selectors/">Selectors
jackalmage@7276 398 specification</a>), then has a {}-wrapped block containing a sequence of
jackalmage@7276 399 declarations. The selector specifies which elements the declarations will
jackalmage@7276 400 apply to. Each declaration has a property name, followed by a colon and
jackalmage@7276 401 the property value, and finished with a semicolon.
jackalmage@5549 402
jackalmage@5549 403 <div class=example>
jackalmage@5549 404 <p> A typical rule might look something like this:
jackalmage@5549 405
jackalmage@5549 406 <pre>
jackalmage@7438 407 p > a {
jackalmage@5549 408 color: blue;
jackalmage@5549 409 text-decoration: underline;
jackalmage@5549 410 }</pre>
jackalmage@5549 411
jackalmage@5549 412 <p> In the above rule, "<code>p > a</code>" is the selector, which, if the
jackalmage@5549 413 source document is HTML, selects any <code>&lt;a></code> elements that
jackalmage@5549 414 are children of a <code>&lt;p></code> element.
jackalmage@5549 415
jackalmage@5549 416 <p> "<code>color: blue;</code>" is a declaration specifying that, for the
jackalmage@5898 417 elements that match the selector, their ‘<code
jackalmage@5898 418 class=property>color</code>’ property should have the value ‘<code
jackalmage@5898 419 class=css>blue</code>’. Similiarly, their ‘<code
jackalmage@5898 420 class=property>text-decoration</code>’ property should have the value
jackalmage@5898 421 ‘<code class=css>underline</code>’.
jackalmage@5549 422 </div>
jackalmage@5549 423
jackalmage@5549 424 <p> <dfn id=at-rules title=at-rule>At-rules</dfn> are all different, but
jackalmage@5549 425 they have a basic structure in common. They start with an "@" character
jackalmage@7233 426 followed by their name. Some <a href="#at-rule"><i>at-rules</i></a> are
jackalmage@5549 427 simple statements, with their name followed by more CSS values to specify
jackalmage@5549 428 their behavior, and finally ended by a semicolon. Others are blocks; they
jackalmage@5549 429 can have CSS values following their name, but they end with a {}-wrapped
jackalmage@7276 430 block, similar to a <i>rule</i>. Even the contents of these blocks are
jackalmage@7276 431 specific to the given <a href="#at-rule"><i>at-rule</i></a>: sometimes
jackalmage@7276 432 they contain a sequence of declarations, like a <i>rule</i>; other times,
jackalmage@7276 433 they may contain additional blocks, or at-rules, or other structures
jackalmage@5549 434 altogether.
jackalmage@5549 435
jackalmage@5549 436 <div class=example>
jackalmage@7233 437 <p> Here are several examples of <a href="#at-rule"><i>at-rules</i></a>
jackalmage@5549 438 that illustrate the varied syntax they may contain.
jackalmage@5549 439
jackalmage@5549 440 <pre>@import "my-styles.css";</pre>
jackalmage@5549 441
jackalmage@5898 442 <p> The ‘<code class=css>@import</code>’ <a
jackalmage@7233 443 href="#at-rule"><i>at-rule</i></a> is a simple statement. After its name,
jackalmage@7233 444 it takes a single string or ‘<code class=css>url()</code>’ function
jackalmage@7233 445 to indicate the stylesheet that it should import.
jackalmage@5549 446
jackalmage@5549 447 <pre>
jackalmage@5549 448 @page :left {
jackalmage@5549 449 margin-left: 4cm;
jackalmage@5549 450 margin-right: 3cm;
jackalmage@5549 451 }</pre>
jackalmage@5549 452
jackalmage@5898 453 <p> The ‘<code class=css>@page</code>’ <a
jackalmage@7233 454 href="#at-rule"><i>at-rule</i></a> consists of an optional page selector
jackalmage@5549 455 (the ":left" pseudoclass), followed by a block of properties that apply
jackalmage@5549 456 to the page when printed. In this way, it's very similar to a normal <a
jackalmage@7444 457 href="#style-rule"><i>style rule</i></a>, except that its properties
jackalmage@7276 458 don't apply to any "element", but rather the page itself.
jackalmage@5549 459
jackalmage@5549 460 <pre>
jackalmage@5549 461 @media print {
jackalmage@5549 462 body { font-size: 10pt }
jackalmage@5549 463 }</pre>
jackalmage@5549 464
jackalmage@5898 465 <p> The ‘<code class=css>@media</code>’ <a
jackalmage@7233 466 href="#at-rule"><i>at-rule</i></a> begins with a media type and a list of
jackalmage@7233 467 optional media queries. Its block contains entire rules, which are only
jackalmage@7233 468 applied when the ‘<code class=css>@media</code>’s conditions are
jackalmage@5898 469 fulfilled.
jackalmage@5549 470 </div>
jackalmage@5549 471
jackalmage@7233 472 <p> Property names and <a href="#at-rule"><i>at-rule</i></a> names are
jackalmage@6871 473 always <b>idents</b>, which have to start with a letter or a hyphen
jackalmage@5549 474 followed by a letter, and then can contain letters, numbers, hyphens, or
jackalmage@5549 475 underscores. You can include any character at all, even ones that CSS uses
jackalmage@5549 476 in its syntax, by escaping it with a backslash (\) or by using a
jackalmage@5549 477 hexadecimal escape.
jackalmage@5549 478
jackalmage@5549 479 <p> The syntax of selectors is defined in the <a
jackalmage@5549 480 href="http://www.w3.org/TR/selectors/">Selectors spec</a>. Similarly, the
jackalmage@5549 481 syntax of the wide variety of CSS values is defined in the <a
jackalmage@5549 482 href="http://www.w3.org/TR/css3-values/">Values &amp; Units spec</a>. The
jackalmage@7233 483 special syntaxes of individual <a href="#at-rule"><i>at-rules</i></a> can
jackalmage@5549 484 be found in the specs that define them.
jackalmage@5473 485
jackalmage@6563 486 <h2 id=tokenizing-and-parsing-css><span class=secno>3. </span> Tokenizing
jackalmage@6563 487 and Parsing CSS</h2>
jackalmage@5473 488
jackalmage@7277 489 <p> User agents must use the parsing rules described in this specifiction
jackalmage@7277 490 to generate the CSSOM trees from text/css resources. Together, these rules
jackalmage@5473 491 define what is referred to as the CSS parser.
jackalmage@5473 492
jackalmage@5473 493 <p> This specification defines the parsing rules for CSS documents, whether
jackalmage@5473 494 they are syntactically correct or not. Certain points in the parsing
jackalmage@5473 495 algorithm are said to be parse errors. The error handling for parse errors
jackalmage@5473 496 is well-defined: user agents must either act as described below when
jackalmage@5473 497 encountering such problems, or must abort processing at the first error
jackalmage@5473 498 that they encounter for which they do not wish to apply the rules
jackalmage@5473 499 described below.
jackalmage@5473 500
jackalmage@5473 501 <p> Conformance checkers must report at least one parse error condition to
jackalmage@5473 502 the user if one or more parse error conditions exist in the document and
jackalmage@5473 503 must not report parse error conditions if none exist in the document.
jackalmage@5473 504 Conformance checkers may report more than one parse error condition if
jackalmage@5473 505 more than one parse error condition exists in the document. Conformance
jackalmage@5473 506 checkers are not required to recover from parse errors.
jackalmage@5473 507
jackalmage@5473 508 <h3 id=overview-of-the-parsing-model><span class=secno>3.1. </span>
jackalmage@5473 509 Overview of the Parsing Model</h3>
jackalmage@5473 510
jackalmage@5473 511 <p> The input to the CSS parsing process consists of a stream of Unicode
jackalmage@5473 512 code points, which is passed through a tokenization stage followed by a
jackalmage@5473 513 tree construction stage. The output is a CSSStyleSheet object.
jackalmage@5473 514
jackalmage@5473 515 <p class=note> Implementations that do not support scripting do not have to
jackalmage@5473 516 actually create a CSSOM CSSStyleSheet object, but the CSSOM tree in such
jackalmage@5473 517 cases is still used as the model for the rest of the specification.
jackalmage@5473 518
jackalmage@5473 519 <h3 id=the-input-byte-stream><span class=secno>3.2. </span> The input byte
jackalmage@5473 520 stream</h3>
jackalmage@5473 521
jackalmage@5473 522 <p> The stream of Unicode code points that comprises the input to the
jackalmage@5473 523 tokenization stage will be initially seen by the user agent as a stream of
jackalmage@5473 524 bytes (typically coming over the network or from the local file system).
jackalmage@5473 525 The bytes encode the actual characters according to a particular character
jackalmage@5473 526 encoding, which the user agent must use to decode the bytes into
jackalmage@5473 527 characters.
jackalmage@5473 528
jackalmage@6922 529 <p> To decode the stream of bytes into a stream of characters, UAs must
jackalmage@6922 530 follow these steps.
jackalmage@6922 531
jackalmage@6944 532 <p> The algorithms to <a
jackalmage@6944 533 href="http://encoding.spec.whatwg.org/#concept-encoding-get"><dfn
jackalmage@6944 534 id=get-an-encoding>get an encoding</dfn></a> and <a
jackalmage@6944 535 href="http://encoding.spec.whatwg.org/#decode"><dfn
jackalmage@6944 536 id=decode>decode</dfn></a> are defined in the <a
jackalmage@6944 537 href="http://encoding.spec.whatwg.org/">Encoding Standard</a>.
jackalmage@6944 538
jackalmage@7465 539 <p> First, determine the fallback encoding:
jackalmage@7465 540
jackalmage@6922 541 <ol>
jackalmage@6922 542 <li> If HTTP or equivalent protocol defines an encoding (e.g. via the
jackalmage@6944 543 charset parameter of the Content-Type header), <a
jackalmage@6944 544 href="#get-an-encoding"><i>get an encoding</i></a> for the specified
jackalmage@7465 545 value. If that does not return failure, use the return value as the
jackalmage@7465 546 fallback encoding.
jackalmage@7465 547
jackalmage@7465 548 <li> Otherwise, check the byte stream. If the first several bytes match
jackalmage@7465 549 the hex sequence
jackalmage@7465 550 <pre>40 63 68 61 72 73 65 74 20 22 (not 22)* 22 3B</pre>
jackalmage@6944 551 then <a href="#get-an-encoding"><i>get an encoding</i></a> for the
jackalmage@7465 552 sequence of <code>(not 22)*</code> bytes, decoded per
jackalmage@7465 553 <code>windows-1252</code>.
jackalmage@6922 554 <p class=note> Note: Anything ASCII-compatible will do, so using
jackalmage@6922 555 <code>windows-1252</code> is fine.
jackalmage@6922 556
jackalmage@6977 557 <p class=note> Note: The byte sequence above, when decoded as ASCII, is
jackalmage@6977 558 the string "<code>@charset "…";</code>", where the "…" is the
jackalmage@6977 559 sequence of bytes corresponding to the encoding's name.
jackalmage@6977 560
jackalmage@7465 561 <p> If the return value was <code>utf-16</code> or <code>utf-16be</code>,
jackalmage@7465 562 use <code>utf-8</code> as the fallback encoding; if it was anything else
jackalmage@7465 563 except failure, use the return value as the fallback encoding.
jackalmage@6944 564
jackalmage@6944 565 <p class=note> This mimics HTML <code>&lt;meta></code> behavior.
jackalmage@6944 566
jackalmage@7465 567 <li> Otherwise, <a href="#get-an-encoding"><i>get an encoding</i></a> for
jackalmage@7465 568 the value of the <code>charset</code> attribute on the
jackalmage@7465 569 <code>&lt;link></code> element or <code>&lt;?xml-stylesheet?></code>
jackalmage@7465 570 processing instruction that caused the style sheet to be included, if
jackalmage@7465 571 any. If that does not return failure, use the return value as the
jackalmage@7465 572 fallback encoding.
jackalmage@7465 573
jackalmage@7465 574 <li> Otherwise, if the referring style sheet or document has an encoding,
jackalmage@7465 575 use that as the fallback encoding.
jackalmage@7465 576
jackalmage@7465 577 <li> Otherwise, use <code>utf-8</code> as the fallback encoding.
jackalmage@6922 578 </ol>
jackalmage@6922 579
jackalmage@7465 580 <p> Then, <a href="#decode"><i>decode</i></a> the byte stream using the
jackalmage@7465 581 fallback encoding.
jackalmage@7465 582
jackalmage@7465 583 <p class=note> Note: the <a href="#decode"><i>decode</i></a> algorithm lets
jackalmage@7465 584 the byte order mark (BOM) take precedence, hence the usage of the term
jackalmage@7465 585 "fallback" above.
jackalmage@7465 586
jackalmage@6944 587 <p class=issue> Anne says that steps 4/5 should be an input to this
jackalmage@6944 588 algorithm from the specs that define importing stylesheet, to make the
jackalmage@6944 589 algorithm as a whole cleaner. Perhaps abstract it into the concept of an
jackalmage@6944 590 "environment charset" or something?
jackalmage@6944 591
jackalmage@6922 592 <h4 id=preprocessing-the-input-stream><span class=secno>3.2.1. </span>
jackalmage@5473 593 Preprocessing the input stream</h4>
jackalmage@5473 594
jackalmage@5473 595 <p> The input stream consists of the characters pushed into it as the input
jackalmage@5473 596 byte stream is decoded.
jackalmage@5473 597
jackalmage@6923 598 <p> Before sending the input stream to the tokenizer, implementations must
jackalmage@6923 599 make the following character substitutions:
jackalmage@6923 600
jackalmage@6923 601 <ul>
jackalmage@6923 602 <li> Replace any U+000D CARRIAGE RETURN (CR) characters or pairs of U+000D
jackalmage@6923 603 CARRIAGE RETURN (CR) followed by U+000A LINE FEED (LF) by a single U+000A
jackalmage@6923 604 LINE FEED (LF) character.
jackalmage@6923 605
jackalmage@6923 606 <li> Replace any U+0000 NULL characters with U+FFFD REPLACEMENT CHARACTER
jackalmage@6923 607 (�).
jackalmage@6923 608 </ul>
jackalmage@5473 609
jackalmage@5473 610 <p> The <dfn id=next-input-character>next input character</dfn> is the
jackalmage@5473 611 first character in the input stream that has not yet been consumed or
jackalmage@5473 612 explicitly ignored by the requirements in this section. Initially, the <a
jackalmage@5473 613 href="#next-input-character"><i>next input character</i></a> is the first
jackalmage@5473 614 character in the input. The <dfn id=current-input-character>current input
jackalmage@5473 615 character</dfn> is the last character to have been consumed.
jackalmage@5473 616
jackalmage@5473 617 <p> The "EOF" character in the tables below is a conceptual character
jackalmage@5473 618 representing the end of the input stream.
jackalmage@5473 619
jackalmage@7224 620 <h2 id=tokenization><span class=secno>4. </span> Tokenization</h2>
jackalmage@5473 621
jackalmage@5473 622 <p> Implementations must act as if they used the following state machine to
jackalmage@6251 623 tokenize CSS. The state machine must start in the <a
jackalmage@5473 624 href="#data-state0"><i>data state</i></a>. Most states consume a single
jackalmage@5473 625 character, which may have various side-effects, and either switches the
jackalmage@5473 626 state machine to a new state to reconsume the same character, or switches
jackalmage@5473 627 it to a new state to consume the next character, or stays in the same
jackalmage@5473 628 state to consume the next character. Some states have more complicated
jackalmage@5473 629 behavior and can consume several characters before switching to another
jackalmage@5473 630 state.
jackalmage@5473 631
jackalmage@5473 632 <p> The output of the tokenization step is a series of zero or more of the
jackalmage@6871 633 following tokens: ident, function, at-keyword, hash, string, bad-string,
jackalmage@6871 634 url, bad-url, delim, number, percentage, dimension, unicode-range,
jackalmage@7370 635 include-match, dash-match, prefix-match, suffix-match, substring-match,
jackalmage@7445 636 whitespace, cdo, cdc, colon, semicolon, comma, [, ], (, ), {, and }.
jackalmage@6871 637
jackalmage@6871 638 <p> ident, function, at-keyword, hash, string, and url tokens have a value
jackalmage@6871 639 composed of zero or more characters. Delim tokens have a value composed of
jackalmage@6871 640 a single character. Number, percentage, and dimension tokens have a
jackalmage@6871 641 representation composed of 1 or more character, a numeric value, and a
jackalmage@6871 642 type flag set to either "integer" or "number". The type flag defaults to
jackalmage@6871 643 "integer" if not otherwise set. Dimension tokens additionally have a unit
jackalmage@6871 644 composed of one or more characters. Unicode-range tokens have a range of
jackalmage@6871 645 characters.
jackalmage@5473 646
jackalmage@5480 647 <p> The tokenizer state machine consists of the states defined in the
jackalmage@5473 648 following subsections.
jackalmage@5473 649
jackalmage@7224 650 <h3 id=token-diagrams><span class=secno>4.1. </span> Token Railroad
jackalmage@7224 651 Diagrams</h3>
jackalmage@6819 652
jackalmage@6819 653 <p> <em>This section is non-normative.</em>
jackalmage@6819 654
jackalmage@6819 655 <p> This section presents an informative view of the token parser, in the
jackalmage@6819 656 form of railroad diagrams. Railroad diagrams are more compact than a
jackalmage@6819 657 state-machine, but often easier to read than a regular expression.
jackalmage@6819 658
jackalmage@6819 659 <p> These diagrams are <em>informative</em> and <em>incomplete</em>; they
jackalmage@6819 660 describe the grammar of "correct" tokens, but do not describe
jackalmage@6819 661 error-handling at all. They are provided solely to make it easier to get
simon@7048 662 an intuitive grasp of the syntax of each token. <!--
simon@7048 663 The "source" of these diagrams is in ./Diagrams.src.html
simon@7048 664 The generated SVG is copied here so that JavaScript is not required
simon@7048 665 to view the spec.
simon@7048 666 -->
jackalmage@6819 667
jackalmage@6819 668 <dl>
simon@7048 669 <dt id=escape-diagram>escape
simon@7048 670
simon@7048 671 <dd><svg class=railroad-diagram height=122 width=377><g
simon@7048 672 transform="translate(.5 .5)"><path
simon@7048 673 d="M 20 21 v 20 m 10 -20 v 20 m -10 -10 h 20.5"></path><path
simon@7048 674 d="M40 31h10"></path><g><path d="M50 31h0"></path><path
simon@7048 675 d="M78 31h0"></path><rect height=22 rx=10 ry=10 width=28 x=50
simon@7048 676 y=20></rect><text x=64 y=35>\</text></g><path
simon@7048 677 d="M78 31h10"></path><g><path d="M88 31h0"></path><path
simon@7048 678 d="M336 31h0"></path><path d="M88 31h20"></path><g><path
simon@7048 679 d="M108 31h18"></path><path d="M298 31h18"></path><rect height=22
simon@7048 680 width=172 x=126 y=20></rect><text x=212 y=35>not NL or hex
simon@7048 681 digit</text></g><path d="M316 31h20"></path><path
simon@7048 682 d="M88 31a10 10 0 0 1 10 10v10a10 10 0 0 0 10 10"></path><g><path
simon@7048 683 d="M108 61h0"></path><path d="M316 61h0"></path><path
simon@7048 684 d="M108 61h10"></path><g><path d="M118 61h0"></path><path
simon@7048 685 d="M230 61h0"></path><path d="M118 61h10"></path><g><path
simon@7048 686 d="M128 61h0"></path><path d="M220 61h0"></path><rect height=22 width=92
simon@7048 687 x=128 y=50></rect><text x=174 y=65>hex digit</text></g><path
simon@7048 688 d="M220 61h10"></path><path
simon@7048 689 d="M128 61a10 10 0 0 0 -10 10v10a10 10 0 0 0 10 10"></path><g><path
simon@7048 690 d="M128 91h9.5"></path><path d="M210.5 91h9.5"></path><text class=comment
simon@7048 691 x=174 y=96>1-6 times</text></g><path
simon@7048 692 d="M220 91a10 10 0 0 0 10 -10v-10a10 10 0 0 0 -10 -10"></path></g><path
simon@7048 693 d="M230 61h10"></path><g><path d="M240 61h0"></path><path
simon@7048 694 d="M316 61h0"></path><path d="M240 61h20"></path><g><path
simon@7048 695 d="M260 61h36"></path></g><path d="M296 61h20"></path><path
simon@7048 696 d="M240 61a10 10 0 0 1 10 10v0a10 10 0 0 0 10 10"></path><g><path
simon@7048 697 d="M260 81h0"></path><path d="M296 81h0"></path><rect height=22 width=36
simon@7048 698 x=260 y=70></rect><text x=278 y=85>WS</text></g><path
simon@7048 699 d="M296 81a10 10 0 0 0 10 -10v0a10 10 0 0 1 10 -10"></path></g></g><path
simon@7048 700 d="M316 61a10 10 0 0 0 10 -10v-10a10 10 0 0 1 10 -10"></path></g><path
simon@7048 701 d="M 336 31 h 20 m -10 -10 v 20 m 10 -20 v 20"></path></g></svg>
simon@7048 702
jackalmage@6819 703 <dt id=ident-diagram>IDENT
jackalmage@6819 704
simon@7048 705 <dd><svg class=railroad-diagram height=110 width=729><g
jackalmage@6819 706 transform="translate(.5 .5)"><path
jackalmage@6819 707 d="M 20 31 v 20 m 10 -20 v 20 m -10 -10 h 20.5"></path><g><path
simon@7048 708 d="M40 41h0"></path><path d="M108 41h0"></path><path
simon@7048 709 d="M40 41h20"></path><g><path d="M60 41h28"></path></g><path
simon@7048 710 d="M88 41h20"></path><path
simon@7048 711 d="M40 41a10 10 0 0 1 10 10v0a10 10 0 0 0 10 10"></path><g><path
simon@7048 712 d="M60 61h0"></path><path d="M88 61h0"></path><rect height=22 rx=10 ry=10
simon@7048 713 width=28 x=60 y=50></rect><text x=74 y=65>-</text></g><path
simon@7048 714 d="M88 61a10 10 0 0 0 10 -10v0a10 10 0 0 1 10 -10"></path></g><g><path
simon@7048 715 d="M108 41h0"></path><path d="M344 41h0"></path><path
simon@7048 716 d="M108 41h20"></path><g><path d="M128 41h0"></path><path
simon@7048 717 d="M324 41h0"></path><rect height=22 width=196 x=128 y=30></rect><text
simon@7048 718 x=226 y=45>a-z A-Z _ or non-ASCII</text></g><path
simon@7048 719 d="M324 41h20"></path><path
simon@7048 720 d="M108 41a10 10 0 0 1 10 10v10a10 10 0 0 0 10 10"></path><g><path
simon@7048 721 d="M128 71h64"></path><path d="M260 71h64"></path><rect height=22
simon@7048 722 width=68 x=192 y=60></rect><text x=226 y=75>escape</text></g><path
simon@7048 723 d="M324 71a10 10 0 0 0 10 -10v-10a10 10 0 0 1 10 -10"></path></g><g><path
simon@7048 724 d="M344 41h0"></path><path d="M688 41h0"></path><path
simon@7048 725 d="M344 41a10 10 0 0 0 10 -10v0a10 10 0 0 1 10 -10"></path><g><path
simon@7048 726 d="M364 21h304"></path></g><path
simon@7048 727 d="M668 21a10 10 0 0 1 10 10v0a10 10 0 0 0 10 10"></path><path
simon@7048 728 d="M344 41h20"></path><g><path d="M364 41h0"></path><path
simon@7048 729 d="M668 41h0"></path><path d="M364 41h10"></path><g><path
simon@7048 730 d="M374 41h0"></path><path d="M658 41h0"></path><path
simon@7048 731 d="M374 41h20"></path><g><path d="M394 41h0"></path><path
simon@7048 732 d="M638 41h0"></path><rect height=22 width=244 x=394 y=30></rect><text
simon@7048 733 x=516 y=45>a-z A-Z 0-9 _ - or non-ASCII</text></g><path
simon@7048 734 d="M638 41h20"></path><path
simon@7048 735 d="M374 41a10 10 0 0 1 10 10v10a10 10 0 0 0 10 10"></path><g><path
simon@7048 736 d="M394 71h88"></path><path d="M550 71h88"></path><rect height=22
simon@7048 737 width=68 x=482 y=60></rect><text x=516 y=75>escape</text></g><path
simon@7048 738 d="M638 71a10 10 0 0 0 10 -10v-10a10 10 0 0 1 10 -10"></path></g><path
simon@7048 739 d="M658 41h10"></path><path
simon@7048 740 d="M374 41a10 10 0 0 0 -10 10v29a10 10 0 0 0 10 10"></path><g><path
simon@7048 741 d="M374 90h284"></path></g><path
simon@7048 742 d="M658 90a10 10 0 0 0 10 -10v-29a10 10 0 0 0 -10 -10"></path></g><path
simon@7048 743 d="M668 41h20"></path></g><path
simon@7048 744 d="M 688 41 h 20 m -10 -10 v 20 m 10 -20 v 20"></path></g></svg>
jackalmage@6819 745
jackalmage@6819 746 <dt id=function-diagram>FUNCTION
jackalmage@6819 747
simon@7048 748 <dd><svg class=railroad-diagram height=62 width=209><g
jackalmage@6819 749 transform="translate(.5 .5)"><path
jackalmage@6819 750 d="M 20 21 v 20 m 10 -20 v 20 m -10 -10 h 20.5"></path><path
simon@7048 751 d="M40 31h10"></path><g><path d="M50 31h0"></path><path
simon@7048 752 d="M110 31h0"></path><rect height=22 width=60 x=50 y=20></rect><text x=80
simon@7048 753 y=35>IDENT</text></g><path d="M110 31h10"></path><path
simon@7048 754 d="M120 31h10"></path><g><path d="M130 31h0"></path><path
simon@7048 755 d="M158 31h0"></path><rect height=22 rx=10 ry=10 width=28 x=130
simon@7048 756 y=20></rect><text x=144 y=35>(</text></g><path
simon@7048 757 d="M158 31h10"></path><path
simon@7048 758 d="M 168 31 h 20 m -10 -10 v 20 m 10 -20 v 20"></path></g></svg>
jackalmage@6819 759
jackalmage@6819 760 <dt id=at-keyword-diagram>AT-KEYWORD
jackalmage@6819 761
simon@7048 762 <dd><svg class=railroad-diagram height=62 width=209><g
jackalmage@6819 763 transform="translate(.5 .5)"><path
jackalmage@6819 764 d="M 20 21 v 20 m 10 -20 v 20 m -10 -10 h 20.5"></path><path
simon@7048 765 d="M40 31h10"></path><g><path d="M50 31h0"></path><path
simon@7048 766 d="M78 31h0"></path><rect height=22 rx=10 ry=10 width=28 x=50
simon@7048 767 y=20></rect><text x=64 y=35>@</text></g><path d="M78 31h10"></path><path
simon@7048 768 d="M88 31h10"></path><g><path d="M98 31h0"></path><path
simon@7048 769 d="M158 31h0"></path><rect height=22 width=60 x=98 y=20></rect><text
simon@7048 770 x=128 y=35>IDENT</text></g><path d="M158 31h10"></path><path
simon@7048 771 d="M 168 31 h 20 m -10 -10 v 20 m 10 -20 v 20"></path></g></svg>
jackalmage@6819 772
jackalmage@6819 773 <dt id=hash-diagram>HASH
jackalmage@6819 774
simon@7048 775 <dd><svg class=railroad-diagram height=100 width=453><g
jackalmage@6819 776 transform="translate(.5 .5)"><path
jackalmage@6819 777 d="M 20 21 v 20 m 10 -20 v 20 m -10 -10 h 20.5"></path><path
simon@7048 778 d="M40 31h10"></path><g><path d="M50 31h0"></path><path
simon@7048 779 d="M78 31h0"></path><rect height=22 rx=10 ry=10 width=28 x=50
simon@7048 780 y=20></rect><text x=64 y=35>#</text></g><path d="M78 31h10"></path><path
simon@7048 781 d="M88 31h10"></path><g><path d="M98 31h0"></path><path
simon@7048 782 d="M402 31h0"></path><path d="M98 31h10"></path><g><path
simon@7048 783 d="M108 31h0"></path><path d="M392 31h0"></path><path
simon@7048 784 d="M108 31h20"></path><g><path d="M128 31h0"></path><path
simon@7048 785 d="M372 31h0"></path><rect height=22 width=244 x=128 y=20></rect><text
simon@7048 786 x=250 y=35>a-z A-Z 0-9 _ - or non-ASCII</text></g><path
simon@7048 787 d="M372 31h20"></path><path
simon@7048 788 d="M108 31a10 10 0 0 1 10 10v10a10 10 0 0 0 10 10"></path><g><path
simon@7048 789 d="M128 61h88"></path><path d="M284 61h88"></path><rect height=22
simon@7048 790 width=68 x=216 y=50></rect><text x=250 y=65>escape</text></g><path
simon@7048 791 d="M372 61a10 10 0 0 0 10 -10v-10a10 10 0 0 1 10 -10"></path></g><path
simon@7048 792 d="M392 31h10"></path><path
simon@7048 793 d="M108 31a10 10 0 0 0 -10 10v29a10 10 0 0 0 10 10"></path><g><path
simon@7048 794 d="M108 80h284"></path></g><path
simon@7048 795 d="M392 80a10 10 0 0 0 10 -10v-29a10 10 0 0 0 -10 -10"></path></g><path
simon@7048 796 d="M402 31h10"></path><path
simon@7048 797 d="M 412 31 h 20 m -10 -10 v 20 m 10 -20 v 20"></path></g></svg>
jackalmage@6819 798
jackalmage@6819 799 <dt id=string-diagram>STRING
jackalmage@6819 800
simon@7048 801 <dd><svg class=railroad-diagram height=248 width=441><g
jackalmage@6819 802 transform="translate(.5 .5)"><path
jackalmage@6819 803 d="M 20 31 v 20 m 10 -20 v 20 m -10 -10 h 20.5"></path><g><path
simon@7048 804 d="M40 41h0"></path><path d="M400 41h0"></path><path
simon@7048 805 d="M40 41h20"></path><g><path d="M60 41h0"></path><path
simon@7048 806 d="M380 41h0"></path><path d="M60 41h10"></path><g><path
simon@7048 807 d="M70 41h0"></path><path d="M98 41h0"></path><rect height=22 rx=10 ry=10
simon@7048 808 width=28 x=70 y=30></rect><text x=84 y=45>"</text></g><path
simon@7048 809 d="M98 41h10"></path><g><path d="M108 41h0"></path><path
simon@7048 810 d="M332 41h0"></path><path
simon@7048 811 d="M108 41a10 10 0 0 0 10 -10v0a10 10 0 0 1 10 -10"></path><g><path
simon@7048 812 d="M128 21h184"></path></g><path
simon@7048 813 d="M312 21a10 10 0 0 1 10 10v0a10 10 0 0 0 10 10"></path><path
simon@7048 814 d="M108 41h20"></path><g><path d="M128 41h0"></path><path
simon@7048 815 d="M312 41h0"></path><path d="M128 41h10"></path><g><path
simon@7048 816 d="M138 41h0"></path><path d="M302 41h0"></path><path
simon@7048 817 d="M138 41h20"></path><g><path d="M158 41h0"></path><path
simon@7048 818 d="M282 41h0"></path><rect height=22 width=124 x=158 y=30></rect><text
simon@7048 819 x=220 y=45>not " \ or NL</text></g><path d="M282 41h20"></path><path
simon@7048 820 d="M138 41a10 10 0 0 1 10 10v10a10 10 0 0 0 10 10"></path><g><path
simon@7048 821 d="M158 71h28"></path><path d="M254 71h28"></path><rect height=22
simon@7048 822 width=68 x=186 y=60></rect><text x=220 y=75>escape</text></g><path
simon@7048 823 d="M282 71a10 10 0 0 0 10 -10v-10a10 10 0 0 1 10 -10"></path><path
simon@7048 824 d="M138 41a10 10 0 0 1 10 10v40a10 10 0 0 0 10 10"></path><g><path
simon@7048 825 d="M158 101h10"></path><path d="M272 101h10"></path><path
simon@7048 826 d="M168 101h10"></path><g><path d="M178 101h0"></path><path
simon@7048 827 d="M206 101h0"></path><rect height=22 rx=10 ry=10 width=28 x=178
simon@7048 828 y=90></rect><text x=192 y=105>\</text></g><path
simon@7048 829 d="M206 101h10"></path><path d="M216 101h10"></path><g><path
simon@7048 830 d="M226 101h0"></path><path d="M262 101h0"></path><rect height=22
simon@7048 831 width=36 x=226 y=90></rect><text x=244 y=105>NL</text></g><path
simon@7048 832 d="M262 101h10"></path></g><path
simon@7048 833 d="M282 101a10 10 0 0 0 10 -10v-40a10 10 0 0 1 10 -10"></path></g><path
simon@7048 834 d="M302 41h10"></path><path
simon@7048 835 d="M138 41a10 10 0 0 0 -10 10v59a10 10 0 0 0 10 10"></path><g><path
simon@7048 836 d="M138 120h164"></path></g><path
simon@7048 837 d="M302 120a10 10 0 0 0 10 -10v-59a10 10 0 0 0 -10 -10"></path></g><path
simon@7048 838 d="M312 41h20"></path></g><path d="M332 41h10"></path><g><path
simon@7048 839 d="M342 41h0"></path><path d="M370 41h0"></path><rect height=22 rx=10
simon@7048 840 ry=10 width=28 x=342 y=30></rect><text x=356 y=45>"</text></g><path
simon@7048 841 d="M370 41h10"></path></g><path d="M380 41h20"></path><path
simon@7048 842 d="M40 41a10 10 0 0 1 10 10v88a10 10 0 0 0 10 10"></path><g><path
simon@7048 843 d="M60 149h0"></path><path d="M380 149h0"></path><path
simon@7048 844 d="M60 149h10"></path><g><path d="M70 149h0"></path><path
simon@7048 845 d="M98 149h0"></path><rect height=22 rx=10 ry=10 width=28 x=70
simon@7048 846 y=138></rect><text x=84 y=153>&apos;</text></g><path
simon@7048 847 d="M98 149h10"></path><g><path d="M108 149h0"></path><path
simon@7048 848 d="M332 149h0"></path><path
simon@7048 849 d="M108 149a10 10 0 0 0 10 -10v0a10 10 0 0 1 10 -10"></path><g><path
simon@7048 850 d="M128 129h184"></path></g><path
simon@7048 851 d="M312 129a10 10 0 0 1 10 10v0a10 10 0 0 0 10 10"></path><path
simon@7048 852 d="M108 149h20"></path><g><path d="M128 149h0"></path><path
simon@7048 853 d="M312 149h0"></path><path d="M128 149h10"></path><g><path
simon@7048 854 d="M138 149h0"></path><path d="M302 149h0"></path><path
simon@7048 855 d="M138 149h20"></path><g><path d="M158 149h0"></path><path
simon@7048 856 d="M282 149h0"></path><rect height=22 width=124 x=158 y=138></rect><text
simon@7048 857 x=220 y=153>not &apos; \ or NL</text></g><path
simon@7048 858 d="M282 149h20"></path><path
simon@7048 859 d="M138 149a10 10 0 0 1 10 10v10a10 10 0 0 0 10 10"></path><g><path
simon@7048 860 d="M158 179h28"></path><path d="M254 179h28"></path><rect height=22
simon@7048 861 width=68 x=186 y=168></rect><text x=220 y=183>escape</text></g><path
simon@7048 862 d="M282 179a10 10 0 0 0 10 -10v-10a10 10 0 0 1 10 -10"></path><path
simon@7048 863 d="M138 149a10 10 0 0 1 10 10v40a10 10 0 0 0 10 10"></path><g><path
simon@7048 864 d="M158 209h10"></path><path d="M272 209h10"></path><path
simon@7048 865 d="M168 209h10"></path><g><path d="M178 209h0"></path><path
simon@7048 866 d="M206 209h0"></path><rect height=22 rx=10 ry=10 width=28 x=178
simon@7048 867 y=198></rect><text x=192 y=213>\</text></g><path
simon@7048 868 d="M206 209h10"></path><path d="M216 209h10"></path><g><path
simon@7048 869 d="M226 209h0"></path><path d="M262 209h0"></path><rect height=22
simon@7048 870 width=36 x=226 y=198></rect><text x=244 y=213>NL</text></g><path
simon@7048 871 d="M262 209h10"></path></g><path
simon@7048 872 d="M282 209a10 10 0 0 0 10 -10v-40a10 10 0 0 1 10 -10"></path></g><path
simon@7048 873 d="M302 149h10"></path><path
simon@7048 874 d="M138 149a10 10 0 0 0 -10 10v59a10 10 0 0 0 10 10"></path><g><path
simon@7048 875 d="M138 228h164"></path></g><path
simon@7048 876 d="M302 228a10 10 0 0 0 10 -10v-59a10 10 0 0 0 -10 -10"></path></g><path
simon@7048 877 d="M312 149h20"></path></g><path d="M332 149h10"></path><g><path
simon@7048 878 d="M342 149h0"></path><path d="M370 149h0"></path><rect height=22 rx=10
simon@7048 879 ry=10 width=28 x=342 y=138></rect><text x=356
simon@7048 880 y=153>&apos;</text></g><path d="M370 149h10"></path></g><path
simon@7048 881 d="M380 149a10 10 0 0 0 10 -10v-88a10 10 0 0 1 10 -10"></path></g><path
jackalmage@6819 882 d="M 400 41 h 20 m -10 -10 v 20 m 10 -20 v 20"></path></g></svg>
jackalmage@6819 883
jackalmage@6819 884 <dt id=url-diagram>URL
jackalmage@6819 885
jackalmage@7169 886 <dd><svg class=railroad-diagram height=178 width=813><g
jackalmage@6819 887 transform="translate(.5 .5)"><path
jackalmage@7169 888 d="M 20 99 v 20 m 10 -20 v 20 m -10 -10 h 20.5"></path><path
jackalmage@7169 889 d="M40 109h10"></path><g><path d="M50 109h0"></path><path
jackalmage@7169 890 d="M150 109h0"></path><rect height=22 width=100 x=50 y=98></rect><text
jackalmage@7169 891 x=100 y=113>IDENT(url)</text></g><path d="M150 109h10"></path><path
jackalmage@7169 892 d="M160 109h10"></path><g><path d="M170 109h0"></path><path
jackalmage@7169 893 d="M198 109h0"></path><rect height=22 rx=10 ry=10 width=28 x=170
jackalmage@7169 894 y=98></rect><text x=184 y=113>(</text></g><path
jackalmage@7169 895 d="M198 109h10"></path><g><path d="M208 109h0"></path><path
jackalmage@7169 896 d="M724 109h0"></path><path
jackalmage@7169 897 d="M208 109a10 10 0 0 0 10 -10v-48a10 10 0 0 1 10 -10"></path><g><path
jackalmage@7169 898 d="M228 41h88"></path><path d="M616 41h88"></path><g><path
jackalmage@7169 899 d="M316 41h0"></path><path d="M412 41h0"></path><path
jackalmage@7169 900 d="M316 41h20"></path><g><path d="M336 41h56"></path></g><path
jackalmage@7169 901 d="M392 41h20"></path><path
jackalmage@7169 902 d="M316 41a10 10 0 0 1 10 10v0a10 10 0 0 0 10 10"></path><g><path
jackalmage@7169 903 d="M336 61h0"></path><path d="M392 61h0"></path><path
jackalmage@7169 904 d="M336 61h10"></path><g><path d="M346 61h0"></path><path
jackalmage@7169 905 d="M382 61h0"></path><rect height=22 width=36 x=346 y=50></rect><text
jackalmage@7169 906 x=364 y=65>WS</text></g><path d="M382 61h10"></path><path
jackalmage@7169 907 d="M346 61a10 10 0 0 0 -10 10v0a10 10 0 0 0 10 10"></path><g><path
jackalmage@7169 908 d="M346 81h36"></path></g><path
jackalmage@7169 909 d="M382 81a10 10 0 0 0 10 -10v0a10 10 0 0 0 -10 -10"></path></g><path
jackalmage@7169 910 d="M392 61a10 10 0 0 0 10 -10v0a10 10 0 0 1 10 -10"></path></g><g><path
jackalmage@7169 911 d="M412 41h0"></path><path d="M520 41h0"></path><path
jackalmage@7169 912 d="M412 41a10 10 0 0 0 10 -10v0a10 10 0 0 1 10 -10"></path><g><path
jackalmage@7169 913 d="M432 21h68"></path></g><path
jackalmage@7169 914 d="M500 21a10 10 0 0 1 10 10v0a10 10 0 0 0 10 10"></path><path
jackalmage@7169 915 d="M412 41h20"></path><g><path d="M432 41h0"></path><path
jackalmage@7169 916 d="M500 41h0"></path><rect height=22 width=68 x=432 y=30></rect><text
jackalmage@7169 917 x=466 y=45>STRING</text></g><path d="M500 41h20"></path></g><g><path
jackalmage@7169 918 d="M520 41h0"></path><path d="M616 41h0"></path><path
jackalmage@7169 919 d="M520 41h20"></path><g><path d="M540 41h56"></path></g><path
jackalmage@7169 920 d="M596 41h20"></path><path
jackalmage@7169 921 d="M520 41a10 10 0 0 1 10 10v0a10 10 0 0 0 10 10"></path><g><path
jackalmage@7169 922 d="M540 61h0"></path><path d="M596 61h0"></path><path
jackalmage@7169 923 d="M540 61h10"></path><g><path d="M550 61h0"></path><path
jackalmage@7169 924 d="M586 61h0"></path><rect height=22 width=36 x=550 y=50></rect><text
jackalmage@7169 925 x=568 y=65>WS</text></g><path d="M586 61h10"></path><path
jackalmage@7169 926 d="M550 61a10 10 0 0 0 -10 10v0a10 10 0 0 0 10 10"></path><g><path
jackalmage@7169 927 d="M550 81h36"></path></g><path
jackalmage@7169 928 d="M586 81a10 10 0 0 0 10 -10v0a10 10 0 0 0 -10 -10"></path></g><path
jackalmage@7169 929 d="M596 61a10 10 0 0 0 10 -10v0a10 10 0 0 1 10 -10"></path></g></g><path
jackalmage@7169 930 d="M704 41a10 10 0 0 1 10 10v48a10 10 0 0 0 10 10"></path><path
jackalmage@7169 931 d="M208 109h20"></path><g><path d="M228 109h0"></path><path
jackalmage@7169 932 d="M704 109h0"></path><g><path d="M228 109h0"></path><path
jackalmage@7169 933 d="M324 109h0"></path><path d="M228 109h20"></path><g><path
jackalmage@7169 934 d="M248 109h56"></path></g><path d="M304 109h20"></path><path
jackalmage@7169 935 d="M228 109a10 10 0 0 1 10 10v0a10 10 0 0 0 10 10"></path><g><path
jackalmage@7169 936 d="M248 129h0"></path><path d="M304 129h0"></path><path
jackalmage@7169 937 d="M248 129h10"></path><g><path d="M258 129h0"></path><path
jackalmage@7169 938 d="M294 129h0"></path><rect height=22 width=36 x=258 y=118></rect><text
jackalmage@7169 939 x=276 y=133>WS</text></g><path d="M294 129h10"></path><path
jackalmage@7169 940 d="M258 129a10 10 0 0 0 -10 10v0a10 10 0 0 0 10 10"></path><g><path
jackalmage@7169 941 d="M258 149h36"></path></g><path
jackalmage@7169 942 d="M294 149a10 10 0 0 0 10 -10v0a10 10 0 0 0 -10 -10"></path></g><path
jackalmage@7169 943 d="M304 129a10 10 0 0 0 10 -10v0a10 10 0 0 1 10 -10"></path></g><path
jackalmage@7169 944 d="M324 109h10"></path><g><path d="M334 109h0"></path><path
jackalmage@7169 945 d="M598 109h0"></path><path d="M334 109h10"></path><g><path
jackalmage@7169 946 d="M344 109h0"></path><path d="M588 109h0"></path><path
jackalmage@7169 947 d="M344 109h20"></path><g><path d="M364 109h0"></path><path
jackalmage@7169 948 d="M568 109h0"></path><rect height=22 width=204 x=364 y=98></rect><text
jackalmage@7169 949 x=466 y=113>not " &apos; ( ) \ WS or NPC</text></g><path
jackalmage@7169 950 d="M568 109h20"></path><path
jackalmage@7169 951 d="M344 109a10 10 0 0 1 10 10v10a10 10 0 0 0 10 10"></path><g><path
jackalmage@7169 952 d="M364 139h68"></path><path d="M500 139h68"></path><rect height=22
jackalmage@7169 953 width=68 x=432 y=128></rect><text x=466 y=143>escape</text></g><path
jackalmage@7169 954 d="M568 139a10 10 0 0 0 10 -10v-10a10 10 0 0 1 10 -10"></path></g><path
jackalmage@7169 955 d="M588 109h10"></path><path
jackalmage@7169 956 d="M344 109a10 10 0 0 0 -10 10v29a10 10 0 0 0 10 10"></path><g><path
jackalmage@7169 957 d="M344 158h244"></path></g><path
jackalmage@7169 958 d="M588 158a10 10 0 0 0 10 -10v-29a10 10 0 0 0 -10 -10"></path></g><path
jackalmage@7169 959 d="M598 109h10"></path><g><path d="M608 109h0"></path><path
jackalmage@7169 960 d="M704 109h0"></path><path d="M608 109h20"></path><g><path
jackalmage@7169 961 d="M628 109h56"></path></g><path d="M684 109h20"></path><path
jackalmage@7169 962 d="M608 109a10 10 0 0 1 10 10v0a10 10 0 0 0 10 10"></path><g><path
jackalmage@7169 963 d="M628 129h0"></path><path d="M684 129h0"></path><path
jackalmage@7169 964 d="M628 129h10"></path><g><path d="M638 129h0"></path><path
jackalmage@7169 965 d="M674 129h0"></path><rect height=22 width=36 x=638 y=118></rect><text
jackalmage@7169 966 x=656 y=133>WS</text></g><path d="M674 129h10"></path><path
jackalmage@7169 967 d="M638 129a10 10 0 0 0 -10 10v0a10 10 0 0 0 10 10"></path><g><path
jackalmage@7169 968 d="M638 149h36"></path></g><path
jackalmage@7169 969 d="M674 149a10 10 0 0 0 10 -10v0a10 10 0 0 0 -10 -10"></path></g><path
jackalmage@7169 970 d="M684 129a10 10 0 0 0 10 -10v0a10 10 0 0 1 10 -10"></path></g></g><path
jackalmage@7169 971 d="M704 109h20"></path></g><path d="M724 109h10"></path><g><path
jackalmage@7169 972 d="M734 109h0"></path><path d="M762 109h0"></path><rect height=22 rx=10
jackalmage@7169 973 ry=10 width=28 x=734 y=98></rect><text x=748 y=113>)</text></g><path
jackalmage@7169 974 d="M762 109h10"></path><path
jackalmage@7169 975 d="M 772 109 h 20 m -10 -10 v 20 m 10 -20 v 20"></path></g></svg>
jackalmage@6819 976
jackalmage@6819 977 <dt id=number-diagram>NUMBER
jackalmage@6819 978
simon@7048 979 <dd><svg class=railroad-diagram height=179 width=713><g
jackalmage@6819 980 transform="translate(.5 .5)"><path
jackalmage@6819 981 d="M 20 50 v 20 m 10 -20 v 20 m -10 -10 h 20.5"></path><g><path
simon@7048 982 d="M40 60h0"></path><path d="M108 60h0"></path><path
simon@7048 983 d="M40 60a10 10 0 0 0 10 -10v0a10 10 0 0 1 10 -10"></path><g><path
simon@7048 984 d="M60 40h0"></path><path d="M88 40h0"></path><rect height=22 rx=10 ry=10
simon@7048 985 width=28 x=60 y=29></rect><text x=74 y=44>+</text></g><path
simon@7048 986 d="M88 40a10 10 0 0 1 10 10v0a10 10 0 0 0 10 10"></path><path
simon@7048 987 d="M40 60h20"></path><g><path d="M60 60h28"></path></g><path
simon@7048 988 d="M88 60h20"></path><path
simon@7048 989 d="M40 60a10 10 0 0 1 10 10v0a10 10 0 0 0 10 10"></path><g><path
simon@7048 990 d="M60 80h0"></path><path d="M88 80h0"></path><rect height=22 rx=10 ry=10
simon@7048 991 width=28 x=60 y=69></rect><text x=74 y=84>-</text></g><path
simon@7048 992 d="M88 80a10 10 0 0 0 10 -10v0a10 10 0 0 1 10 -10"></path></g><g><path
simon@7048 993 d="M108 60h0"></path><path d="M396 60h0"></path><path
simon@7048 994 d="M108 60h20"></path><g><path d="M128 60h0"></path><path
simon@7048 995 d="M376 60h0"></path><path d="M128 60h10"></path><g><path
simon@7048 996 d="M138 60h0"></path><path d="M218 60h0"></path><path
simon@7048 997 d="M138 60h10"></path><g><path d="M148 60h0"></path><path
simon@7048 998 d="M208 60h0"></path><rect height=22 width=60 x=148 y=49></rect><text
simon@7048 999 x=178 y=64>digit</text></g><path d="M208 60h10"></path><path
simon@7048 1000 d="M148 60a10 10 0 0 0 -10 10v0a10 10 0 0 0 10 10"></path><g><path
simon@7048 1001 d="M148 80h60"></path></g><path
simon@7048 1002 d="M208 80a10 10 0 0 0 10 -10v0a10 10 0 0 0 -10 -10"></path></g><path
simon@7048 1003 d="M218 60h10"></path><path d="M228 60h10"></path><g><path
simon@7048 1004 d="M238 60h0"></path><path d="M266 60h0"></path><rect height=22 rx=10
simon@7048 1005 ry=10 width=28 x=238 y=49></rect><text x=252 y=64>.</text></g><path
simon@7048 1006 d="M266 60h10"></path><path d="M276 60h10"></path><g><path
simon@7048 1007 d="M286 60h0"></path><path d="M366 60h0"></path><path
simon@7048 1008 d="M286 60h10"></path><g><path d="M296 60h0"></path><path
simon@7048 1009 d="M356 60h0"></path><rect height=22 width=60 x=296 y=49></rect><text
simon@7048 1010 x=326 y=64>digit</text></g><path d="M356 60h10"></path><path
simon@7048 1011 d="M296 60a10 10 0 0 0 -10 10v0a10 10 0 0 0 10 10"></path><g><path
simon@7048 1012 d="M296 80h60"></path></g><path
simon@7048 1013 d="M356 80a10 10 0 0 0 10 -10v0a10 10 0 0 0 -10 -10"></path></g><path
simon@7048 1014 d="M366 60h10"></path></g><path d="M376 60h20"></path><path
simon@7048 1015 d="M108 60a10 10 0 0 1 10 10v19a10 10 0 0 0 10 10"></path><g><path
simon@7048 1016 d="M128 99h84"></path><path d="M292 99h84"></path><path
simon@7048 1017 d="M212 99h10"></path><g><path d="M222 99h0"></path><path
simon@7048 1018 d="M282 99h0"></path><rect height=22 width=60 x=222 y=88></rect><text
simon@7048 1019 x=252 y=103>digit</text></g><path d="M282 99h10"></path><path
simon@7048 1020 d="M222 99a10 10 0 0 0 -10 10v0a10 10 0 0 0 10 10"></path><g><path
simon@7048 1021 d="M222 119h60"></path></g><path
simon@7048 1022 d="M282 119a10 10 0 0 0 10 -10v0a10 10 0 0 0 -10 -10"></path></g><path
simon@7048 1023 d="M376 99a10 10 0 0 0 10 -10v-19a10 10 0 0 1 10 -10"></path><path
simon@7048 1024 d="M108 60a10 10 0 0 1 10 10v58a10 10 0 0 0 10 10"></path><g><path
simon@7048 1025 d="M128 138h50"></path><path d="M326 138h50"></path><path
simon@7048 1026 d="M178 138h10"></path><g><path d="M188 138h0"></path><path
simon@7048 1027 d="M216 138h0"></path><rect height=22 rx=10 ry=10 width=28 x=188
simon@7048 1028 y=127></rect><text x=202 y=142>.</text></g><path
simon@7048 1029 d="M216 138h10"></path><path d="M226 138h10"></path><g><path
simon@7048 1030 d="M236 138h0"></path><path d="M316 138h0"></path><path
simon@7048 1031 d="M236 138h10"></path><g><path d="M246 138h0"></path><path
simon@7048 1032 d="M306 138h0"></path><rect height=22 width=60 x=246 y=127></rect><text
simon@7048 1033 x=276 y=142>digit</text></g><path d="M306 138h10"></path><path
simon@7048 1034 d="M246 138a10 10 0 0 0 -10 10v0a10 10 0 0 0 10 10"></path><g><path
simon@7048 1035 d="M246 158h60"></path></g><path
simon@7048 1036 d="M306 158a10 10 0 0 0 10 -10v0a10 10 0 0 0 -10 -10"></path></g><path
simon@7048 1037 d="M316 138h10"></path></g><path
simon@7048 1038 d="M376 138a10 10 0 0 0 10 -10v-58a10 10 0 0 1 10 -10"></path></g><g><path
simon@7048 1039 d="M396 60h0"></path><path d="M672 60h0"></path><path
simon@7048 1040 d="M396 60h20"></path><g><path d="M416 60h236"></path></g><path
simon@7048 1041 d="M652 60h20"></path><path
simon@7048 1042 d="M396 60a10 10 0 0 1 10 10v28a10 10 0 0 0 10 10"></path><g><path
simon@7048 1043 d="M416 108h0"></path><path d="M652 108h0"></path><g><path
simon@7048 1044 d="M416 108h0"></path><path d="M484 108h0"></path><path
simon@7048 1045 d="M416 108h20"></path><g><path d="M436 108h0"></path><path
simon@7048 1046 d="M464 108h0"></path><rect height=22 rx=10 ry=10 width=28 x=436
simon@7048 1047 y=97></rect><text x=450 y=112>e</text></g><path
simon@7048 1048 d="M464 108h20"></path><path
simon@7048 1049 d="M416 108a10 10 0 0 1 10 10v10a10 10 0 0 0 10 10"></path><g><path
simon@7048 1050 d="M436 138h0"></path><path d="M464 138h0"></path><rect height=22 rx=10
simon@7048 1051 ry=10 width=28 x=436 y=127></rect><text x=450 y=142>E</text></g><path
simon@7048 1052 d="M464 138a10 10 0 0 0 10 -10v-10a10 10 0 0 1 10 -10"></path></g><g><path
simon@7048 1053 d="M484 108h0"></path><path d="M552 108h0"></path><path
simon@7048 1054 d="M484 108a10 10 0 0 0 10 -10v0a10 10 0 0 1 10 -10"></path><g><path
simon@7048 1055 d="M504 88h0"></path><path d="M532 88h0"></path><rect height=22 rx=10
simon@7048 1056 ry=10 width=28 x=504 y=77></rect><text x=518 y=92>+</text></g><path
simon@7048 1057 d="M532 88a10 10 0 0 1 10 10v0a10 10 0 0 0 10 10"></path><path
simon@7048 1058 d="M484 108h20"></path><g><path d="M504 108h28"></path></g><path
simon@7048 1059 d="M532 108h20"></path><path
simon@7048 1060 d="M484 108a10 10 0 0 1 10 10v0a10 10 0 0 0 10 10"></path><g><path
simon@7048 1061 d="M504 128h0"></path><path d="M532 128h0"></path><rect height=22 rx=10
simon@7048 1062 ry=10 width=28 x=504 y=117></rect><text x=518 y=132>-</text></g><path
simon@7048 1063 d="M532 128a10 10 0 0 0 10 -10v0a10 10 0 0 1 10 -10"></path></g><path
simon@7048 1064 d="M552 108h10"></path><g><path d="M562 108h0"></path><path
simon@7048 1065 d="M642 108h0"></path><path d="M562 108h10"></path><g><path
simon@7048 1066 d="M572 108h0"></path><path d="M632 108h0"></path><rect height=22
simon@7048 1067 width=60 x=572 y=97></rect><text x=602 y=112>digit</text></g><path
simon@7048 1068 d="M632 108h10"></path><path
simon@7048 1069 d="M572 108a10 10 0 0 0 -10 10v0a10 10 0 0 0 10 10"></path><g><path
simon@7048 1070 d="M572 128h60"></path></g><path
simon@7048 1071 d="M632 128a10 10 0 0 0 10 -10v0a10 10 0 0 0 -10 -10"></path></g><path
simon@7048 1072 d="M642 108h10"></path></g><path
simon@7048 1073 d="M652 108a10 10 0 0 0 10 -10v-28a10 10 0 0 1 10 -10"></path></g><path
simon@7048 1074 d="M 672 60 h 20 m -10 -10 v 20 m 10 -20 v 20"></path></g></svg>
jackalmage@6819 1075
jackalmage@6819 1076 <dt id=dimension-diagram>DIMENSION
jackalmage@6819 1077
simon@7048 1078 <dd><svg class=railroad-diagram height=62 width=249><g
jackalmage@6819 1079 transform="translate(.5 .5)"><path
jackalmage@6819 1080 d="M 20 21 v 20 m 10 -20 v 20 m -10 -10 h 20.5"></path><path
simon@7048 1081 d="M40 31h10"></path><g><path d="M50 31h0"></path><path
simon@7048 1082 d="M118 31h0"></path><rect height=22 width=68 x=50 y=20></rect><text x=84
simon@7048 1083 y=35>NUMBER</text></g><path d="M118 31h10"></path><path
simon@7048 1084 d="M128 31h10"></path><g><path d="M138 31h0"></path><path
simon@7048 1085 d="M198 31h0"></path><rect height=22 width=60 x=138 y=20></rect><text
simon@7048 1086 x=168 y=35>IDENT</text></g><path d="M198 31h10"></path><path
simon@7048 1087 d="M 208 31 h 20 m -10 -10 v 20 m 10 -20 v 20"></path></g></svg>
jackalmage@6819 1088
jackalmage@6819 1089 <dt id=percentage-diagram>PERCENTAGE
jackalmage@6819 1090
simon@7048 1091 <dd><svg class=railroad-diagram height=62 width=217><g
jackalmage@6819 1092 transform="translate(.5 .5)"><path
jackalmage@6819 1093 d="M 20 21 v 20 m 10 -20 v 20 m -10 -10 h 20.5"></path><path
simon@7048 1094 d="M40 31h10"></path><g><path d="M50 31h0"></path><path
simon@7048 1095 d="M118 31h0"></path><rect height=22 width=68 x=50 y=20></rect><text x=84
simon@7048 1096 y=35>NUMBER</text></g><path d="M118 31h10"></path><path
simon@7048 1097 d="M128 31h10"></path><g><path d="M138 31h0"></path><path
simon@7048 1098 d="M166 31h0"></path><rect height=22 rx=10 ry=10 width=28 x=138
simon@7048 1099 y=20></rect><text x=152 y=35>%</text></g><path
simon@7048 1100 d="M166 31h10"></path><path
simon@7048 1101 d="M 176 31 h 20 m -10 -10 v 20 m 10 -20 v 20"></path></g></svg>
jackalmage@6819 1102
jackalmage@6819 1103 <dt id=unicode-range-diagram>UNICODE-RANGE
jackalmage@6819 1104
simon@7048 1105 <dd><svg class=railroad-diagram height=222 width=600><g
jackalmage@6819 1106 transform="translate(.5 .5)"><path
jackalmage@6819 1107 d="M 20 21 v 20 m 10 -20 v 20 m -10 -10 h 20.5"></path><g><path
simon@7048 1108 d="M40 31h0"></path><path d="M108 31h0"></path><path
simon@7048 1109 d="M40 31h20"></path><g><path d="M60 31h0"></path><path
simon@7048 1110 d="M88 31h0"></path><rect height=22 rx=10 ry=10 width=28 x=60
simon@7048 1111 y=20></rect><text x=74 y=35>U</text></g><path d="M88 31h20"></path><path
simon@7048 1112 d="M40 31a10 10 0 0 1 10 10v10a10 10 0 0 0 10 10"></path><g><path
simon@7048 1113 d="M60 61h0"></path><path d="M88 61h0"></path><rect height=22 rx=10 ry=10
simon@7048 1114 width=28 x=60 y=50></rect><text x=74 y=65>u</text></g><path
simon@7048 1115 d="M88 61a10 10 0 0 0 10 -10v-10a10 10 0 0 1 10 -10"></path></g><path
simon@7048 1116 d="M108 31h10"></path><g><path d="M118 31h0"></path><path
simon@7048 1117 d="M146 31h0"></path><rect height=22 rx=10 ry=10 width=28 x=118
simon@7048 1118 y=20></rect><text x=132 y=35>+</text></g><path
simon@7048 1119 d="M146 31h10"></path><g><path d="M156 31h0"></path><path
simon@7048 1120 d="M559 31h0"></path><path d="M156 31h20"></path><g><path
simon@7048 1121 d="M176 31h115.5"></path><path d="M423.5 31h115.5"></path><path
simon@7048 1122 d="M291.5 31h10"></path><g><path d="M301.5 31h0"></path><path
simon@7048 1123 d="M413.5 31h0"></path><path d="M301.5 31h10"></path><g><path
simon@7048 1124 d="M311.5 31h0"></path><path d="M403.5 31h0"></path><rect height=22
simon@7048 1125 width=92 x=311.5 y=20></rect><text x=357.5 y=35>hex digit</text></g><path
simon@7048 1126 d="M403.5 31h10"></path><path
simon@7048 1127 d="M311.5 31a10 10 0 0 0 -10 10v10a10 10 0 0 0 10 10"></path><g><path
simon@7048 1128 d="M311.5 61h9.5"></path><path d="M394 61h9.5"></path><text class=comment
simon@7048 1129 x=357.5 y=66>1-6 times</text></g><path
simon@7048 1130 d="M403.5 61a10 10 0 0 0 10 -10v-10a10 10 0 0 0 -10 -10"></path></g><path
simon@7048 1131 d="M413.5 31h10"></path></g><path d="M539 31h20"></path><path
simon@7048 1132 d="M156 31a10 10 0 0 1 10 10v50a10 10 0 0 0 10 10"></path><g><path
simon@7048 1133 d="M176 101h0"></path><path d="M539 101h0"></path><g><path
simon@7048 1134 d="M176 101h0"></path><path d="M328 101h0"></path><path
simon@7048 1135 d="M176 101a10 10 0 0 0 10 -10v0a10 10 0 0 1 10 -10"></path><g><path
simon@7048 1136 d="M196 81h112"></path></g><path
simon@7048 1137 d="M308 81a10 10 0 0 1 10 10v0a10 10 0 0 0 10 10"></path><path
simon@7048 1138 d="M176 101h20"></path><g><path d="M196 101h0"></path><path
simon@7048 1139 d="M308 101h0"></path><path d="M196 101h10"></path><g><path
simon@7048 1140 d="M206 101h0"></path><path d="M298 101h0"></path><rect height=22
simon@7048 1141 width=92 x=206 y=90></rect><text x=252 y=105>hex digit</text></g><path
simon@7048 1142 d="M298 101h10"></path><path
simon@7048 1143 d="M206 101a10 10 0 0 0 -10 10v10a10 10 0 0 0 10 10"></path><g><path
simon@7048 1144 d="M206 131h9.5"></path><path d="M288.5 131h9.5"></path><text
simon@7048 1145 class=comment x=252 y=136>1-5 times</text></g><path
simon@7048 1146 d="M298 131a10 10 0 0 0 10 -10v-10a10 10 0 0 0 -10 -10"></path></g><path
simon@7048 1147 d="M308 101h20"></path></g><path d="M328 101h10"></path><g><path
simon@7048 1148 d="M338 101h0"></path><path d="M529 101h0"></path><path
simon@7048 1149 d="M338 101h10"></path><g><path d="M348 101h71.5"></path><path
simon@7048 1150 d="M447.5 101h71.5"></path><rect height=22 rx=10 ry=10 width=28 x=419.5
simon@7048 1151 y=90></rect><text x=433.5 y=105>?</text></g><path
simon@7048 1152 d="M519 101h10"></path><path
simon@7048 1153 d="M348 101a10 10 0 0 0 -10 10v10a10 10 0 0 0 10 10"></path><g><path
simon@7048 1154 d="M348 131h0"></path><path d="M519 131h0"></path><text class=comment
simon@7048 1155 x=433.5 y=136>1 to (6 - digits) times</text></g><path
simon@7048 1156 d="M519 131a10 10 0 0 0 10 -10v-10a10 10 0 0 0 -10 -10"></path></g><path
simon@7048 1157 d="M529 101h10"></path></g><path
simon@7048 1158 d="M539 101a10 10 0 0 0 10 -10v-50a10 10 0 0 1 10 -10"></path><path
simon@7048 1159 d="M156 31a10 10 0 0 1 10 10v110a10 10 0 0 0 10 10"></path><g><path
simon@7048 1160 d="M176 161h25.5"></path><path d="M513.5 161h25.5"></path><path
simon@7048 1161 d="M201.5 161h10"></path><g><path d="M211.5 161h0"></path><path
simon@7048 1162 d="M323.5 161h0"></path><path d="M211.5 161h10"></path><g><path
simon@7048 1163 d="M221.5 161h0"></path><path d="M313.5 161h0"></path><rect height=22
simon@7048 1164 width=92 x=221.5 y=150></rect><text x=267.5 y=165>hex
simon@7048 1165 digit</text></g><path d="M313.5 161h10"></path><path
simon@7048 1166 d="M221.5 161a10 10 0 0 0 -10 10v10a10 10 0 0 0 10 10"></path><g><path
simon@7048 1167 d="M221.5 191h9.5"></path><path d="M304 191h9.5"></path><text
simon@7048 1168 class=comment x=267.5 y=196>1-6 times</text></g><path
simon@7048 1169 d="M313.5 191a10 10 0 0 0 10 -10v-10a10 10 0 0 0 -10 -10"></path></g><path
simon@7048 1170 d="M323.5 161h10"></path><path d="M333.5 161h10"></path><g><path
simon@7048 1171 d="M343.5 161h0"></path><path d="M371.5 161h0"></path><rect height=22
simon@7048 1172 rx=10 ry=10 width=28 x=343.5 y=150></rect><text x=357.5
simon@7048 1173 y=165>-</text></g><path d="M371.5 161h10"></path><path
simon@7048 1174 d="M381.5 161h10"></path><g><path d="M391.5 161h0"></path><path
simon@7048 1175 d="M503.5 161h0"></path><path d="M391.5 161h10"></path><g><path
simon@7048 1176 d="M401.5 161h0"></path><path d="M493.5 161h0"></path><rect height=22
simon@7048 1177 width=92 x=401.5 y=150></rect><text x=447.5 y=165>hex
simon@7048 1178 digit</text></g><path d="M493.5 161h10"></path><path
simon@7048 1179 d="M401.5 161a10 10 0 0 0 -10 10v10a10 10 0 0 0 10 10"></path><g><path
simon@7048 1180 d="M401.5 191h9.5"></path><path d="M484 191h9.5"></path><text
simon@7048 1181 class=comment x=447.5 y=196>1-6 times</text></g><path
simon@7048 1182 d="M493.5 191a10 10 0 0 0 10 -10v-10a10 10 0 0 0 -10 -10"></path></g><path
simon@7048 1183 d="M503.5 161h10"></path></g><path
simon@7048 1184 d="M539 161a10 10 0 0 0 10 -10v-110a10 10 0 0 1 10 -10"></path></g><path
simon@7048 1185 d="M 559 31 h 20 m -10 -10 v 20 m 10 -20 v 20"></path></g></svg>
jackalmage@6819 1186
jackalmage@6819 1187 <dt id=comment-diagram>COMMENT
jackalmage@6819 1188
simon@7048 1189 <dd><svg class=railroad-diagram height=81 width=497><g
jackalmage@6819 1190 transform="translate(.5 .5)"><path
jackalmage@6819 1191 d="M 20 31 v 20 m 10 -20 v 20 m -10 -10 h 20.5"></path><path
simon@7048 1192 d="M40 41h10"></path><g><path d="M50 41h0"></path><path
simon@7048 1193 d="M86 41h0"></path><rect height=22 rx=10 ry=10 width=36 x=50
simon@7048 1194 y=30></rect><text x=68 y=45>/*</text></g><path
simon@7048 1195 d="M86 41h10"></path><g><path d="M96 41h0"></path><path
simon@7048 1196 d="M400 41h0"></path><path
simon@7048 1197 d="M96 41a10 10 0 0 0 10 -10v0a10 10 0 0 1 10 -10"></path><g><path
simon@7048 1198 d="M116 21h264"></path></g><path
simon@7048 1199 d="M380 21a10 10 0 0 1 10 10v0a10 10 0 0 0 10 10"></path><path
simon@7048 1200 d="M96 41h20"></path><g><path d="M116 41h0"></path><path
simon@7048 1201 d="M380 41h0"></path><path d="M116 41h10"></path><g><path
simon@7048 1202 d="M126 41h0"></path><path d="M370 41h0"></path><rect height=22 width=244
simon@7048 1203 x=126 y=30></rect><text x=248 y=45>anything but * followed by
simon@7048 1204 /</text></g><path d="M370 41h10"></path><path
simon@7048 1205 d="M126 41a10 10 0 0 0 -10 10v0a10 10 0 0 0 10 10"></path><g><path
simon@7048 1206 d="M126 61h244"></path></g><path
simon@7048 1207 d="M370 61a10 10 0 0 0 10 -10v0a10 10 0 0 0 -10 -10"></path></g><path
simon@7048 1208 d="M380 41h20"></path></g><path d="M400 41h10"></path><g><path
simon@7048 1209 d="M410 41h0"></path><path d="M446 41h0"></path><rect height=22 rx=10
simon@7048 1210 ry=10 width=36 x=410 y=30></rect><text x=428 y=45>*/</text></g><path
simon@7048 1211 d="M446 41h10"></path><path
simon@7048 1212 d="M 456 41 h 20 m -10 -10 v 20 m 10 -20 v 20"></path></g></svg>
jackalmage@6819 1213
jackalmage@6819 1214 <dt id=cdo-diagram>CDO
jackalmage@6819 1215
simon@7048 1216 <dd><svg class=railroad-diagram height=62 width=153><g
jackalmage@6819 1217 transform="translate(.5 .5)"><path
jackalmage@6819 1218 d="M 20 21 v 20 m 10 -20 v 20 m -10 -10 h 20.5"></path><path
simon@7048 1219 d="M40 31h10"></path><g><path d="M50 31h0"></path><path
simon@7048 1220 d="M102 31h0"></path><rect height=22 rx=10 ry=10 width=52 x=50
simon@7048 1221 y=20></rect><text x=76 y=35>&lt;!--</text></g><path
simon@7048 1222 d="M102 31h10"></path><path
simon@7048 1223 d="M 112 31 h 20 m -10 -10 v 20 m 10 -20 v 20"></path></g></svg>
jackalmage@6819 1224
jackalmage@6819 1225 <dt id=cdc-diagram>CDC
jackalmage@6819 1226
simon@7048 1227 <dd><svg class=railroad-diagram height=62 width=145><g
jackalmage@6819 1228 transform="translate(.5 .5)"><path
jackalmage@6819 1229 d="M 20 21 v 20 m 10 -20 v 20 m -10 -10 h 20.5"></path><path
simon@7048 1230 d="M40 31h10"></path><g><path d="M50 31h0"></path><path
simon@7048 1231 d="M94 31h0"></path><rect height=22 rx=10 ry=10 width=44 x=50
simon@7048 1232 y=20></rect><text x=72 y=35>--&gt;</text></g><path
simon@7048 1233 d="M94 31h10"></path><path
simon@7048 1234 d="M 104 31 h 20 m -10 -10 v 20 m 10 -20 v 20"></path></g></svg>
jackalmage@6819 1235 </dl>
jackalmage@6819 1236
jackalmage@7224 1237 <h3 id=tokenizer-flags><span class=secno>4.2. </span> Tokenizer Flags</h3>
jackalmage@5483 1238
jackalmage@5483 1239 <p> The tokenizer can be run with any of several flags that alter its
jackalmage@5483 1240 behavior.
jackalmage@5483 1241
jackalmage@5483 1242 <dl>
jackalmage@5483 1243 <dt>the <dfn id=transform-function-whitespace>transform function
jackalmage@5483 1244 whitespace</dfn> flag
jackalmage@5483 1245
jackalmage@5483 1246 <dd> This flag is set when parsing SVG's <code>transform</code> attribute.
jackalmage@5483 1247 When this is set, whitespace is allowed between the name of a transform
jackalmage@5483 1248 function and its opening parenthesis.
jackalmage@5483 1249 </dl>
jackalmage@5483 1250
jackalmage@7224 1251 <h3 id=definitions><span class=secno>4.3. </span> Definitions</h3>
jackalmage@5473 1252
jackalmage@5473 1253 <p> This section defines several terms used during the tokenization phase.
jackalmage@5473 1254
jackalmage@5473 1255 <dl>
jackalmage@5473 1256 <dt><dfn id=digit>digit</dfn>
jackalmage@5473 1257
jackalmage@5473 1258 <dd> A character between U+0030 DIGIT ZERO (0) and U+0039 DIGIT NINE (9).
jackalmage@5473 1259
jackalmage@5473 1260 <dt><dfn id=hex-digit>hex digit</dfn>
jackalmage@5473 1261
jackalmage@5473 1262 <dd> A <a href="#digit"><i>digit</i></a>, or a character between U+0041
jackalmage@5473 1263 LATIN CAPITAL LETTER A (A) and U+0046 LATIN CAPITAL LETTER F (F), or a
jackalmage@5473 1264 character between U+0061 LATIN SMALL LETTER A (a) and U+0066 LATIN SMALL
jackalmage@5473 1265 LETTER F (f).
jackalmage@5473 1266
jackalmage@5473 1267 <dt><dfn id=uppercase-letter>uppercase letter</dfn>
jackalmage@5473 1268
jackalmage@5473 1269 <dd> A character between U+0041 LATIN CAPITAL LETTER A (A) and U+005A
jackalmage@5473 1270 LATIN CAPITAL LETTER Z (Z).
jackalmage@5473 1271
jackalmage@5473 1272 <dt><dfn id=lowercase-letter>lowercase letter</dfn>
jackalmage@5473 1273
jackalmage@5473 1274 <dd> A character between U+0061 LATIN SMALL LETTER A (a) and U+007A LATIN
jackalmage@5473 1275 SMALL LETTER Z (z).
jackalmage@5473 1276
jackalmage@5473 1277 <dt><dfn id=letter>letter</dfn>
jackalmage@5473 1278
jackalmage@5473 1279 <dd> An <a href="#uppercase-letter"><i>uppercase letter</i></a> or a <a
jackalmage@5473 1280 href="#lowercase-letter"><i>lowercase letter</i></a>.
jackalmage@5473 1281
jackalmage@5473 1282 <dt><dfn id=non-ascii-character>non-ASCII character</dfn>
jackalmage@5473 1283
jackalmage@7245 1284 <dd> A character with a codepoint equal to or greater than U+0080
jackalmage@7245 1285 &lt;control>.
jackalmage@5473 1286
jackalmage@5473 1287 <dt><dfn id=name-start-character>name-start character</dfn>
jackalmage@5473 1288
jackalmage@5473 1289 <dd> A <a href="#letter"><i>letter</i></a>, a <a
jackalmage@5473 1290 href="#non-ascii-character"><i>non-ASCII character</i></a>, or U+005F LOW
jackalmage@5473 1291 LINE (_).
jackalmage@5473 1292
jackalmage@5473 1293 <dt><dfn id=name-character>name character</dfn>
jackalmage@5473 1294
jackalmage@5473 1295 <dd> A <a href="#name-start-character"><i>name-start character</i></a>, A
jackalmage@5473 1296 <a href="#digit"><i>digit</i></a>, or U+002D HYPHEN-MINUS (-).
jackalmage@5473 1297
jackalmage@5473 1298 <dt><dfn id=non-printable-character>non-printable character</dfn>
jackalmage@5473 1299
jackalmage@5473 1300 <dd> A character between U+0000 NULL and U+0008 BACKSPACE or a character
jackalmage@5473 1301 between U+000E SHIFT OUT and U+001F INFORMATION SEPARATOR ONE or a
jackalmage@5473 1302 character between U+007F DELETE and U+009F APPLICATION PROGRAM COMMAND.
jackalmage@5473 1303
jackalmage@5473 1304 <dt><dfn id=newline>newline</dfn>
jackalmage@5473 1305
jackalmage@5473 1306 <dd> U+000A LINE FEED or U+000C FORM FEED. <span class=note> Note that
jackalmage@5473 1307 U+000D CARRIAGE RETURN is not included in this definition, as it is
jackalmage@5473 1308 removed from the stream during preprocessing. </span>
jackalmage@5473 1309
jackalmage@5473 1310 <dt><dfn id=whitespace>whitespace</dfn>
jackalmage@5473 1311
jackalmage@5473 1312 <dd>A <a href="#newline"><i>newline</i></a>, U+0009 CHARACTER TABULATION,
jackalmage@5473 1313 or U+0020 SPACE.
jackalmage@5548 1314
jackalmage@5548 1315 <dt><dfn id=maximum-allowed-codepoint>maximum allowed codepoint</dfn>
jackalmage@5548 1316
jackalmage@5548 1317 <dd>The greatest codepoint defined by Unicode. This is currently U+10FFFF.
jackalmage@5473 1318 </dl>
jackalmage@5473 1319
jackalmage@7224 1320 <h3 id=tokenizer-state-machine><span class=secno>4.4. </span> Tokenizer
jackalmage@7224 1321 State Machine</h3>
jackalmage@7224 1322
jackalmage@7224 1323 <h4 id=data-state><span class=secno>4.4.1. </span> <dfn id=data-state0>Data
jackalmage@5473 1324 state</dfn></h4>
jackalmage@5473 1325
jackalmage@5473 1326 <p> Consume the <a href="#next-input-character"><i>next input
jackalmage@5473 1327 character</i></a>.
jackalmage@5473 1328
jackalmage@5473 1329 <dl>
jackalmage@5473 1330 <dt><a href="#whitespace"><i>whitespace</i></a>
jackalmage@5473 1331
jackalmage@5483 1332 <dd> Consume as much <a href="#whitespace"><i>whitespace</i></a> as
jackalmage@5483 1333 possible. Emit a whitespace token. Remain in this state.
jackalmage@5473 1334
jackalmage@5473 1335 <dt>U+0022 QUOTATION MARK (")
jackalmage@5473 1336
jackalmage@5473 1337 <dd> Switch to the <a
jackalmage@5473 1338 href="#double-quote-string-state0"><i>double-quote-string state</i></a>.
jackalmage@5473 1339
jackalmage@5473 1340 <dt>U+0023 NUMBER SIGN (#)
jackalmage@5473 1341
jackalmage@5473 1342 <dd> Switch to the <a href="#hash-state0"><i>hash state</i></a>.
jackalmage@5473 1343
jackalmage@7370 1344 <dt>U+0024 DOLLAR SIGN ($)
jackalmage@7370 1345
jackalmage@7370 1346 <dd> If the <a href="#next-input-character"><i>next input
jackalmage@7370 1347 character</i></a> is U+003D EQUALS SIGN (=), consume it and emit a
jackalmage@7370 1348 suffix-match token. Remain in this state.
jackalmage@7370 1349 <p> Otherwise, emit a delim token with its value set to the <a
jackalmage@7370 1350 href="#current-input-character"><i>current input character</i></a>.
jackalmage@7370 1351 Remain in this state.
jackalmage@7370 1352
jackalmage@5547 1353 <dt>U+0027 APOSTROPHE (&apos;)
jackalmage@5473 1354
jackalmage@5473 1355 <dd> Switch to the <a
jackalmage@5473 1356 href="#single-quote-string-state0"><i>single-quote-string state</i></a>.
jackalmage@5473 1357
jackalmage@5473 1358 <dt>U+0028 LEFT PARENTHESIS (()
jackalmage@5473 1359
jackalmage@6251 1360 <dd> Emit a ( token. Remain in this state.
jackalmage@5473 1361
jackalmage@5473 1362 <dt>U+0029 RIGHT PARENTHESIS ())
jackalmage@5473 1363
jackalmage@6020 1364 <dd> Emit a ) token. Remain in this state.
jackalmage@5473 1365
jackalmage@7370 1366 <dt>U+002A ASTERISK (*)
jackalmage@7370 1367
jackalmage@7370 1368 <dd> If the <a href="#next-input-character"><i>next input
jackalmage@7370 1369 character</i></a> is U+003D EQUALS SIGN (=), consume it and emit a
jackalmage@7370 1370 substring-match token. Remain in this state.
jackalmage@7370 1371 <p> Otherwise, emit a delim token with its value set to the <a
jackalmage@7370 1372 href="#current-input-character"><i>current input character</i></a>.
jackalmage@7370 1373 Remain in this state.
jackalmage@7370 1374
jackalmage@5473 1375 <dt>U+002B PLUS SIGN (+)
jackalmage@5473 1376
jackalmage@5473 1377 <dd> If the <a href="#next-input-character"><i>next input
jackalmage@5473 1378 character</i></a> is a <a href="#digit"><i>digit</i></a>, or the <a
jackalmage@5473 1379 href="#next-input-character"><i title="next input character">next 2 input
jackalmage@5500 1380 characters</i></a> are U+002E FULL STOP (.) followed by a <a
jackalmage@5473 1381 href="#digit"><i>digit</i></a>, switch to the <a
jackalmage@5477 1382 href="#number-state0"><i>number state</i></a>. Reconsume the <a
jackalmage@5477 1383 href="#current-input-character"><i>current input character</i></a>.
jackalmage@5473 1384 <p> Otherwise, emit a delim token with its value set to U+002B PLUS SIGN
jackalmage@5473 1385 (+). Remain in this state.
jackalmage@5473 1386
jackalmage@7445 1387 <dt>U+002C COMMA (,)
jackalmage@7445 1388
jackalmage@7445 1389 <dd> Emit a comma token. Remain in this state.
jackalmage@7445 1390
jackalmage@5473 1391 <dt>U+002D HYPHEN-MINUS (-)
jackalmage@5473 1392
jackalmage@5473 1393 <dd> If the <a href="#next-input-character"><i
jackalmage@5473 1394 title="next input character">next 2 input characters</i></a> are U+002D
jackalmage@5473 1395 HYPHEN-MINUS U+003E GREATER-THAN SIGN (->), consume them, emit a CDC
jackalmage@5473 1396 token, and remain in this state.
jackalmage@5473 1397 <p> Otherwise, if the <a href="#next-input-character"><i>next input
jackalmage@5477 1398 character</i></a> is a <a href="#digit"><i>digit</i></a>, or the <a
jackalmage@5477 1399 href="#next-input-character"><i title="next input character">next 2
jackalmage@5500 1400 input characters</i></a> are U+002E FULL STOP (.) followed by a <a
jackalmage@5477 1401 href="#digit"><i>digit</i></a>, switch to the <a
jackalmage@5473 1402 href="#number-state0"><i>number state</i></a>. Reconsume the <a
jackalmage@5473 1403 href="#current-input-character"><i>current input character</i></a>.
jackalmage@5473 1404
jackalmage@7197 1405 <p> Otherwise, switch to the <a href="#ident-state0"><i>ident
jackalmage@6871 1406 state</i></a>. Reconsume the <a
jackalmage@5473 1407 href="#current-input-character"><i>current input character</i></a>.
jackalmage@5473 1408
jackalmage@5473 1409 <dt>U+002E FULL STOP (.)
jackalmage@5473 1410
jackalmage@5473 1411 <dd> If the <a href="#next-input-character"><i>next input
jackalmage@7196 1412 character</i></a> is a <a href="#digit"><i>digit</i></a>, switch to the
jackalmage@7196 1413 <a href="#number-state0"><i>number state</i></a>. Reconsume the <a
jackalmage@5473 1414 href="#current-input-character"><i>current input character</i></a>.
jackalmage@5473 1415 <p> Otherwise, emit a delim token with its value set to U+002E FULL STOP
jackalmage@5473 1416 (.). Remain in this state.
jackalmage@5473 1417
jackalmage@5473 1418 <dt>U+002F SOLIDUS (/)
jackalmage@5473 1419
jackalmage@5473 1420 <dd> If the <a href="#next-input-character"><i>next input
jackalmage@5473 1421 character</i></a> is U+002A ASTERISK (*), consume it and switch to the <a
jackalmage@5473 1422 href="#comment-state0"><i>comment state</i></a>.
jackalmage@5473 1423 <p> Otherwise, emit a delim token with its value set to U+002F SOLIDUS
jackalmage@5473 1424 (/). Remain in this state.
jackalmage@5473 1425
jackalmage@5473 1426 <dt>U+003A COLON (:)
jackalmage@5473 1427
jackalmage@5473 1428 <dd> Emit a colon token. Remain in this state.
jackalmage@5473 1429
jackalmage@5473 1430 <dt>U+003B SEMICOLON (;)
jackalmage@5473 1431
jackalmage@5473 1432 <dd> Emit a semicolon token. Remain in this state.
jackalmage@5473 1433
jackalmage@5473 1434 <dt>U+003C LESS-THAN SIGN (&lt;)
jackalmage@5473 1435
jackalmage@5473 1436 <dd> If the <a href="#next-input-character"><i
jackalmage@5473 1437 title="next input character">next 3 input characters</i></a> are U+0021
jackalmage@5473 1438 EXCLAMATION MARK U+002D HYPHEN-MINUS U+002D HYPHEN-MINUS (!--), consume
jackalmage@5473 1439 them and emit a cdo token. Remain in this state.
jackalmage@5473 1440 <p> Otherwise, emit a delim token with its value set to U+003C LESS-THAN
jackalmage@5473 1441 SIGN (&lt;). Remain in this state.
jackalmage@5473 1442
jackalmage@5473 1443 <dt>U+0040 COMMERCIAL AT (@)
jackalmage@5473 1444
jackalmage@5559 1445 <dd> Switch to the <a href="#at-keyword-state0"><i>at-keyword
jackalmage@5559 1446 state</i></a>.
jackalmage@5473 1447
jackalmage@5473 1448 <dt>U+005B LEFT SQUARE BRACKET ([)
jackalmage@5473 1449
jackalmage@6251 1450 <dd> Emit a [ token. Remain in this state.
jackalmage@5473 1451
jackalmage@5473 1452 <dt>U+005C REVERSE SOLIDUS (\)
jackalmage@5473 1453
jackalmage@5473 1454 <dd> If the <a href="#next-input-character"><i>next input
jackalmage@5473 1455 character</i></a> is a <a href="#newline"><i>newline</i></a> or EOF, this
jackalmage@5473 1456 is a <i>parse error</i>. Emit a delim token with its value set to U+005C
jackalmage@5473 1457 REVERSE SOLIDUS (\). Remain in this state.
jackalmage@6871 1458 <p> Otherwise, switch to the <a href="#ident-state0"><i>ident
jackalmage@5473 1459 state</i></a>. Reconsume the <a
jackalmage@5473 1460 href="#current-input-character"><i>current input character</i></a>.
jackalmage@5473 1461
jackalmage@5473 1462 <dt>U+005D RIGHT SQUARE BRACKET (])
jackalmage@5473 1463
jackalmage@6020 1464 <dd> Emit a ] token. Remain in this state.
jackalmage@5473 1465
jackalmage@7370 1466 <dt>U+005E CIRCUMFLEX ACCENT (^)
jackalmage@7370 1467
jackalmage@7370 1468 <dd> If the <a href="#next-input-character"><i>next input
jackalmage@7370 1469 character</i></a> is U+003D EQUALS SIGN (=), consume it and emit a
jackalmage@7370 1470 prefix-match token. Remain in this state.
jackalmage@7370 1471 <p> Otherwise, emit a delim token with its value set to the <a
jackalmage@7370 1472 href="#current-input-character"><i>current input character</i></a>.
jackalmage@7370 1473 Remain in this state.
jackalmage@7370 1474
jackalmage@5473 1475 <dt>U+007B LEFT CURLY BRACKET ({)
jackalmage@5473 1476
jackalmage@6865 1477 <dd> Emit a { token. Remain in this state.
jackalmage@5473 1478
jackalmage@5473 1479 <dt>U+007D RIGHT CURLY BRACKET (})
jackalmage@5473 1480
jackalmage@6251 1481 <dd> Emit a } token. Remain in this state.
jackalmage@5473 1482
jackalmage@5473 1483 <dt><a href="#digit"><i>digit</i></a>
jackalmage@5473 1484
jackalmage@5473 1485 <dd> Switch to the <a href="#number-state0"><i>number state</i></a>.
jackalmage@5473 1486 Reconsume the <a href="#current-input-character"><i>current input
jackalmage@5473 1487 character</i></a>.
jackalmage@5473 1488
jackalmage@5473 1489 <dt>U+0055 LATIN CAPITAL LETTER U (U)
jackalmage@5473 1490
jackalmage@5473 1491 <dt>U+0075 LATIN SMALL LETTER U (u)
jackalmage@5473 1492
jackalmage@5473 1493 <dd> If the <a href="#next-input-character"><i
jackalmage@5473 1494 title="next input character">next 2 input character</i></a> are U+002B
jackalmage@7340 1495 PLUS SIGN (+) followed by a <a href="#hex-digit"><i>hex digit</i></a> or
jackalmage@7340 1496 U+003F QUESTION MARK (?), consume the <a
jackalmage@7340 1497 href="#next-input-character"><i>next input character</i></a>. <span
jackalmage@7340 1498 class=note>Note: don't consume both of them.</span> Switch to the <a
jackalmage@5473 1499 href="#unicode-range-state0"><i>unicode-range state</i></a>.
jackalmage@6871 1500 <p>Otherwise, switch to the <a href="#ident-state0"><i>ident
jackalmage@5473 1501 state</i></a>. Reconsume the <a
jackalmage@5473 1502 href="#current-input-character"><i>current input character</i></a>.
jackalmage@5473 1503
jackalmage@5473 1504 <dt><a href="#name-start-character"><i>name-start character</i></a>
jackalmage@5473 1505
jackalmage@6871 1506 <dd> Switch to the <a href="#ident-state0"><i>ident state</i></a>.
jackalmage@6871 1507 Reconsume the <a href="#current-input-character"><i>current input
jackalmage@6871 1508 character</i></a>.
jackalmage@5473 1509
jackalmage@7370 1510 <dt>U+007C VERTICAL LINE (|)
jackalmage@7370 1511
jackalmage@7370 1512 <dd> If the <a href="#next-input-character"><i>next input
jackalmage@7370 1513 character</i></a> is U+003D EQUALS SIGN (=), consume it and emit a
jackalmage@7370 1514 dash-match token. Remain in this state.
jackalmage@7370 1515 <p> Otherwise, emit a delim token with its value set to the <a
jackalmage@7370 1516 href="#current-input-character"><i>current input character</i></a>.
jackalmage@7370 1517 Remain in this state.
jackalmage@7370 1518
jackalmage@7370 1519 <dt>U+007E TILDE (~)
jackalmage@7370 1520
jackalmage@7370 1521 <dd> If the <a href="#next-input-character"><i>next input
jackalmage@7370 1522 character</i></a> is U+003D EQUALS SIGN (=), consume it and emit an
jackalmage@7370 1523 includes-match token. Remain in this state.
jackalmage@7370 1524 <p> Otherwise, emit a delim token with its value set to the <a
jackalmage@7370 1525 href="#current-input-character"><i>current input character</i></a>.
jackalmage@7370 1526 Remain in this state.
jackalmage@7370 1527
jackalmage@5473 1528 <dt>EOF
jackalmage@5473 1529
jackalmage@5473 1530 <dd> Emit an end-of-file token.
jackalmage@5473 1531
jackalmage@5473 1532 <dt>anything else
jackalmage@5473 1533
jackalmage@5473 1534 <dd> Emit a delim token with its value set to the <a
jackalmage@5473 1535 href="#current-input-character"><i>current input character</i></a>.
jackalmage@5473 1536 Remain in this state.
jackalmage@5473 1537 </dl>
jackalmage@5473 1538
jackalmage@7224 1539 <h4 id=double-quote-string-state><span class=secno>4.4.2. </span> <dfn
jackalmage@5473 1540 id=double-quote-string-state0>Double-quote-string state</dfn></h4>
jackalmage@5473 1541
jackalmage@5473 1542 <p> If a string token has not yet been created since entering this state,
jackalmage@5473 1543 create a string token with its value initially set to the empty string.
jackalmage@5473 1544
jackalmage@5473 1545 <p> Consume the <a href="#next-input-character"><i>next input
jackalmage@5473 1546 character</i></a>.
jackalmage@5473 1547
jackalmage@5473 1548 <dl>
jackalmage@5473 1549 <dt>U+0022 QUOTATION MARK (")
jackalmage@5473 1550
jackalmage@5473 1551 <dd> Emit the string token. Return to the <a href="#data-state0"><i>data
jackalmage@5473 1552 state</i></a>.
jackalmage@5473 1553
jackalmage@5473 1554 <dt>EOF
jackalmage@5473 1555
jackalmage@5473 1556 <dd> This is a <i>parse error</i>. Emit the string token. Switch to the <a
jackalmage@5473 1557 href="#data-state0"><i>data state</i></a>. Reconsume the <a
jackalmage@5473 1558 href="#current-input-character"><i>current input character</i></a>.
jackalmage@5473 1559
jackalmage@5473 1560 <dt><a href="#newline"><i>newline</i></a>
jackalmage@5473 1561
jackalmage@5494 1562 <dd> This is a <i>parse error</i>. Emit a bad-string token. Switch to the
jackalmage@6010 1563 <a href="#data-state0"><i>data state</i></a>. Reconsume the <a
jackalmage@6010 1564 href="#current-input-character"><i>current input character</i></a>.
jackalmage@5473 1565
jackalmage@5473 1566 <dt>U+005C REVERSE SOLIDUS (\)
jackalmage@5473 1567
jackalmage@5473 1568 <dd> If the <a href="#next-input-character"><i>next input
jackalmage@6009 1569 character</i></a> is an EOF, this is a <i>parse error</i>. Emit a
jackalmage@6009 1570 bad-string token, then switch to the <a href="#data-state0"><i>data
jackalmage@5473 1571 state</i></a>.
jackalmage@5473 1572 <p> Otherwise, if the <a href="#next-input-character"><i>next input
jackalmage@5473 1573 character</i></a> is a <a href="#newline"><i>newline</i></a>, consume
jackalmage@5473 1574 it. Remain in this state.
jackalmage@5473 1575
jackalmage@5544 1576 <p> Otherwise, <a href="#consume-an-escaped-character0"><i>consume an
jackalmage@5544 1577 escaped character</i></a>. Append the returned character to the string
jackalmage@5544 1578 token's value. Remain in this state.
jackalmage@5473 1579
jackalmage@5473 1580 <dt>anything else
jackalmage@5473 1581
jackalmage@5473 1582 <dd> Append the <a href="#current-input-character"><i>current input
jackalmage@5473 1583 character</i></a> to the string token's value. Remain in this state.
jackalmage@5473 1584 </dl>
jackalmage@5473 1585
jackalmage@7224 1586 <h4 id=single-quote-string-state><span class=secno>4.4.3. </span> <dfn
jackalmage@5473 1587 id=single-quote-string-state0>Single-quote-string state</dfn></h4>
jackalmage@5473 1588
jackalmage@5473 1589 <p> If a string token has not yet been created since entering this state,
jackalmage@5473 1590 create a string token with its value initially set to the empty string.
jackalmage@5473 1591
jackalmage@5473 1592 <p> Consume the <a href="#next-input-character"><i>next input
jackalmage@5473 1593 character</i></a>.
jackalmage@5473 1594
jackalmage@5473 1595 <dl>
jackalmage@5547 1596 <dt>U+0027 APOSTROPHE (&apos;)
jackalmage@5473 1597
jackalmage@5473 1598 <dd> Emit the string token. Return to the <a href="#data-state0"><i>data
jackalmage@5473 1599 state</i></a>.
jackalmage@5473 1600
jackalmage@5473 1601 <dt>EOF
jackalmage@5473 1602
jackalmage@5473 1603 <dd> This is a <i>parse error</i>. Emit the string token. Switch to the <a
jackalmage@5473 1604 href="#data-state0"><i>data state</i></a>. Reconsume the <a
jackalmage@5473 1605 href="#current-input-character"><i>current input character</i></a>.
jackalmage@5473 1606
jackalmage@5473 1607 <dt><a href="#newline"><i>newline</i></a>
jackalmage@5473 1608
jackalmage@5494 1609 <dd> This is a <i>parse error</i>. Emit a bad-string token. Switch to the
jackalmage@6010 1610 <a href="#data-state0"><i>data state</i></a>. Reconsume the <a
jackalmage@6010 1611 href="#current-input-character"><i>current input character</i></a>.
jackalmage@5473 1612
jackalmage@5473 1613 <dt>U+005C REVERSE SOLIDUS (\)
jackalmage@5473 1614
jackalmage@5473 1615 <dd> If the <a href="#next-input-character"><i>next input
jackalmage@6009 1616 character</i></a> is an EOF, this is a <i>parse error</i>. Emit a
jackalmage@6009 1617 bad-string token, then switch to the <a href="#data-state0"><i>data
jackalmage@5473 1618 state</i></a>.
jackalmage@5473 1619 <p> Otherwise, if the <a href="#next-input-character"><i>next input
jackalmage@5473 1620 character</i></a> is a <a href="#newline"><i>newline</i></a>, consume
jackalmage@5473 1621 it. Remain in this state.
jackalmage@5473 1622
jackalmage@5544 1623 <p> Otherwise, <a href="#consume-an-escaped-character0"><i>consume an
jackalmage@5544 1624 escaped character</i></a>. Append the returned character to the string
jackalmage@5544 1625 token's value. Remain in this state.
jackalmage@5473 1626
jackalmage@5473 1627 <dt>anything else
jackalmage@5473 1628
jackalmage@5473 1629 <dd> Append the <a href="#current-input-character"><i>current input
jackalmage@5473 1630 character</i></a> to the string token's value. Remain in this state.
jackalmage@5473 1631 </dl>
jackalmage@5473 1632
jackalmage@7224 1633 <h4 id=hash-state><span class=secno>4.4.4. </span> <dfn id=hash-state0>Hash
jackalmage@5473 1634 state</dfn></h4>
jackalmage@5473 1635
jackalmage@5473 1636 <p> Consume the <a href="#next-input-character"><i>next input
jackalmage@5473 1637 character</i></a>.
jackalmage@5473 1638
jackalmage@5473 1639 <dl>
jackalmage@5473 1640 <dt><a href="#name-character"><i>name character</i></a>
jackalmage@5473 1641
jackalmage@5473 1642 <dd> Create a hash token with its value set to the <a
jackalmage@5473 1643 href="#current-input-character"><i>current input character</i></a>.
jackalmage@5473 1644 Switch to the <a href="#hash-rest-state0"><i>hash-rest state</i></a>.
jackalmage@5473 1645
jackalmage@5473 1646 <dt>U+005C REVERSE SOLIDUS (\)
jackalmage@5473 1647
jackalmage@5473 1648 <dd> If the <a href="#next-input-character"><i>next input
jackalmage@5473 1649 character</i></a> is a <a href="#newline"><i>newline</i></a> or EOF, emit
jackalmage@5473 1650 a delim token with its value set to U+0023 NUMBER SIGN (#). Switch to the
jackalmage@5473 1651 <a href="#data-state0"><i>data state</i></a>. Reconsume the <a
jackalmage@5473 1652 href="#current-input-character"><i>current input character</i></a>.
jackalmage@5545 1653 <p> Otherwise, <a href="#consume-an-escaped-character0"><i>consume an
jackalmage@5545 1654 escaped character</i></a>. Create a hash token with its value set to the
jackalmage@5545 1655 returned character. Switch to the <a
jackalmage@5545 1656 href="#hash-rest-state0"><i>hash-rest state</i></a>.
jackalmage@5473 1657
jackalmage@5473 1658 <dt>anything else
jackalmage@5473 1659
jackalmage@5473 1660 <dd> Emit a delim token with its value set to U+0023 NUMBER SIGN (#).
jackalmage@5473 1661 Switch to the <a href="#data-state0"><i>data state</i></a>. Reconsume the
jackalmage@5473 1662 <a href="#current-input-character"><i>current input character</i></a>.
jackalmage@5473 1663 </dl>
jackalmage@5473 1664
jackalmage@7224 1665 <h4 id=hash-rest-state><span class=secno>4.4.5. </span> <dfn
jackalmage@5473 1666 id=hash-rest-state0>Hash-rest state</dfn></h4>
jackalmage@5473 1667
jackalmage@5473 1668 <p> Consume the <a href="#next-input-character"><i>next input
jackalmage@5473 1669 character</i></a>.
jackalmage@5473 1670
jackalmage@5473 1671 <dl>
jackalmage@5473 1672 <dt><a href="#name-character"><i>name character</i></a>
jackalmage@5473 1673
jackalmage@5473 1674 <dd> Append the <a href="#current-input-character"><i>current input
jackalmage@5473 1675 character</i></a> to the hash token's value. Remain in this state.
jackalmage@5473 1676
jackalmage@5473 1677 <dt>U+005C REVERSE SOLIDUS (\)
jackalmage@5473 1678
jackalmage@5473 1679 <dd> If the <a href="#next-input-character"><i>next input
jackalmage@5473 1680 character</i></a> is a <a href="#newline"><i>newline</i></a> or EOF, emit
jackalmage@5473 1681 the hash token. Switch to the <a href="#data-state0"><i>data
jackalmage@5473 1682 state</i></a>. Reconsume the <a
jackalmage@5473 1683 href="#current-input-character"><i>current input character</i></a>.
jackalmage@5473 1684 <p> Otherwise, <a href="#consume-an-escaped-character0"><i>consume an
jackalmage@5473 1685 escaped character</i></a>. Append the returned character to the hash
jackalmage@5473 1686 token's value. Remain in this state.
jackalmage@5473 1687
jackalmage@5473 1688 <dt>anything else
jackalmage@5473 1689
jackalmage@5473 1690 <dd> Emit the hash token. Switch to the <a href="#data-state0"><i>data
jackalmage@5473 1691 state</i></a>. Reconsume the <a
jackalmage@5473 1692 href="#current-input-character"><i>current input character</i></a>.
jackalmage@5473 1693 </dl>
jackalmage@5473 1694
jackalmage@7224 1695 <h4 id=comment-state><span class=secno>4.4.6. </span> <dfn
jackalmage@5473 1696 id=comment-state0>Comment state</dfn></h4>
jackalmage@5473 1697
jackalmage@5473 1698 <p> Consume the <a href="#next-input-character"><i>next input
jackalmage@5473 1699 character</i></a>.
jackalmage@5473 1700
jackalmage@5473 1701 <dl>
jackalmage@5473 1702 <dt>U+002A ASTERISK (*)
jackalmage@5473 1703
jackalmage@5473 1704 <dd> If the <a href="#next-input-character"><i>next input
jackalmage@7217 1705 character</i></a> is U+002F SOLIDUS (/), consume it, and switch to the <a
jackalmage@7217 1706 href="#data-state0"><i>data state</i></a>.
jackalmage@5473 1707 <p> Otherwise, do nothing and remain in this state.
jackalmage@5473 1708
jackalmage@5473 1709 <dt>EOF
jackalmage@5473 1710
jackalmage@7217 1711 <dd> This is a <i>parse error</i>. Switch to the <a
jackalmage@5473 1712 href="#data-state0"><i>data state</i></a>. Reconsume the <a
jackalmage@5473 1713 href="#current-input-character"><i>current input character</i></a>.
jackalmage@5473 1714
jackalmage@5473 1715 <dt>anything else
jackalmage@5473 1716
jackalmage@5473 1717 <dd> Do nothing and remain in this state.
jackalmage@5473 1718 </dl>
jackalmage@5473 1719
jackalmage@7224 1720 <h4 id=at-keyword-state><span class=secno>4.4.7. </span> <dfn
jackalmage@5473 1721 id=at-keyword-state0>At-keyword state</dfn></h4>
jackalmage@5473 1722
jackalmage@5473 1723 <p> Consume the <a href="#next-input-character"><i>next input
jackalmage@5473 1724 character</i></a>.
jackalmage@5473 1725
jackalmage@5473 1726 <dl>
jackalmage@5473 1727 <dt>U+002D HYPHEN-MINUS (-)
jackalmage@5473 1728
jackalmage@5473 1729 <dd> If the <a href="#next-input-character"><i>next input
jackalmage@5473 1730 character</i></a> is a <a href="#name-start-character"><i>name-start
jackalmage@7198 1731 character</i></a>, Create an at-keyword token with its value initially
jackalmage@7198 1732 set to U+002D HYPHEN-MINUS. Switch to the <a
jackalmage@7198 1733 href="#at-keyword-rest-state0"><i>at-keyword-rest state</i></a>.
jackalmage@7198 1734 <p> Otherwise, if the <a href="#next-input-character"><i
jackalmage@7198 1735 title="next input character">next two characters</i></a> are U+005C
jackalmage@7198 1736 REVERSE SOLIDUS (\) followed by anything but a <a
jackalmage@7198 1737 href="#newline"><i>newline</i></a> or EOF, create an at-keyword token
jackalmage@7198 1738 with its value initially set to U+002D HYPHEN-MINUS. Switch to the <a
jackalmage@7198 1739 href="#at-keyword-rest-state0"><i>at-keyword-rest state</i></a>.
jackalmage@7198 1740
jackalmage@5473 1741 <p> Otherwise, emit a delim token with its value set to U+0040 COMMERCIAL
jackalmage@5473 1742 AT (@). Switch to the <a href="#data-state0"><i>data state</i></a>.
jackalmage@5473 1743 Reconsume the <a href="#current-input-character"><i>current input
jackalmage@5473 1744 character</i></a>.
jackalmage@5473 1745
jackalmage@5473 1746 <dt><a href="#name-start-character"><i>name-start character</i></a>
jackalmage@5473 1747
jackalmage@5473 1748 <dd> Create an at-keyword token with its value set to the <a
jackalmage@5473 1749 href="#current-input-character"><i>current input character</i></a>.
jackalmage@5473 1750 Switch to the <a href="#at-keyword-rest-state0"><i>at-keyword-rest
jackalmage@5473 1751 state</i></a>.
jackalmage@5473 1752
jackalmage@5473 1753 <dt>U+005C REVERSE SOLIDUS (\)
jackalmage@5473 1754
jackalmage@5473 1755 <dd> If the <a href="#next-input-character"><i>next input
jackalmage@5473 1756 character</i></a> is a <a href="#newline"><i>newline</i></a> or EOF, emit
jackalmage@5473 1757 a delim token with its value set to U+0040 COMMERCIAL AT (@). Switch to
jackalmage@5473 1758 the <a href="#data-state0"><i>data state</i></a>. Reconsume the <a
jackalmage@5473 1759 href="#current-input-character"><i>current input character</i></a>.
jackalmage@5473 1760 <p> Otherwise, <a href="#consume-an-escaped-character0"><i>consume an
jackalmage@5473 1761 escaped character</i></a>. Create an at-keyword token with its value set
jackalmage@5473 1762 to the returned character. Switch to the <a
jackalmage@5473 1763 href="#at-keyword-rest-state0"><i>at-keyword-rest state</i></a>.
jackalmage@5473 1764
jackalmage@5473 1765 <dt>anything else
jackalmage@5473 1766
jackalmage@5473 1767 <dd> Emit a delim token with its value set to U+0040 COMMERCIAL AT (@).
jackalmage@5473 1768 Switch to the <a href="#data-state0"><i>data state</i></a>. Reconsume the
jackalmage@5473 1769 <a href="#current-input-character"><i>current input character</i></a>.
jackalmage@5473 1770 </dl>
jackalmage@5473 1771
jackalmage@7224 1772 <h4 id=at-keyword-rest-state><span class=secno>4.4.8. </span> <dfn
jackalmage@5473 1773 id=at-keyword-rest-state0>At-keyword-rest state</dfn></h4>
jackalmage@5473 1774
jackalmage@5473 1775 <p> Consume the <a href="#next-input-character"><i>next input
jackalmage@5473 1776 character</i></a>.
jackalmage@5473 1777
jackalmage@5473 1778 <dl>
jackalmage@5473 1779 <dt><a href="#name-character"><i>name character</i></a>
jackalmage@5473 1780
jackalmage@5473 1781 <dd> Append the <a href="#current-input-character"><i>current input
jackalmage@5473 1782 character</i></a> to the at-keyword token's value. Remain in this state.
jackalmage@5473 1783
jackalmage@5473 1784 <dt>U+005C REVERSE SOLIDUS (\)
jackalmage@5473 1785
jackalmage@5473 1786 <dd> If the <a href="#next-input-character"><i>next input
jackalmage@5473 1787 character</i></a> is a <a href="#newline"><i>newline</i></a> or EOF, emit
jackalmage@5473 1788 the at-keyword token. Switch to the <a href="#data-state0"><i>data
jackalmage@5473 1789 state</i></a>. Reconsume the <a
jackalmage@5473 1790 href="#current-input-character"><i>current input character</i></a>.
jackalmage@5473 1791 <p> Otherwise, <a href="#consume-an-escaped-character0"><i>consume an
jackalmage@5473 1792 escaped character</i></a>. Append the returned character to the
jackalmage@5473 1793 at-keyword token's value. Remain in this state.
jackalmage@5473 1794
jackalmage@5473 1795 <dt>anything else
jackalmage@5473 1796
jackalmage@5473 1797 <dd> Emit the at-keyword token. Switch to the <a
jackalmage@5473 1798 href="#data-state0"><i>data state</i></a>. Reconsume the <a
jackalmage@5473 1799 href="#current-input-character"><i>current input character</i></a>.
jackalmage@5473 1800 </dl>
jackalmage@5473 1801
jackalmage@7224 1802 <h4 id=ident-state><span class=secno>4.4.9. </span> <dfn
jackalmage@6871 1803 id=ident-state0>Ident state</dfn></h4>
jackalmage@5473 1804
jackalmage@5473 1805 <p> Consume the <a href="#next-input-character"><i>next input
jackalmage@5473 1806 character</i></a>.
jackalmage@5473 1807
jackalmage@5473 1808 <dl>
jackalmage@5473 1809 <dt>U+002D HYPHEN-MINUS (-)
jackalmage@5473 1810
jackalmage@5473 1811 <dd> If the <a href="#next-input-character"><i>next input
jackalmage@5486 1812 character</i></a> is a <a href="#name-start-character"><i>name-start
jackalmage@5473 1813 character</i></a>, create an identifer token with its value initially set
jackalmage@5473 1814 to U+002D HYPHEN-MINUS. Switch to the <a
jackalmage@6871 1815 href="#ident-rest-state0"><i>ident-rest state</i></a>.
jackalmage@7197 1816 <p> Otherwise, if the <a href="#next-input-character"><i
jackalmage@7197 1817 title="next input character">next two characters</i></a> are U+005C
jackalmage@7197 1818 REVERSE SOLIDUS (\) followed by anything but a <a
jackalmage@7197 1819 href="#newline"><i>newline</i></a> or EOF, create an identifer token
jackalmage@7197 1820 with its value initially set to U+002D HYPHEN-MINUS. Switch to the <a
jackalmage@7197 1821 href="#ident-rest-state0"><i>ident-rest state</i></a>.
jackalmage@7197 1822
jackalmage@7197 1823 <p> Otherwise, emit a delim token with its value set to U+002D
jackalmage@7197 1824 HYPHEN-MINUS (-). Switch to the <a href="#data-state0"><i>data
jackalmage@7197 1825 state</i></a>.
jackalmage@5473 1826
jackalmage@5473 1827 <dt><a href="#name-start-character"><i>name-start character</i></a>
jackalmage@5473 1828
jackalmage@6871 1829 <dd> Create an ident token with its value set to the <a
jackalmage@5473 1830 href="#current-input-character"><i>current input character</i></a>.
jackalmage@6871 1831 Switch to the <a href="#ident-rest-state0"><i>ident-rest state</i></a>.
jackalmage@5473 1832
jackalmage@5473 1833 <dt>U+005C REVERSE SOLIDUS (\)
jackalmage@5473 1834
jackalmage@5473 1835 <dd> If the <a href="#next-input-character"><i>next input
jackalmage@5473 1836 character</i></a> is a <a href="#newline"><i>newline</i></a> or EOF,
jackalmage@5473 1837 switch to the <a href="#data-state0"><i>data state</i></a>. Reconsume the
jackalmage@5473 1838 <a href="#current-input-character"><i>current input character</i></a>.
jackalmage@5473 1839 <p> Otherwise, <a href="#consume-an-escaped-character0"><i>consume an
jackalmage@6871 1840 escaped character</i></a>. Create an ident token with its value set to
jackalmage@6871 1841 the returned character. Switch to the <a
jackalmage@7170 1842 href="#ident-rest-state0"><i>ident-rest state</i></a>. <!--
jackalmage@7170 1843 This state should only be entered with a valid character.
jackalmage@7170 1844 If it hits anything else, this is a spec error.
jackalmage@7170 1845 -->
jackalmage@5473 1846 </dl>
jackalmage@5473 1847
jackalmage@7224 1848 <h4 id=ident-rest-state><span class=secno>4.4.10. </span> <dfn
jackalmage@6871 1849 id=ident-rest-state0>Ident-rest state</dfn></h4>
jackalmage@5473 1850
jackalmage@5473 1851 <p> Consume the <a href="#next-input-character"><i>next input
jackalmage@5473 1852 character</i></a>.
jackalmage@5473 1853
jackalmage@5473 1854 <dl>
jackalmage@5473 1855 <dt><a href="#name-character"><i>name character</i></a>
jackalmage@5473 1856
jackalmage@5473 1857 <dd> Append the <a href="#current-input-character"><i>current input
jackalmage@6871 1858 character</i></a> to the ident token's value. Remain in this state.
jackalmage@5473 1859
jackalmage@5473 1860 <dt>U+005C REVERSE SOLIDUS (\)
jackalmage@5473 1861
jackalmage@5473 1862 <dd> If the <a href="#next-input-character"><i>next input
jackalmage@5473 1863 character</i></a> is a <a href="#newline"><i>newline</i></a> or EOF, emit
jackalmage@6871 1864 the ident token. Switch to the <a href="#data-state0"><i>data
jackalmage@5473 1865 state</i></a>. Reconsume the <a
jackalmage@5473 1866 href="#current-input-character"><i>current input character</i></a>.
jackalmage@5473 1867 <p> Otherwise, <a href="#consume-an-escaped-character0"><i>consume an
jackalmage@6871 1868 escaped character</i></a>. Append the returned character to the ident
jackalmage@6871 1869 token's value. Remain in this state.
jackalmage@5473 1870
jackalmage@5473 1871 <dt>U+0028 LEFT PARENTHESIS (()
jackalmage@5473 1872
jackalmage@7169 1873 <dd> If the identifier token's value is an <a
jackalmage@7169 1874 href="#ascii-case-insensitive"><i>ASCII case-insensitive</i></a> match
jackalmage@7169 1875 for "url", switch to the <a href="#url-state0"><i>url state</i></a>.
jackalmage@7169 1876 <p> Otherwise, Emit a function token with its value set to the identifier
jackalmage@7169 1877 token's value. Switch to the <a href="#data-state0"><i>data
jackalmage@7169 1878 state</i></a>.
jackalmage@5473 1879
jackalmage@5486 1880 <dt><a href="#whitespace"><i>whitespace</i></a>
jackalmage@5486 1881
jackalmage@5486 1882 <dd> If the <a href="#transform-function-whitespace"><i>transform function
jackalmage@7195 1883 whitespace</i></a> flag is set, reconsume the <a
jackalmage@7195 1884 href="#current-input-character"><i>current input character</i></a> and
jackalmage@7195 1885 switch to the <a
jackalmage@5486 1886 href="#transform-function-whitespace-state0"><i>transform-function-whitespace
jackalmage@5486 1887 state</i></a>.
jackalmage@6871 1888 <p> Otherwise, emit the ident token. Switch to the <a
jackalmage@5486 1889 href="#data-state0"><i>data state</i></a>. Reconsume the <a
jackalmage@5486 1890 href="#current-input-character"><i>current input character</i></a>.
jackalmage@5486 1891
jackalmage@5473 1892 <dt>anything else
jackalmage@5473 1893
jackalmage@6871 1894 <dd> Emit the ident token. Switch to the <a href="#data-state0"><i>data
jackalmage@6871 1895 state</i></a>. Reconsume the <a
jackalmage@5473 1896 href="#current-input-character"><i>current input character</i></a>.
jackalmage@5473 1897 </dl>
jackalmage@5473 1898
jackalmage@7224 1899 <h4 id=transform-function-whitespace-state><span class=secno>4.4.11.
jackalmage@5486 1900 </span> <dfn
jackalmage@5486 1901 id=transform-function-whitespace-state0>Transform-function-whitespace
jackalmage@5486 1902 state</dfn></h4>
jackalmage@5486 1903
jackalmage@5486 1904 <p> Consume the <a href="#next-input-character"><i>next input
jackalmage@5486 1905 character</i></a>.
jackalmage@5486 1906
jackalmage@5486 1907 <dl>
jackalmage@5486 1908 <dt><a href="#whitespace"><i>whitespace</i></a>
jackalmage@5486 1909
jackalmage@7195 1910 <dd> If the <a href="#next-input-character"><i>next input
jackalmage@7195 1911 character</i></a> is <a href="#whitespace"><i>whitespace</i></a>, remain
jackalmage@7195 1912 in this state.
jackalmage@7195 1913 <p> Otherwise, if the <a href="#next-input-character"><i>next input
jackalmage@7195 1914 character</i></a> is U+0028 LEFT PARENTHESES ((), emit a function token
jackalmage@7195 1915 with its value set to the identifer token's value. Switch to the <a
jackalmage@7195 1916 href="#data-state0"><i>data state</i></a>.
jackalmage@7195 1917
jackalmage@7195 1918 <p> Otherwise, emit the identifer token. Switch to the <a
jackalmage@7195 1919 href="#data-state0"><i>data state</i></a>. Reconsume the <a
jackalmage@7195 1920 href="#current-input-character"><i>current input character</i></a>.
jackalmage@5486 1921 </dl>
jackalmage@5486 1922
jackalmage@7224 1923 <h4 id=number-state><span class=secno>4.4.12. </span> <dfn
jackalmage@5473 1924 id=number-state0>Number state</dfn></h4>
jackalmage@5473 1925
jackalmage@5477 1926 <p> Create a number token with its representation initially set to the
jackalmage@5964 1927 empty string.
jackalmage@5477 1928
jackalmage@5473 1929 <p> Consume the <a href="#next-input-character"><i>next input
jackalmage@5473 1930 character</i></a>.
jackalmage@5473 1931
jackalmage@5473 1932 <dl>
jackalmage@5473 1933 <dt>U+002D HYPHEN-MINUS (-)
jackalmage@5473 1934
jackalmage@5473 1935 <dd> If the <a href="#next-input-character"><i>next input
jackalmage@5473 1936 character</i></a> is a <a href="#digit"><i>digit</i></a>, consume it.
jackalmage@5477 1937 Append U+002D HYPHEN-MINUS (-) to the number token's representation.
jackalmage@5477 1938 Append the <a href="#digit"><i>digit</i></a> to the number token's
jackalmage@5477 1939 representation. Switch to the <a
jackalmage@5473 1940 href="#number-rest-state0"><i>number-rest state</i></a>.
jackalmage@5473 1941 <p> Otherwise, if the <a href="#next-input-character"><i
jackalmage@5473 1942 title="next input character">next 2 input characters</i></a> are U+002E
jackalmage@5473 1943 FULL STOP followed by a <a href="#digit"><i>digit</i></a>, consume them.
jackalmage@5477 1944 Append U+002D HYPHEN-MINUS (-) to the number token's representation.
jackalmage@5477 1945 Append U+002E FULL STOP (.) to the number token's representation. Append
jackalmage@5477 1946 the <a href="#digit"><i>digit</i></a> to the number token's
jackalmage@5477 1947 representation. Switch to the <i>number fraction</i> state.
jackalmage@5473 1948
jackalmage@5473 1949 <p> Otherwise, switch to the <a href="#data-state0"><i>data
jackalmage@5473 1950 state</i></a>. Reconsume the <a
jackalmage@5473 1951 href="#current-input-character"><i>current input character</i></a>.
jackalmage@5473 1952
jackalmage@5477 1953 <dt>U+002B PLUS SIGN (+)
jackalmage@5473 1954
jackalmage@5473 1955 <dd> If the <a href="#next-input-character"><i>next input
jackalmage@5473 1956 character</i></a> is a <a href="#digit"><i>digit</i></a>, consume it.
jackalmage@5477 1957 Append U+002D PLUS SIGN (+) to the number token's representation. Append
jackalmage@5477 1958 the <a href="#digit"><i>digit</i></a> to the number token's
jackalmage@5477 1959 representation. Switch to the <a
jackalmage@5477 1960 href="#number-rest-state0"><i>number-rest state</i></a>.
jackalmage@5477 1961 <p> Otherwise, if the <a href="#next-input-character"><i
jackalmage@5477 1962 title="next input character">next 2 input characters</i></a> are U+002E
jackalmage@5477 1963 FULL STOP followed by a <a href="#digit"><i>digit</i></a>, consume them.
jackalmage@5477 1964 Append U+002D PLUS SIGN (+) to the number token's representation. Append
jackalmage@5477 1965 U+002E FULL STOP (.) to the number token's representation. Append the <a
jackalmage@5477 1966 href="#digit"><i>digit</i></a> to the number token's representation.
jackalmage@5477 1967 Switch to the <i>number fraction</i> state.
jackalmage@5477 1968
jackalmage@5477 1969 <p> Otherwise, switch to the <a href="#data-state0"><i>data
jackalmage@5477 1970 state</i></a>. Reconsume the <a
jackalmage@5477 1971 href="#current-input-character"><i>current input character</i></a>.
jackalmage@5477 1972
jackalmage@5477 1973 <dt><a href="#digit"><i>digit</i></a>
jackalmage@5477 1974
jackalmage@5477 1975 <dd> Append the <a href="#current-input-character"><i>current input
jackalmage@5477 1976 character</i></a> to the number token's representation. Switch to the <a
jackalmage@5477 1977 href="#number-rest-state0"><i>number-rest state</i></a>.
jackalmage@5477 1978
jackalmage@5477 1979 <dt>U+002E FULL STOP (.)
jackalmage@5477 1980
jackalmage@5477 1981 <dd> If the <a href="#next-input-character"><i>next input
jackalmage@5477 1982 character</i></a> is a <a href="#digit"><i>digit</i></a>, consume it.
jackalmage@5477 1983 Append U+002E FULL STOP (.) to the number token's representation. Append
jackalmage@5477 1984 the <a href="#digit"><i>digit</i></a> to the number token's
jackalmage@5477 1985 representation. Switch to the <a
jackalmage@5473 1986 href="#number-fraction-state0"><i>number-fraction state</i></a>.
jackalmage@5473 1987 <p> Otherwise, switch to the <a href="#data-state0"><i>data
jackalmage@5473 1988 state</i></a>. Reconsume the <a
jackalmage@5473 1989 href="#current-input-character"><i>current input character</i></a>.
jackalmage@5473 1990
jackalmage@5473 1991 <dt>anything else
jackalmage@5473 1992
jackalmage@5473 1993 <dd> Switch to the <a href="#data-state0"><i>data state</i></a>. Reconsume
jackalmage@5473 1994 the <a href="#current-input-character"><i>current input
jackalmage@5473 1995 character</i></a>.
jackalmage@5473 1996 </dl>
jackalmage@5473 1997
jackalmage@7224 1998 <h4 id=number-rest-state><span class=secno>4.4.13. </span> <dfn
jackalmage@5473 1999 id=number-rest-state0>Number-rest state</dfn></h4>
jackalmage@5473 2000
jackalmage@5473 2001 <p> Consume the <a href="#next-input-character"><i>next input
jackalmage@5473 2002 character</i></a>.
jackalmage@5473 2003
jackalmage@5473 2004 <dl>
jackalmage@5473 2005 <dt><a href="#digit"><i>digit</i></a>
jackalmage@5473 2006
jackalmage@5473 2007 <dd> Append the <a href="#current-input-character"><i>current input
jackalmage@5477 2008 character</i></a> to the number token's representation. Remain in this
jackalmage@5477 2009 state.
jackalmage@5473 2010
jackalmage@5473 2011 <dt>U+002E FULL STOP (.)
jackalmage@5473 2012
jackalmage@5473 2013 <dd> If the <a href="#next-input-character"><i>next input
jackalmage@5473 2014 character</i></a> is a <a href="#digit"><i>digit</i></a>, consume it.
jackalmage@5473 2015 Append U+002E FULL STOP (.) followed by the <a
jackalmage@5477 2016 href="#digit"><i>digit</i></a> to the number token's representation.
jackalmage@5477 2017 Switch to the <a href="#number-fraction-state0"><i>number-fraction
jackalmage@5477 2018 state</i></a>.
jackalmage@5477 2019 <p> Otherwise, set the number token's value to the number produced by
jackalmage@5477 2020 interpreting the number token's representation as a base-10 number and
jackalmage@5477 2021 emit it. Switch to the <a href="#data-state0"><i>data state</i></a>.
jackalmage@5477 2022 Reconsume the <a href="#current-input-character"><i>current input
jackalmage@5473 2023 character</i></a>.
jackalmage@5473 2024
jackalmage@6866 2025 <dt>U+0025 PERCENT SIGN (%)
jackalmage@5473 2026
jackalmage@6867 2027 <dd> Emit a percentage token with its value set to the number produced by
jackalmage@5477 2028 interpreting the number token's representation as a base-10 number.
jackalmage@7173 2029 Switch to the <a href="#data-state0"><i>data state</i></a>.
jackalmage@5481 2030
jackalmage@5481 2031 <dt>U+0045 LATIN CAPITAL LETTER E (E)
jackalmage@5481 2032
jackalmage@5481 2033 <dt>U+0065 LATIN SMALL LETTER E (e)
jackalmage@5481 2034
jackalmage@6545 2035 <dd> If the <a href="#next-input-character"><i>next input
jackalmage@6545 2036 character</i></a> is a <a href="#digit"><i>digit</i></a>, or the <a
jackalmage@6545 2037 href="#next-input-character"><i title="next input character">next 2 input
jackalmage@6545 2038 characters</i></a> are U+002B PLUS SIGN (+) or U+002D HYPHEN-MINUS (-)
jackalmage@6545 2039 followed by a <a href="#digit"><i>digit</i></a>, consume them and append
jackalmage@6545 2040 them to the number token's representation. Switch to the <a
jackalmage@6545 2041 href="#sci-notation-state0"><i>sci-notation state</i></a>.
jackalmage@5481 2042 <p> Otherwise, create a dimension token with its representation set to
jackalmage@5481 2043 the number token's representation, its value set to the number produced
jackalmage@5481 2044 by interpreting the number token's representation as a base-10 number,
jackalmage@5481 2045 and a unit initially set to the <a
jackalmage@5481 2046 href="#current-input-character"><i>current input character</i></a>.
jackalmage@5481 2047 Switch to the <a href="#dimension-state0"><i>dimension state</i></a>.
jackalmage@5477 2048
jackalmage@5477 2049 <dt>U+002D HYPHEN-MINUS (-)
jackalmage@5477 2050
jackalmage@5477 2051 <dd> If the <a href="#next-input-character"><i>next input
jackalmage@5477 2052 character</i></a> is a <a href="#name-start-character"><i>name-start
jackalmage@5477 2053 character</i></a>, consume it. Create a dimension token with its
jackalmage@5477 2054 representation set to the number token's representation, its value set to
jackalmage@5477 2055 the number produced by interpreting the number token's representation as
jackalmage@5477 2056 a base-10 number, and a unit initially set to U+002D HYPHEN-MINUS
jackalmage@5477 2057 followed by the <a href="#name-start-character"><i>name-start
jackalmage@5477 2058 character</i></a>. Switch to the <a href="#dimension-state0"><i>dimension
jackalmage@5477 2059 state</i></a>.
jackalmage@5477 2060 <p> Otherwise, if the <a href="#next-input-character"><i
jackalmage@5477 2061 title="next input character">next 2 input characters</i></a> are U+005C
jackalmage@5477 2062 REVERSE SOLIDUS (\) followed by a <a href="#newline"><i>newline</i></a>,
jackalmage@5477 2063 or U+005C REVERSE SOLIDUS (\) followed by EOF, set the number token's
jackalmage@5477 2064 value to the number produced by interpreting the number token's
jackalmage@5477 2065 representation as a base-10 number and emit it. Switch to the <a
jackalmage@5477 2066 href="#data-state0"><i>data state</i></a>. Reconsume the <a
jackalmage@5477 2067 href="#current-input-character"><i>current input character</i></a>.
jackalmage@5477 2068
jackalmage@5477 2069 <p> Otherwise, if the <a href="#next-input-character"><i>next input
jackalmage@5477 2070 character</i></a> is U+005C REVERSE SOLIDUS (\), consume it, then <a
jackalmage@5477 2071 href="#consume-an-escaped-character0"><i>consume an escaped
jackalmage@5477 2072 character</i></a>. Create a dimension token with its representation set
jackalmage@5477 2073 to the number token's representation, its value set to the number
jackalmage@5477 2074 produced by interpreting the number token's representation as a base-10
jackalmage@5477 2075 number, and a unit initially set to U+002D HYPHEN-MINUS followed by the
jackalmage@5477 2076 returned character. Switch to the <a
jackalmage@5477 2077 href="#dimension-state0"><i>dimension state</i></a>.
jackalmage@5477 2078
jackalmage@5477 2079 <p> Otherwise, set the number token's value to the number produced by
jackalmage@5477 2080 interpreting the number token's representation as a base-10 number and
jackalmage@5477 2081 emit it. Switch to the <a href="#data-state0"><i>data state</i></a>.
jackalmage@5477 2082 Reconsume the <a href="#current-input-character"><i>current input
jackalmage@5477 2083 character</i></a>.
jackalmage@5477 2084
jackalmage@5477 2085 <dt><a href="#name-start-character"><i>name-start character</i></a>
jackalmage@5477 2086
jackalmage@5477 2087 <dd> Create a dimension token with its representation set to the number
jackalmage@5477 2088 token's representation, its value set to the number produced by
jackalmage@5477 2089 interpreting the number token's representation as a base-10 number, and a
jackalmage@5477 2090 unit initially set to the <a href="#current-input-character"><i>current
jackalmage@5477 2091 input character</i></a>. Switch to the <a
jackalmage@5477 2092 href="#dimension-state0"><i>dimension state</i></a>.
jackalmage@5477 2093
jackalmage@5477 2094 <dt>U+005C REVERSE SOLIDUS (\)
jackalmage@5477 2095
jackalmage@5477 2096 <dd> If the <a href="#next-input-character"><i>next input
jackalmage@5477 2097 character</i></a> is a <a href="#newline"><i>newline</i></a> or EOF, set
jackalmage@5477 2098 the number token's value to the number produced by interpreting the
jackalmage@5477 2099 number token's representation as a base-10 number and emit it. Switch to
jackalmage@5477 2100 the <a href="#data-state0"><i>data state</i></a>. Reconsume the <a
jackalmage@5477 2101 href="#current-input-character"><i>current input character</i></a>.
jackalmage@5477 2102 <p> Otherwise, <a href="#consume-an-escaped-character0"><i>consume an
jackalmage@5477 2103 escaped character</i></a>. Create a dimension token with its
jackalmage@5477 2104 representation set to the number token's representation, its value set
jackalmage@5477 2105 to the number produced by interpreting the number token's representation
jackalmage@5477 2106 as a base-10 number, and a unit initially set to the returned character.
jackalmage@5477 2107 Switch to the <a href="#dimension-state0"><i>dimension state</i></a>.
jackalmage@5477 2108
jackalmage@5477 2109 <dt>anything else
jackalmage@5477 2110
jackalmage@5477 2111 <dd> Emit a number token with its value set to the number produced by
jackalmage@5473 2112 interpreting the string token's value as a base-10 number. Switch to the
jackalmage@5473 2113 <a href="#data-state0"><i>data state</i></a>. Reconsume the <a
jackalmage@5477 2114 href="#current-input-character"><i>current input character</i></a>.
jackalmage@5477 2115 </dl>
jackalmage@5477 2116
jackalmage@7224 2117 <h4 id=number-fraction-state><span class=secno>4.4.14. </span> <dfn
jackalmage@5477 2118 id=number-fraction-state0>Number-fraction state</dfn></h4>
jackalmage@5477 2119
jackalmage@5479 2120 <p> Set the number token's type flag to "number".
jackalmage@5479 2121
jackalmage@5477 2122 <p> Consume the <a href="#next-input-character"><i>next input
jackalmage@5477 2123 character</i></a>.
jackalmage@5477 2124
jackalmage@5477 2125 <dl>
jackalmage@5477 2126 <dt><a href="#digit"><i>digit</i></a>
jackalmage@5477 2127
jackalmage@5477 2128 <dd> Append the <a href="#current-input-character"><i>current input
jackalmage@5477 2129 character</i></a> to the string token's value. Remain in this state.
jackalmage@5477 2130
jackalmage@6866 2131 <dt>U+0025 PERCENT SIGN (%)
jackalmage@5477 2132
jackalmage@6867 2133 <dd> Emit a percentage token with its value set to the number produced by
jackalmage@5477 2134 interpreting the number token's representation as a base-10 number.
jackalmage@7308 2135 Switch to the <a href="#data-state0"><i>data state</i></a>.
jackalmage@5481 2136
jackalmage@5481 2137 <dt>U+0045 LATIN CAPITAL LETTER E (E)
jackalmage@5481 2138
jackalmage@5481 2139 <dt>U+0065 LATIN SMALL LETTER E (e)
jackalmage@5481 2140
jackalmage@6545 2141 <dd> If the <a href="#next-input-character"><i>next input
jackalmage@6545 2142 character</i></a> is a <a href="#digit"><i>digit</i></a>, or the <a
jackalmage@6545 2143 href="#next-input-character"><i title="next input character">next 2 input
jackalmage@6545 2144 characters</i></a> are U+002B PLUS SIGN (+) or U+002D HYPHEN-MINUS (-)
jackalmage@6545 2145 followed by a <a href="#digit"><i>digit</i></a>, consume them and append
jackalmage@6545 2146 them to the number token's representation. Switch to the <a
jackalmage@6545 2147 href="#sci-notation-state0"><i>sci-notation state</i></a>.
jackalmage@5481 2148 <p> Otherwise, create a dimension token with its representation set to
jackalmage@5481 2149 the number token's representation, its value set to the number produced
jackalmage@5481 2150 by interpreting the number token's representation as a base-10 number,
jackalmage@5481 2151 and a unit initially set to the <a
jackalmage@5481 2152 href="#current-input-character"><i>current input character</i></a>.
jackalmage@5481 2153 Switch to the <a href="#dimension-state0"><i>dimension state</i></a>.
jackalmage@5473 2154
jackalmage@5473 2155 <dt>U+002D HYPHEN-MINUS (-)
jackalmage@5473 2156
jackalmage@5473 2157 <dd> If the <a href="#next-input-character"><i>next input
jackalmage@5473 2158 character</i></a> is a <a href="#name-start-character"><i>name-start
jackalmage@5477 2159 character</i></a>, consume it. Create a dimension token with its
jackalmage@5477 2160 representation set to the number token's representation, its value set to
jackalmage@5477 2161 the number produced by interpreting the number token's representation as
jackalmage@5477 2162 a base-10 number, and a unit initially set to U+002D HYPHEN-MINUS
jackalmage@5477 2163 followed by the <a href="#name-start-character"><i>name-start
jackalmage@5477 2164 character</i></a>. Switch to the <a href="#dimension-state0"><i>dimension
jackalmage@5477 2165 state</i></a>.
jackalmage@5473 2166 <p> Otherwise, if the <a href="#next-input-character"><i
jackalmage@5473 2167 title="next input character">next 2 input characters</i></a> are U+005C
jackalmage@5473 2168 REVERSE SOLIDUS (\) followed by a <a href="#newline"><i>newline</i></a>,
jackalmage@5477 2169 or U+005C REVERSE SOLIDUS (\) followed by EOF, set the number token's
jackalmage@5477 2170 value to the number produced by interpreting the number token's
jackalmage@5477 2171 representation as a base-10 number and emit it. Switch to the <a
jackalmage@5477 2172 href="#data-state0"><i>data state</i></a>. Reconsume the <a
jackalmage@5473 2173 href="#current-input-character"><i>current input character</i></a>.
jackalmage@5473 2174
jackalmage@5473 2175 <p> Otherwise, if the <a href="#next-input-character"><i>next input
jackalmage@5473 2176 character</i></a> is U+005C REVERSE SOLIDUS (\), consume it, then <a
jackalmage@5473 2177 href="#consume-an-escaped-character0"><i>consume an escaped
jackalmage@5477 2178 character</i></a>. Create a dimension token with its representation set
jackalmage@5477 2179 to the number token's representation, its value set to the number
jackalmage@5477 2180 produced by interpreting the number token's representation as a base-10
jackalmage@5473 2181 number, and a unit initially set to U+002D HYPHEN-MINUS followed by the
jackalmage@5473 2182 returned character. Switch to the <a
jackalmage@5473 2183 href="#dimension-state0"><i>dimension state</i></a>.
jackalmage@5473 2184
jackalmage@5477 2185 <p> Otherwise, set the number token's value to the number produced by
jackalmage@5477 2186 interpreting the number token's representation as a base-10 number and
jackalmage@5477 2187 emit it. Switch to the <a href="#data-state0"><i>data state</i></a>.
jackalmage@5477 2188 Reconsume the <a href="#current-input-character"><i>current input
jackalmage@5473 2189 character</i></a>.
jackalmage@5473 2190
jackalmage@5473 2191 <dt><a href="#name-start-character"><i>name-start character</i></a>
jackalmage@5473 2192
jackalmage@5477 2193 <dd> Create a dimension token with its representation set to the number
jackalmage@5477 2194 token's representation, its value set to the number produced by
jackalmage@5477 2195 interpreting the number token's representation as a base-10 number, and a
jackalmage@5477 2196 unit initially set to the <a href="#current-input-character"><i>current
jackalmage@5477 2197 input character</i></a>. Switch to the <a
jackalmage@5477 2198 href="#dimension-state0"><i>dimension state</i></a>.
jackalmage@5473 2199
jackalmage@5473 2200 <dt>U+005C REVERSE SOLIDUS (\)
jackalmage@5473 2201
jackalmage@5473 2202 <dd> If the <a href="#next-input-character"><i>next input
jackalmage@5477 2203 character</i></a> is a <a href="#newline"><i>newline</i></a> or EOF, set
jackalmage@5477 2204 the number token's value to the number produced by interpreting the
jackalmage@5477 2205 number token's representation as a base-10 number and emit it. Switch to
jackalmage@5477 2206 the <a href="#data-state0"><i>data state</i></a>. Reconsume the <a
jackalmage@5473 2207 href="#current-input-character"><i>current input character</i></a>.
jackalmage@5473 2208 <p> Otherwise, <a href="#consume-an-escaped-character0"><i>consume an
jackalmage@5477 2209 escaped character</i></a>. Create a dimension token with its
jackalmage@5477 2210 representation set to the number token's representation, its value set
jackalmage@5477 2211 to the number produced by interpreting the number token's representation
jackalmage@5477 2212 as a base-10 number, and a unit initially set to the returned character.
jackalmage@5473 2213 Switch to the <a href="#dimension-state0"><i>dimension state</i></a>.
jackalmage@5473 2214
jackalmage@5473 2215 <dt>anything else
jackalmage@5473 2216
jackalmage@5473 2217 <dd> Emit a number token with its value set to the number produced by
jackalmage@5473 2218 interpreting the string token's value as a base-10 number. Switch to the
jackalmage@5473 2219 <a href="#data-state0"><i>data state</i></a>. Reconsume the <a
jackalmage@5473 2220 href="#current-input-character"><i>current input character</i></a>.
jackalmage@5473 2221 </dl>
jackalmage@5473 2222
jackalmage@7224 2223 <h4 id=dimension-state><span class=secno>4.4.15. </span> <dfn
jackalmage@5473 2224 id=dimension-state0>Dimension state</dfn></h4>
jackalmage@5473 2225 <!--
jackalmage@5473 2226 This state is currently always entered with a dimension token
jackalmage@5473 2227 having already been created and gotten over the "first valid character" hump,
jackalmage@5473 2228 so the dimension token is already ready to emit.
jackalmage@5473 2229
jackalmage@5473 2230 If this ever becomes not true, make the necessary additions here
jackalmage@5473 2231 or things will break.
jackalmage@5473 2232 -->
jackalmage@5473 2233
jackalmage@5473 2234 <p> Consume the <a href="#next-input-character"><i>next input
jackalmage@5473 2235 character</i></a>.
jackalmage@5473 2236
jackalmage@5473 2237 <dl>
jackalmage@5473 2238 <dt><a href="#name-character"><i>name character</i></a>
jackalmage@5473 2239
jackalmage@5473 2240 <dd> Append the <a href="#current-input-character"><i>current input
jackalmage@5473 2241 character</i></a> to the dimension token's unit. Remain in this state.
jackalmage@5473 2242
jackalmage@5473 2243 <dt>U+005C REVERSE SOLIDUS (\)
jackalmage@5473 2244
jackalmage@5473 2245 <dd> If the <a href="#next-input-character"><i>next input
jackalmage@5473 2246 character</i></a> is a <a href="#newline"><i>newline</i></a> or EOF, emit
jackalmage@5473 2247 the dimension token. Switch to the <a href="#data-state0"><i>data
jackalmage@5473 2248 state</i></a>. Reconsume the <a
jackalmage@5473 2249 href="#current-input-character"><i>current input character</i></a>.
jackalmage@5473 2250 <p> Otherwise, <a href="#consume-an-escaped-character0"><i>consume an
jackalmage@5473 2251 escaped character</i></a>. Append the returned character to the
jackalmage@5473 2252 dimension token's unit.
jackalmage@5473 2253
jackalmage@5473 2254 <dt>anything else
jackalmage@5473 2255
jackalmage@5473 2256 <dd> Emit the dimension token. Switch to the <a
jackalmage@5473 2257 href="#data-state0"><i>data state</i></a>. Reconsume the <a
jackalmage@5473 2258 href="#current-input-character"><i>current input character</i></a>.
jackalmage@5473 2259 </dl>
jackalmage@5473 2260
jackalmage@7224 2261 <h4 id=sci-notation-state><span class=secno>4.4.16. </span> <dfn
jackalmage@5481 2262 id=sci-notation-state0>Sci-notation state</dfn></h4>
jackalmage@5481 2263
jackalmage@7199 2264 <p> Set the number token's type flag to "number".
jackalmage@7199 2265
jackalmage@5481 2266 <p> Consume the <a href="#next-input-character"><i>next input
jackalmage@5481 2267 character</i></a>.
jackalmage@5481 2268
jackalmage@5481 2269 <dl>
jackalmage@5481 2270 <dt><a href="#digit"><i>digit</i></a>
jackalmage@5481 2271
jackalmage@5481 2272 <dd> Append the <a href="#current-input-character"><i>current input
jackalmage@5481 2273 character</i></a> to the number token's representation. Remain in this
jackalmage@5481 2274 state.
jackalmage@5481 2275
jackalmage@5481 2276 <dt>anything else
jackalmage@5481 2277
jackalmage@5481 2278 <dd> Let <var>base</var> be the result of interpreting the portion of the
jackalmage@5481 2279 number token's representation preceding the U+0045 LATIN CAPITAL LETTER E
jackalmage@5481 2280 (E) or U+0065 LATIN SMALL LETTER E (e) as a base-10 number.
jackalmage@5481 2281 <p> Let <var>power</var> be the result of interpreting the portion of the
jackalmage@5481 2282 number token's representation following the U+0045 LATIN CAPITAL LETTER
jackalmage@5481 2283 E (E) or U+0065 LATIN SMALL LETTER E (e) as a base-10 number.
jackalmage@5481 2284
jackalmage@5481 2285 <p> Set the number token's value to <code><var>base</var> *
jackalmage@5481 2286 10<sup><var>power</var></sup></code>. If the number token's value is not
jackalmage@5481 2287 an integer, set the number token's type flag to "number". Emit the
jackalmage@7134 2288 number token. Switch to the <a href="#data-state0"><i>data
jackalmage@7134 2289 state</i></a>. Reconsume the <a
jackalmage@5481 2290 href="#current-input-character"><i>current input character</i></a>.
jackalmage@5481 2291 </dl>
jackalmage@5481 2292
jackalmage@7224 2293 <h4 id=url-state><span class=secno>4.4.17. </span> <dfn id=url-state0>URL
jackalmage@5473 2294 state</dfn></h4>
jackalmage@5473 2295
jackalmage@5473 2296 <p> Consume the <a href="#next-input-character"><i>next input
jackalmage@5473 2297 character</i></a>.
jackalmage@5473 2298
jackalmage@5473 2299 <dl>
jackalmage@7135 2300 <dt>EOF
jackalmage@7135 2301
jackalmage@7135 2302 <dd> This is a <i>parse error</i>. Emit a bad-url token. Switch to the <a
jackalmage@7135 2303 href="#data-state0"><i>data state</i></a>.
jackalmage@7135 2304
jackalmage@5473 2305 <dt>U+0022 QUOTATION MARK (")
jackalmage@5473 2306
jackalmage@5473 2307 <dd> Switch to the <a href="#url-double-quote-state0"><i>url-double-quote
jackalmage@5473 2308 state</i></a>.
jackalmage@5473 2309
jackalmage@5547 2310 <dt>U+0027 APOSTROPHE (&apos;)
jackalmage@5473 2311
jackalmage@5473 2312 <dd> Switch to the <a href="#url-single-quote-state0"><i>url-single-quote
jackalmage@5473 2313 state</i></a>.
jackalmage@5473 2314
jackalmage@5473 2315 <dt>U+0029 RIGHT PARENTHESIS ())
jackalmage@5473 2316
jackalmage@5473 2317 <dd> Emit a url token with its value set to the empty string. Switch to
jackalmage@5473 2318 the <a href="#data-state0"><i>data state</i></a>.
jackalmage@5473 2319
jackalmage@5473 2320 <dt><a href="#whitespace"><i>whitespace</i></a>
jackalmage@5473 2321
jackalmage@5473 2322 <dd> Remain in this state.
jackalmage@5473 2323
jackalmage@5473 2324 <dt>anything else
jackalmage@5473 2325
jackalmage@5473 2326 <dd> Switch to the <a href="#url-unquoted-state0"><i>url-unquoted
jackalmage@5473 2327 state</i></a>. Reconsume the <a
jackalmage@5473 2328 href="#current-input-character"><i>current input character</i></a>.
jackalmage@5473 2329 </dl>
jackalmage@5473 2330
jackalmage@7224 2331 <h4 id=url-double-quote-state><span class=secno>4.4.18. </span> <dfn
jackalmage@5473 2332 id=url-double-quote-state0>URL-double-quote state</dfn></h4>
jackalmage@5473 2333
jackalmage@5473 2334 <p> If a url token has not yet been created since entering this state,
jackalmage@5473 2335 create a url token with its value initially set to the empty string.
jackalmage@5473 2336
jackalmage@5473 2337 <p> Consume the <a href="#next-input-character"><i>next input
jackalmage@5473 2338 character</i></a>.
jackalmage@5473 2339
jackalmage@5473 2340 <dl>
jackalmage@7135 2341 <dt>EOF
jackalmage@7135 2342
jackalmage@7135 2343 <dd> This is a <i>parse error</i>. Emit a bad-url token. Switch to the <a
jackalmage@7135 2344 href="#data-state0"><i>data state</i></a>.
jackalmage@7135 2345
jackalmage@5473 2346 <dt>U+0022 QUOTATION MARK (")
jackalmage@5473 2347
jackalmage@5473 2348 <dd> Switch to the <a href="#url-end-state0"><i>url-end state</i></a>.
jackalmage@5473 2349
jackalmage@5494 2350 <dt><a href="#newline"><i>newline</i></a>
jackalmage@5494 2351
jackalmage@5986 2352 <dd> This is a <i>parse error</i>. Switch to the <a
jackalmage@5986 2353 href="#bad-url-state0"><i>bad-url state</i></a>.
jackalmage@5494 2354
jackalmage@5473 2355 <dt>U+005C REVERSE SOLIDUS (\)
jackalmage@5473 2356
jackalmage@5473 2357 <dd> If the <a href="#next-input-character"><i>next input
jackalmage@5473 2358 character</i></a> is EOF, this is a <i>parse error</i>. Emit a bad-url
jackalmage@5473 2359 token. Switch to the <a href="#data-state0"><i>data state</i></a>.
jackalmage@5473 2360 Reconsume the <a href="#current-input-character"><i>current input
jackalmage@5473 2361 character</i></a>.
jackalmage@5473 2362 <p> Otherwise, if the <a href="#next-input-character"><i>next input
jackalmage@5473 2363 character</i></a> is a <a href="#newline"><i>newline</i></a>, consume it
jackalmage@5473 2364 and remain in this state.
jackalmage@5473 2365
jackalmage@5544 2366 <p> Otherwise, <a href="#consume-an-escaped-character0"><i>consume an
jackalmage@5544 2367 escaped character</i></a>. Append the returned character to the url
jackalmage@5547 2368 token's value. Remain in this state.
jackalmage@5473 2369
jackalmage@5473 2370 <dt>anything else
jackalmage@5473 2371
jackalmage@5473 2372 <dd> Append the <a href="#current-input-character"><i>current input
jackalmage@5473 2373 character</i></a> to the url token's value. Remain in this state.
jackalmage@5473 2374 </dl>
jackalmage@5473 2375
jackalmage@7224 2376 <h4 id=url-single-quote-state><span class=secno>4.4.19. </span> <dfn
jackalmage@5473 2377 id=url-single-quote-state0>URL-single-quote state</dfn></h4>
jackalmage@5473 2378
jackalmage@5473 2379 <p> If a url token has not yet been created since entering this state,
jackalmage@5473 2380 create a url token with its value initially set to the empty string.
jackalmage@5473 2381
jackalmage@5473 2382 <p> Consume the <a href="#next-input-character"><i>next input
jackalmage@5473 2383 character</i></a>.
jackalmage@5473 2384
jackalmage@5473 2385 <dl>
jackalmage@7135 2386 <dt>EOF
jackalmage@7135 2387
jackalmage@7135 2388 <dd> This is a <i>parse error</i>. Emit a bad-url token. Switch to the <a
jackalmage@7135 2389 href="#data-state0"><i>data state</i></a>.
jackalmage@7135 2390
jackalmage@5547 2391 <dt>U+0027 APOSTROPHE (&apos;)
jackalmage@5473 2392
jackalmage@5473 2393 <dd> Switch to the <a href="#url-end-state0"><i>url-end state</i></a>.
jackalmage@5473 2394
jackalmage@5494 2395 <dt><a href="#newline"><i>newline</i></a>
jackalmage@5494 2396
jackalmage@5986 2397 <dd> This is a <i>parse error</i>. Switch to the <a
jackalmage@5986 2398 href="#bad-url-state0"><i>bad-url state</i></a>.
jackalmage@5494 2399
jackalmage@5473 2400 <dt>U+005C REVERSE SOLIDUS (\)
jackalmage@5473 2401
jackalmage@5473 2402 <dd> If the <a href="#next-input-character"><i>next input
jackalmage@5473 2403 character</i></a> is EOF, this is a <i>parse error</i>. Emit a bad-url
jackalmage@5473 2404 token. Switch to the <a href="#data-state0"><i>data state</i></a>.
jackalmage@5473 2405 Reconsume the <a href="#current-input-character"><i>current input
jackalmage@5473 2406 character</i></a>.
jackalmage@5473 2407 <p> Otherwise, if the <a href="#next-input-character"><i>next input
jackalmage@5473 2408 character</i></a> is a <a href="#newline"><i>newline</i></a>, consume it
jackalmage@5473 2409 and remain in this state.
jackalmage@5473 2410
jackalmage@5544 2411 <p> Otherwise, <a href="#consume-an-escaped-character0"><i>consume an
jackalmage@5544 2412 escaped character</i></a>. Append the returned character to the url
jackalmage@5547 2413 token's value. Remain in this state.
jackalmage@5473 2414
jackalmage@5473 2415 <dt>anything else
jackalmage@5473 2416
jackalmage@5473 2417 <dd> Append the <a href="#current-input-character"><i>current input
jackalmage@5473 2418 character</i></a> to the url token's value. Remain in this state.
jackalmage@5473 2419 </dl>
jackalmage@5473 2420
jackalmage@7224 2421 <h4 id=url-end-state><span class=secno>4.4.20. </span> <dfn
jackalmage@5473 2422 id=url-end-state0>URL-end state</dfn></h4>
jackalmage@5473 2423
jackalmage@5473 2424 <p> Consume the <a href="#next-input-character"><i>next input
jackalmage@5473 2425 character</i></a>.
jackalmage@5473 2426
jackalmage@5473 2427 <dl>
jackalmage@7135 2428 <dt>EOF
jackalmage@7135 2429
jackalmage@7135 2430 <dd> This is a <i>parse error</i>. Emit a bad-url token. Switch to the <a
jackalmage@7135 2431 href="#data-state0"><i>data state</i></a>.
jackalmage@7135 2432
jackalmage@5473 2433 <dt><a href="#whitespace"><i>whitespace</i></a>
jackalmage@5473 2434
jackalmage@5473 2435 <dd> Remain in this state.
jackalmage@5473 2436
jackalmage@5473 2437 <dt>U+0029 RIGHT PARENTHESIS ())
jackalmage@5473 2438
jackalmage@5473 2439 <dd> Emit the url token. Switch to the <a href="#data-state0"><i>data
jackalmage@5473 2440 state</i></a>.
jackalmage@5473 2441
jackalmage@5473 2442 <dt>anything else
jackalmage@5473 2443
jackalmage@5986 2444 <dd> This is a <i>parse error</i>. Switch to the <a
jackalmage@6012 2445 href="#bad-url-state0"><i>bad-url state</i></a>. Reconsume the <a
jackalmage@6012 2446 href="#current-input-character"><i>current input character</i></a>.
jackalmage@5473 2447 </dl>
jackalmage@5473 2448
jackalmage@7224 2449 <h4 id=url-unquoted-state><span class=secno>4.4.21. </span> <dfn
jackalmage@5473 2450 id=url-unquoted-state0>URL-unquoted state</dfn></h4>
jackalmage@5473 2451
jackalmage@5473 2452 <p> If a url token has not yet been created since entering this state,
jackalmage@5473 2453 create a url token with its value initially set to the empty string.
jackalmage@5473 2454
jackalmage@5473 2455 <p> Consume the <a href="#next-input-character"><i>next input
jackalmage@5473 2456 character</i></a>.
jackalmage@5473 2457
jackalmage@5473 2458 <dl>
jackalmage@7133 2459 <dt>EOF
jackalmage@7133 2460
jackalmage@7135 2461 <dd> This is a <i>parse error</i>. Emit a bad-url token. Switch to the <a
jackalmage@7135 2462 href="#data-state0"><i>data state</i></a>.
jackalmage@7133 2463
jackalmage@5473 2464 <dt><a href="#whitespace"><i>whitespace</i></a>
jackalmage@5473 2465
jackalmage@5473 2466 <dd> Switch to the <a href="#url-end-state0"><i>url-end state</i></a>.
jackalmage@5473 2467
jackalmage@5473 2468 <dt>U+0029 RIGHT PARENTHESIS ())
jackalmage@5473 2469
jackalmage@5473 2470 <dd> Emit the url token. Switch to the <a href="#data-state0"><i>data
jackalmage@5473 2471 state</i></a>.
jackalmage@5473 2472
jackalmage@5473 2473 <dt>U+0022 QUOTATION MARK (")
jackalmage@5473 2474
jackalmage@5547 2475 <dt>U+0027 APOSTROPHE (&apos;)
jackalmage@5473 2476
jackalmage@5473 2477 <dt>U+0028 LEFT PARENTHESIS (()
jackalmage@5473 2478
jackalmage@7171 2479 <dt><a href="#non-printable-character"><i>non-printable character</i></a>
jackalmage@5473 2480
jackalmage@5986 2481 <dd> This is a <i>parse error</i>. Switch to the <a
jackalmage@5986 2482 href="#bad-url-state0"><i>bad-url state</i></a>.
jackalmage@5473 2483
jackalmage@5473 2484 <dt>U+005C REVERSE SOLIDUS
jackalmage@5473 2485
jackalmage@5473 2486 <dd> If the <a href="#next-input-character"><i>next input
jackalmage@5473 2487 character</i></a> is a <a href="#newline"><i>newline</i></a> or EOF, this
jackalmage@6011 2488 is a <i>parse error</i>. Switch to the <a
jackalmage@6011 2489 href="#bad-url-state0"><i>bad-url state</i></a>.
jackalmage@5473 2490 <p> Otherwise, <a href="#consume-an-escaped-character0"><i>consume an
jackalmage@5473 2491 escaped character</i></a>. Append the returned character to the url
jackalmage@5547 2492 token's value. Remain in this state.
jackalmage@5473 2493
jackalmage@5473 2494 <dt>anything else
jackalmage@5473 2495
jackalmage@5473 2496 <dd> Append the <a href="#current-input-character"><i>current input
jackalmage@5473 2497 character</i></a> to the url token's value. Remain in this state.
jackalmage@5473 2498 </dl>
jackalmage@5473 2499
jackalmage@7224 2500 <h4 id=bad-url-state><span class=secno>4.4.22. </span> <dfn
jackalmage@5986 2501 id=bad-url-state0>Bad-URL state</dfn></h4>
jackalmage@5986 2502
jackalmage@5986 2503 <p> Consume the <a href="#next-input-character"><i>next input
jackalmage@5986 2504 character</i></a>.
jackalmage@5986 2505
jackalmage@5986 2506 <dl>
jackalmage@7135 2507 <dt>EOF
jackalmage@7135 2508
jackalmage@7135 2509 <dd> This is a <i>parse error</i>. Emit a bad-url token. Switch to the <a
jackalmage@7135 2510 href="#data-state0"><i>data state</i></a>.
jackalmage@7135 2511
jackalmage@5986 2512 <dt>U+0029 RIGHT PARENTHESIS ())
jackalmage@5986 2513
jackalmage@5986 2514 <dd> Emit a bad-url token. Switch to the <a href="#data-state0"><i>data
jackalmage@5986 2515 state</i></a>.
jackalmage@5986 2516
jackalmage@5986 2517 <dt>U+005C REVERSE SOLIDUS
jackalmage@5986 2518
jackalmage@5986 2519 <dd> If the <a href="#next-input-character"><i>next input
jackalmage@5986 2520 character</i></a> is a <a href="#newline"><i>newline</i></a> or EOF, do
jackalmage@5986 2521 nothing and remain in this state.
jackalmage@5986 2522 <p> Otherwise, <a href="#consume-an-escaped-character0"><i>consume an
jackalmage@5986 2523 escaped character</i></a>. Remain in this state.
jackalmage@5986 2524
jackalmage@5986 2525 <dt>anything else
jackalmage@5986 2526
jackalmage@5986 2527 <dd> Do nothing. Remain in this state.
jackalmage@5986 2528 </dl>
jackalmage@5986 2529
jackalmage@7224 2530 <h4 id=unicode-range-state><span class=secno>4.4.23. </span> <dfn
jackalmage@5473 2531 id=unicode-range-state0>Unicode-range state</dfn></h4>
jackalmage@5473 2532
jackalmage@5473 2533 <p> Create a new unicode-range token with an empty range.
jackalmage@5473 2534
jackalmage@5473 2535 <p> Consume as many <a href="#hex-digit"><i>hex digits</i></a> as possible,
jackalmage@5898 2536 but no more than 6. If less than 6 <a href="#hex-digit"><i>hex
jackalmage@5898 2537 digits</i></a> were consumed, consume as many U+003F QUESTION MARK (?)
jackalmage@6033 2538 characters as possible, but no more than enough to make the total of <a
jackalmage@5898 2539 href="#hex-digit"><i>hex digits</i></a> and U+003F QUESTION MARK (?)
jackalmage@5898 2540 characters equal to 6.
jackalmage@5473 2541
jackalmage@5473 2542 <p> If any U+003F QUESTION MARK (?) characters were consumed, first
jackalmage@5473 2543 interpret the consumed characters as a hexadecimal number, with the U+003F
jackalmage@5473 2544 QUESTION MARK (?) characters replaced by U+0030 DIGIT ZERO (0) characters.
jackalmage@5473 2545 This is the <a href="#start-of-the-range"><i>start of the range</i></a>.
jackalmage@5473 2546 Then interpret the consumed characters as a hexadecimal number again, with
jackalmage@5473 2547 the U+003F QUESTION MARK (?) character replaced by U+0046 LATIN CAPITAL
jackalmage@5473 2548 LETTER F (F) characters. This is the <a href="#end-of-the-range"><i>end of
jackalmage@5473 2549 the range</i></a>. <a href="#set-the-unicode-range-tokens-range0"><i>Set
jackalmage@5473 2550 the unicode-range token's range</i></a>, then emit it. Switch to the <a
jackalmage@5473 2551 href="#data-state0"><i>data state</i></a>.
jackalmage@5473 2552
jackalmage@5473 2553 <p> Otherwise, interpret the digits as a hexadecimal number. This is the <a
jackalmage@5473 2554 href="#start-of-the-range"><i>start of the range</i></a>.
jackalmage@5473 2555
jackalmage@5473 2556 <p> Consume the <a href="#next-input-character"><i>next input
jackalmage@5473 2557 character</i></a>.
jackalmage@5473 2558
jackalmage@5473 2559 <dl>
jackalmage@5473 2560 <dt>U+002D HYPHEN-MINUS (-)
jackalmage@5473 2561
jackalmage@5473 2562 <dd> If the <a href="#next-input-character"><i>next input
jackalmage@5473 2563 character</i></a> is a <a href="#hex-digit"><i>hex digit</i></a>, consume
jackalmage@5473 2564 as many <a href="#hex-digit"><i>hex digits</i></a> as possible, but no
jackalmage@5473 2565 more than 6. Interpret the digits as a hexadecimal number. This is the <a
jackalmage@5473 2566 href="#end-of-the-range"><i>end of the range</i></a>. <a
jackalmage@5473 2567 href="#set-the-unicode-range-tokens-range0"><i>Set the unicode-range
jackalmage@5473 2568 token's range</i></a>, then emit it. Switch to the <a
jackalmage@5473 2569 href="#data-state0"><i>data state</i></a>.
jackalmage@5473 2570 <p> Otherwise, <a href="#set-the-unicode-range-tokens-range0"><i>set the
jackalmage@5473 2571 unicode-range token's range</i></a> and emit it. Switch to the <a
jackalmage@5473 2572 href="#data-state0"><i>data state</i></a>. Reconsume the <a
jackalmage@5473 2573 href="#current-input-character"><i>current input character</i></a>.
jackalmage@5473 2574
jackalmage@5473 2575 <dt>anything else
jackalmage@5473 2576
jackalmage@5473 2577 <dd> <a href="#set-the-unicode-range-tokens-range0"><i>Set the
jackalmage@5473 2578 unicode-range token's range</i></a> and emit it. Switch to the <a
jackalmage@5473 2579 href="#data-state0"><i>data state</i></a>. Reconsume the <a
jackalmage@5473 2580 href="#current-input-character"><i>current input character</i></a>.
jackalmage@5473 2581 </dl>
jackalmage@5473 2582
jackalmage@7224 2583 <h3 id=consume-an-escaped-character><span class=secno>4.5. </span> <dfn
jackalmage@7224 2584 id=consume-an-escaped-character0>Consume an escaped character</dfn></h3>
jackalmage@5473 2585
jackalmage@5473 2586 <p> This section describes how to <a
jackalmage@5473 2587 href="#consume-an-escaped-character0"><i>consume an escaped
jackalmage@5473 2588 character</i></a>. It assumes that the U+005C REVERSE SOLIDUS (\) has
jackalmage@5473 2589 already been consumed and that the next input character has already been
jackalmage@5473 2590 verified to not be a <a href="#newline"><i>newline</i></a> or EOF. It will
jackalmage@5473 2591 return a character.
jackalmage@5473 2592
jackalmage@5473 2593 <p> Consume the <a href="#next-input-character"><i>next input
jackalmage@5473 2594 character</i></a>.
jackalmage@5473 2595
jackalmage@5473 2596 <dl>
jackalmage@5473 2597 <dt><a href="#hex-digit"><i>hex digit</i></a>
jackalmage@5473 2598
jackalmage@5473 2599 <dd> Consume as many <a href="#hex-digit"><i>hex digits</i></a> as
jackalmage@5473 2600 possible, but no more than 5. <span class=note>Note that this means 1-6
jackalmage@5473 2601 hex digits have been consumed in total.</span> If the <a
jackalmage@5473 2602 href="#next-input-character"><i>next input character</i></a> is <a
jackalmage@5473 2603 href="#whitespace"><i>whitespace</i></a>, consume it as well. Interpret
jackalmage@5473 2604 the <a href="#hex-digit"><i>hex digits</i></a> as a hexadecimal number.
jackalmage@6924 2605 If this number is zero, or is greater than the <a
jackalmage@5548 2606 href="#maximum-allowed-codepoint"><i>maximum allowed codepoint</i></a>,
jackalmage@6924 2607 return U+FFFD REPLACEMENT CHARACTER (�). Otherwise, return the
jackalmage@6924 2608 character with that codepoint.
jackalmage@5473 2609
jackalmage@5473 2610 <dt>anything else
jackalmage@5473 2611
jackalmage@5473 2612 <dd> Return the <a href="#current-input-character"><i>current input
jackalmage@5473 2613 character</i></a>.
jackalmage@5473 2614 </dl>
jackalmage@5473 2615
jackalmage@7224 2616 <h3 id=set-the-unicode-range-tokens-range><span class=secno>4.6. </span>
jackalmage@5473 2617 <dfn id=set-the-unicode-range-tokens-range0>Set the unicode-range token's
jackalmage@7224 2618 range</dfn></h3>
jackalmage@5473 2619
jackalmage@5473 2620 <p> This section describes how to set a unicode-range token's range so that
jackalmage@5473 2621 the range it describes is within the supported range of unicode
jackalmage@5473 2622 characters.
jackalmage@5473 2623
jackalmage@5473 2624 <p> It assumes that the <dfn id=start-of-the-range>start of the range</dfn>
jackalmage@5473 2625 has been defined, the <dfn id=end-of-the-range>end of the range</dfn>
jackalmage@5473 2626 might be defined, and both are non-negative integers.
jackalmage@5473 2627
jackalmage@5473 2628 <p> If the <a href="#start-of-the-range"><i>start of the range</i></a> is
jackalmage@5548 2629 greater than the <a href="#maximum-allowed-codepoint"><i>maximum allowed
jackalmage@5548 2630 codepoint</i></a>, the unicode-range token's range is empty.
jackalmage@5473 2631
jackalmage@5473 2632 <p> If the <a href="#end-of-the-range"><i>end of the range</i></a> is
jackalmage@5473 2633 defined, and it is less than the <a href="#start-of-the-range"><i>start of
jackalmage@5473 2634 the range</i></a>, the unicode-range token's range is empty.
jackalmage@5473 2635
jackalmage@5473 2636 <p> If the <a href="#end-of-the-range"><i>end of the range</i></a> is not
jackalmage@5473 2637 defined, the unicode-range token's range is the single character whose
jackalmage@5473 2638 codepoint is the <a href="#start-of-the-range"><i>start of the
jackalmage@5473 2639 range</i></a>.
jackalmage@5473 2640
jackalmage@5473 2641 <p> Otherwise, if the <a href="#end-of-the-range"><i>end of the
jackalmage@5548 2642 range</i></a> is greater than the <a
jackalmage@5548 2643 href="#maximum-allowed-codepoint"><i>maximum allowed codepoint</i></a>,
jackalmage@5548 2644 change it to the <a href="#maximum-allowed-codepoint"><i>maximum allowed
jackalmage@5548 2645 codepoint</i></a>. The unicode-range token's range is all characters
jackalmage@5548 2646 between the character whose codepoint is the <a
jackalmage@5548 2647 href="#start-of-the-range"><i>start of the range</i></a> and the character
jackalmage@5548 2648 whose codepoint is the <a href="#end-of-the-range"><i>end of the
jackalmage@6008 2649 range</i></a>.
jackalmage@6008 2650
jackalmage@7224 2651 <h3 id=changes-from-css-2.1-tokenizer><span class=secno>4.7. </span>
jackalmage@6008 2652 Changes from CSS 2.1 Tokenizer</h3>
jackalmage@6008 2653
jackalmage@6008 2654 <p> <em>This section is non-normative.</em>
jackalmage@6008 2655
jackalmage@7447 2656 <p class=issue> Note that the point of this spec is to match reality;
jackalmage@7447 2657 changes from CSS2.1&apos;s tokenizer are nearly always because the
jackalmage@7447 2658 tokenizer specified something that doesn't match actual browser behavior,
jackalmage@7447 2659 or left something unspecified. If some detail doesn't match browsers,
jackalmage@7447 2660 please let me know as it's almost certainly unintentional.
jackalmage@6008 2661
jackalmage@6008 2662 <ol>
jackalmage@7446 2663 <li> The prefix-match, suffix-match, and substring-match tokens have been
jackalmage@7446 2664 imported from Selectors 3.
jackalmage@6008 2665
jackalmage@6008 2666 <li> The BAD-URI token (now bad-url) is "self-contained". In other words,
jackalmage@6008 2667 once the tokenizer realizes it's in a bad-url rather than a url token, it
jackalmage@6008 2668 just seeks forward to look for the closing ), ignoring everything else.
jackalmage@6008 2669 This behavior is simpler than treating it like a FUNCTION token and
jackalmage@6008 2670 paying attention to opened blocks and such. Only WebKit exhibits this
jackalmage@6008 2671 behavior, but it doesn't appear that we've gotten any compat bugs from
jackalmage@6008 2672 it.
jackalmage@6013 2673
jackalmage@7445 2674 <li> The comma token has been added.
jackalmage@7445 2675
jackalmage@6013 2676 <li> The number, percentage, and dimension tokens have been changed to
jackalmage@6013 2677 include the preceding +/- sign as part of their value (rather than as a
jackalmage@6013 2678 separate DELIM token that needs to be manually handled every time the
jackalmage@6013 2679 token is mentioned in other specs). The only consequence of this is that
jackalmage@6013 2680 comments can no longer be inserted between the sign and the number.
jackalmage@6013 2681
jackalmage@6563 2682 <li> Some flags have been added for SVG-compatible tokenizing, so that a
jackalmage@6563 2683 single state machine can be used for both "vanilla" and SVG CSS parsing.
jackalmage@6563 2684
jackalmage@6563 2685 <li> Scientific notation is supported for numbers, per WG resolution.
jackalmage@6008 2686 </ol>
jackalmage@6008 2687 <!--
jackalmage@7438 2688 PPPPPPPPPPPPPPPPP AAA RRRRRRRRRRRRRRRRR SSSSSSSSSSSSSSS EEEEEEEEEEEEEEEEEEEEEERRRRRRRRRRRRRRRRR
jackalmage@7438 2689 P::::::::::::::::P A:::A R::::::::::::::::R SS:::::::::::::::SE::::::::::::::::::::ER::::::::::::::::R
jackalmage@7438 2690 P::::::PPPPPP:::::P A:::::A R::::::RRRRRR:::::R S:::::SSSSSS::::::SE::::::::::::::::::::ER::::::RRRRRR:::::R
jackalmage@5486 2691 PP:::::P P:::::P A:::::::A RR:::::R R:::::RS:::::S SSSSSSSEE::::::EEEEEEEEE::::ERR:::::R R:::::R
jackalmage@5486 2692 P::::P P:::::P A:::::::::A R::::R R:::::RS:::::S E:::::E EEEEEE R::::R R:::::R
jackalmage@5486 2693 P::::P P:::::PA:::::A:::::A R::::R R:::::RS:::::S E:::::E R::::R R:::::R
jackalmage@7438 2694 P::::PPPPPP:::::PA:::::A A:::::A R::::RRRRRR:::::R S::::SSSS E::::::EEEEEEEEEE R::::RRRRRR:::::R
jackalmage@7438 2695 P:::::::::::::PPA:::::A A:::::A R:::::::::::::RR SS::::::SSSSS E:::::::::::::::E R:::::::::::::RR
jackalmage@7438 2696 P::::PPPPPPPPP A:::::A A:::::A R::::RRRRRR:::::R SSS::::::::SS E:::::::::::::::E R::::RRRRRR:::::R
jackalmage@5486 2697 P::::P A:::::AAAAAAAAA:::::A R::::R R:::::R SSSSSS::::S E::::::EEEEEEEEEE R::::R R:::::R
jackalmage@5486 2698 P::::P A:::::::::::::::::::::A R::::R R:::::R S:::::S E:::::E R::::R R:::::R
jackalmage@5486 2699 P::::P A:::::AAAAAAAAAAAAA:::::A R::::R R:::::R S:::::S E:::::E EEEEEE R::::R R:::::R
jackalmage@5486 2700 PP::::::PP A:::::A A:::::A RR:::::R R:::::RSSSSSSS S:::::SEE::::::EEEEEEEE:::::ERR:::::R R:::::R
jackalmage@5486 2701 P::::::::P A:::::A A:::::A R::::::R R:::::RS::::::SSSSSS:::::SE::::::::::::::::::::ER::::::R R:::::R
jackalmage@5486 2702 P::::::::P A:::::A A:::::A R::::::R R:::::RS:::::::::::::::SS E::::::::::::::::::::ER::::::R R:::::R
jackalmage@5486 2703 PPPPPPPPPPAAAAAAA AAAAAAARRRRRRRR RRRRRRR SSSSSSSSSSSSSSS EEEEEEEEEEEEEEEEEEEEEERRRRRRRR RRRRRRR
jackalmage@5486 2704 -->
jackalmage@6008 2705
jackalmage@7224 2706 <h2 id=parsing><span class=secno>5. </span> Parsing</h2>
jackalmage@5486 2707
jackalmage@7444 2708 <p> The input to the parsing stage is a stream or list of tokens from the
jackalmage@7444 2709 tokenization stage. The output depends on how the parser is invoked, as
jackalmage@7444 2710 defined by the entry points listed later in this section. The parser
jackalmage@7444 2711 output can consist of at-rules, qualified rules, and/or declarations.
jackalmage@7444 2712
jackalmage@7444 2713 <p> The parser's output is constructed according to the fundamental syntax
jackalmage@7444 2714 of CSS, without regards for the validity of any specific item.
jackalmage@7444 2715 Implementations may check the validity of items as they are returned by
jackalmage@7444 2716 the various parser algorithms and treat the algorithm as returning nothing
jackalmage@7444 2717 if the item was invalid according to the implementation's own grammar
jackalmage@7444 2718 knowledge, or may construct a full tree as specified and "clean up"
jackalmage@7444 2719 afterwards by removing any invalid items.
jackalmage@6022 2720
jackalmage@6022 2721 <p> The items that can appear in the tree are a mixture of basic tokens and
jackalmage@6022 2722 new objects:
jackalmage@6022 2723
jackalmage@6022 2724 <dl>
jackalmage@7233 2725 <dt><dfn id=at-rule>at-rule</dfn>
jackalmage@6022 2726
jackalmage@7264 2727 <dd> An at-rule has a name, a prelude consisting of a list of component
jackalmage@7264 2728 values, and a value consisting of a list of at-rules, style rules, or
jackalmage@6030 2729 declarations.
jackalmage@6022 2730
jackalmage@7444 2731 <dt><dfn id=qualified-rule>qualified rule</dfn>
jackalmage@7444 2732
jackalmage@7444 2733 <dd> A qualified rule has a prelude consisting of a list of component
jackalmage@7444 2734 values, and a value consisting of a list of at-rules or declarations.
jackalmage@6030 2735
jackalmage@7233 2736 <dt><dfn id=declaration>declaration</dfn>
jackalmage@6030 2737
jackalmage@7264 2738 <dd> A declaration has a name, a value consisting of a list of component
jackalmage@7264 2739 values, and an <var>important</var> flag which is initially unset.
jackalmage@7264 2740
jackalmage@7264 2741 <dt><dfn id=component-value>component value</dfn>
jackalmage@7264 2742
jackalmage@7264 2743 <dd> A component value is one of the preserved tokens, a function, or a
jackalmage@7264 2744 simple block.
jackalmage@6022 2745
jackalmage@7233 2746 <dt><dfn id=preserved-tokens>preserved tokens</dfn>
jackalmage@6022 2747
jackalmage@7444 2748 <dd> Any token produced by the tokenizer except for function tokens, {
jackalmage@7444 2749 tokens, ( tokens, and [ tokens.
jackalmage@7444 2750 <p class=note> The non-preserved tokens listed above are always consumed
jackalmage@7444 2751 into higher-level objects, either functions or simple blocks, and so
jackalmage@7444 2752 never appear in any parser output themselves.
jackalmage@7238 2753
jackalmage@7233 2754 <dt><dfn id=function>function</dfn>
jackalmage@6022 2755
jackalmage@7444 2756 <dd> A function has a name and a list of arguments. Each argument is a
jackalmage@7264 2757 list of component values.
jackalmage@6022 2758
jackalmage@7233 2759 <dt><dfn id=simple-block>simple block</dfn>
jackalmage@6022 2760
jackalmage@6029 2761 <dd> A simple block has an associated token (either a [, (, or { token)
jackalmage@7264 2762 and a value consisting of a list of component values.
jackalmage@7444 2763
jackalmage@7444 2764 <dt><dfn id=recognized-at-rule-name>recognized at-rule name</dfn>
jackalmage@7444 2765
jackalmage@7444 2766 <dd> When the parser is invoked, it must be provided with a list of <a
jackalmage@7444 2767 href="#recognized-at-rule-name"><i>recognized at-rule names</i></a>,
jackalmage@7444 2768 where each name is additionally associated with whether the <a
jackalmage@7444 2769 href="#at-rule"><i>at-rule</i></a> is <a
jackalmage@7444 2770 href="#rule-filled"><i>rule-filled</i></a>, <a
jackalmage@7444 2771 href="#declaration-filled"><i>declaration-filled</i></a>, or neither.
jackalmage@6022 2772 </dl>
jackalmage@5498 2773
jackalmage@7224 2774 <h3 id=parser-flags><span class=secno>5.1. </span> Parser Flags</h3>
jackalmage@7205 2775
jackalmage@7205 2776 <dl>
jackalmage@7205 2777 <dt>the <dfn id=quirks-mode>quirks mode</dfn> flag
jackalmage@7205 2778
jackalmage@7205 2779 <dd> This flag is set when the host document is in quirks mode. When this
jackalmage@7205 2780 is set, the parser allows <a
jackalmage@7264 2781 href="#consume-a-component value-with-the-hashless-co">hash colors
jackalmage@7264 2782 without the # character</a> and <a
jackalmage@7264 2783 href="#consume-a-component value-with-the-unitless-le">pixel lengths
jackalmage@7264 2784 without the ‘<code class=property>px</code>’ unit</a> in some
jackalmage@7264 2785 circumstances.
jackalmage@7205 2786 </dl>
jackalmage@7205 2787
jackalmage@7224 2788 <h3 id=definitions0><span class=secno>5.2. </span> Definitions</h3>
jackalmage@5498 2789
jackalmage@5498 2790 <dl>
jackalmage@6014 2791 <dt><dfn id=current-input-token>current input token</dfn>
jackalmage@6014 2792
jackalmage@6015 2793 <dd> The token currently being operated on, from the list of tokens
jackalmage@6015 2794 produced by the tokenizer.
jackalmage@6014 2795
jackalmage@5964 2796 <dt><dfn id=next-input-token>next input token</dfn>
jackalmage@5498 2797
jackalmage@6015 2798 <dd> The token following the <a href="#current-input-token"><i>current
jackalmage@6021 2799 input token</i></a> in the list of tokens produced by the tokenizer. If
jackalmage@6021 2800 there isn't a token following the <a
jackalmage@6021 2801 href="#current-input-token"><i>current input token</i></a>, the <a
jackalmage@6021 2802 href="#next-input-token"><i>next input token</i></a> is an EOF token.
jackalmage@5498 2803
jackalmage@6678 2804 <dt><dfn id=reconsume-the-current-input-token>reconsume the current input
jackalmage@6678 2805 token</dfn>
jackalmage@6678 2806
jackalmage@6678 2807 <dd> Push the current input token back onto the list of tokens produced by
jackalmage@6678 2808 the tokenizer, so that the next time a mode instructs you to consume the
jackalmage@6678 2809 next input token, it will instead reconsume the current input token.
jackalmage@6678 2810
jackalmage@6016 2811 <dt><dfn id=rule-filled>rule-filled</dfn>
jackalmage@6016 2812
jackalmage@7239 2813 <dd> An at-rule is <a href="#rule-filled"><i>rule-filled</i></a> if it is
jackalmage@7239 2814 in the list of <i>recognized at-rules</i> and marked as such. This type
jackalmage@7239 2815 of <a href="#at-rule"><i>at-rule</i></a> may have a prelude, and finishes
jackalmage@7444 2816 with a <a href="#simple-block"><i>simple block</i></a> which contains <a
jackalmage@7444 2817 href="#at-rule"><i>at-rules</i></a> and/or <a
jackalmage@7444 2818 href="#qualified-rule"><i>qualified rules</i></a>. Examples of <a
jackalmage@7239 2819 href="#rule-filled"><i>rule-filled</i></a> at-rules are ‘<code
jackalmage@7239 2820 class=css>@media</code>’ and ‘<code class=css>@keyframes</code>’.
jackalmage@6016 2821
jackalmage@6016 2822 <dt><dfn id=declaration-filled>declaration-filled</dfn>
jackalmage@6016 2823
jackalmage@7239 2824 <dd> An at-rule is <a
jackalmage@7239 2825 href="#declaration-filled"><i>declaration-filled</i></a> if it is in the
jackalmage@7239 2826 list of <i>recognized at-rules</i> and marked as such. This type of <a
jackalmage@7239 2827 href="#at-rule"><i>at-rule</i></a> may have a prelude, and finishes with
jackalmage@7444 2828 a <a href="#simple-block"><i>simple block</i></a> which contains <a
jackalmage@7444 2829 href="#at-rule"><i>at-rules</i></a> and/or <a
jackalmage@7444 2830 href="#declaration"><i>declarations</i></a>. Examples of <a
jackalmage@6016 2831 href="#declaration-filled"><i>declaration-filled</i></a> at-rules are
jackalmage@6016 2832 ‘<code class=css>@font-face</code>’ and ‘<code
jackalmage@6016 2833 class=css>@page</code>’.
jackalmage@7128 2834
jackalmage@7128 2835 <dt><dfn id=ascii-case-insensitive>ASCII case-insensitive</dfn>
jackalmage@7128 2836
jackalmage@7128 2837 <dd> When two strings are to be matched ASCII case-insensitively,
jackalmage@7128 2838 temporarily convert both of them to ASCII lower-case form by adding 32
jackalmage@7128 2839 (0x20) to the value of each codepoint between U+0041 LATIN CAPITAL LETTER
jackalmage@7128 2840 A (A) and U+005A LATIN CAPITAL LETTER Z (Z), inclusive, and then compare
jackalmage@7128 2841 them on a codepoint-by-codepoint basis.
jackalmage@5498 2842 </dl>
jackalmage@5498 2843
jackalmage@7444 2844 <h3 id=parser-entry-points><span class=secno>5.3. </span> Parser Entry
jackalmage@7444 2845 Points</h3>
jackalmage@7444 2846
jackalmage@7444 2847 <p> The algorithms defined in this specification can be invoked in multiple
jackalmage@7444 2848 ways to convert a stream of text into various CSS concepts.
jackalmage@7444 2849
jackalmage@7444 2850 <p> All of the algorithms defined in this section begin in the parser. It
jackalmage@7444 2851 is assumed that the <a href="#preprocessing-the-input-stream">input
jackalmage@7444 2852 preprocessing</a> and <a href="#tokenization">tokenization</a> steps have
jackalmage@7444 2853 already been completed, resulting in a stream of tokens.
jackalmage@7444 2854
jackalmage@7444 2855 <div class=issue>
jackalmage@7444 2856 <p> The following notes should probably be translated into normative text
jackalmage@7444 2857 in the relevant specs, hooking this spec's terms:
jackalmage@7444 2858
jackalmage@7444 2859 <ul>
jackalmage@7444 2860 <li> "<a href="#parse-a-stylesheet0"><i>Parse a stylesheet</i></a>" is
jackalmage@7444 2861 intended to be the normal parser entry point, for parsing stylesheets.
jackalmage@7444 2862
jackalmage@7444 2863 <li> "<a href="#parse-a-rule0"><i>Parse a rule</i></a>" is intended for
jackalmage@7444 2864 use by the <code>CSSStyleSheet#insertRule</code> method, and similar
jackalmage@7444 2865 functions which might exist, which parse text into a single rule.
jackalmage@7444 2866
jackalmage@7444 2867 <li> "<a href="#parse-a-list-of-declarations0"><i>Parse a list of
jackalmage@7444 2868 declarations</i></a>" is for the contents of a <code>style</code>
jackalmage@7444 2869 attribute, which parses text into the contents of a single style rule.
jackalmage@7444 2870
jackalmage@7444 2871 <li> Dunno about "<i>Parse a value</i>" yet. I'll remove it if I don't
jackalmage@7444 2872 figure out what to do with it.
jackalmage@7444 2873
jackalmage@7444 2874 <li> "<i>Parse a list of values</i>" is for the contents of
jackalmage@7444 2875 presentational attributes, which parse text into a single declaration's
jackalmage@7444 2876 value.
jackalmage@7444 2877
jackalmage@7444 2878 <li> "<i>Parse a comma-separated list of values</i>" is similar, but for
jackalmage@7444 2879 comma-separated lists.
jackalmage@7444 2880 </ul>
jackalmage@7444 2881
jackalmage@7444 2882 <p> Are there any other things somewhere where some tech (that isn't
jackalmage@7444 2883 straight CSS itself) needs to parse some text into CSS?
jackalmage@7444 2884 </div>
jackalmage@7444 2885
jackalmage@7463 2886 <p> All of the algorithms defined in this spec may be called with either a
jackalmage@7463 2887 list of tokens or of component values. Either way produces an identical
jackalmage@7463 2888 result.
jackalmage@7463 2889
jackalmage@7444 2890 <h4 id=parse-a-stylesheet><span class=secno>5.3.1. </span> <dfn
jackalmage@7444 2891 id=parse-a-stylesheet0>Parse a stylesheet</dfn></h4>
jackalmage@7444 2892
jackalmage@7444 2893 <p> To <a href="#parse-a-stylesheet0"><i>parse a stylesheet</i></a> from a
jackalmage@7444 2894 stream of tokens:
jackalmage@7444 2895
jackalmage@7444 2896 <ol>
jackalmage@7444 2897 <li> Create a new stylesheet.
jackalmage@7444 2898
jackalmage@7444 2899 <li> <a href="#consume-a-list-of-rules0"><i>Consume a list of
jackalmage@7444 2900 rules</i></a> from the stream of tokens.
jackalmage@7444 2901
jackalmage@7444 2902 <li> Assign the returned value to the stylesheet's value.
jackalmage@7444 2903
jackalmage@7444 2904 <li> Return the stylesheet.
jackalmage@7444 2905 </ol>
jackalmage@7444 2906
jackalmage@7444 2907 <h4 id=parse-a-rule><span class=secno>5.3.2. </span> <dfn
jackalmage@7444 2908 id=parse-a-rule0>Parse a rule</dfn></h4>
jackalmage@7444 2909
jackalmage@7444 2910 <p> To <a href="#parse-a-rule0"><i>parse a rule</i></a> from a stream of
jackalmage@7444 2911 tokens:
jackalmage@7444 2912
jackalmage@7444 2913 <ol>
jackalmage@7444 2914 <li> Consume whitespace tokens from the token stream until a
jackalmage@7444 2915 non-whitespace token is encountered.
jackalmage@7444 2916
jackalmage@7444 2917 <li> If the <a href="#current-input-token"><i>current input token</i></a>
jackalmage@7444 2918 is a CDO token, CDC token, or EOF token, return a syntax error.
jackalmage@7444 2919 <p> Otherwise, if the <a href="#current-input-token"><i>current input
jackalmage@7444 2920 token</i></a> is an at-keyword token:
jackalmage@7444 2921
jackalmage@7444 2922 <ul>
jackalmage@7444 2923 <li> If the at-keyword token's name is on the list of <a
jackalmage@7444 2924 href="#recognized-at-rule-name"><i>recognized at-rule names</i></a>,
jackalmage@7444 2925 and the list indicates that it is a <a
jackalmage@7444 2926 href="#rule-filled"><i>rule-filled</i></a> or <a
jackalmage@7444 2927 href="#declaration-filled"><i>declaration-filled</i></a> at-rule, <a
jackalmage@7444 2928 href="#consume-an-at-rule0"><i>consume an at-rule</i></a>. If nothing
jackalmage@7444 2929 was returned, return a syntax error.
jackalmage@7444 2930
jackalmage@7444 2931 <li> Otherwise, <a href="#consume-an-at-statement0"><i>consume an
jackalmage@7444 2932 at-statement</i></a>. If nothing was returned, return a syntax error.
jackalmage@7444 2933 </ul>
jackalmage@7444 2934
jackalmage@7444 2935 <p> Otherwise, <a href="#consume-a-qualified-rule0"><i>consume a
jackalmage@7444 2936 qualified rule</i></a>. If nothing was returned, return a syntax error.
jackalmage@7444 2937
jackalmage@7444 2938 <li> Consume whitespace tokens from the token stream until a
jackalmage@7444 2939 non-whitespace token is encountered.
jackalmage@7444 2940
jackalmage@7444 2941 <li> If the <a href="#current-input-token"><i>current input token</i></a>
jackalmage@7444 2942 is an EOF token, return the rule obtained in step 2. Otherwise, return a
jackalmage@7444 2943 syntax error.
jackalmage@7444 2944 </ol>
jackalmage@7444 2945
jackalmage@7444 2946 <h4 id=parse-a-list-of-declarations><span class=secno>5.3.3. </span> <dfn
jackalmage@7444 2947 id=parse-a-list-of-declarations0>Parse a list of declarations</dfn></h4>
jackalmage@7444 2948
jackalmage@7444 2949 <p> To <a href="#parse-a-list-of-declarations0"><i>parse a list of
jackalmage@7444 2950 declarations</i></a>:
jackalmage@7444 2951
jackalmage@7444 2952 <ol>
jackalmage@7444 2953 <li> <a href="#consume-a-list-of-declarations0"><i>Consume a list of
jackalmage@7444 2954 declarations</i></a>. If anything was returned, return it.
jackalmage@7444 2955 </ol>
jackalmage@7444 2956
jackalmage@7444 2957 <h4 id=parse-a-component-value><span class=secno>5.3.4. </span> <dfn
jackalmage@7444 2958 id=parse-a-component-value0>Parse a component value</dfn></h4>
jackalmage@7444 2959
jackalmage@7444 2960 <p> To <a href="#parse-a-component-value0"><i>parse a component
jackalmage@7444 2961 value</i></a>:
jackalmage@7444 2962
jackalmage@7444 2963 <ol>
jackalmage@7444 2964 <li> Discard whitespace tokens from the token stream until a
jackalmage@7444 2965 non-whitespace token is reached. If the token stream is exhausted without
jackalmage@7444 2966 finding a non-whitespace token, return a syntax error.
jackalmage@7444 2967
jackalmage@7444 2968 <li> <a href="#consume-a-component-value0"><i>Consume a component
jackalmage@7444 2969 value</i></a>. If nothing is returned, return a syntax error.
jackalmage@7444 2970
jackalmage@7444 2971 <li> Discard whitespace tokens from the token stream until a
jackalmage@7444 2972 non-whitespace token is reached. If the token stream is exhausted without
jackalmage@7444 2973 finding a non-whitespace token, return the value found in the previous
jackalmage@7444 2974 step. Otherwise, return a syntax error.
jackalmage@7444 2975 </ol>
jackalmage@7444 2976
jackalmage@7444 2977 <h4 id=parse-a-list-of-component-values><span class=secno>5.3.5. </span>
jackalmage@7444 2978 <dfn id=parse-a-list-of-component-values0>Parse a list of component
jackalmage@7444 2979 values</dfn></h4>
jackalmage@7444 2980
jackalmage@7444 2981 <p> To <a href="#parse-a-list-of-component-values0"><i>parse a list of
jackalmage@7444 2982 component values</i></a>:
jackalmage@7444 2983
jackalmage@7444 2984 <ol>
jackalmage@7444 2985 <li> Repeatedly <a href="#consume-a-component-value0"><i>consume a
jackalmage@7444 2986 component value</i></a> until an EOF token is returned, appending the
jackalmage@7444 2987 returned values into a list. Return the list.
jackalmage@7444 2988 </ol>
jackalmage@7444 2989
jackalmage@7444 2990 <h4 id=parse-a-comma-separated-list-of-componen><span class=secno>5.3.6.
jackalmage@7444 2991 </span> <dfn id=parse-a-comma-separated-list-of-componen0>Parse a
jackalmage@7444 2992 comma-separated list of component values</dfn></h4>
jackalmage@7444 2993
jackalmage@7444 2994 <p> To <a href="#parse-a-comma-separated-list-of-componen0"><i>parse a
jackalmage@7444 2995 comma-separated list of component values</i></a>:
jackalmage@7444 2996
jackalmage@7444 2997 <ol>
jackalmage@7444 2998 <li> Initialize <var>val</var> to an empty list, and <var>temp</var> to an
jackalmage@7444 2999 empty list.
jackalmage@7444 3000
jackalmage@7444 3001 <li> Repeatedly <a href="#consume-a-component-value0"><i>consume a
jackalmage@7444 3002 component value</i></a>, appending the returned values to
jackalmage@7444 3003 <var>temp</var>, until either a comma token or EOF token is returned.
jackalmage@7444 3004
jackalmage@7444 3005 <li> If a comma token is encountered, do not append it to <var>temp</var>.
jackalmage@7444 3006 Instead, append <var>temp</var> to <var>val</var>. Create a new
jackalmage@7444 3007 <var>temp</var>, and return to step 2.
jackalmage@7444 3008
jackalmage@7444 3009 <li> If an EOF token is encountered, append <var>temp</var> to
jackalmage@7444 3010 <var>val</var>, and return <var>val</var>.
jackalmage@7444 3011 </ol>
jackalmage@7444 3012
jackalmage@7444 3013 <h4 id=parse-anb-notation><span class=secno>5.3.7. </span> <dfn
jackalmage@7444 3014 id=parse-anb-notation0>Parse an+b notation</dfn></h4>
jackalmage@7444 3015
jackalmage@7444 3016 <p> To <a href="#parse-anb-notation0"><i>parse an+b notation</i></a>:
jackalmage@7444 3017
jackalmage@7444 3018 <p> Initialize an integer called <var>step</var> to 0, an integer called
jackalmage@7444 3019 <var>offset</var> to 0, and a string called <var>repr</var> to the empty
jackalmage@7444 3020 string.
jackalmage@7444 3021
jackalmage@7444 3022 <p> Repeatedly consume the <a href="#next-input-token"><i>next input
jackalmage@7444 3023 token</i></a> and process it as follows:
jackalmage@7444 3024
jackalmage@7444 3025 <dl>
jackalmage@7444 3026 <dt>ident token
jackalmage@7444 3027
jackalmage@7444 3028 <dt>number token with its type flag set to "integer"
jackalmage@7444 3029
jackalmage@7444 3030 <dt>dimension token
jackalmage@7444 3031
jackalmage@7444 3032 <dd> Append the token's value, representation, or representation and unit,
jackalmage@7444 3033 respectively, to <var>repr</var>.
jackalmage@7444 3034
jackalmage@7444 3035 <dt>delim token with the value "+"
jackalmage@7444 3036
jackalmage@7444 3037 <dd> Append U+002B PLUS SIGN (+) to <var>repr</var>.
jackalmage@7444 3038
jackalmage@7444 3039 <dt>delim token with the value "-"
jackalmage@7444 3040
jackalmage@7444 3041 <dd> Append U+002D HYPHEN-MINUS (-) to <var>repr</var>.
jackalmage@7444 3042
jackalmage@7444 3043 <dt>whitespace token
jackalmage@7444 3044
jackalmage@7444 3045 <dd> Append U+0020 SPACE ( ) to <var>repr</var>.
jackalmage@7444 3046
jackalmage@7444 3047 <dt>EOF
jackalmage@7444 3048
jackalmage@7444 3049 <dd> Continue to the next step of the algorithm.
jackalmage@7444 3050
jackalmage@7444 3051 <dt>anything else
jackalmage@7444 3052
jackalmage@7444 3053 <dd> This is a <i>parse error</i>. Return a syntax error.
jackalmage@7444 3054 </dl>
jackalmage@7444 3055
jackalmage@7444 3056 <p> Trim U+0020 SPACE ( ) characters from the front and back of
jackalmage@7444 3057 <var>repr</var>, then process it as follows:
jackalmage@7444 3058
jackalmage@7444 3059 <ol>
jackalmage@7444 3060 <li> If <var>repr</var> is an <a href="#ascii-case-insensitive"><i>ASCII
jackalmage@7444 3061 case-insensitive</i></a> match for the string "odd", set <var>step</var>
jackalmage@7444 3062 to 2 and <var>offset</var> to 1.
jackalmage@7444 3063
jackalmage@7444 3064 <li> Otherwise, if <var>repr</var> is an <a
jackalmage@7444 3065 href="#ascii-case-insensitive"><i>ASCII case-insensitive</i></a> match
jackalmage@7444 3066 for the string "even", set <var>step</var> to 2 and <var>offset</var> to
jackalmage@7444 3067 0.
jackalmage@7444 3068
jackalmage@7444 3069 <li> Otherwise, if <var>repr</var> consists solely of <a
jackalmage@7444 3070 href="#digit"><i>digits</i></a>, optionally prefixed with a single U+002B
jackalmage@7444 3071 PLUS SIGN (+) or U+002D HYPHEN-MINUS (-), interpret <var>repr</var> as a
jackalmage@7444 3072 base-10 number, and set <var>step</var> to the result.
jackalmage@7444 3073
jackalmage@7444 3074 <li> Otherwise, if <var>repr</var> contains U+004E LATIN CAPITAL LETTER N
jackalmage@7444 3075 (N), or U+006E LATIN SMALL LETTER N (n), split <var>repr</var> into two
jackalmage@7444 3076 substrings composed respectively of the characters preceding and
jackalmage@7444 3077 following the first such letter.
jackalmage@7444 3078 <p> Interpret the first string as follows:
jackalmage@7444 3079
jackalmage@7444 3080 <ul>
jackalmage@7444 3081 <li> If the first string is empty, set <var>step</var> to 1.
jackalmage@7444 3082
jackalmage@7444 3083 <li> Otherwise, if the first string consists solely of a single U+002B
jackalmage@7444 3084 PLUS SIGN (+) or U+002D HYPHEN-MINUS (-), set <var>step</var> to 1 or
jackalmage@7444 3085 -1, respectively.
jackalmage@7444 3086
jackalmage@7444 3087 <li> Otherwise, if the first string consists solely of <a
jackalmage@7444 3088 href="#digit"><i>digits</i></a>, optionally prefixed with a single
jackalmage@7444 3089 U+002B PLUS SIGN (+) or U+002D HYPHEN-MINUS (-), interpret the first
jackalmage@7444 3090 string as a base-10 number, and set <var>step</var> to the result.
jackalmage@7444 3091
jackalmage@7444 3092 <li> Otherwise, this is a <i>parse error</i>; return a syntax error.
jackalmage@7444 3093 </ul>
jackalmage@7444 3094
jackalmage@7444 3095 <p> Interpret the second string as follows:
jackalmage@7444 3096
jackalmage@7444 3097 <ul>
jackalmage@7444 3098 <li> If the second string is empty, set <var>offset</var> to 0.
jackalmage@7444 3099
jackalmage@7444 3100 <li> Otherwise, if the second string consists solely of 0 or more U+0020
jackalmage@7444 3101 SPACE characters, optionally followed by a single U+002B PLUS SIGN (+)
jackalmage@7444 3102 or U+002D HYPHEN-MINUS (-) character, followed by 0 or more U+0020
jackalmage@7444 3103 SPACE characters, followed by 1 or more <a
jackalmage@7444 3104 href="#digit"><i>digits</i></a>, interpret the digits as a base-10
jackalmage@7444 3105 number. If there was a U+002D HYPHEN-MINUS (-) character, negate the
jackalmage@7444 3106 result. Set <var>offset</var> to the result.
jackalmage@7444 3107
jackalmage@7444 3108 <li> Otherwise, this is a <i>parse error</i>; return a syntax error.
jackalmage@7444 3109 </ul>
jackalmage@7444 3110
jackalmage@7444 3111 <li> Otherwise, this is a <i>parse error</i>; return a syntax error.
jackalmage@7444 3112 </ol>
jackalmage@7444 3113
jackalmage@7444 3114 <p> Return <var>step</var> and <var>offset</var>.
jackalmage@7444 3115
jackalmage@7444 3116 <h3 id=parser-algorithms><span class=secno>5.4. </span> Parser Algorithms</h3>
jackalmage@7444 3117
jackalmage@7462 3118 <p> The following algorithms comprise the parser. They are called by the
jackalmage@7462 3119 parser entry points above.
jackalmage@7462 3120
jackalmage@7462 3121 <p> These algorithms may be called with a list of either tokens or of
jackalmage@7462 3122 component values. (The difference being that some tokens are replaced by
jackalmage@7462 3123 <a href="#function"><i>functions</i></a> and <a
jackalmage@7462 3124 href="#simple-block"><i>simple blocks</i></a> in a list of component
jackalmage@7462 3125 values.) Similar to how the input stream returned EOF characters to
jackalmage@7462 3126 represent when it was empty during the tokenization stage, the lists in
jackalmage@7462 3127 this stage must return an EOF token when the next token is requested but
jackalmage@7462 3128 they are empty.
jackalmage@7462 3129
jackalmage@7462 3130 <p> An algorithm may be invoked with a specific list, in which case it
jackalmage@7462 3131 consumes only that list (and when that list is exhausted, it begins
jackalmage@7462 3132 returning EOF tokens). Otherwise, it is implicitly invoked with the same
jackalmage@7462 3133 list as the invoking algorithm.
jackalmage@7462 3134
jackalmage@7444 3135 <h4 id=consume-a-list-of-rules><span class=secno>5.4.1. </span> <dfn
jackalmage@7444 3136 id=consume-a-list-of-rules0>Consume a list of rules</dfn></h4>
jackalmage@7444 3137
jackalmage@7444 3138 <p> Create an initially empty list of rules.
jackalmage@7444 3139
jackalmage@7444 3140 <p> Repeatedly consume the <a href="#next-input-token"><i>next input
jackalmage@7444 3141 token</i></a>:
jackalmage@5498 3142
jackalmage@5498 3143 <dl>
jackalmage@5498 3144 <dt>cdo token
jackalmage@5498 3145
jackalmage@5498 3146 <dt>cdc token
jackalmage@5498 3147
jackalmage@5498 3148 <dt>whitespace token
jackalmage@5498 3149
jackalmage@7444 3150 <dd> Do nothing.
jackalmage@7444 3151
jackalmage@7444 3152 <dt>EOF token
jackalmage@7444 3153
jackalmage@7444 3154 <dd> Return the list of rules.
jackalmage@5498 3155
jackalmage@5498 3156 <dt>at-keyword token
jackalmage@5498 3157
jackalmage@7444 3158 <dd> <a href="#reconsume-the-current-input-token"><i>Reconsume the current
jackalmage@7444 3159 input token</i></a>. If the token's value is on the list of <a
jackalmage@7444 3160 href="#recognized-at-rule-name"><i>recognized at-rule names</i></a>, and
jackalmage@7444 3161 is noted as <a href="#rule-filled"><i>rule-filled</i></a> or <a
jackalmage@7444 3162 href="#declaration-filled"><i>declaration-filled</i></a>, <a
jackalmage@7444 3163 href="#consume-an-at-rule0"><i>consume an at-rule</i></a>; otherwise, <a
jackalmage@7444 3164 href="#consume-an-at-statement0"><i>consume an at-statement</i></a>. If
jackalmage@7444 3165 anything was returned, append it to the list of rules.
jackalmage@7444 3166
jackalmage@7444 3167 <dt>anything else
jackalmage@7444 3168
jackalmage@7444 3169 <dd> <a href="#reconsume-the-current-input-token"><i>Reconsume the current
jackalmage@7444 3170 input token</i></a>. <a href="#consume-a-qualified-rule0"><i>Consume a
jackalmage@7444 3171 qualified rule</i></a>. If anything is returned, append it to the list of
jackalmage@7444 3172 rules
jackalmage@7444 3173 </dl>
jackalmage@7444 3174
jackalmage@7444 3175 <h4 id=consume-an-at-rule><span class=secno>5.4.2. </span> <dfn
jackalmage@7444 3176 id=consume-an-at-rule0>Consume an at-rule</dfn></h4>
jackalmage@7444 3177
jackalmage@7444 3178 <p> Create a new at-rule with its name set to the value of the <a
jackalmage@7444 3179 href="#current-input-token"><i>current input token</i></a>, its prelude
jackalmage@7444 3180 initially set to an empty list, and its value initially set to nothing.
jackalmage@7444 3181
jackalmage@7444 3182 <p> Repeatedly consume the <a href="#next-input-token"><i>next input
jackalmage@7444 3183 token</i></a>:
jackalmage@7444 3184
jackalmage@7444 3185 <dl>
jackalmage@7444 3186 <dt>{ token
jackalmage@7444 3187
jackalmage@7444 3188 <dd> <a href="#consume-a-simple-block0"><i>Consume a simple block</i></a>.
jackalmage@7444 3189 If the at-rule is <a href="#rule-filled"><i>rule-filled</i></a>, <a
jackalmage@7444 3190 href="#consume-a-list-of-rules0"><i>consume a list of rules</i></a> from
jackalmage@7444 3191 the block's value; otherwise, <a
jackalmage@7444 3192 href="#consume-a-list-of-declarations0"><i>consume a list of
jackalmage@7444 3193 declarations</i></a> from the block's value. If anything was returned,
jackalmage@7444 3194 assign it to the at-rule's value. Return the at-rule.
jackalmage@5964 3195
jackalmage@7462 3196 <dt><a href="#simple-block"><i>simple block</i></a> with an associated
jackalmage@7462 3197 token of {
jackalmage@7462 3198
jackalmage@7462 3199 <dd> If the at-rule is <a href="#rule-filled"><i>rule-filled</i></a>, <a
jackalmage@7462 3200 href="#consume-a-list-of-rules0"><i>consume a list of rules</i></a> from
jackalmage@7462 3201 the block's value; otherwise, <a
jackalmage@7462 3202 href="#consume-a-list-of-declarations0"><i>consume a list of
jackalmage@7462 3203 declarations</i></a> from the block's value. If anything was returned,
jackalmage@7462 3204 assign it to the at-rule's value. Return the at-rule.
jackalmage@7462 3205
jackalmage@6239 3206 <dt>EOF token
jackalmage@6239 3207
jackalmage@7444 3208 <dd> This is a <i>parse error</i>. Return nothing.
jackalmage@6239 3209
jackalmage@5498 3210 <dt>anything else
jackalmage@5498 3211
jackalmage@7444 3212 <dd> <a href="#consume-a-component-value0"><i>Consume a component
jackalmage@7444 3213 value</i></a>. Append the returned value to the at-rule's prelude.
jackalmage@5964 3214 </dl>
jackalmage@5964 3215
jackalmage@7444 3216 <h4 id=consume-an-at-statement><span class=secno>5.4.3. </span> <dfn
jackalmage@7444 3217 id=consume-an-at-statement0>Consume an at-statement</dfn></h4>
jackalmage@7444 3218
jackalmage@7444 3219 <p> Create a new at-rule with its name set to the value of the <a
jackalmage@7444 3220 href="#current-input-token"><i>current input token</i></a>, its prelude
jackalmage@7444 3221 initially set to an empty list, and its value set to nothing.
jackalmage@7444 3222
jackalmage@7444 3223 <p> Repeatedly consume the <a href="#next-input-token"><i>next input
jackalmage@7444 3224 token</i></a>:
jackalmage@5964 3225
jackalmage@5964 3226 <dl>
jackalmage@5964 3227 <dt>semicolon token
jackalmage@5964 3228
jackalmage@7444 3229 <dt>EOF token
jackalmage@7444 3230
jackalmage@7444 3231 <dd> Return the at-rule.
jackalmage@7444 3232
jackalmage@7444 3233 <dt>anything else
jackalmage@7444 3234
jackalmage@7444 3235 <dd> <a href="#consume-a-component-value0"><i>Consume a component
jackalmage@7444 3236 value</i></a>. Append the returned value to the at-rule's prelude.
jackalmage@7444 3237 </dl>
jackalmage@7444 3238
jackalmage@7444 3239 <h4 id=consume-a-qualified-rule><span class=secno>5.4.4. </span> <dfn
jackalmage@7444 3240 id=consume-a-qualified-rule0>Consume a qualified rule</dfn></h4>
jackalmage@7444 3241
jackalmage@7444 3242 <p> Create a new qualified rule with its prelude initially set to an empty
jackalmage@7444 3243 list, and its value initially set to nothing.
jackalmage@7444 3244
jackalmage@7444 3245 <p> Repeatedly consume the <a href="#next-input-token"><i>next input
jackalmage@7444 3246 token</i></a>:
jackalmage@7444 3247
jackalmage@7444 3248 <dl>
jackalmage@7444 3249 <dt>EOF token
jackalmage@7444 3250
jackalmage@7444 3251 <dd> This is a <i>parse error</i>. Return nothing.
jackalmage@5964 3252
jackalmage@6020 3253 <dt>{ token
jackalmage@5964 3254
jackalmage@7444 3255 <dd> <a href="#consume-a-simple-block0"><i>Consume a simple block</i></a>.
jackalmage@7444 3256 <a href="#consume-a-list-of-declarations0"><i>Consume a list of
jackalmage@7444 3257 declarations</i></a> from the block's value. If anything was returned,
jackalmage@7444 3258 assign it to the qualified rule's value. Return the qualified rule.
jackalmage@6239 3259
jackalmage@7462 3260 <dt><a href="#simple-block"><i>simple block</i></a> with an associated
jackalmage@7462 3261 token of {
jackalmage@7462 3262
jackalmage@7462 3263 <dd> <a href="#consume-a-list-of-declarations0"><i>Consume a list of
jackalmage@7462 3264 declarations</i></a> from the block's value. If anything was returned,
jackalmage@7462 3265 assign it to the qualified rule's value. Return the qualified rule.
jackalmage@7462 3266
jackalmage@5964 3267 <dt>anything else
jackalmage@5964 3268
jackalmage@7264 3269 <dd> <a href="#consume-a-component-value0"><i>Consume a component
jackalmage@7444 3270 value</i></a>. Append the returned value to the qualified rule's prelude.
jackalmage@5964 3271 </dl>
jackalmage@5964 3272
jackalmage@7444 3273 <h4 id=consume-a-list-of-declarations><span class=secno>5.4.5. </span> <dfn
jackalmage@7444 3274 id=consume-a-list-of-declarations0>Consume a list of declarations</dfn></h4>
jackalmage@7444 3275
jackalmage@7444 3276 <p> Create an initially empty list of declarations.
jackalmage@7444 3277
jackalmage@7444 3278 <p> Repeatedly consume the <a href="#next-input-token"><i>next input
jackalmage@7444 3279 token</i></a>:
jackalmage@5964 3280
jackalmage@5964 3281 <dl>
jackalmage@6255 3282 <dt>whitespace token
jackalmage@6255 3283
jackalmage@7444 3284 <dt>semicolon token
jackalmage@7444 3285
jackalmage@7444 3286 <dd> Do nothing.
jackalmage@7444 3287
jackalmage@7444 3288 <dt>EOF token
jackalmage@7444 3289
jackalmage@7444 3290 <dd> Return the list of declarations.
jackalmage@5978 3291
jackalmage@5964 3292 <dt>at-keyword token
jackalmage@5964 3293
jackalmage@7444 3294 <dd> <a href="#reconsume-the-current-input-token"><i>Reconsume the current
jackalmage@7444 3295 input token</i></a>. If the token's value is on the list of <a
jackalmage@7444 3296 href="#recognized-at-rule-name"><i>recognized at-rule names</i></a>, and
jackalmage@7444 3297 is noted as <a href="#rule-filled"><i>rule-filled</i></a> or <a
jackalmage@7444 3298 href="#declaration-filled"><i>declaration-filled</i></a>, <a
jackalmage@7444 3299 href="#consume-an-at-rule0"><i>consume an at-rule</i></a>; otherwise, <a
jackalmage@7444 3300 href="#consume-an-at-statement0"><i>consume an at-statement</i></a>. If
jackalmage@7444 3301 anything was returned, append it to the list of declarations.
jackalmage@7444 3302
jackalmage@7444 3303 <dt>ident token
jackalmage@7444 3304
jackalmage@7444 3305 <dd> Initialize a temporary list initially filled with the <a
jackalmage@7444 3306 href="#current-input-token"><i>current input token</i></a>. Repeatedly <a
jackalmage@7444 3307 href="#consume-a-component-value0"><i>consume a component value</i></a>
jackalmage@7444 3308 from the <a href="#next-input-token"><i>next input token</i></a> until a
jackalmage@7444 3309 semicolon token or EOF token is returned, appending all of the returned
jackalmage@7444 3310 values up to that point to the temporary list. <a
jackalmage@7444 3311 href="#consume-a-declaration0"><i>Consume a declaration</i></a> from the
jackalmage@7444 3312 temporary list. If anything was returned, append it to the list of
jackalmage@7444 3313 declarations.
jackalmage@6239 3314
jackalmage@6016 3315 <dt>anything else
jackalmage@6016 3316
jackalmage@7444 3317 <dd> This is a <i>parse error</i>. Repeatedly consume the <a
jackalmage@7444 3318 href="#next-input-token"><i>next input token</i></a> until it is a
jackalmage@7444 3319 semicolon token or EOF token.
jackalmage@5964 3320 </dl>
jackalmage@5964 3321
jackalmage@7444 3322 <h4 id=consume-a-declaration><span class=secno>5.4.6. </span> <dfn
jackalmage@7444 3323 id=consume-a-declaration0>Consume a declaration</dfn></h4>
jackalmage@7444 3324
jackalmage@7444 3325 <p> Create a new declaration with its name set to the value of the <a
jackalmage@7444 3326 href="#current-input-token"><i>current input token</i></a>.
jackalmage@7444 3327
jackalmage@7444 3328 <p> Repeatedly consume whitespace tokens until a non-whitespace token is
jackalmage@7454 3329 reached. If this token is anything but a colon token, this is a <i>parse
jackalmage@7454 3330 error</i>. Return nothing.
jackalmage@7444 3331
jackalmage@7444 3332 <p> Otherwise, repeatedly <a href="#consume-a-component-value0"><i>consume
jackalmage@7444 3333 a component value</i></a> from the <a href="#next-input-token"><i>next
jackalmage@7444 3334 input token</i></a> until an EOF token is reached, appending all of the
jackalmage@7444 3335 returned values up to that point to the declaration's value.
jackalmage@7444 3336
jackalmage@7444 3337 <p> If the last two non-whitespace tokens in the declaration's value are a
jackalmage@7444 3338 delim token with the value "!" followed by an ident token with a value
jackalmage@7444 3339 that is an <a href="#ascii-case-insensitive"><i>ASCII
jackalmage@7444 3340 case-insensitive</i></a> match for "important", remove them from the
jackalmage@7444 3341 declaration's value and set the declaration's <var>important</var> flag to
jackalmage@7444 3342 true.
jackalmage@7444 3343
jackalmage@7444 3344 <p> Return the declaration.
jackalmage@7444 3345
jackalmage@7444 3346 <h4 id=consume-a-component-value><span class=secno>5.4.7. </span> <dfn
jackalmage@7444 3347 id=consume-a-component-value0>Consume a component value</dfn></h4>
jackalmage@6518 3348
jackalmage@6518 3349 <p> This section describes how to <a
jackalmage@7264 3350 href="#consume-a-component-value0"><i>consume a component value</i></a>.
jackalmage@6236 3351
jackalmage@6236 3352 <p> If the <a href="#current-input-token"><i>current input token</i></a> is
jackalmage@6236 3353 a {, [, or ( token, <a href="#consume-a-simple-block0"><i>consume a simple
jackalmage@6236 3354 block</i></a> and return it.
jackalmage@6236 3355
jackalmage@6236 3356 <p> Otherwise, if the <a href="#current-input-token"><i>current input
jackalmage@6236 3357 token</i></a> is a function token, <a
jackalmage@6236 3358 href="#consume-a-function0"><i>consume a function</i></a> and return it.
jackalmage@6236 3359
jackalmage@6236 3360 <p> Otherwise, return the <a href="#current-input-token"><i>current input
jackalmage@6236 3361 token</i></a>.
jackalmage@6236 3362
jackalmage@7444 3363 <h4 id=consume-a-component-value-with-the-hashl><span class=secno>5.4.8.
jackalmage@7264 3364 </span> <dfn id=consume-a-component-value-with-the-hashl0>Consume a
jackalmage@7444 3365 component value with the hashless color quirk</dfn></h4>
jackalmage@6521 3366
jackalmage@6521 3367 <p> This section describes how to <a
jackalmage@7264 3368 href="#consume-a-component-value-with-the-hashl0"><i>consume a component
jackalmage@7264 3369 value with the hashless color quirk</i></a>.
jackalmage@6521 3370
jackalmage@6521 3371 <p> The <dfn id=hashless-color-quirk-list>hashless color quirk list</dfn>
jackalmage@7215 3372 contains the following property names:
jackalmage@6521 3373
jackalmage@6521 3374 <ul>
jackalmage@6535 3375 <li>‘<code class=property>background-color</code>’
jackalmage@6535 3376
jackalmage@6535 3377 <li>‘<code class=property>border-color</code>’
jackalmage@6535 3378
jackalmage@6535 3379 <li>‘<code class=property>border-top-color</code>’
jackalmage@6535 3380
jackalmage@6535 3381 <li>‘<code class=property>border-right-color</code>’
jackalmage@6535 3382
jackalmage@6535 3383 <li>‘<code class=property>border-bottom-color</code>’
jackalmage@6535 3384
jackalmage@6535 3385 <li>‘<code class=property>border-left-color</code>’
jackalmage@6535 3386
jackalmage@6535 3387 <li>‘<code class=property>color</code>’
jackalmage@6521 3388 </ul>
jackalmage@6521 3389
jackalmage@6521 3390 <p> If the <a href="#current-input-token"><i>current input token</i></a> is
jackalmage@6521 3391 a number token, let <var>value</var> be the token's representation. If the
jackalmage@6521 3392 <a href="#current-input-token"><i>current input token</i></a> is a
jackalmage@6521 3393 dimension token, let <var>value</var> be the token's representation
jackalmage@6521 3394 followed by the token's unit. If the <a
jackalmage@6871 3395 href="#current-input-token"><i>current input token</i></a> is an ident
jackalmage@6871 3396 token, let <var>value</var> be the token's value.
jackalmage@6521 3397
jackalmage@6533 3398 <p> If <var>value</var> has a length of 3 or 6 and is composed solely of <a
jackalmage@6521 3399 href="#hex-digit"><i>hex digits</i></a>, create a hash token with its
jackalmage@6533 3400 value set to the <var>value</var> and return it.
jackalmage@6521 3401
jackalmage@7264 3402 <p> Otherwise, <a href="#consume-a-component-value0"><i>consume a component
jackalmage@7264 3403 value</i></a> and return the returned value.
jackalmage@7264 3404
jackalmage@7444 3405 <h4 id=consume-a-component-value-with-the-unitl><span class=secno>5.4.9.
jackalmage@7264 3406 </span> <dfn id=consume-a-component-value-with-the-unitl0>Consume a
jackalmage@7444 3407 component value with the unitless length quirk</dfn></h4>
jackalmage@6521 3408
jackalmage@6521 3409 <p> This section describes how to <a
jackalmage@7264 3410 href="#consume-a-component-value-with-the-unitl0"><i>consume a component
jackalmage@7264 3411 value with the unitless length quirk</i></a>.
jackalmage@6521 3412
jackalmage@6521 3413 <p> The <dfn id=unitless-length-quirk-list>unitless length quirk list</dfn>
jackalmage@7215 3414 contains the following property names:
jackalmage@6521 3415
jackalmage@6521 3416 <ul>
jackalmage@6535 3417 <li>‘<code class=property>border-top-width</code>’
jackalmage@6535 3418
jackalmage@6535 3419 <li>‘<code class=property>border-right-width</code>’
jackalmage@6535 3420
jackalmage@6535 3421 <li>‘<code class=property>border-bottom-width</code>’
jackalmage@6535 3422
jackalmage@6535 3423 <li>‘<code class=property>border-left-width</code>’
jackalmage@6535 3424
jackalmage@6535 3425 <li>‘<code class=property>border-width</code>’
jackalmage@6535 3426
jackalmage@6535 3427 <li>‘<code class=property>bottom</code>’
jackalmage@6535 3428
jackalmage@6535 3429 <li>‘<code class=property>font-size</code>’
jackalmage@6535 3430
jackalmage@6535 3431 <li>‘<code class=property>height</code>’
jackalmage@6535 3432
jackalmage@6535 3433 <li>‘<code class=property>left</code>’
jackalmage@6535 3434
jackalmage@6535 3435 <li>‘<code class=property>letter-spacing</code>’
jackalmage@6535 3436
jackalmage@6535 3437 <li>‘<code class=property>margin</code>’
jackalmage@6535 3438
jackalmage@6535 3439 <li>‘<code class=property>margin-right</code>’
jackalmage@6535 3440
jackalmage@6535 3441 <li>‘<code class=property>margin-left</code>’
jackalmage@6535 3442
jackalmage@6535 3443 <li>‘<code class=property>margin-top</code>’
jackalmage@6535 3444
jackalmage@6535 3445 <li>‘<code class=property>margin-bottom</code>’
jackalmage@6535 3446
jackalmage@6535 3447 <li>‘<code class=property>padding</code>’
jackalmage@6535 3448
jackalmage@6535 3449 <li>‘<code class=property>padding-top</code>’
jackalmage@6535 3450
jackalmage@6535 3451 <li>‘<code class=property>padding-right</code>’
jackalmage@6535 3452
jackalmage@6535 3453 <li>‘<code class=property>padding-bottom</code>’
jackalmage@6535 3454
jackalmage@6535 3455 <li>‘<code class=property>padding-left</code>’
jackalmage@6535 3456
jackalmage@6535 3457 <li>‘<code class=property>right</code>’
jackalmage@6535 3458
jackalmage@6535 3459 <li>‘<code class=property>top</code>’
jackalmage@6535 3460
jackalmage@6535 3461 <li>‘<code class=property>width</code>’
jackalmage@6535 3462
jackalmage@6535 3463 <li>‘<code class=property>word-spacing</code>’
jackalmage@6521 3464 </ul>
jackalmage@6521 3465
jackalmage@6521 3466 <p> If the <a href="#current-input-token"><i>current input token</i></a> is
jackalmage@6521 3467 a number token, create a dimension token with its value and representation
jackalmage@6521 3468 set to the token's value and representation, and its unit set to "px".
jackalmage@6521 3469 Return the dimension token.
jackalmage@6521 3470
jackalmage@7264 3471 <p> Otherwise, <a href="#consume-a-component-value0"><i>consume a component
jackalmage@7264 3472 value</i></a> and return the returned value.
jackalmage@6521 3473
jackalmage@7444 3474 <h4 id=consume-a-simple-block><span class=secno>5.4.10. </span> <dfn
jackalmage@7444 3475 id=consume-a-simple-block0>Consume a simple block</dfn></h4>
jackalmage@6025 3476
jackalmage@6025 3477 <p> This section describes how to <a
jackalmage@6236 3478 href="#consume-a-simple-block0"><i>consume a simple block</i></a>.
jackalmage@5964 3479
jackalmage@6003 3480 <p> The <dfn id=ending-token>ending token</dfn> is the mirror variant of
jackalmage@6236 3481 the <a href="#current-input-token"><i>current input token</i></a>. (E.g.
jackalmage@6236 3482 if it was called with [, the <a href="#ending-token"><i>ending
jackalmage@6236 3483 token</i></a> is ].)
jackalmage@6236 3484
jackalmage@6236 3485 <p> Create a simple block with its associated token set to the <a
jackalmage@7444 3486 href="#current-input-token"><i>current input token</i></a>.
jackalmage@7259 3487
jackalmage@5964 3488 <p> Repeatedly consume the <a href="#next-input-token"><i>next input
jackalmage@5964 3489 token</i></a> and process it as follows:
jackalmage@5964 3490
jackalmage@5964 3491 <dl>
jackalmage@5964 3492 <dt>EOF token
jackalmage@5964 3493
jackalmage@6001 3494 <dt><a href="#ending-token"><i>ending token</i></a>
jackalmage@6001 3495
jackalmage@7444 3496 <dd> Return the block.
jackalmage@5964 3497
jackalmage@6236 3498 <dt>anything else
jackalmage@6236 3499
jackalmage@7264 3500 <dd> <a href="#consume-a-component-value0"><i>Consume a component
jackalmage@7444 3501 value</i></a> and append it to the value of the block.
jackalmage@5964 3502 </dl>
jackalmage@5964 3503
jackalmage@7444 3504 <h4 id=consume-a-function><span class=secno>5.4.11. </span> <dfn
jackalmage@7444 3505 id=consume-a-function0>Consume a function</dfn></h4>
jackalmage@6020 3506
jackalmage@6020 3507 <p> This section describes how to <a href="#consume-a-function0"><i>consume
jackalmage@6020 3508 a function</i></a>.
jackalmage@6020 3509
jackalmage@6020 3510 <p> Create a function with a name equal to the value of the <a
jackalmage@7444 3511 href="#current-input-token"><i>current input token</i></a>, and an
jackalmage@7444 3512 argument list which is initially empty. Create an argument, called the
jackalmage@7444 3513 <dfn id=current-argument>current argument</dfn>, with a value which is
jackalmage@7444 3514 initially an empty list.
jackalmage@7259 3515
jackalmage@6020 3516 <p> Repeatedly consume the <a href="#next-input-token"><i>next input
jackalmage@6020 3517 token</i></a> and process it as follows:
jackalmage@6020 3518
jackalmage@6020 3519 <dl>
jackalmage@6020 3520 <dt>EOF token
jackalmage@6020 3521
jackalmage@6020 3522 <dt>) token
jackalmage@6020 3523
jackalmage@7444 3524 <dd> Return the function.
jackalmage@7444 3525
jackalmage@7444 3526 <dt>comma token
jackalmage@6020 3527
jackalmage@6532 3528 <dd> Append the <a href="#current-argument"><i>current argument</i></a> to
jackalmage@6532 3529 the function's argument list. Create a new <a
jackalmage@6532 3530 href="#current-argument"><i>current argument</i></a> which is initially
jackalmage@6532 3531 empty.
jackalmage@6532 3532
jackalmage@6532 3533 <dt>number token
jackalmage@6532 3534
jackalmage@6546 3535 <dd> If the <a href="#quirks-mode"><i>quirks mode</i></a> flag is set, and
jackalmage@7215 3536 the function's name is as <a href="#ascii-case-insensitive"><i>ASCII
jackalmage@7215 3537 case-insensitive</i></a> match with "rect", <a
jackalmage@7264 3538 href="#consume-a-component-value-with-the-unitl0"><i>consume a component
jackalmage@7264 3539 value with the unitless length quirk</i></a>. If anything was returned,
jackalmage@7264 3540 append the returned value to the value of the <a
jackalmage@7259 3541 href="#current-argument"><i>current argument</i></a>; otherwise, set the
jackalmage@7259 3542 <var>valid</var> flag to false.
jackalmage@7264 3543 <p> Otherwise, <a href="#consume-a-component-value0"><i>consume a
jackalmage@7264 3544 component value</i></a>. If anything was returned, append the returned
jackalmage@7264 3545 value to the value of the <a href="#current-argument"><i>current
jackalmage@7259 3546 argument</i></a>; otherwise, set the <var>valid</var> flag to false.
jackalmage@6020 3547
jackalmage@6020 3548 <dt>anything else
jackalmage@6020 3549
jackalmage@7264 3550 <dd> <a href="#consume-a-component-value0"><i>Consume a component
jackalmage@7444 3551 value</i></a> and append the returned value to the value of the <a
jackalmage@7444 3552 href="#current-argument"><i>current argument</i></a>.
jackalmage@6020 3553 </dl>
jackalmage@6020 3554
jackalmage@7444 3555 <h3 id=changes-from-css-2.1-core-grammar><span class=secno>5.5. </span>
jackalmage@6008 3556 Changes from CSS 2.1 Core Grammar</h3>
jackalmage@6008 3557
jackalmage@6008 3558 <p> <em>This section is non-normative.</em>
jackalmage@6008 3559
jackalmage@6598 3560 <p class=issue> Note that the point of this spec is to match reality;
jackalmage@6598 3561 changes from CSS2.1&apos;s Core Grammar are nearly always because the Core
jackalmage@6598 3562 Grammar specified something that doesn't match actual browser behavior, or
jackalmage@6598 3563 left something unspecified. If some detail doesn't match browsers, please
jackalmage@6598 3564 let me know as it's almost certainly unintentional.
jackalmage@6008 3565
jackalmage@6008 3566 <ol>
jackalmage@6598 3567 <li> The handling of some miscellanous "special" tokens (like an unmatched
jackalmage@6598 3568 } token) showing up in various places in the grammar has been specified
jackalmage@6598 3569 with some reasonable behavior shown by at least one browser. Previously,
jackalmage@6560 3570 stylesheets with those tokens in those places just didn't match the
jackalmage@6560 3571 stylesheet grammar at all, so their handling was totally undefined.
jackalmage@7241 3572 Specifically:
jackalmage@7241 3573 <ul>
jackalmage@7241 3574 <li> [] blocks, () blocks and functions can now contain {} blocks,
jackalmage@7241 3575 at-keywords or semicolons
jackalmage@7241 3576
jackalmage@7241 3577 <li> Selectors can now contain semicolons
jackalmage@7241 3578
jackalmage@7261 3579 <li> Selectors and at-rule preludes can now contain at-keywords
jackalmage@7241 3580 </ul>
jackalmage@6563 3581
jackalmage@6563 3582 <li> Quirks mode parsing differences are now officially recognized in the
jackalmage@6563 3583 parser.
jackalmage@6008 3584 </ol>
jackalmage@7444 3585
jackalmage@7444 3586 <h2 id=serialization><span class=secno>6. </span>Serialization</h2>
jackalmage@7217 3587
jackalmage@7217 3588 <p> This specification does not define how to serialize CSS in general,
jackalmage@7217 3589 leaving that task to the CSSOM and individual feature specifications.
jackalmage@7217 3590 However, there is one important facet that must be specified here
jackalmage@7217 3591 regarding comments, to ensure accurate "round-tripping" of data from text
jackalmage@7217 3592 to CSS objects and back.
jackalmage@7217 3593
jackalmage@7217 3594 <p> The tokenizer described in this specification does not produce tokens
jackalmage@7217 3595 for comments, or otherwise preserve them in any way. Implementations may
jackalmage@7217 3596 preserve the contents of comments and their location in the token stream.
jackalmage@7217 3597 If they do, this preserved information must have no effect on the parsing
jackalmage@7217 3598 step, but must be serialized in its position as "/*" followed by its
jackalmage@7217 3599 contents followed by "*/".
jackalmage@7217 3600
jackalmage@7217 3601 <p> If the implementation does not preserve comments, it must insert the
jackalmage@7217 3602 text "/**/" between the serialization of adjacent tokens when the two
jackalmage@7217 3603 tokens are of the following pairs:
jackalmage@7217 3604
jackalmage@7217 3605 <ul>
jackalmage@7222 3606 <li> hash or at-keyword token followed by a number, percentage, ident,
jackalmage@7219 3607 dimension, unicode-range, url, or a function token;
jackalmage@7217 3608
jackalmage@7217 3609 <li> number, ident, and dimension tokens in any combination;
jackalmage@7217 3610
jackalmage@7219 3611 <li> number, ident, or dimension token followed by a percentage,
jackalmage@7219 3612 unicode-range, url, or function token;
jackalmage@7219 3613
jackalmage@7219 3614 <li> ident token followed by a ( token;
jackalmage@7219 3615
jackalmage@7222 3616 <li> a delim token containing "#" or "@" followed by any token except
jackalmage@7222 3617 whitespace;
jackalmage@7222 3618
jackalmage@7222 3619 <li> a delim token containing "-", "+", ".", "&lt;", ">", or "!" following
jackalmage@7222 3620 or followed by any token except whitespace;
jackalmage@7219 3621
jackalmage@7219 3622 <li> a delim token containing "/" following or followed by a delim token
jackalmage@7219 3623 containing "*".
jackalmage@7217 3624 </ul>
jackalmage@7217 3625
jackalmage@7217 3626 <p class=note> The preceding pairs of tokens can only be adjacent due to
jackalmage@7217 3627 comments in the original text, so the above rule reinserts the minimum
jackalmage@7217 3628 number of comments into the serialized text to ensure an accurate
jackalmage@7222 3629 round-trip. (Roughly. The delim token rules are slightly too powerful, for
jackalmage@7222 3630 simplicity.) <!--
jackalmage@7438 3631
jackalmage@5486 3632 TTTTTTTTTTTTTTTTTTTTTTTHHHHHHHHH HHHHHHHHHEEEEEEEEEEEEEEEEEEEEEE
jackalmage@5486 3633 T:::::::::::::::::::::TH:::::::H H:::::::HE::::::::::::::::::::E
jackalmage@5486 3634 T:::::::::::::::::::::TH:::::::H H:::::::HE::::::::::::::::::::E
jackalmage@5486 3635 T:::::TT:::::::TT:::::THH::::::H H::::::HHEE::::::EEEEEEEEE::::E
jackalmage@5486 3636 TTTTTT T:::::T TTTTTT H:::::H H:::::H E:::::E EEEEEE
jackalmage@7438 3637 T:::::T H:::::H H:::::H E:::::E
jackalmage@7438 3638 T:::::T H::::::HHHHH::::::H E::::::EEEEEEEEEE
jackalmage@7438 3639 T:::::T H:::::::::::::::::H E:::::::::::::::E
jackalmage@7438 3640 T:::::T H:::::::::::::::::H E:::::::::::::::E
jackalmage@7438 3641 T:::::T H::::::HHHHH::::::H E::::::EEEEEEEEEE
jackalmage@7438 3642 T:::::T H:::::H H:::::H E:::::E
jackalmage@5486 3643 T:::::T H:::::H H:::::H E:::::E EEEEEE
jackalmage@5486 3644 TT:::::::TT HH::::::H H::::::HHEE::::::EEEEEEEE:::::E
jackalmage@5486 3645 T:::::::::T H:::::::H H:::::::HE::::::::::::::::::::E
jackalmage@5486 3646 T:::::::::T H:::::::H H:::::::HE::::::::::::::::::::E
jackalmage@5486 3647 TTTTTTTTTTT HHHHHHHHH HHHHHHHHHEEEEEEEEEEEEEEEEEEEEEE
jackalmage@7438 3648
jackalmage@7438 3649
jackalmage@7438 3650
jackalmage@7438 3651 EEEEEEEEEEEEEEEEEEEEEENNNNNNNN NNNNNNNNDDDDDDDDDDDDD
jackalmage@7438 3652 E::::::::::::::::::::EN:::::::N N::::::ND::::::::::::DDD
jackalmage@7438 3653 E::::::::::::::::::::EN::::::::N N::::::ND:::::::::::::::DD
jackalmage@7438 3654 EE::::::EEEEEEEEE::::EN:::::::::N N::::::NDDD:::::DDDDD:::::D
jackalmage@7438 3655 E:::::E EEEEEEN::::::::::N N::::::N D:::::D D:::::D
jackalmage@5486 3656 E:::::E N:::::::::::N N::::::N D:::::D D:::::D
jackalmage@5486 3657 E::::::EEEEEEEEEE N:::::::N::::N N::::::N D:::::D D:::::D
jackalmage@5486 3658 E:::::::::::::::E N::::::N N::::N N::::::N D:::::D D:::::D
jackalmage@5486 3659 E:::::::::::::::E N::::::N N::::N:::::::N D:::::D D:::::D
jackalmage@5486 3660 E::::::EEEEEEEEEE N::::::N N:::::::::::N D:::::D D:::::D
jackalmage@5486 3661 E:::::E N::::::N N::::::::::N D:::::D D:::::D
jackalmage@7438 3662 E:::::E EEEEEEN::::::N N:::::::::N D:::::D D:::::D
jackalmage@7438 3663 EE::::::EEEEEEEE:::::EN::::::N N::::::::NDDD:::::DDDDD:::::D
jackalmage@7438 3664 E::::::::::::::::::::EN::::::N N:::::::ND:::::::::::::::DD
jackalmage@7438 3665 E::::::::::::::::::::EN::::::N N::::::ND::::::::::::DDD
jackalmage@7438 3666 EEEEEEEEEEEEEEEEEEEEEENNNNNNNN NNNNNNNDDDDDDDDDDDDD
jackalmage@5486 3667 -->
jackalmage@5473 3668
jackalmage@7444 3669 <h2 id=conformance><span class=secno>7. </span> Conformance</h2>
jackalmage@7444 3670
jackalmage@7444 3671 <h3 id=conventions><span class=secno>7.1. </span> Document conventions</h3>
jackalmage@5473 3672
jackalmage@5473 3673 <p>Conformance requirements are expressed with a combination of descriptive
jackalmage@5473 3674 assertions and RFC 2119 terminology. The key words “MUST”, “MUST
jackalmage@5473 3675 NOT”, “REQUIRED”, “SHALL”, “SHALL NOT”, “SHOULD”,
jackalmage@5473 3676 “SHOULD NOT”, “RECOMMENDED”, “MAY”, and “OPTIONAL” in the
jackalmage@5473 3677 normative parts of this document are to be interpreted as described in RFC
jackalmage@5473 3678 2119. However, for readability, these words do not appear in all uppercase
jackalmage@5473 3679 letters in this specification.
jackalmage@5473 3680
jackalmage@5473 3681 <p>All of the text of this specification is normative except sections
jackalmage@5473 3682 explicitly marked as non-normative, examples, and notes. <a
jackalmage@5473 3683 href="#RFC2119" rel=biblioentry>[RFC2119]<!--{{!RFC2119}}--></a>
jackalmage@5473 3684
jackalmage@5473 3685 <p>Examples in this specification are introduced with the words “for
jackalmage@5473 3686 example” or are set apart from the normative text with
jackalmage@5473 3687 <code>class="example"</code>, like this:
jackalmage@5473 3688
jackalmage@5473 3689 <div class=example>
jackalmage@6670 3690 <p>This is an example of an informative example.
jackalmage@5473 3691 </div>
jackalmage@5473 3692
jackalmage@5473 3693 <p>Informative notes begin with the word “Note” and are set apart from
jackalmage@5473 3694 the normative text with <code>class="note"</code>, like this:
jackalmage@5473 3695
jackalmage@5473 3696 <p class=note>Note, this is an informative note.
jackalmage@5473 3697
jackalmage@7444 3698 <h3 id=conformance-classes><span class=secno>7.2. </span> Conformance
jackalmage@5473 3699 classes</h3>
jackalmage@5473 3700
jackalmage@6598 3701 <p>Conformance to CSS Syntax Module Level 3 is defined for three
jackalmage@6598 3702 conformance classes:
jackalmage@5473 3703
jackalmage@5473 3704 <dl>
jackalmage@5473 3705 <dt><dfn id=style-sheet title="style sheet!!as conformance class">style
jackalmage@5473 3706 sheet</dfn>
jackalmage@5473 3707
jackalmage@5473 3708 <dd>A <a href="http://www.w3.org/TR/CSS21/conform.html#style-sheet">CSS
jackalmage@5473 3709 style sheet</a>.
jackalmage@5473 3710
jackalmage@5473 3711 <dt><dfn id=renderer>renderer</dfn>
jackalmage@5473 3712
jackalmage@5473 3713 <dd>A <a href="http://www.w3.org/TR/CSS21/conform.html#user-agent">UA</a>
jackalmage@5473 3714 that interprets the semantics of a style sheet and renders documents that
jackalmage@5473 3715 use them.
jackalmage@5473 3716
jackalmage@5473 3717 <dt><dfn id=authoring-tool>authoring tool</dfn>
jackalmage@5473 3718
jackalmage@5473 3719 <dd>A <a href="http://www.w3.org/TR/CSS21/conform.html#user-agent">UA</a>
jackalmage@5473 3720 that writes a style sheet.
jackalmage@5473 3721 </dl>
jackalmage@5473 3722
jackalmage@6598 3723 <p>A style sheet is conformant to CSS Syntax Module Level 3 if it is
jackalmage@6598 3724 syntactically valid according to this module.
jackalmage@6598 3725
jackalmage@6598 3726 <p>A renderer is conformant to CSS Syntax Module Level 3 if it parses a
jackalmage@6598 3727 stylesheet according to this module.
jackalmage@6598 3728
jackalmage@6598 3729 <p>An authoring tool is conformant to CSS Syntax Module Level 3 if it
jackalmage@6598 3730 writes style sheets that are syntactically valid according to this module.
jackalmage@5473 3731
jackalmage@5473 3732 <h2 class=no-num id=acknowledgments> Acknowledgments</h2>
jackalmage@5473 3733
jackalmage@6598 3734 <p> Thanks for feedback and contributions from David Baron, 呂康豪
jackalmage@6598 3735 (Kang-Hao Lu), and Simon Sapin.
jackalmage@5473 3736
jackalmage@5473 3737 <h2 class=no-num id=references> References</h2>
jackalmage@5473 3738
jackalmage@5473 3739 <h3 class=no-num id=normative-references> Normative references</h3>
jackalmage@5473 3740 <!--begin-normative-->
jackalmage@5473 3741 <!-- Sorted by label -->
jackalmage@5473 3742
jackalmage@5473 3743 <dl class=bibliography>
jackalmage@5473 3744 <dt style="display: none"><!-- keeps the doc valid if the DL is empty -->
jackalmage@5473 3745 <!---->
jackalmage@5473 3746
jackalmage@5473 3747 <dt id=RFC2119>[RFC2119]
jackalmage@5473 3748
jackalmage@5473 3749 <dd>S. Bradner. <a href="http://www.ietf.org/rfc/rfc2119.txt"><cite>Key
jackalmage@5473 3750 words for use in RFCs to Indicate Requirement Levels.</cite></a> Internet
jackalmage@5473 3751 RFC 2119. URL: <a
jackalmage@5473 3752 href="http://www.ietf.org/rfc/rfc2119.txt">http://www.ietf.org/rfc/rfc2119.txt</a>
jackalmage@6670 3753 </dd>
jackalmage@5473 3754 <!---->
jackalmage@5473 3755 </dl>
jackalmage@5473 3756 <!--end-normative-->
jackalmage@5473 3757
jackalmage@5473 3758 <h3 class=no-num id=other-references> Other references</h3>
jackalmage@5473 3759 <!--begin-informative-->
jackalmage@5473 3760 <!-- Sorted by label -->
jackalmage@5473 3761
jackalmage@5473 3762 <dl class=bibliography>
jackalmage@5473 3763 <dt style="display: none"><!-- keeps the doc valid if the DL is empty -->
jackalmage@5473 3764 <!---->
jackalmage@5473 3765 </dl>
jackalmage@5473 3766 <!--end-informative-->
jackalmage@5473 3767
jackalmage@5473 3768 <h2 class=no-num id=index> Index</h2>
jackalmage@5473 3769 <!--begin-index-->
jackalmage@5473 3770
jackalmage@5473 3771 <ul class=indexlist>
jackalmage@7128 3772 <li>ASCII case-insensitive, <a href="#ascii-case-insensitive"
jackalmage@7224 3773 title="section 5.2."><strong>5.2.</strong></a>
jackalmage@7128 3774
jackalmage@5473 3775 <li>At-keyword-rest state, <a href="#at-keyword-rest-state0"
jackalmage@7224 3776 title="section 4.4.8."><strong>4.4.8.</strong></a>
jackalmage@5473 3777
jackalmage@5473 3778 <li>At-keyword state, <a href="#at-keyword-state0"
jackalmage@7224 3779 title="section 4.4.7."><strong>4.4.7.</strong></a>
simon@7048 3780
jackalmage@7233 3781 <li>at-rule, <a href="#at-rule"
jackalmage@7233 3782 title="section 5."><strong>5.</strong></a>, <a href="#at-rules"
simon@7048 3783 title="section 2."><strong>2.</strong></a>
jackalmage@5549 3784
jackalmage@5473 3785 <li>authoring tool, <a href="#authoring-tool"
jackalmage@7444 3786 title="section 7.2."><strong>7.2.</strong></a>
jackalmage@7224 3787
jackalmage@7224 3788 <li>Bad-URL state, <a href="#bad-url-state0"
jackalmage@7224 3789 title="section 4.4.22."><strong>4.4.22.</strong></a>
jackalmage@7224 3790
jackalmage@5473 3791 <li>Comment state, <a href="#comment-state0"
jackalmage@7224 3792 title="section 4.4.6."><strong>4.4.6.</strong></a>
jackalmage@5473 3793
jackalmage@7264 3794 <li>component value, <a href="#component-value"
jackalmage@7264 3795 title="section 5."><strong>5.</strong></a>
jackalmage@7264 3796
jackalmage@7264 3797 <li>Consume a component value, <a href="#consume-a-component-value0"
jackalmage@7444 3798 title="section 5.4.7."><strong>5.4.7.</strong></a>
jackalmage@7264 3799
jackalmage@7264 3800 <li>Consume a component value with the hashless color quirk, <a
jackalmage@7264 3801 href="#consume-a-component-value-with-the-hashl0"
jackalmage@7444 3802 title="section 5.4.8."><strong>5.4.8.</strong></a>
jackalmage@7264 3803
jackalmage@7264 3804 <li>Consume a component value with the unitless length quirk, <a
jackalmage@7264 3805 href="#consume-a-component-value-with-the-unitl0"
jackalmage@7444 3806 title="section 5.4.9."><strong>5.4.9.</strong></a>
jackalmage@7444 3807
jackalmage@7444 3808 <li>Consume a declaration, <a href="#consume-a-declaration0"
jackalmage@7444 3809 title="section 5.4.6."><strong>5.4.6.</strong></a>
jackalmage@7264 3810
jackalmage@6020 3811 <li>Consume a function, <a href="#consume-a-function0"
jackalmage@7444 3812 title="section 5.4.11."><strong>5.4.11.</strong></a>
jackalmage@7444 3813
jackalmage@7444 3814 <li>Consume a list of declarations, <a
jackalmage@7444 3815 href="#consume-a-list-of-declarations0"
jackalmage@7444 3816 title="section 5.4.5."><strong>5.4.5.</strong></a>
jackalmage@7444 3817
jackalmage@7444 3818 <li>Consume a list of rules, <a href="#consume-a-list-of-rules0"
jackalmage@7444 3819 title="section 5.4.1."><strong>5.4.1.</strong></a>
jackalmage@7444 3820
jackalmage@7444 3821 <li>Consume an at-rule, <a href="#consume-an-at-rule0"
jackalmage@7444 3822 title="section 5.4.2."><strong>5.4.2.</strong></a>
jackalmage@7444 3823
jackalmage@7444 3824 <li>Consume an at-statement, <a href="#consume-an-at-statement0"
jackalmage@7444 3825 title="section 5.4.3."><strong>5.4.3.</strong></a>
jackalmage@6020 3826
jackalmage@5473 3827 <li>Consume an escaped character, <a href="#consume-an-escaped-character0"
jackalmage@7224 3828 title="section 4.5."><strong>4.5.</strong></a>
jackalmage@5473 3829
jackalmage@7444 3830 <li>Consume a qualified rule, <a href="#consume-a-qualified-rule0"
jackalmage@7444 3831 title="section 5.4.4."><strong>5.4.4.</strong></a>
jackalmage@7444 3832
jackalmage@6025 3833 <li>Consume a simple block, <a href="#consume-a-simple-block0"
jackalmage@7444 3834 title="section 5.4.10."><strong>5.4.10.</strong></a>
jackalmage@6025 3835
jackalmage@6532 3836 <li>current argument, <a href="#current-argument"
jackalmage@7444 3837 title="section 5.4.11."><strong>5.4.11.</strong></a>
jackalmage@5964 3838
jackalmage@5473 3839 <li>current input character, <a href="#current-input-character"
simon@7048 3840 title="section 3.2.1."><strong>3.2.1.</strong></a>
jackalmage@5473 3841
jackalmage@6014 3842 <li>current input token, <a href="#current-input-token"
jackalmage@7224 3843 title="section 5.2."><strong>5.2.</strong></a>
jackalmage@6014 3844
jackalmage@5473 3845 <li>Data state, <a href="#data-state0"
jackalmage@7224 3846 title="section 4.4.1."><strong>4.4.1.</strong></a>
jackalmage@5483 3847
jackalmage@7233 3848 <li>declaration, <a href="#declaration"
jackalmage@7233 3849 title="section 5."><strong>5.</strong></a>
jackalmage@7233 3850
jackalmage@7205 3851 <li>declaration-filled, <a href="#declaration-filled"
jackalmage@7224 3852 title="section 5.2."><strong>5.2.</strong></a>
jackalmage@7205 3853
simon@7048 3854 <li>decode, <a href="#decode"
simon@7048 3855 title="section 3.2."><strong>3.2.</strong></a>
simon@7048 3856
jackalmage@7224 3857 <li>digit, <a href="#digit" title="section 4.3."><strong>4.3.</strong></a>
jackalmage@5473 3858
jackalmage@5473 3859 <li>Dimension state, <a href="#dimension-state0"
jackalmage@7224 3860 title="section 4.4.15."><strong>4.4.15.</strong></a>
jackalmage@5473 3861
jackalmage@5473 3862 <li>Double-quote-string state, <a href="#double-quote-string-state0"
jackalmage@7224 3863 title="section 4.4.2."><strong>4.4.2.</strong></a>
jackalmage@5473 3864
jackalmage@5964 3865 <li>ending token, <a href="#ending-token"
jackalmage@7444 3866 title="section 5.4.10."><strong>5.4.10.</strong></a>
jackalmage@5964 3867
jackalmage@5473 3868 <li>end of the range, <a href="#end-of-the-range"
jackalmage@7224 3869 title="section 4.6."><strong>4.6.</strong></a>
jackalmage@5473 3870
jackalmage@7233 3871 <li>function, <a href="#function"
jackalmage@7233 3872 title="section 5."><strong>5.</strong></a>
jackalmage@7233 3873
jackalmage@6944 3874 <li>get an encoding, <a href="#get-an-encoding"
simon@7048 3875 title="section 3.2."><strong>3.2.</strong></a>
jackalmage@6521 3876
jackalmage@6521 3877 <li>hashless color quirk list, <a href="#hashless-color-quirk-list"
jackalmage@7444 3878 title="section 5.4.8."><strong>5.4.8.</strong></a>
jackalmage@6239 3879
jackalmage@5473 3880 <li>Hash-rest state, <a href="#hash-rest-state0"
jackalmage@7224 3881 title="section 4.4.5."><strong>4.4.5.</strong></a>
jackalmage@5473 3882
jackalmage@5473 3883 <li>Hash state, <a href="#hash-state0"
jackalmage@7224 3884 title="section 4.4.4."><strong>4.4.4.</strong></a>
jackalmage@5473 3885
jackalmage@5473 3886 <li>hex digit, <a href="#hex-digit"
jackalmage@7224 3887 title="section 4.3."><strong>4.3.</strong></a>
jackalmage@5473 3888
jackalmage@6871 3889 <li>Ident-rest state, <a href="#ident-rest-state0"
jackalmage@7224 3890 title="section 4.4.10."><strong>4.4.10.</strong></a>
jackalmage@6871 3891
jackalmage@6871 3892 <li>Ident state, <a href="#ident-state0"
jackalmage@7224 3893 title="section 4.4.9."><strong>4.4.9.</strong></a>
simon@7048 3894
simon@7048 3895 <li>letter, <a href="#letter"
jackalmage@7224 3896 title="section 4.3."><strong>4.3.</strong></a>
jackalmage@5473 3897
jackalmage@5473 3898 <li>lowercase letter, <a href="#lowercase-letter"
jackalmage@7224 3899 title="section 4.3."><strong>4.3.</strong></a>
jackalmage@5473 3900
jackalmage@5548 3901 <li>maximum allowed codepoint, <a href="#maximum-allowed-codepoint"
jackalmage@7224 3902 title="section 4.3."><strong>4.3.</strong></a>
jackalmage@5548 3903
jackalmage@5473 3904 <li>name character, <a href="#name-character"
jackalmage@7224 3905 title="section 4.3."><strong>4.3.</strong></a>
jackalmage@5473 3906
jackalmage@5473 3907 <li>name-start character, <a href="#name-start-character"
jackalmage@7224 3908 title="section 4.3."><strong>4.3.</strong></a>
simon@7048 3909
simon@7048 3910 <li>newline, <a href="#newline"
jackalmage@7224 3911 title="section 4.3."><strong>4.3.</strong></a>
jackalmage@5473 3912
jackalmage@5473 3913 <li>next input character, <a href="#next-input-character"
simon@7048 3914 title="section 3.2.1."><strong>3.2.1.</strong></a>
jackalmage@5473 3915
jackalmage@5964 3916 <li>next input token, <a href="#next-input-token"
jackalmage@7224 3917 title="section 5.2."><strong>5.2.</strong></a>
jackalmage@5964 3918
jackalmage@5473 3919 <li>non-ASCII character, <a href="#non-ascii-character"
jackalmage@7224 3920 title="section 4.3."><strong>4.3.</strong></a>
jackalmage@5473 3921
jackalmage@5473 3922 <li>non-printable character, <a href="#non-printable-character"
jackalmage@7224 3923 title="section 4.3."><strong>4.3.</strong></a>
jackalmage@5473 3924
jackalmage@5473 3925 <li>Number-fraction state, <a href="#number-fraction-state0"
jackalmage@7224 3926 title="section 4.4.14."><strong>4.4.14.</strong></a>
jackalmage@5473 3927
jackalmage@5473 3928 <li>Number-rest state, <a href="#number-rest-state0"
jackalmage@7224 3929 title="section 4.4.13."><strong>4.4.13.</strong></a>
jackalmage@5473 3930
jackalmage@5473 3931 <li>Number state, <a href="#number-state0"
jackalmage@7224 3932 title="section 4.4.12."><strong>4.4.12.</strong></a>
jackalmage@5473 3933
jackalmage@7264 3934 <li>Parse a comma-separated list of component values, <a
jackalmage@7264 3935 href="#parse-a-comma-separated-list-of-componen0"
jackalmage@7444 3936 title="section 5.3.6."><strong>5.3.6.</strong></a>
jackalmage@7233 3937
jackalmage@7264 3938 <li>Parse a component value, <a href="#parse-a-component-value0"
jackalmage@7444 3939 title="section 5.3.4."><strong>5.3.4.</strong></a>
jackalmage@7264 3940
jackalmage@7264 3941 <li>Parse a list of component values, <a
jackalmage@7264 3942 href="#parse-a-list-of-component-values0"
jackalmage@7444 3943 title="section 5.3.5."><strong>5.3.5.</strong></a>
jackalmage@7264 3944
jackalmage@7233 3945 <li>Parse a list of declarations, <a href="#parse-a-list-of-declarations0"
jackalmage@7444 3946 title="section 5.3.3."><strong>5.3.3.</strong></a>
jackalmage@7233 3947
jackalmage@7277 3948 <li>Parse an+b notation, <a href="#parse-anb-notation0"
jackalmage@7444 3949 title="section 5.3.7."><strong>5.3.7.</strong></a>
jackalmage@7277 3950
jackalmage@7233 3951 <li>Parse a rule, <a href="#parse-a-rule0"
jackalmage@7444 3952 title="section 5.3.2."><strong>5.3.2.</strong></a>
jackalmage@7233 3953
jackalmage@7233 3954 <li>Parse a stylesheet, <a href="#parse-a-stylesheet0"
jackalmage@7444 3955 title="section 5.3.1."><strong>5.3.1.</strong></a>
jackalmage@6253 3956
jackalmage@7233 3957 <li>preserved tokens, <a href="#preserved-tokens"
jackalmage@7233 3958 title="section 5."><strong>5.</strong></a>
jackalmage@7233 3959
jackalmage@7444 3960 <li>qualified rule, <a href="#qualified-rule"
jackalmage@7444 3961 title="section 5."><strong>5.</strong></a>
jackalmage@7444 3962
jackalmage@6546 3963 <li>quirks mode, <a href="#quirks-mode"
jackalmage@7224 3964 title="section 5.1."><strong>5.1.</strong></a>
jackalmage@6546 3965
jackalmage@7444 3966 <li>recognized at-rule name, <a href="#recognized-at-rule-name"
jackalmage@7239 3967 title="section 5."><strong>5.</strong></a>
jackalmage@7239 3968
jackalmage@6678 3969 <li>reconsume the current input token, <a
jackalmage@6678 3970 href="#reconsume-the-current-input-token"
jackalmage@7224 3971 title="section 5.2."><strong>5.2.</strong></a>
simon@7048 3972
simon@7048 3973 <li>renderer, <a href="#renderer"
jackalmage@7444 3974 title="section 7.2."><strong>7.2.</strong></a>
jackalmage@7224 3975
jackalmage@7224 3976 <li>rule-filled, <a href="#rule-filled"
jackalmage@7217 3977 title="section 5.2."><strong>5.2.</strong></a>
simon@7048 3978
jackalmage@5481 3979 <li>Sci-notation state, <a href="#sci-notation-state0"
jackalmage@7224 3980 title="section 4.4.16."><strong>4.4.16.</strong></a>
jackalmage@5481 3981
jackalmage@5473 3982 <li>Set the unicode-range token's range, <a
jackalmage@5473 3983 href="#set-the-unicode-range-tokens-range0"
jackalmage@7224 3984 title="section 4.6."><strong>4.6.</strong></a>
jackalmage@5473 3985
jackalmage@7233 3986 <li>simple block, <a href="#simple-block"
jackalmage@7233 3987 title="section 5."><strong>5.</strong></a>
jackalmage@7233 3988
jackalmage@5473 3989 <li>Single-quote-string state, <a href="#single-quote-string-state0"
jackalmage@7224 3990 title="section 4.4.3."><strong>4.4.3.</strong></a>
jackalmage@5473 3991
jackalmage@5473 3992 <li>start of the range, <a href="#start-of-the-range"
jackalmage@7224 3993 title="section 4.6."><strong>4.6.</strong></a>
jackalmage@5473 3994
jackalmage@7233 3995 <li>style rule, <a href="#style-rule"
jackalmage@7444 3996 title="section 2."><strong>2.</strong></a>
jackalmage@7233 3997
jackalmage@5473 3998 <li>style sheet
jackalmage@5473 3999 <ul>
jackalmage@5473 4000 <li>as conformance class, <a href="#style-sheet"
jackalmage@7444 4001 title="section 7.2."><strong>7.2.</strong></a>
jackalmage@5473 4002 </ul>
jackalmage@5473 4003
jackalmage@5483 4004 <li>transform function whitespace, <a
jackalmage@5483 4005 href="#transform-function-whitespace"
jackalmage@7224 4006 title="section 4.2."><strong>4.2.</strong></a>
jackalmage@5483 4007
jackalmage@5486 4008 <li>Transform-function-whitespace state, <a
jackalmage@5486 4009 href="#transform-function-whitespace-state0"
jackalmage@7224 4010 title="section 4.4.11."><strong>4.4.11.</strong></a>
jackalmage@5486 4011
jackalmage@5473 4012 <li>Unicode-range state, <a href="#unicode-range-state0"
jackalmage@7224 4013 title="section 4.4.23."><strong>4.4.23.</strong></a>
jackalmage@5473 4014
jackalmage@6521 4015 <li>unitless length quirk list, <a href="#unitless-length-quirk-list"
jackalmage@7444 4016 title="section 5.4.9."><strong>5.4.9.</strong></a>
jackalmage@6521 4017
jackalmage@5473 4018 <li>uppercase letter, <a href="#uppercase-letter"
jackalmage@7224 4019 title="section 4.3."><strong>4.3.</strong></a>
jackalmage@5473 4020
jackalmage@5473 4021 <li>URL-double-quote state, <a href="#url-double-quote-state0"
jackalmage@7224 4022 title="section 4.4.18."><strong>4.4.18.</strong></a>
jackalmage@5473 4023
jackalmage@5473 4024 <li>URL-end state, <a href="#url-end-state0"
jackalmage@7224 4025 title="section 4.4.20."><strong>4.4.20.</strong></a>
jackalmage@5473 4026
jackalmage@5473 4027 <li>URL-single-quote state, <a href="#url-single-quote-state0"
jackalmage@7224 4028 title="section 4.4.19."><strong>4.4.19.</strong></a>
jackalmage@5473 4029
jackalmage@5473 4030 <li>URL state, <a href="#url-state0"
jackalmage@7224 4031 title="section 4.4.17."><strong>4.4.17.</strong></a>
jackalmage@5473 4032
jackalmage@5473 4033 <li>URL-unquoted state, <a href="#url-unquoted-state0"
jackalmage@7224 4034 title="section 4.4.21."><strong>4.4.21.</strong></a>
jackalmage@5473 4035
jackalmage@5473 4036 <li>whitespace, <a href="#whitespace"
jackalmage@7224 4037 title="section 4.3."><strong>4.3.</strong></a>
jackalmage@5473 4038 </ul>
jackalmage@5473 4039 <!--end-index-->
jackalmage@5473 4040
jackalmage@5473 4041 <h2 class=no-num id=property-index> Property index</h2>
jackalmage@5473 4042 <!--begin-properties-->
jackalmage@5473 4043
jackalmage@5473 4044 <table class=proptable>
jackalmage@5473 4045 <thead>
jackalmage@5473 4046 <tr>
jackalmage@5553 4047 <th>Property
jackalmage@5473 4048
jackalmage@5473 4049 <th>Values
jackalmage@5473 4050
jackalmage@5473 4051 <th>Initial
jackalmage@5473 4052
jackalmage@5898 4053 <th>Applies to
jackalmage@5473 4054
jackalmage@5473 4055 <th>Inh.
jackalmage@5473 4056
jackalmage@5473 4057 <th>Percentages
jackalmage@5473 4058
jackalmage@5473 4059 <th>Media
jackalmage@5473 4060
jackalmage@5473 4061 <tbody>
jackalmage@5473 4062 </table>
jackalmage@5473 4063 <!--end-properties-->
jackalmage@5473 4064 </html>
jackalmage@5473 4065 <!-- Keep this comment at the end of the file
jackalmage@5473 4066 Local variables:
jackalmage@5473 4067 mode: sgml
jackalmage@5473 4068 sgml-declaration:"~/SGML/HTML4.decl"
jackalmage@5473 4069 sgml-default-doctype-name:"html"
jackalmage@5473 4070 sgml-minimize-attributes:t
jackalmage@5473 4071 sgml-nofill-elements:("pre" "style" "br")
jackalmage@5473 4072 sgml-live-element-indicator:t
jackalmage@5473 4073 sgml-omittag:nil
jackalmage@5473 4074 sgml-shorttag:nil
jackalmage@5473 4075 sgml-namecase-general:t
jackalmage@5473 4076 sgml-general-insert-case:lower
jackalmage@5473 4077 sgml-always-quote-attributes:t
jackalmage@5473 4078 sgml-indent-step:nil
jackalmage@5473 4079 sgml-indent-data:t
jackalmage@5473 4080 sgml-parent-document:nil
jackalmage@5473 4081 sgml-exposed-tags:nil
jackalmage@5473 4082 sgml-local-catalogs:nil
jackalmage@5473 4083 sgml-local-ecat-files:nil
jackalmage@5473 4084 End:
jackalmage@5473 4085 -->

mercurial