CINXE.COM
CSS Syntax Module Level 3
<!doctype html><html lang="en"> <head> <meta content="text/html; charset=utf-8" http-equiv="Content-Type"> <meta content="width=device-width, initial-scale=1, shrink-to-fit=no" name="viewport"> <title>CSS Syntax Module Level 3</title> <meta content="ED" name="w3c-status"> <link href="https://www.w3.org/StyleSheets/TR/2021/W3C-ED" rel="stylesheet"> <meta content="Bikeshed version 742f3d674, updated Mon Nov 4 14:56:54 2024 -0800" name="generator"> <link href="https://www.w3.org/TR/css-syntax-3/" rel="canonical"> <link href="https://drafts.csswg.org/csslogo.ico" rel="icon"> <meta content="dbde8fabad3b9e7fb3b25413cb4293c8e9d527d8" name="revision"> <meta content="dark light" name="color-scheme"> <link href="https://www.w3.org/StyleSheets/TR/2021/dark.css" media="(prefers-color-scheme: dark)" rel="stylesheet" type="text/css"> <style> #serialization-tables th, #serialization-tables td { font-size: 80%; line-height: normal; padding: 0.5em; text-align: center; } </style> <style>/* Boilerplate: style-autolinks */ .css.css, .property.property, .descriptor.descriptor { color: var(--a-normal-text); font-size: inherit; font-family: inherit; } .css::before, .property::before, .descriptor::before { content: "‘"; } .css::after, .property::after, .descriptor::after { content: "’"; } .property, .descriptor { /* Don't wrap property and descriptor names */ white-space: nowrap; } .type { /* CSS value <type> */ font-style: italic; } pre .property::before, pre .property::after { content: ""; } [data-link-type="property"]::before, [data-link-type="propdesc"]::before, [data-link-type="descriptor"]::before, [data-link-type="value"]::before, [data-link-type="function"]::before, [data-link-type="at-rule"]::before, [data-link-type="selector"]::before, [data-link-type="maybe"]::before { content: "‘"; } [data-link-type="property"]::after, [data-link-type="propdesc"]::after, [data-link-type="descriptor"]::after, [data-link-type="value"]::after, [data-link-type="function"]::after, [data-link-type="at-rule"]::after, [data-link-type="selector"]::after, [data-link-type="maybe"]::after { content: "’"; } [data-link-type].production::before, [data-link-type].production::after, .prod [data-link-type]::before, .prod [data-link-type]::after { content: ""; } [data-link-type=element], [data-link-type=element-attr] { font-family: Menlo, Consolas, "DejaVu Sans Mono", monospace; font-size: .9em; } [data-link-type=element]::before { content: "<" } [data-link-type=element]::after { content: ">" } [data-link-type=biblio] { white-space: pre; } @media (prefers-color-scheme: dark) { :root { --selflink-text: black; --selflink-bg: silver; --selflink-hover-text: white; } } </style> <style>/* Boilerplate: style-colors */ /* Any --*-text not paired with a --*-bg is assumed to have a transparent bg */ :root { color-scheme: light dark; --text: black; --bg: white; --unofficial-watermark: url(https://www.w3.org/StyleSheets/TR/2016/logos/UD-watermark); --logo-bg: #1a5e9a; --logo-active-bg: #c00; --logo-text: white; --tocnav-normal-text: #707070; --tocnav-normal-bg: var(--bg); --tocnav-hover-text: var(--tocnav-normal-text); --tocnav-hover-bg: #f8f8f8; --tocnav-active-text: #c00; --tocnav-active-bg: var(--tocnav-normal-bg); --tocsidebar-text: var(--text); --tocsidebar-bg: #f7f8f9; --tocsidebar-shadow: rgba(0,0,0,.1); --tocsidebar-heading-text: hsla(203,20%,40%,.7); --toclink-text: var(--text); --toclink-underline: #3980b5; --toclink-visited-text: var(--toclink-text); --toclink-visited-underline: #054572; --heading-text: #005a9c; --hr-text: var(--text); --algo-border: #def; --del-text: red; --del-bg: transparent; --ins-text: #080; --ins-bg: transparent; --a-normal-text: #034575; --a-normal-underline: #bbb; --a-visited-text: var(--a-normal-text); --a-visited-underline: #707070; --a-hover-bg: rgba(75%, 75%, 75%, .25); --a-active-text: #c00; --a-active-underline: #c00; --blockquote-border: silver; --blockquote-bg: transparent; --blockquote-text: currentcolor; --issue-border: #e05252; --issue-bg: #fbe9e9; --issue-text: var(--text); --issueheading-text: #831616; --example-border: #e0cb52; --example-bg: #fcfaee; --example-text: var(--text); --exampleheading-text: #574b0f; --note-border: #52e052; --note-bg: #e9fbe9; --note-text: var(--text); --noteheading-text: hsl(120, 70%, 30%); --notesummary-underline: silver; --assertion-border: #aaa; --assertion-bg: #eee; --assertion-text: black; --advisement-border: orange; --advisement-bg: #fec; --advisement-text: var(--text); --advisementheading-text: #b35f00; --warning-border: red; --warning-bg: hsla(40,100%,50%,0.95); --warning-text: var(--text); --amendment-border: #330099; --amendment-bg: #F5F0FF; --amendment-text: var(--text); --amendmentheading-text: #220066; --def-border: #8ccbf2; --def-bg: #def; --def-text: var(--text); --defrow-border: #bbd7e9; --datacell-border: silver; --indexinfo-text: #707070; --indextable-hover-text: black; --indextable-hover-bg: #f7f8f9; --outdatedspec-bg: rgba(0, 0, 0, .5); --outdatedspec-text: black; --outdated-bg: maroon; --outdated-text: white; --outdated-shadow: red; --editedrec-bg: darkorange; } @media (prefers-color-scheme: dark) { :root { --text: #ddd; --bg: black; --unofficial-watermark: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='400' height='400'%3E%3Cg fill='%23100808' transform='translate(200 200) rotate(-45) translate(-200 -200)' stroke='%23100808' stroke-width='3'%3E%3Ctext x='50%25' y='220' style='font: bold 70px sans-serif; text-anchor: middle; letter-spacing: 6px;'%3EUNOFFICIAL%3C/text%3E%3Ctext x='50%25' y='305' style='font: bold 70px sans-serif; text-anchor: middle; letter-spacing: 6px;'%3EDRAFT%3C/text%3E%3C/g%3E%3C/svg%3E"); --logo-bg: #1a5e9a; --logo-active-bg: #c00; --logo-text: white; --tocnav-normal-text: #999; --tocnav-normal-bg: var(--bg); --tocnav-hover-text: var(--tocnav-normal-text); --tocnav-hover-bg: #080808; --tocnav-active-text: #f44; --tocnav-active-bg: var(--tocnav-normal-bg); --tocsidebar-text: var(--text); --tocsidebar-bg: #080808; --tocsidebar-shadow: rgba(255,255,255,.1); --tocsidebar-heading-text: hsla(203,20%,40%,.7); --toclink-text: var(--text); --toclink-underline: #6af; --toclink-visited-text: var(--toclink-text); --toclink-visited-underline: #054572; --heading-text: #8af; --hr-text: var(--text); --algo-border: #456; --del-text: #f44; --del-bg: transparent; --ins-text: #4a4; --ins-bg: transparent; --a-normal-text: #6af; --a-normal-underline: #555; --a-visited-text: var(--a-normal-text); --a-visited-underline: var(--a-normal-underline); --a-hover-bg: rgba(25%, 25%, 25%, .2); --a-active-text: #f44; --a-active-underline: var(--a-active-text); --borderedblock-bg: rgba(255, 255, 255, .05); --blockquote-border: silver; --blockquote-bg: var(--borderedblock-bg); --blockquote-text: currentcolor; --issue-border: #e05252; --issue-bg: var(--borderedblock-bg); --issue-text: var(--text); --issueheading-text: hsl(0deg, 70%, 70%); --example-border: hsl(50deg, 90%, 60%); --example-bg: var(--borderedblock-bg); --example-text: var(--text); --exampleheading-text: hsl(50deg, 70%, 70%); --note-border: hsl(120deg, 100%, 35%); --note-bg: var(--borderedblock-bg); --note-text: var(--text); --noteheading-text: hsl(120, 70%, 70%); --notesummary-underline: silver; --assertion-border: #444; --assertion-bg: var(--borderedblock-bg); --assertion-text: var(--text); --advisement-border: orange; --advisement-bg: #222218; --advisement-text: var(--text); --advisementheading-text: #f84; --warning-border: red; --warning-bg: hsla(40,100%,20%,0.95); --warning-text: var(--text); --amendment-border: #330099; --amendment-bg: #080010; --amendment-text: var(--text); --amendmentheading-text: #cc00ff; --def-border: #8ccbf2; --def-bg: #080818; --def-text: var(--text); --defrow-border: #136; --datacell-border: silver; --indexinfo-text: #aaa; --indextable-hover-text: var(--text); --indextable-hover-bg: #181818; --outdatedspec-bg: rgba(255, 255, 255, .5); --outdatedspec-text: black; --outdated-bg: maroon; --outdated-text: white; --outdated-shadow: red; --editedrec-bg: darkorange; } /* In case a transparent-bg image doesn't expect to be on a dark bg, which is quite common in practice... */ img { background: white; } } </style> <style>/* Boilerplate: style-counters */ body { counter-reset: example figure issue; } .issue { counter-increment: issue; } .issue:not(.no-marker)::before { content: "Issue " counter(issue); } .example { counter-increment: example; } .example:not(.no-marker)::before { content: "Example " counter(example); } .invalid.example:not(.no-marker)::before, .illegal.example:not(.no-marker)::before { content: "Invalid Example" counter(example); } figcaption { counter-increment: figure; } figcaption:not(.no-marker)::before { content: "Figure " counter(figure) " "; } </style> <style>/* Boilerplate: style-dfn-panel */ :root { --dfnpanel-bg: #ddd; --dfnpanel-text: var(--text); --dfnpanel-target-bg: #ffc; --dfnpanel-target-outline: orange; } @media (prefers-color-scheme: dark) { :root { --dfnpanel-bg: #222; --dfnpanel-text: var(--text); --dfnpanel-target-bg: #333; --dfnpanel-target-outline: silver; } } .dfn-panel { position: absolute; z-index: 35; width: 20em; width: 300px; height: auto; max-height: 500px; overflow: auto; padding: 0.5em 0.75em; font: small Helvetica Neue, sans-serif, Droid Sans Fallback; background: var(--dfnpanel-bg); color: var(--dfnpanel-text); border: outset 0.2em; white-space: normal; /* in case it's moved into a pre */ } .dfn-panel:not(.on) { display: none; } .dfn-panel * { margin: 0; padding: 0; text-indent: 0; } .dfn-panel > b { display: block; } .dfn-panel a { color: var(--dfnpanel-text); } .dfn-panel a:not(:hover) { text-decoration: none !important; border-bottom: none !important; } .dfn-panel a:focus { outline: 5px auto Highlight; outline: 5px auto -webkit-focus-ring-color; } .dfn-panel > b + b { margin-top: 0.25em; } .dfn-panel ul { padding: 0 0 0 1em; list-style: none; } .dfn-panel li a { max-width: calc(300px - 1.5em - 1em); overflow: hidden; text-overflow: ellipsis; } .dfn-panel.activated { display: inline-block; position: fixed; left: 8px; bottom: 2em; margin: 0 auto; max-width: calc(100vw - 1.5em - .4em - .5em); max-height: 30vh; transition: left 1s ease-out, bottom 1s ease-out; } .dfn-panel .link-item:hover { text-decoration: underline; } .dfn-panel .link-item .copy-icon { opacity: 0; } .dfn-panel .link-item:hover .copy-icon, .dfn-panel .link-item .copy-icon:focus { opacity: 1; } .dfn-panel .copy-icon { display: inline-block; margin-right: 0.5em; width: 0.85em; height: 1em; border-radius: 3px; background-color: #ccc; cursor: pointer; } .dfn-panel .copy-icon .icon { width: 100%; height: 100%; background-color: #fff; display: flex; justify-content: center; align-items: center; position: relative; } .dfn-panel .copy-icon .icon::before { content: ""; position: absolute; top: 0; left: 0; width: 100%; height: 100%; border: 1px solid black; background-color: #ccc; opacity: 0.25; transform: translate(3px, -3px); } .dfn-panel .copy-icon:active .icon::before { opacity: 1; } .dfn-paneled[role="button"] { cursor: help; } .highlighted { animation: target-fade 3s; } @keyframes target-fade { from { background-color: var(--dfnpanel-target-bg); outline: 5px solid var(--dfnpanel-target-outline); } to { color: var(--a-normal-text); background-color: transparent; outline: transparent; } } </style> <style>/* Boilerplate: style-issues */ a[href].issue-return { float: right; float: inline-end; color: var(--issueheading-text); font-weight: bold; text-decoration: none; } </style> <style>/* Boilerplate: style-md-lists */ /* This is a weird hack for me not yet following the commonmark spec regarding paragraph and lists. */ [data-md] > :first-child { margin-top: 0; } [data-md] > :last-child { margin-bottom: 0; } </style> <style>/* Boilerplate: style-railroad */ :root { --railroad-bg: hsl(30, 20%, 95%); --railroad-stroke: black; --railroad-fill: hsl(120,100%,90%); } svg.railroad-diagram { background-color: var(--railroad-bg); } svg.railroad-diagram path { stroke-width:3px; stroke: var(--railroad-stroke); fill:transparent; } svg.railroad-diagram text { font: bold 14px monospace; fill: var(--text, currentcolor); text-anchor:middle; } svg.railroad-diagram text.label { text-anchor:start; } svg.railroad-diagram text.comment { font:italic 12px monospace; } svg.railroad-diagram rect { stroke-width:3px; stroke: var(--railroad-stroke); fill: var(--railroad-fill); } @media (prefers-color-scheme: dark) { :root { --railroad-bg: rgba(255, 255, 255, .05); --railroad-stroke: #bbb; --railroad-fill: hsla(240deg, 20%, 15%); } } </style> <style>/* Boilerplate: style-ref-hints */ :root { --ref-hint-bg: #ddd; --ref-hint-text: var(--text); } @media (prefers-color-scheme: dark) { :root { --ref-hint-bg: #222; --ref-hint-text: var(--text); } } .ref-hint { display: inline-block; position: absolute; z-index: 35; width: 20em; width: 300px; height: auto; max-height: 500px; overflow: auto; padding: 0.5em 0.5em; font: small Helvetica Neue, sans-serif, Droid Sans Fallback; background: var(--ref-hint-bg); color: var(--ref-hint-text); border: outset 0.2em; white-space: normal; /* in case it's moved into a pre */ } .ref-hint * { margin: 0; padding: 0; text-indent: 0; } .ref-hint ul { padding: 0 0 0 1em; list-style: none; } </style> <style>/* Boilerplate: style-selflinks */ :root { --selflink-text: white; --selflink-bg: gray; --selflink-hover-text: black; } .heading, .issue, .note, .example, li, dt { position: relative; } a.self-link { position: absolute; top: 0; left: calc(-1 * (3.5rem - 26px)); width: calc(3.5rem - 26px); height: 2em; text-align: center; border: none; transition: opacity .2s; opacity: .5; } a.self-link:hover { opacity: 1; } .heading > a.self-link { font-size: 83%; } .example > a.self-link, .note > a.self-link, .issue > a.self-link { /* These blocks are overflow:auto, so positioning outside doesn't work. */ left: auto; right: 0; } li > a.self-link { left: calc(-1 * (3.5rem - 26px) - 2em); } dfn > a.self-link { top: auto; left: auto; opacity: 0; width: 1.5em; height: 1.5em; background: var(--selflink-bg); color: var(--selflink-text); font-style: normal; transition: opacity .2s, background-color .2s, color .2s; } dfn:hover > a.self-link { opacity: 1; } dfn > a.self-link:hover { color: var(--selflink-hover-text); } a.self-link::before { content: "¶"; } .heading > a.self-link::before { content: "§"; } dfn > a.self-link::before { content: "#"; } </style> <style>/* Boilerplate: style-var-click-highlighting */ /* Colors were chosen in Lab using https://nixsensor.com/free-color-converter/ D50 2deg illuminant, L in [0,100], a and b in [-128, 128] 0 = lab(85,0,85) 1 = lab(85,80,30) 2 = lab(85,-40,40) 3 = lab(85,-50,0) 4 = lab(85,5,15) 5 = lab(85,-10,-50) 6 = lab(85,35,-15) For darkmode: 0 = oklab(50% 0% 108%) 1 = oklab(50% -51% 51%) 2 = oklab(50% -64% -20%) 3 = oklab(50% 6% 19%) 4 = oklab(50% -12% -64%) 5 = oklab(50% 44% -19%) 6 = oklab(50% 102% 38%) */ [data-algorithm] var { cursor: pointer; } var[data-var-color] { background-color: var(--var-bg); box-shadow: 0 0 0 2px var(--var-bg); } var[data-var-color] { --var-bg: #F4D200; } var[data-var-color="1"] { --var-bg: #FF87A2; } var[data-var-color="2"] { --var-bg: #96E885; } var[data-var-color="3"] { --var-bg: #3EEED2; } var[data-var-color="4"] { --var-bg: #EACFB6; } var[data-var-color="5"] { --var-bg: #82DDFF; } var[data-var-color="6"] { --var-vg: #FFBCF2; } @media (prefers-color-scheme: dark) { var[data-var-color] { --var-bg: #bc1a00; } var[data-var-color="1"] { --var-bg: #007f00; } var[data-var-color="2"] { --var-bg: #008698; } var[data-var-color="3"] { --var-bg: #7f5b2b; } var[data-var-color="4"] { --var-bg: #004df3; } var[data-var-color="5"] { --var-bg: #a1248a; } var[data-var-color="6"] { --var-vg: #ff0000; } } </style> <style>/* Boilerplate: style-wpt */ :root { --wpt-border: hsl(0, 0%, 60%); --wpt-bg: hsl(0, 0%, 95%); --wpt-text: var(--text); --wptheading-text: hsl(0, 0%, 30%); } @media (prefers-color-scheme: dark) { :root { --wpt-border: hsl(0, 0%, 30%); --wpt-bg: var(--borderedblock-bg); --wpt-text: var(--text); --wptheading-text: hsl(0, 0%, 60%); } } .wpt-tests-block { list-style: none; border-left: .5em solid var(--wpt-border); background: var(--wpt-bg); color: var(--wpt-text); margin: 1em auto; padding: .5em; } .wpt-tests-block summary { color: var(--wptheading-text); font-weight: normal; text-transform: uppercase; } .wpt-tests-block summary::marker{ color: var(--wpt-border); } .wpt-tests-block summary:hover::marker{ color: var(--wpt-text); } /* The only content of a wpt test block in its closed state is the <summary>, which contains the word TESTS, and that is absolutely positioned. In that closed state, wpt test blocks are styled to have a top margin whose height is exactly equal to the height of the absolutely positioned <summary>, and no other background/padding/margin/border. The wpt test block elements will therefore allow the maring of the previous/next block elements to collapse through them; if this combined margin would be larger than its own top margin, it stays as is, and therefore the pre-existing vertical rhythm of the document is undisturbed. If that combined margin would be smaller, it is grown to that size. This means that the wpt test block ensures that there's always enough vertical space to insert the summary, without adding more than is needed. */ .wpt-tests-block:not([open]){ padding: 0; border: none; background: none; font-size: 0.75em; line-height: 1; position: relative; margin: 1em 0 0; } .wpt-tests-block:not([open]) summary { position: absolute; right: 0; bottom: 0; } /* It is possible that both the last child of a block element and the block element itself would be annotated with a <wpt> block each. If the block element has a padding or a border, that's fine, but otherwise the bottom margin of the block and of its last child would collapse and both <wpt> elements would overlap, being both placed there. To avoid that, add 1px of padding to the <wpt> element annotating the last child to prevent the bottom margin of the block and of its last child from collapsing (and as much negative margin, as wel only want to prevent margin collapsing, but are not trying to actually take more space). */ .wpt-tests-block:not([open]):last-child { padding-bottom: 1px; margin-bottom: -1px; } /* Exception to the previous rule: don't do that in non-last list items, because it's not necessary, and would therefore consume more space than strictly needed. Lists must have list items as children, not <wpt> elements, so a <wpt> element cannot be a sibling of a list item, and the collision that the previous rule avoids cannot happen. */ li:not(:last-child) > .wpt-tests-block:not([open]):last-child, dd:not(:last-child) > .wpt-tests-block:not([open]):last-child { padding-bottom: 0; margin-bottom: 0; } .wpt-tests-block:not([open]):not(:hover){ opacity: 0.5; } .wpt-tests-list { list-style: none; display: grid; margin: 0; padding: 0; grid-template-columns: 1fr max-content auto auto; grid-column-gap: .5em; } .wpt-tests-block hr:last-child { display: none; } .wpt-test { display: contents; } .wpt-test > a { text-decoration: underline; border: none; } .wpt-test > .wpt-name { grid-column: 1; } .wpt-test > .wpt-results { grid-column: 2; } .wpt-test > .wpt-live { grid-column: 3; } .wpt-test > .wpt-source { grid-column: 4; } .wpt-test > .wpt-results { display: flex; gap: .1em; } .wpt-test .wpt-result { display: inline-block; height: 1em; width: 1em; border-radius: 50%; position: relative; } </style> <body class="h-entry"> <div class="head"> <p data-fill-with="logo"><a class="logo" href="https://www.w3.org/"> <img alt="W3C" height="48" src="https://www.w3.org/StyleSheets/TR/2021/logos/W3C" width="72"> </a> </p> <h1 class="p-name no-ref" id="title">CSS Syntax Module Level 3</h1> <p id="w3c-state"><a href="https://www.w3.org/standards/types/#ED">Editor’s Draft</a>, <time class="dt-updated" datetime="2024-11-20">20 November 2024</time></p> <details open> <summary>More details about this document</summary> <div data-fill-with="spec-metadata"> <dl> <dt>This version: <dd><a class="u-url" href="https://drafts.csswg.org/css-syntax/">https://drafts.csswg.org/css-syntax/</a> <dt>Latest published version: <dd><a href="https://www.w3.org/TR/css-syntax-3/">https://www.w3.org/TR/css-syntax-3/</a> <dt>Previous Versions: <dd><a href="https://www.w3.org/TR/2019/CR-css-syntax-3-20190716/" rel="prev">https://www.w3.org/TR/2019/CR-css-syntax-3-20190716/</a> <dd><a href="https://www.w3.org/TR/2014/CR-css-syntax-3-20140220/" rel="prev">https://www.w3.org/TR/2014/CR-css-syntax-3-20140220/</a> <dd><a href="https://www.w3.org/TR/2013/WD-css-syntax-3-20131105/" rel="prev">https://www.w3.org/TR/2013/WD-css-syntax-3-20131105/</a> <dd><a href="https://www.w3.org/TR/2013/WD-css-syntax-3-20130919/" rel="prev">https://www.w3.org/TR/2013/WD-css-syntax-3-20130919/</a> <dt>Feedback: <dd><a href="https://github.com/w3c/csswg-drafts/labels/css-syntax-3">CSSWG Issues Repository</a> <dt class="editor">Editors: <dd class="editor p-author h-card vcard" data-editor-id="42199"><a class="p-name fn u-url url" href="http://xanthir.com/contact/">Tab Atkins Jr.</a> (<span class="p-org org">Google</span>) <dd class="editor p-author h-card vcard" data-editor-id="58001"><a class="p-name fn u-url url" href="http://exyr.org/about/">Simon Sapin</a> (<span class="p-org org">Mozilla</span>) <dt>Suggest an Edit for this Spec: <dd><a href="https://github.com/w3c/csswg-drafts/blob/main/css-syntax-3/Overview.bs">GitHub Editor</a> </dl> </div> </details> <div data-fill-with="warning"></div> <p class="copyright" data-fill-with="copyright"><a href="https://www.w3.org/policies/#copyright">Copyright</a> © 2024 <a href="https://www.w3.org/">World Wide Web Consortium</a>. <abbr title="World Wide Web Consortium">W3C</abbr><sup>®</sup> <a href="https://www.w3.org/policies/#Legal_Disclaimer">liability</a>, <a href="https://www.w3.org/policies/#W3C_Trademarks">trademark</a> and <a href="https://www.w3.org/copyright/software-license/" rel="license" title="W3C Software and Document License">permissive document license</a> rules apply. </p> <hr title="Separator for header"> </div> <div class="p-summary" data-fill-with="abstract"> <h2 class="no-num no-toc no-ref heading settled" id="abstract"><span class="content">Abstract</span></h2> <p>This module describes, in general terms, the basic structure and syntax of CSS stylesheets. It defines, in detail, the syntax and parsing of CSS - how to turn a stream of bytes into a meaningful stylesheet.</p> <a href="https://www.w3.org/TR/CSS/">CSS</a> is a language for describing the rendering of structured documents (such as HTML and XML) on screen, on paper, etc. <script> const githubPrefix = "https://w3c.github.io/csswg-drafts/"; if(location.href.slice(0, githubPrefix.length) == githubPrefix) { const suffix = location.href.slice(githubPrefix.length); const draftUrl = "https://drafts.csswg.org/" + suffix; window.location.replace(draftUrl); } </script> </div> <h2 class="no-num no-toc no-ref heading settled" id="sotd"><span class="content">Status of this document</span></h2> <div data-fill-with="status"> <p> This is a public copy of the editors’ draft. It is provided for discussion only and may change at any moment. Its publication here does not imply endorsement of its contents by W3C. Don’t cite this document other than as work in progress. </p> <p>Please send feedback by <a href="https://github.com/w3c/csswg-drafts/issues">filing issues in GitHub</a> (preferred), including the spec code “css-syntax” in the title, like this: “[css-syntax] <i>…summary of comment…</i>”. All issues and comments are <a href="https://lists.w3.org/Archives/Public/public-css-archive/">archived</a>. Alternately, feedback can be sent to the (<a href="https://lists.w3.org/Archives/Public/www-style/">archived</a>) public mailing list <a href="mailto:www-style@w3.org?Subject=%5Bcss-syntax%5D%20PUT%20SUBJECT%20HERE">www-style@w3.org</a>. </p> <p>This document is governed by the <a href="https://www.w3.org/policies/process/20231103/" id="w3c_process_revision">03 November 2023 W3C Process Document</a>. </p> <p></p> </div> <div data-fill-with="at-risk"></div> <nav data-fill-with="table-of-contents" id="toc"> <h2 class="no-num no-toc no-ref" id="contents">Table of Contents</h2> <ol class="toc" role="directory"> <li> <a href="#intro"><span class="secno">1</span> <span class="content"> Introduction</span></a> <ol class="toc"> <li><a href="#placement"><span class="secno">1.1</span> <span class="content"> Module interactions</span></a> </ol> <li> <a href="#syntax-description"><span class="secno">2</span> <span class="content"> Description of CSS’s Syntax</span></a> <ol class="toc"> <li><a href="#escaping"><span class="secno">2.1</span> <span class="content"> Escaping</span></a> <li><a href="#error-handling"><span class="secno">2.2</span> <span class="content"> Error Handling</span></a> </ol> <li> <a href="#tokenizing-and-parsing"><span class="secno">3</span> <span class="content"> Tokenizing and Parsing CSS</span></a> <ol class="toc"> <li><a href="#parsing-overview"><span class="secno">3.1</span> <span class="content"> Overview of the Parsing Model</span></a> <li><a href="#input-byte-stream"><span class="secno">3.2</span> <span class="content"> The input byte stream</span></a> <li><a href="#input-preprocessing"><span class="secno">3.3</span> <span class="content"> Preprocessing the input stream</span></a> </ol> <li> <a href="#tokenization"><span class="secno">4</span> <span class="content"> Tokenization</span></a> <ol class="toc"> <li><a href="#token-diagrams"><span class="secno">4.1</span> <span class="content"> Token Railroad Diagrams</span></a> <li><a href="#tokenizer-definitions"><span class="secno">4.2</span> <span class="content"> Definitions</span></a> <li> <a href="#tokenizer-algorithms"><span class="secno">4.3</span> <span class="content"> Tokenizer Algorithms</span></a> <ol class="toc"> <li><a href="#consume-token"><span class="secno">4.3.1</span> <span class="content"> Consume a token</span></a> <li><a href="#consume-comment"><span class="secno">4.3.2</span> <span class="content"> Consume comments</span></a> <li><a href="#consume-numeric-token"><span class="secno">4.3.3</span> <span class="content"> Consume a numeric token</span></a> <li><a href="#consume-ident-like-token"><span class="secno">4.3.4</span> <span class="content"> Consume an ident-like token</span></a> <li><a href="#consume-string-token"><span class="secno">4.3.5</span> <span class="content"> Consume a string token</span></a> <li><a href="#consume-url-token"><span class="secno">4.3.6</span> <span class="content"> Consume a url token</span></a> <li><a href="#consume-escaped-code-point"><span class="secno">4.3.7</span> <span class="content"> Consume an escaped code point</span></a> <li><a href="#starts-with-a-valid-escape"><span class="secno">4.3.8</span> <span class="content"> Check if two code points are a valid escape</span></a> <li><a href="#would-start-an-identifier"><span class="secno">4.3.9</span> <span class="content"> Check if three code points would start an ident sequence</span></a> <li><a href="#starts-with-a-number"><span class="secno">4.3.10</span> <span class="content"> Check if three code points would start a number</span></a> <li><a href="#starts-a-unicode-range"><span class="secno">4.3.11</span> <span class="content"> Check if three code points would start a unicode-range</span></a> <li><a href="#consume-name"><span class="secno">4.3.12</span> <span class="content"> Consume an ident sequence</span></a> <li><a href="#consume-number"><span class="secno">4.3.13</span> <span class="content"> Consume a number</span></a> <li><a href="#consume-unicode-range-token"><span class="secno">4.3.14</span> <span class="content"> Consume a unicode-range token</span></a> <li><a href="#consume-remnants-of-bad-url"><span class="secno">4.3.15</span> <span class="content"> Consume the remnants of a bad url</span></a> </ol> </ol> <li> <a href="#parsing"><span class="secno">5</span> <span class="content"> Parsing</span></a> <ol class="toc"> <li><a href="#parser-diagrams"><span class="secno">5.1</span> <span class="content"> Parser Railroad Diagrams</span></a> <li><a href="#css-tree"><span class="secno">5.2</span> <span class="content"> CSS Parsing Results</span></a> <li><a href="#parser-definitions"><span class="secno">5.3</span> <span class="content"> Token Streams</span></a> <li> <a href="#parser-entry-points"><span class="secno">5.4</span> <span class="content"> Parser Entry Points</span></a> <ol class="toc"> <li><a href="#parse-grammar"><span class="secno">5.4.1</span> <span class="content"> Parse something according to a CSS grammar</span></a> <li><a href="#parse-comma-list"><span class="secno">5.4.2</span> <span class="content"> Parse a comma-separated list according to a CSS grammar</span></a> <li><a href="#parse-stylesheet"><span class="secno">5.4.3</span> <span class="content"> Parse a stylesheet</span></a> <li><a href="#parse-stylesheet-contents"><span class="secno">5.4.4</span> <span class="content"> Parse a stylesheet’s contents</span></a> <li><a href="#parse-block-contents"><span class="secno">5.4.5</span> <span class="content"> Parse a block’s contents</span></a> <li><a href="#parse-rule"><span class="secno">5.4.6</span> <span class="content"> Parse a rule</span></a> <li><a href="#parse-declaration"><span class="secno">5.4.7</span> <span class="content"> Parse a declaration</span></a> <li><a href="#parse-component-value"><span class="secno">5.4.8</span> <span class="content"> Parse a component value</span></a> <li><a href="#parse-list-of-component-values"><span class="secno">5.4.9</span> <span class="content"> Parse a list of component values</span></a> <li><a href="#parse-comma-separated-list-of-component-values"><span class="secno">5.4.10</span> <span class="content"> Parse a comma-separated list of component values</span></a> </ol> <li> <a href="#parser-algorithms"><span class="secno">5.5</span> <span class="content"> Parser Algorithms</span></a> <ol class="toc"> <li><a href="#consume-stylesheet-contents"><span class="secno">5.5.1</span> <span class="content"> Consume a stylesheet’s contents</span></a> <li><a href="#consume-at-rule"><span class="secno">5.5.2</span> <span class="content"> Consume an at-rule</span></a> <li><a href="#consume-qualified-rule"><span class="secno">5.5.3</span> <span class="content"> Consume a qualified rule</span></a> <li><a href="#consume-block"><span class="secno">5.5.4</span> <span class="content"> Consume a block</span></a> <li><a href="#consume-block-contents"><span class="secno">5.5.5</span> <span class="content"> Consume a block’s contents</span></a> <li><a href="#consume-declaration"><span class="secno">5.5.6</span> <span class="content"> Consume a declaration</span></a> <li><a href="#consume-list-of-components"><span class="secno">5.5.7</span> <span class="content"> Consume a list of component values</span></a> <li><a href="#consume-component-value"><span class="secno">5.5.8</span> <span class="content"> Consume a component value</span></a> <li><a href="#consume-simple-block"><span class="secno">5.5.9</span> <span class="content"> Consume a simple block</span></a> <li><a href="#consume-function"><span class="secno">5.5.10</span> <span class="content"> Consume a function</span></a> <li><a href="#consume-unicode-range-value"><span class="secno">5.5.11</span> <span class="content"> Consume a <span class="property">unicode-range</span> value</span></a> </ol> </ol> <li> <a href="#anb-microsyntax"><span class="secno">6</span> <span class="content"> The <var>An+B</var> microsyntax</span></a> <ol class="toc"> <li><a href="#anb-syntax"><span class="secno">6.1</span> <span class="content"> Informal Syntax Description</span></a> <li><a href="#the-anb-type"><span class="secno">6.2</span> <span class="content"> The <code><an+b></code> type</span></a> </ol> <li> <a href="#rule-defs"><span class="secno">7</span> <span class="content"> Defining Grammars for Rules and Other Values</span></a> <ol class="toc"> <li><a href="#block-contents"><span class="secno">7.1</span> <span class="content"> Defining Block Contents: the <span class="production"><block-contents></span>, <span class="production"><declaration-list></span>, <span class="production"><qualified-rule-list></span>, <span class="production"><declaration-rule-list></span>, and <span class="production"><rule-list></span> productions</span></a> <li><a href="#any-value"><span class="secno">7.2</span> <span class="content"> Defining Arbitrary Contents: the <span class="production"><declaration-value></span> and <span class="production"><any-value></span> productions</span></a> </ol> <li> <a href="#css-stylesheets"><span class="secno">8</span> <span class="content"> CSS stylesheets</span></a> <ol class="toc"> <li><a href="#style-rules"><span class="secno">8.1</span> <span class="content"> Style rules</span></a> <li><a href="#at-rules"><span class="secno">8.2</span> <span class="content"> At-rules</span></a> <li><a href="#charset-rule"><span class="secno">8.3</span> <span class="content"> The <span class="css">@charset</span> Rule</span></a> </ol> <li> <a href="#serialization"><span class="secno">9</span> <span class="content"> Serialization</span></a> <ol class="toc"> <li><a href="#serializing-anb"><span class="secno">9.1</span> <span class="content"> Serializing <var><an+b></var></span></a> </ol> <li><a href="#privacy"><span class="secno">10</span> <span class="content"> Privacy Considerations</span></a> <li><a href="#security"><span class="secno">11</span> <span class="content"> Security Considerations</span></a> <li> <a href="#changes"><span class="secno">12</span> <span class="content"> Changes</span></a> <ol class="toc"> <li><a href="#changes-CR-20211224"><span class="secno">12.1</span> <span class="content"> Changes from the 24 December 2021 Candidate Recommendation Draft</span></a> <li><a href="#changes-CR-20190716"><span class="secno">12.2</span> <span class="content"> Changes from the 16 August 2019 Candidate Recommendation</span></a> <li><a href="#changes-CR-20140220"><span class="secno">12.3</span> <span class="content"> Changes from the 20 February 2014 Candidate Recommendation</span></a> <li><a href="#changes-WD-20131105"><span class="secno">12.4</span> <span class="content"> Changes from the 5 November 2013 Last Call Working Draft</span></a> <li><a href="#changes-WD-20130919"><span class="secno">12.5</span> <span class="content"> Changes from the 19 September 2013 Working Draft</span></a> <li><a href="#changes-css21"><span class="secno">12.6</span> <span class="content"> Changes from CSS 2.1 and Selectors Level 3</span></a> </ol> <li><a href="#acknowledgments"><span class="secno"></span> <span class="content"> Acknowledgments</span></a> <li> <a href="#w3c-conformance"><span class="secno"></span> <span class="content"> Conformance</span></a> <ol class="toc"> <li><a href="#w3c-conventions"><span class="secno"></span> <span class="content"> Document conventions</span></a> <li><a href="#w3c-conformance-classes"><span class="secno"></span> <span class="content"> Conformance classes</span></a> <li> <a href="#w3c-partial"><span class="secno"></span> <span class="content"> Partial implementations</span></a> <ol class="toc"> <li><a href="#w3c-conform-future-proofing"><span class="secno"></span> <span class="content"> Implementations of Unstable and Proprietary Features</span></a> </ol> <li><a href="#w3c-testing"><span class="secno"></span> <span class="content"> Non-experimental implementations</span></a> </ol> <li> <a href="#index"><span class="secno"></span> <span class="content">Index</span></a> <ol class="toc"> <li><a href="#index-defined-here"><span class="secno"></span> <span class="content">Terms defined by this specification</span></a> <li><a href="#index-defined-elsewhere"><span class="secno"></span> <span class="content">Terms defined by reference</span></a> </ol> <li> <a href="#references"><span class="secno"></span> <span class="content">References</span></a> <ol class="toc"> <li><a href="#normative"><span class="secno"></span> <span class="content">Normative References</span></a> <li><a href="#informative"><span class="secno"></span> <span class="content">Informative References</span></a> </ol> </ol> </nav> <main> <h2 class="heading settled" data-level="1" id="intro"><span class="secno">1. </span><span class="content"> Introduction</span><a class="self-link" href="#intro"></a></h2> <p><em>This section is not normative.</em></p> <p>This module defines the abstract syntax and parsing of CSS stylesheets and other things which use CSS syntax (such as the HTML <code>style</code> attribute).</p> <p>It defines algorithms for converting a stream of Unicode <a data-link-type="dfn" href="https://infra.spec.whatwg.org/#code-point" id="ref-for-code-point">code points</a> (in other words, text) into a stream of CSS tokens, and then further into CSS objects such as stylesheets, rules, and declarations.</p> <h3 class="heading settled" data-level="1.1" id="placement"><span class="secno">1.1. </span><span class="content"> Module interactions</span><a class="self-link" href="#placement"></a></h3> <p>This module defines the syntax and parsing of CSS stylesheets. It supersedes the lexical scanner and grammar defined in CSS 2.1.</p> <h2 class="heading settled" data-level="2" id="syntax-description"><span class="secno">2. </span><span class="content"> Description of CSS’s Syntax</span><a class="self-link" href="#syntax-description"></a></h2> <p><em>This section is not normative.</em></p> <p>A CSS document is a series of <a data-link-type="dfn" href="#style-rule" id="ref-for-style-rule">style rules</a>—which are <a data-link-type="dfn" href="#qualified-rule" id="ref-for-qualified-rule">qualified rules</a> that apply styles to elements in a document—and <a data-link-type="dfn" href="#at-rule" id="ref-for-at-rule">at-rules</a>—which define special processing rules or values for the CSS document.</p> <p>A <a data-link-type="dfn" href="#qualified-rule" id="ref-for-qualified-rule①">qualified rule</a> starts with a prelude then has a {}-wrapped block containing a sequence of declarations. The meaning of the prelude varies based on the context that the rule appears in—for <a data-link-type="dfn" href="#style-rule" id="ref-for-style-rule①">style rules</a>, it’s a selector which specifies what elements the declarations will apply to. Each declaration has a name, followed by a colon and the declaration value. Declarations are separated by semicolons.</p> <div class="example" id="example-0ffd6a46"> <a class="self-link" href="#example-0ffd6a46"></a> <p>A typical rule might look something like this:</p> <pre>p > a { color: blue; text-decoration: underline; } </pre> <p>In the above rule, "<code>p > a</code>" is the selector, which, if the source document is HTML, selects any <code><a data-link-type="element" href="https://html.spec.whatwg.org/multipage/text-level-semantics.html#the-a-element" id="ref-for-the-a-element">a</a></code> elements that are children of a <code><a data-link-type="element" href="https://html.spec.whatwg.org/multipage/grouping-content.html#the-p-element" id="ref-for-the-p-element">p</a></code> element.</p> <p>"<code>color: blue</code>" is a declaration specifying that, for the elements that match the selector, their <a class="property css" data-link-type="property" href="https://drafts.csswg.org/css-color-4/#propdef-color" id="ref-for-propdef-color">color</a> property should have the value <a class="css" data-link-type="maybe" href="https://drafts.csswg.org/css-color-4/#valdef-color-blue" id="ref-for-valdef-color-blue">blue</a>. Similarly, their <a class="property css" data-link-type="property" href="https://drafts.csswg.org/css-text-decor-3/#propdef-text-decoration" id="ref-for-propdef-text-decoration">text-decoration</a> property should have the value <a class="css" data-link-type="maybe" href="https://drafts.csswg.org/css-text-decor-4/#valdef-text-decoration-line-underline" id="ref-for-valdef-text-decoration-line-underline">underline</a>.</p> </div> <p><a data-link-type="dfn" href="#at-rule" id="ref-for-at-rule①">At-rules</a> are all different, but they have a basic structure in common. They start with an "@" <a data-link-type="dfn" href="https://infra.spec.whatwg.org/#code-point" id="ref-for-code-point①">code point</a> followed by their name as a CSS keyword. Some <span id="ref-for-at-rule②">at-rules</span> are simple statements, with their name followed by more CSS values to specify their behavior, and finally ended by a semicolon. Others are blocks; they can have CSS values following their name, but they end with a {}-wrapped block, similar to a <a data-link-type="dfn" href="#qualified-rule" id="ref-for-qualified-rule②">qualified rule</a>. Even the contents of these blocks are specific to the given <span id="ref-for-at-rule③">at-rule</span>: sometimes they contain a sequence of declarations, like a <span id="ref-for-qualified-rule③">qualified rule</span>; other times, they may contain additional blocks, or at-rules, or other structures altogether.</p> <div class="example" id="example-42888746"> <a class="self-link" href="#example-42888746"></a> <p>Here are several examples of <a data-link-type="dfn" href="#at-rule" id="ref-for-at-rule④">at-rules</a> that illustrate the varied syntax they may contain.</p> <pre>@import "my-styles.css";</pre> <p>The <a class="css" data-link-type="maybe" href="https://drafts.csswg.org/css-cascade-5/#at-ruledef-import" id="ref-for-at-ruledef-import">@import</a> <a data-link-type="dfn" href="#at-rule" id="ref-for-at-rule⑤">at-rule</a> is a simple statement. After its name, it takes a single string or <a class="css" data-link-type="maybe" href="https://drafts.csswg.org/css-values-4/#funcdef-url" id="ref-for-funcdef-url">url()</a> function to indicate the stylesheet that it should import.</p> <pre>@page :left { margin-left: 4cm; margin-right: 3cm; } </pre> <p>The <a class="css" data-link-type="maybe" href="https://drafts.csswg.org/css-page-3/#at-ruledef-page" id="ref-for-at-ruledef-page">@page</a> <a data-link-type="dfn" href="#at-rule" id="ref-for-at-rule⑥">at-rule</a> consists of an optional page selector (the <a class="css" data-link-type="maybe" href="https://drafts.csswg.org/css-page-3/#valdef-page-left" id="ref-for-valdef-page-left">:left</a> pseudoclass), followed by a block of properties that apply to the page when printed. In this way, it’s very similar to a normal style rule, except that its properties don’t apply to any "element", but rather the page itself.</p> <pre>@media print { body { font-size: 10pt } } </pre> <p>The <a class="css" data-link-type="maybe" href="https://drafts.csswg.org/css-conditional-3/#at-ruledef-media" id="ref-for-at-ruledef-media">@media</a> <a data-link-type="dfn" href="#at-rule" id="ref-for-at-rule⑦">at-rule</a> begins with a media type and a list of optional media queries. Its block contains entire rules, which are only applied when the <span class="css" id="ref-for-at-ruledef-media①">@media</span>s conditions are fulfilled.</p> </div> <p>Property names and <a data-link-type="dfn" href="#at-rule" id="ref-for-at-rule⑧">at-rule</a> names are always <a data-link-type="dfn" href="#ident-sequence" id="ref-for-ident-sequence">ident sequences</a>, which have to start with an <a data-link-type="dfn" href="#ident-start-code-point" id="ref-for-ident-start-code-point">ident-start code point</a>, two hyphens, or a hyphen followed by an ident-start code point, and then can contain zero or more <a data-link-type="dfn" href="#ident-code-point" id="ref-for-ident-code-point">ident code points</a>. You can include any <a data-link-type="dfn" href="https://infra.spec.whatwg.org/#code-point" id="ref-for-code-point②">code point</a> at all, even ones that CSS uses in its syntax, by <a data-link-type="dfn" href="#escape-codepoint" id="ref-for-escape-codepoint">escaping</a> it.</p> <p>The syntax of selectors is defined in the <a href="https://www.w3.org/TR/selectors/">Selectors spec</a>. Similarly, the syntax of the wide variety of CSS values is defined in the <a href="https://www.w3.org/TR/css3-values/">Values & Units spec</a>. The special syntaxes of individual <a data-link-type="dfn" href="#at-rule" id="ref-for-at-rule⑨">at-rules</a> can be found in the specs that define them.</p> <h3 class="heading settled" data-level="2.1" id="escaping"><span class="secno">2.1. </span><span class="content"> Escaping</span><a class="self-link" href="#escaping"></a></h3> <p><em>This section is not normative.</em></p> <p>Any Unicode <a data-link-type="dfn" href="https://infra.spec.whatwg.org/#code-point" id="ref-for-code-point③">code point</a> can be included in an <a data-link-type="dfn" href="#ident-sequence" id="ref-for-ident-sequence①">ident sequence</a> or quoted string by <dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport id="escape-codepoint">escaping</dfn> it. CSS escape sequences start with a backslash (\), and continue with:</p> <ul> <li> Any Unicode <a data-link-type="dfn" href="https://infra.spec.whatwg.org/#code-point" id="ref-for-code-point④">code point</a> that is not a <a data-link-type="dfn" href="#hex-digit" id="ref-for-hex-digit">hex digits</a> or a <a data-link-type="dfn" href="#newline" id="ref-for-newline">newline</a>. The escape sequence is replaced by that <span id="ref-for-code-point⑤">code point</span>. <li> Or one to six <a data-link-type="dfn" href="#hex-digit" id="ref-for-hex-digit①">hex digits</a>, followed by an optional <a data-link-type="dfn" href="#whitespace" id="ref-for-whitespace">whitespace</a>. The escape sequence is replaced by the Unicode <a data-link-type="dfn" href="https://infra.spec.whatwg.org/#code-point" id="ref-for-code-point⑥">code point</a> whose value is given by the hexadecimal digits. This optional whitespace allow hexadecimal escape sequences to be followed by "real" hex digits. <p class="example" id="example-cc2d6518"><a class="self-link" href="#example-cc2d6518"></a> An <a data-link-type="dfn" href="#ident-sequence" id="ref-for-ident-sequence②">ident sequence</a> with the value "&B" could be written as <span class="css">\26 B</span> or <span class="css">\000026B</span>. </p> <p class="note" role="note"> A "real" space after the escape sequence must be doubled. </p> </ul> <h3 class="heading settled" data-level="2.2" id="error-handling"><span class="secno">2.2. </span><span class="content"> Error Handling</span><a class="self-link" href="#error-handling"></a></h3> <p><em>This section is not normative.</em></p> <p>When errors occur in CSS, the parser attempts to recover gracefully, throwing away only the minimum amount of content before returning to parsing as normal. This is because errors aren’t always mistakes—new syntax looks like an error to an old parser, and it’s useful to be able to add new syntax to the language without worrying about stylesheets that include it being completely broken in older UAs.</p> <p>The precise error-recovery behavior is detailed in the parser itself, but it’s simple enough that a short description is fairly accurate.</p> <ul> <li> At the "top level" of a stylesheet, an <a class="production css" data-link-type="type" href="#typedef-at-keyword-token" id="ref-for-typedef-at-keyword-token"><at-keyword-token></a> starts an at-rule. Anything else starts a qualified rule, and is included in the rule’s prelude. This may produce an invalid selector, but that’s not the concern of the CSS parser—at worst, it means the selector will match nothing. <li> Once an at-rule starts, nothing is invalid from the parser’s standpoint; it’s all part of the at-rule’s prelude. Encountering a <a class="production css" data-link-type="type" href="#typedef-semicolon-token" id="ref-for-typedef-semicolon-token"><semicolon-token></a> ends the at-rule immediately, while encountering an opening curly-brace <a href="#tokendef-open-curly" id="ref-for-tokendef-open-curly"><{-token></a> starts the at-rule’s body. The at-rule seeks forward, matching blocks (content surrounded by (), {}, or []) until it finds a closing curly-brace <a href="#tokendef-close-curly" id="ref-for-tokendef-close-curly"><}-token></a> that isn’t matched by anything else or inside of another block. The contents of the at-rule are then interpreted according to the at-rule’s own grammar. <li> Qualified rules work similarly, except that semicolons don’t end them; instead, they are just taken in as part of the rule’s prelude. When the first {} block is found, the contents are always interpreted as a list of declarations. <li> When interpreting a list of declarations, unknown syntax at any point causes the parser to throw away whatever declaration it’s currently building, and seek forward until it finds a semicolon (or the end of the block). It then starts fresh, trying to parse a declaration again. <li id="autoclosing"> <a class="self-link" href="#autoclosing"></a> If the stylesheet ends while any rule, declaration, function, string, etc. are still open, everything is automatically closed. This doesn’t make them invalid, though they may be incomplete and thus thrown away when they are verified against their grammar. <div class="example" id="example-84a0b91f"> <a class="self-link" href="#example-84a0b91f"></a> For example, the syntax of the <a class="css" data-link-type="maybe" href="https://drafts.csswg.org/css-transforms-1/#funcdef-transform-translatex" id="ref-for-funcdef-transform-translatex">translateX()</a> function is: <pre>translateX( <a class="production" data-link-type="type"><translation-value></a> )</pre> <p>However, the stylesheet may end with the function unclosed, like:</p> <pre>.foo { transform: translate(50px</pre> <p>The CSS parser parses this as a style rule containing one declaration, whose value is a function named "translate". This matches the above grammar, even though the ending token didn’t appear in the token stream, because by the time the parser is finished, the presence of the ending token is no longer possible to determine; all you have is the fact that there’s a block and a function.</p> </div> </ul> <p>After each construct (declaration, style rule, at-rule) is parsed, the user agent checks it against its expected grammar. If it does not match the grammar, it’s <dfn class="dfn-paneled" data-dfn-for="css" data-dfn-type="dfn" data-export id="css-invalid">invalid</dfn>, and gets <dfn class="dfn-paneled" data-dfn-for="css" data-dfn-type="dfn" data-export id="css-ignored">ignored</dfn> by the UA, which treats it as if it wasn’t there at all.</p> <h2 class="heading settled" data-level="3" id="tokenizing-and-parsing"><span class="secno">3. </span><span class="content"> Tokenizing and Parsing CSS</span><a class="self-link" href="#tokenizing-and-parsing"></a></h2> <p>User agents must use the parsing rules described in this specification to generate the <a data-link-type="biblio" href="#biblio-cssom" title="CSS Object Model (CSSOM)">[CSSOM]</a> trees from text/css resources. Together, these rules define what is referred to as the CSS parser.</p> <p>This specification defines the parsing rules for CSS documents, whether they are syntactically correct or not. Certain points in the parsing algorithm are said to be <dfn class="dfn-paneled" data-dfn-type="dfn" data-lt="parse error" data-noexport id="parse-error">parse errors</dfn>. The error handling for parse errors is well-defined: user agents must either act as described below when encountering such problems, or must abort processing at the first error that they encounter for which they do not wish to apply the rules described below.</p> <p>Conformance checkers must report at least one parse error condition to the user if one or more parse error conditions exist in the document and must not report parse error conditions if none exist in the document. Conformance checkers may report more than one parse error condition if more than one parse error condition exists in the document. Conformance checkers are not required to recover from parse errors, but if they do, they must recover in the same way as user agents.</p> <h3 class="heading settled" data-level="3.1" id="parsing-overview"><span class="secno">3.1. </span><span class="content"> Overview of the Parsing Model</span><a class="self-link" href="#parsing-overview"></a></h3> <p>The input to the CSS parsing process consists of a stream of Unicode <a data-link-type="dfn" href="https://infra.spec.whatwg.org/#code-point" id="ref-for-code-point⑦">code points</a>, which is passed through a tokenization stage followed by a tree construction stage. The output is a CSSStyleSheet object.</p> <p class="note" role="note"><span class="marker">Note:</span> Implementations that do not support scripting do not have to actually create a CSSOM CSSStyleSheet object, but the CSSOM tree in such cases is still used as the model for the rest of the specification.</p> <h3 class="heading settled" data-level="3.2" id="input-byte-stream"><span class="secno">3.2. </span><span class="content"> The input byte stream</span><a class="self-link" href="#input-byte-stream"></a></h3> <p>When parsing a stylesheet, the stream of Unicode <a data-link-type="dfn" href="https://infra.spec.whatwg.org/#code-point" id="ref-for-code-point⑧">code points</a> that comprises the input to the tokenization stage might be initially seen by the user agent as a stream of bytes (typically coming over the network or from the local file system). If so, the user agent must decode these bytes into <span id="ref-for-code-point⑨">code points</span> according to a particular character encoding.</p> <div class="algorithm" data-algorithm="decode bytes" data-algorithm-for="CSS"> To <dfn class="dfn-paneled" data-dfn-for="CSS" data-dfn-type="dfn" data-lt="decode bytes" data-noexport id="css-decode-bytes">decode</dfn> a <var>stylesheet</var>’s stream of bytes into a stream of <a data-link-type="dfn" href="https://infra.spec.whatwg.org/#code-point" id="ref-for-code-point①⓪">code points</a>: <ol> <li data-md> <p><a data-link-type="dfn" href="#determine-the-fallback-encoding" id="ref-for-determine-the-fallback-encoding">Determine the fallback encoding</a> of <var>stylesheet</var>, and let <var>fallback</var> be the result.</p> <li data-md> <p><a data-link-type="dfn" href="https://encoding.spec.whatwg.org/#decode" id="ref-for-decode">Decode</a> <var>stylesheet</var>’s stream of bytes with fallback encoding <var>fallback</var>, and return the result.</p> </ol> <p class="note" role="note"><span class="marker">Note:</span> The <a data-link-type="dfn" href="https://encoding.spec.whatwg.org/#decode" id="ref-for-decode①">decode</a> algorithm gives precedence to a byte order mark (BOM), and only uses the fallback when none is found.</p> </div> <div class="algorithm" data-algorithm="determine the fallback encoding"> To <dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport id="determine-the-fallback-encoding">determine the fallback encoding</dfn> of a <var>stylesheet</var>: <ol> <li> If HTTP or equivalent protocol provides an <var>encoding label</var> (e.g. via the charset parameter of the Content-Type header) for the <var>stylesheet</var>, <a data-link-type="dfn" href="https://encoding.spec.whatwg.org/#concept-encoding-get" id="ref-for-concept-encoding-get">get an encoding</a> from <var>encoding label</var>. If that does not return failure, return it. <li> Otherwise, check <var>stylesheet</var>’s byte stream. If the first 1024 bytes of the stream begin with the hex sequence <pre>40 63 68 61 72 73 65 74 20 22 XX* 22 3B</pre> <p>where each <code>XX</code> byte is a value between 0<sub>16</sub> and 21<sub>16</sub> inclusive or a value between 23<sub>16</sub> and 7F<sub>16</sub> inclusive, then <a data-link-type="dfn" href="https://encoding.spec.whatwg.org/#concept-encoding-get" id="ref-for-concept-encoding-get①">get an encoding</a> from a string formed out of the sequence of <code>XX</code> bytes, interpreted as <code>ASCII</code>.</p> <details class="note"> <summary>What does that byte sequence mean?</summary> <p>The byte sequence above, when decoded as ASCII, is the string "<code>@charset "…";</code>", where the "…" is the sequence of bytes corresponding to the encoding’s label.</p> </details> <p>If the return value was <code>utf-16be</code> or <code>utf-16le</code>, return <code>utf-8</code>; if it was anything else except failure, return it.</p> <details class="note"> <summary>Why use utf-8 when the declaration says utf-16?</summary> <p>The bytes of the encoding declaration spell out “<code>@charset "…";</code>” in ASCII, but UTF-16 is not ASCII-compatible. Either you’ve typed in complete gibberish (like <code>䁣桡牳整•utf-16be∻</code>) to get the right bytes in the document, which we don’t want to encourage, or your document is actually in an ASCII-compatible encoding and your encoding declaration is lying.</p> <p>Either way, defaulting to UTF-8 is a decent answer.</p> <p>As well, this mimics the behavior of HTML’s <code><meta charset></code> attribute.</p> </details> <p class="note" role="note"><span class="marker">Note:</span> Note that the syntax of an encoding declaration <em>looks like</em> the syntax of an <a data-link-type="dfn" href="#at-rule" id="ref-for-at-rule①⓪">at-rule</a> named <a class="css" data-link-type="maybe" href="#at-ruledef-charset" id="ref-for-at-ruledef-charset">@charset</a>, but no such rule actually exists, and the rules for how you can write it are much more restrictive than they would normally be for recognizing such a rule. A number of things you can do in CSS that would produce a valid <span class="css" id="ref-for-at-ruledef-charset①">@charset</span> rule (if one existed), such as using multiple spaces, comments, or single quotes, will cause the encoding declaration to not be recognized. This behavior keeps the encoding declaration as simple as possible, and thus maximizes the likelihood of it being implemented correctly.</p> <li> Otherwise, if an <a data-link-type="dfn" href="#environment-encoding" id="ref-for-environment-encoding">environment encoding</a> is provided by the referring document, return it. <li> Otherwise, return <code>utf-8</code>. </ol> <div class="note" role="note"> <p>Though UTF-8 is the default encoding for the web, and many newer web-based file formats assume or require UTF-8 encoding, CSS was created before it was clear which encoding would win, and thus can’t automatically assume the stylesheet is UTF-8.</p> <p>Stylesheet authors <em>should</em> author their stylesheets in UTF-8, and ensure that either an HTTP header (or equivalent method) declares the encoding of the stylesheet to be UTF-8, or that the referring document declares its encoding to be UTF-8. (In HTML, this is done by adding a <code><meta charset=utf-8></code> element to the head of the document.)</p> <p>If neither of these options are available, authors should begin the stylesheet with a UTF-8 BOM or the exact characters</p> <pre>@charset "utf-8";</pre> </div> </div> <p>Document languages that refer to CSS stylesheets that are decoded from bytes may define an <dfn class="dfn-paneled" data-dfn-type="dfn" data-export id="environment-encoding">environment encoding</dfn> for each such stylesheet, which is used as a fallback when other encoding hints are not available or can not be used.</p> <p>The concept of <a data-link-type="dfn" href="#environment-encoding" id="ref-for-environment-encoding①">environment encoding</a> only exists for compatibility with legacy content. New formats and new linking mechanisms <b>should not</b> provide an <span id="ref-for-environment-encoding②">environment encoding</span>, so the stylesheet defaults to UTF-8 instead in the absence of more explicit information.</p> <p class="note" role="note"><span class="marker">Note:</span> <a data-link-type="biblio" href="#biblio-html" title="HTML Standard">[HTML]</a> defines <a href="https://html.spec.whatwg.org/multipage/links.html#link-type-stylesheet">the environment encoding for <code><link rel=stylesheet></code></a>.</p> <p class="note" role="note"><span class="marker">Note:</span> <a data-link-type="biblio" href="#biblio-cssom" title="CSS Object Model (CSSOM)">[CSSOM]</a> defines <a href="https://drafts.csswg.org/cssom/#requirements-on-user-agents-implementing-the-xml-stylesheet-processing-instruction">the environment encoding for <code><xml-stylesheet?></code></a>.</p> <p class="note" role="note"><span class="marker">Note:</span> <a data-link-type="biblio" href="#biblio-css-cascade-3" title="CSS Cascading and Inheritance Level 3">[CSS-CASCADE-3]</a> defines <a class="css" data-link-type="at-rule" href="https://drafts.csswg.org/css-cascade-5/#at-ruledef-import" id="ref-for-at-ruledef-import①">the environment encoding for <code>@import</code></a>.</p> <h3 class="heading settled" data-level="3.3" id="input-preprocessing"><span class="secno">3.3. </span><span class="content"> Preprocessing the input stream</span><a class="self-link" href="#input-preprocessing"></a></h3> <p>The <dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport id="input-stream">input stream</dfn> consists of the <a data-link-type="dfn" href="#css-filter-code-points" id="ref-for-css-filter-code-points">filtered code points</a> pushed into it as the input byte stream is decoded.</p> <div class="algorithm" data-algorithm="filter code points" data-algorithm-for="CSS"> To <dfn class="dfn-paneled" data-dfn-for="CSS" data-dfn-type="dfn" data-lt="filter code points|filtered code points" data-noexport id="css-filter-code-points">filter code points</dfn> from a stream of (unfiltered) <a data-link-type="dfn" href="https://infra.spec.whatwg.org/#code-point" id="ref-for-code-point①①">code points</a> <var>input</var>: <ul> <li> Replace any U+000D CARRIAGE RETURN (CR) <a data-link-type="dfn" href="https://infra.spec.whatwg.org/#code-point" id="ref-for-code-point①②">code points</a>, U+000C FORM FEED (FF) <span id="ref-for-code-point①③">code points</span>, or pairs of U+000D CARRIAGE RETURN (CR) followed by U+000A LINE FEED (LF) in <var>input</var> by a single U+000A LINE FEED (LF) <span id="ref-for-code-point①④">code point</span>. <li> Replace any U+0000 NULL or <a data-link-type="dfn" href="https://infra.spec.whatwg.org/#surrogate" id="ref-for-surrogate">surrogate</a> <a data-link-type="dfn" href="https://infra.spec.whatwg.org/#code-point" id="ref-for-code-point①⑤">code points</a> in <var>input</var> with U+FFFD REPLACEMENT CHARACTER (�). <p class="note" role="note"><span class="marker">Note:</span> The only way to produce a <a data-link-type="dfn" href="https://infra.spec.whatwg.org/#surrogate" id="ref-for-surrogate①">surrogate</a> <a data-link-type="dfn" href="https://infra.spec.whatwg.org/#code-point" id="ref-for-code-point①⑥">code point</a> in CSS content is by directly assigning a <code>DOMString</code> with one in it via an OM operation.</p> </ul> </div> <h2 class="heading settled" data-level="4" id="tokenization"><span class="secno">4. </span><span class="content"> Tokenization</span><a class="self-link" href="#tokenization"></a></h2> <p>To <dfn class="dfn-paneled" data-dfn-for="CSS" data-dfn-type="dfn" data-lt="tokenize|tokenization" data-noexport id="css-tokenize">tokenize</dfn> a stream of <a data-link-type="dfn" href="https://infra.spec.whatwg.org/#code-point" id="ref-for-code-point①⑦">code points</a> into a stream of CSS tokens <var>input</var>, repeatedly <a data-link-type="dfn" href="#tokenizer-consume-a-token" id="ref-for-tokenizer-consume-a-token">consume a token</a> from <var>input</var> until an <a class="production css" data-link-type="type" href="#typedef-eof-token" id="ref-for-typedef-eof-token"><EOF-token></a> is reached, pushing each of the returned tokens into a stream.</p> <p class="note" role="note"><span class="marker">Note:</span> Each call to the <a data-link-type="dfn" href="#tokenizer-consume-a-token" id="ref-for-tokenizer-consume-a-token①">consume a token</a> algorithm returns a single token, so it can also be used "on-demand" to tokenize a stream of <a data-link-type="dfn" href="https://infra.spec.whatwg.org/#code-point" id="ref-for-code-point①⑧">code points</a> <em>during</em> parsing, if so desired.</p> <p>The output of tokenization step is a stream of zero or more of the following tokens: <dfn class="dfn-paneled css" data-dfn-type="type" data-export id="typedef-ident-token"><ident-token></dfn>, <dfn class="dfn-paneled css" data-dfn-type="type" data-export id="typedef-function-token"><function-token></dfn>, <dfn class="dfn-paneled css" data-dfn-type="type" data-export id="typedef-at-keyword-token"><at-keyword-token></dfn>, <dfn class="dfn-paneled css" data-dfn-type="type" data-export id="typedef-hash-token"><hash-token></dfn>, <dfn class="dfn-paneled css" data-dfn-type="type" data-export id="typedef-string-token"><string-token></dfn>, <dfn class="dfn-paneled css" data-dfn-type="type" data-export id="typedef-bad-string-token"><bad-string-token></dfn>, <dfn class="dfn-paneled css" data-dfn-type="type" data-export id="typedef-url-token"><url-token></dfn>, <dfn class="dfn-paneled css" data-dfn-type="type" data-export id="typedef-bad-url-token"><bad-url-token></dfn>, <dfn class="dfn-paneled css" data-dfn-type="type" data-export id="typedef-delim-token"><delim-token></dfn>, <dfn class="dfn-paneled css" data-dfn-type="type" data-export id="typedef-number-token"><number-token></dfn>, <dfn class="dfn-paneled css" data-dfn-type="type" data-export id="typedef-percentage-token"><percentage-token></dfn>, <dfn class="dfn-paneled css" data-dfn-type="type" data-export id="typedef-dimension-token"><dimension-token></dfn>, <dfn class="dfn-paneled css" data-dfn-type="type" data-export id="typedef-unicode-range-token"><unicode-range-token></dfn>, <dfn class="dfn-paneled css" data-dfn-type="type" data-export id="typedef-whitespace-token"><whitespace-token></dfn>, <dfn class="dfn-paneled css" data-dfn-type="type" data-export id="typedef-cdo-token"><CDO-token></dfn>, <dfn class="dfn-paneled css" data-dfn-type="type" data-export id="typedef-cdc-token"><CDC-token></dfn>, <dfn class="dfn-paneled css" data-dfn-type="type" data-export id="typedef-colon-token"><colon-token></dfn>, <dfn class="dfn-paneled css" data-dfn-type="type" data-export id="typedef-semicolon-token"><semicolon-token></dfn>, <dfn class="dfn-paneled css" data-dfn-type="type" data-export id="typedef-comma-token"><comma-token></dfn>, <dfn class="dfn-paneled css" data-dfn-type="type" data-export id="tokendef-open-square"><[-token></dfn>, <dfn class="dfn-paneled css" data-dfn-type="type" data-export id="tokendef-close-square"><]-token></dfn>, <dfn class="dfn-paneled css" data-dfn-type="type" data-export id="tokendef-open-paren"><(-token></dfn>, <dfn class="dfn-paneled css" data-dfn-type="type" data-export id="tokendef-close-paren"><)-token></dfn>, <dfn class="dfn-paneled css" data-dfn-type="type" data-export id="tokendef-open-curly"><{-token></dfn>, and <dfn class="dfn-paneled css" data-dfn-type="type" data-export id="tokendef-close-curly"><}-token></dfn>.</p> <ul> <li> <a class="production css" data-link-type="type" href="#typedef-ident-token" id="ref-for-typedef-ident-token"><ident-token></a>, <a class="production css" data-link-type="type" href="#typedef-function-token" id="ref-for-typedef-function-token"><function-token></a>, <a class="production css" data-link-type="type" href="#typedef-at-keyword-token" id="ref-for-typedef-at-keyword-token①"><at-keyword-token></a>, <a class="production css" data-link-type="type" href="#typedef-hash-token" id="ref-for-typedef-hash-token"><hash-token></a>, <a class="production css" data-link-type="type" href="#typedef-string-token" id="ref-for-typedef-string-token"><string-token></a>, and <a class="production css" data-link-type="type" href="#typedef-url-token" id="ref-for-typedef-url-token"><url-token></a> have a value composed of zero or more <a data-link-type="dfn" href="https://infra.spec.whatwg.org/#code-point" id="ref-for-code-point①⑨">code points</a>. Additionally, hash tokens have a type flag set to either "id" or "unrestricted". The type flag defaults to "unrestricted" if not otherwise set. <li> <a class="production css" data-link-type="type" href="#typedef-delim-token" id="ref-for-typedef-delim-token"><delim-token></a> has a value composed of a single <a data-link-type="dfn" href="https://infra.spec.whatwg.org/#code-point" id="ref-for-code-point②⓪">code point</a>. <li> <a class="production css" data-link-type="type" href="#typedef-number-token" id="ref-for-typedef-number-token"><number-token></a>, <a class="production css" data-link-type="type" href="#typedef-percentage-token" id="ref-for-typedef-percentage-token"><percentage-token></a>, and <a class="production css" data-link-type="type" href="#typedef-dimension-token" id="ref-for-typedef-dimension-token"><dimension-token></a> have a numeric value, and an optional sign character set to either "+" or "-" (or nothing). <p><a class="production css" data-link-type="type" href="#typedef-number-token" id="ref-for-typedef-number-token①"><number-token></a> and <a class="production css" data-link-type="type" href="#typedef-dimension-token" id="ref-for-typedef-dimension-token①"><dimension-token></a> additionally have a type flag set to either "integer" or "number". The type flag defaults to "integer" if not otherwise set. <span class="production" id="ref-for-typedef-dimension-token②"><dimension-token></span> additionally have a unit composed of one or more <a data-link-type="dfn" href="https://infra.spec.whatwg.org/#code-point" id="ref-for-code-point②①">code points</a>.</p> <li> <a class="production css" data-link-type="type" href="#typedef-unicode-range-token" id="ref-for-typedef-unicode-range-token"><unicode-range-token></a> has a starting and ending code point. It represents an inclusive range of codepoints (including both the start and end). If the ending code point is before the starting code point, it represents an empty range. </ul> <p class="note" role="note"><span class="marker">Note:</span> The type flag of hash tokens is used in the Selectors syntax <a data-link-type="biblio" href="#biblio-select" title="Selectors Level 3">[SELECT]</a>. Only hash tokens with the "id" type are valid <a href="https://www.w3.org/TR/selectors/#id-selectors">ID selectors</a>.</p> <h3 class="heading settled" data-level="4.1" id="token-diagrams"><span class="secno">4.1. </span><span class="content"> Token Railroad Diagrams</span><a class="self-link" href="#token-diagrams"></a></h3> <p><em>This section is non-normative.</em></p> <p>This section presents an informative view of the tokenizer, in the form of railroad diagrams. Railroad diagrams are more compact than an explicit parser, but often easier to read than an regular expression.</p> <p>These diagrams are <em>informative</em> and <em>incomplete</em>; they describe the grammar of "correct" tokens, but do not describe error-handling at all. They are provided solely to make it easier to get an intuitive grasp of the syntax of each token.</p> <p>Diagrams with names such as <em><foo-token></em> represent tokens. The rest are productions referred to by other diagrams.</p> <dl> <dt id="comment-diagram"><a class="self-link" href="#comment-diagram"></a>comment <dd> <div class="railroad"> <svg class="railroad-diagram" height="80" viewBox="0 0 512.0 80" width="512.0"> <g transform="translate(.5 .5)"> <g> <path d="M20 30v20m10 -20v20m-10 -10h20"></path> </g> <path d="M40 40h10"></path> <g class="terminal "> <path d="M50 40h0.0"></path> <path d="M87.0 40h0.0"></path> <rect height="22" rx="10" ry="10" width="37" x="50" y="29"></rect> <text x="68.5" y="44">/*</text> </g> <path d="M87.0 40h10"></path> <g> <path d="M97.0 40h0.0"></path> <path d="M415.0 40h0.0"></path> <path d="M97.0 40a10 10 0 0 0 10 -10v0a10 10 0 0 1 10 -10"></path> <g> <path d="M117.0 20h278.0"></path> </g> <path d="M395.0 20a10 10 0 0 1 10 10v0a10 10 0 0 0 10 10"></path> <path d="M97.0 40h20"></path> <g> <path d="M117.0 40h0.0"></path> <path d="M395.0 40h0.0"></path> <path d="M117.0 40h10"></path> <g class="non-terminal "> <path d="M127.0 40h0.0"></path> <path d="M385.0 40h0.0"></path> <rect height="22" width="258" x="127" y="29"></rect> <text x="256" y="44">anything but * followed by /</text> </g> <path d="M385.0 40h10"></path> <path d="M127.0 40a10 10 0 0 0 -10 10v0a10 10 0 0 0 10 10"></path> <g> <path d="M127.0 60h258.0"></path> </g> <path d="M385.0 60a10 10 0 0 0 10 -10v0a10 10 0 0 0 -10 -10"></path> </g> <path d="M395.0 40h20"></path> </g> <path d="M415.0 40h10"></path> <g class="terminal "> <path d="M425.0 40h0.0"></path> <path d="M462.0 40h0.0"></path> <rect height="22" rx="10" ry="10" width="37" x="425" y="29"></rect> <text x="443.5" y="44">*/</text> </g> <path d="M462.0 40h10"></path> <path d="M 472.0 40 h 20 m -10 -10 v 20 m 10 -20 v 20"></path> </g> </svg> </div> <dt id="newline-diagram"><a class="self-link" href="#newline-diagram"></a>newline <dd> <div class="railroad"> <svg class="railroad-diagram" height="152" viewBox="0 0 174.0 152" width="174.0"> <g transform="translate(.5 .5)"> <g> <path d="M20 21v20m10 -20v20m-10 -10h20"></path> </g> <g> <path d="M40 31h0.0"></path> <path d="M134.0 31h0.0"></path> <path d="M40.0 31h20"></path> <g class="terminal "> <path d="M60.0 31h8.5"></path> <path d="M105.5 31h8.5"></path> <rect height="22" rx="10" ry="10" width="37" x="68.5" y="20"></rect> <text x="87" y="35">\n</text> </g> <path d="M114.0 31h20"></path> <path d="M40.0 31a10 10 0 0 1 10 10v10a10 10 0 0 0 10 10"></path> <g class="terminal "> <path d="M60.0 61h0.0"></path> <path d="M114.0 61h0.0"></path> <rect height="22" rx="10" ry="10" width="54" x="60" y="50"></rect> <text x="87" y="65">\r\n</text> </g> <path d="M114.0 61a10 10 0 0 0 10 -10v-10a10 10 0 0 1 10 -10"></path> <path d="M40.0 31a10 10 0 0 1 10 10v40a10 10 0 0 0 10 10"></path> <g class="terminal "> <path d="M60.0 91h8.5"></path> <path d="M105.5 91h8.5"></path> <rect height="22" rx="10" ry="10" width="37" x="68.5" y="80"></rect> <text x="87" y="95">\r</text> </g> <path d="M114.0 91a10 10 0 0 0 10 -10v-40a10 10 0 0 1 10 -10"></path> <path d="M40.0 31a10 10 0 0 1 10 10v70a10 10 0 0 0 10 10"></path> <g class="terminal "> <path d="M60.0 121h8.5"></path> <path d="M105.5 121h8.5"></path> <rect height="22" rx="10" ry="10" width="37" x="68.5" y="110"></rect> <text x="87" y="125">\f</text> </g> <path d="M114.0 121a10 10 0 0 0 10 -10v-70a10 10 0 0 1 10 -10"></path> </g> <path d="M 134.0 31 h 20 m -10 -10 v 20 m 10 -20 v 20"></path> </g> </svg> </div> <dt id="whitespace-diagram"><a class="self-link" href="#whitespace-diagram"></a>whitespace <dd> <div class="railroad"> <svg class="railroad-diagram" height="122" viewBox="0 0 199.5 122" width="199.5"> <g transform="translate(.5 .5)"> <g> <path d="M20 21v20m10 -20v20m-10 -10h20"></path> </g> <g> <path d="M40 31h0.0"></path> <path d="M159.5 31h0.0"></path> <path d="M40.0 31h20"></path> <g class="terminal "> <path d="M60.0 31h8.5"></path> <path d="M131.0 31h8.5"></path> <rect height="22" rx="10" ry="10" width="62.5" x="68.5" y="20"></rect> <text x="99.75" y="35">space</text> </g> <path d="M139.5 31h20"></path> <path d="M40.0 31a10 10 0 0 1 10 10v10a10 10 0 0 0 10 10"></path> <g class="terminal "> <path d="M60.0 61h21.25"></path> <path d="M118.25 61h21.25"></path> <rect height="22" rx="10" ry="10" width="37" x="81.25" y="50"></rect> <text x="99.75" y="65">\t</text> </g> <path d="M139.5 61a10 10 0 0 0 10 -10v-10a10 10 0 0 1 10 -10"></path> <path d="M40.0 31a10 10 0 0 1 10 10v40a10 10 0 0 0 10 10"></path> <g class="non-terminal "> <path d="M60.0 91h0.0"></path> <path d="M139.5 91h0.0"></path> <rect height="22" width="79.5" x="60" y="80"></rect> <text x="99.75" y="95">newline</text> </g> <path d="M139.5 91a10 10 0 0 0 10 -10v-40a10 10 0 0 1 10 -10"></path> </g> <path d="M 159.5 31 h 20 m -10 -10 v 20 m 10 -20 v 20"></path> </g> </svg> </div> <dt id="hex-digit-diagram"><a class="self-link" href="#hex-digit-diagram"></a>hex digit <dd> <div class="railroad"> <svg class="railroad-diagram" height="62" viewBox="0 0 239.0 62" width="239.0"> <g transform="translate(.5 .5)"> <g> <path d="M20 21v20m10 -20v20m-10 -10h20"></path> </g> <path d="M40 31h10"></path> <g class="non-terminal "> <path d="M50 31h0.0"></path> <path d="M189.0 31h0.0"></path> <rect height="22" width="139" x="50" y="20"></rect> <text x="119.5" y="35">0-9 a-f or A-F</text> </g> <path d="M189.0 31h10"></path> <path d="M 199.0 31 h 20 m -10 -10 v 20 m 10 -20 v 20"></path> </g> </svg> </div> <dt id="escape-diagram"><a class="self-link" href="#escape-diagram"></a>escape <dd> <div class="railroad"> <svg class="railroad-diagram" height="116" viewBox="0 0 440.0 116" width="440.0"> <g transform="translate(.5 .5)"> <g> <path d="M20 21v20m10 -20v20m-10 -10h20"></path> </g> <path d="M40 31h10"></path> <g class="terminal "> <path d="M50 31h0.0"></path> <path d="M78.5 31h0.0"></path> <rect height="22" rx="10" ry="10" width="28.5" x="50" y="20"></rect> <text x="64.25" y="35">\</text> </g> <path d="M78.5 31h10"></path> <g> <path d="M88.5 31h0.0"></path> <path d="M400.0 31h0.0"></path> <path d="M88.5 31h20"></path> <g class="non-terminal "> <path d="M108.5 31h23.75"></path> <path d="M356.25 31h23.75"></path> <rect height="22" width="224" x="132.25" y="20"></rect> <text x="244.25" y="35">not newline or hex digit</text> </g> <path d="M380.0 31h20"></path> <path d="M88.5 31a10 10 0 0 1 10 10v10a10 10 0 0 0 10 10"></path> <g> <path d="M108.5 61h0.0"></path> <path d="M380.0 61h0.0"></path> <g> <path d="M108.5 61h0.0"></path> <path d="M225.0 61h0.0"></path> <path d="M108.5 61h10"></path> <g class="non-terminal "> <path d="M118.5 61h0.0"></path> <path d="M215.0 61h0.0"></path> <rect height="22" width="96.5" x="118.5" y="50"></rect> <text x="166.75" y="65">hex digit</text> </g> <path d="M215.0 61h10"></path> <path d="M118.5 61a10 10 0 0 0 -10 10v7a10 10 0 0 0 10 10"></path> <g class="non-terminal "> <path d="M118.5 88h11.75"></path> <path d="M203.25 88h11.75"></path> <text class="comment" x="166.75" y="93">1-6 times</text> </g> <path d="M215.0 88a10 10 0 0 0 10 -10v-7a10 10 0 0 0 -10 -10"></path> </g> <path d="M225.0 61h10"></path> <g> <path d="M235.0 61h0.0"></path> <path d="M380.0 61h0.0"></path> <path d="M235.0 61h20"></path> <g> <path d="M255.0 61h105.0"></path> </g> <path d="M360.0 61h20"></path> <path d="M235.0 61a10 10 0 0 1 10 10v0a10 10 0 0 0 10 10"></path> <g class="non-terminal "> <path d="M255.0 81h0.0"></path> <path d="M360.0 81h0.0"></path> <rect height="22" width="105" x="255" y="70"></rect> <text x="307.5" y="85">whitespace</text> </g> <path d="M360.0 81a10 10 0 0 0 10 -10v0a10 10 0 0 1 10 -10"></path> </g> </g> <path d="M380.0 61a10 10 0 0 0 10 -10v-10a10 10 0 0 1 10 -10"></path> </g> <path d="M 400.0 31 h 20 m -10 -10 v 20 m 10 -20 v 20"></path> </g> </svg> </div> <dt id="whitespace-token-diagram"><a class="self-link" href="#whitespace-token-diagram"></a><a class="production css" data-link-type="type" href="#typedef-whitespace-token" id="ref-for-typedef-whitespace-token"><whitespace-token></a> <dd> <div class="railroad"> <svg class="railroad-diagram" height="71" viewBox="0 0 225.0 71" width="225.0"> <g transform="translate(.5 .5)"> <g> <path d="M20 21v20m10 -20v20m-10 -10h20"></path> </g> <path d="M40 31h10"></path> <g> <path d="M50 31h0.0"></path> <path d="M175.0 31h0.0"></path> <path d="M50.0 31h10"></path> <g class="non-terminal "> <path d="M60.0 31h0.0"></path> <path d="M165.0 31h0.0"></path> <rect height="22" width="105" x="60" y="20"></rect> <text x="112.5" y="35">whitespace</text> </g> <path d="M165.0 31h10"></path> <path d="M60.0 31a10 10 0 0 0 -10 10v0a10 10 0 0 0 10 10"></path> <g> <path d="M60.0 51h105.0"></path> </g> <path d="M165.0 51a10 10 0 0 0 10 -10v0a10 10 0 0 0 -10 -10"></path> </g> <path d="M175.0 31h10"></path> <path d="M 185.0 31 h 20 m -10 -10 v 20 m 10 -20 v 20"></path> </g> </svg> </div> <dt id="ws*-diagram"><a class="self-link" href="#ws*-diagram"></a>ws* <dd> <div class="railroad"> <svg class="railroad-diagram" height="80" viewBox="0 0 313.0 80" width="313.0"> <g transform="translate(.5 .5)"> <g> <path d="M20 30v20m10 -20v20m-10 -10h20"></path> </g> <g> <path d="M40 40h0.0"></path> <path d="M273.0 40h0.0"></path> <path d="M40.0 40a10 10 0 0 0 10 -10v0a10 10 0 0 1 10 -10"></path> <g> <path d="M60.0 20h193.0"></path> </g> <path d="M253.0 20a10 10 0 0 1 10 10v0a10 10 0 0 0 10 10"></path> <path d="M40.0 40h20"></path> <g> <path d="M60.0 40h0.0"></path> <path d="M253.0 40h0.0"></path> <path d="M60.0 40h10"></path> <g class="non-terminal "> <path d="M70.0 40h0.0"></path> <path d="M243.0 40h0.0"></path> <rect height="22" width="173" x="70" y="29"></rect> <text x="156.5" y="44"><whitespace-token></text> </g> <path d="M243.0 40h10"></path> <path d="M70.0 40a10 10 0 0 0 -10 10v0a10 10 0 0 0 10 10"></path> <g> <path d="M70.0 60h173.0"></path> </g> <path d="M243.0 60a10 10 0 0 0 10 -10v0a10 10 0 0 0 -10 -10"></path> </g> <path d="M253.0 40h20"></path> </g> <path d="M 273.0 40 h 20 m -10 -10 v 20 m 10 -20 v 20"></path> </g> </svg> </div> <dt id="ident-token-diagram"><a class="self-link" href="#ident-token-diagram"></a><a class="production css" data-link-type="type" href="#typedef-ident-token" id="ref-for-typedef-ident-token①"><ident-token></a> <dd> <div class="railroad"> <svg class="railroad-diagram" height="130" viewBox="0 0 793.5 130" width="793.5"> <g transform="translate(.5 .5)"> <g> <path d="M20 51v20m10 -20v20m-10 -10h20"></path> </g> <g> <path d="M40 61h0.0"></path> <path d="M395.5 61h0.0"></path> <path d="M40.0 61a10 10 0 0 0 10 -10v-10a10 10 0 0 1 10 -10"></path> <g class="terminal "> <path d="M60.0 31h139.25"></path> <path d="M236.25 31h139.25"></path> <rect height="22" rx="10" ry="10" width="37" x="199.25" y="20"></rect> <text x="217.75" y="35">--</text> </g> <path d="M375.5 31a10 10 0 0 1 10 10v10a10 10 0 0 0 10 10"></path> <path d="M40.0 61h20"></path> <g> <path d="M60.0 61h0.0"></path> <path d="M375.5 61h0.0"></path> <g> <path d="M60.0 61h0.0"></path> <path d="M128.5 61h0.0"></path> <path d="M60.0 61h20"></path> <g> <path d="M80.0 61h28.5"></path> </g> <path d="M108.5 61h20"></path> <path d="M60.0 61a10 10 0 0 1 10 10v0a10 10 0 0 0 10 10"></path> <g class="terminal "> <path d="M80.0 81h0.0"></path> <path d="M108.5 81h0.0"></path> <rect height="22" rx="10" ry="10" width="28.5" x="80" y="70"></rect> <text x="94.25" y="85">-</text> </g> <path d="M108.5 81a10 10 0 0 0 10 -10v0a10 10 0 0 1 10 -10"></path> </g> <g> <path d="M128.5 61h0.0"></path> <path d="M375.5 61h0.0"></path> <path d="M128.5 61h20"></path> <g class="non-terminal "> <path d="M148.5 61h0.0"></path> <path d="M355.5 61h0.0"></path> <rect height="22" width="207" x="148.5" y="50"></rect> <text x="252" y="65">a-z A-Z _ or non-ASCII</text> </g> <path d="M355.5 61h20"></path> <path d="M128.5 61a10 10 0 0 1 10 10v10a10 10 0 0 0 10 10"></path> <g class="non-terminal "> <path d="M148.5 91h68.0"></path> <path d="M287.5 91h68.0"></path> <rect height="22" width="71" x="216.5" y="80"></rect> <text x="252" y="95">escape</text> </g> <path d="M355.5 91a10 10 0 0 0 10 -10v-10a10 10 0 0 1 10 -10"></path> </g> </g> <path d="M375.5 61h20"></path> </g> <g> <path d="M395.5 61h0.0"></path> <path d="M753.5 61h0.0"></path> <path d="M395.5 61a10 10 0 0 0 10 -10v0a10 10 0 0 1 10 -10"></path> <g> <path d="M415.5 41h318.0"></path> </g> <path d="M733.5 41a10 10 0 0 1 10 10v0a10 10 0 0 0 10 10"></path> <path d="M395.5 61h20"></path> <g> <path d="M415.5 61h0.0"></path> <path d="M733.5 61h0.0"></path> <path d="M415.5 61h10"></path> <g> <path d="M425.5 61h0.0"></path> <path d="M723.5 61h0.0"></path> <path d="M425.5 61h20"></path> <g class="non-terminal "> <path d="M445.5 61h0.0"></path> <path d="M703.5 61h0.0"></path> <rect height="22" width="258" x="445.5" y="50"></rect> <text x="574.5" y="65">a-z A-Z 0-9 _ - or non-ASCII</text> </g> <path d="M703.5 61h20"></path> <path d="M425.5 61a10 10 0 0 1 10 10v10a10 10 0 0 0 10 10"></path> <g class="non-terminal "> <path d="M445.5 91h93.5"></path> <path d="M610.0 91h93.5"></path> <rect height="22" width="71" x="539" y="80"></rect> <text x="574.5" y="95">escape</text> </g> <path d="M703.5 91a10 10 0 0 0 10 -10v-10a10 10 0 0 1 10 -10"></path> </g> <path d="M723.5 61h10"></path> <path d="M425.5 61a10 10 0 0 0 -10 10v29a10 10 0 0 0 10 10"></path> <g> <path d="M425.5 110h298.0"></path> </g> <path d="M723.5 110a10 10 0 0 0 10 -10v-29a10 10 0 0 0 -10 -10"></path> </g> <path d="M733.5 61h20"></path> </g> <path d="M 753.5 61 h 20 m -10 -10 v 20 m 10 -20 v 20"></path> </g> </svg> </div> <dt id="function-token-diagram"><a class="self-link" href="#function-token-diagram"></a><a class="production css" data-link-type="type" href="#typedef-function-token" id="ref-for-typedef-function-token①"><function-token></a> <dd> <div class="railroad"> <svg class="railroad-diagram" height="62" viewBox="0 0 279.0 62" width="279.0"> <g transform="translate(.5 .5)"> <g> <path d="M20 21v20m10 -20v20m-10 -10h20"></path> </g> <path d="M40 31h10"></path> <g class="non-terminal "> <path d="M50 31h0.0"></path> <path d="M180.5 31h0.0"></path> <rect height="22" width="130.5" x="50" y="20"></rect> <text x="115.25" y="35"><ident-token></text> </g> <path d="M180.5 31h10"></path> <path d="M190.5 31h10"></path> <g class="terminal "> <path d="M200.5 31h0.0"></path> <path d="M229.0 31h0.0"></path> <rect height="22" rx="10" ry="10" width="28.5" x="200.5" y="20"></rect> <text x="214.75" y="35">(</text> </g> <path d="M229.0 31h10"></path> <path d="M 239.0 31 h 20 m -10 -10 v 20 m 10 -20 v 20"></path> </g> </svg> </div> <dt id="at-keyword-token-diagram"><a class="self-link" href="#at-keyword-token-diagram"></a><a class="production css" data-link-type="type" href="#typedef-at-keyword-token" id="ref-for-typedef-at-keyword-token②"><at-keyword-token></a> <dd> <div class="railroad"> <svg class="railroad-diagram" height="62" viewBox="0 0 279.0 62" width="279.0"> <g transform="translate(.5 .5)"> <g> <path d="M20 21v20m10 -20v20m-10 -10h20"></path> </g> <path d="M40 31h10"></path> <g class="terminal "> <path d="M50 31h0.0"></path> <path d="M78.5 31h0.0"></path> <rect height="22" rx="10" ry="10" width="28.5" x="50" y="20"></rect> <text x="64.25" y="35">@</text> </g> <path d="M78.5 31h10"></path> <path d="M88.5 31h10"></path> <g class="non-terminal "> <path d="M98.5 31h0.0"></path> <path d="M229.0 31h0.0"></path> <rect height="22" width="130.5" x="98.5" y="20"></rect> <text x="163.75" y="35"><ident-token></text> </g> <path d="M229.0 31h10"></path> <path d="M 239.0 31 h 20 m -10 -10 v 20 m 10 -20 v 20"></path> </g> </svg> </div> <dt id="hash-token-diagram"><a class="self-link" href="#hash-token-diagram"></a><a class="production css" data-link-type="type" href="#typedef-hash-token" id="ref-for-typedef-hash-token①"><hash-token></a> <dd> <div class="railroad"> <svg class="railroad-diagram" height="100" viewBox="0 0 466.5 100" width="466.5"> <g transform="translate(.5 .5)"> <g> <path d="M20 21v20m10 -20v20m-10 -10h20"></path> </g> <path d="M40 31h10"></path> <g class="terminal "> <path d="M50 31h0.0"></path> <path d="M78.5 31h0.0"></path> <rect height="22" rx="10" ry="10" width="28.5" x="50" y="20"></rect> <text x="64.25" y="35">#</text> </g> <path d="M78.5 31h10"></path> <path d="M88.5 31h10"></path> <g> <path d="M98.5 31h0.0"></path> <path d="M416.5 31h0.0"></path> <path d="M98.5 31h10"></path> <g> <path d="M108.5 31h0.0"></path> <path d="M406.5 31h0.0"></path> <path d="M108.5 31h20"></path> <g class="non-terminal "> <path d="M128.5 31h0.0"></path> <path d="M386.5 31h0.0"></path> <rect height="22" width="258" x="128.5" y="20"></rect> <text x="257.5" y="35">a-z A-Z 0-9 _ - or non-ASCII</text> </g> <path d="M386.5 31h20"></path> <path d="M108.5 31a10 10 0 0 1 10 10v10a10 10 0 0 0 10 10"></path> <g class="non-terminal "> <path d="M128.5 61h93.5"></path> <path d="M293.0 61h93.5"></path> <rect height="22" width="71" x="222" y="50"></rect> <text x="257.5" y="65">escape</text> </g> <path d="M386.5 61a10 10 0 0 0 10 -10v-10a10 10 0 0 1 10 -10"></path> </g> <path d="M406.5 31h10"></path> <path d="M108.5 31a10 10 0 0 0 -10 10v29a10 10 0 0 0 10 10"></path> <g> <path d="M108.5 80h298.0"></path> </g> <path d="M406.5 80a10 10 0 0 0 10 -10v-29a10 10 0 0 0 -10 -10"></path> </g> <path d="M416.5 31h10"></path> <path d="M 426.5 31 h 20 m -10 -10 v 20 m 10 -20 v 20"></path> </g> </svg> </div> <dt id="string-token-diagram"><a class="self-link" href="#string-token-diagram"></a><a class="production css" data-link-type="type" href="#typedef-string-token" id="ref-for-typedef-string-token①"><string-token></a> <dd> <div class="railroad"> <svg class="railroad-diagram" height="246" viewBox="0 0 470.0 246" width="470.0"> <g transform="translate(.5 .5)"> <g> <path d="M20 30v20m10 -20v20m-10 -10h20"></path> </g> <g> <path d="M40 40h0.0"></path> <path d="M430.0 40h0.0"></path> <path d="M40.0 40h20"></path> <g> <path d="M60.0 40h0.0"></path> <path d="M410.0 40h0.0"></path> <g class="terminal "> <path d="M60.0 40h0.0"></path> <path d="M88.5 40h0.0"></path> <rect height="22" rx="10" ry="10" width="28.5" x="60" y="29"></rect> <text x="74.25" y="44">"</text> </g> <path d="M88.5 40h10"></path> <g> <path d="M98.5 40h0.0"></path> <path d="M371.5 40h0.0"></path> <path d="M98.5 40a10 10 0 0 0 10 -10v0a10 10 0 0 1 10 -10"></path> <g> <path d="M118.5 20h233.0"></path> </g> <path d="M351.5 20a10 10 0 0 1 10 10v0a10 10 0 0 0 10 10"></path> <path d="M98.5 40h20"></path> <g> <path d="M118.5 40h0.0"></path> <path d="M351.5 40h0.0"></path> <path d="M118.5 40h10"></path> <g> <path d="M128.5 40h0.0"></path> <path d="M341.5 40h0.0"></path> <path d="M128.5 40h20"></path> <g class="non-terminal "> <path d="M148.5 40h0.0"></path> <path d="M321.5 40h0.0"></path> <rect height="22" width="173" x="148.5" y="29"></rect> <text x="235" y="44">not " \ or newline</text> </g> <path d="M321.5 40h20"></path> <path d="M128.5 40a10 10 0 0 1 10 10v10a10 10 0 0 0 10 10"></path> <g class="non-terminal "> <path d="M148.5 70h51.0"></path> <path d="M270.5 70h51.0"></path> <rect height="22" width="71" x="199.5" y="59"></rect> <text x="235" y="74">escape</text> </g> <path d="M321.5 70a10 10 0 0 0 10 -10v-10a10 10 0 0 1 10 -10"></path> <path d="M128.5 40a10 10 0 0 1 10 10v40a10 10 0 0 0 10 10"></path> <g> <path d="M148.5 100h22.5"></path> <path d="M299.0 100h22.5"></path> <g class="terminal "> <path d="M171.0 100h0.0"></path> <path d="M199.5 100h0.0"></path> <rect height="22" rx="10" ry="10" width="28.5" x="171" y="89"></rect> <text x="185.25" y="104">\</text> </g> <path d="M199.5 100h10"></path> <path d="M209.5 100h10"></path> <g class="non-terminal "> <path d="M219.5 100h0.0"></path> <path d="M299.0 100h0.0"></path> <rect height="22" width="79.5" x="219.5" y="89"></rect> <text x="259.25" y="104">newline</text> </g> </g> <path d="M321.5 100a10 10 0 0 0 10 -10v-40a10 10 0 0 1 10 -10"></path> </g> <path d="M341.5 40h10"></path> <path d="M128.5 40a10 10 0 0 0 -10 10v59a10 10 0 0 0 10 10"></path> <g> <path d="M128.5 119h213.0"></path> </g> <path d="M341.5 119a10 10 0 0 0 10 -10v-59a10 10 0 0 0 -10 -10"></path> </g> <path d="M351.5 40h20"></path> </g> <path d="M371.5 40h10"></path> <g class="terminal "> <path d="M381.5 40h0.0"></path> <path d="M410.0 40h0.0"></path> <rect height="22" rx="10" ry="10" width="28.5" x="381.5" y="29"></rect> <text x="395.75" y="44">"</text> </g> </g> <path d="M410.0 40h20"></path> <path d="M40.0 40a10 10 0 0 1 10 10v87a10 10 0 0 0 10 10"></path> <g> <path d="M60.0 147h0.0"></path> <path d="M410.0 147h0.0"></path> <g class="terminal "> <path d="M60.0 147h0.0"></path> <path d="M88.5 147h0.0"></path> <rect height="22" rx="10" ry="10" width="28.5" x="60" y="136"></rect> <text x="74.25" y="151">'</text> </g> <path d="M88.5 147h10"></path> <g> <path d="M98.5 147h0.0"></path> <path d="M371.5 147h0.0"></path> <path d="M98.5 147a10 10 0 0 0 10 -10v0a10 10 0 0 1 10 -10"></path> <g> <path d="M118.5 127h233.0"></path> </g> <path d="M351.5 127a10 10 0 0 1 10 10v0a10 10 0 0 0 10 10"></path> <path d="M98.5 147h20"></path> <g> <path d="M118.5 147h0.0"></path> <path d="M351.5 147h0.0"></path> <path d="M118.5 147h10"></path> <g> <path d="M128.5 147h0.0"></path> <path d="M341.5 147h0.0"></path> <path d="M128.5 147h20"></path> <g class="non-terminal "> <path d="M148.5 147h0.0"></path> <path d="M321.5 147h0.0"></path> <rect height="22" width="173" x="148.5" y="136"></rect> <text x="235" y="151">not ' \ or newline</text> </g> <path d="M321.5 147h20"></path> <path d="M128.5 147a10 10 0 0 1 10 10v10a10 10 0 0 0 10 10"></path> <g class="non-terminal "> <path d="M148.5 177h51.0"></path> <path d="M270.5 177h51.0"></path> <rect height="22" width="71" x="199.5" y="166"></rect> <text x="235" y="181">escape</text> </g> <path d="M321.5 177a10 10 0 0 0 10 -10v-10a10 10 0 0 1 10 -10"></path> <path d="M128.5 147a10 10 0 0 1 10 10v40a10 10 0 0 0 10 10"></path> <g> <path d="M148.5 207h22.5"></path> <path d="M299.0 207h22.5"></path> <g class="terminal "> <path d="M171.0 207h0.0"></path> <path d="M199.5 207h0.0"></path> <rect height="22" rx="10" ry="10" width="28.5" x="171" y="196"></rect> <text x="185.25" y="211">\</text> </g> <path d="M199.5 207h10"></path> <path d="M209.5 207h10"></path> <g class="non-terminal "> <path d="M219.5 207h0.0"></path> <path d="M299.0 207h0.0"></path> <rect height="22" width="79.5" x="219.5" y="196"></rect> <text x="259.25" y="211">newline</text> </g> </g> <path d="M321.5 207a10 10 0 0 0 10 -10v-40a10 10 0 0 1 10 -10"></path> </g> <path d="M341.5 147h10"></path> <path d="M128.5 147a10 10 0 0 0 -10 10v59a10 10 0 0 0 10 10"></path> <g> <path d="M128.5 226h213.0"></path> </g> <path d="M341.5 226a10 10 0 0 0 10 -10v-59a10 10 0 0 0 -10 -10"></path> </g> <path d="M351.5 147h20"></path> </g> <path d="M371.5 147h10"></path> <g class="terminal "> <path d="M381.5 147h0.0"></path> <path d="M410.0 147h0.0"></path> <rect height="22" rx="10" ry="10" width="28.5" x="381.5" y="136"></rect> <text x="395.75" y="151">'</text> </g> </g> <path d="M410.0 147a10 10 0 0 0 10 -10v-87a10 10 0 0 1 10 -10"></path> </g> <path d="M 430.0 40 h 20 m -10 -10 v 20 m 10 -20 v 20"></path> </g> </svg> </div> <dt id="url-token-diagram"><a class="self-link" href="#url-token-diagram"></a><a class="production css" data-link-type="type" href="#typedef-url-token" id="ref-for-typedef-url-token①"><url-token></a> <dd> <div class="railroad"> <svg class="railroad-diagram" height="109" viewBox="0 0 910.0 109" width="910.0"> <g transform="translate(.5 .5)"> <g> <path d="M20 30v20m10 -20v20m-10 -10h20"></path> </g> <path d="M40 40h10"></path> <g class="non-terminal "> <path d="M50 40h0.0"></path> <path d="M231.5 40h0.0"></path> <rect height="22" width="181.5" x="50" y="29"></rect> <text x="140.75" y="44"><ident-token "url"></text> </g> <path d="M231.5 40h10"></path> <path d="M241.5 40h10"></path> <g class="terminal "> <path d="M251.5 40h0.0"></path> <path d="M280.0 40h0.0"></path> <rect height="22" rx="10" ry="10" width="28.5" x="251.5" y="29"></rect> <text x="265.75" y="44">(</text> </g> <path d="M280.0 40h10"></path> <path d="M290.0 40h10"></path> <g class="non-terminal "> <path d="M300.0 40h0.0"></path> <path d="M345.5 40h0.0"></path> <rect height="22" width="45.5" x="300" y="29"></rect> <text x="322.75" y="44">ws*</text> </g> <path d="M345.5 40h10"></path> <g> <path d="M355.5 40h0.0"></path> <path d="M756.0 40h0.0"></path> <path d="M355.5 40a10 10 0 0 0 10 -10v0a10 10 0 0 1 10 -10"></path> <g> <path d="M375.5 20h360.5"></path> </g> <path d="M736.0 20a10 10 0 0 1 10 10v0a10 10 0 0 0 10 10"></path> <path d="M355.5 40h20"></path> <g> <path d="M375.5 40h0.0"></path> <path d="M736.0 40h0.0"></path> <path d="M375.5 40h10"></path> <g> <path d="M385.5 40h0.0"></path> <path d="M726.0 40h0.0"></path> <path d="M385.5 40h20"></path> <g class="non-terminal "> <path d="M405.5 40h0.0"></path> <path d="M706.0 40h0.0"></path> <rect height="22" width="300.5" x="405.5" y="29"></rect> <text x="555.75" y="44">not " ' ( ) \ ws or non-printable</text> </g> <path d="M706.0 40h20"></path> <path d="M385.5 40a10 10 0 0 1 10 10v10a10 10 0 0 0 10 10"></path> <g class="non-terminal "> <path d="M405.5 70h114.75"></path> <path d="M591.25 70h114.75"></path> <rect height="22" width="71" x="520.25" y="59"></rect> <text x="555.75" y="74">escape</text> </g> <path d="M706.0 70a10 10 0 0 0 10 -10v-10a10 10 0 0 1 10 -10"></path> </g> <path d="M726.0 40h10"></path> <path d="M385.5 40a10 10 0 0 0 -10 10v29a10 10 0 0 0 10 10"></path> <g> <path d="M385.5 89h340.5"></path> </g> <path d="M726.0 89a10 10 0 0 0 10 -10v-29a10 10 0 0 0 -10 -10"></path> </g> <path d="M736.0 40h20"></path> </g> <path d="M756.0 40h10"></path> <g class="non-terminal "> <path d="M766.0 40h0.0"></path> <path d="M811.5 40h0.0"></path> <rect height="22" width="45.5" x="766" y="29"></rect> <text x="788.75" y="44">ws*</text> </g> <path d="M811.5 40h10"></path> <path d="M821.5 40h10"></path> <g class="terminal "> <path d="M831.5 40h0.0"></path> <path d="M860.0 40h0.0"></path> <rect height="22" rx="10" ry="10" width="28.5" x="831.5" y="29"></rect> <text x="845.75" y="44">)</text> </g> <path d="M860.0 40h10"></path> <path d="M 870.0 40 h 20 m -10 -10 v 20 m 10 -20 v 20"></path> </g> </svg> </div> <dt id="number-token-diagram"><a class="self-link" href="#number-token-diagram"></a><a class="production css" data-link-type="type" href="#typedef-number-token" id="ref-for-typedef-number-token②"><number-token></a> <dd> <div class="railroad"> <svg class="railroad-diagram" height="169" viewBox="0 0 691.5 169" width="691.5"> <g transform="translate(.5 .5)"> <g> <path d="M20 41v20m10 -20v20m-10 -10h20"></path> </g> <g> <path d="M40 51h0.0"></path> <path d="M108.5 51h0.0"></path> <path d="M40.0 51a10 10 0 0 0 10 -10v0a10 10 0 0 1 10 -10"></path> <g class="terminal "> <path d="M60.0 31h0.0"></path> <path d="M88.5 31h0.0"></path> <rect height="22" rx="10" ry="10" width="28.5" x="60" y="20"></rect> <text x="74.25" y="35">+</text> </g> <path d="M88.5 31a10 10 0 0 1 10 10v0a10 10 0 0 0 10 10"></path> <path d="M40.0 51h20"></path> <g> <path d="M60.0 51h28.5"></path> </g> <path d="M88.5 51h20"></path> <path d="M40.0 51a10 10 0 0 1 10 10v0a10 10 0 0 0 10 10"></path> <g class="terminal "> <path d="M60.0 71h0.0"></path> <path d="M88.5 71h0.0"></path> <rect height="22" rx="10" ry="10" width="28.5" x="60" y="60"></rect> <text x="74.25" y="75">-</text> </g> <path d="M88.5 71a10 10 0 0 0 10 -10v0a10 10 0 0 1 10 -10"></path> </g> <g> <path d="M108.5 51h0.0"></path> <path d="M382.0 51h0.0"></path> <path d="M108.5 51h20"></path> <g> <path d="M128.5 51h0.0"></path> <path d="M362.0 51h0.0"></path> <g> <path d="M128.5 51h0.0"></path> <path d="M211.0 51h0.0"></path> <path d="M128.5 51h10"></path> <g class="non-terminal "> <path d="M138.5 51h0.0"></path> <path d="M201.0 51h0.0"></path> <rect height="22" width="62.5" x="138.5" y="40"></rect> <text x="169.75" y="55">digit</text> </g> <path d="M201.0 51h10"></path> <path d="M138.5 51a10 10 0 0 0 -10 10v0a10 10 0 0 0 10 10"></path> <g> <path d="M138.5 71h62.5"></path> </g> <path d="M201.0 71a10 10 0 0 0 10 -10v0a10 10 0 0 0 -10 -10"></path> </g> <path d="M211.0 51h10"></path> <path d="M221.0 51h10"></path> <g class="terminal "> <path d="M231.0 51h0.0"></path> <path d="M259.5 51h0.0"></path> <rect height="22" rx="10" ry="10" width="28.5" x="231" y="40"></rect> <text x="245.25" y="55">.</text> </g> <path d="M259.5 51h10"></path> <path d="M269.5 51h10"></path> <g> <path d="M279.5 51h0.0"></path> <path d="M362.0 51h0.0"></path> <path d="M279.5 51h10"></path> <g class="non-terminal "> <path d="M289.5 51h0.0"></path> <path d="M352.0 51h0.0"></path> <rect height="22" width="62.5" x="289.5" y="40"></rect> <text x="320.75" y="55">digit</text> </g> <path d="M352.0 51h10"></path> <path d="M289.5 51a10 10 0 0 0 -10 10v0a10 10 0 0 0 10 10"></path> <g> <path d="M289.5 71h62.5"></path> </g> <path d="M352.0 71a10 10 0 0 0 10 -10v0a10 10 0 0 0 -10 -10"></path> </g> </g> <path d="M362.0 51h20"></path> <path d="M108.5 51a10 10 0 0 1 10 10v19a10 10 0 0 0 10 10"></path> <g> <path d="M128.5 90h75.5"></path> <path d="M286.5 90h75.5"></path> <path d="M204.0 90h10"></path> <g class="non-terminal "> <path d="M214.0 90h0.0"></path> <path d="M276.5 90h0.0"></path> <rect height="22" width="62.5" x="214" y="79"></rect> <text x="245.25" y="94">digit</text> </g> <path d="M276.5 90h10"></path> <path d="M214.0 90a10 10 0 0 0 -10 10v0a10 10 0 0 0 10 10"></path> <g> <path d="M214.0 110h62.5"></path> </g> <path d="M276.5 110a10 10 0 0 0 10 -10v0a10 10 0 0 0 -10 -10"></path> </g> <path d="M362.0 90a10 10 0 0 0 10 -10v-19a10 10 0 0 1 10 -10"></path> <path d="M108.5 51a10 10 0 0 1 10 10v58a10 10 0 0 0 10 10"></path> <g> <path d="M128.5 129h51.25"></path> <path d="M310.75 129h51.25"></path> <g class="terminal "> <path d="M179.75 129h0.0"></path> <path d="M208.25 129h0.0"></path> <rect height="22" rx="10" ry="10" width="28.5" x="179.75" y="118"></rect> <text x="194" y="133">.</text> </g> <path d="M208.25 129h10"></path> <path d="M218.25 129h10"></path> <g> <path d="M228.25 129h0.0"></path> <path d="M310.75 129h0.0"></path> <path d="M228.25 129h10"></path> <g class="non-terminal "> <path d="M238.25 129h0.0"></path> <path d="M300.75 129h0.0"></path> <rect height="22" width="62.5" x="238.25" y="118"></rect> <text x="269.5" y="133">digit</text> </g> <path d="M300.75 129h10"></path> <path d="M238.25 129a10 10 0 0 0 -10 10v0a10 10 0 0 0 10 10"></path> <g> <path d="M238.25 149h62.5"></path> </g> <path d="M300.75 149a10 10 0 0 0 10 -10v0a10 10 0 0 0 -10 -10"></path> </g> </g> <path d="M362.0 129a10 10 0 0 0 10 -10v-58a10 10 0 0 1 10 -10"></path> </g> <g> <path d="M382.0 51h0.0"></path> <path d="M651.5 51h0.0"></path> <path d="M382.0 51h20"></path> <g> <path d="M402.0 51h229.5"></path> </g> <path d="M631.5 51h20"></path> <path d="M382.0 51a10 10 0 0 1 10 10v19a10 10 0 0 0 10 10"></path> <g> <path d="M402.0 90h0.0"></path> <path d="M631.5 90h0.0"></path> <g> <path d="M402.0 90h0.0"></path> <path d="M470.5 90h0.0"></path> <path d="M402.0 90h20"></path> <g class="terminal "> <path d="M422.0 90h0.0"></path> <path d="M450.5 90h0.0"></path> <rect height="22" rx="10" ry="10" width="28.5" x="422" y="79"></rect> <text x="436.25" y="94">e</text> </g> <path d="M450.5 90h20"></path> <path d="M402.0 90a10 10 0 0 1 10 10v10a10 10 0 0 0 10 10"></path> <g class="terminal "> <path d="M422.0 120h0.0"></path> <path d="M450.5 120h0.0"></path> <rect height="22" rx="10" ry="10" width="28.5" x="422" y="109"></rect> <text x="436.25" y="124">E</text> </g> <path d="M450.5 120a10 10 0 0 0 10 -10v-10a10 10 0 0 1 10 -10"></path> </g> <g> <path d="M470.5 90h0.0"></path> <path d="M539.0 90h0.0"></path> <path d="M470.5 90a10 10 0 0 0 10 -10v0a10 10 0 0 1 10 -10"></path> <g class="terminal "> <path d="M490.5 70h0.0"></path> <path d="M519.0 70h0.0"></path> <rect height="22" rx="10" ry="10" width="28.5" x="490.5" y="59"></rect> <text x="504.75" y="74">+</text> </g> <path d="M519.0 70a10 10 0 0 1 10 10v0a10 10 0 0 0 10 10"></path> <path d="M470.5 90h20"></path> <g> <path d="M490.5 90h28.5"></path> </g> <path d="M519.0 90h20"></path> <path d="M470.5 90a10 10 0 0 1 10 10v0a10 10 0 0 0 10 10"></path> <g class="terminal "> <path d="M490.5 110h0.0"></path> <path d="M519.0 110h0.0"></path> <rect height="22" rx="10" ry="10" width="28.5" x="490.5" y="99"></rect> <text x="504.75" y="114">-</text> </g> <path d="M519.0 110a10 10 0 0 0 10 -10v0a10 10 0 0 1 10 -10"></path> </g> <path d="M539.0 90h10"></path> <g> <path d="M549.0 90h0.0"></path> <path d="M631.5 90h0.0"></path> <path d="M549.0 90h10"></path> <g class="non-terminal "> <path d="M559.0 90h0.0"></path> <path d="M621.5 90h0.0"></path> <rect height="22" width="62.5" x="559" y="79"></rect> <text x="590.25" y="94">digit</text> </g> <path d="M621.5 90h10"></path> <path d="M559.0 90a10 10 0 0 0 -10 10v0a10 10 0 0 0 10 10"></path> <g> <path d="M559.0 110h62.5"></path> </g> <path d="M621.5 110a10 10 0 0 0 10 -10v0a10 10 0 0 0 -10 -10"></path> </g> </g> <path d="M631.5 90a10 10 0 0 0 10 -10v-19a10 10 0 0 1 10 -10"></path> </g> <path d="M 651.5 51 h 20 m -10 -10 v 20 m 10 -20 v 20"></path> </g> </svg> </div> <dt id="dimension-token-diagram"><a class="self-link" href="#dimension-token-diagram"></a><a class="production css" data-link-type="type" href="#typedef-dimension-token" id="ref-for-typedef-dimension-token③"><dimension-token></a> <dd> <div class="railroad"> <svg class="railroad-diagram" height="62" viewBox="0 0 389.5 62" width="389.5"> <g transform="translate(.5 .5)"> <g> <path d="M20 21v20m10 -20v20m-10 -10h20"></path> </g> <path d="M40 31h10"></path> <g class="non-terminal "> <path d="M50 31h0.0"></path> <path d="M189.0 31h0.0"></path> <rect height="22" width="139" x="50" y="20"></rect> <text x="119.5" y="35"><number-token></text> </g> <path d="M189.0 31h10"></path> <path d="M199.0 31h10"></path> <g class="non-terminal "> <path d="M209.0 31h0.0"></path> <path d="M339.5 31h0.0"></path> <rect height="22" width="130.5" x="209" y="20"></rect> <text x="274.25" y="35"><ident-token></text> </g> <path d="M339.5 31h10"></path> <path d="M 349.5 31 h 20 m -10 -10 v 20 m 10 -20 v 20"></path> </g> </svg> </div> <dt id="percentage-token-diagram"><a class="self-link" href="#percentage-token-diagram"></a><a class="production css" data-link-type="type" href="#typedef-percentage-token" id="ref-for-typedef-percentage-token①"><percentage-token></a> <dd> <div class="railroad"> <svg class="railroad-diagram" height="62" viewBox="0 0 287.5 62" width="287.5"> <g transform="translate(.5 .5)"> <g> <path d="M20 21v20m10 -20v20m-10 -10h20"></path> </g> <path d="M40 31h10"></path> <g class="non-terminal "> <path d="M50 31h0.0"></path> <path d="M189.0 31h0.0"></path> <rect height="22" width="139" x="50" y="20"></rect> <text x="119.5" y="35"><number-token></text> </g> <path d="M189.0 31h10"></path> <path d="M199.0 31h10"></path> <g class="terminal "> <path d="M209.0 31h0.0"></path> <path d="M237.5 31h0.0"></path> <rect height="22" rx="10" ry="10" width="28.5" x="209" y="20"></rect> <text x="223.25" y="35">%</text> </g> <path d="M237.5 31h10"></path> <path d="M 247.5 31 h 20 m -10 -10 v 20 m 10 -20 v 20"></path> </g> </svg> </div> <dt id="CDO-token-diagram"><a class="self-link" href="#CDO-token-diagram"></a><a class="production css" data-link-type="type" href="#typedef-cdo-token" id="ref-for-typedef-cdo-token"><CDO-token></a> <dd> <div class="railroad"> <svg class="railroad-diagram" height="62" viewBox="0 0 213.5 62" width="213.5"> <g transform="translate(.5 .5)"> <g> <path d="M20 21v20m10 -20v20m-10 -10h20"></path> </g> <path d="M40 31h10"></path> <g class="terminal "> <path d="M50 31h0.0"></path> <path d="M163.5 31h0.0"></path> <rect height="22" rx="10" ry="10" width="113.5" x="50" y="20"></rect> <text x="106.75" y="35"><<!---->!--</text> </g> <path d="M163.5 31h10"></path> <path d="M 173.5 31 h 20 m -10 -10 v 20 m 10 -20 v 20"></path> </g> </svg> </div> <dt id="CDC-token-diagram"><a class="self-link" href="#CDC-token-diagram"></a><a class="production css" data-link-type="type" href="#typedef-cdc-token" id="ref-for-typedef-cdc-token"><CDC-token></a> <dd> <div class="railroad"> <svg class="railroad-diagram" height="62" viewBox="0 0 145.5 62" width="145.5"> <g transform="translate(.5 .5)"> <g> <path d="M20 21v20m10 -20v20m-10 -10h20"></path> </g> <path d="M40 31h10"></path> <g class="terminal "> <path d="M50 31h0.0"></path> <path d="M95.5 31h0.0"></path> <rect height="22" rx="10" ry="10" width="45.5" x="50" y="20"></rect> <text x="72.75" y="35">--></text> </g> <path d="M95.5 31h10"></path> <path d="M 105.5 31 h 20 m -10 -10 v 20 m 10 -20 v 20"></path> </g> </svg> </div> <dt id="unicode-range-token-diagram"><a class="self-link" href="#unicode-range-token-diagram"></a><a class="production css" data-link-type="type" href="#typedef-unicode-range-token" id="ref-for-typedef-unicode-range-token①"><unicode-range-token></a> <dd> <div class="railroad"> <svg class="railroad-diagram" height="203" viewBox="0 0 580.5 203" width="580.5"> <g transform="translate(.5 .5)"> <g> <path d="M20 21v20m10 -20v20m-10 -10h20"></path> </g> <g> <path d="M40 31h0.0"></path> <path d="M108.5 31h0.0"></path> <path d="M40.0 31h20"></path> <g class="terminal "> <path d="M60.0 31h0.0"></path> <path d="M88.5 31h0.0"></path> <rect height="22" rx="10" ry="10" width="28.5" x="60" y="20"></rect> <text x="74.25" y="35">U</text> </g> <path d="M88.5 31h20"></path> <path d="M40.0 31a10 10 0 0 1 10 10v10a10 10 0 0 0 10 10"></path> <g class="terminal "> <path d="M60.0 61h0.0"></path> <path d="M88.5 61h0.0"></path> <rect height="22" rx="10" ry="10" width="28.5" x="60" y="50"></rect> <text x="74.25" y="65">u</text> </g> <path d="M88.5 61a10 10 0 0 0 10 -10v-10a10 10 0 0 1 10 -10"></path> </g> <path d="M108.5 31h10"></path> <g class="terminal "> <path d="M118.5 31h0.0"></path> <path d="M147.0 31h0.0"></path> <rect height="22" rx="10" ry="10" width="28.5" x="118.5" y="20"></rect> <text x="132.75" y="35">+</text> </g> <path d="M147.0 31h10"></path> <g> <path d="M157.0 31h0.0"></path> <path d="M540.5 31h0.0"></path> <path d="M157.0 31h20"></path> <g> <path d="M177.0 31h113.5"></path> <path d="M407.0 31h113.5"></path> <path d="M290.5 31h10"></path> <g class="non-terminal "> <path d="M300.5 31h0.0"></path> <path d="M397.0 31h0.0"></path> <rect height="22" width="96.5" x="300.5" y="20"></rect> <text x="348.75" y="35">hex digit</text> </g> <path d="M397.0 31h10"></path> <path d="M300.5 31a10 10 0 0 0 -10 10v7a10 10 0 0 0 10 10"></path> <g class="non-terminal "> <path d="M300.5 58h11.75"></path> <path d="M385.25 58h11.75"></path> <text class="comment" x="348.75" y="63">1-6 times</text> </g> <path d="M397.0 58a10 10 0 0 0 10 -10v-7a10 10 0 0 0 -10 -10"></path> </g> <path d="M520.5 31h20"></path> <path d="M157.0 31a10 10 0 0 1 10 10v43a10 10 0 0 0 10 10"></path> <g> <path d="M177.0 94h0.0"></path> <path d="M520.5 94h0.0"></path> <g> <path d="M177.0 94h0.0"></path> <path d="M333.5 94h0.0"></path> <path d="M177.0 94a10 10 0 0 0 10 -10v0a10 10 0 0 1 10 -10"></path> <g> <path d="M197.0 74h116.5"></path> </g> <path d="M313.5 74a10 10 0 0 1 10 10v0a10 10 0 0 0 10 10"></path> <path d="M177.0 94h20"></path> <g> <path d="M197.0 94h0.0"></path> <path d="M313.5 94h0.0"></path> <path d="M197.0 94h10"></path> <g class="non-terminal "> <path d="M207.0 94h0.0"></path> <path d="M303.5 94h0.0"></path> <rect height="22" width="96.5" x="207" y="83"></rect> <text x="255.25" y="98">hex digit</text> </g> <path d="M303.5 94h10"></path> <path d="M207.0 94a10 10 0 0 0 -10 10v7a10 10 0 0 0 10 10"></path> <g class="non-terminal "> <path d="M207.0 121h11.75"></path> <path d="M291.75 121h11.75"></path> <text class="comment" x="255.25" y="126">1-5 times</text> </g> <path d="M303.5 121a10 10 0 0 0 10 -10v-7a10 10 0 0 0 -10 -10"></path> </g> <path d="M313.5 94h20"></path> </g> <path d="M333.5 94h10"></path> <g> <path d="M343.5 94h0.0"></path> <path d="M520.5 94h0.0"></path> <path d="M343.5 94h10"></path> <g class="terminal "> <path d="M353.5 94h64.25"></path> <path d="M446.25 94h64.25"></path> <rect height="22" rx="10" ry="10" width="28.5" x="417.75" y="83"></rect> <text x="432" y="98">?</text> </g> <path d="M510.5 94h10"></path> <path d="M353.5 94a10 10 0 0 0 -10 10v7a10 10 0 0 0 10 10"></path> <g class="non-terminal "> <path d="M353.5 121h0.0"></path> <path d="M510.5 121h0.0"></path> <text class="comment" x="432" y="126">1 to (6-digits) times</text> </g> <path d="M510.5 121a10 10 0 0 0 10 -10v-7a10 10 0 0 0 -10 -10"></path> </g> </g> <path d="M520.5 94a10 10 0 0 0 10 -10v-43a10 10 0 0 1 10 -10"></path> <path d="M157.0 31a10 10 0 0 1 10 10v97a10 10 0 0 0 10 10"></path> <g> <path d="M177.0 148h21.0"></path> <path d="M499.5 148h21.0"></path> <g> <path d="M198.0 148h0.0"></path> <path d="M314.5 148h0.0"></path> <path d="M198.0 148h10"></path> <g class="non-terminal "> <path d="M208.0 148h0.0"></path> <path d="M304.5 148h0.0"></path> <rect height="22" width="96.5" x="208" y="137"></rect> <text x="256.25" y="152">hex digit</text> </g> <path d="M304.5 148h10"></path> <path d="M208.0 148a10 10 0 0 0 -10 10v7a10 10 0 0 0 10 10"></path> <g class="non-terminal "> <path d="M208.0 175h11.75"></path> <path d="M292.75 175h11.75"></path> <text class="comment" x="256.25" y="180">1-6 times</text> </g> <path d="M304.5 175a10 10 0 0 0 10 -10v-7a10 10 0 0 0 -10 -10"></path> </g> <path d="M314.5 148h10"></path> <path d="M324.5 148h10"></path> <g class="terminal "> <path d="M334.5 148h0.0"></path> <path d="M363.0 148h0.0"></path> <rect height="22" rx="10" ry="10" width="28.5" x="334.5" y="137"></rect> <text x="348.75" y="152">-</text> </g> <path d="M363.0 148h10"></path> <path d="M373.0 148h10"></path> <g> <path d="M383.0 148h0.0"></path> <path d="M499.5 148h0.0"></path> <path d="M383.0 148h10"></path> <g class="non-terminal "> <path d="M393.0 148h0.0"></path> <path d="M489.5 148h0.0"></path> <rect height="22" width="96.5" x="393" y="137"></rect> <text x="441.25" y="152">hex digit</text> </g> <path d="M489.5 148h10"></path> <path d="M393.0 148a10 10 0 0 0 -10 10v7a10 10 0 0 0 10 10"></path> <g class="non-terminal "> <path d="M393.0 175h11.75"></path> <path d="M477.75 175h11.75"></path> <text class="comment" x="441.25" y="180">1-6 times</text> </g> <path d="M489.5 175a10 10 0 0 0 10 -10v-7a10 10 0 0 0 -10 -10"></path> </g> </g> <path d="M520.5 148a10 10 0 0 0 10 -10v-97a10 10 0 0 1 10 -10"></path> </g> <path d="M 540.5 31 h 20 m -10 -10 v 20 m 10 -20 v 20"></path> </g> </svg> </div> </dl> <h3 class="heading settled" data-level="4.2" id="tokenizer-definitions"><span class="secno">4.2. </span><span class="content"> Definitions</span><a class="self-link" href="#tokenizer-definitions"></a></h3> <p>This section defines several terms used during the tokenization phase.</p> <dl> <dt><dfn class="dfn-paneled" data-dfn-type="dfn" data-export id="next-input-code-point">next input code point</dfn> <dd> The first <a data-link-type="dfn" href="https://infra.spec.whatwg.org/#code-point" id="ref-for-code-point②②">code point</a> in the <a data-link-type="dfn" href="#input-stream" id="ref-for-input-stream">input stream</a> that has not yet been consumed. <dt><dfn class="dfn-paneled" data-dfn-type="dfn" data-export id="current-input-code-point">current input code point</dfn> <dd> The last <a data-link-type="dfn" href="https://infra.spec.whatwg.org/#code-point" id="ref-for-code-point②③">code point</a> to have been consumed. <dt><dfn class="dfn-paneled" data-dfn-type="dfn" data-export id="reconsume-the-current-input-code-point">reconsume the current input code point</dfn> <dd> Push the <a data-link-type="dfn" href="#current-input-code-point" id="ref-for-current-input-code-point">current input code point</a> back onto the front of the <a data-link-type="dfn" href="#input-stream" id="ref-for-input-stream①">input stream</a>, so that the next time you are instructed to consume the <a data-link-type="dfn" href="#next-input-code-point" id="ref-for-next-input-code-point">next input code point</a>, it will instead reconsume the <span id="ref-for-current-input-code-point①">current input code point</span>. <dt><dfn class="dfn-paneled" data-dfn-type="dfn" data-export id="eof-code-point">EOF code point</dfn> <dd> A conceptual <a data-link-type="dfn" href="https://infra.spec.whatwg.org/#code-point" id="ref-for-code-point②④">code point</a> representing the end of the <a data-link-type="dfn" href="#input-stream" id="ref-for-input-stream②">input stream</a>. Whenever the <span id="ref-for-input-stream③">input stream</span> is empty, the <a data-link-type="dfn" href="#next-input-code-point" id="ref-for-next-input-code-point①">next input code point</a> is always an EOF code point. <dt><dfn class="dfn-paneled" data-dfn-type="dfn" data-export id="digit">digit</dfn> <dd> A <a data-link-type="dfn" href="https://infra.spec.whatwg.org/#code-point" id="ref-for-code-point②⑤">code point</a> between U+0030 DIGIT ZERO (0) and U+0039 DIGIT NINE (9) inclusive. <dt><dfn class="dfn-paneled" data-dfn-type="dfn" data-export id="hex-digit">hex digit</dfn> <dd> A <a data-link-type="dfn" href="#digit" id="ref-for-digit">digit</a>, or a <a data-link-type="dfn" href="https://infra.spec.whatwg.org/#code-point" id="ref-for-code-point②⑥">code point</a> between U+0041 LATIN CAPITAL LETTER A (A) and U+0046 LATIN CAPITAL LETTER F (F) inclusive, or a <span id="ref-for-code-point②⑦">code point</span> between U+0061 LATIN SMALL LETTER A (a) and U+0066 LATIN SMALL LETTER F (f) inclusive. <dt><dfn class="dfn-paneled" data-dfn-type="dfn" data-export id="uppercase-letter">uppercase letter</dfn> <dd> A <a data-link-type="dfn" href="https://infra.spec.whatwg.org/#code-point" id="ref-for-code-point②⑧">code point</a> between U+0041 LATIN CAPITAL LETTER A (A) and U+005A LATIN CAPITAL LETTER Z (Z) inclusive. <dt><dfn class="dfn-paneled" data-dfn-type="dfn" data-export id="lowercase-letter">lowercase letter</dfn> <dd> A <a data-link-type="dfn" href="https://infra.spec.whatwg.org/#code-point" id="ref-for-code-point②⑨">code point</a> between U+0061 LATIN SMALL LETTER A (a) and U+007A LATIN SMALL LETTER Z (z) inclusive. <dt><dfn class="dfn-paneled" data-dfn-type="dfn" data-export id="letter">letter</dfn> <dd> An <a data-link-type="dfn" href="#uppercase-letter" id="ref-for-uppercase-letter">uppercase letter</a> or a <a data-link-type="dfn" href="#lowercase-letter" id="ref-for-lowercase-letter">lowercase letter</a>. <dt><dfn class="dfn-paneled" data-dfn-type="dfn" data-export id="non-ascii-ident-code-point">non-ASCII ident code point</dfn> <dd> A <a data-link-type="dfn" href="https://infra.spec.whatwg.org/#code-point" id="ref-for-code-point③⓪">code point</a> whose value is any of: <ul> <li data-md> <p>U+00B7</p> <li data-md> <p>between U+00C0 and U+00D6</p> <li data-md> <p>between U+00D8 and U+00F6</p> <li data-md> <p>between U+00F8 and U+037D</p> <li data-md> <p>between U+037F and U+1FFF</p> <li data-md> <p>U+200C</p> <li data-md> <p>U+200D</p> <li data-md> <p>U+203F</p> <li data-md> <p>U+2040</p> <li data-md> <p>between U+2070 and U+218F</p> <li data-md> <p>between U+2C00 and U+2FEF</p> <li data-md> <p>between U+3001 and U+D7FF</p> <li data-md> <p>between U+F900 and U+FDCF</p> <li data-md> <p>between U+FDF0 and U+FFFD</p> <li data-md> <p>greater than or equal to U+10000</p> </ul> <p>All of these ranges are inclusive.</p> <details class="note"> <summary>Why these character, specifically?</summary> <p>This matches the list of non-ASCII codepoints allowed to be used in HTML <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/custom-elements.html#valid-custom-element-name" id="ref-for-valid-custom-element-name">valid custom element names</a>. It excludes a number of characters that appear as whitespace, or that can cause rendering or parsing issues in some tools, such as the direction override codepoints.</p> <p>Note that this is a weaker set of restrictions than <a href="https://unicode.org/reports/tr31/#Figure_Code_Point_Categories_for_Identifier_Parsing">UAX 31</a> recommends for identifiers (used by languages such as JavaScript to restrict their identifier syntax), allowing things such as starting an identifier with a combining character. Consistency with HTML custom element names (and thus, the ability to write selectors for all custom elements without having to use escapes) was considered valuable, and the set of characters restricted by HTML covers the "high value" restrictions well.</p> <p>These restrictions do not avoid all possible confusing renderings; mixing characters from LTR and RTL scripts can still result in unexpected visual transposition in most text editors, for example. Source text can contain the restricted characters in non-ident contexts, as well: most of them are completely valid in strings, for example. Even when used in a way that creates invalid CSS, the parsing errors they cause might be limited to something unimportant, while their effect on rendering the source text in code review tools might be significant and/or malicious. For more details on these sorts of "source text attacks", see <a href="https://blog.rust-lang.org/2021/11/01/cve-2021-42574.html">this Rust-lang blog post</a> <small><a href="https://web.archive.org/web/20220323175009/https://blog.rust-lang.org/2021/11/01/cve-2021-42574.html">(archived)</a></small>.</p> </details> <dt><dfn class="dfn-paneled" data-dfn-type="dfn" data-export data-lt="ident-start code point | name-start code point" id="ident-start-code-point">ident-start code point<span id="name-start-code-point"></span><span id="identifier-start-code-point"></span></dfn> <dd> A <a data-link-type="dfn" href="#letter" id="ref-for-letter">letter</a>, a <a data-link-type="dfn" href="#non-ascii-ident-code-point" id="ref-for-non-ascii-ident-code-point">non-ASCII ident code point</a>, or U+005F LOW LINE (_). <dt><dfn class="dfn-paneled" data-dfn-type="dfn" data-export id="ident-code-point">ident code point<span id="name-code-point"></span><span id="identifier-code-point"></span></dfn> <dd> An <a data-link-type="dfn" href="#ident-start-code-point" id="ref-for-ident-start-code-point①">ident-start code point</a>, a <a data-link-type="dfn" href="#digit" id="ref-for-digit①">digit</a>, or U+002D HYPHEN-MINUS (-). <dt><dfn class="dfn-paneled" data-dfn-type="dfn" data-export id="non-printable-code-point">non-printable code point</dfn> <dd> A <a data-link-type="dfn" href="https://infra.spec.whatwg.org/#code-point" id="ref-for-code-point③①">code point</a> between U+0000 NULL and U+0008 BACKSPACE inclusive, or U+000B LINE TABULATION, or a <span id="ref-for-code-point③②">code point</span> between U+000E SHIFT OUT and U+001F INFORMATION SEPARATOR ONE inclusive, or U+007F DELETE. <dt><dfn class="dfn-paneled" data-dfn-type="dfn" data-export id="newline">newline</dfn> <dd> U+000A LINE FEED. <span class="note"> Note that U+000D CARRIAGE RETURN and U+000C FORM FEED are not included in this definition, as they are converted to U+000A LINE FEED during <a href="#input-preprocessing">preprocessing</a>. </span> <dt><dfn class="dfn-paneled" data-dfn-type="dfn" data-export id="whitespace">whitespace</dfn> <dd>A <a data-link-type="dfn" href="#newline" id="ref-for-newline①">newline</a>, U+0009 CHARACTER TABULATION, or U+0020 SPACE. <dt><dfn class="dfn-paneled" data-dfn-type="dfn" data-export id="maximum-allowed-code-point">maximum allowed code point</dfn> <dd>The greatest <a data-link-type="dfn" href="https://infra.spec.whatwg.org/#code-point" id="ref-for-code-point③③">code point</a> defined by Unicode: U+10FFFF. <dt><dfn class="dfn-paneled" data-dfn-type="dfn" data-export data-lt="ident sequence | CSS ident sequence" id="ident-sequence">ident sequence<span id="css-identifier"></span><span id="identifier"></span></dfn> <dd> A sequence of <a data-link-type="dfn" href="https://infra.spec.whatwg.org/#code-point" id="ref-for-code-point③④">code points</a> that has the same syntax as an <a class="production css" data-link-type="type" href="#typedef-ident-token" id="ref-for-typedef-ident-token②"><ident-token></a>. <p class="note" role="note"><span class="marker">Note:</span> The part of an <a class="production css" data-link-type="type" href="#typedef-at-keyword-token" id="ref-for-typedef-at-keyword-token③"><at-keyword-token></a> after the "@", the part of a <a class="production css" data-link-type="type" href="#typedef-hash-token" id="ref-for-typedef-hash-token②"><hash-token></a> (with the "id" type flag) after the "#", the part of a <a class="production css" data-link-type="type" href="#typedef-function-token" id="ref-for-typedef-function-token②"><function-token></a> before the "(", and the unit of a <a class="production css" data-link-type="type" href="#typedef-dimension-token" id="ref-for-typedef-dimension-token④"><dimension-token></a> are all <a data-link-type="dfn" href="#ident-sequence" id="ref-for-ident-sequence③">ident sequences</a>.</p> </dl> <h3 class="heading settled" data-level="4.3" id="tokenizer-algorithms"><span class="secno">4.3. </span><span class="content"> Tokenizer Algorithms</span><a class="self-link" href="#tokenizer-algorithms"></a></h3> <p>The algorithms defined in this section transform a stream of <a data-link-type="dfn" href="https://infra.spec.whatwg.org/#code-point" id="ref-for-code-point③⑤">code points</a> into a stream of tokens.</p> <h4 class="heading settled" data-level="4.3.1" id="consume-token"><span class="secno">4.3.1. </span><span class="content"> Consume a token</span><a class="self-link" href="#consume-token"></a></h4> <p>This section describes how to <dfn class="dfn-paneled" data-dfn-for="tokenizer" data-dfn-type="dfn" data-noexport id="tokenizer-consume-a-token">consume a token</dfn> from a stream of <a data-link-type="dfn" href="https://infra.spec.whatwg.org/#code-point" id="ref-for-code-point③⑥">code points</a>. It additionally takes an optional boolean <var>unicode ranges allowed</var>, defaulting to false. It will return a single token of any type.</p> <p><a data-link-type="dfn" href="#consume-comments" id="ref-for-consume-comments">Consume comments</a>.</p> <p>Consume the <a data-link-type="dfn" href="#next-input-code-point" id="ref-for-next-input-code-point②">next input code point</a>.</p> <dl> <dt><a data-link-type="dfn" href="#whitespace" id="ref-for-whitespace①">whitespace</a> <dd> Consume as much <a data-link-type="dfn" href="#whitespace" id="ref-for-whitespace②">whitespace</a> as possible. Return a <a class="production css" data-link-type="type" href="#typedef-whitespace-token" id="ref-for-typedef-whitespace-token①"><whitespace-token></a>. <dt>U+0022 QUOTATION MARK (") <dd> <a data-link-type="dfn" href="#consume-a-string-token" id="ref-for-consume-a-string-token">Consume a string token</a> and return it. <dt>U+0023 NUMBER SIGN (#) <dd> If the <a data-link-type="dfn" href="#next-input-code-point" id="ref-for-next-input-code-point③">next input code point</a> is an <a data-link-type="dfn" href="#ident-code-point" id="ref-for-ident-code-point①">ident code point</a> or the <span id="ref-for-next-input-code-point④">next two input code points</span> <a data-link-type="dfn" href="#check-if-two-code-points-are-a-valid-escape" id="ref-for-check-if-two-code-points-are-a-valid-escape">are a valid escape</a>, then: <ol> <li> Create a <a class="production css" data-link-type="type" href="#typedef-hash-token" id="ref-for-typedef-hash-token③"><hash-token></a>. <li> If the <a data-link-type="dfn" href="#next-input-code-point" id="ref-for-next-input-code-point⑤">next 3 input code points</a> <a data-link-type="dfn" href="#check-if-three-code-points-would-start-an-ident-sequence" id="ref-for-check-if-three-code-points-would-start-an-ident-sequence">would start an ident sequence</a>, set the <a class="production css" data-link-type="type" href="#typedef-hash-token" id="ref-for-typedef-hash-token④"><hash-token></a>’s type flag to "id". <li> <a data-link-type="dfn" href="#consume-an-ident-sequence" id="ref-for-consume-an-ident-sequence">Consume an ident sequence</a>, and set the <a class="production css" data-link-type="type" href="#typedef-hash-token" id="ref-for-typedef-hash-token⑤"><hash-token></a>’s value to the returned string. <li> Return the <a class="production css" data-link-type="type" href="#typedef-hash-token" id="ref-for-typedef-hash-token⑥"><hash-token></a>. </ol> <p>Otherwise, return a <a class="production css" data-link-type="type" href="#typedef-delim-token" id="ref-for-typedef-delim-token①"><delim-token></a> with its value set to the <a data-link-type="dfn" href="#current-input-code-point" id="ref-for-current-input-code-point②">current input code point</a>.</p> <dt>U+0027 APOSTROPHE (') <dd> <a data-link-type="dfn" href="#consume-a-string-token" id="ref-for-consume-a-string-token①">Consume a string token</a> and return it. <dt>U+0028 LEFT PARENTHESIS (() <dd> Return a <a href="#tokendef-open-paren" id="ref-for-tokendef-open-paren"><(-token></a>. <dt>U+0029 RIGHT PARENTHESIS ()) <dd> Return a <a href="#tokendef-close-paren" id="ref-for-tokendef-close-paren"><)-token></a>. <dt>U+002B PLUS SIGN (+) <dd> If the input stream <a data-link-type="dfn" href="#check-if-three-code-points-would-start-a-number" id="ref-for-check-if-three-code-points-would-start-a-number">starts with a number</a>, <a data-link-type="dfn" href="#reconsume-the-current-input-code-point" id="ref-for-reconsume-the-current-input-code-point">reconsume the current input code point</a>, <a data-link-type="dfn" href="#consume-a-numeric-token" id="ref-for-consume-a-numeric-token">consume a numeric token</a>, and return it. <p>Otherwise, return a <a class="production css" data-link-type="type" href="#typedef-delim-token" id="ref-for-typedef-delim-token②"><delim-token></a> with its value set to the <a data-link-type="dfn" href="#current-input-code-point" id="ref-for-current-input-code-point③">current input code point</a>.</p> <dt>U+002C COMMA (,) <dd> Return a <a class="production css" data-link-type="type" href="#typedef-comma-token" id="ref-for-typedef-comma-token"><comma-token></a>. <dt>U+002D HYPHEN-MINUS (-) <dd> If the input stream <a data-link-type="dfn" href="#check-if-three-code-points-would-start-a-number" id="ref-for-check-if-three-code-points-would-start-a-number①">starts with a number</a>, <a data-link-type="dfn" href="#reconsume-the-current-input-code-point" id="ref-for-reconsume-the-current-input-code-point①">reconsume the current input code point</a>, <a data-link-type="dfn" href="#consume-a-numeric-token" id="ref-for-consume-a-numeric-token①">consume a numeric token</a>, and return it. <p>Otherwise, if the <a data-link-type="dfn" href="#next-input-code-point" id="ref-for-next-input-code-point⑥">next 2 input code points</a> are U+002D HYPHEN-MINUS U+003E GREATER-THAN SIGN (->), consume them and return a <a class="production css" data-link-type="type" href="#typedef-cdc-token" id="ref-for-typedef-cdc-token①"><CDC-token></a>.</p> <p>Otherwise, if the input stream <a data-link-type="dfn" href="#check-if-three-code-points-would-start-an-ident-sequence" id="ref-for-check-if-three-code-points-would-start-an-ident-sequence①">starts with an ident sequence</a>, <a data-link-type="dfn" href="#reconsume-the-current-input-code-point" id="ref-for-reconsume-the-current-input-code-point②">reconsume the current input code point</a>, <a data-link-type="dfn" href="#consume-an-ident-like-token" id="ref-for-consume-an-ident-like-token">consume an ident-like token</a>, and return it.</p> <p>Otherwise, return a <a class="production css" data-link-type="type" href="#typedef-delim-token" id="ref-for-typedef-delim-token③"><delim-token></a> with its value set to the <a data-link-type="dfn" href="#current-input-code-point" id="ref-for-current-input-code-point④">current input code point</a>.</p> <dt>U+002E FULL STOP (.) <dd> If the input stream <a data-link-type="dfn" href="#check-if-three-code-points-would-start-a-number" id="ref-for-check-if-three-code-points-would-start-a-number②">starts with a number</a>, <a data-link-type="dfn" href="#reconsume-the-current-input-code-point" id="ref-for-reconsume-the-current-input-code-point③">reconsume the current input code point</a>, <a data-link-type="dfn" href="#consume-a-numeric-token" id="ref-for-consume-a-numeric-token②">consume a numeric token</a>, and return it. <p>Otherwise, return a <a class="production css" data-link-type="type" href="#typedef-delim-token" id="ref-for-typedef-delim-token④"><delim-token></a> with its value set to the <a data-link-type="dfn" href="#current-input-code-point" id="ref-for-current-input-code-point⑤">current input code point</a>.</p> <dt>U+003A COLON (:) <dd> Return a <a class="production css" data-link-type="type" href="#typedef-colon-token" id="ref-for-typedef-colon-token"><colon-token></a>. <dt>U+003B SEMICOLON (;) <dd> Return a <a class="production css" data-link-type="type" href="#typedef-semicolon-token" id="ref-for-typedef-semicolon-token①"><semicolon-token></a>. <dt>U+003C LESS-THAN SIGN (<) <dd> If the <a data-link-type="dfn" href="#next-input-code-point" id="ref-for-next-input-code-point⑦">next 3 input code points</a> are U+0021 EXCLAMATION MARK U+002D HYPHEN-MINUS U+002D HYPHEN-MINUS (!--), consume them and return a <a class="production css" data-link-type="type" href="#typedef-cdo-token" id="ref-for-typedef-cdo-token①"><CDO-token></a>. <p>Otherwise, return a <a class="production css" data-link-type="type" href="#typedef-delim-token" id="ref-for-typedef-delim-token⑤"><delim-token></a> with its value set to the <a data-link-type="dfn" href="#current-input-code-point" id="ref-for-current-input-code-point⑥">current input code point</a>.</p> <dt>U+0040 COMMERCIAL AT (@) <dd> If the <a data-link-type="dfn" href="#next-input-code-point" id="ref-for-next-input-code-point⑧">next 3 input code points</a> <a data-link-type="dfn" href="#check-if-three-code-points-would-start-an-ident-sequence" id="ref-for-check-if-three-code-points-would-start-an-ident-sequence②">would start an ident sequence</a>, <a data-link-type="dfn" href="#consume-an-ident-sequence" id="ref-for-consume-an-ident-sequence①">consume an ident sequence</a>, create an <a class="production css" data-link-type="type" href="#typedef-at-keyword-token" id="ref-for-typedef-at-keyword-token④"><at-keyword-token></a> with its value set to the returned value, and return it. <p>Otherwise, return a <a class="production css" data-link-type="type" href="#typedef-delim-token" id="ref-for-typedef-delim-token⑥"><delim-token></a> with its value set to the <a data-link-type="dfn" href="#current-input-code-point" id="ref-for-current-input-code-point⑦">current input code point</a>.</p> <dt>U+005B LEFT SQUARE BRACKET ([) <dd> Return a <a href="#tokendef-open-square" id="ref-for-tokendef-open-square"><[-token></a>. <dt>U+005C REVERSE SOLIDUS (\) <dd> If the input stream <a data-link-type="dfn" href="#check-if-two-code-points-are-a-valid-escape" id="ref-for-check-if-two-code-points-are-a-valid-escape①">starts with a valid escape</a>, <a data-link-type="dfn" href="#reconsume-the-current-input-code-point" id="ref-for-reconsume-the-current-input-code-point④">reconsume the current input code point</a>, <a data-link-type="dfn" href="#consume-an-ident-like-token" id="ref-for-consume-an-ident-like-token①">consume an ident-like token</a>, and return it. <p>Otherwise, this is a <a data-link-type="dfn" href="#parse-error" id="ref-for-parse-error">parse error</a>. Return a <a class="production css" data-link-type="type" href="#typedef-delim-token" id="ref-for-typedef-delim-token⑦"><delim-token></a> with its value set to the <a data-link-type="dfn" href="#current-input-code-point" id="ref-for-current-input-code-point⑧">current input code point</a>.</p> <dt>U+005D RIGHT SQUARE BRACKET (]) <dd> Return a <a href="#tokendef-close-square" id="ref-for-tokendef-close-square"><]-token></a>. <dt>U+007B LEFT CURLY BRACKET ({) <dd> Return a <a href="#tokendef-open-curly" id="ref-for-tokendef-open-curly③"><{-token></a>. <dt>U+007D RIGHT CURLY BRACKET (}) <dd> Return a <a href="#tokendef-close-curly" id="ref-for-tokendef-close-curly①"><}-token></a>. <dt><a data-link-type="dfn" href="#digit" id="ref-for-digit②">digit</a> <dd> <a data-link-type="dfn" href="#reconsume-the-current-input-code-point" id="ref-for-reconsume-the-current-input-code-point⑤">Reconsume the current input code point</a>, <a data-link-type="dfn" href="#consume-a-numeric-token" id="ref-for-consume-a-numeric-token③">consume a numeric token</a>, and return it. <dt>U+0055 LATIN CAPITAL LETTER U (U) <dt>u+0075 LATIN LOWERCASE LETTER U (u) <dd> If <var>unicode ranges allowed</var> is true and the input stream <a data-link-type="dfn" href="#check-if-three-code-points-would-start-a-unicode-range" id="ref-for-check-if-three-code-points-would-start-a-unicode-range">would start a unicode-range</a>, <a data-link-type="dfn" href="#reconsume-the-current-input-code-point" id="ref-for-reconsume-the-current-input-code-point⑥">reconsume the current input code point</a>, <a data-link-type="dfn" href="#consume-a-unicode-range-token" id="ref-for-consume-a-unicode-range-token">consume a unicode-range token</a>, and return it. <p>Otherwise, <a data-link-type="dfn" href="#reconsume-the-current-input-code-point" id="ref-for-reconsume-the-current-input-code-point⑦">reconsume the current input code point</a>, <a data-link-type="dfn" href="#consume-an-ident-like-token" id="ref-for-consume-an-ident-like-token②">consume an ident-like token</a>, and return it.</p> <dt><a data-link-type="dfn" href="#ident-start-code-point" id="ref-for-ident-start-code-point②">ident-start code point</a> <dd> <a data-link-type="dfn" href="#reconsume-the-current-input-code-point" id="ref-for-reconsume-the-current-input-code-point⑧">Reconsume the current input code point</a>, <a data-link-type="dfn" href="#consume-an-ident-like-token" id="ref-for-consume-an-ident-like-token③">consume an ident-like token</a>, and return it. <dt>EOF <dd> Return an <a class="production css" data-link-type="type" href="#typedef-eof-token" id="ref-for-typedef-eof-token①"><EOF-token></a>. <dt>anything else <dd> Return a <a class="production css" data-link-type="type" href="#typedef-delim-token" id="ref-for-typedef-delim-token⑧"><delim-token></a> with its value set to the <a data-link-type="dfn" href="#current-input-code-point" id="ref-for-current-input-code-point⑨">current input code point</a>. </dl> <h4 class="heading settled" data-level="4.3.2" id="consume-comment"><span class="secno">4.3.2. </span><span class="content"> Consume comments</span><a class="self-link" href="#consume-comment"></a></h4> <p>This section describes how to <dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport id="consume-comments">consume comments</dfn> from a stream of <a data-link-type="dfn" href="https://infra.spec.whatwg.org/#code-point" id="ref-for-code-point③⑦">code points</a>. It returns nothing.</p> <p>If the <a data-link-type="dfn" href="#next-input-code-point" id="ref-for-next-input-code-point⑨">next two input code point</a> are U+002F SOLIDUS (/) followed by a U+002A ASTERISK (*), consume them and all following <a data-link-type="dfn" href="https://infra.spec.whatwg.org/#code-point" id="ref-for-code-point③⑧">code points</a> up to and including the first U+002A ASTERISK (*) followed by a U+002F SOLIDUS (/), or up to an EOF code point. Return to the start of this step.</p> <p>If the preceding paragraph ended by consuming an EOF code point, this is a <a data-link-type="dfn" href="#parse-error" id="ref-for-parse-error①">parse error</a>.</p> <p>Return nothing.</p> <h4 class="heading settled" data-level="4.3.3" id="consume-numeric-token"><span class="secno">4.3.3. </span><span class="content"> Consume a numeric token</span><a class="self-link" href="#consume-numeric-token"></a></h4> <p>This section describes how to <dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport id="consume-a-numeric-token">consume a numeric token</dfn> from a stream of <a data-link-type="dfn" href="https://infra.spec.whatwg.org/#code-point" id="ref-for-code-point③⑨">code points</a>. It returns either a <a class="production css" data-link-type="type" href="#typedef-number-token" id="ref-for-typedef-number-token③"><number-token></a>, <a class="production css" data-link-type="type" href="#typedef-percentage-token" id="ref-for-typedef-percentage-token②"><percentage-token></a>, or <a class="production css" data-link-type="type" href="#typedef-dimension-token" id="ref-for-typedef-dimension-token⑤"><dimension-token></a>.</p> <p><a data-link-type="dfn" href="#consume-a-number" id="ref-for-consume-a-number">Consume a number</a> and let <var>number</var> be the result.</p> <p>If the <a data-link-type="dfn" href="#next-input-code-point" id="ref-for-next-input-code-point①⓪">next 3 input code points</a> <a data-link-type="dfn" href="#check-if-three-code-points-would-start-an-ident-sequence" id="ref-for-check-if-three-code-points-would-start-an-ident-sequence③">would start an ident sequence</a>, then:</p> <ol> <li>Create a <a class="production css" data-link-type="type" href="#typedef-dimension-token" id="ref-for-typedef-dimension-token⑥"><dimension-token></a> with the same value, type flag, and sign character as <var>number</var>, and a unit set initially to the empty string. <li><a data-link-type="dfn" href="#consume-an-ident-sequence" id="ref-for-consume-an-ident-sequence②">Consume an ident sequence</a>. Set the <a class="production css" data-link-type="type" href="#typedef-dimension-token" id="ref-for-typedef-dimension-token⑦"><dimension-token></a>’s unit to the returned value. <li>Return the <a class="production css" data-link-type="type" href="#typedef-dimension-token" id="ref-for-typedef-dimension-token⑧"><dimension-token></a>. </ol> <p>Otherwise, if the <a data-link-type="dfn" href="#next-input-code-point" id="ref-for-next-input-code-point①①">next input code point</a> is U+0025 PERCENTAGE SIGN (%), consume it. Create a <a class="production css" data-link-type="type" href="#typedef-percentage-token" id="ref-for-typedef-percentage-token③"><percentage-token></a> with the same value and sign character as <var>number</var>, and return it.</p> <p>Otherwise, create a <a class="production css" data-link-type="type" href="#typedef-number-token" id="ref-for-typedef-number-token④"><number-token></a> with the same value, type flag, and sign character as <var>number</var>, and return it.</p> <h4 class="heading settled" data-level="4.3.4" id="consume-ident-like-token"><span class="secno">4.3.4. </span><span class="content"> Consume an ident-like token</span><a class="self-link" href="#consume-ident-like-token"></a></h4> <p>This section describes how to <dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport id="consume-an-ident-like-token">consume an ident-like token</dfn> from a stream of <a data-link-type="dfn" href="https://infra.spec.whatwg.org/#code-point" id="ref-for-code-point④⓪">code points</a>. It returns an <a class="production css" data-link-type="type" href="#typedef-ident-token" id="ref-for-typedef-ident-token③"><ident-token></a>, <a class="production css" data-link-type="type" href="#typedef-function-token" id="ref-for-typedef-function-token③"><function-token></a>, <a class="production css" data-link-type="type" href="#typedef-url-token" id="ref-for-typedef-url-token②"><url-token></a>, or <a class="production css" data-link-type="type" href="#typedef-bad-url-token" id="ref-for-typedef-bad-url-token"><bad-url-token></a>.</p> <p><a data-link-type="dfn" href="#consume-an-ident-sequence" id="ref-for-consume-an-ident-sequence③">Consume an ident sequence</a>, and let <var>string</var> be the result.</p> <p>If <var>string</var>’s value is an <a data-link-type="dfn" href="https://infra.spec.whatwg.org/#ascii-case-insensitive" id="ref-for-ascii-case-insensitive">ASCII case-insensitive</a> match for "url", and the <a data-link-type="dfn" href="#next-input-code-point" id="ref-for-next-input-code-point①②">next input code point</a> is U+0028 LEFT PARENTHESIS ((), consume it. While the <span id="ref-for-next-input-code-point①③">next two input code points</span> are <a data-link-type="dfn" href="#whitespace" id="ref-for-whitespace③">whitespace</a>, consume the <span id="ref-for-next-input-code-point①④">next input code point</span>. If the <span id="ref-for-next-input-code-point①⑤">next one or two input code points</span> are U+0022 QUOTATION MARK ("), U+0027 APOSTROPHE ('), or <span id="ref-for-whitespace④">whitespace</span> followed by U+0022 QUOTATION MARK (") or U+0027 APOSTROPHE ('), then create a <a class="production css" data-link-type="type" href="#typedef-function-token" id="ref-for-typedef-function-token④"><function-token></a> with its value set to <var>string</var> and return it. Otherwise, <a data-link-type="dfn" href="#consume-a-url-token" id="ref-for-consume-a-url-token">consume a url token</a>, and return it.</p> <p>Otherwise, if the <a data-link-type="dfn" href="#next-input-code-point" id="ref-for-next-input-code-point①⑥">next input code point</a> is U+0028 LEFT PARENTHESIS ((), consume it. Create a <a class="production css" data-link-type="type" href="#typedef-function-token" id="ref-for-typedef-function-token⑤"><function-token></a> with its value set to <var>string</var> and return it.</p> <p>Otherwise, create an <a class="production css" data-link-type="type" href="#typedef-ident-token" id="ref-for-typedef-ident-token④"><ident-token></a> with its value set to <var>string</var> and return it.</p> <h4 class="heading settled" data-level="4.3.5" id="consume-string-token"><span class="secno">4.3.5. </span><span class="content"> Consume a string token</span><a class="self-link" href="#consume-string-token"></a></h4> <p>This section describes how to <dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport id="consume-a-string-token">consume a string token</dfn> from a stream of <a data-link-type="dfn" href="https://infra.spec.whatwg.org/#code-point" id="ref-for-code-point④①">code points</a>. It returns either a <a class="production css" data-link-type="type" href="#typedef-string-token" id="ref-for-typedef-string-token②"><string-token></a> or <a class="production css" data-link-type="type" href="#typedef-bad-string-token" id="ref-for-typedef-bad-string-token"><bad-string-token></a>.</p> <p>This algorithm may be called with an <var>ending code point</var>, which denotes the <a data-link-type="dfn" href="https://infra.spec.whatwg.org/#code-point" id="ref-for-code-point④②">code point</a> that ends the string. If an <var>ending code point</var> is not specified, the <a data-link-type="dfn" href="#current-input-code-point" id="ref-for-current-input-code-point①⓪">current input code point</a> is used.</p> <p>Initially create a <a class="production css" data-link-type="type" href="#typedef-string-token" id="ref-for-typedef-string-token③"><string-token></a> with its value set to the empty string.</p> <p>Repeatedly consume the <a data-link-type="dfn" href="#next-input-code-point" id="ref-for-next-input-code-point①⑦">next input code point</a> from the stream:</p> <dl> <dt><var>ending code point</var> <dd> Return the <a class="production css" data-link-type="type" href="#typedef-string-token" id="ref-for-typedef-string-token④"><string-token></a>. <dt>EOF <dd> This is a <a data-link-type="dfn" href="#parse-error" id="ref-for-parse-error②">parse error</a>. Return the <a class="production css" data-link-type="type" href="#typedef-string-token" id="ref-for-typedef-string-token⑤"><string-token></a>. <dt><a data-link-type="dfn" href="#newline" id="ref-for-newline②">newline</a> <dd> This is a <a data-link-type="dfn" href="#parse-error" id="ref-for-parse-error③">parse error</a>. <a data-link-type="dfn" href="#reconsume-the-current-input-code-point" id="ref-for-reconsume-the-current-input-code-point⑨">Reconsume the current input code point</a>, create a <a class="production css" data-link-type="type" href="#typedef-bad-string-token" id="ref-for-typedef-bad-string-token①"><bad-string-token></a>, and return it. <dt>U+005C REVERSE SOLIDUS (\) <dd> If the <a data-link-type="dfn" href="#next-input-code-point" id="ref-for-next-input-code-point①⑧">next input code point</a> is EOF, do nothing. <p>Otherwise, if the <a data-link-type="dfn" href="#next-input-code-point" id="ref-for-next-input-code-point①⑨">next input code point</a> is a newline, consume it.</p> <p>Otherwise, <span class="note">(the stream <a data-link-type="dfn" href="#check-if-two-code-points-are-a-valid-escape" id="ref-for-check-if-two-code-points-are-a-valid-escape②">starts with a valid escape</a>)</span> <a data-link-type="dfn" href="#consume-an-escaped-code-point" id="ref-for-consume-an-escaped-code-point">consume an escaped code point</a> and append the returned <a data-link-type="dfn" href="https://infra.spec.whatwg.org/#code-point" id="ref-for-code-point④③">code point</a> to the <a class="production css" data-link-type="type" href="#typedef-string-token" id="ref-for-typedef-string-token⑥"><string-token></a>’s value.</p> <dt>anything else <dd> Append the <a data-link-type="dfn" href="#current-input-code-point" id="ref-for-current-input-code-point①①">current input code point</a> to the <a class="production css" data-link-type="type" href="#typedef-string-token" id="ref-for-typedef-string-token⑦"><string-token></a>’s value. </dl> <h4 class="heading settled" data-level="4.3.6" id="consume-url-token"><span class="secno">4.3.6. </span><span class="content"> Consume a url token</span><a class="self-link" href="#consume-url-token"></a></h4> <p>This section describes how to <dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport id="consume-a-url-token">consume a url token</dfn> from a stream of <a data-link-type="dfn" href="https://infra.spec.whatwg.org/#code-point" id="ref-for-code-point④④">code points</a>. It returns either a <a class="production css" data-link-type="type" href="#typedef-url-token" id="ref-for-typedef-url-token③"><url-token></a> or a <a class="production css" data-link-type="type" href="#typedef-bad-url-token" id="ref-for-typedef-bad-url-token①"><bad-url-token></a>.</p> <p class="note" role="note"><span class="marker">Note:</span> This algorithm assumes that the initial "url(" has already been consumed. This algorithm also assumes that it’s being called to consume an "unquoted" value, like <span class="css">url(foo)</span>. A quoted value, like <span class="css">url("foo")</span>, is parsed as a <a class="production css" data-link-type="type" href="#typedef-function-token" id="ref-for-typedef-function-token⑥"><function-token></a>. <a data-link-type="dfn" href="#consume-an-ident-like-token" id="ref-for-consume-an-ident-like-token④">Consume an ident-like token</a> automatically handles this distinction; this algorithm shouldn’t be called directly otherwise.</p> <ol> <li> Initially create a <a class="production css" data-link-type="type" href="#typedef-url-token" id="ref-for-typedef-url-token④"><url-token></a> with its value set to the empty string. <li> Consume as much <a data-link-type="dfn" href="#whitespace" id="ref-for-whitespace⑤">whitespace</a> as possible. <li> Repeatedly consume the <a data-link-type="dfn" href="#next-input-code-point" id="ref-for-next-input-code-point②⓪">next input code point</a> from the stream: <dl> <dt>U+0029 RIGHT PARENTHESIS ()) <dd> Return the <a class="production css" data-link-type="type" href="#typedef-url-token" id="ref-for-typedef-url-token⑤"><url-token></a>. <dt>EOF <dd> This is a <a data-link-type="dfn" href="#parse-error" id="ref-for-parse-error④">parse error</a>. Return the <a class="production css" data-link-type="type" href="#typedef-url-token" id="ref-for-typedef-url-token⑥"><url-token></a>. <dt><a data-link-type="dfn" href="#whitespace" id="ref-for-whitespace⑥">whitespace</a> <dd> Consume as much <a data-link-type="dfn" href="#whitespace" id="ref-for-whitespace⑦">whitespace</a> as possible. If the <a data-link-type="dfn" href="#next-input-code-point" id="ref-for-next-input-code-point②①">next input code point</a> is U+0029 RIGHT PARENTHESIS ()) or EOF, consume it and return the <a class="production css" data-link-type="type" href="#typedef-url-token" id="ref-for-typedef-url-token⑦"><url-token></a> (if EOF was encountered, this is a <a data-link-type="dfn" href="#parse-error" id="ref-for-parse-error⑤">parse error</a>); otherwise, <a data-link-type="dfn" href="#consume-the-remnants-of-a-bad-url" id="ref-for-consume-the-remnants-of-a-bad-url">consume the remnants of a bad url</a>, create a <a class="production css" data-link-type="type" href="#typedef-bad-url-token" id="ref-for-typedef-bad-url-token②"><bad-url-token></a>, and return it. <dt>U+0022 QUOTATION MARK (") <dt>U+0027 APOSTROPHE (') <dt>U+0028 LEFT PARENTHESIS (() <dt><a data-link-type="dfn" href="#non-printable-code-point" id="ref-for-non-printable-code-point">non-printable code point</a> <dd> This is a <a data-link-type="dfn" href="#parse-error" id="ref-for-parse-error⑥">parse error</a>. <a data-link-type="dfn" href="#consume-the-remnants-of-a-bad-url" id="ref-for-consume-the-remnants-of-a-bad-url①">Consume the remnants of a bad url</a>, create a <a class="production css" data-link-type="type" href="#typedef-bad-url-token" id="ref-for-typedef-bad-url-token③"><bad-url-token></a>, and return it. <dt>U+005C REVERSE SOLIDUS (\) <dd> If the stream <a data-link-type="dfn" href="#check-if-two-code-points-are-a-valid-escape" id="ref-for-check-if-two-code-points-are-a-valid-escape③">starts with a valid escape</a>, <a data-link-type="dfn" href="#consume-an-escaped-code-point" id="ref-for-consume-an-escaped-code-point①">consume an escaped code point</a> and append the returned <a data-link-type="dfn" href="https://infra.spec.whatwg.org/#code-point" id="ref-for-code-point④⑤">code point</a> to the <a class="production css" data-link-type="type" href="#typedef-url-token" id="ref-for-typedef-url-token⑧"><url-token></a>’s value. <p>Otherwise, this is a <a data-link-type="dfn" href="#parse-error" id="ref-for-parse-error⑦">parse error</a>. <a data-link-type="dfn" href="#consume-the-remnants-of-a-bad-url" id="ref-for-consume-the-remnants-of-a-bad-url②">Consume the remnants of a bad url</a>, create a <a class="production css" data-link-type="type" href="#typedef-bad-url-token" id="ref-for-typedef-bad-url-token④"><bad-url-token></a>, and return it.</p> <dt>anything else <dd> Append the <a data-link-type="dfn" href="#current-input-code-point" id="ref-for-current-input-code-point①②">current input code point</a> to the <a class="production css" data-link-type="type" href="#typedef-url-token" id="ref-for-typedef-url-token⑨"><url-token></a>’s value. </dl> </ol> <h4 class="heading settled" data-level="4.3.7" id="consume-escaped-code-point"><span class="secno">4.3.7. </span><span class="content"> Consume an escaped code point</span><a class="self-link" href="#consume-escaped-code-point"></a></h4> <p>This section describes how to <dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport id="consume-an-escaped-code-point">consume an escaped code point</dfn>. It assumes that the U+005C REVERSE SOLIDUS (\) has already been consumed and that the next input code point has already been verified to be part of a valid escape. It will return a <a data-link-type="dfn" href="https://infra.spec.whatwg.org/#code-point" id="ref-for-code-point④⑥">code point</a>.</p> <p>Consume the <a data-link-type="dfn" href="#next-input-code-point" id="ref-for-next-input-code-point②②">next input code point</a>.</p> <dl> <dt><a data-link-type="dfn" href="#hex-digit" id="ref-for-hex-digit②">hex digit</a> <dd> Consume as many <a data-link-type="dfn" href="#hex-digit" id="ref-for-hex-digit③">hex digits</a> as possible, but no more than 5. <span class="note">Note that this means 1-6 hex digits have been consumed in total.</span> If the <a data-link-type="dfn" href="#next-input-code-point" id="ref-for-next-input-code-point②③">next input code point</a> is <a data-link-type="dfn" href="#whitespace" id="ref-for-whitespace⑧">whitespace</a>, consume it as well. Interpret the <span id="ref-for-hex-digit④">hex digits</span> as a hexadecimal number. If this number is zero, or is for a <a data-link-type="dfn" href="https://infra.spec.whatwg.org/#surrogate" id="ref-for-surrogate②">surrogate</a>, or is greater than the <a data-link-type="dfn" href="#maximum-allowed-code-point" id="ref-for-maximum-allowed-code-point">maximum allowed code point</a>, return U+FFFD REPLACEMENT CHARACTER (�). Otherwise, return the <a data-link-type="dfn" href="https://infra.spec.whatwg.org/#code-point" id="ref-for-code-point④⑦">code point</a> with that value. <dt>EOF <dd> This is a <a data-link-type="dfn" href="#parse-error" id="ref-for-parse-error⑧">parse error</a>. Return U+FFFD REPLACEMENT CHARACTER (�). <dt>anything else <dd> Return the <a data-link-type="dfn" href="#current-input-code-point" id="ref-for-current-input-code-point①③">current input code point</a>. </dl> <h4 class="heading settled" data-level="4.3.8" id="starts-with-a-valid-escape"><span class="secno">4.3.8. </span><span class="content"> Check if two code points are a valid escape</span><a class="self-link" href="#starts-with-a-valid-escape"></a></h4> <p>This section describes how to <dfn class="dfn-paneled" data-dfn-type="dfn" data-lt="check if two code points are a valid escape|are a valid escape|starts with a valid escape" data-noexport id="check-if-two-code-points-are-a-valid-escape">check if two code points are a valid escape</dfn>. The algorithm described here can be called explicitly with two <a data-link-type="dfn" href="https://infra.spec.whatwg.org/#code-point" id="ref-for-code-point④⑧">code points</a>, or can be called with the input stream itself. In the latter case, the two <span id="ref-for-code-point④⑨">code points</span> in question are the <a data-link-type="dfn" href="#current-input-code-point" id="ref-for-current-input-code-point①④">current input code point</a> and the <a data-link-type="dfn" href="#next-input-code-point" id="ref-for-next-input-code-point②④">next input code point</a>, in that order.</p> <p class="note" role="note"><span class="marker">Note:</span> This algorithm will not consume any additional <a data-link-type="dfn" href="https://infra.spec.whatwg.org/#code-point" id="ref-for-code-point⑤⓪">code point</a>.</p> <p>If the first <a data-link-type="dfn" href="https://infra.spec.whatwg.org/#code-point" id="ref-for-code-point⑤①">code point</a> is not U+005C REVERSE SOLIDUS (\), return false.</p> <p>Otherwise, if the second <a data-link-type="dfn" href="https://infra.spec.whatwg.org/#code-point" id="ref-for-code-point⑤②">code point</a> is a <a data-link-type="dfn" href="#newline" id="ref-for-newline③">newline</a>, return false.</p> <p>Otherwise, return true.</p> <h4 class="heading settled" data-level="4.3.9" id="would-start-an-identifier"><span class="secno">4.3.9. </span><span class="content"> Check if three code points would start an ident sequence</span><a class="self-link" href="#would-start-an-identifier"></a></h4> <p>This section describes how to <dfn class="dfn-paneled" data-dfn-type="dfn" data-lt="check if three code points would start an ident sequence|starts with an ident sequence|start with an ident sequence|would start an ident sequence" data-noexport id="check-if-three-code-points-would-start-an-ident-sequence">check if three code points would start an <a data-link-type="dfn" href="#ident-sequence" id="ref-for-ident-sequence④">ident sequence</a><span id="check-if-three-code-points-would-start-an-identifier"></span></dfn>. The algorithm described here can be called explicitly with three <a data-link-type="dfn" href="https://infra.spec.whatwg.org/#code-point" id="ref-for-code-point⑤③">code points</a>, or can be called with the input stream itself. In the latter case, the three <span id="ref-for-code-point⑤④">code points</span> in question are the <a data-link-type="dfn" href="#current-input-code-point" id="ref-for-current-input-code-point①⑤">current input code point</a> and the <a data-link-type="dfn" href="#next-input-code-point" id="ref-for-next-input-code-point②⑤">next two input code points</a>, in that order.</p> <p class="note" role="note"><span class="marker">Note:</span> This algorithm will not consume any additional <a data-link-type="dfn" href="https://infra.spec.whatwg.org/#code-point" id="ref-for-code-point⑤⑤">code points</a>.</p> <p>Look at the first <a data-link-type="dfn" href="https://infra.spec.whatwg.org/#code-point" id="ref-for-code-point⑤⑥">code point</a>:</p> <dl> <dt>U+002D HYPHEN-MINUS <dd> If the second <a data-link-type="dfn" href="https://infra.spec.whatwg.org/#code-point" id="ref-for-code-point⑤⑦">code point</a> is an <a data-link-type="dfn" href="#ident-start-code-point" id="ref-for-ident-start-code-point③">ident-start code point</a> or a U+002D HYPHEN-MINUS, or the second and third <span id="ref-for-code-point⑤⑧">code points</span> <a data-link-type="dfn" href="#check-if-two-code-points-are-a-valid-escape" id="ref-for-check-if-two-code-points-are-a-valid-escape④">are a valid escape</a>, return true. Otherwise, return false. <dt><a data-link-type="dfn" href="#ident-start-code-point" id="ref-for-ident-start-code-point④">ident-start code point</a> <dd> Return true. <dt>U+005C REVERSE SOLIDUS (\) <dd> If the first and second <a data-link-type="dfn" href="https://infra.spec.whatwg.org/#code-point" id="ref-for-code-point⑤⑨">code points</a> <a data-link-type="dfn" href="#check-if-two-code-points-are-a-valid-escape" id="ref-for-check-if-two-code-points-are-a-valid-escape⑤">are a valid escape</a>, return true. Otherwise, return false. <dt>anything else <dd> Return false. </dl> <h4 class="heading settled" data-level="4.3.10" id="starts-with-a-number"><span class="secno">4.3.10. </span><span class="content"> Check if three code points would start a number</span><a class="self-link" href="#starts-with-a-number"></a></h4> <p>This section describes how to <dfn class="dfn-paneled" data-dfn-type="dfn" data-lt="check if three code points would start a number|starts with a number|start with a number|would start a number" data-noexport id="check-if-three-code-points-would-start-a-number">check if three code points would start a number</dfn>. The algorithm described here can be called explicitly with three <a data-link-type="dfn" href="https://infra.spec.whatwg.org/#code-point" id="ref-for-code-point⑥⓪">code points</a>, or can be called with the input stream itself. In the latter case, the three <span id="ref-for-code-point⑥①">code points</span> in question are the <a data-link-type="dfn" href="#current-input-code-point" id="ref-for-current-input-code-point①⑥">current input code point</a> and the <a data-link-type="dfn" href="#next-input-code-point" id="ref-for-next-input-code-point②⑥">next two input code points</a>, in that order.</p> <p class="note" role="note"><span class="marker">Note:</span> This algorithm will not consume any additional <a data-link-type="dfn" href="https://infra.spec.whatwg.org/#code-point" id="ref-for-code-point⑥②">code points</a>.</p> <p>Look at the first <a data-link-type="dfn" href="https://infra.spec.whatwg.org/#code-point" id="ref-for-code-point⑥③">code point</a>:</p> <dl> <dt>U+002B PLUS SIGN (+) <dt>U+002D HYPHEN-MINUS (-) <dd> If the second <a data-link-type="dfn" href="https://infra.spec.whatwg.org/#code-point" id="ref-for-code-point⑥④">code point</a> is a <a data-link-type="dfn" href="#digit" id="ref-for-digit③">digit</a>, return true. <p>Otherwise, if the second <a data-link-type="dfn" href="https://infra.spec.whatwg.org/#code-point" id="ref-for-code-point⑥⑤">code point</a> is a U+002E FULL STOP (.) and the third <span id="ref-for-code-point⑥⑥">code point</span> is a <a data-link-type="dfn" href="#digit" id="ref-for-digit④">digit</a>, return true.</p> <p>Otherwise, return false.</p> <dt>U+002E FULL STOP (.) <dd> If the second <a data-link-type="dfn" href="https://infra.spec.whatwg.org/#code-point" id="ref-for-code-point⑥⑦">code point</a> is a <a data-link-type="dfn" href="#digit" id="ref-for-digit⑤">digit</a>, return true. Otherwise, return false. <dt><a data-link-type="dfn" href="#digit" id="ref-for-digit⑥">digit</a> <dd> Return true. <dt>anything else <dd> Return false. </dl> <h4 class="heading settled" data-level="4.3.11" id="starts-a-unicode-range"><span class="secno">4.3.11. </span><span class="content"> Check if three code points would start a unicode-range</span><a class="self-link" href="#starts-a-unicode-range"></a></h4> <p>This section describes how to <dfn class="dfn-paneled" data-dfn-type="dfn" data-lt="check if three code points would start a unicode-range|would start a unicode-range" data-noexport id="check-if-three-code-points-would-start-a-unicode-range">check if three code points would start a unicode-range</dfn>. The algorithm described here can be called explicitly with three <a data-link-type="dfn" href="https://infra.spec.whatwg.org/#code-point" id="ref-for-code-point⑥⑧">code points</a>, or can be called with the input stream itself. In the latter case, the three <span id="ref-for-code-point⑥⑨">code points</span> in question are the <a data-link-type="dfn" href="#current-input-code-point" id="ref-for-current-input-code-point①⑦">current input code point</a> and the <a data-link-type="dfn" href="#next-input-code-point" id="ref-for-next-input-code-point②⑦">next two input code points</a>, in that order.</p> <p class="note" role="note"><span class="marker">Note:</span> This algorithm will not consume any additional <a data-link-type="dfn" href="https://infra.spec.whatwg.org/#code-point" id="ref-for-code-point⑦⓪">code points</a>.</p> <p>If all of the following are true:</p> <ul> <li data-md> <p>The first code point is either U+0055 LATIN CAPITAL LETTER U (U) or U+0075 LATIN SMALL LETTER U (u)</p> <li data-md> <p>The second code point is U+002B PLUS SIGN (+).</p> <li data-md> <p>The third code point is either U+003F QUESTION MARK (?) or a <a data-link-type="dfn" href="#hex-digit" id="ref-for-hex-digit⑤">hex digit</a></p> </ul> <p>then return true.</p> <p>Otherwise return false.</p> <h4 class="heading settled" data-level="4.3.12" id="consume-name"><span class="secno">4.3.12. </span><span class="content"> Consume an ident sequence</span><a class="self-link" href="#consume-name"></a></h4> <p>This section describes how to <dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport id="consume-an-ident-sequence">consume an ident sequence<span id="consume-an-identifier"></span></dfn> from a stream of <a data-link-type="dfn" href="https://infra.spec.whatwg.org/#code-point" id="ref-for-code-point⑦①">code points</a>. It returns a string containing the largest name that can be formed from adjacent <span id="ref-for-code-point⑦②">code points</span> in the stream, starting from the first.</p> <p class="note" role="note"><span class="marker">Note:</span> This algorithm does not do the verification of the first few <a data-link-type="dfn" href="https://infra.spec.whatwg.org/#code-point" id="ref-for-code-point⑦③">code points</a> that are necessary to ensure the returned <span id="ref-for-code-point⑦④">code points</span> would constitute an <a class="production css" data-link-type="type" href="#typedef-ident-token" id="ref-for-typedef-ident-token⑤"><ident-token></a>. If that is the intended use, ensure that the stream <a data-link-type="dfn" href="#check-if-three-code-points-would-start-an-ident-sequence" id="ref-for-check-if-three-code-points-would-start-an-ident-sequence④">starts with an ident sequence</a> before calling this algorithm.</p> <p>Let <var>result</var> initially be an empty string.</p> <p>Repeatedly consume the <a data-link-type="dfn" href="#next-input-code-point" id="ref-for-next-input-code-point②⑧">next input code point</a> from the stream:</p> <dl> <dt><a data-link-type="dfn" href="#ident-code-point" id="ref-for-ident-code-point②">ident code point</a> <dd> Append the <a data-link-type="dfn" href="https://infra.spec.whatwg.org/#code-point" id="ref-for-code-point⑦⑤">code point</a> to <var>result</var>. <dt>the stream <a data-link-type="dfn" href="#check-if-two-code-points-are-a-valid-escape" id="ref-for-check-if-two-code-points-are-a-valid-escape⑥">starts with a valid escape</a> <dd> <a data-link-type="dfn" href="#consume-an-escaped-code-point" id="ref-for-consume-an-escaped-code-point②">Consume an escaped code point</a>. Append the returned <a data-link-type="dfn" href="https://infra.spec.whatwg.org/#code-point" id="ref-for-code-point⑦⑥">code point</a> to <var>result</var>. <dt>anything else <dd> <a data-link-type="dfn" href="#reconsume-the-current-input-code-point" id="ref-for-reconsume-the-current-input-code-point①⓪">Reconsume the current input code point</a>. Return <var>result</var>. </dl> <h4 class="heading settled" data-level="4.3.13" id="consume-number"><span class="secno">4.3.13. </span><span class="content"> Consume a number</span><a class="self-link" href="#consume-number"></a></h4> <p>This section describes how to <dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport id="consume-a-number">consume a number</dfn> from a stream of <a data-link-type="dfn" href="https://infra.spec.whatwg.org/#code-point" id="ref-for-code-point⑦⑦">code points</a>. It returns a numeric <var>value</var>, a string <var>type</var> which is either "integer" or "number", and an optional <var>sign character</var> which is either "+", "-", or missing.</p> <p class="note" role="note"><span class="marker">Note:</span> This algorithm does not do the verification of the first few <a data-link-type="dfn" href="https://infra.spec.whatwg.org/#code-point" id="ref-for-code-point⑦⑧">code points</a> that are necessary to ensure a number can be obtained from the stream. Ensure that the stream <a data-link-type="dfn" href="#check-if-three-code-points-would-start-a-number" id="ref-for-check-if-three-code-points-would-start-a-number③">starts with a number</a> before calling this algorithm.</p> <p>Execute the following steps in order:</p> <ol> <li> Let <var>type</var> be the string "integer". Let <var>number part</var> and <var>exponent part</var> be the empty string. <li> If the <a data-link-type="dfn" href="#next-input-code-point" id="ref-for-next-input-code-point②⑨">next input code point</a> is U+002B PLUS SIGN (+) or U+002D HYPHEN-MINUS (-), consume it. Append it to <var>number part</var> and set <var>sign character</var> to it. <li> While the <a data-link-type="dfn" href="#next-input-code-point" id="ref-for-next-input-code-point③⓪">next input code point</a> is a <a data-link-type="dfn" href="#digit" id="ref-for-digit⑦">digit</a>, consume it and append it to <var>number part</var>. <li> If the <a data-link-type="dfn" href="#next-input-code-point" id="ref-for-next-input-code-point③①">next 2 input code points</a> are U+002E FULL STOP (.) followed by a <a data-link-type="dfn" href="#digit" id="ref-for-digit⑧">digit</a>, then: <ol> <li>Consume the <a data-link-type="dfn" href="#next-input-code-point" id="ref-for-next-input-code-point③②">next input code point</a> and append it to <var>number part</var>. <li>While the <a data-link-type="dfn" href="#next-input-code-point" id="ref-for-next-input-code-point③③">next input code point</a> is a <a data-link-type="dfn" href="#digit" id="ref-for-digit⑨">digit</a>, consume it and append it to <var>number part</var>. <li>Set <var>type</var> to "number". </ol> <li> If the <a data-link-type="dfn" href="#next-input-code-point" id="ref-for-next-input-code-point③④">next 2 or 3 input code points</a> are U+0045 LATIN CAPITAL LETTER E (E) or U+0065 LATIN SMALL LETTER E (e), optionally followed by U+002D HYPHEN-MINUS (-) or U+002B PLUS SIGN (+), followed by a <a data-link-type="dfn" href="#digit" id="ref-for-digit①⓪">digit</a>, then: <ol> <li>Consume the <a data-link-type="dfn" href="#next-input-code-point" id="ref-for-next-input-code-point③⑤">next input code point</a>. <li>If the <a data-link-type="dfn" href="#next-input-code-point" id="ref-for-next-input-code-point③⑥">next input code point</a> is "+" or "-", consume it and append it to <var>exponent part</var>. <li>While the <a data-link-type="dfn" href="#next-input-code-point" id="ref-for-next-input-code-point③⑦">next input code point</a> is a <a data-link-type="dfn" href="#digit" id="ref-for-digit①①">digit</a>, consume it and append it to <var>exponent part</var>. <li>Set <var>type</var> to "number". </ol> <li> Let <var>value</var> be the result of interpreting <var>number part</var> as a base-10 number. <p>If <var>exponent part</var> is non-empty, interpret it as a base-10 integer, then raise 10 to the power of the result, multiply it by <var>value</var>, and set <var>value</var> to that result.</p> <li> Return <var>value</var>, <var>type</var>, and <var>sign character</var>. </ol> <h4 class="heading settled" data-level="4.3.14" id="consume-unicode-range-token"><span class="secno">4.3.14. </span><span class="content"> Consume a unicode-range token</span><a class="self-link" href="#consume-unicode-range-token"></a></h4> <p>This section describes how to <dfn class="dfn-paneled" data-dfn-type="dfn" data-export id="consume-a-unicode-range-token">consume a unicode-range token</dfn> from a stream of <a data-link-type="dfn" href="https://infra.spec.whatwg.org/#code-point" id="ref-for-code-point⑦⑨">code points</a>. It returns a <a class="production css" data-link-type="type" href="#typedef-unicode-range-token" id="ref-for-typedef-unicode-range-token②"><unicode-range-token></a>.</p> <p class="note" role="note"><span class="marker">Note:</span> This algorithm does not do the verification of the first few code points that are necessary to ensure the returned code points would constitute an <a class="production css" data-link-type="type" href="#typedef-unicode-range-token" id="ref-for-typedef-unicode-range-token③"><unicode-range-token></a>. Ensure that the stream <a data-link-type="dfn" href="#check-if-three-code-points-would-start-a-unicode-range" id="ref-for-check-if-three-code-points-would-start-a-unicode-range①">would start a unicode-range</a> before calling this algorithm.</p> <p class="note" role="note"><span class="marker">Note:</span> This token is not produced by the tokenizer under normal circumstances. This algorithm is only called during <a data-link-type="dfn" href="#consume-the-value-of-a-unicode-range-descriptor" id="ref-for-consume-the-value-of-a-unicode-range-descriptor">consume the value of a unicode-range descriptor</a>, which itself is only called as a special case for parsing the <a class="property" data-link-type="propdesc" href="https://drafts.csswg.org/css-fonts-4/#descdef-font-face-unicode-range" id="ref-for-descdef-font-face-unicode-range">unicode-range</a> descriptor; this single invocation in the entire language is due to a bad syntax design in early CSS.</p> <ol> <li data-md> <p>Consume the <a data-link-type="dfn" href="#next-input-code-point" id="ref-for-next-input-code-point③⑧">next two input code points</a> and discard them.</p> <li data-md> <p>Consume as many <a data-link-type="dfn" href="#hex-digit" id="ref-for-hex-digit⑥">hex digits</a> as possible, but no more than 6. If less than 6 hex digits were consumed, consume as many U+003F QUESTION MARK (?) code points as possible, but no more than enough to make the total of hex digits and U+003F QUESTION MARK (?) code points equal to 6.</p> <p>Let <var>first segment</var> be the consumed code points.</p> <li data-md> <p>If <var>first segment</var> contains any question mark code points, then:</p> <ol> <li data-md> <p>Replace the question marks in <var>first segment</var> with U+0030 DIGIT ZERO (0) <a data-link-type="dfn" href="https://infra.spec.whatwg.org/#code-point" id="ref-for-code-point⑧⓪">code points</a>, and interpret the result as a hexadecimal number. Let this be <var>start of range</var>.</p> <li data-md> <p>Replace the question marks in <var>first segment</var> with U+0046 LATIN CAPITAL LETTER F (F) <a data-link-type="dfn" href="https://infra.spec.whatwg.org/#code-point" id="ref-for-code-point⑧①">code points</a>, and interpret the result as a hexadecimal number. Let this be <var>end of range</var>.</p> <li data-md> <p>Return a new <a class="production css" data-link-type="type" href="#typedef-unicode-range-token" id="ref-for-typedef-unicode-range-token④"><unicode-range-token></a> starting at <var>start of range</var> and ending at <var>end of range</var>.</p> </ol> <li data-md> <p>Otherwise, interpret <var>first segment</var> as a hexadecimal number, and let the result be <var>start of range</var>.</p> <li data-md> <p>If the <a data-link-type="dfn" href="#next-input-code-point" id="ref-for-next-input-code-point③⑨">next 2 input code points</a> are U+002D HYPHEN-MINUS (-) followed by a <a data-link-type="dfn" href="#hex-digit" id="ref-for-hex-digit⑦">hex digit</a>, then:</p> <ol> <li data-md> <p>Consume the <a data-link-type="dfn" href="#next-input-code-point" id="ref-for-next-input-code-point④⓪">next input code point</a>.</p> <li data-md> <p>Consume as many <a data-link-type="dfn" href="#hex-digit" id="ref-for-hex-digit⑧">hex digits</a> as possible, but no more than 6. Interpret the consumed code points as a hexadecimal number. Let this be <var>end of range</var>.</p> <li data-md> <p>Return a new <a class="production css" data-link-type="type" href="#typedef-unicode-range-token" id="ref-for-typedef-unicode-range-token⑤"><unicode-range-token></a> starting at <var>start of range</var> and ending at <var>end of range</var>.</p> </ol> <li data-md> <p>Otherwise, return a new <a class="production css" data-link-type="type" href="#typedef-unicode-range-token" id="ref-for-typedef-unicode-range-token⑥"><unicode-range-token></a> both starting and ending at <var>start of range</var>.</p> </ol> <h4 class="heading settled" data-level="4.3.15" id="consume-remnants-of-bad-url"><span class="secno">4.3.15. </span><span class="content"> Consume the remnants of a bad url</span><a class="self-link" href="#consume-remnants-of-bad-url"></a></h4> <p>This section describes how to <dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport id="consume-the-remnants-of-a-bad-url">consume the remnants of a bad url</dfn> from a stream of <a data-link-type="dfn" href="https://infra.spec.whatwg.org/#code-point" id="ref-for-code-point⑧②">code points</a>, "cleaning up" after the tokenizer realizes that it’s in the middle of a <a class="production css" data-link-type="type" href="#typedef-bad-url-token" id="ref-for-typedef-bad-url-token⑤"><bad-url-token></a> rather than a <a class="production css" data-link-type="type" href="#typedef-url-token" id="ref-for-typedef-url-token①⓪"><url-token></a>. It returns nothing; its sole use is to consume enough of the input stream to reach a recovery point where normal tokenizing can resume.</p> <p>Repeatedly consume the <a data-link-type="dfn" href="#next-input-code-point" id="ref-for-next-input-code-point④①">next input code point</a> from the stream:</p> <dl> <dt>U+0029 RIGHT PARENTHESIS ()) <dt>EOF <dd> Return. <dt>the input stream <a data-link-type="dfn" href="#check-if-two-code-points-are-a-valid-escape" id="ref-for-check-if-two-code-points-are-a-valid-escape⑦">starts with a valid escape</a> <dd> <a data-link-type="dfn" href="#consume-an-escaped-code-point" id="ref-for-consume-an-escaped-code-point③">Consume an escaped code point</a>. <span class="note">This allows an escaped right parenthesis ("\)") to be encountered without ending the <a class="production css" data-link-type="type" href="#typedef-bad-url-token" id="ref-for-typedef-bad-url-token⑥"><bad-url-token></a>. This is otherwise identical to the "anything else" clause.</span> <dt>anything else <dd> Do nothing. </dl> <h2 class="heading settled" data-level="5" id="parsing"><span class="secno">5. </span><span class="content"> Parsing</span><a class="self-link" href="#parsing"></a></h2> <p>The CSS parser converts a <a data-link-type="dfn" href="#css-token-stream" id="ref-for-css-token-stream">token stream</a> (produced by the tokenization process, defined earlier in this spec) into one or more of several CSS constructs (depending on which parsing algorithm is invoked).</p> <h3 class="heading settled" data-level="5.1" id="parser-diagrams"><span class="secno">5.1. </span><span class="content"> Parser Railroad Diagrams</span><a class="self-link" href="#parser-diagrams"></a></h3> <p><em>This section is non-normative.</em></p> <p>This section presents an informative view of the parser, in the form of railroad diagrams.</p> <p>These diagrams are <em>informative</em> and <em>incomplete</em>; they describe the grammar of "correct" stylesheets, but do not describe error-handling at all. They are provided solely to make it easier to get an intuitive grasp of the syntax.</p> <dl> <dt id="stylesheet-diagram"><a class="self-link" href="#stylesheet-diagram"></a>Stylesheet <dd> <div class="railroad"> <svg class="railroad-diagram" height="198" viewBox="0 0 353.0 198" width="353.0"> <g transform="translate(.5 .5)"> <g> <path d="M20 119v20m10 -20v20m-10 -10h20"></path> </g> <g> <path d="M40 129h0.0"></path> <path d="M313.0 129h0.0"></path> <path d="M40.0 129a10 10 0 0 0 10 -10v-89a10 10 0 0 1 10 -10"></path> <g> <path d="M60.0 20h233.0"></path> </g> <path d="M293.0 20a10 10 0 0 1 10 10v89a10 10 0 0 0 10 10"></path> <path d="M40.0 129h20"></path> <g> <path d="M60.0 129h0.0"></path> <path d="M293.0 129h0.0"></path> <path d="M60.0 129h10"></path> <g> <path d="M70.0 129h0.0"></path> <path d="M283.0 129h0.0"></path> <path d="M70.0 129a10 10 0 0 0 10 -10v-10a10 10 0 0 1 10 -10"></path> <g class="non-terminal "> <path d="M90.0 99h0.0"></path> <path d="M263.0 99h0.0"></path> <rect height="22" width="173" x="90" y="88"></rect> <text x="176.5" y="103"><whitespace-token></text> </g> <path d="M263.0 99a10 10 0 0 1 10 10v10a10 10 0 0 0 10 10"></path> <path d="M70.0 129a10 10 0 0 0 10 -10v-40a10 10 0 0 1 10 -10"></path> <g class="non-terminal "> <path d="M90.0 69h29.75"></path> <path d="M233.25 69h29.75"></path> <rect height="22" width="113.5" x="119.75" y="58"></rect> <text x="176.5" y="73"><CDC-token></text> </g> <path d="M263.0 69a10 10 0 0 1 10 10v40a10 10 0 0 0 10 10"></path> <path d="M70.0 129a10 10 0 0 0 10 -10v-70a10 10 0 0 1 10 -10"></path> <g class="non-terminal "> <path d="M90.0 39h29.75"></path> <path d="M233.25 39h29.75"></path> <rect height="22" width="113.5" x="119.75" y="28"></rect> <text x="176.5" y="43"><CDO-token></text> </g> <path d="M263.0 39a10 10 0 0 1 10 10v70a10 10 0 0 0 10 10"></path> <path d="M70.0 129h20"></path> <g class="non-terminal "> <path d="M90.0 129h17.0"></path> <path d="M246.0 129h17.0"></path> <rect height="22" width="139" x="107" y="118"></rect> <text x="176.5" y="133">Qualified rule</text> </g> <path d="M263.0 129h20"></path> <path d="M70.0 129a10 10 0 0 1 10 10v10a10 10 0 0 0 10 10"></path> <g class="non-terminal "> <path d="M90.0 159h46.75"></path> <path d="M216.25 159h46.75"></path> <rect height="22" width="79.5" x="136.75" y="148"></rect> <text x="176.5" y="163">At-rule</text> </g> <path d="M263.0 159a10 10 0 0 0 10 -10v-10a10 10 0 0 1 10 -10"></path> </g> <path d="M283.0 129h10"></path> <path d="M70.0 129a10 10 0 0 0 -10 10v29a10 10 0 0 0 10 10"></path> <g> <path d="M70.0 178h213.0"></path> </g> <path d="M283.0 178a10 10 0 0 0 10 -10v-29a10 10 0 0 0 -10 -10"></path> </g> <path d="M293.0 129h20"></path> </g> <path d="M 313.0 129 h 20 m -10 -10 v 20 m 10 -20 v 20"></path> </g> </svg> </div> <dt id="at-rule-diagram"><a class="self-link" href="#at-rule-diagram"></a>At-rule <dd> <div class="railroad"> <svg class="railroad-diagram" height="101" viewBox="0 0 608.5 101" width="608.5"> <g transform="translate(.5 .5)"> <g> <path d="M20 30v20m10 -20v20m-10 -10h20"></path> </g> <path d="M40 40h10"></path> <g class="non-terminal "> <path d="M50 40h0.0"></path> <path d="M223.0 40h0.0"></path> <rect height="22" width="173" x="50" y="29"></rect> <text x="136.5" y="44"><at-keyword-token></text> </g> <path d="M223.0 40h10"></path> <g> <path d="M233.0 40h0.0"></path> <path d="M440.5 40h0.0"></path> <path d="M233.0 40a10 10 0 0 0 10 -10v0a10 10 0 0 1 10 -10"></path> <g> <path d="M253.0 20h167.5"></path> </g> <path d="M420.5 20a10 10 0 0 1 10 10v0a10 10 0 0 0 10 10"></path> <path d="M233.0 40h20"></path> <g> <path d="M253.0 40h0.0"></path> <path d="M420.5 40h0.0"></path> <path d="M253.0 40h10"></path> <g class="non-terminal "> <path d="M263.0 40h0.0"></path> <path d="M410.5 40h0.0"></path> <rect height="22" width="147.5" x="263" y="29"></rect> <text x="336.75" y="44">Component value</text> </g> <path d="M410.5 40h10"></path> <path d="M263.0 40a10 10 0 0 0 -10 10v0a10 10 0 0 0 10 10"></path> <g> <path d="M263.0 60h147.5"></path> </g> <path d="M410.5 60a10 10 0 0 0 10 -10v0a10 10 0 0 0 -10 -10"></path> </g> <path d="M420.5 40h20"></path> </g> <g> <path d="M440.5 40h0.0"></path> <path d="M568.5 40h0.0"></path> <path d="M440.5 40h20"></path> <g class="non-terminal "> <path d="M460.5 40h0.0"></path> <path d="M548.5 40h0.0"></path> <rect height="22" width="88" x="460.5" y="29"></rect> <text x="504.5" y="44">{} block</text> </g> <path d="M548.5 40h20"></path> <path d="M440.5 40a10 10 0 0 1 10 10v10a10 10 0 0 0 10 10"></path> <g class="terminal "> <path d="M460.5 70h29.75"></path> <path d="M518.75 70h29.75"></path> <rect height="22" rx="10" ry="10" width="28.5" x="490.25" y="59"></rect> <text x="504.5" y="74">;</text> </g> <path d="M548.5 70a10 10 0 0 0 10 -10v-10a10 10 0 0 1 10 -10"></path> </g> <path d="M 568.5 40 h 20 m -10 -10 v 20 m 10 -20 v 20"></path> </g> </svg> </div> <dt id="qualified-rule-diagram"><a class="self-link" href="#qualified-rule-diagram"></a>Qualified rule <dd> <div class="railroad"> <svg class="railroad-diagram" height="80" viewBox="0 0 395.5 80" width="395.5"> <g transform="translate(.5 .5)"> <g> <path d="M20 30v20m10 -20v20m-10 -10h20"></path> </g> <g> <path d="M40 40h0.0"></path> <path d="M247.5 40h0.0"></path> <path d="M40.0 40a10 10 0 0 0 10 -10v0a10 10 0 0 1 10 -10"></path> <g> <path d="M60.0 20h167.5"></path> </g> <path d="M227.5 20a10 10 0 0 1 10 10v0a10 10 0 0 0 10 10"></path> <path d="M40.0 40h20"></path> <g> <path d="M60.0 40h0.0"></path> <path d="M227.5 40h0.0"></path> <path d="M60.0 40h10"></path> <g class="non-terminal "> <path d="M70.0 40h0.0"></path> <path d="M217.5 40h0.0"></path> <rect height="22" width="147.5" x="70" y="29"></rect> <text x="143.75" y="44">Component value</text> </g> <path d="M217.5 40h10"></path> <path d="M70.0 40a10 10 0 0 0 -10 10v0a10 10 0 0 0 10 10"></path> <g> <path d="M70.0 60h147.5"></path> </g> <path d="M217.5 60a10 10 0 0 0 10 -10v0a10 10 0 0 0 -10 -10"></path> </g> <path d="M227.5 40h20"></path> </g> <path d="M247.5 40h10"></path> <g class="non-terminal "> <path d="M257.5 40h0.0"></path> <path d="M345.5 40h0.0"></path> <rect height="22" width="88" x="257.5" y="29"></rect> <text x="301.5" y="44">{} block</text> </g> <path d="M345.5 40h10"></path> <path d="M 355.5 40 h 20 m -10 -10 v 20 m 10 -20 v 20"></path> </g> </svg> </div> <dt id="declaration-list-diagram"><a class="self-link" href="#declaration-list-diagram"></a>{} block <dd> <div class="railroad"> <svg class="railroad-diagram" height="161" viewBox="0 0 570.0 161" width="570.0"> <g transform="translate(.5 .5)"> <g> <path d="M20 30v20m10 -20v20m-10 -10h20"></path> </g> <path d="M40 40h10"></path> <g class="terminal "> <path d="M50 40h0.0"></path> <path d="M78.5 40h0.0"></path> <rect height="22" rx="10" ry="10" width="28.5" x="50" y="29"></rect> <text x="64.25" y="44">{</text> </g> <path d="M78.5 40h10"></path> <path d="M88.5 40h10"></path> <g class="non-terminal "> <path d="M98.5 40h0.0"></path> <path d="M144.0 40h0.0"></path> <rect height="22" width="45.5" x="98.5" y="29"></rect> <text x="121.25" y="44">ws*</text> </g> <path d="M144.0 40h10"></path> <g> <path d="M154.0 40h0.0"></path> <path d="M416.0 40h0.0"></path> <path d="M154.0 40a10 10 0 0 0 10 -10v0a10 10 0 0 1 10 -10"></path> <g> <path d="M174.0 20h222.0"></path> </g> <path d="M396.0 20a10 10 0 0 1 10 10v0a10 10 0 0 0 10 10"></path> <path d="M154.0 40h20"></path> <g> <path d="M174.0 40h0.0"></path> <path d="M396.0 40h0.0"></path> <path d="M174.0 40h10"></path> <g> <path d="M184.0 40h0.0"></path> <path d="M386.0 40h0.0"></path> <path d="M184.0 40h20"></path> <g> <path d="M204.0 40h0.0"></path> <path d="M366.0 40h0.0"></path> <g class="non-terminal "> <path d="M204.0 40h0.0"></path> <path d="M317.5 40h0.0"></path> <rect height="22" width="113.5" x="204" y="29"></rect> <text x="260.75" y="44">Declaration</text> </g> <path d="M317.5 40h10"></path> <path d="M327.5 40h10"></path> <g class="terminal "> <path d="M337.5 40h0.0"></path> <path d="M366.0 40h0.0"></path> <rect height="22" rx="10" ry="10" width="28.5" x="337.5" y="29"></rect> <text x="351.75" y="44">;</text> </g> </g> <path d="M366.0 40h20"></path> <path d="M184.0 40a10 10 0 0 1 10 10v10a10 10 0 0 0 10 10"></path> <g class="non-terminal "> <path d="M204.0 70h41.25"></path> <path d="M324.75 70h41.25"></path> <rect height="22" width="79.5" x="245.25" y="59"></rect> <text x="285" y="74">At-rule</text> </g> <path d="M366.0 70a10 10 0 0 0 10 -10v-10a10 10 0 0 1 10 -10"></path> <path d="M184.0 40a10 10 0 0 1 10 10v40a10 10 0 0 0 10 10"></path> <g class="non-terminal "> <path d="M204.0 100h11.5"></path> <path d="M354.5 100h11.5"></path> <rect height="22" width="139" x="215.5" y="89"></rect> <text x="285" y="104">Qualified rule</text> </g> <path d="M366.0 100a10 10 0 0 0 10 -10v-40a10 10 0 0 1 10 -10"></path> </g> <path d="M386.0 40h10"></path> <path d="M184.0 40a10 10 0 0 0 -10 10v70a10 10 0 0 0 10 10"></path> <g class="non-terminal "> <path d="M184.0 130h78.25"></path> <path d="M307.75 130h78.25"></path> <rect height="22" width="45.5" x="262.25" y="119"></rect> <text x="285" y="134">ws*</text> </g> <path d="M386.0 130a10 10 0 0 0 10 -10v-70a10 10 0 0 0 -10 -10"></path> </g> <path d="M396.0 40h20"></path> </g> <path d="M416.0 40h10"></path> <g class="non-terminal "> <path d="M426.0 40h0.0"></path> <path d="M471.5 40h0.0"></path> <rect height="22" width="45.5" x="426" y="29"></rect> <text x="448.75" y="44">ws*</text> </g> <path d="M471.5 40h10"></path> <path d="M481.5 40h10"></path> <g class="terminal "> <path d="M491.5 40h0.0"></path> <path d="M520.0 40h0.0"></path> <rect height="22" rx="10" ry="10" width="28.5" x="491.5" y="29"></rect> <text x="505.75" y="44">}</text> </g> <path d="M520.0 40h10"></path> <path d="M 530.0 40 h 20 m -10 -10 v 20 m 10 -20 v 20"></path> </g> </svg> </div> <dt id="declaration-diagram"><a class="self-link" href="#declaration-diagram"></a>Declaration <dd> <div class="railroad"> <svg class="railroad-diagram" height="91" viewBox="0 0 697.0 91" width="697.0"> <g transform="translate(.5 .5)"> <g> <path d="M20 30v20m10 -20v20m-10 -10h20"></path> </g> <path d="M40 40h10"></path> <g class="non-terminal "> <path d="M50 40h0.0"></path> <path d="M180.5 40h0.0"></path> <rect height="22" width="130.5" x="50" y="29"></rect> <text x="115.25" y="44"><ident-token></text> </g> <path d="M180.5 40h10"></path> <path d="M190.5 40h10"></path> <g class="non-terminal "> <path d="M200.5 40h0.0"></path> <path d="M246.0 40h0.0"></path> <rect height="22" width="45.5" x="200.5" y="29"></rect> <text x="223.25" y="44">ws*</text> </g> <path d="M246.0 40h10"></path> <path d="M256.0 40h10"></path> <g class="terminal "> <path d="M266.0 40h0.0"></path> <path d="M294.5 40h0.0"></path> <rect height="22" rx="10" ry="10" width="28.5" x="266" y="29"></rect> <text x="280.25" y="44">:</text> </g> <path d="M294.5 40h10"></path> <g> <path d="M304.5 40h0.0"></path> <path d="M512.0 40h0.0"></path> <path d="M304.5 40a10 10 0 0 0 10 -10v0a10 10 0 0 1 10 -10"></path> <g> <path d="M324.5 20h167.5"></path> </g> <path d="M492.0 20a10 10 0 0 1 10 10v0a10 10 0 0 0 10 10"></path> <path d="M304.5 40h20"></path> <g> <path d="M324.5 40h0.0"></path> <path d="M492.0 40h0.0"></path> <path d="M324.5 40h10"></path> <g class="non-terminal "> <path d="M334.5 40h0.0"></path> <path d="M482.0 40h0.0"></path> <rect height="22" width="147.5" x="334.5" y="29"></rect> <text x="408.25" y="44">Component value</text> </g> <path d="M482.0 40h10"></path> <path d="M334.5 40a10 10 0 0 0 -10 10v0a10 10 0 0 0 10 10"></path> <g> <path d="M334.5 60h147.5"></path> </g> <path d="M482.0 60a10 10 0 0 0 10 -10v0a10 10 0 0 0 -10 -10"></path> </g> <path d="M492.0 40h20"></path> </g> <g> <path d="M512.0 40h0.0"></path> <path d="M657.0 40h0.0"></path> <path d="M512.0 40h20"></path> <g> <path d="M532.0 40h105.0"></path> </g> <path d="M637.0 40h20"></path> <path d="M512.0 40a10 10 0 0 1 10 10v0a10 10 0 0 0 10 10"></path> <g class="non-terminal "> <path d="M532.0 60h0.0"></path> <path d="M637.0 60h0.0"></path> <rect height="22" width="105" x="532" y="49"></rect> <text x="584.5" y="64">!important</text> </g> <path d="M637.0 60a10 10 0 0 0 10 -10v0a10 10 0 0 1 10 -10"></path> </g> <path d="M 657.0 40 h 20 m -10 -10 v 20 m 10 -20 v 20"></path> </g> </svg> </div> <dt id="!important-diagram"><a class="self-link" href="#!important-diagram"></a>!important <dd> <div class="railroad"> <svg class="railroad-diagram" height="62" viewBox="0 0 512.0 62" width="512.0"> <g transform="translate(.5 .5)"> <g> <path d="M20 21v20m10 -20v20m-10 -10h20"></path> </g> <path d="M40 31h10"></path> <g class="terminal "> <path d="M50 31h0.0"></path> <path d="M78.5 31h0.0"></path> <rect height="22" rx="10" ry="10" width="28.5" x="50" y="20"></rect> <text x="64.25" y="35">!</text> </g> <path d="M78.5 31h10"></path> <path d="M88.5 31h10"></path> <g class="non-terminal "> <path d="M98.5 31h0.0"></path> <path d="M144.0 31h0.0"></path> <rect height="22" width="45.5" x="98.5" y="20"></rect> <text x="121.25" y="35">ws*</text> </g> <path d="M144.0 31h10"></path> <path d="M154.0 31h10"></path> <g class="non-terminal "> <path d="M164.0 31h0.0"></path> <path d="M396.5 31h0.0"></path> <rect height="22" width="232.5" x="164" y="20"></rect> <text x="280.25" y="35"><ident-token "important"></text> </g> <path d="M396.5 31h10"></path> <path d="M406.5 31h10"></path> <g class="non-terminal "> <path d="M416.5 31h0.0"></path> <path d="M462.0 31h0.0"></path> <rect height="22" width="45.5" x="416.5" y="20"></rect> <text x="439.25" y="35">ws*</text> </g> <path d="M462.0 31h10"></path> <path d="M 472.0 31 h 20 m -10 -10 v 20 m 10 -20 v 20"></path> </g> </svg> </div> <dt id="component-value-diagram"><a class="self-link" href="#component-value-diagram"></a>Component value <dd> <div class="railroad"> <svg class="railroad-diagram" height="122" viewBox="0 0 267.5 122" width="267.5"> <g transform="translate(.5 .5)"> <g> <path d="M20 21v20m10 -20v20m-10 -10h20"></path> </g> <g> <path d="M40 31h0.0"></path> <path d="M227.5 31h0.0"></path> <path d="M40.0 31h20"></path> <g class="non-terminal "> <path d="M60.0 31h0.0"></path> <path d="M207.5 31h0.0"></path> <rect height="22" width="147.5" x="60" y="20"></rect> <text x="133.75" y="35">Preserved token</text> </g> <path d="M207.5 31h20"></path> <path d="M40.0 31a10 10 0 0 1 10 10v10a10 10 0 0 0 10 10"></path> <g class="non-terminal "> <path d="M60.0 61h12.75"></path> <path d="M194.75 61h12.75"></path> <rect height="22" width="122" x="72.75" y="50"></rect> <text x="133.75" y="65">Simple block</text> </g> <path d="M207.5 61a10 10 0 0 0 10 -10v-10a10 10 0 0 1 10 -10"></path> <path d="M40.0 31a10 10 0 0 1 10 10v40a10 10 0 0 0 10 10"></path> <g class="non-terminal "> <path d="M60.0 91h4.25"></path> <path d="M203.25 91h4.25"></path> <rect height="22" width="139" x="64.25" y="80"></rect> <text x="133.75" y="95">Function block</text> </g> <path d="M207.5 91a10 10 0 0 0 10 -10v-40a10 10 0 0 1 10 -10"></path> </g> <path d="M 227.5 31 h 20 m -10 -10 v 20 m 10 -20 v 20"></path> </g> </svg> </div> <dt id="simple-block-diagram"><a class="self-link" href="#simple-block-diagram"></a>Simple block <dd> <div class="railroad"> <svg class="railroad-diagram" height="176" viewBox="0 0 404.5 176" width="404.5"> <g transform="translate(.5 .5)"> <g> <path d="M20 30v20m10 -20v20m-10 -10h20"></path> </g> <g> <path d="M40 40h0.0"></path> <path d="M364.5 40h0.0"></path> <path d="M40.0 40h20"></path> <g> <path d="M60.0 40h0.0"></path> <path d="M344.5 40h0.0"></path> <g class="terminal "> <path d="M60.0 40h0.0"></path> <path d="M88.5 40h0.0"></path> <rect height="22" rx="10" ry="10" width="28.5" x="60" y="29"></rect> <text x="74.25" y="44">{</text> </g> <path d="M88.5 40h10"></path> <g> <path d="M98.5 40h0.0"></path> <path d="M306.0 40h0.0"></path> <path d="M98.5 40a10 10 0 0 0 10 -10v0a10 10 0 0 1 10 -10"></path> <g> <path d="M118.5 20h167.5"></path> </g> <path d="M286.0 20a10 10 0 0 1 10 10v0a10 10 0 0 0 10 10"></path> <path d="M98.5 40h20"></path> <g> <path d="M118.5 40h0.0"></path> <path d="M286.0 40h0.0"></path> <path d="M118.5 40h10"></path> <g class="non-terminal "> <path d="M128.5 40h0.0"></path> <path d="M276.0 40h0.0"></path> <rect height="22" width="147.5" x="128.5" y="29"></rect> <text x="202.25" y="44">Component value</text> </g> <path d="M276.0 40h10"></path> <path d="M128.5 40a10 10 0 0 0 -10 10v0a10 10 0 0 0 10 10"></path> <g> <path d="M128.5 60h147.5"></path> </g> <path d="M276.0 60a10 10 0 0 0 10 -10v0a10 10 0 0 0 -10 -10"></path> </g> <path d="M286.0 40h20"></path> </g> <path d="M306.0 40h10"></path> <g class="terminal "> <path d="M316.0 40h0.0"></path> <path d="M344.5 40h0.0"></path> <rect height="22" rx="10" ry="10" width="28.5" x="316" y="29"></rect> <text x="330.25" y="44">}</text> </g> </g> <path d="M344.5 40h20"></path> <path d="M40.0 40a10 10 0 0 1 10 10v28a10 10 0 0 0 10 10"></path> <g> <path d="M60.0 88h0.0"></path> <path d="M344.5 88h0.0"></path> <g class="terminal "> <path d="M60.0 88h0.0"></path> <path d="M88.5 88h0.0"></path> <rect height="22" rx="10" ry="10" width="28.5" x="60" y="77"></rect> <text x="74.25" y="92">(</text> </g> <path d="M88.5 88h10"></path> <g> <path d="M98.5 88h0.0"></path> <path d="M306.0 88h0.0"></path> <path d="M98.5 88a10 10 0 0 0 10 -10v0a10 10 0 0 1 10 -10"></path> <g> <path d="M118.5 68h167.5"></path> </g> <path d="M286.0 68a10 10 0 0 1 10 10v0a10 10 0 0 0 10 10"></path> <path d="M98.5 88h20"></path> <g> <path d="M118.5 88h0.0"></path> <path d="M286.0 88h0.0"></path> <path d="M118.5 88h10"></path> <g class="non-terminal "> <path d="M128.5 88h0.0"></path> <path d="M276.0 88h0.0"></path> <rect height="22" width="147.5" x="128.5" y="77"></rect> <text x="202.25" y="92">Component value</text> </g> <path d="M276.0 88h10"></path> <path d="M128.5 88a10 10 0 0 0 -10 10v0a10 10 0 0 0 10 10"></path> <g> <path d="M128.5 108h147.5"></path> </g> <path d="M276.0 108a10 10 0 0 0 10 -10v0a10 10 0 0 0 -10 -10"></path> </g> <path d="M286.0 88h20"></path> </g> <path d="M306.0 88h10"></path> <g class="terminal "> <path d="M316.0 88h0.0"></path> <path d="M344.5 88h0.0"></path> <rect height="22" rx="10" ry="10" width="28.5" x="316" y="77"></rect> <text x="330.25" y="92">)</text> </g> </g> <path d="M344.5 88a10 10 0 0 0 10 -10v-28a10 10 0 0 1 10 -10"></path> <path d="M40.0 40a10 10 0 0 1 10 10v76a10 10 0 0 0 10 10"></path> <g> <path d="M60.0 136h0.0"></path> <path d="M344.5 136h0.0"></path> <g class="terminal "> <path d="M60.0 136h0.0"></path> <path d="M88.5 136h0.0"></path> <rect height="22" rx="10" ry="10" width="28.5" x="60" y="125"></rect> <text x="74.25" y="140">[</text> </g> <path d="M88.5 136h10"></path> <g> <path d="M98.5 136h0.0"></path> <path d="M306.0 136h0.0"></path> <path d="M98.5 136a10 10 0 0 0 10 -10v0a10 10 0 0 1 10 -10"></path> <g> <path d="M118.5 116h167.5"></path> </g> <path d="M286.0 116a10 10 0 0 1 10 10v0a10 10 0 0 0 10 10"></path> <path d="M98.5 136h20"></path> <g> <path d="M118.5 136h0.0"></path> <path d="M286.0 136h0.0"></path> <path d="M118.5 136h10"></path> <g class="non-terminal "> <path d="M128.5 136h0.0"></path> <path d="M276.0 136h0.0"></path> <rect height="22" width="147.5" x="128.5" y="125"></rect> <text x="202.25" y="140">Component value</text> </g> <path d="M276.0 136h10"></path> <path d="M128.5 136a10 10 0 0 0 -10 10v0a10 10 0 0 0 10 10"></path> <g> <path d="M128.5 156h147.5"></path> </g> <path d="M276.0 156a10 10 0 0 0 10 -10v0a10 10 0 0 0 -10 -10"></path> </g> <path d="M286.0 136h20"></path> </g> <path d="M306.0 136h10"></path> <g class="terminal "> <path d="M316.0 136h0.0"></path> <path d="M344.5 136h0.0"></path> <rect height="22" rx="10" ry="10" width="28.5" x="316" y="125"></rect> <text x="330.25" y="140">]</text> </g> </g> <path d="M344.5 136a10 10 0 0 0 10 -10v-76a10 10 0 0 1 10 -10"></path> </g> <path d="M 364.5 40 h 20 m -10 -10 v 20 m 10 -20 v 20"></path> </g> </svg> </div> <dt id="function-block-diagram"><a class="self-link" href="#function-block-diagram"></a>Function block <dd> <div class="railroad"> <svg class="railroad-diagram" height="80" viewBox="0 0 512.0 80" width="512.0"> <g transform="translate(.5 .5)"> <g> <path d="M20 30v20m10 -20v20m-10 -10h20"></path> </g> <path d="M40 40h10"></path> <g class="non-terminal "> <path d="M50 40h0.0"></path> <path d="M206.0 40h0.0"></path> <rect height="22" width="156" x="50" y="29"></rect> <text x="128" y="44"><function-token></text> </g> <path d="M206.0 40h10"></path> <g> <path d="M216.0 40h0.0"></path> <path d="M423.5 40h0.0"></path> <path d="M216.0 40a10 10 0 0 0 10 -10v0a10 10 0 0 1 10 -10"></path> <g> <path d="M236.0 20h167.5"></path> </g> <path d="M403.5 20a10 10 0 0 1 10 10v0a10 10 0 0 0 10 10"></path> <path d="M216.0 40h20"></path> <g> <path d="M236.0 40h0.0"></path> <path d="M403.5 40h0.0"></path> <path d="M236.0 40h10"></path> <g class="non-terminal "> <path d="M246.0 40h0.0"></path> <path d="M393.5 40h0.0"></path> <rect height="22" width="147.5" x="246" y="29"></rect> <text x="319.75" y="44">Component value</text> </g> <path d="M393.5 40h10"></path> <path d="M246.0 40a10 10 0 0 0 -10 10v0a10 10 0 0 0 10 10"></path> <g> <path d="M246.0 60h147.5"></path> </g> <path d="M393.5 60a10 10 0 0 0 10 -10v0a10 10 0 0 0 -10 -10"></path> </g> <path d="M403.5 40h20"></path> </g> <path d="M423.5 40h10"></path> <g class="terminal "> <path d="M433.5 40h0.0"></path> <path d="M462.0 40h0.0"></path> <rect height="22" rx="10" ry="10" width="28.5" x="433.5" y="29"></rect> <text x="447.75" y="44">)</text> </g> <path d="M462.0 40h10"></path> <path d="M 472.0 40 h 20 m -10 -10 v 20 m 10 -20 v 20"></path> </g> </svg> </div> </dl> <h3 class="heading settled" data-level="5.2" id="css-tree"><span class="secno">5.2. </span><span class="content"> CSS Parsing Results</span><a class="self-link" href="#css-tree"></a></h3> <p>The result of parsing can be any of the following (or lists of these):</p> <dl> <dt data-md><dfn class="dfn-paneled" data-dfn-for="CSS" data-dfn-type="dfn" data-export id="css-stylesheet">stylesheet</dfn> <dd data-md> <p>A stylesheet has a list of <a data-link-type="dfn" href="#css-rule" id="ref-for-css-rule">rules</a>.</p> <dt data-md><dfn class="dfn-paneled" data-dfn-for="CSS" data-dfn-type="dfn" data-export id="css-rule">rule</dfn> <dd data-md> <p>A <a data-link-type="dfn" href="#css-rule" id="ref-for-css-rule①">rule</a> is either an <a data-link-type="dfn" href="#at-rule" id="ref-for-at-rule①①">at-rule</a> or a <a data-link-type="dfn" href="#qualified-rule" id="ref-for-qualified-rule④">qualified rule</a>.</p> <dt><a data-link-type="dfn" href="#at-rule" id="ref-for-at-rule①②">at-rule</a> <dd> An <a data-link-type="dfn" href="#at-rule" id="ref-for-at-rule①③">at-rule</a> has a name which is a <a data-link-type="dfn" href="https://infra.spec.whatwg.org/#string" id="ref-for-string">string</a>, a prelude consisting of a list of <a data-link-type="dfn" href="#component-value" id="ref-for-component-value">component values</a>. <a data-link-type="dfn" href="#block-at-rule" id="ref-for-block-at-rule">Block at-rules</a> (ending in a {}-block) will additionally have a list of <a data-link-type="dfn">declarations</a> and a list of child <a data-link-type="dfn" href="#css-rule" id="ref-for-css-rule②">rules</a>. (<a data-link-type="dfn" href="#statement-at-rule" id="ref-for-statement-at-rule">Statement at-rules</a>, ending in a semicolon, will not.) <dt><dfn class="dfn-paneled" data-dfn-for="CSS" data-dfn-type="dfn" data-export id="qualified-rule">qualified rule</dfn> <dd> A qualified rule has a prelude consisting of a list of component values, a list of declarations, and a list of child rules. <p class="note" role="note"><span class="marker">Note:</span> Most qualified rules will be style rules, where the prelude is a selector <a data-link-type="biblio" href="#biblio-selectors-4" title="Selectors Level 4">[selectors-4]</a> and its declarations are <a data-link-type="dfn" href="https://drafts.csswg.org/css-cascade-5/#css-property" id="ref-for-css-property">properties</a>.</p> <dt><dfn class="dfn-paneled" data-dfn-for="CSS" data-dfn-type="dfn" data-export id="declaration">declaration</dfn> <dd> A declaration has a name which is a <a data-link-type="dfn" href="https://infra.spec.whatwg.org/#string" id="ref-for-string①">string</a>, a value consisting of a list of <a data-link-type="dfn" href="#component-value" id="ref-for-component-value①">component values</a>, and an <var>important</var> flag which is initially unset. It also has an optional <var>original text</var> which is a <span id="ref-for-string②">string</span> (captured for only a few declarations). <p>Declarations are further categorized as <dfn class="dfn-paneled" data-dfn-for="CSS" data-dfn-type="dfn" data-export id="css-property-declarations">property declarations</dfn> or <dfn class="dfn-paneled" data-dfn-for="CSS" data-dfn-type="dfn" data-export id="css-descriptor-declarations">descriptor declarations</dfn>, with the former setting CSS <a data-link-type="dfn" href="https://drafts.csswg.org/css-cascade-5/#css-property" id="ref-for-css-property①">properties</a> and appearing most often in <a data-link-type="dfn" href="#qualified-rule" id="ref-for-qualified-rule⑤">qualified rules</a> and the latter setting CSS <a data-link-type="dfn" href="#css-descriptor" id="ref-for-css-descriptor">descriptors</a>, which appear only in <a data-link-type="dfn" href="#at-rule" id="ref-for-at-rule①④">at-rules</a>. (This categorization does not occur at the Syntax level; instead, it is a product of where the declaration appears, and is defined by the respective specifications defining the given rule.)</p> <dt><dfn class="dfn-paneled" data-dfn-for="CSS" data-dfn-type="dfn" data-export id="component-value">component value</dfn> <dd> A component value is one of the <a data-link-type="dfn" href="#preserved-tokens" id="ref-for-preserved-tokens">preserved tokens</a>, a <a data-link-type="dfn" href="#function" id="ref-for-function">function</a>, or a <a data-link-type="dfn" href="#simple-block" id="ref-for-simple-block">simple block</a>. <dt><dfn class="dfn-paneled" data-dfn-for="CSS" data-dfn-type="dfn" data-export id="preserved-tokens">preserved tokens</dfn> <dd> Any token produced by the tokenizer except for <a class="production css" data-link-type="type" href="#typedef-function-token" id="ref-for-typedef-function-token⑦"><function-token></a>s, <a href="#tokendef-open-curly" id="ref-for-tokendef-open-curly④"><{-token></a>s, <a href="#tokendef-open-paren" id="ref-for-tokendef-open-paren①"><(-token></a>s, and <a href="#tokendef-open-square" id="ref-for-tokendef-open-square①"><[-token></a>s. <p class="note" role="note"><span class="marker">Note:</span> The non-<a data-link-type="dfn" href="#preserved-tokens" id="ref-for-preserved-tokens①">preserved tokens</a> listed above are always consumed into higher-level objects, either functions or simple blocks, and so never appear in any parser output themselves.</p> <p class="note" role="note"><span class="marker">Note:</span> The tokens <a href="#tokendef-close-curly" id="ref-for-tokendef-close-curly②"><}-token></a>s, <a href="#tokendef-close-paren" id="ref-for-tokendef-close-paren①"><)-token></a>s, <a href="#tokendef-close-square" id="ref-for-tokendef-close-square①"><]-token></a>, <a class="production css" data-link-type="type" href="#typedef-bad-string-token" id="ref-for-typedef-bad-string-token②"><bad-string-token></a>, and <a class="production css" data-link-type="type" href="#typedef-bad-url-token" id="ref-for-typedef-bad-url-token⑦"><bad-url-token></a> are always parse errors, but they are preserved in the token stream by this specification to allow other specs, such as Media Queries, to define more fine-grained error-handling than just dropping an entire declaration or block.</p> <dt><dfn class="dfn-paneled" data-dfn-for="CSS" data-dfn-type="dfn" data-export id="function">function</dfn> <dd> A function has a name and a value consisting of a list of <a data-link-type="dfn" href="#component-value" id="ref-for-component-value②">component values</a>. <dt><dfn class="dfn-paneled" data-dfn-for="CSS" data-dfn-type="dfn" data-export id="simple-block">simple block</dfn> <dt><dfn class="dfn-paneled" data-dfn-for="CSS" data-dfn-type="dfn" data-export id="curly-block">{}-block</dfn> <dt><dfn class="dfn-paneled" data-dfn-for="CSS" data-dfn-type="dfn" data-export id="square-block">[]-block</dfn> <dt><dfn class="dfn-paneled" data-dfn-for="CSS" data-dfn-type="dfn" data-export id="paren-block">()-block</dfn> <dd> A simple block has an associated token (either a <a href="#tokendef-open-square" id="ref-for-tokendef-open-square②"><[-token></a>, <a href="#tokendef-open-paren" id="ref-for-tokendef-open-paren②"><(-token></a>, or <a href="#tokendef-open-curly" id="ref-for-tokendef-open-curly⑤"><{-token></a>) and a value consisting of a list of component values. <p><a data-link-type="dfn" href="#curly-block" id="ref-for-curly-block">{}-block</a>, <a data-link-type="dfn" href="#square-block" id="ref-for-square-block">[]-block</a>, and <a data-link-type="dfn" href="#paren-block" id="ref-for-paren-block">()-block</a> refer specifically to a <a data-link-type="dfn" href="#simple-block" id="ref-for-simple-block①">simple block</a> with that corresponding associated token.</p> </dl> <h3 class="heading settled" data-level="5.3" id="parser-definitions"><span class="secno">5.3. </span><span class="content"> Token Streams</span><a class="self-link" href="#parser-definitions"></a></h3> <p>A <dfn class="dfn-paneled" data-dfn-for="CSS" data-dfn-type="dfn" data-noexport id="css-token-stream">token stream</dfn> is a <a data-link-type="dfn" href="https://infra.spec.whatwg.org/#struct" id="ref-for-struct">struct</a> representing a stream of <a data-link-type="dfn" href="#token-stream-tokens" id="ref-for-token-stream-tokens">tokens</a> and/or <a data-link-type="dfn" href="#component-value" id="ref-for-component-value③">component values</a>. It has the following <a data-link-type="dfn" href="https://infra.spec.whatwg.org/#struct-item" id="ref-for-struct-item">items</a>:</p> <dl> <dt data-md><dfn class="dfn-paneled" data-dfn-for="token stream" data-dfn-type="dfn" data-noexport id="token-stream-tokens">tokens</dfn> <dd data-md> <p>A <a data-link-type="dfn" href="https://infra.spec.whatwg.org/#list" id="ref-for-list">list</a> of <a data-link-type="dfn" href="#token-stream-tokens" id="ref-for-token-stream-tokens①">tokens</a> and/or <a data-link-type="dfn" href="#component-value" id="ref-for-component-value④">component values</a>.</p> <p class="note" role="note"><span class="marker">Note:</span> This specification assumes, for simplicity, that the input stream has been fully tokenized before parsing begins. However, the parsing algorithms only use one token of "lookahead", so in practice tokenization and parsing can be done in lockstep.</p> <dt data-md><dfn class="dfn-paneled" data-dfn-for="token stream" data-dfn-type="dfn" data-noexport id="token-stream-index">index</dfn> <dd data-md> <p>An index into the <a data-link-type="dfn" href="#token-stream-tokens" id="ref-for-token-stream-tokens②">tokens</a>, representing the progress of parsing. It starts at 0 initially.</p> <p class="note" role="note"><span class="marker">Note:</span> Aside from <a data-link-type="dfn" href="#token-stream-mark" id="ref-for-token-stream-mark">marking</a>, the <a data-link-type="dfn" href="#token-stream-index" id="ref-for-token-stream-index">index</a> never goes backwards. Thus the already-processed prefix of <a data-link-type="dfn" href="#token-stream-tokens" id="ref-for-token-stream-tokens③">tokens</a> can be eagerly discarded as it’s processed.</p> <dt data-md><dfn class="dfn-paneled" data-dfn-for="token stream" data-dfn-type="dfn" data-noexport id="token-stream-marked-indexes">marked indexes</dfn> <dd data-md> <p>A <a data-link-type="dfn" href="https://infra.spec.whatwg.org/#stack" id="ref-for-stack">stack</a> of index values, representing points that the parser might return to. It starts empty initially.</p> </dl> <p>CSS has a small number of places that require referencing the precise text that was parsed for a declaration’s value (not just what tokens were produced from that text). This is not explicitly described in the algorithmic structure here, but the <a data-link-type="dfn" href="#css-token-stream" id="ref-for-css-token-stream①">token stream</a> must, thus, have the ability to reproduce the original text of declarations on demand. See <a data-link-type="dfn" href="#consume-a-declaration" id="ref-for-consume-a-declaration">consume a declaration</a> for details on when this is required.</p> <p>Several operations can be performed on a <a data-link-type="dfn" href="#css-token-stream" id="ref-for-css-token-stream②">token stream</a>:</p> <dl> <dt data-md><dfn class="dfn-paneled" data-dfn-for="token stream" data-dfn-type="dfn" data-noexport id="token-stream-next-token">next token</dfn> <dd data-md> <p>The item of <a data-link-type="dfn" href="#token-stream-tokens" id="ref-for-token-stream-tokens④">tokens</a> at <a data-link-type="dfn" href="#token-stream-index" id="ref-for-token-stream-index①">index</a>.</p> <p>If that index would be out-of-bounds past the end of the list, it’s instead an <a class="production css" data-link-type="type" href="#typedef-eof-token" id="ref-for-typedef-eof-token②"><eof-token></a>.</p> <dt data-md><dfn class="dfn-paneled" data-dfn-for="token stream" data-dfn-type="dfn" data-noexport id="token-stream-empty">empty</dfn> <dd data-md> <p>A token stream is <a data-link-type="dfn" href="#token-stream-empty" id="ref-for-token-stream-empty">empty</a> if the <a data-link-type="dfn" href="#token-stream-next-token" id="ref-for-token-stream-next-token">next token</a> is an <a class="production css" data-link-type="type" href="#typedef-eof-token" id="ref-for-typedef-eof-token③"><eof-token></a>.</p> <dt data-md><dfn class="dfn-paneled" data-dfn-for="token stream" data-dfn-type="dfn" data-noexport id="token-stream-consume-a-token">consume a token</dfn> <dd data-md> <p>Let <var>token</var> be the <a data-link-type="dfn" href="#token-stream-next-token" id="ref-for-token-stream-next-token①">next token</a>. Increment <a data-link-type="dfn" href="#token-stream-index" id="ref-for-token-stream-index②">index</a>, then return <var>token</var>.</p> <dt data-md><dfn class="dfn-paneled" data-dfn-for="token stream" data-dfn-type="dfn" data-noexport id="token-stream-discard-a-token">discard a token</dfn> <dd data-md> <p>If the <a data-link-type="dfn" href="#css-token-stream" id="ref-for-css-token-stream③">token stream</a> is not <a data-link-type="dfn">empty</a>, increment <a data-link-type="dfn" href="#token-stream-index" id="ref-for-token-stream-index③">index</a>.</p> <dt data-md><dfn class="dfn-paneled" data-dfn-for="token stream" data-dfn-type="dfn" data-noexport id="token-stream-mark">mark</dfn> <dd data-md> <p>Append <a data-link-type="dfn" href="#token-stream-index" id="ref-for-token-stream-index④">index</a> to <a data-link-type="dfn" href="#token-stream-marked-indexes" id="ref-for-token-stream-marked-indexes">marked indexes</a>.</p> <dt data-md><dfn class="dfn-paneled" data-dfn-for="token stream" data-dfn-type="dfn" data-noexport id="token-stream-restore-a-mark">restore a mark</dfn> <dd data-md> <p><a data-link-type="dfn" href="https://infra.spec.whatwg.org/#stack-pop" id="ref-for-stack-pop">Pop</a> from <a data-link-type="dfn" href="#token-stream-marked-indexes" id="ref-for-token-stream-marked-indexes①">marked indexes</a>, and set <a data-link-type="dfn" href="#token-stream-index" id="ref-for-token-stream-index⑤">index</a> to the popped value.</p> <dt data-md><dfn class="dfn-paneled" data-dfn-for="token stream" data-dfn-type="dfn" data-noexport id="token-stream-discard-a-mark">discard a mark</dfn> <dd data-md> <p><a data-link-type="dfn" href="https://infra.spec.whatwg.org/#stack-pop" id="ref-for-stack-pop①">Pop</a> from <a data-link-type="dfn" href="#token-stream-marked-indexes" id="ref-for-token-stream-marked-indexes②">marked indexes</a>, and do nothing with the popped value.</p> <dt data-md><dfn class="dfn-paneled" data-dfn-for="token stream" data-dfn-type="dfn" data-noexport id="token-stream-discard-whitespace">discard whitespace</dfn> <dd data-md> <p>While the <a data-link-type="dfn" href="#token-stream-next-token" id="ref-for-token-stream-next-token②">next token</a> is a <a class="production css" data-link-type="type" href="#typedef-whitespace-token" id="ref-for-typedef-whitespace-token②"><whitespace-token></a>, <a data-link-type="dfn" href="#token-stream-discard-a-token" id="ref-for-token-stream-discard-a-token">discard a token</a>.</p> <dt data-md><dfn class="dfn-paneled" data-dfn-for="token stream" data-dfn-type="dfn" data-noexport id="token-stream-process">process</dfn> <dd data-md> <p>To <a data-link-type="dfn" href="#token-stream-process" id="ref-for-token-stream-process">process</a>, given a following list of token types and associated actions, perform the action associated with the <a data-link-type="dfn" href="#token-stream-next-token" id="ref-for-token-stream-next-token③">next token</a>. Repeat until one of the actions returns something, then return that.</p> </dl> <p>An <dfn class="dfn-paneled css" data-dfn-type="type" data-export id="typedef-eof-token"><a class="production css" data-link-type="type" href="#typedef-eof-token" id="ref-for-typedef-eof-token④"><eof-token></a></dfn> is a conceptual token, not actually produced by the tokenizer, used to indicate that the <a data-link-type="dfn" href="#css-token-stream" id="ref-for-css-token-stream④">token stream</a> has been exhausted.</p> <h3 class="heading settled" data-level="5.4" id="parser-entry-points"><span class="secno">5.4. </span><span class="content"> Parser Entry Points</span><a class="self-link" href="#parser-entry-points"></a></h3> <p>The algorithms defined in this section produce high-level CSS objects from lists of CSS tokens.</p> <div class="algorithm" data-algorithm="normalize into a list of tokens"> The algorithms here operate on a token stream as input, but for convenience can also be invoked with a number of other value types. <p>To <dfn class="dfn-paneled" data-dfn-type="dfn" data-export data-local-lt="normalize" id="normalize-into-a-token-stream">normalize into a token stream</dfn> a given <var>input</var>:</p> <ol> <li data-md> <p>If <var>input</var> is already a <a data-link-type="dfn" href="#css-token-stream" id="ref-for-css-token-stream⑤">token stream</a>, return it.</p> <li data-md> <p>If <var>input</var> is a list of CSS <a data-link-type="dfn" href="#token-stream-tokens" id="ref-for-token-stream-tokens⑤">tokens</a> and/or <a data-link-type="dfn" href="#component-value" id="ref-for-component-value⑤">component values</a>, create a new <a data-link-type="dfn" href="#css-token-stream" id="ref-for-css-token-stream⑥">token stream</a> with <var>input</var> as its <span id="ref-for-token-stream-tokens⑥">tokens</span>, and return it.</p> <li data-md> <p>If <var>input</var> is a <a data-link-type="dfn" href="https://infra.spec.whatwg.org/#string" id="ref-for-string③">string</a>, then <a data-link-type="dfn" href="#css-filter-code-points" id="ref-for-css-filter-code-points①">filter code points</a> from <var>input</var>, <a data-link-type="dfn" href="#css-tokenize" id="ref-for-css-tokenize">tokenize</a> the result, then create a new <a data-link-type="dfn" href="#css-token-stream" id="ref-for-css-token-stream⑦">token stream</a> with those tokens as its <a data-link-type="dfn" href="#token-stream-tokens" id="ref-for-token-stream-tokens⑦">tokens</a>, and return it.</p> <li data-md> <p class="assertion">Assert: Only the preceding types should be passed as <var>input</var>.</p> </ol> </div> <p class="note" role="note"><span class="marker">Note:</span> Other specs can define additional entry points for their own purposes.</p> <div class="note" role="note"> The following notes should probably be translated into normative text in the relevant specs, hooking this spec’s terms: <ul> <li> "<a data-link-type="dfn" href="#parse-a-stylesheet" id="ref-for-parse-a-stylesheet">Parse a stylesheet</a>" is intended to be the normal parser entry point, for parsing stylesheets. <li> "<a data-link-type="dfn" href="#parse-a-stylesheets-contents" id="ref-for-parse-a-stylesheets-contents">Parse a stylesheet’s contents</a>" is intended for use by the <code class="idl"><a data-link-type="idl" href="https://drafts.csswg.org/cssom-1/#dom-cssstylesheet-replace" id="ref-for-dom-cssstylesheet-replace">CSSStyleSheet replace()</a></code> method, and similar, which parse text into the contents of an existing stylesheet. <li> "<a data-link-type="dfn" href="#parse-a-rule" id="ref-for-parse-a-rule">Parse a rule</a>" is intended for use by the <code class="idl"><a data-link-type="idl" href="https://drafts.csswg.org/cssom-1/#dom-cssstylesheet-insertrule" id="ref-for-dom-cssstylesheet-insertrule">CSSStyleSheet insertRule()</a></code> method, and similar, which parse text into a single rule. <code>CSSStyleSheet#insertRule</code> method, and similar functions which might exist, which parse text into a single rule. <li> "<a data-link-type="dfn" href="#parse-a-declaration" id="ref-for-parse-a-declaration">Parse a declaration</a>" is used in <a class="css" data-link-type="maybe" href="https://drafts.csswg.org/css-conditional-3/#at-ruledef-supports" id="ref-for-at-ruledef-supports">@supports</a> conditions. <a data-link-type="biblio" href="#biblio-css3-conditional" title="CSS Conditional Rules Module Level 3">[CSS3-CONDITIONAL]</a> <li> "<a data-link-type="dfn" href="#parse-a-blocks-contents" id="ref-for-parse-a-blocks-contents">Parse a block’s contents</a>" is intended for parsing the contents of any block in CSS (including things like the style attribute), and APIs such as <code class="idl"><a data-link-type="idl" href="https://drafts.csswg.org/cssom-1/#dom-cssstyledeclaration-csstext" id="ref-for-dom-cssstyledeclaration-csstext">the CSSStyleDeclaration cssText attribute</a></code>. <li> "<a data-link-type="dfn" href="#parse-a-component-value" id="ref-for-parse-a-component-value">Parse a component value</a>" is for things that need to consume a single value, like the parsing rules for <a class="css" data-link-type="maybe" href="https://drafts.csswg.org/css-values-5/#funcdef-attr" id="ref-for-funcdef-attr">attr()</a>. <li> "<a data-link-type="dfn" href="#parse-a-list-of-component-values" id="ref-for-parse-a-list-of-component-values">Parse a list of component values</a>" is for the contents of presentational attributes, which parse text into a single declaration’s value, or for parsing a stand-alone selector <a data-link-type="biblio" href="#biblio-select" title="Selectors Level 3">[SELECT]</a> or list of Media Queries <a data-link-type="biblio" href="#biblio-mediaq" title="Media Queries Level 4">[MEDIAQ]</a>, as in <a href="https://www.w3.org/TR/selectors-api/">Selectors API</a> or the <code>media</code> HTML attribute. </ul> </div> <h4 class="heading settled" data-level="5.4.1" id="parse-grammar"><span class="secno">5.4.1. </span><span class="content"> Parse something according to a CSS grammar</span><a class="self-link" href="#parse-grammar"></a></h4> <p>It is often desirable to parse a string or token list to see if it matches some CSS grammar, and if it does, to destructure it according to the grammar. This section provides a generic hook for this kind of operation. It should be invoked like <span class="informative">"parse <var>foo</var> as a CSS <a class="production css" data-link-type="type" href="https://drafts.csswg.org/css-color-5/#typedef-color" id="ref-for-typedef-color"><color></a>"</span>, or similar.</p> <p>This algorithm returns either failure, if the input does not match the provided grammar, or the result of parsing the input according to the grammar, which is an unspecified structure corresponding to the provided grammar specification. The return value must only be interacted with by specification prose, where the representation ambiguity is not problematic. If it is meant to be exposed outside of spec language, the spec using the result must explicitly translate it into a well-specified representation, such as, for example, by invoking a CSS serialization algorithm <span class="informative">(like "serialize as a CSS <a class="production css" data-link-type="type" href="https://drafts.csswg.org/css-values-4/#string-value" id="ref-for-string-value"><string></a> value").</span></p> <p class="note" role="note"><span class="marker">Note:</span> This algorithm, and <a data-link-type="dfn" href="#css-parse-a-comma-separated-list-according-to-a-css-grammar" id="ref-for-css-parse-a-comma-separated-list-according-to-a-css-grammar">parse a comma-separated list according to a CSS grammar</a>, are <em>usually</em> the only parsing algorithms other specs will want to call. The remaining parsing algorithms are meant mostly for <a data-link-type="biblio" href="#biblio-cssom" title="CSS Object Model (CSSOM)">[CSSOM]</a> and related "explicitly constructing CSS structures" cases. Consult the CSSWG for guidance first if you think you need to use one of the other algorithms.</p> <div class="algorithm" data-algorithm="parse something according to a CSS grammar" data-algorithm-for="CSS"> To <dfn class="dfn-paneled" data-dfn-for="CSS" data-dfn-type="dfn" data-export data-lt="parse something according to a CSS grammar|parse" id="css-parse-something-according-to-a-css-grammar">parse something according to a CSS grammar</dfn> (aka simply <a data-link-type="dfn" href="#css-parse-something-according-to-a-css-grammar" id="ref-for-css-parse-something-according-to-a-css-grammar">parse</a>) given an <var>input</var> and a CSS <var>grammar</var> production: <ol> <li> <a data-link-type="dfn" href="#normalize-into-a-token-stream" id="ref-for-normalize-into-a-token-stream">Normalize</a> <var>input</var>, and set <var>input</var> to the result. <li> <a data-link-type="dfn" href="#parse-a-list-of-component-values" id="ref-for-parse-a-list-of-component-values①">Parse a list of component values</a> from <var>input</var>, and let <var>result</var> be the return value. <li> Attempt to match <var>result</var> against <var>grammar</var>. If this is successful, return the matched result; otherwise, return failure. </ol> </div> <h4 class="heading settled" data-level="5.4.2" id="parse-comma-list"><span class="secno">5.4.2. </span><span class="content"> Parse a comma-separated list according to a CSS grammar</span><a class="self-link" href="#parse-comma-list"></a></h4> <p>While one can definitely <a data-link-type="dfn" href="#css-parse-something-according-to-a-css-grammar" id="ref-for-css-parse-something-according-to-a-css-grammar①">parse</a> a value according to a grammar with commas in it, if <em>any</em> part of the value fails to parse, the entire thing doesn’t parse, and returns failure.</p> <p>Sometimes that’s what’s desired (such as in list-valued CSS properties); other times, it’s better to let each comma-separated sub-part of the value parse separately, dealing with the parts that parse successfully one way, and the parts that fail to parse another way (typically ignoring them, such as in <code><a data-link-type="element-sub" href="https://html.spec.whatwg.org/multipage/embedded-content.html#attr-img-sizes" id="ref-for-attr-img-sizes"><img sizes></a></code>).</p> <p>This algorithm provides an easy hook to accomplish exactly that. It returns a list of values split by "top-level" commas, where each values is either failure (if it failed to parse) or the result of parsing (an unspecified structure, as described in the <a data-link-type="dfn" href="#css-parse-something-according-to-a-css-grammar" id="ref-for-css-parse-something-according-to-a-css-grammar②">parse</a> algorithm).</p> <div class="algorithm" data-algorithm="parse a comma-separated list according to a CSS grammar" data-algorithm-for="CSS"> To <dfn class="dfn-paneled" data-dfn-for="CSS" data-dfn-type="dfn" data-export data-lt="parse a comma-separated list according to a CSS grammar|parse a list" id="css-parse-a-comma-separated-list-according-to-a-css-grammar">parse a comma-separated list according to a CSS grammar</dfn> (aka <a data-link-type="dfn" href="#css-parse-a-comma-separated-list-according-to-a-css-grammar" id="ref-for-css-parse-a-comma-separated-list-according-to-a-css-grammar①">parse a list</a>) given an <var>input</var> and a CSS <var>grammar</var> production: <ol> <li> <a data-link-type="dfn" href="#normalize-into-a-token-stream" id="ref-for-normalize-into-a-token-stream①">Normalize</a> <var>input</var>, and set <var>input</var> to the result. <li> If <var>input</var> contains only <a class="production css" data-link-type="type" href="#typedef-whitespace-token" id="ref-for-typedef-whitespace-token③"><whitespace-token></a>s, return an empty <a data-link-type="dfn" href="https://infra.spec.whatwg.org/#list" id="ref-for-list①">list</a>. <li> <a data-link-type="dfn" href="#parse-a-comma-separated-list-of-component-values" id="ref-for-parse-a-comma-separated-list-of-component-values">Parse a comma-separated list of component values</a> from <var>input</var>, and let <var>list</var> be the return value. <li> <a data-link-type="dfn" href="https://infra.spec.whatwg.org/#list-iterate" id="ref-for-list-iterate">For each</a> <var>item</var> of <var>list</var>, replace <var>item</var> with the result of <a data-link-type="dfn" href="#css-parse-something-according-to-a-css-grammar" id="ref-for-css-parse-something-according-to-a-css-grammar③">parsing</a> <var>item</var> with <var>grammar</var>. <li> Return <var>list</var>. </ol> </div> <h4 class="heading settled" data-level="5.4.3" id="parse-stylesheet"><span class="secno">5.4.3. </span><span class="content"> Parse a stylesheet</span><a class="self-link" href="#parse-stylesheet"></a></h4> <div class="algorithm" data-algorithm="parse a stylesheet"> To <dfn class="dfn-paneled" data-dfn-type="dfn" data-export id="parse-a-stylesheet">parse a stylesheet</dfn> from an <var>input</var> given an optional <a data-link-type="dfn" href="https://url.spec.whatwg.org/#concept-url" id="ref-for-concept-url">url</a> <var>location</var>: <ol> <li> If <var>input</var> is a byte stream for a stylesheet, <a data-link-type="dfn" href="#css-decode-bytes" id="ref-for-css-decode-bytes">decode bytes</a> from <var>input</var>, and set <var>input</var> to the result. <li> <a data-link-type="dfn" href="#normalize-into-a-token-stream" id="ref-for-normalize-into-a-token-stream②">Normalize</a> <var>input</var>, and set <var>input</var> to the result. <li> Create a new stylesheet, with its <a data-link-type="dfn" href="https://drafts.csswg.org/cssom-1/#concept-css-style-sheet-location" id="ref-for-concept-css-style-sheet-location">location</a> set to <var>location</var> (or null, if <var>location</var> was not passed). <li> <a data-link-type="dfn" href="#consume-a-stylesheets-contents" id="ref-for-consume-a-stylesheets-contents">Consume a stylesheet’s contents</a> from <var>input</var>, and set the stylesheet’s rules to the result. <li> Return the stylesheet. </ol> </div> <h4 class="heading settled" data-level="5.4.4" id="parse-stylesheet-contents"><span class="secno">5.4.4. </span><span class="content"> Parse a stylesheet’s contents</span><span id="parse-list-of-rules"></span><a class="self-link" href="#parse-stylesheet-contents"></a></h4> <div class="algorithm" data-algorithm="parse a stylesheet’s contents"> To <dfn class="dfn-paneled" data-dfn-type="dfn" data-export id="parse-a-stylesheets-contents">parse a stylesheet’s contents</dfn> from <var>input</var>: <ol> <li> <a data-link-type="dfn" href="#normalize-into-a-token-stream" id="ref-for-normalize-into-a-token-stream③">Normalize</a> <var>input</var>, and set <var>input</var> to the result. <li> <a data-link-type="dfn" href="#consume-a-stylesheets-contents" id="ref-for-consume-a-stylesheets-contents①">Consume a stylesheet’s contents</a> from <var>input</var>, and return the result. </ol> </div> <h4 class="heading settled" data-level="5.4.5" id="parse-block-contents"><span class="secno">5.4.5. </span><span class="content"> Parse a block’s contents</span><span id="parse-list-of-declarations"></span><a class="self-link" href="#parse-block-contents"></a></h4> <div class="algorithm" data-algorithm="parse a block’s contents"> To <dfn class="dfn-paneled" data-dfn-type="dfn" data-export id="parse-a-blocks-contents">parse a block’s contents</dfn> from <var>input</var>: <ol> <li> <a data-link-type="dfn" href="#normalize-into-a-token-stream" id="ref-for-normalize-into-a-token-stream④">Normalize</a> <var>input</var>, and set <var>input</var> to the result. <li> <a data-link-type="dfn" href="#consume-a-blocks-contents" id="ref-for-consume-a-blocks-contents">Consume a block’s contents</a> from <var>input</var>, and return the result. </ol> </div> <h4 class="heading settled" data-level="5.4.6" id="parse-rule"><span class="secno">5.4.6. </span><span class="content"> Parse a rule</span><a class="self-link" href="#parse-rule"></a></h4> <div class="algorithm" data-algorithm="parse a rule"> To <dfn class="dfn-paneled" data-dfn-type="dfn" data-export id="parse-a-rule">parse a rule</dfn> from <var>input</var>: <ol> <li> <a data-link-type="dfn" href="#normalize-into-a-token-stream" id="ref-for-normalize-into-a-token-stream⑤">Normalize</a> <var>input</var>, and set <var>input</var> to the result. <li> <a data-link-type="dfn" href="#token-stream-discard-whitespace" id="ref-for-token-stream-discard-whitespace">Discard whitespace</a> from <var>input</var>. <li> If the <a data-link-type="dfn" href="#token-stream-next-token" id="ref-for-token-stream-next-token④">next token</a> from <var>input</var> is an <a class="production css" data-link-type="type" href="#typedef-eof-token" id="ref-for-typedef-eof-token⑤"><EOF-token></a>, return a syntax error. <p>Otherwise, if the <a data-link-type="dfn" href="#token-stream-next-token" id="ref-for-token-stream-next-token⑤">next token</a> from <var>input</var> is an <a class="production css" data-link-type="type" href="#typedef-at-keyword-token" id="ref-for-typedef-at-keyword-token⑤"><at-keyword-token></a>, <a data-link-type="dfn" href="#consume-an-at-rule" id="ref-for-consume-an-at-rule">consume an at-rule</a> from <var>input</var>, and let <var>rule</var> be the return value.</p> <p>Otherwise, <a data-link-type="dfn" href="#consume-a-qualified-rule" id="ref-for-consume-a-qualified-rule">consume a qualified rule</a> from <var>input</var> and let <var>rule</var> be the return value. If nothing or an <a data-link-type="dfn" href="#invalid-rule-error" id="ref-for-invalid-rule-error">invalid rule error</a> was returned, return a syntax error.</p> <li> <a data-link-type="dfn" href="#token-stream-discard-whitespace" id="ref-for-token-stream-discard-whitespace①">Discard whitespace</a> from <var>input</var>. <li> If the <a data-link-type="dfn" href="#token-stream-next-token" id="ref-for-token-stream-next-token⑥">next token</a> from <var>input</var> is an <a class="production css" data-link-type="type" href="#typedef-eof-token" id="ref-for-typedef-eof-token⑥"><EOF-token></a>, return <var>rule</var>. Otherwise, return a syntax error. </ol> </div> <h4 class="heading settled" data-level="5.4.7" id="parse-declaration"><span class="secno">5.4.7. </span><span class="content"> Parse a declaration</span><a class="self-link" href="#parse-declaration"></a></h4> <p class="note" role="note"><span class="marker">Note:</span> Unlike "<a data-link-type="dfn" href="https://www.w3.org/TR/css-syntax-3/#parse-a-list-of-declarations" id="ref-for-parse-a-list-of-declarations">Parse a list of declarations</a>", this parses only a declaration and not an at-rule.</p> <div class="algorithm" data-algorithm="parse a declaration"> To <dfn class="dfn-paneled" data-dfn-type="dfn" data-export id="parse-a-declaration">parse a declaration</dfn> from <var>input</var>: <ol> <li> <a data-link-type="dfn" href="#normalize-into-a-token-stream" id="ref-for-normalize-into-a-token-stream⑥">Normalize</a> <var>input</var>, and set <var>input</var> to the result. <li> <a data-link-type="dfn" href="#token-stream-discard-whitespace" id="ref-for-token-stream-discard-whitespace②">Discard whitespace</a> from <var>input</var>. <li> <a data-link-type="dfn" href="#consume-a-declaration" id="ref-for-consume-a-declaration①">Consume a declaration</a> from <var>input</var>. If anything was returned, return it. Otherwise, return a syntax error. </ol> </div> <h4 class="heading settled" data-level="5.4.8" id="parse-component-value"><span class="secno">5.4.8. </span><span class="content"> Parse a component value</span><a class="self-link" href="#parse-component-value"></a></h4> <div class="algorithm" data-algorithm="parse a component value"> To <dfn class="dfn-paneled" data-dfn-type="dfn" data-export id="parse-a-component-value">parse a component value</dfn> from <var>input</var>: <ol> <li> <a data-link-type="dfn" href="#normalize-into-a-token-stream" id="ref-for-normalize-into-a-token-stream⑦">Normalize</a> <var>input</var>, and set <var>input</var> to the result. <li> <a data-link-type="dfn" href="#token-stream-discard-whitespace" id="ref-for-token-stream-discard-whitespace③">Discard whitespace</a> from <var>input</var>. <li> If <var>input</var> is <a data-link-type="dfn" href="#token-stream-empty" id="ref-for-token-stream-empty①">empty</a>, return a syntax error. <li> <a data-link-type="dfn" href="#consume-a-component-value" id="ref-for-consume-a-component-value">Consume a component value</a> from <var>input</var> and let <var>value</var> be the return value. <li> <a data-link-type="dfn" href="#token-stream-discard-whitespace" id="ref-for-token-stream-discard-whitespace④">Discard whitespace</a> from <var>input</var>. <li> If <var>input</var> is <a data-link-type="dfn" href="#token-stream-empty" id="ref-for-token-stream-empty②">empty</a>, return <var>value</var>. Otherwise, return a syntax error. </ol> </div> <h4 class="heading settled" data-level="5.4.9" id="parse-list-of-component-values"><span class="secno">5.4.9. </span><span class="content"> Parse a list of component values</span><a class="self-link" href="#parse-list-of-component-values"></a></h4> <div class="algorithm" data-algorithm="parse a list of component values"> To <dfn class="dfn-paneled" data-dfn-type="dfn" data-export id="parse-a-list-of-component-values">parse a list of component values</dfn> from <var>input</var>: <ol> <li data-md> <p><a data-link-type="dfn" href="#normalize-into-a-token-stream" id="ref-for-normalize-into-a-token-stream⑧">Normalize</a> <var>input</var>, and set <var>input</var> to the result.</p> <li data-md> <p><a data-link-type="dfn" href="#consume-a-list-of-component-values" id="ref-for-consume-a-list-of-component-values">Consume a list of component values</a> from <var>input</var>, and return the result.</p> </ol> </div> <h4 class="heading settled" data-level="5.4.10" id="parse-comma-separated-list-of-component-values"><span class="secno">5.4.10. </span><span class="content"> Parse a comma-separated list of component values</span><a class="self-link" href="#parse-comma-separated-list-of-component-values"></a></h4> <div class="algorithm" data-algorithm="parse a comma-separated list of component values"> To <dfn class="dfn-paneled" data-dfn-type="dfn" data-export id="parse-a-comma-separated-list-of-component-values">parse a comma-separated list of component values</dfn> from <var>input</var>: <ol> <li data-md> <p><a data-link-type="dfn" href="#normalize-into-a-token-stream" id="ref-for-normalize-into-a-token-stream⑨">Normalize</a> <var>input</var>, and set <var>input</var> to the result.</p> <li data-md> <p>Let <var>groups</var> be an empty <a data-link-type="dfn" href="https://infra.spec.whatwg.org/#list" id="ref-for-list②">list</a>.</p> <li data-md> <p>While <var>input</var> is not <a data-link-type="dfn" href="#token-stream-empty" id="ref-for-token-stream-empty③">empty</a>:</p> <ol> <li data-md> <p><a data-link-type="dfn" href="#consume-a-list-of-component-values" id="ref-for-consume-a-list-of-component-values①">Consume a list of component values</a> from <var>input</var>, with <a class="production css" data-link-type="type" href="#typedef-comma-token" id="ref-for-typedef-comma-token①"><comma-token></a> as the stop token, and append the result to <var>groups</var>.</p> <li data-md> <p><a data-link-type="dfn" href="#token-stream-discard-a-token" id="ref-for-token-stream-discard-a-token①">Discard a token</a> from <var>input</var>.</p> </ol> <li data-md> <p>Return <var>groups</var>.</p> </ol> </div> <h3 class="heading settled" data-level="5.5" id="parser-algorithms"><span class="secno">5.5. </span><span class="content"> Parser Algorithms</span><a class="self-link" href="#parser-algorithms"></a></h3> <p>The following algorithms comprise the parser. They are called by the parser entry points above, and generally should not be called directly by other specifications.</p> <p>Note that CSS parsing is case-sensitive, and checking the validity of constructs in a given context must be done <em>during</em> parsing in at least some circumstances. This specification intentionally does not specify <em>how</em> sufficient context should be passed around to enable validity-checking.</p> <h4 class="heading settled" data-level="5.5.1" id="consume-stylesheet-contents"><span class="secno">5.5.1. </span><span class="content"> Consume a stylesheet’s contents</span><span id="consume-list-of-rules"></span><a class="self-link" href="#consume-stylesheet-contents"></a></h4> <p>To <dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport id="consume-a-stylesheets-contents">consume a stylesheet’s contents</dfn> from a <a data-link-type="dfn" href="#css-token-stream" id="ref-for-css-token-stream⑧">token stream</a> <var>input</var>:</p> <p>Let <var>rules</var> be an initially empty <a data-link-type="dfn" href="https://infra.spec.whatwg.org/#list" id="ref-for-list③">list</a> of rules.</p> <p><a data-link-type="dfn" href="#token-stream-process" id="ref-for-token-stream-process①">Process</a> <var>input</var>:</p> <dl> <dt><a class="production css" data-link-type="type" href="#typedef-whitespace-token" id="ref-for-typedef-whitespace-token④"><whitespace-token></a> <dd> <a data-link-type="dfn" href="#token-stream-discard-a-token" id="ref-for-token-stream-discard-a-token②">Discard a token</a> from <var>input</var>. <dt><a class="production css" data-link-type="type" href="#typedef-eof-token" id="ref-for-typedef-eof-token⑦"><EOF-token></a> <dd> Return <var>rules</var>. <dt><a class="production css" data-link-type="type" href="#typedef-cdo-token" id="ref-for-typedef-cdo-token②"><CDO-token></a> <dt><a class="production css" data-link-type="type" href="#typedef-cdc-token" id="ref-for-typedef-cdc-token②"><CDC-token></a> <dd> <a data-link-type="dfn" href="#token-stream-discard-a-token" id="ref-for-token-stream-discard-a-token③">Discard a token</a> from <var>input</var>. <details class="note"> <summary>What’s this for?</summary> <p>Back when CSS was first being introduced, the <code><a data-link-type="element" href="https://html.spec.whatwg.org/multipage/semantics.html#the-style-element" id="ref-for-the-style-element">style</a></code> element was treated as an unknown element by older browsers. To avoid having its contents displayed in the page for these legacy browsers, it became common practice to wrap the stylesheet in an HTML comment, and newer browsers would simply ignore the HTML comment syntax. This requirement carries over to today, decades later.</p> <p>The same practice was done for <code><a data-link-type="element" href="https://html.spec.whatwg.org/multipage/scripting.html#script" id="ref-for-script">script</a></code> elements, where HTML comment syntax is treated as a line comment in JS (similar to <code>//</code>) for the same reason.</p> </details> <dt><a class="production css" data-link-type="type" href="#typedef-at-keyword-token" id="ref-for-typedef-at-keyword-token⑥"><at-keyword-token></a> <dd> <a data-link-type="dfn" href="#consume-an-at-rule" id="ref-for-consume-an-at-rule①">Consume an at-rule</a> from <var>input</var>. If anything is returned, append it to <var>rules</var>. <dt>anything else <dd> <a data-link-type="dfn" href="#consume-a-qualified-rule" id="ref-for-consume-a-qualified-rule①">Consume a qualified rule</a> from <var>input</var>. If a <a data-link-type="dfn" href="#css-rule" id="ref-for-css-rule③">rule</a> is returned, append it to <var>rules</var>. </dl> <h4 class="heading settled" data-level="5.5.2" id="consume-at-rule"><span class="secno">5.5.2. </span><span class="content"> Consume an at-rule</span><a class="self-link" href="#consume-at-rule"></a></h4> <p>To <dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport id="consume-an-at-rule">consume an at-rule</dfn> from a <a data-link-type="dfn" href="#css-token-stream" id="ref-for-css-token-stream⑨">token stream</a> <var>input</var>, given an optional bool <var>nested</var> (default false):</p> <p class="assertion">Assert: The <a data-link-type="dfn" href="#token-stream-next-token" id="ref-for-token-stream-next-token⑦">next token</a> is an <a class="production css" data-link-type="type" href="#typedef-at-keyword-token" id="ref-for-typedef-at-keyword-token⑦"><at-keyword-token></a>.</p> <p><a data-link-type="dfn" href="#token-stream-consume-a-token" id="ref-for-token-stream-consume-a-token">Consume a token</a> from <var>input</var>, and let <var>rule</var> be a new <a data-link-type="dfn" href="#at-rule" id="ref-for-at-rule①⑤">at-rule</a> with its name set to the returned token’s value, its prelude initially set to an empty <a data-link-type="dfn" href="https://infra.spec.whatwg.org/#list" id="ref-for-list④">list</a>, and no declarations or child rules.</p> <p><a data-link-type="dfn" href="#token-stream-process" id="ref-for-token-stream-process②">Process</a> <var>input</var>:</p> <dl> <dt><a class="production css" data-link-type="type" href="#typedef-semicolon-token" id="ref-for-typedef-semicolon-token②"><semicolon-token></a> <dt><a class="production css" data-link-type="type" href="#typedef-eof-token" id="ref-for-typedef-eof-token⑧"><EOF-token></a> <dd> <a data-link-type="dfn" href="#token-stream-discard-a-token" id="ref-for-token-stream-discard-a-token④">Discard a token</a> from <var>input</var>. If <var>rule</var> is valid in the current context, return it; otherwise return nothing. <dt><a href="#tokendef-close-curly" id="ref-for-tokendef-close-curly③"><}-token></a> <dd> If <var>nested</var> is true: <ul> <li data-md> <p>If <var>rule</var> is valid in the current context, return it.</p> <li data-md> <p>Otherwise, return nothing.</p> </ul> <p>Otherwise, <a data-link-type="dfn" href="#token-stream-consume-a-token" id="ref-for-token-stream-consume-a-token①">consume a token</a> and append the result to <var>rule</var>’s prelude.</p> <dt><a href="#tokendef-open-curly" id="ref-for-tokendef-open-curly⑥"><{-token></a> <dd> <a data-link-type="dfn" href="#consume-a-block" id="ref-for-consume-a-block">Consume a block</a> from <var>input</var>, and assign the result to <var>rule</var>’s child <a data-link-type="dfn" href="#css-rule" id="ref-for-css-rule④">rules</a>. <p class="note" role="note"><span class="marker">Note:</span> If the result contains <a data-link-type="dfn" href="https://infra.spec.whatwg.org/#list" id="ref-for-list⑤">lists</a> of <a data-link-type="dfn">declarations</a>, how they’re materialized in the CSSOM depends on the rule. Some turn them all into <a data-link-type="dfn" href="https://drafts.csswg.org/css-nesting-1/#nested-declarations-rule%E2%91%A0" id="ref-for-nested-declarations-rule%E2%91%A0">nested declarations rules</a>, others will treat them all as declarations, and others will treat the first item differently from the rest.</p> <p>If <var>rule</var> is valid in the current context, return it. Otherwise, return nothing.</p> <dt>anything else <dd> <a data-link-type="dfn" href="#consume-a-component-value" id="ref-for-consume-a-component-value①">Consume a component value</a> from <var>input</var> and append the returned value to <var>rule</var>’s prelude. </dl> <h4 class="heading settled" data-level="5.5.3" id="consume-qualified-rule"><span class="secno">5.5.3. </span><span class="content"> Consume a qualified rule</span><a class="self-link" href="#consume-qualified-rule"></a></h4> <p>To <dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport id="consume-a-qualified-rule">consume a qualified rule</dfn>, from a <a data-link-type="dfn" href="#css-token-stream" id="ref-for-css-token-stream①⓪">token stream</a> <var>input</var>, given an optional <a data-link-type="dfn" href="#token-stream-tokens" id="ref-for-token-stream-tokens⑧">token</a> <var>stop token</var> and an optional bool <var>nested</var> (default false):</p> <p>Let <var>rule</var> be a new <a data-link-type="dfn" href="#qualified-rule" id="ref-for-qualified-rule⑥">qualified rule</a> with its prelude, declarations, and child rules all initially set to empty <a data-link-type="dfn" href="https://infra.spec.whatwg.org/#list" id="ref-for-list⑥">lists</a>.</p> <p><a data-link-type="dfn" href="#token-stream-process" id="ref-for-token-stream-process③">Process</a> <var>input</var>:</p> <dl> <dt><a class="production css" data-link-type="type" href="#typedef-eof-token" id="ref-for-typedef-eof-token⑨"><EOF-token></a> <dt><var>stop token</var> (if passed) <dd> This is a <a data-link-type="dfn" href="#parse-error" id="ref-for-parse-error⑨">parse error</a>. Return nothing. <dt><a href="#tokendef-close-curly" id="ref-for-tokendef-close-curly④"><}-token></a> <dd> This is a <a data-link-type="dfn" href="#parse-error" id="ref-for-parse-error①⓪">parse error</a>. If <var>nested</var> is true, return nothing. Otherwise, <a data-link-type="dfn" href="#token-stream-consume-a-token" id="ref-for-token-stream-consume-a-token②">consume a token</a> and append the result to <var>rule</var>’s prelude. <dt><a href="#tokendef-open-curly" id="ref-for-tokendef-open-curly⑦"><{-token></a> <dd> If the first two non-<a class="production css" data-link-type="type" href="#typedef-whitespace-token" id="ref-for-typedef-whitespace-token⑤"><whitespace-token></a> values of <var>rule</var>’s prelude are an <a class="production css" data-link-type="type" href="#typedef-ident-token" id="ref-for-typedef-ident-token⑥"><ident-token></a> whose value starts with "--" followed by a <a class="production css" data-link-type="type" href="#typedef-colon-token" id="ref-for-typedef-colon-token①"><colon-token></a>, then: <ul> <li data-md> <p>If <var>nested</var> is true, <a data-link-type="dfn" href="#consume-the-remnants-of-a-bad-declaration" id="ref-for-consume-the-remnants-of-a-bad-declaration">consume the remnants of a bad declaration</a> from <var>input</var>, with <var>nested</var> set to true, and return nothing.</p> <li data-md> <p>If <var>nested</var> is false, <a data-link-type="dfn" href="#consume-a-block" id="ref-for-consume-a-block①">consume a block</a> from <var>input</var>, and return nothing.</p> </ul> <details class="note"> <summary>What’s this check for?</summary> <p><a data-link-type="dfn">Declarations</a> and <a data-link-type="dfn" href="#qualified-rule" id="ref-for-qualified-rule⑦">qualified rules</a> don’t <em>generally</em> overlap in their allowed syntax. No currently-defined CSS property allows {}-blocks in its value, so <code>foo:bar {};</code> is definitely a rule, and <code>foo: bar;</code> is definitely a property. Even if a future CSS property allows {}-blocks in its value, the allowed syntax is restricted to the {}-block being the whole value, such as <code>foo: {...};</code>, which is guaranteed to not be a valid rule, since the <span class="css">:</span> doesn’t have an ident or function following it to mark it as a pseudo-class.</p> <p>This allows us to mix declarations and rules in the same context: we first try to parse something as a declaration, and if that doesn’t result in a valid declaration, we reparse it as a rule instead. An accidentally-invalid declaration will parse as a rule instead, but that’s fine: the parser will stop at the declaration’s ending semicolon and consider it an invalid rule. (Or in the case of a property containing a {}-block, will stop just *before* the semicolon, still considering it an invalid rule, and then the next attempt to parse something will throw out the lone semicolon as invalid.) So the total amount of tokens consumed is the same regardless.</p> <p><a data-link-type="dfn" href="https://drafts.csswg.org/css-variables-2/#custom-property" id="ref-for-custom-property">Custom properties</a>, however, don’t have the CSSWG carefully vetting their syntax. Authors <em>can</em> write a custom property that takes a {}-block in its value, even combined with other things; if that custom property is then invalid (due to an invalidly-written <a class="css" data-link-type="maybe" href="https://drafts.csswg.org/css-variables-2/#funcdef-var" id="ref-for-funcdef-var">var()</a> function, for example), when it’s reparsed as a rule it will stop early, at the {}-block. The remaining tokens of the custom property’s value will then get parsed as a fresh construct, potentially causing unexpected declarations or rules to be created.</p> <p>To avoid this (admittedly very niche) corner-case, we subtract the syntax of a <a data-link-type="dfn" href="https://drafts.csswg.org/css-variables-2/#custom-property" id="ref-for-custom-property①">custom property</a> from that of a <a data-link-type="dfn" href="#qualified-rule" id="ref-for-qualified-rule⑧">qualified rule</a>; if you’re in a context that allows properties and rules to be mixed, and you somehow end up parsing a rule that looks like a <span id="ref-for-custom-property②">custom property</span>, you’ve messed up, and need to instead consume an entire custom property (all the way to the ending semicolon).</p> <p>(If we’re in a context that doesn’t allow properties, we just throw away the rule if it looks like a custom property. This ensures that <code>--foo:hover { color: blue; }</code> is consistently invalid everywhere, without potentially consuming a ton of a stylesheet looking for the non-existent ending semicolon.)</p> </details> <p>Otherwise, <a data-link-type="dfn" href="#consume-a-block" id="ref-for-consume-a-block②">consume a block</a> from <var>input</var>, and let <var>child rules</var> be the result. If the first item of <var>child rules</var> is a <a data-link-type="dfn" href="https://infra.spec.whatwg.org/#list" id="ref-for-list⑦">list</a> of <a data-link-type="dfn">declarations</a>, remove it from <var>child rules</var> and assign it to <var>rule</var>’s declarations. If any remaining items of <var>child rules</var> are <span id="ref-for-list⑧">lists</span> of <span>declarations</span>, replace them with <a data-link-type="dfn" href="https://drafts.csswg.org/css-nesting-1/#nested-declarations-rule%E2%91%A0" id="ref-for-nested-declarations-rule%E2%91%A0①">nested declarations rules</a> containing the <span id="ref-for-list⑨">list</span> as its sole child. Assign <var>child rules</var> to <var>rule</var>’s child <a data-link-type="dfn" href="#css-rule" id="ref-for-css-rule⑤">rules</a>.</p> <p>If <var>rule</var> is valid in the current context, return it; otherwise return an <dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport id="invalid-rule-error">invalid rule error</dfn>.</p> <dt>anything else <dd> <a data-link-type="dfn" href="#consume-a-component-value" id="ref-for-consume-a-component-value②">Consume a component value</a> from <var>input</var> and append the result to <var>rule</var>’s prelude. </dl> <h4 class="heading settled" data-level="5.5.4" id="consume-block"><span class="secno">5.5.4. </span><span class="content"> Consume a block</span><a class="self-link" href="#consume-block"></a></h4> <p>To <dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport id="consume-a-block">consume a block</dfn>, from a <a data-link-type="dfn" href="#css-token-stream" id="ref-for-css-token-stream①①">token stream</a> <var>input</var>:</p> <p class="assertion">Assert: The <a data-link-type="dfn" href="#token-stream-next-token" id="ref-for-token-stream-next-token⑧">next token</a> is a <a href="#tokendef-open-curly" id="ref-for-tokendef-open-curly⑧"><{-token></a>.</p> <p><a data-link-type="dfn" href="#token-stream-discard-a-token" id="ref-for-token-stream-discard-a-token⑤">Discard a token</a> from <var>input</var>. <a data-link-type="dfn" href="#consume-a-blocks-contents" id="ref-for-consume-a-blocks-contents①">Consume a block’s contents</a> from <var>input</var> and let <var>rules</var> be the result. <span id="ref-for-token-stream-discard-a-token⑥">Discard a token</span> from <var>input</var>.</p> <p>Return <var>rules</var>.</p> <h4 class="heading settled" data-level="5.5.5" id="consume-block-contents"><span class="secno">5.5.5. </span><span class="content"> Consume a block’s contents</span><span id="consume-list-of-declarations"></span><a class="self-link" href="#consume-block-contents"></a></h4> <p>To <dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport id="consume-a-blocks-contents">consume a block’s contents</dfn> from a <a data-link-type="dfn" href="#css-token-stream" id="ref-for-css-token-stream①②">token stream</a> <var>input</var>:</p> <p class="note" role="note"><span class="marker">Note:</span> This algorithm returns a <a data-link-type="dfn" href="https://infra.spec.whatwg.org/#list" id="ref-for-list①⓪">list</a>, consisting of <a data-link-type="dfn" href="#css-rule" id="ref-for-css-rule⑥">rules</a> and <span id="ref-for-list①①">lists</span> of <a data-link-type="dfn">declarations</a>. Depending on the parent context, a <span id="ref-for-list①②">list</span> of <span>declarations</span> might be materialized in the CSSOM as either a <code class="idl"><a data-link-type="idl" href="https://drafts.csswg.org/cssom-1/#cssstyledeclaration" id="ref-for-cssstyledeclaration">CSSStyleDeclaration</a></code>, or as a <code class="idl"><a data-link-type="idl" href="https://drafts.csswg.org/css-nesting-1/#cssnesteddeclarations" id="ref-for-cssnesteddeclarations">CSSNestedDeclarations</a></code> rule.</p> <p>Let <var>rules</var> be an empty <a data-link-type="dfn" href="https://infra.spec.whatwg.org/#list" id="ref-for-list①③">list</a>, containing either <a data-link-type="dfn" href="#css-rule" id="ref-for-css-rule⑦">rules</a> or <span id="ref-for-list①④">lists</span> of <a data-link-type="dfn">declarations</a>.</p> <p>Let <var>decls</var> be an empty <a data-link-type="dfn" href="https://infra.spec.whatwg.org/#list" id="ref-for-list①⑤">list</a> of <a data-link-type="dfn">declarations</a>.</p> <p><a data-link-type="dfn" href="#token-stream-process" id="ref-for-token-stream-process④">Process</a> <var>input</var>:</p> <dl> <dt><a class="production css" data-link-type="type" href="#typedef-whitespace-token" id="ref-for-typedef-whitespace-token⑥"><whitespace-token></a> <dt><a class="production css" data-link-type="type" href="#typedef-semicolon-token" id="ref-for-typedef-semicolon-token③"><semicolon-token></a> <dd> <a data-link-type="dfn" href="#token-stream-discard-a-token" id="ref-for-token-stream-discard-a-token⑦">Discard a token</a> from <var>input</var>. <dt><a class="production css" data-link-type="type" href="#typedef-eof-token" id="ref-for-typedef-eof-token①⓪"><EOF-token></a> <dt><a href="#tokendef-close-curly" id="ref-for-tokendef-close-curly⑤"><}-token></a> <dd> Return <var>rules</var>. <dt><a class="production css" data-link-type="type" href="#typedef-at-keyword-token" id="ref-for-typedef-at-keyword-token⑧"><at-keyword-token></a> <dd> If <var>decls</var> is not empty, append it to <var>rules</var>, and set <var>decls</var> to a fresh empty <a data-link-type="dfn" href="https://infra.spec.whatwg.org/#list" id="ref-for-list①⑥">list</a> of <a data-link-type="dfn">declarations</a>. <p><a data-link-type="dfn" href="#consume-an-at-rule" id="ref-for-consume-an-at-rule②">Consume an at-rule</a> from <var>input</var>, with <var>nested</var> set to true. If a <a data-link-type="dfn" href="#css-rule" id="ref-for-css-rule⑧">rule</a> was returned, append it to <var>rules</var>.</p> <dt>anything else <dd> <a data-link-type="dfn" href="#token-stream-mark" id="ref-for-token-stream-mark①">Mark</a> <var>input</var>. <p><a data-link-type="dfn" href="#consume-a-declaration" id="ref-for-consume-a-declaration②">Consume a declaration</a> from <var>input</var>, with <var>nested</var> set to true. If a <a data-link-type="dfn">declaration</a> was returned, append it to <var>decls</var>, and <a data-link-type="dfn" href="#token-stream-discard-a-mark" id="ref-for-token-stream-discard-a-mark">discard a mark</a> from <var>input</var>.</p> <p>Otherwise, <a data-link-type="dfn" href="#token-stream-restore-a-mark" id="ref-for-token-stream-restore-a-mark">restore a mark</a> from <var>input</var>, then <a data-link-type="dfn" href="#consume-a-qualified-rule" id="ref-for-consume-a-qualified-rule②">consume a qualified rule</a> from <var>input</var>, with <var>nested</var> set to true, and <a class="production css" data-link-type="type" href="#typedef-semicolon-token" id="ref-for-typedef-semicolon-token④"><semicolon-token></a> as the <var>stop token</var>.</p> <dl class="switch"> <dt data-md>If nothing was returned <dd data-md> <p>Do nothing</p> <dt data-md>If an <a data-link-type="dfn" href="#invalid-rule-error" id="ref-for-invalid-rule-error①">invalid rule error</a> was returned <dd data-md> <p>If <var>decls</var> is not empty, append <var>decls</var> to <var>rules</var>, and set <var>decls</var> to a fresh empty <a data-link-type="dfn" href="https://infra.spec.whatwg.org/#list" id="ref-for-list①⑦">list</a> of <a data-link-type="dfn">declarations</a>. (Otherwise, do nothing.)</p> <dt data-md>If a <a data-link-type="dfn" href="#css-rule" id="ref-for-css-rule⑨">rule</a> was returned <dd data-md> <p>If <var>decls</var> is not empty, append <var>decls</var> to <var>rules</var>, and set <var>decls</var> to a fresh empty <a data-link-type="dfn" href="https://infra.spec.whatwg.org/#list" id="ref-for-list①⑧">list</a> of <a data-link-type="dfn">declarations</a>. Append the <a data-link-type="dfn" href="#css-rule" id="ref-for-css-rule①⓪">rule</a> to <var>rules</var>.</p> </dl> </dl> <details class="note"> <summary>Implementation note</summary> <p>This spec, as with many CSS specs, has been written to prioritize understandability over efficiency. A number of algorithms, notably the above "parse as a declaration, then parse as a rule" behavior can be fairly inefficient if implemented naively as described.</p> <p>However, the behavior has been carefully written to allow "early exits" as much as possible. In particular, and roughly in order of when the exit can occur:</p> <ul> <li data-md> <p>If the first non-whitespace token isn’t an <a class="production css" data-link-type="type" href="#typedef-ident-token" id="ref-for-typedef-ident-token⑦"><ident-token></a> for a recognized property name (or a custom property name), you can immediately stop parsing as a declaration and reparse as a rule instead. If the <em>next</em> non-whitespace token isn’t a <a class="production css" data-link-type="type" href="#typedef-colon-token" id="ref-for-typedef-colon-token②"><colon-token></a>, you can similarly immediately stop parsing as a declaration.</p> <p>(That is, <span class="css">font+ ...</span> is guaranteed to not be a property, nor is <span class="css">not-a-prop-name: ...</span>.)</p> <li data-md> <p>If the first two non-whitespace tokens are a custom property name and a colon, it’s definitely a custom property and won’t ever produce a valid rule, so even if the custom property ends up invalid there’s no need to try and reparse as a rule.</p> <p>(That is, <span class="css">--foo:hover {...}</span> is guaranteed to be a custom property, not a rule.)</p> <li data-md> <p>If the first three non-whitespace tokens are a valid property name, a colon, and anything other than a <a class="production css" data-link-type="type" href="#tokendef-open-curly" id="ref-for-tokendef-open-curly⑨"><{-token></a>, and then while parsing the declaration’s value you encounter a <span class="production" id="ref-for-tokendef-open-curly①"><{-token></span>, you can immediately stop parsing as a declaration and reparse as a rule instead.</p> <p>(That is, <span class="css">font:bar {...</span> is guaranteed to be an invalid property.)</p> <li data-md> <p>If you see a recognized property name, a colon, and a {}-block, but the first non-whitespace tokens following that block isn’t either immediately the final semicolon, or the !important followed by the semicolon, you can immediately stop parsing as a declaration and reparse as a rule instead.</p> <p>(That is, <a class="css" data-link-type="propdesc" href="https://drafts.csswg.org/css-fonts-4/#propdef-font" id="ref-for-propdef-font">font: {} bar ...</a> is guaranteed to be an invalid property; you don’t need to keep parsing until you hit a semicolon.)</p> </ul> <p>Similarly, even tho the parsing requirements are specified to rely on checking the grammar of the declarations as you parse, a <em>generic</em> processor trying to implement a non-CSS language on top of the generic CSS <em>syntax</em> can still get away with just verifying that declarations start with an ident, a colon, and then either contain solely a {}-block or no {}-block at all. They’ll just spent a little more time on parsing than an implementation with grammar knowledge in cases like <span class="css">foo:hover ... {}</span>, since they can’t early-exit on the first token.</p> </details> <h4 class="heading settled" data-level="5.5.6" id="consume-declaration"><span class="secno">5.5.6. </span><span class="content"> Consume a declaration</span><a class="self-link" href="#consume-declaration"></a></h4> <p>To <dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport id="consume-a-declaration">consume a declaration</dfn> from a <a data-link-type="dfn" href="#css-token-stream" id="ref-for-css-token-stream①③">token stream</a> <var>input</var>, given an optional bool <var>nested</var> (default false):</p> <p>Let <var>decl</var> be a new <a data-link-type="dfn">declaration</a>, with an initially empty name and a value set to an empty <a data-link-type="dfn" href="https://infra.spec.whatwg.org/#list" id="ref-for-list①⑨">list</a>.</p> <ol> <li> If the <a data-link-type="dfn" href="#token-stream-next-token" id="ref-for-token-stream-next-token⑨">next token</a> is an <a class="production css" data-link-type="type" href="#typedef-ident-token" id="ref-for-typedef-ident-token⑧"><ident-token></a>, <a data-link-type="dfn" href="#token-stream-consume-a-token" id="ref-for-token-stream-consume-a-token③">consume a token</a> from <var>input</var> and set <var>decl</var>’s name to the token’s value. <p>Otherwise, <a data-link-type="dfn" href="#consume-the-remnants-of-a-bad-declaration" id="ref-for-consume-the-remnants-of-a-bad-declaration①">consume the remnants of a bad declaration</a> from <var>input</var>, with <var>nested</var>, and return nothing.</p> <li> <a data-link-type="dfn" href="#token-stream-discard-whitespace" id="ref-for-token-stream-discard-whitespace⑤">Discard whitespace</a> from <var>input</var>. <li> If the <a data-link-type="dfn" href="#token-stream-next-token" id="ref-for-token-stream-next-token①⓪">next token</a> is a <a class="production css" data-link-type="type" href="#typedef-colon-token" id="ref-for-typedef-colon-token③"><colon-token></a>, <a data-link-type="dfn" href="#token-stream-discard-a-token" id="ref-for-token-stream-discard-a-token⑧">discard a token</a> from <var>input</var>. <p>Otherwise, <a data-link-type="dfn" href="#consume-the-remnants-of-a-bad-declaration" id="ref-for-consume-the-remnants-of-a-bad-declaration②">consume the remnants of a bad declaration</a> from <var>input</var>, with <var>nested</var>, and return nothing.</p> <li> <a data-link-type="dfn" href="#token-stream-discard-whitespace" id="ref-for-token-stream-discard-whitespace⑥">Discard whitespace</a> from <var>input</var>. <li> <a data-link-type="dfn" href="#consume-a-list-of-component-values" id="ref-for-consume-a-list-of-component-values②">Consume a list of component values</a> from <var>input</var>, with <var>nested</var>, and with <a class="production css" data-link-type="type" href="#typedef-semicolon-token" id="ref-for-typedef-semicolon-token⑤"><semicolon-token></a> as the stop token, and set <var>decl</var>’s value to the result. <li> If the last two non-<a class="production css" data-link-type="type" href="#typedef-whitespace-token" id="ref-for-typedef-whitespace-token⑦"><whitespace-token></a>s in <var>decl</var>’s value are a <a class="production css" data-link-type="type" href="#typedef-delim-token" id="ref-for-typedef-delim-token⑨"><delim-token></a> with the value "!" followed by an <a class="production css" data-link-type="type" href="#typedef-ident-token" id="ref-for-typedef-ident-token⑨"><ident-token></a> with a value that is an <a data-link-type="dfn" href="https://infra.spec.whatwg.org/#ascii-case-insensitive" id="ref-for-ascii-case-insensitive①">ASCII case-insensitive</a> match for "important", remove them from <var>decl</var>’s value and set <var>decl</var>’s <var>important</var> flag. <li> While the last item in <var>decl</var>’s value is a <a class="production css" data-link-type="type" href="#typedef-whitespace-token" id="ref-for-typedef-whitespace-token⑧"><whitespace-token></a>, <a data-link-type="dfn" href="https://infra.spec.whatwg.org/#list-remove" id="ref-for-list-remove">remove</a> that token. <li> If <var>decl</var>’s name is a <a data-link-type="dfn" href="https://drafts.css-houdini.org/css-typed-om-1/#custom-property-name-string" id="ref-for-custom-property-name-string">custom property name string</a>, then set <var>decl</var>’s <var>original text</var> to the segment of the original source text string corresponding to the tokens of <var>decl</var>’s value. <p>Otherwise, if <var>decl</var>’s value contains a top-level <a data-link-type="dfn" href="#simple-block" id="ref-for-simple-block②">simple block</a> with an associated token of <a class="production css" data-link-type="type" href="#tokendef-open-curly" id="ref-for-tokendef-open-curly②"><{-token></a>, and also contains <em>any other</em> non-<a class="production css" data-link-type="type" href="#typedef-whitespace-token" id="ref-for-typedef-whitespace-token⑨"><whitespace-token></a> value, return nothing. (That is, a top-level {}-block is only allowed as the entire value of a non-custom property.)</p> <p>Otherwise, if <var>decl</var>’s name is an <a data-link-type="dfn" href="https://infra.spec.whatwg.org/#ascii-case-insensitive" id="ref-for-ascii-case-insensitive②">ASCII case-insensitive</a> match for "unicode-range", <a data-link-type="dfn" href="#consume-the-value-of-a-unicode-range-descriptor" id="ref-for-consume-the-value-of-a-unicode-range-descriptor①">consume the value of a unicode-range descriptor</a> from the segment of the original source text string corresponding to the tokens returned by the <a data-link-type="dfn" href="#consume-a-list-of-component-values" id="ref-for-consume-a-list-of-component-values③">consume a list of component values</a> call, and replace <var>decl</var>’s value with the result.</p> <li> If <var>decl</var> is valid in the current context, return it; otherwise return nothing. </ol> <div class="algorithm" data-algorithm="consume the remnants of a bad declaration"> To <dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport id="consume-the-remnants-of-a-bad-declaration">consume the remnants of a bad declaration</dfn> from a <a data-link-type="dfn" href="#css-token-stream" id="ref-for-css-token-stream①④">token stream</a> <var>input</var>, given a bool <var>nested</var>: <p><a data-link-type="dfn" href="#token-stream-process" id="ref-for-token-stream-process⑤">Process</a> <var>input</var>:</p> <dl> <dt data-md><a class="production css" data-link-type="type" href="#typedef-eof-token" id="ref-for-typedef-eof-token①①"><eof-token></a> <dt data-md><a class="production css" data-link-type="type" href="#typedef-semicolon-token" id="ref-for-typedef-semicolon-token⑥"><semicolon-token></a> <dd data-md> <p><a data-link-type="dfn" href="#token-stream-discard-a-token" id="ref-for-token-stream-discard-a-token⑨">Discard a token</a> from <var>input</var>, and return nothing.</p> <dt data-md><a href="#tokendef-close-curly" id="ref-for-tokendef-close-curly⑥"><}-token></a> <dd data-md> <p>If <var>nested</var> is true, return nothing. Otherwise, <a data-link-type="dfn" href="#token-stream-discard-a-token" id="ref-for-token-stream-discard-a-token①⓪">discard a token</a>.</p> <dt data-md>anything else <dd data-md> <p><a data-link-type="dfn" href="#consume-a-component-value" id="ref-for-consume-a-component-value③">Consume a component value</a> from <var>input</var>, and do nothing.</p> </dl> </div> <h4 class="heading settled" data-level="5.5.7" id="consume-list-of-components"><span class="secno">5.5.7. </span><span class="content"> Consume a list of component values</span><a class="self-link" href="#consume-list-of-components"></a></h4> <p>To <dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport id="consume-a-list-of-component-values">consume a list of component values</dfn> from a <a data-link-type="dfn" href="#css-token-stream" id="ref-for-css-token-stream①⑤">token stream</a> <var>input</var>, given an optional <a data-link-type="dfn" href="#token-stream-tokens" id="ref-for-token-stream-tokens⑨">token</a> <var>stop token</var> and an optional boolean <var>nested</var> (default false):</p> <p>Let <var>values</var> be an empty <a data-link-type="dfn" href="https://infra.spec.whatwg.org/#list" id="ref-for-list②⓪">list</a> of <a data-link-type="dfn" href="#component-value" id="ref-for-component-value⑥">component values</a>.</p> <p><a data-link-type="dfn" href="#token-stream-process" id="ref-for-token-stream-process⑥">Process</a> <var>input</var>:</p> <dl> <dt data-md><a class="production css" data-link-type="type" href="#typedef-eof-token" id="ref-for-typedef-eof-token①②"><eof-token></a> <dt data-md><var>stop token</var> (if passed) <dd data-md> <p>Return <var>values</var>.</p> <dt data-md><a href="#tokendef-close-curly" id="ref-for-tokendef-close-curly⑦"><}-token></a> <dd data-md> <p>If <var>nested</var> is true, return <var>values</var>.</p> <p>Otherwise, this is a <a data-link-type="dfn" href="#parse-error" id="ref-for-parse-error①①">parse error</a>. <a data-link-type="dfn" href="#token-stream-consume-a-token" id="ref-for-token-stream-consume-a-token④">Consume a token</a> from <var>input</var> and append the result to <var>values</var>.</p> <dt data-md>anything else <dd data-md> <p><a data-link-type="dfn" href="#consume-a-component-value" id="ref-for-consume-a-component-value④">Consume a component value</a> from <var>input</var>, and append the result to <var>values</var>.</p> </dl> <h4 class="heading settled" data-level="5.5.8" id="consume-component-value"><span class="secno">5.5.8. </span><span class="content"> Consume a component value</span><a class="self-link" href="#consume-component-value"></a></h4> <p>To <dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport id="consume-a-component-value">consume a component value</dfn> from a <a data-link-type="dfn" href="#css-token-stream" id="ref-for-css-token-stream①⑥">token stream</a> <var>input</var>:</p> <p><a data-link-type="dfn" href="#token-stream-process" id="ref-for-token-stream-process⑦">Process</a> <var>input</var>:</p> <dl> <dt data-md><a href="#tokendef-open-curly" id="ref-for-tokendef-open-curly①⓪"><{-token></a> <dt data-md><a href="#tokendef-open-square" id="ref-for-tokendef-open-square③"><[-token></a> <dt data-md><a href="#tokendef-open-paren" id="ref-for-tokendef-open-paren③"><(-token></a> <dd data-md> <p><a data-link-type="dfn" href="#consume-a-simple-block" id="ref-for-consume-a-simple-block">Consume a simple block</a> from <var>input</var> and return the result.</p> <dt data-md><a class="production css" data-link-type="type" href="#typedef-function-token" id="ref-for-typedef-function-token⑧"><function-token></a> <dd data-md> <p><a data-link-type="dfn" href="#consume-a-function" id="ref-for-consume-a-function">Consume a function</a> from <var>input</var> and return the result.</p> <dt data-md>anything else <dd data-md> <p><a data-link-type="dfn" href="#token-stream-consume-a-token" id="ref-for-token-stream-consume-a-token⑤">Consume a token</a> from <var>input</var> and return the result.</p> </dl> <h4 class="heading settled" data-level="5.5.9" id="consume-simple-block"><span class="secno">5.5.9. </span><span class="content"> Consume a simple block</span><a class="self-link" href="#consume-simple-block"></a></h4> <p>To <dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport id="consume-a-simple-block">consume a simple block</dfn> from a <a data-link-type="dfn" href="#css-token-stream" id="ref-for-css-token-stream①⑦">token stream</a> <var>input</var>:</p> <p class="assertion">Assert: the <a data-link-type="dfn" href="#token-stream-next-token" id="ref-for-token-stream-next-token①①">next token</a> of <var>input</var> is <a href="#tokendef-open-curly" id="ref-for-tokendef-open-curly①①"><{-token></a>, <a href="#tokendef-open-square" id="ref-for-tokendef-open-square④"><[-token></a>, or <a href="#tokendef-open-paren" id="ref-for-tokendef-open-paren④"><(-token></a>.</p> <p>Let <var>ending token</var> be the mirror variant of the <a data-link-type="dfn" href="#token-stream-next-token" id="ref-for-token-stream-next-token①②">next token</a>. (E.g. if it was called with <a href="#tokendef-open-square" id="ref-for-tokendef-open-square⑤"><[-token></a>, the <var>ending token</var> is <a href="#tokendef-close-square" id="ref-for-tokendef-close-square②"><]-token></a>.)</p> <p>Let <var>block</var> be a new <a data-link-type="dfn" href="#simple-block" id="ref-for-simple-block③">simple block</a> with its associated token set to the <a data-link-type="dfn" href="#token-stream-next-token" id="ref-for-token-stream-next-token①③">next token</a> and with its value initially set to an empty <a data-link-type="dfn" href="https://infra.spec.whatwg.org/#list" id="ref-for-list②①">list</a>.</p> <p><a data-link-type="dfn" href="#token-stream-discard-a-token" id="ref-for-token-stream-discard-a-token①①">Discard a token</a> from <var>input</var>.</p> <p><a data-link-type="dfn" href="#token-stream-process" id="ref-for-token-stream-process⑧">Process</a> <var>input</var>:</p> <dl> <dt data-md><a class="production css" data-link-type="type" href="#typedef-eof-token" id="ref-for-typedef-eof-token①③"><eof-token></a> <dt data-md><var>ending token</var> <dd data-md> <p><a data-link-type="dfn" href="#token-stream-discard-a-token" id="ref-for-token-stream-discard-a-token①②">Discard a token</a> from <var>input</var>. Return <var>block</var>.</p> <dt data-md>anything else <dd data-md> <p><a data-link-type="dfn" href="#consume-a-component-value" id="ref-for-consume-a-component-value⑤">Consume a component value</a> from <var>input</var> and append the result to <var>block</var>’s value.</p> </dl> <h4 class="heading settled" data-level="5.5.10" id="consume-function"><span class="secno">5.5.10. </span><span class="content"> Consume a function</span><a class="self-link" href="#consume-function"></a></h4> <p>To <dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport id="consume-a-function">consume a function</dfn> from a <a data-link-type="dfn" href="#css-token-stream" id="ref-for-css-token-stream①⑧">token stream</a> <var>input</var>:</p> <p class="assertion">Assert: The <a data-link-type="dfn" href="#token-stream-next-token" id="ref-for-token-stream-next-token①④">next token</a> is a <a class="production css" data-link-type="type" href="#typedef-function-token" id="ref-for-typedef-function-token⑨"><function-token></a>.</p> <p><a data-link-type="dfn" href="#token-stream-consume-a-token" id="ref-for-token-stream-consume-a-token⑥">Consume a token</a> from <var>input</var>, and let <var>function</var> be a new function with its name equal the returned token’s value, and a value set to an empty <a data-link-type="dfn" href="https://infra.spec.whatwg.org/#list" id="ref-for-list②②">list</a>.</p> <p><a data-link-type="dfn" href="#token-stream-process" id="ref-for-token-stream-process⑨">Process</a> <var>input</var>:</p> <dl> <dt data-md><a class="production css" data-link-type="type" href="#typedef-eof-token" id="ref-for-typedef-eof-token①④"><eof-token></a> <dt data-md><a href="#tokendef-close-paren" id="ref-for-tokendef-close-paren②"><)-token></a> <dd data-md> <p><a data-link-type="dfn" href="#token-stream-discard-a-token" id="ref-for-token-stream-discard-a-token①③">Discard a token</a> from <var>input</var>. Return <var>function</var>.</p> <dt data-md>anything else <dd data-md> <p><a data-link-type="dfn" href="#consume-a-component-value" id="ref-for-consume-a-component-value⑥">Consume a component value</a> from <var>input</var> and append the result to <var>function</var>’s value.</p> </dl> <h4 class="heading settled" data-level="5.5.11" id="consume-unicode-range-value"><span class="secno">5.5.11. </span><span class="content"> Consume a <a class="property" data-link-type="propdesc" href="https://drafts.csswg.org/css-fonts-4/#descdef-font-face-unicode-range" id="ref-for-descdef-font-face-unicode-range①">unicode-range</a> value</span><a class="self-link" href="#consume-unicode-range-value"></a></h4> <p>To <dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport id="consume-the-value-of-a-unicode-range-descriptor">consume the value of a unicode-range descriptor</dfn> from a string <var>input string</var>:</p> <ol> <li data-md> <p>Let <var>tokens</var> be the result of <a data-link-type="dfn" href="#css-tokenize" id="ref-for-css-tokenize①">tokenizing</a> <var>input string</var> with <var>unicode ranges allowed</var> set to true. Let <var>input</var> be a new <a data-link-type="dfn" href="#css-token-stream" id="ref-for-css-token-stream①⑨">token stream</a> from <var>tokens</var>.</p> <li data-md> <p><a data-link-type="dfn" href="#consume-a-list-of-component-values" id="ref-for-consume-a-list-of-component-values④">Consume a list of component values</a> from <var>input</var>, and return the result.</p> </ol> <p class="note" role="note"><span class="marker">Note:</span> The existence of this algorithm is due to a design mistake in early CSS. It should never be reproduced.</p> <h2 class="heading settled" data-level="6" id="anb-microsyntax"><span class="secno">6. </span><span class="content"> The <var>An+B</var> microsyntax</span><a class="self-link" href="#anb-microsyntax"></a></h2> <p>Several things in CSS, such as the <span class="informative"><a class="css" data-link-type="maybe" href="https://drafts.csswg.org/selectors-4/#nth-child-pseudo" id="ref-for-nth-child-pseudo">:nth-child()</a></span> pseudoclass, need to indicate indexes in a list. The <var>An+B</var> microsyntax is useful for this, allowing an author to easily indicate single elements or all elements at regularly-spaced intervals in a list.</p> <p>The <dfn class="dfn-paneled" data-dfn-type="dfn" data-export id="anb">An+B</dfn> notation defines an integer step (<var>A</var>) and offset (<var>B</var>), and represents the <var>An+B</var>th elements in a list, for every positive integer or zero value of <var>n</var>, with the first element in the list having index 1 (not 0).</p> <p>For values of <var>A</var> and <var>B</var> greater than 0, this effectively divides the list into groups of <var>A</var> elements (the last group taking the remainder), and selecting the <var>B</var>th element of each group.</p> <p>The <var>An+B</var> notation also accepts the <span class="css">even</span> and <span class="css">odd</span> keywords, which have the same meaning as <span class="css">2n</span> and <span class="css">2n+1</span>, respectively.</p> <div class="example" id="example-0b8828eb"> <a class="self-link" href="#example-0b8828eb"></a> <p>Examples: </p> <pre>2n+0 /* represents all of the even elements in the list */ even /* same */ 4n+1 /* represents the 1st, 5th, 9th, 13th, etc. elements in the list */</pre> </div> <p>The values of <var>A</var> and <var>B</var> can be negative, but only the positive results of <var>An+B</var>, for <var>n</var> ≥ 0, are used.</p> <div class="example" id="example-34cd21ee"> <a class="self-link" href="#example-34cd21ee"></a> <p>Example: </p> <pre>-1n+6 /* represents the first 6 elements of the list */ -4n+10 /* represents the 2nd, 6th, and 10th elements of the list */ </pre> </div> <p>If both <var>A</var> and <var>B</var> are 0, the pseudo-class represents no element in the list.</p> <h3 class="heading settled" data-level="6.1" id="anb-syntax"><span class="secno">6.1. </span><span class="content"> Informal Syntax Description</span><a class="self-link" href="#anb-syntax"></a></h3> <p><em>This section is non-normative.</em></p> <p>When <var>A</var> is 0, the <var>An</var> part may be omitted (unless the <var>B</var> part is already omitted). When <var>An</var> is not included and <var>B</var> is non-negative, the <a class="css" data-link-type="maybe" href="https://drafts.csswg.org/selectors-4/#selectordef-adjacent" id="ref-for-selectordef-adjacent">+</a> sign before <var>B</var> (when allowed) may also be omitted. In this case the syntax simplifies to just <var>B</var>.</p> <div class="example" id="example-335ba750"> <a class="self-link" href="#example-335ba750"></a> <p>Examples: </p> <pre>0n+5 /* represents the 5th element in the list */ 5 /* same */</pre> </div> <p>When <var>A</var> is 1 or -1, the <code>1</code> may be omitted from the rule.</p> <div class="example" id="example-5d33d659"> <a class="self-link" href="#example-5d33d659"></a> <p>Examples: </p> <p>The following notations are therefore equivalent: </p> <pre>1n+0 /* represents all elements in the list */ n+0 /* same */ n /* same */</pre> </div> <p>If <var>B</var> is 0, then every <var>A</var>th element is picked. In such a case, the <var>+B</var> (or <var>-B</var>) part may be omitted unless the <var>A</var> part is already omitted.</p> <div class="example" id="example-c62dcd18"> <a class="self-link" href="#example-c62dcd18"></a> <p>Examples: </p> <pre>2n+0 /* represents every even element in the list */ 2n /* same */</pre> </div> <p>When B is negative, its minus sign replaces the <a class="css" data-link-type="maybe" href="https://drafts.csswg.org/selectors-4/#selectordef-adjacent" id="ref-for-selectordef-adjacent①">+</a> sign.</p> <div class="example" id="example-3d25855e"> <a class="self-link" href="#example-3d25855e"></a> <p>Valid example: </p> <pre>3n-6</pre> <p>Invalid example: </p> <pre>3n + -6</pre> </div> <p>Whitespace is permitted on either side of the <a class="css" data-link-type="maybe" href="https://drafts.csswg.org/selectors-4/#selectordef-adjacent" id="ref-for-selectordef-adjacent②">+</a> or <span class="css">-</span> that separates the <var>An</var> and <var>B</var> parts when both are present.</p> <div class="example" id="example-e61d78e8"> <a class="self-link" href="#example-e61d78e8"></a> <p>Valid Examples with white space: </p> <pre>3n + 1 +3n - 2 -n+ 6 +6</pre> <p>Invalid Examples with white space: </p> <pre>3 n + 2n + 2</pre> </div> <h3 class="heading settled" data-level="6.2" id="the-anb-type"><span class="secno">6.2. </span><span class="content"> The <code><an+b></code> type</span><a class="self-link" href="#the-anb-type"></a></h3> <p>The <var>An+B</var> notation was originally defined using a slightly different tokenizer than the rest of CSS, resulting in a somewhat odd definition when expressed in terms of CSS tokens. This section describes how to recognize the <var>An+B</var> notation in terms of CSS tokens (thus defining the <var><an+b></var> type for CSS grammar purposes), and how to interpret the CSS tokens to obtain values for <var>A</var> and <var>B</var>.</p> <p>The <var><an+b></var> type is defined (using the <a href="https://www.w3.org/TR/css3-values/#value-defs">Value Definition Syntax in the Values & Units spec</a>) as:</p> <pre class="prod"><dfn class="dfn-paneled" data-dfn-type="type" data-export id="anb-production"><an<a data-link-type="grammar" href="https://drafts.csswg.org/css-values-4/#mult-one-plus" id="ref-for-mult-one-plus">+</a>b></dfn> = odd <a data-link-type="grammar" href="https://drafts.csswg.org/css-values-4/#comb-one" id="ref-for-comb-one">|</a> even <a data-link-type="grammar" href="https://drafts.csswg.org/css-values-4/#comb-one" id="ref-for-comb-one①">|</a> <var><integer></var> <a data-link-type="grammar" href="https://drafts.csswg.org/css-values-4/#comb-one" id="ref-for-comb-one②">|</a> <var><n-dimension></var> <a data-link-type="grammar" href="https://drafts.csswg.org/css-values-4/#comb-one" id="ref-for-comb-one③">|</a> '+'<a data-link-type="grammar" href="https://drafts.csswg.org/css-values-4/#mult-opt" id="ref-for-mult-opt">?</a><sup><a href="#anb-plus">†</a></sup> n <a data-link-type="grammar" href="https://drafts.csswg.org/css-values-4/#comb-one" id="ref-for-comb-one④">|</a> -n <a data-link-type="grammar" href="https://drafts.csswg.org/css-values-4/#comb-one" id="ref-for-comb-one⑤">|</a> <var><ndashdigit-dimension></var> <a data-link-type="grammar" href="https://drafts.csswg.org/css-values-4/#comb-one" id="ref-for-comb-one⑥">|</a> '+'<a data-link-type="grammar" href="https://drafts.csswg.org/css-values-4/#mult-opt" id="ref-for-mult-opt①">?</a><sup><a href="#anb-plus">†</a></sup> <var><ndashdigit-ident></var> <a data-link-type="grammar" href="https://drafts.csswg.org/css-values-4/#comb-one" id="ref-for-comb-one⑦">|</a> <var><dashndashdigit-ident></var> <a data-link-type="grammar" href="https://drafts.csswg.org/css-values-4/#comb-one" id="ref-for-comb-one⑧">|</a> <var><n-dimension></var> <var><signed-integer></var> <a data-link-type="grammar" href="https://drafts.csswg.org/css-values-4/#comb-one" id="ref-for-comb-one⑨">|</a> '+'<a data-link-type="grammar" href="https://drafts.csswg.org/css-values-4/#mult-opt" id="ref-for-mult-opt②">?</a><sup><a href="#anb-plus">†</a></sup> n <var><signed-integer></var> <a data-link-type="grammar" href="https://drafts.csswg.org/css-values-4/#comb-one" id="ref-for-comb-one①⓪">|</a> -n <var><signed-integer></var> <a data-link-type="grammar" href="https://drafts.csswg.org/css-values-4/#comb-one" id="ref-for-comb-one①①">|</a> <var><ndash-dimension></var> <var><signless-integer></var> <a data-link-type="grammar" href="https://drafts.csswg.org/css-values-4/#comb-one" id="ref-for-comb-one①②">|</a> '+'<a data-link-type="grammar" href="https://drafts.csswg.org/css-values-4/#mult-opt" id="ref-for-mult-opt③">?</a><sup><a href="#anb-plus">†</a></sup> n- <var><signless-integer></var> <a data-link-type="grammar" href="https://drafts.csswg.org/css-values-4/#comb-one" id="ref-for-comb-one①③">|</a> -n- <var><signless-integer></var> <a data-link-type="grammar" href="https://drafts.csswg.org/css-values-4/#comb-one" id="ref-for-comb-one①④">|</a> <var><n-dimension></var> ['+' <a data-link-type="grammar" href="https://drafts.csswg.org/css-values-4/#comb-one" id="ref-for-comb-one①⑤">|</a> '-'] <var><signless-integer></var> <a data-link-type="grammar" href="https://drafts.csswg.org/css-values-4/#comb-one" id="ref-for-comb-one①⑥">|</a> '+'<a data-link-type="grammar" href="https://drafts.csswg.org/css-values-4/#mult-opt" id="ref-for-mult-opt④">?</a><sup><a href="#anb-plus">†</a></sup> n ['+' <a data-link-type="grammar" href="https://drafts.csswg.org/css-values-4/#comb-one" id="ref-for-comb-one①⑦">|</a> '-'] <var><signless-integer></var> <a data-link-type="grammar" href="https://drafts.csswg.org/css-values-4/#comb-one" id="ref-for-comb-one①⑧">|</a> -n ['+' <a data-link-type="grammar" href="https://drafts.csswg.org/css-values-4/#comb-one" id="ref-for-comb-one①⑨">|</a> '-'] <var><signless-integer></var> </pre> <p>where:</p> <ul> <li><dfn class="dfn-paneled css" data-dfn-type="type" data-export id="typedef-n-dimension"><code><n-dimension></code></dfn> is a <a class="production css" data-link-type="type" href="#typedef-dimension-token" id="ref-for-typedef-dimension-token⑨"><dimension-token></a> with its type flag set to "integer", and a unit that is an <a data-link-type="dfn" href="https://infra.spec.whatwg.org/#ascii-case-insensitive" id="ref-for-ascii-case-insensitive③">ASCII case-insensitive</a> match for "n" <li><dfn class="dfn-paneled css" data-dfn-type="type" data-export id="typedef-ndash-dimension"><code><ndash-dimension></code></dfn> is a <a class="production css" data-link-type="type" href="#typedef-dimension-token" id="ref-for-typedef-dimension-token①⓪"><dimension-token></a> with its type flag set to "integer", and a unit that is an <a data-link-type="dfn" href="https://infra.spec.whatwg.org/#ascii-case-insensitive" id="ref-for-ascii-case-insensitive④">ASCII case-insensitive</a> match for "n-" <li><dfn class="dfn-paneled css" data-dfn-type="type" data-export id="typedef-ndashdigit-dimension"><code><ndashdigit-dimension></code></dfn> is a <a class="production css" data-link-type="type" href="#typedef-dimension-token" id="ref-for-typedef-dimension-token①①"><dimension-token></a> with its type flag set to "integer", and a unit that is an <a data-link-type="dfn" href="https://infra.spec.whatwg.org/#ascii-case-insensitive" id="ref-for-ascii-case-insensitive⑤">ASCII case-insensitive</a> match for "n-*", where "*" is a series of one or more <a data-link-type="dfn" href="#digit" id="ref-for-digit①②">digits</a> <li><dfn class="dfn-paneled css" data-dfn-type="type" data-export id="typedef-ndashdigit-ident"><code><ndashdigit-ident></code></dfn> is an <a class="production css" data-link-type="type" href="#typedef-ident-token" id="ref-for-typedef-ident-token①⓪"><ident-token></a> whose value is an <a data-link-type="dfn" href="https://infra.spec.whatwg.org/#ascii-case-insensitive" id="ref-for-ascii-case-insensitive⑥">ASCII case-insensitive</a> match for "n-*", where "*" is a series of one or more <a data-link-type="dfn" href="#digit" id="ref-for-digit①③">digits</a> <li><dfn class="dfn-paneled css" data-dfn-type="type" data-export id="typedef-dashndashdigit-ident"><code><dashndashdigit-ident></code></dfn> is an <a class="production css" data-link-type="type" href="#typedef-ident-token" id="ref-for-typedef-ident-token①①"><ident-token></a> whose value is an <a data-link-type="dfn" href="https://infra.spec.whatwg.org/#ascii-case-insensitive" id="ref-for-ascii-case-insensitive⑦">ASCII case-insensitive</a> match for "-n-*", where "*" is a series of one or more <a data-link-type="dfn" href="#digit" id="ref-for-digit①④">digits</a> <li><dfn class="dfn-paneled css" data-dfn-type="type" data-export id="typedef-integer"><code><integer></code></dfn> is a <a class="production css" data-link-type="type" href="#typedef-number-token" id="ref-for-typedef-number-token⑤"><number-token></a> with its type flag set to "integer" <li><dfn class="dfn-paneled css" data-dfn-type="type" data-export id="typedef-signed-integer"><code><signed-integer></code></dfn> is a <a class="production css" data-link-type="type" href="#typedef-number-token" id="ref-for-typedef-number-token⑥"><number-token></a> with its type flag set to "integer", and a sign character <li><dfn class="dfn-paneled css" data-dfn-type="type" data-export id="typedef-signless-integer"><code><signless-integer></code></dfn> is a <a class="production css" data-link-type="type" href="#typedef-number-token" id="ref-for-typedef-number-token⑦"><number-token></a> with its type flag set to "integer", and no sign character </ul> <p id="anb-plus"> <sup>†</sup>: When a plus sign (+) precedes an ident starting with "n", as in the cases marked above, there must be no whitespace between the two tokens, or else the tokens do not match the above grammar. Whitespace is valid (and ignored) between any other two tokens. </p> <p>The clauses of the production are interpreted as follows:</p> <dl> <dt><span class="css">odd</span> <dd> <var>A</var> is 2, <var>B</var> is 1. <dt><span class="css">even</span> <dd> <var>A</var> is 2, <var>B</var> is 0. <dt><code><var><integer></var></code> <dd> <var>A</var> is 0, <var>B</var> is the integer’s value. <dt><code><var><n-dimension></var></code> <dt><code>'+'? n</code> <dt><code>-n</code> <dd> <var>A</var> is the dimension’s value, 1, or -1, respectively. <var>B</var> is 0. <dt><code><var><ndashdigit-dimension></var></code> <dt><code>'+'? <var><ndashdigit-ident></var></code> <dd> <var>A</var> is the dimension’s value or 1, respectively. <var>B</var> is the dimension’s unit or ident’s value, respectively, with the first <a data-link-type="dfn" href="https://infra.spec.whatwg.org/#code-point" id="ref-for-code-point⑧③">code point</a> removed and the remainder interpreted as a base-10 number. <span class="note">B is negative.</span> <dt><code><var><dashndashdigit-ident></var></code> <dd> <var>A</var> is -1. <var>B</var> is the ident’s value, with the first two <a data-link-type="dfn" href="https://infra.spec.whatwg.org/#code-point" id="ref-for-code-point⑧④">code points</a> removed and the remainder interpreted as a base-10 number. <span class="note">B is negative.</span> <dt><code><var><n-dimension></var> <var><signed-integer></var></code> <dt><code>'+'? n <var><signed-integer></var></code> <dt><code>-n <var><signed-integer></var></code> <dd> <var>A</var> is the dimension’s value, 1, or -1, respectively. <var>B</var> is the integer’s value. <dt><code><var><ndash-dimension></var> <var><signless-integer></var></code> <dt><code>'+'? n- <var><signless-integer></var></code> <dt><code>-n- <var><signless-integer></var></code> <dd> <var>A</var> is the dimension’s value, 1, or -1, respectively. <var>B</var> is the negation of the integer’s value. <dt><code><var><n-dimension></var> ['+' | '-'] <var><signless-integer></var></code> <dt><code>'+'? n ['+' | '-'] <var><signless-integer></var></code> <dt><code>-n ['+' | '-'] <var><signless-integer></var></code> <dd> <var>A</var> is the dimension’s value, 1, or -1, respectively. <var>B</var> is the integer’s value. If a <code>'-'</code> was provided between the two, <var>B</var> is instead the negation of the integer’s value. </dl> <h2 class="heading settled" data-level="7" id="rule-defs"><span class="secno">7. </span><span class="content"> Defining Grammars for Rules and Other Values</span><a class="self-link" href="#rule-defs"></a></h2> <p><a href="https://drafts.csswg.org/css-values-4/#value-defs"><cite>CSS Values 4</cite> § 2 Value Definition Syntax</a> defines how to specify a grammar for properties and other CSS syntactic constructions.</p> <h3 class="heading settled" data-level="7.1" id="block-contents"><span class="secno">7.1. </span><span class="content"> Defining Block Contents: the <a class="production css" data-link-type="type" href="#typedef-block-contents" id="ref-for-typedef-block-contents"><block-contents></a>, <a class="production css" data-link-type="type" href="#typedef-declaration-list" id="ref-for-typedef-declaration-list"><declaration-list></a>, <a class="production css" data-link-type="type" href="#typedef-qualified-rule-list" id="ref-for-typedef-qualified-rule-list"><qualified-rule-list></a>, <a class="production css" data-link-type="type" href="#typedef-declaration-rule-list" id="ref-for-typedef-declaration-rule-list"><declaration-rule-list></a>, and <a class="production css" data-link-type="type" href="#typedef-rule-list" id="ref-for-typedef-rule-list"><rule-list></a> productions</span><a class="self-link" href="#block-contents"></a></h3> <p>The CSS parser is agnostic as to the contents of blocks—they’re all <a data-link-type="dfn" href="#consume-a-blocks-contents" id="ref-for-consume-a-blocks-contents②">parsed with the same algorithm</a>, and differentiate themselves solely by what constructs are valid.</p> <p>When writing a rule grammar, <dfn class="dfn-paneled css" data-dfn-type="type" data-export id="typedef-block-contents"><block-contents></dfn> represents this agnostic parsing. It must only be used as the sole value in a block, and represents that no restrictions are implicitly placed on what the block can contain.</p> <p>Accompanying prose must define what is valid and invalid in this context. If any <a data-link-type="dfn">declarations</a> are valid, and are <a data-link-type="dfn" href="#css-property-declarations" id="ref-for-css-property-declarations">property declarations</a>, it must define whether they interact with the cascade; if they do, it must define their specificity and how they use <code>!important</code>.</p> <p>In many cases, however, a block can’t validly contain <em>any</em> constructs of a given type. To represent these cases more explicitly, the following productions may be used</p> <ul> <li data-md> <p><dfn class="dfn-paneled css" data-dfn-type="type" data-export id="typedef-declaration-list"><declaration-list></dfn>: only <a data-link-type="dfn">declarations</a> are allowed; <a data-link-type="dfn" href="#at-rule" id="ref-for-at-rule①⑥">at-rules</a> and <a data-link-type="dfn" href="#qualified-rule" id="ref-for-qualified-rule⑨">qualified rules</a> are automatically invalid.</p> <li data-md> <p><dfn class="dfn-paneled css" data-dfn-type="type" data-export id="typedef-qualified-rule-list"><qualified-rule-list></dfn>: only <a data-link-type="dfn" href="#qualified-rule" id="ref-for-qualified-rule①⓪">qualified rules</a> are allowed; <a data-link-type="dfn">declarations</a> and <a data-link-type="dfn" href="#at-rule" id="ref-for-at-rule①⑦">at-rules</a> are automatically invalid.</p> <li data-md> <p><dfn class="dfn-paneled css" data-dfn-type="type" data-export id="typedef-at-rule-list"><at-rule-list></dfn>: only <a data-link-type="dfn" href="#at-rule" id="ref-for-at-rule①⑧">at-rules</a> are allowed; <a data-link-type="dfn">declarations</a> and <a data-link-type="dfn" href="#qualified-rule" id="ref-for-qualified-rule①①">qualified rules</a> are automatically invalid.</p> <li data-md> <p><dfn class="dfn-paneled css" data-dfn-type="type" data-export id="typedef-declaration-rule-list"><declaration-rule-list></dfn>: <a data-link-type="dfn">declarations</a> and <a data-link-type="dfn" href="#at-rule" id="ref-for-at-rule①⑨">at-rules</a> are allowed; <a data-link-type="dfn" href="#qualified-rule" id="ref-for-qualified-rule①②">qualified rules</a> are automatically invalid.</p> <li data-md> <p><dfn class="dfn-paneled css" data-dfn-type="type" data-export id="typedef-rule-list"><rule-list></dfn>: <a data-link-type="dfn" href="#qualified-rule" id="ref-for-qualified-rule①③">qualified rules</a> and <a data-link-type="dfn" href="#at-rule" id="ref-for-at-rule②⓪">at-rules</a> are allowed; <a data-link-type="dfn">declarations</a> are automatically invalid.</p> </ul> <p>All of these are exactly equivalent to <a class="production css" data-link-type="type" href="#typedef-block-contents" id="ref-for-typedef-block-contents①"><block-contents></a> in terms of parsing, but the accompanying prose only has to define validity for the categories that aren’t automatically invalid.</p> <div class="example" id="example-6dc7b979"> <a class="self-link" href="#example-6dc7b979"></a> Some examples of the various productions: <ul> <li data-md> <p>A top-level <a class="css" data-link-type="maybe" href="https://drafts.csswg.org/css-conditional-3/#at-ruledef-media" id="ref-for-at-ruledef-media②">@media</a> uses <a class="production css" data-link-type="type" href="#typedef-rule-list" id="ref-for-typedef-rule-list①"><rule-list></a> for its block, while a nested one <a data-link-type="biblio" href="#biblio-css-nesting-1" title="CSS Nesting Module">[CSS-NESTING-1]</a> uses <a class="production css" data-link-type="type" href="#typedef-block-contents" id="ref-for-typedef-block-contents②"><block-contents></a>.</p> <li data-md> <p><a data-link-type="dfn" href="#style-rule" id="ref-for-style-rule②">Style rules</a> use <a class="production css" data-link-type="type" href="#typedef-block-contents" id="ref-for-typedef-block-contents③"><block-contents></a>.</p> <li data-md> <p><a class="css" data-link-type="maybe" href="https://drafts.csswg.org/css-fonts-5/#at-font-face-rule" id="ref-for-at-font-face-rule">@font-face</a> uses <a class="production css" data-link-type="type" href="#typedef-declaration-list" id="ref-for-typedef-declaration-list①"><declaration-list></a>.</p> <li data-md> <p><a class="css" data-link-type="maybe" href="https://drafts.csswg.org/css-page-3/#at-ruledef-page" id="ref-for-at-ruledef-page①">@page</a> uses <a class="production css" data-link-type="type" href="#typedef-declaration-rule-list" id="ref-for-typedef-declaration-rule-list①"><declaration-rule-list></a>.</p> <li data-md> <p><a class="css" data-link-type="maybe" href="https://drafts.csswg.org/css-animations-1/#at-ruledef-keyframes" id="ref-for-at-ruledef-keyframes">@keyframes</a> uses <a class="production css" data-link-type="type" href="#typedef-qualified-rule-list" id="ref-for-typedef-qualified-rule-list①"><qualified-rule-list></a></p> </ul> </div> <div class="example" id="example-92c1a511"> <a class="self-link" href="#example-92c1a511"></a> For example, the grammar for <a class="css" data-link-type="maybe" href="https://drafts.csswg.org/css-fonts-5/#at-font-face-rule" id="ref-for-at-font-face-rule①">@font-face</a> can be written as: <pre><a class="production" data-link-type="at-rule" href="https://drafts.csswg.org/css-fonts-5/#at-font-face-rule" id="ref-for-at-font-face-rule②"><@font-face></a> = @font-face { <a class="production" data-link-type="type" href="#typedef-declaration-list" id="ref-for-typedef-declaration-list②"><declaration-list></a> }</pre> <p>and then accompanying prose defines the valid <a data-link-type="dfn" href="#css-descriptor" id="ref-for-css-descriptor①">descriptors</a> allowed in the block.</p> <p>The grammar for <a class="css" data-link-type="maybe" href="https://drafts.csswg.org/css-animations-1/#at-ruledef-keyframes" id="ref-for-at-ruledef-keyframes①">@keyframes</a> can be written as:</p> <pre><a class="production" data-link-type="at-rule" href="https://drafts.csswg.org/css-animations-1/#at-ruledef-keyframes" id="ref-for-at-ruledef-keyframes②"><@keyframes></a> = @keyframes { <a class="production" data-link-type="type" href="#typedef-qualified-rule-list" id="ref-for-typedef-qualified-rule-list②"><qualified-rule-list></a> } <a class="production" data-link-type="type"><keyframe-rule></a> = <a class="production" data-link-type="type" href="https://drafts.csswg.org/css-animations-1/#typedef-keyframe-selector" id="ref-for-typedef-keyframe-selector"><keyframe-selector></a> { <a class="production" data-link-type="type" href="#typedef-declaration-list" id="ref-for-typedef-declaration-list③"><declaration-list></a> } </pre> <p>and then accompanying prose defines that only <a class="production css" data-link-type="type"><keyframe-rule></a>s are allowed in <a class="css" data-link-type="maybe" href="https://drafts.csswg.org/css-animations-1/#at-ruledef-keyframes" id="ref-for-at-ruledef-keyframes③">@keyframes</a>, and that <span class="production"><keyframe-rule></span>s accept all animatable CSS properties, plus the <a class="property css" data-link-type="property" href="https://drafts.csswg.org/css-animations-1/#propdef-animation-timing-function" id="ref-for-propdef-animation-timing-function">animation-timing-function</a> property, but they do not interact with the cascade.</p> </div> <h3 class="heading settled" data-level="7.2" id="any-value"><span class="secno">7.2. </span><span class="content"> Defining Arbitrary Contents: the <a class="production css" data-link-type="type" href="#typedef-declaration-value" id="ref-for-typedef-declaration-value"><declaration-value></a> and <a class="production css" data-link-type="type" href="#typedef-any-value" id="ref-for-typedef-any-value"><any-value></a> productions</span><a class="self-link" href="#any-value"></a></h3> <p>In some grammars, it is useful to accept any reasonable input in the grammar, and do more specific error-handling on the contents manually (rather than simply invalidating the construct, as grammar mismatches tend to do).</p> <p><span class="informative">For example, <a data-link-type="dfn" href="https://drafts.csswg.org/css-variables-2/#custom-property" id="ref-for-custom-property③">custom properties</a> allow any reasonable value, as they can contain arbitrary pieces of other CSS properties, or be used for things that aren’t part of existing CSS at all. For another example, the <a class="production css" data-link-type="type" href="https://drafts.csswg.org/mediaqueries-5/#typedef-general-enclosed" id="ref-for-typedef-general-enclosed"><general-enclosed></a> production in Media Queries defines the bounds of what future syntax MQs will allow, and uses special logic to deal with "unknown" values.</span></p> <p>To aid in this, two additional productions are defined:</p> <p>The <dfn class="dfn-paneled css" data-dfn-type="type" data-export id="typedef-declaration-value"><declaration-value></dfn> production matches <em>any</em> sequence of one or more tokens, so long as the sequence does not contain <a class="production css" data-link-type="type" href="#typedef-bad-string-token" id="ref-for-typedef-bad-string-token③"><bad-string-token></a>, <a class="production css" data-link-type="type" href="#typedef-bad-url-token" id="ref-for-typedef-bad-url-token⑧"><bad-url-token></a>, unmatched <a class="production css" data-link-type="type" href="#tokendef-close-paren" id="ref-for-tokendef-close-paren③"><)-token></a>, <a class="production css" data-link-type="type" href="#tokendef-close-square" id="ref-for-tokendef-close-square③"><]-token></a>, or <a class="production css" data-link-type="type" href="#tokendef-close-curly" id="ref-for-tokendef-close-curly⑧"><}-token></a>, or top-level <a class="production css" data-link-type="type" href="#typedef-semicolon-token" id="ref-for-typedef-semicolon-token⑦"><semicolon-token></a> tokens or <a class="production css" data-link-type="type" href="#typedef-delim-token" id="ref-for-typedef-delim-token①⓪"><delim-token></a> tokens with a value of "!". It represents the entirety of what a valid declaration can have as its value.</p> <p>The <dfn class="dfn-paneled css" data-dfn-type="type" data-export id="typedef-any-value"><any-value></dfn> production is identical to <a class="production css" data-link-type="type" href="#typedef-declaration-value" id="ref-for-typedef-declaration-value①"><declaration-value></a>, but also allows top-level <a class="production css" data-link-type="type" href="#typedef-semicolon-token" id="ref-for-typedef-semicolon-token⑧"><semicolon-token></a> tokens and <a class="production css" data-link-type="type" href="#typedef-delim-token" id="ref-for-typedef-delim-token①①"><delim-token></a> tokens with a value of "!". It represents the entirety of what valid CSS can be in any context.</p> <h2 class="heading settled" data-level="8" id="css-stylesheets"><span class="secno">8. </span><span class="content"> CSS stylesheets</span><a class="self-link" href="#css-stylesheets"></a></h2> <p>To <dfn class="dfn-paneled" data-dfn-type="dfn" data-export id="parse-a-css-stylesheet">parse a CSS stylesheet</dfn>, first <a data-link-type="dfn" href="#parse-a-stylesheet" id="ref-for-parse-a-stylesheet①">parse a stylesheet</a>. Interpret all of the resulting top-level <a data-link-type="dfn" href="#qualified-rule" id="ref-for-qualified-rule①④">qualified rules</a> as <a data-link-type="dfn" href="#style-rule" id="ref-for-style-rule③">style rules</a>, defined below.</p> <p>If any style rule is <a data-link-type="dfn" href="#css-invalid" id="ref-for-css-invalid">invalid</a>, or any at-rule is not recognized or is invalid according to its grammar or context, it’s a <a data-link-type="dfn" href="#parse-error" id="ref-for-parse-error①②">parse error</a>. Discard that rule.</p> <h3 class="heading settled" data-level="8.1" id="style-rules"><span class="secno">8.1. </span><span class="content"> Style rules</span><a class="self-link" href="#style-rules"></a></h3> <p>A <dfn class="dfn-paneled" data-dfn-type="dfn" data-export id="style-rule">style rule</dfn> is a <a data-link-type="dfn" href="#qualified-rule" id="ref-for-qualified-rule①⑤">qualified rule</a> that associates a <a data-link-type="dfn" href="https://drafts.csswg.org/selectors-4/#selector-list" id="ref-for-selector-list">selector list</a> with a list of property declarations and possibly a list of nested rules. They are also called <a href="https://www.w3.org/TR/CSS2/syndata.html#rule-sets">rule sets</a> in <a data-link-type="biblio" href="#biblio-css2" title="Cascading Style Sheets Level 2 Revision 1 (CSS 2.1) Specification">[CSS2]</a>. CSS Cascading and Inheritance <a data-link-type="biblio" href="#biblio-css-cascade-3" title="CSS Cascading and Inheritance Level 3">[CSS-CASCADE-3]</a> defines how the declarations inside of style rules participate in the cascade.</p> <p>The prelude of the qualified rule is <a data-link-type="dfn" href="#css-parse-something-according-to-a-css-grammar" id="ref-for-css-parse-something-according-to-a-css-grammar④">parsed</a> as a <a class="production css" data-link-type="type" href="https://drafts.csswg.org/selectors-4/#typedef-selector-list" id="ref-for-typedef-selector-list"><selector-list></a>. If this returns failure, the entire style rule is <a data-link-type="dfn" href="#css-invalid" id="ref-for-css-invalid①">invalid</a>.</p> <p>The content of the qualified rule’s block is parsed as a <a class="production css" data-link-type="type" href="#typedef-declaration-list" id="ref-for-typedef-declaration-list④"><declaration-list></a>. Qualified rules in this block are also <a data-link-type="dfn" href="#style-rule" id="ref-for-style-rule④">style rules</a>. Unless defined otherwise by another specification or a future level of this specification, at-rules in that list are <a data-link-type="dfn" href="#css-invalid" id="ref-for-css-invalid②">invalid</a> and must be ignored.</p> <p class="note" role="note"><span class="marker">Note:</span> <a data-link-type="biblio" href="#biblio-css-nesting-1" title="CSS Nesting Module">[CSS-NESTING-1]</a> defines that <a data-link-type="dfn" href="https://drafts.csswg.org/css-conditional-3/#conditional-group-rule" id="ref-for-conditional-group-rule">conditional group rules</a> and some other <a data-link-type="dfn" href="#at-rule" id="ref-for-at-rule②①">at-rules</a> are allowed inside of <a data-link-type="dfn" href="#style-rule" id="ref-for-style-rule⑤">style rules</a>.</p> <p>Declarations for an unknown CSS property or whose value does not match the syntax defined by the property are <a data-link-type="dfn" href="#css-invalid" id="ref-for-css-invalid③">invalid</a> and must be ignored. The validity of the style rule’s contents have no effect on the validity of the style rule itself. Unless otherwise specified, property names are <a data-link-type="dfn" href="https://infra.spec.whatwg.org/#ascii-case-insensitive" id="ref-for-ascii-case-insensitive⑧">ASCII case-insensitive</a>.</p> <p class="note" role="note"><span class="marker">Note:</span> The names of Custom Properties <a data-link-type="biblio" href="#biblio-css-variables" title="CSS Custom Properties for Cascading Variables Module Level 1">[CSS-VARIABLES]</a> are case-sensitive.</p> <p><a data-link-type="dfn" href="#qualified-rule" id="ref-for-qualified-rule①⑥">Qualified rules</a> at the top-level of a CSS stylesheet are <a data-link-type="dfn" href="#style-rule" id="ref-for-style-rule⑥">style rules</a>. Qualified rules in other contexts may or may not be style rules, as defined by the context.</p> <p class="example" id="example-4acffe04"><a class="self-link" href="#example-4acffe04"></a> For example, qualified rules inside <a class="css" data-link-type="maybe" href="https://drafts.csswg.org/css-conditional-3/#at-ruledef-media" id="ref-for-at-ruledef-media③">@media</a> rules <a data-link-type="biblio" href="#biblio-css3-conditional" title="CSS Conditional Rules Module Level 3">[CSS3-CONDITIONAL]</a> are style rules, but qualified rules inside <a class="css" data-link-type="maybe" href="https://drafts.csswg.org/css-animations-1/#at-ruledef-keyframes" id="ref-for-at-ruledef-keyframes④">@keyframes</a> rules <a data-link-type="biblio" href="#biblio-css3-animations" title="CSS Animations Level 1">[CSS3-ANIMATIONS]</a> are not. </p> <h3 class="heading settled" data-level="8.2" id="at-rules"><span class="secno">8.2. </span><span class="content"> At-rules</span><a class="self-link" href="#at-rules"></a></h3> <p>An <dfn class="dfn-paneled" data-dfn-type="dfn" data-export id="at-rule">at-rule</dfn> is a rule that begins with an at-keyword, and can thus be distinguished from <a data-link-type="dfn" href="#style-rule" id="ref-for-style-rule⑦">style rules</a> in the same context.</p> <p><a data-link-type="dfn" href="#at-rule" id="ref-for-at-rule②②">At-rules</a> are used to:</p> <ul> <li data-md> <p>group and structure style rules and other at-rules such as in <a data-link-type="dfn" href="https://drafts.csswg.org/css-conditional-3/#conditional-group-rule" id="ref-for-conditional-group-rule①">conditional group rules</a></p> <li data-md> <p>declare style information that is not associated with a particular element, such as defining <a data-link-type="dfn" href="https://drafts.csswg.org/css-counter-styles-3/#counter-style" id="ref-for-counter-style">counter styles</a></p> <li data-md> <p>manage syntactic constructs such as <a href="https://drafts.csswg.org/css-cascade-3/#at-import">imports</a> and <a data-link-type="biblio" href="#biblio-css-namespaces-3" title="CSS Namespaces Module Level 3">namespaces</a> keyword mappings</p> <li data-md> <p>and serve other miscellaneous purposes not served by a <a data-link-type="dfn" href="#style-rule" id="ref-for-style-rule⑧">style rule</a></p> </ul> <p>At-rules take many forms, depending on the specific rule and its purpose, but broadly speaking there are two kinds: <dfn class="dfn-paneled" data-dfn-type="dfn" data-export data-lt="statement at-rule" id="statement-at-rule">statement at-rules</dfn> which are simpler constructs that end in a semicolon, and <dfn class="dfn-paneled" data-dfn-type="dfn" data-export data-lt="block at-rule" id="block-at-rule">block at-rules</dfn> which end in a <a data-link-type="dfn" href="#curly-block" id="ref-for-curly-block①">{}-block</a> that can contain nested <a data-link-type="dfn" href="#qualified-rule" id="ref-for-qualified-rule①⑦">qualified rules</a>, <a data-link-type="dfn" href="#at-rule" id="ref-for-at-rule②③">at-rules</a>, or <a data-link-type="dfn">declarations</a>.</p> <p><a data-link-type="dfn" href="#block-at-rule" id="ref-for-block-at-rule①">Block at-rules</a> will typically contain a collection of (generic or <a data-link-type="dfn" href="#at-rule" id="ref-for-at-rule②④">at-rule</a>–specific) <span id="ref-for-at-rule②⑤">at-rules</span>, <a data-link-type="dfn" href="#qualified-rule" id="ref-for-qualified-rule①⑧">qualified rules</a>, and/or <a data-link-type="dfn" href="#css-descriptor-declarations" id="ref-for-css-descriptor-declarations">descriptor declarations</a> subject to limitations defined by the <span id="ref-for-at-rule②⑥">at-rule</span>. <dfn class="dfn-paneled" data-dfn-for="CSS" data-dfn-type="dfn" data-export data-lt="descriptor" id="css-descriptor">Descriptors</dfn> are similar to <a data-link-type="dfn" href="https://drafts.csswg.org/css-cascade-5/#css-property" id="ref-for-css-property②">properties</a> (and are declared with the same syntax) but are associated with a particular type of <span id="ref-for-at-rule②⑦">at-rule</span> rather than with elements and boxes in the tree.</p> <h3 class="heading settled" data-level="8.3" id="charset-rule"><span class="secno">8.3. </span><span class="content"> The <a class="css" data-link-type="maybe" href="#at-ruledef-charset" id="ref-for-at-ruledef-charset②">@charset</a> Rule</span><a class="self-link" href="#charset-rule"></a></h3> <p>The algorithm used to <a data-link-type="dfn" href="#determine-the-fallback-encoding" id="ref-for-determine-the-fallback-encoding①">determine the fallback encoding</a> for a stylesheet looks for a specific byte sequence as the very first few bytes in the file, which has the syntactic form of an <a data-link-type="dfn" href="#at-rule" id="ref-for-at-rule②⑧">at-rule</a> named "@charset".</p> <p>However, there is no actual <a data-link-type="dfn" href="#at-rule" id="ref-for-at-rule②⑨">at-rule</a> named <dfn class="dfn-paneled css" data-dfn-type="at-rule" data-export id="at-ruledef-charset">@charset</dfn>. When a stylesheet is actually parsed, any occurrences of an <a class="css" data-link-type="maybe" href="#at-ruledef-charset" id="ref-for-at-ruledef-charset③">@charset</a> rule must be treated as an unrecognized rule, and thus dropped as invalid when the stylesheet is grammar-checked.</p> <p class="note" role="note"><span class="marker">Note:</span> In CSS 2.1, <a class="css" data-link-type="maybe" href="#at-ruledef-charset" id="ref-for-at-ruledef-charset④">@charset</a> was a valid rule. Some legacy specs may still refer to a <span class="css" id="ref-for-at-ruledef-charset⑤">@charset</span> rule, and explicitly talk about its presence in the stylesheet.</p> <h2 class="heading settled" data-level="9" id="serialization"><span class="secno">9. </span><span class="content"> Serialization</span><a class="self-link" href="#serialization"></a></h2> <p>The tokenizer described in this specification does not produce tokens for comments, or otherwise preserve them in any way. Implementations may preserve the contents of comments and their location in the token stream. If they do, this preserved information must have no effect on the parsing step.</p> <p>This specification does not define how to serialize CSS in general, leaving that task to the <a data-link-type="biblio" href="#biblio-cssom" title="CSS Object Model (CSSOM)">[CSSOM]</a> and individual feature specifications. In particular, the serialization of comments and whitespace is not defined.</p> <p>The only requirement for serialization is that it must "round-trip" with parsing, that is, parsing the stylesheet must produce the same data structures as parsing, serializing, and parsing again, except for consecutive <a class="production css" data-link-type="type" href="#typedef-whitespace-token" id="ref-for-typedef-whitespace-token①⓪"><whitespace-token></a>s, which may be collapsed into a single token.</p> <p class="note" role="note"><span class="marker">Note:</span> This exception can exist because CSS grammars always interpret any amount of whitespace as identical to a single space.</p> <div class="note" id="serialization-tables" role="note"> <a class="self-link" href="#serialization-tables"></a> To satisfy this requirement: <ul> <li> A <a class="production css" data-link-type="type" href="#typedef-delim-token" id="ref-for-typedef-delim-token①②"><delim-token></a> containing U+005C REVERSE SOLIDUS (\) must be serialized as U+005C REVERSE SOLIDUS followed by a <a data-link-type="dfn" href="#newline" id="ref-for-newline④">newline</a>. (The tokenizer only ever emits such a token followed by a <a class="production css" data-link-type="type" href="#typedef-whitespace-token" id="ref-for-typedef-whitespace-token①①"><whitespace-token></a> that starts with a newline.) <li> A <a class="production css" data-link-type="type" href="#typedef-hash-token" id="ref-for-typedef-hash-token⑦"><hash-token></a> with the "unrestricted" type flag may not need as much escaping as the same token with the "id" type flag. <li> The unit of a <a class="production css" data-link-type="type" href="#typedef-dimension-token" id="ref-for-typedef-dimension-token①②"><dimension-token></a> may need escaping to disambiguate with scientific notation. <li> For any consecutive pair of tokens, if the first token shows up in the row headings of the following table, and the second token shows up in the column headings, and there’s a ✗ in the cell denoted by the intersection of the chosen row and column, the pair of tokens must be serialized with a comment between them. <p>If the tokenizer preserves comments, and there were comments originally between the token pair, the preserved comment(s) should be used; otherwise, an empty comment (<code>/**/</code>) must be inserted. (Preserved comments may be reinserted even if the following tables don’t require a comment between two tokens.)</p> <p>Single characters in the row and column headings represent a <a class="production css" data-link-type="type" href="#typedef-delim-token" id="ref-for-typedef-delim-token①③"><delim-token></a> with that value, except for "<code>(</code>", which represents a <a href="#tokendef-open-paren" id="ref-for-tokendef-open-paren⑤">(-token</a>.</p> </ul> <table class="data"> <tbody> <tr> <td> <th>ident <th>function <th>url <th>bad url <th>- <th>number <th>percentage <th>dimension <th>CDC <th>( <th>* <th>% <tr> <th>ident <td>✗ <td>✗ <td>✗ <td>✗ <td>✗ <td>✗ <td>✗ <td>✗ <td>✗ <td>✗ <td> <td> <tr> <th>at-keyword <td>✗ <td>✗ <td>✗ <td>✗ <td>✗ <td>✗ <td>✗ <td>✗ <td>✗ <td> <td> <td> <tr> <th>hash <td>✗ <td>✗ <td>✗ <td>✗ <td>✗ <td>✗ <td>✗ <td>✗ <td>✗ <td> <td> <td> <tr> <th>dimension <td>✗ <td>✗ <td>✗ <td>✗ <td>✗ <td>✗ <td>✗ <td>✗ <td>✗ <td> <td> <td> <tr> <th># <td>✗ <td>✗ <td>✗ <td>✗ <td>✗ <td>✗ <td>✗ <td>✗ <td>✗ <td> <td> <td> <tr> <th>- <td>✗ <td>✗ <td>✗ <td>✗ <td>✗ <td>✗ <td>✗ <td>✗ <td>✗ <td> <td> <td> <tr> <th>number <td>✗ <td>✗ <td>✗ <td>✗ <td> <td>✗ <td>✗ <td>✗ <td>✗ <td> <td> <td>✗ <tr> <th>@ <td>✗ <td>✗ <td>✗ <td>✗ <td>✗ <td> <td> <td> <td>✗ <td> <td> <td> <tr> <th>. <td> <td> <td> <td> <td> <td>✗ <td>✗ <td>✗ <td> <td> <td> <td> <tr> <th>+ <td> <td> <td> <td> <td> <td>✗ <td>✗ <td>✗ <td> <td> <td> <td> <tr> <th>/ <td> <td> <td> <td> <td> <td> <td> <td> <td> <td> <td>✗ <td> </table> </div> <h3 class="heading settled" data-level="9.1" id="serializing-anb"><span class="secno">9.1. </span><span class="content"> Serializing <var><an+b></var></span><a class="self-link" href="#serializing-anb"></a></h3> <div class="algorithm" data-algorithm="serialize an <an+b> value"> To <dfn class="dfn-paneled" data-dfn-type="dfn" data-export id="serialize-an-anb-value">serialize an <a class="production css" data-link-type="type" href="#anb-production" id="ref-for-anb-production"><an+b></a> value</dfn>, with integer values <var>A</var> and <var>B</var>: <ol> <li data-md> <p>If <var>A</var> is zero, return the serialization of <var>B</var>.</p> <li data-md> <p>Otherwise, let <var>result</var> initially be an empty <a data-link-type="dfn" href="https://infra.spec.whatwg.org/#string" id="ref-for-string④">string</a>.</p> <li data-md> <dl class="switch"> <dt data-md><var>A</var> is <code>1</code> <dd data-md> <p>Append "n" to <var>result</var>.</p> <dt data-md><var>A</var> is <code>-1</code> <dd data-md> <p>Append "-n" to <var>result</var>.</p> <dt data-md><var>A</var> is non-zero <dd data-md> <p>Serialize <var>A</var> and append it to <var>result</var>, then append "n" to <var>result</var>.</p> </dl> <li data-md> <dl class="switch"> <dt data-md><var>B</var> is greater than zero <dd data-md> <p>Append "+" to <var>result</var>, then append the serialization of <var>B</var> to <var>result</var>.</p> <dt data-md><var>B</var> is less than zero <dd data-md> <p>Append the serialization of <var>B</var> to <var>result</var>.</p> </dl> <li data-md> <p>Return <var>result</var>.</p> </ol> </div> <h2 class="heading settled" data-level="10" id="privacy"><span class="secno">10. </span><span class="content"> Privacy Considerations</span><a class="self-link" href="#privacy"></a></h2> <p>This specification introduces no new privacy concerns.</p> <h2 class="heading settled" data-level="11" id="security"><span class="secno">11. </span><span class="content"> Security Considerations</span><a class="self-link" href="#security"></a></h2> <p>This specification improves security, in that CSS parsing is now unambiguously defined for all inputs.</p> <p>Insofar as old parsers, such as whitelists/filters, parse differently from this specification, they are somewhat insecure, but the previous parsing specification left a lot of ambiguous corner cases which browsers interpreted differently, so those filters were potentially insecure already, and this specification does not worsen the situation.</p> <h2 class="non-normative heading settled" data-level="12" id="changes"><span class="secno">12. </span><span class="content"> Changes</span><a class="self-link" href="#changes"></a></h2> <p><em>This section is non-normative.</em></p> <h3 class="heading settled" data-level="12.1" id="changes-CR-20211224"><span class="secno">12.1. </span><span class="content"> Changes from the 24 December 2021 Candidate Recommendation Draft</span><a class="self-link" href="#changes-CR-20211224"></a></h3> <p>The following substantive changes were made:</p> <ul> <li data-md> <p>The definition of <a data-link-type="dfn" href="https://www.w3.org/TR/css-syntax-3/#non-ascii-code-point" id="ref-for-non-ascii-code-point">non-ASCII code point</a> was restricted to omit some potentially troublesome codepoints. (<a href="https://github.com/w3c/csswg-drafts/issues/7129">7129</a>)</p> <li data-md> <p>Defined the <code><foo()></code> and <code><@foo></code> productions. (<a href="https://github.com/w3c/csswg-drafts/issues/5728">5728</a>)</p> <li data-md> <p>Allow nested style rules. (<a href="https://github.com/w3c/csswg-drafts/issues/7961#issuecomment-1514955984">7961</a>).</p> <li data-md> <p>As part of allowing Nesting, significantly rewrote the entire parsing section. Notably, removed "parse a list of rules" and "parse a list of declarations" in favor of "parse a stylesheet’s contents" and "parse a block’s contents". Only additional normative change is that semicolons trigger slightly different error-recovery now in some contexts, so that parsing of things like <a class="css" data-link-type="maybe" href="https://drafts.csswg.org/css-conditional-3/#at-ruledef-media" id="ref-for-at-ruledef-media④">@media</a> blocks is identical whether they’re nested or not. (<a href="https://github.com/w3c/csswg-drafts/issues/8834">8834</a>).</p> <li data-md> <p>Removed the attempt at a <code><urange></code> production in terms of existing tokens, instead relying on a special re-parse from source specifically when you’re parsing the <a class="property" data-link-type="propdesc" href="https://drafts.csswg.org/css-fonts-4/#descdef-font-face-unicode-range" id="ref-for-descdef-font-face-unicode-range②">unicode-range</a> descriptor. (<a href="https://github.com/w3c/csswg-drafts/issues/8835">8835</a>)</p> <li data-md> <p>Since the above removed the main need to preserve a token’s "representation" (the original string it was parsed from), removed the rest of the references to "representation" in the An+B section and instead just recorded the few bits of information necessary for that (whether or not the number had an explicit sign).</p> <li data-md> <p>Explicitly noted that some uses (<a data-link-type="dfn" href="https://drafts.csswg.org/css-variables-2/#custom-property" id="ref-for-custom-property④">custom properties</a>, the <span class="css">unicode-range</span> descriptor) require access to the original string of a declaration’s entire value, and marked where that occurs in the parser.</p> <li data-md> <p>When <a data-link-type="dfn" href="#consume-a-blocks-contents" id="ref-for-consume-a-blocks-contents③">consuming a block’s contents</a>, rather than grouping all declarations together, regardless of where they appear relative to other rules, declarations now maintain their relative position wrt surrounding rules. It’s up to individual rules to determine what they actually do with that information.</p> </ul> <h3 class="heading settled" data-level="12.2" id="changes-CR-20190716"><span class="secno">12.2. </span><span class="content"> Changes from the 16 August 2019 Candidate Recommendation</span><a class="self-link" href="#changes-CR-20190716"></a></h3> <p>The following substantive changes were made:</p> <ul> <li data-md> <p>Added a new <a href="#parse-comma-list">§ 5.4.2 Parse a comma-separated list according to a CSS grammar</a> algorithm.</p> <li data-md> <p>Added a new "Parse a style block’s content" algorithm and a corresponding <a class="production css" data-link-type="type" href="https://www.w3.org/TR/css-syntax-3/#typedef-style-block" id="ref-for-typedef-style-block"><style-block></a> production, and defined that <a data-link-type="dfn" href="#style-rule" id="ref-for-style-rule⑨">style rules</a> use it.</p> <li data-md> <p>Aligned <a data-link-type="dfn" href="#parse-a-stylesheet" id="ref-for-parse-a-stylesheet②">parse a stylesheet</a> with the Fetch-related shenanigans. (See <a href="https://github.com/w3c/csswg-drafts/commit/64becb59fe678760608a6f2a8d6bfb3a334500c9#diff-9d409f899ee6e2cc8cd87356d0e2a0ff739c5aa9663d83f49c951c379a38f1f6">commit</a>.)</p> <blockquote> <p> To <a data-link-type="dfn" href="#parse-a-stylesheet" id="ref-for-parse-a-stylesheet③">parse a stylesheet</a> from an <var>input</var> <ins>given an optional <a data-link-type="dfn" href="https://url.spec.whatwg.org/#concept-url" id="ref-for-concept-url①">url</a> <var>location</var></ins> : </p> <ol> <li>... <li> Create a new stylesheet <ins>, with its <a data-link-type="dfn" href="https://drafts.csswg.org/cssom-1/#concept-css-style-sheet-location" id="ref-for-concept-css-style-sheet-location①">location</a> set to <var>location</var> (or null, if <var>location</var> was not passed).</ins> <li>... </ol> </blockquote> </ul> <p>The following editorial changes were made:</p> <ul> <li data-md> <p>Added <a href="#at-rules">§ 8.2 At-rules</a> to provide definitions for <a data-link-type="dfn" href="#at-rule" id="ref-for-at-rule③⓪">at-rules</a>, <a data-link-type="dfn" href="#statement-at-rule" id="ref-for-statement-at-rule①">statement at-rules</a>, <a data-link-type="dfn" href="#block-at-rule" id="ref-for-block-at-rule②">block at-rules</a>, and <a data-link-type="dfn" href="#css-descriptor" id="ref-for-css-descriptor②">descriptors</a>. (<a href="https://github.com/w3c/csswg-drafts/issues/5633">5633</a>)</p> <li data-md> <p>Improved the definition text for <a data-link-type="dfn">declaration</a>, and added definitions for <a data-link-type="dfn" href="#css-property-declarations" id="ref-for-css-property-declarations①">property declarations</a> and <a data-link-type="dfn" href="#css-descriptor-declarations" id="ref-for-css-descriptor-declarations①">descriptor declarations</a>.</p> <li data-md> <p>Switched to consistently refer to <a data-link-type="dfn" href="#ident-sequence" id="ref-for-ident-sequence⑤">ident sequence</a>, rather than sometimes using the term “name”.</p> <li data-md> <p>Explicitly named several of the pre-tokenizing processes, and explicitly referred to them in the parsing entry points (rather than relying on a blanket "do X at the start of these algorithms" statement).</p> <li data-md> <p>Added more entries to the "put a comment between them" table, to properly handle the fact that idents can now start with <code>--</code>. (<a href="https://github.com/w3c/csswg-drafts/pull/6874">6874</a>)</p> </ul> <h3 class="heading settled" data-level="12.3" id="changes-CR-20140220"><span class="secno">12.3. </span><span class="content"> Changes from the 20 February 2014 Candidate Recommendation</span><a class="self-link" href="#changes-CR-20140220"></a></h3> <p>The following substantive changes were made:</p> <ul> <li data-md> <p>Removed <a class="production css" data-link-type="type" href="#typedef-unicode-range-token" id="ref-for-typedef-unicode-range-token⑦"><unicode-range-token></a>, in favor of creating a <a class="production css" data-link-type="type" href="https://www.w3.org/TR/css-syntax-3/#typedef-urange" id="ref-for-typedef-urange"><urange></a> production.</p> <li data-md> <p>url() functions that contain a string are now parsed as normal <a class="production css" data-link-type="type" href="#typedef-function-token" id="ref-for-typedef-function-token①⓪"><function-token></a>s. url() functions that contain "raw" URLs are still specially parsed as <a class="production css" data-link-type="type" href="#typedef-url-token" id="ref-for-typedef-url-token①①"><url-token></a>s.</p> <li data-md> <p>Fixed a bug in the "Consume a URL token" algorithm, where it didn’t consume the quote character starting a string before attempting to consume the string.</p> <li data-md> <p>Fixed a bug in several of the parser algorithms related to the current/next token and things getting consumed early/late.</p> <li data-md> <p>Fix several bugs in the tokenization and parsing algorithms.</p> <li data-md> <p>Change the definition of ident-like tokens to allow "--" to start an ident. As part of this, rearrange the ordering of the clauses in the "-" step of <a data-link-type="dfn" href="#tokenizer-consume-a-token" id="ref-for-tokenizer-consume-a-token②">consume a token</a> so that <a class="production css" data-link-type="type" href="#typedef-cdc-token" id="ref-for-typedef-cdc-token③"><CDC-token></a>s are recognized as such instead of becoming a <span class="css">--</span> <a class="production css" data-link-type="type" href="#typedef-ident-token" id="ref-for-typedef-ident-token①②"><ident-token></a>.</p> <li data-md> <p>Don’t serialize the digit in an <a class="production css" data-link-type="type" href="#anb-production" id="ref-for-anb-production①"><an+b></a> when A is 1 or -1.</p> <li data-md> <p>Define all tokens to have a representation.</p> <li data-md> <p>Fixed minor bug in <a data-link-type="dfn" href="#check-if-two-code-points-are-a-valid-escape" id="ref-for-check-if-two-code-points-are-a-valid-escape⑧">check if two code points are a valid escape</a>—a <code>\</code> followed by an EOF is now correctly reported as <em>not</em> a valid escape. A final <code>\</code> in a stylesheet now just emits itself as a <a class="production css" data-link-type="type" href="#typedef-delim-token" id="ref-for-typedef-delim-token①④"><delim-token></a>.</p> <li data-md> <p>@charset is no longer a valid CSS rule (there’s just an encoding declaration that <em>looks</em> like a rule named @charset)</p> <li data-md> <p>Trimmed whitespace from the beginning/ending of a declaration’s value during parsing.</p> <li data-md> <p>Removed the Selectors-specific tokens, per WG resolution.</p> <li data-md> <p>Filtered <a data-link-type="dfn" href="https://infra.spec.whatwg.org/#surrogate" id="ref-for-surrogate③">surrogates</a> from the input stream, per WG resolution. Now the entire specification operates only on <a data-link-type="dfn" href="https://infra.spec.whatwg.org/#scalar-value" id="ref-for-scalar-value">scalar values</a>.</p> </ul> <p>The following editorial changes were made:</p> <ul> <li data-md> <p>The "Consume a string token" algorithm was changed to allow calling it without specifying an explicit ending token, so that it uses the current token instead. The three call-sites of the algorithm were changed to use that form.</p> <li data-md> <p>Minor editorial restructuring of algorithms.</p> <li data-md> <p>Added the <a data-link-type="dfn" href="#css-parse-something-according-to-a-css-grammar" id="ref-for-css-parse-something-according-to-a-css-grammar⑤">parse</a> and <a data-link-type="dfn" href="#parse-a-comma-separated-list-of-component-values" id="ref-for-parse-a-comma-separated-list-of-component-values①">parse a comma-separated list of component values</a> API entry points.</p> <li data-md> <p>Added the <a class="production css" data-link-type="type" href="#typedef-declaration-value" id="ref-for-typedef-declaration-value②"><declaration-value></a> and <a class="production css" data-link-type="type" href="#typedef-any-value" id="ref-for-typedef-any-value①"><any-value></a> productions.</p> <li data-md> <p>Removed "code point" and "surrogate code point" in favor of the identical definitions in the Infra Standard.</p> <li data-md> <p>Clarified on every range that they are inclusive.</p> <li data-md> <p>Added a column to the comment-insertion table to handle a number token appearing next to a "%" delim token.</p> </ul> <p><a href="https://github.com/w3c/csswg-drafts/milestone/5?closed=1">A Disposition of Comments is available.</a></p> <h3 class="heading settled" data-level="12.4" id="changes-WD-20131105"><span class="secno">12.4. </span><span class="content"> Changes from the 5 November 2013 Last Call Working Draft</span><a class="self-link" href="#changes-WD-20131105"></a></h3> <ul> <li> The <a href="#serialization">Serialization</a> section has been rewritten to make only the "round-trip" requirement normative, and move the details of how to achieve it into a note. Some corner cases in these details have been fixed. <li> <a data-link-type="biblio" href="#biblio-encoding" title="Encoding Standard">[ENCODING]</a> has been added to the list of normative references. It was already referenced in normative text before, just not listed as such. <li> In the algorithm to <a data-link-type="dfn" href="#determine-the-fallback-encoding" id="ref-for-determine-the-fallback-encoding②">determine the fallback encoding</a> of a stylesheet, limit the <code>@charset</code> byte sequence to 1024 bytes. This aligns with what HTML does for <code><meta charset></code> and makes sure the size of the sequence is bounded. This only makes a difference with leading or trailing whitespace in the encoding label: <pre>@charset " <em>(lots of whitespace)</em> utf-8";</pre> </ul> <h3 class="heading settled" data-level="12.5" id="changes-WD-20130919"><span class="secno">12.5. </span><span class="content"> Changes from the 19 September 2013 Working Draft</span><a class="self-link" href="#changes-WD-20130919"></a></h3> <ul> <li> The concept of <a data-link-type="dfn" href="#environment-encoding" id="ref-for-environment-encoding③">environment encoding</a> was added. The behavior does not change, but some of the definitions should be moved to the relevant specs. </ul> <h3 class="heading settled" data-level="12.6" id="changes-css21"><span class="secno">12.6. </span><span class="content"> Changes from CSS 2.1 and Selectors Level 3</span><a class="self-link" href="#changes-css21"></a></h3> <p class="note" role="note"><span class="marker">Note:</span> The point of this spec is to match reality; changes from CSS2.1 are nearly always because CSS 2.1 specified something that doesn’t match actual browser behavior, or left something unspecified. If some detail doesn’t match browsers, please let me know as it’s almost certainly unintentional.</p> <p>Changes in decoding from a byte stream:</p> <ul> <li> Only detect <a class="css" data-link-type="maybe" href="#at-ruledef-charset" id="ref-for-at-ruledef-charset⑥">@charset</a> rules in ASCII-compatible byte patterns. <li> Ignore <a class="css" data-link-type="maybe" href="#at-ruledef-charset" id="ref-for-at-ruledef-charset⑦">@charset</a> rules that specify an ASCII-incompatible encoding, as that would cause the rule itself to not decode properly. <li> Refer to <a data-link-type="biblio" href="#biblio-encoding" title="Encoding Standard">[ENCODING]</a> rather than the IANA registry for character encodings. </ul> <p>Tokenization changes:</p> <ul> <li> Any U+0000 NULL <a data-link-type="dfn" href="https://infra.spec.whatwg.org/#code-point" id="ref-for-code-point⑧⑤">code point</a> in the CSS source is replaced with U+FFFD REPLACEMENT CHARACTER. <li> Any hexadecimal escape sequence such as <span class="css">\0</span> that evaluates to zero produce U+FFFD REPLACEMENT CHARACTER rather than U+0000 NULL. <li> The definition of <a data-link-type="dfn" href="#non-ascii-ident-code-point" id="ref-for-non-ascii-ident-code-point①">non-ASCII ident code point</a> was changed to be consistent with HTML’s <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/custom-elements.html#valid-custom-element-name" id="ref-for-valid-custom-element-name①">valid custom element names</a>. <li> Tokenization does not emit COMMENT or BAD_COMMENT tokens anymore. BAD_COMMENT is now considered the same as a normal token (not an error). <a href="#serialization">Serialization</a> is responsible for inserting comments as necessary between tokens that need to be separated, e.g. two consecutive <a class="production css" data-link-type="type" href="#typedef-ident-token" id="ref-for-typedef-ident-token①③"><ident-token></a>s. <li> The <a class="production css" data-link-type="type" href="#typedef-unicode-range-token" id="ref-for-typedef-unicode-range-token⑧"><unicode-range-token></a> was removed, as it was low value and occasionally actively harmful. (<span class="css">u+a { font-weight: bold; }</span> was an invalid selector, for example...) <p>Instead, a <a class="production css" data-link-type="type" href="https://www.w3.org/TR/css-syntax-3/#typedef-urange" id="ref-for-typedef-urange①"><urange></a> production was added, based on token patterns. It is technically looser than what 2.1 allowed (any number of digits and ? characters), but not in any way that should impact its use in practice.</p> <li> Apply the <a href="https://www.w3.org/TR/CSS2/syndata.html#unexpected-eof">EOF error handling rule</a> in the tokenizer and emit normal <a class="production css" data-link-type="type" href="#typedef-string-token" id="ref-for-typedef-string-token⑧"><string-token></a> and <a class="production css" data-link-type="type" href="#typedef-url-token" id="ref-for-typedef-url-token①②"><url-token></a> rather than BAD_STRING or BAD_URI on EOF. <li> The BAD_URI token (now <a class="production css" data-link-type="type" href="#typedef-bad-url-token" id="ref-for-typedef-bad-url-token⑨"><bad-url-token></a>) is "self-contained". In other words, once the tokenizer realizes it’s in a <span class="production" id="ref-for-typedef-bad-url-token①⓪"><bad-url-token></span> rather than a <a class="production css" data-link-type="type" href="#typedef-url-token" id="ref-for-typedef-url-token①③"><url-token></a>, it just seeks forward to look for the closing ), ignoring everything else. This behavior is simpler than treating it like a <a class="production css" data-link-type="type" href="#typedef-function-token" id="ref-for-typedef-function-token①①"><function-token></a> and paying attention to opened blocks and such. Only WebKit exhibits this behavior, but it doesn’t appear that we’ve gotten any compat bugs from it. <li> The <a class="production css" data-link-type="type" href="#typedef-comma-token" id="ref-for-typedef-comma-token②"><comma-token></a> has been added. <li> <a class="production css" data-link-type="type" href="#typedef-number-token" id="ref-for-typedef-number-token⑧"><number-token></a>, <a class="production css" data-link-type="type" href="#typedef-percentage-token" id="ref-for-typedef-percentage-token④"><percentage-token></a>, and <a class="production css" data-link-type="type" href="#typedef-dimension-token" id="ref-for-typedef-dimension-token①③"><dimension-token></a> have been changed to include the preceding +/- sign as part of their value (rather than as a separate <a class="production css" data-link-type="type" href="#typedef-delim-token" id="ref-for-typedef-delim-token①⑤"><delim-token></a> that needs to be manually handled every time the token is mentioned in other specs). The only consequence of this is that comments can no longer be inserted between the sign and the number. <li> Scientific notation is supported for numbers/percentages/dimensions to match SVG, per WG resolution. <li> Hexadecimal escape for <a data-link-type="dfn" href="https://infra.spec.whatwg.org/#surrogate" id="ref-for-surrogate④">surrogate</a> now emit a replacement character rather than the surrogate. This allows implementations to safely use UTF-16 internally. </ul> <p>Parsing changes:</p> <ul> <li> Any list of declarations now also accepts at-rules, like <a class="css" data-link-type="maybe" href="https://drafts.csswg.org/css-page-3/#at-ruledef-page" id="ref-for-at-ruledef-page②">@page</a>, per WG resolution. This makes a difference in error handling even if no such at-rules are defined yet: an at-rule, valid or not, ends at a {} block without a <a class="production css" data-link-type="type" href="#typedef-semicolon-token" id="ref-for-typedef-semicolon-token⑨"><semicolon-token></a> and lets the next declaration begin. <li> The handling of some miscellaneous "special" tokens (like an unmatched <a href="#tokendef-close-curly" id="ref-for-tokendef-close-curly⑨"><}-token></a>) showing up in various places in the grammar has been specified with some reasonable behavior shown by at least one browser. Previously, stylesheets with those tokens in those places just didn’t match the stylesheet grammar at all, so their handling was totally undefined. Specifically: <ul> <li> [] blocks, () blocks and functions can now contain {} blocks, <a class="production css" data-link-type="type" href="#typedef-at-keyword-token" id="ref-for-typedef-at-keyword-token⑨"><at-keyword-token></a>s or <a class="production css" data-link-type="type" href="#typedef-semicolon-token" id="ref-for-typedef-semicolon-token①⓪"><semicolon-token></a>s <li> Qualified rule preludes can now contain semicolons <li> Qualified rule and at-rule preludes can now contain <a class="production css" data-link-type="type" href="#typedef-at-keyword-token" id="ref-for-typedef-at-keyword-token①⓪"><at-keyword-token></a>s </ul> </ul> <p><var>An+B</var> changes from Selectors Level 3 <a data-link-type="biblio" href="#biblio-select" title="Selectors Level 3">[SELECT]</a>:</p> <ul> <li> The <var>An+B</var> microsyntax has now been formally defined in terms of CSS tokens, rather than with a separate tokenizer. This has resulted in minor differences: <ul> <li> In some cases, minus signs or digits can be escaped (when they appear as part of the unit of a <a class="production css" data-link-type="type" href="#typedef-dimension-token" id="ref-for-typedef-dimension-token①④"><dimension-token></a> or <a class="production css" data-link-type="type" href="#typedef-ident-token" id="ref-for-typedef-ident-token①④"><ident-token></a>). </ul> </ul> <h2 class="no-num heading settled" id="acknowledgments"><span class="content"> Acknowledgments</span><a class="self-link" href="#acknowledgments"></a></h2> <p>Thanks for feedback and contributions from Anne van Kesteren, David Baron, Elika J. Etemad (fantasai), Henri Sivonen, Johannes Koch, 呂康豪 (Kang-Hao Lu), Marc O’Morain, Raffaello Giulietti, Simon Pieter, Tyler Karaszewski, and Zack Weinberg.</p> </main> <h2 class="no-ref no-num heading settled" id="w3c-conformance"><span class="content"> Conformance</span><a class="self-link" href="#w3c-conformance"></a></h2> <h3 class="no-ref heading settled" id="w3c-conventions"><span class="content"> Document conventions</span><a class="self-link" href="#w3c-conventions"></a></h3> <p>Conformance requirements are expressed with a combination of descriptive assertions and RFC 2119 terminology. The key words “MUST”, “MUST NOT”, “REQUIRED”, “SHALL”, “SHALL NOT”, “SHOULD”, “SHOULD NOT”, “RECOMMENDED”, “MAY”, and “OPTIONAL” in the normative parts of this document are to be interpreted as described in RFC 2119. However, for readability, these words do not appear in all uppercase letters in this specification. </p> <p>All of the text of this specification is normative except sections explicitly marked as non-normative, examples, and notes. <a data-link-type="biblio" href="#biblio-rfc2119" title="Key words for use in RFCs to Indicate Requirement Levels">[RFC2119]</a></p> <p>Examples in this specification are introduced with the words “for example” or are set apart from the normative text with <code>class="example"</code>, like this: </p> <div class="example" id="w3c-example"> <a class="self-link" href="#w3c-example"></a> <p>This is an example of an informative example.</p> </div> <p>Informative notes begin with the word “Note” and are set apart from the normative text with <code>class="note"</code>, like this: </p> <p class="note" role="note">Note, this is an informative note.</p> <p>Advisements are normative sections styled to evoke special attention and are set apart from other normative text with <code><strong class="advisement"></code>, like this: <strong class="advisement"> UAs MUST provide an accessible alternative. </strong></p> <details class="wpt-tests-block" dir="ltr" lang="en" open> <summary>Tests</summary> <p>Tests relating to the content of this specification may be documented in “Tests” blocks like this one. Any such block is non-normative.</p> <ul class="wpt-tests-list"></ul> <hr> </details> <h3 class="no-ref heading settled" id="w3c-conformance-classes"><span class="content"> Conformance classes</span><a class="self-link" href="#w3c-conformance-classes"></a></h3> <p>Conformance to this specification is defined for three conformance classes: </p> <dl> <dt>style sheet <dd>A <a href="http://www.w3.org/TR/CSS21/conform.html#style-sheet">CSS style sheet</a>. <dt>renderer <dd>A <a href="http://www.w3.org/TR/CSS21/conform.html#user-agent">UA</a> that interprets the semantics of a style sheet and renders documents that use them. <dt>authoring tool <dd>A <a href="http://www.w3.org/TR/CSS21/conform.html#user-agent">UA</a> that writes a style sheet. </dl> <p>A style sheet is conformant to this specification if all of its statements that use syntax defined in this module are valid according to the generic CSS grammar and the individual grammars of each feature defined in this module. </p> <p>A renderer is conformant to this specification if, in addition to interpreting the style sheet as defined by the appropriate specifications, it supports all the features defined by this specification by parsing them correctly and rendering the document accordingly. However, the inability of a UA to correctly render a document due to limitations of the device does not make the UA non-conformant. (For example, a UA is not required to render color on a monochrome monitor.) </p> <p>An authoring tool is conformant to this specification if it writes style sheets that are syntactically correct according to the generic CSS grammar and the individual grammars of each feature in this module, and meet all other conformance requirements of style sheets as described in this module. </p> <h3 class="no-ref heading settled" id="w3c-partial"><span class="content"> Partial implementations</span><a class="self-link" href="#w3c-partial"></a></h3> <p>So that authors can exploit the forward-compatible parsing rules to assign fallback values, CSS renderers <strong>must</strong> treat as invalid (and <a href="http://www.w3.org/TR/CSS21/conform.html#ignore">ignore as appropriate</a>) any at-rules, properties, property values, keywords, and other syntactic constructs for which they have no usable level of support. In particular, user agents <strong>must not</strong> selectively ignore unsupported component values and honor supported values in a single multi-value property declaration: if any value is considered invalid (as unsupported values must be), CSS requires that the entire declaration be ignored.</p> <h4 class="heading settled" id="w3c-conform-future-proofing"><span class="content"> Implementations of Unstable and Proprietary Features</span><a class="self-link" href="#w3c-conform-future-proofing"></a></h4> <p>To avoid clashes with future stable CSS features, the CSSWG recommends <a href="http://www.w3.org/TR/CSS/#future-proofing">following best practices</a> for the implementation of <a href="http://www.w3.org/TR/CSS/#unstable">unstable</a> features and <a href="http://www.w3.org/TR/CSS/#proprietary-extension">proprietary extensions</a> to CSS. </p> <h3 class="no-ref heading settled" id="w3c-testing"><span class="content"> Non-experimental implementations</span><a class="self-link" href="#w3c-testing"></a></h3> <p>Once a specification reaches the Candidate Recommendation stage, non-experimental implementations are possible, and implementors should release an unprefixed implementation of any CR-level feature they can demonstrate to be correctly implemented according to spec. </p> <p>To establish and maintain the interoperability of CSS across implementations, the CSS Working Group requests that non-experimental CSS renderers submit an implementation report (and, if necessary, the testcases used for that implementation report) to the W3C before releasing an unprefixed implementation of any CSS features. Testcases submitted to W3C are subject to review and correction by the CSS Working Group. </p> <p>Further information on submitting testcases and implementation reports can be found from on the CSS Working Group’s website at <a href="http://www.w3.org/Style/CSS/Test/">http://www.w3.org/Style/CSS/Test/</a>. Questions should be directed to the <a href="http://lists.w3.org/Archives/Public/public-css-testsuite">public-css-testsuite@w3.org</a> mailing list.</p> <script src="https://www.w3.org/scripts/TR/2021/fixup.js"></script> <h2 class="no-num no-ref heading settled" id="index"><span class="content">Index</span><a class="self-link" href="#index"></a></h2> <h3 class="no-num no-ref heading settled" id="index-defined-here"><span class="content">Terms defined by this specification</span><a class="self-link" href="#index-defined-here"></a></h3> <ul class="index"> <li><a href="#anb-production"><an+b></a><span>, in § 6.2</span> <li><a href="#anb">An+B</a><span>, in § 6</span> <li><a href="#typedef-any-value"><any-value></a><span>, in § 7.2</span> <li><a href="#check-if-two-code-points-are-a-valid-escape">are a valid escape</a><span>, in § 4.3.8</span> <li><a href="#typedef-at-keyword-token"><at-keyword-token></a><span>, in § 4</span> <li><a href="#at-rule">at-rule</a><span>, in § 8.2</span> <li><a href="#typedef-at-rule-list"><at-rule-list></a><span>, in § 7.1</span> <li><a href="#typedef-bad-string-token"><bad-string-token></a><span>, in § 4</span> <li><a href="#typedef-bad-url-token"><bad-url-token></a><span>, in § 4</span> <li><a href="#paren-block">()-block</a><span>, in § 5.2</span> <li><a href="#square-block">[]-block</a><span>, in § 5.2</span> <li><a href="#curly-block">{}-block</a><span>, in § 5.2</span> <li><a href="#block-at-rule">block at-rule</a><span>, in § 8.2</span> <li><a href="#typedef-block-contents"><block-contents></a><span>, in § 7.1</span> <li><a href="#typedef-cdc-token"><CDC-token></a><span>, in § 4</span> <li><a href="#typedef-cdo-token"><CDO-token></a><span>, in § 4</span> <li><a href="#at-ruledef-charset">@charset</a><span>, in § 8.3</span> <li><a href="#check-if-three-code-points-would-start-an-ident-sequence">check if three code points would start an ident sequence</a><span>, in § 4.3.9</span> <li><a href="#check-if-three-code-points-would-start-a-number">check if three code points would start a number</a><span>, in § 4.3.10</span> <li><a href="#check-if-three-code-points-would-start-a-unicode-range">check if three code points would start a unicode-range</a><span>, in § 4.3.11</span> <li><a href="#check-if-two-code-points-are-a-valid-escape">check if two code points are a valid escape</a><span>, in § 4.3.8</span> <li><a href="#typedef-colon-token"><colon-token></a><span>, in § 4</span> <li><a href="#typedef-comma-token"><comma-token></a><span>, in § 4</span> <li><a href="#component-value">component value</a><span>, in § 5.2</span> <li><a href="#consume-a-block">consume a block</a><span>, in § 5.5.4</span> <li><a href="#consume-a-blocks-contents">consume a block’s contents</a><span>, in § 5.5.5</span> <li><a href="#consume-a-component-value">consume a component value</a><span>, in § 5.5.8</span> <li><a href="#consume-a-declaration">consume a declaration</a><span>, in § 5.5.6</span> <li><a href="#consume-a-function">consume a function</a><span>, in § 5.5.10</span> <li><a href="#consume-a-list-of-component-values">consume a list of component values</a><span>, in § 5.5.7</span> <li><a href="#consume-an-at-rule">consume an at-rule</a><span>, in § 5.5.2</span> <li><a href="#consume-an-escaped-code-point">consume an escaped code point</a><span>, in § 4.3.7</span> <li><a href="#consume-an-ident-like-token">consume an ident-like token</a><span>, in § 4.3.4</span> <li><a href="#consume-an-ident-sequence">consume an ident sequence</a><span>, in § 4.3.12</span> <li><a href="#consume-a-number">consume a number</a><span>, in § 4.3.13</span> <li><a href="#consume-a-numeric-token">consume a numeric token</a><span>, in § 4.3.3</span> <li><a href="#consume-a-qualified-rule">consume a qualified rule</a><span>, in § 5.5.3</span> <li><a href="#consume-a-simple-block">consume a simple block</a><span>, in § 5.5.9</span> <li><a href="#consume-a-string-token">consume a string token</a><span>, in § 4.3.5</span> <li><a href="#consume-a-stylesheets-contents">consume a stylesheet’s contents</a><span>, in § 5.5.1</span> <li> consume a token <ul> <li><a href="#token-stream-consume-a-token">dfn for token stream</a><span>, in § 5.3</span> <li><a href="#tokenizer-consume-a-token">dfn for tokenizer</a><span>, in § 4.3.1</span> </ul> <li><a href="#consume-a-unicode-range-token">consume a unicode-range token</a><span>, in § 4.3.14</span> <li><a href="#consume-a-url-token">consume a url token</a><span>, in § 4.3.6</span> <li><a href="#consume-comments">consume comments</a><span>, in § 4.3.2</span> <li><a href="#consume-the-remnants-of-a-bad-declaration">consume the remnants of a bad declaration</a><span>, in § 5.5.6</span> <li><a href="#consume-the-remnants-of-a-bad-url">consume the remnants of a bad url</a><span>, in § 4.3.15</span> <li><a href="#consume-the-value-of-a-unicode-range-descriptor">consume the value of a unicode-range descriptor</a><span>, in § 5.5.11</span> <li><a href="#ident-sequence">CSS ident sequence</a><span>, in § 4.2</span> <li><a href="#current-input-code-point">current input code point</a><span>, in § 4.2</span> <li><a href="#typedef-dashndashdigit-ident"><dashndashdigit-ident></a><span>, in § 6.2</span> <li><a href="#declaration">declaration</a><span>, in § 5.2</span> <li><a href="#typedef-declaration-list"><declaration-list></a><span>, in § 7.1</span> <li><a href="#typedef-declaration-rule-list"><declaration-rule-list></a><span>, in § 7.1</span> <li><a href="#typedef-declaration-value"><declaration-value></a><span>, in § 7.2</span> <li><a href="#css-decode-bytes">decode bytes</a><span>, in § 3.2</span> <li><a href="#typedef-delim-token"><delim-token></a><span>, in § 4</span> <li><a href="#css-descriptor">descriptor</a><span>, in § 8.2</span> <li><a href="#css-descriptor-declarations">descriptor declarations</a><span>, in § 5.2</span> <li><a href="#determine-the-fallback-encoding">determine the fallback encoding</a><span>, in § 3.2</span> <li><a href="#digit">digit</a><span>, in § 4.2</span> <li><a href="#typedef-dimension-token"><dimension-token></a><span>, in § 4</span> <li><a href="#token-stream-discard-a-mark">discard a mark</a><span>, in § 5.3</span> <li><a href="#token-stream-discard-a-token">discard a token</a><span>, in § 5.3</span> <li><a href="#token-stream-discard-whitespace">discard whitespace</a><span>, in § 5.3</span> <li><a href="#token-stream-empty">empty</a><span>, in § 5.3</span> <li><a href="#environment-encoding">environment encoding</a><span>, in § 3.2</span> <li><a href="#eof-code-point">EOF code point</a><span>, in § 4.2</span> <li><a href="#typedef-eof-token"><eof-token></a><span>, in § 5.3</span> <li><a href="#escape-codepoint">escaping</a><span>, in § 2.1</span> <li><a href="#css-filter-code-points">filter code points</a><span>, in § 3.3</span> <li><a href="#css-filter-code-points">filtered code points</a><span>, in § 3.3</span> <li><a href="#function">function</a><span>, in § 5.2</span> <li><a href="#typedef-function-token"><function-token></a><span>, in § 4</span> <li><a href="#typedef-hash-token"><hash-token></a><span>, in § 4</span> <li><a href="#hex-digit">hex digit</a><span>, in § 4.2</span> <li><a href="#ident-code-point">ident code point</a><span>, in § 4.2</span> <li><a href="#ident-sequence">ident sequence</a><span>, in § 4.2</span> <li><a href="#ident-start-code-point">ident-start code point</a><span>, in § 4.2</span> <li><a href="#typedef-ident-token"><ident-token></a><span>, in § 4</span> <li><a href="#css-ignored">ignored</a><span>, in § 2.2</span> <li><a href="#token-stream-index">index</a><span>, in § 5.3</span> <li><a href="#input-stream">input stream</a><span>, in § 3.3</span> <li><a href="#typedef-integer"><integer></a><span>, in § 6.2</span> <li><a href="#css-invalid">invalid</a><span>, in § 2.2</span> <li><a href="#invalid-rule-error">invalid rule error</a><span>, in § 5.5.3</span> <li><a href="#letter">letter</a><span>, in § 4.2</span> <li><a href="#lowercase-letter">lowercase letter</a><span>, in § 4.2</span> <li><a href="#token-stream-mark">mark</a><span>, in § 5.3</span> <li><a href="#token-stream-marked-indexes">marked indexes</a><span>, in § 5.3</span> <li><a href="#maximum-allowed-code-point">maximum allowed code point</a><span>, in § 4.2</span> <li><a href="#ident-start-code-point">name-start code point</a><span>, in § 4.2</span> <li><a href="#typedef-ndashdigit-dimension"><ndashdigit-dimension></a><span>, in § 6.2</span> <li><a href="#typedef-ndashdigit-ident"><ndashdigit-ident></a><span>, in § 6.2</span> <li><a href="#typedef-ndash-dimension"><ndash-dimension></a><span>, in § 6.2</span> <li><a href="#typedef-n-dimension"><n-dimension></a><span>, in § 6.2</span> <li><a href="#newline">newline</a><span>, in § 4.2</span> <li><a href="#next-input-code-point">next input code point</a><span>, in § 4.2</span> <li><a href="#token-stream-next-token">next token</a><span>, in § 5.3</span> <li><a href="#non-ascii-ident-code-point">non-ASCII ident code point</a><span>, in § 4.2</span> <li><a href="#non-printable-code-point">non-printable code point</a><span>, in § 4.2</span> <li><a href="#normalize-into-a-token-stream">normalize</a><span>, in § 5.4</span> <li><a href="#normalize-into-a-token-stream">normalize into a token stream</a><span>, in § 5.4</span> <li><a href="#typedef-number-token"><number-token></a><span>, in § 4</span> <li><a href="#css-parse-something-according-to-a-css-grammar">parse</a><span>, in § 5.4.1</span> <li><a href="#parse-a-blocks-contents">parse a block’s contents</a><span>, in § 5.4.5</span> <li><a href="#css-parse-a-comma-separated-list-according-to-a-css-grammar">parse a comma-separated list according to a CSS grammar</a><span>, in § 5.4.2</span> <li><a href="#parse-a-comma-separated-list-of-component-values">parse a comma-separated list of component values</a><span>, in § 5.4.10</span> <li><a href="#parse-a-component-value">parse a component value</a><span>, in § 5.4.8</span> <li><a href="#parse-a-css-stylesheet">parse a CSS stylesheet</a><span>, in § 8</span> <li><a href="#parse-a-declaration">parse a declaration</a><span>, in § 5.4.7</span> <li><a href="#css-parse-a-comma-separated-list-according-to-a-css-grammar">parse a list</a><span>, in § 5.4.2</span> <li><a href="#parse-a-list-of-component-values">parse a list of component values</a><span>, in § 5.4.9</span> <li><a href="#parse-a-rule">parse a rule</a><span>, in § 5.4.6</span> <li><a href="#parse-a-stylesheet">parse a stylesheet</a><span>, in § 5.4.3</span> <li><a href="#parse-a-stylesheets-contents">parse a stylesheet’s contents</a><span>, in § 5.4.4</span> <li><a href="#parse-error">parse error</a><span>, in § 3</span> <li><a href="#css-parse-something-according-to-a-css-grammar">parse something according to a CSS grammar</a><span>, in § 5.4.1</span> <li><a href="#typedef-percentage-token"><percentage-token></a><span>, in § 4</span> <li><a href="#preserved-tokens">preserved tokens</a><span>, in § 5.2</span> <li><a href="#token-stream-process">process</a><span>, in § 5.3</span> <li><a href="#css-property-declarations">property declarations</a><span>, in § 5.2</span> <li><a href="#qualified-rule">qualified rule</a><span>, in § 5.2</span> <li><a href="#typedef-qualified-rule-list"><qualified-rule-list></a><span>, in § 7.1</span> <li><a href="#reconsume-the-current-input-code-point">reconsume the current input code point</a><span>, in § 4.2</span> <li><a href="#token-stream-restore-a-mark">restore a mark</a><span>, in § 5.3</span> <li><a href="#css-rule">rule</a><span>, in § 5.2</span> <li><a href="#typedef-rule-list"><rule-list></a><span>, in § 7.1</span> <li><a href="#typedef-semicolon-token"><semicolon-token></a><span>, in § 4</span> <li><a href="#serialize-an-anb-value">serialize an <an+b> value</a><span>, in § 9.1</span> <li><a href="#typedef-signed-integer"><signed-integer></a><span>, in § 6.2</span> <li><a href="#typedef-signless-integer"><signless-integer></a><span>, in § 6.2</span> <li><a href="#simple-block">simple block</a><span>, in § 5.2</span> <li><a href="#check-if-three-code-points-would-start-an-ident-sequence">starts with an ident sequence</a><span>, in § 4.3.9</span> <li><a href="#check-if-three-code-points-would-start-a-number">starts with a number</a><span>, in § 4.3.10</span> <li><a href="#check-if-two-code-points-are-a-valid-escape">starts with a valid escape</a><span>, in § 4.3.8</span> <li><a href="#check-if-three-code-points-would-start-an-ident-sequence">start with an ident sequence</a><span>, in § 4.3.9</span> <li><a href="#check-if-three-code-points-would-start-a-number">start with a number</a><span>, in § 4.3.10</span> <li><a href="#statement-at-rule">statement at-rule</a><span>, in § 8.2</span> <li><a href="#typedef-string-token"><string-token></a><span>, in § 4</span> <li><a href="#style-rule">style rule</a><span>, in § 8.1</span> <li><a href="#css-stylesheet">stylesheet</a><span>, in § 5.2</span> <li><a href="#tokendef-open-paren"><(-token></a><span>, in § 4</span> <li><a href="#tokendef-close-paren"><)-token></a><span>, in § 4</span> <li><a href="#tokendef-open-square"><[-token></a><span>, in § 4</span> <li><a href="#tokendef-close-square"><]-token></a><span>, in § 4</span> <li><a href="#tokendef-open-curly"><{-token></a><span>, in § 4</span> <li><a href="#tokendef-close-curly"><}-token></a><span>, in § 4</span> <li><a href="#css-tokenize">tokenization</a><span>, in § 4</span> <li><a href="#css-tokenize">tokenize</a><span>, in § 4</span> <li><a href="#token-stream-tokens">tokens</a><span>, in § 5.3</span> <li><a href="#css-token-stream">token stream</a><span>, in § 5.3</span> <li><a href="#typedef-unicode-range-token"><unicode-range-token></a><span>, in § 4</span> <li><a href="#uppercase-letter">uppercase letter</a><span>, in § 4.2</span> <li><a href="#typedef-url-token"><url-token></a><span>, in § 4</span> <li><a href="#whitespace">whitespace</a><span>, in § 4.2</span> <li><a href="#typedef-whitespace-token"><whitespace-token></a><span>, in § 4</span> <li><a href="#check-if-three-code-points-would-start-an-ident-sequence">would start an ident sequence</a><span>, in § 4.3.9</span> <li><a href="#check-if-three-code-points-would-start-a-number">would start a number</a><span>, in § 4.3.10</span> <li><a href="#check-if-three-code-points-would-start-a-unicode-range">would start a unicode-range</a><span>, in § 4.3.11</span> </ul> <h3 class="no-num no-ref heading settled" id="index-defined-elsewhere"><span class="content">Terms defined by reference</span><a class="self-link" href="#index-defined-elsewhere"></a></h3> <ul class="index"> <li> <a data-link-type="biblio">[CSS-CASCADE-5]</a> defines the following terms: <ul> <li><span class="dfn-paneled" id="4e55d7fb">@import</span> <li><span class="dfn-paneled" id="2edd539e">property</span> </ul> <li> <a data-link-type="biblio">[CSS-COLOR-4]</a> defines the following terms: <ul> <li><span class="dfn-paneled" id="f17eedd8">blue</span> <li><span class="dfn-paneled" id="73ea1d43">color</span> </ul> <li> <a data-link-type="biblio">[CSS-COLOR-5]</a> defines the following terms: <ul> <li><span class="dfn-paneled" id="1548047a"><color></span> </ul> <li> <a data-link-type="biblio">[CSS-COUNTER-STYLES-3]</a> defines the following terms: <ul> <li><span class="dfn-paneled" id="b1b99838">counter style</span> </ul> <li> <a data-link-type="biblio">[CSS-FONTS-4]</a> defines the following terms: <ul> <li><span class="dfn-paneled" id="2c57f900">font</span> <li><span class="dfn-paneled" id="dea91031">unicode-range</span> </ul> <li> <a data-link-type="biblio">[CSS-FONTS-5]</a> defines the following terms: <ul> <li><span class="dfn-paneled" id="0497de86">@font-face</span> </ul> <li> <a data-link-type="biblio">[CSS-NESTING-1]</a> defines the following terms: <ul> <li><span class="dfn-paneled" id="cccedd30">CSSNestedDeclarations</span> <li><span class="dfn-paneled" id="f8cc2828">nested declarations rule</span> </ul> <li> <a data-link-type="biblio">[CSS-PAGE-3]</a> defines the following terms: <ul> <li><span class="dfn-paneled" id="0d25dea6">:left</span> <li><span class="dfn-paneled" id="5ee7eb9e">@page</span> </ul> <li> <a data-link-type="biblio">[CSS-SYNTAX-3]</a> defines the following terms: <ul> <li><span class="dfn-paneled" id="a015dd4d"><style-block></span> <li><span class="dfn-paneled" id="6524d004"><urange></span> <li><span class="dfn-paneled" id="38314b9f">non-ASCII code point</span> <li><span class="dfn-paneled" id="69aefbfb">parse a list of declarations</span> </ul> <li> <a data-link-type="biblio">[CSS-TEXT-DECOR-3]</a> defines the following terms: <ul> <li><span class="dfn-paneled" id="ffc192db">text-decoration</span> </ul> <li> <a data-link-type="biblio">[CSS-TEXT-DECOR-4]</a> defines the following terms: <ul> <li><span class="dfn-paneled" id="a83be41c">underline</span> </ul> <li> <a data-link-type="biblio">[CSS-TRANSFORMS-1]</a> defines the following terms: <ul> <li><span class="dfn-paneled" id="0f401002">translateX()</span> </ul> <li> <a data-link-type="biblio">[CSS-TYPED-OM-1]</a> defines the following terms: <ul> <li><span class="dfn-paneled" id="88d7e451">custom property name string</span> </ul> <li> <a data-link-type="biblio">[CSS-VALUES-4]</a> defines the following terms: <ul> <li><span class="dfn-paneled" id="bedd9d42">+</span> <li><span class="dfn-paneled" id="977d3003"><string></span> <li><span class="dfn-paneled" id="537cf076">?</span> <li><span class="dfn-paneled" id="5a2f7ea1">url()</span> <li><span class="dfn-paneled" id="6ec67710">|</span> </ul> <li> <a data-link-type="biblio">[CSS-VALUES-5]</a> defines the following terms: <ul> <li><span class="dfn-paneled" id="57699934">attr()</span> </ul> <li> <a data-link-type="biblio">[CSS-VARIABLES-2]</a> defines the following terms: <ul> <li><span class="dfn-paneled" id="198f1537">custom property</span> <li><span class="dfn-paneled" id="dbba942a">var()</span> </ul> <li> <a data-link-type="biblio">[CSS3-ANIMATIONS]</a> defines the following terms: <ul> <li><span class="dfn-paneled" id="c5c89fde"><keyframe-selector></span> <li><span class="dfn-paneled" id="fa19c68e">@keyframes</span> <li><span class="dfn-paneled" id="c16b1855">animation-timing-function</span> </ul> <li> <a data-link-type="biblio">[CSS3-CONDITIONAL]</a> defines the following terms: <ul> <li><span class="dfn-paneled" id="5f1b7f60">@media</span> <li><span class="dfn-paneled" id="c1ebc639">@supports</span> <li><span class="dfn-paneled" id="bf3ca8a7">conditional group rule</span> </ul> <li> <a data-link-type="biblio">[CSSOM]</a> defines the following terms: <ul> <li><span class="dfn-paneled" id="a82a20ef">CSSStyleDeclaration</span> <li><span class="dfn-paneled" id="b13bfb39">cssText</span> <li><span class="dfn-paneled" id="2c476514">insertRule(rule)</span> <li><span class="dfn-paneled" id="bbc31c9d">location</span> <li><span class="dfn-paneled" id="da406a25">replace(text)</span> </ul> <li> <a data-link-type="biblio">[ENCODING]</a> defines the following terms: <ul> <li><span class="dfn-paneled" id="58b7ba18">decode</span> <li><span class="dfn-paneled" id="4fdfba4e">get an encoding</span> </ul> <li> <a data-link-type="biblio">[HTML]</a> defines the following terms: <ul> <li><span class="dfn-paneled" id="68bf3d31">a</span> <li><span class="dfn-paneled" id="b80d76a2">p</span> <li><span class="dfn-paneled" id="0cf3964f">script</span> <li><span class="dfn-paneled" id="1d1029cb">sizes</span> <li><span class="dfn-paneled" id="ba920583">style</span> <li><span class="dfn-paneled" id="15c9cf79">valid custom element name</span> </ul> <li> <a data-link-type="biblio">[INFRA]</a> defines the following terms: <ul> <li><span class="dfn-paneled" id="7f9469b5">ASCII case-insensitive</span> <li><span class="dfn-paneled" id="915aff5e">code point</span> <li><span class="dfn-paneled" id="16d07e10">for each</span> <li><span class="dfn-paneled" id="c88f3887">item</span> <li><span class="dfn-paneled" id="649608b9">list</span> <li><span class="dfn-paneled" id="fca74142">pop</span> <li><span class="dfn-paneled" id="99c988d6">remove</span> <li><span class="dfn-paneled" id="ecf251b4">scalar value</span> <li><span class="dfn-paneled" id="ceacaa1c">stack</span> <li><span class="dfn-paneled" id="0698d556">string</span> <li><span class="dfn-paneled" id="984221ca">struct</span> <li><span class="dfn-paneled" id="a3fb968a">surrogate</span> </ul> <li> <a data-link-type="biblio">[MEDIAQUERIES-5]</a> defines the following terms: <ul> <li><span class="dfn-paneled" id="c4f8137c"><general-enclosed></span> </ul> <li> <a data-link-type="biblio">[SELECTORS-4]</a> defines the following terms: <ul> <li><span class="dfn-paneled" id="eb0095fe">+</span> <li><span class="dfn-paneled" id="9d795fd1">:nth-child()</span> <li><span class="dfn-paneled" id="71aed09f"><selector-list></span> <li><span class="dfn-paneled" id="069e89f6">selector list</span> </ul> <li> <a data-link-type="biblio">[URL]</a> defines the following terms: <ul> <li><span class="dfn-paneled" id="dcffbccd">URL</span> </ul> </ul> <h2 class="no-num no-ref heading settled" id="references"><span class="content">References</span><a class="self-link" href="#references"></a></h2> <h3 class="no-num no-ref heading settled" id="normative"><span class="content">Normative References</span><a class="self-link" href="#normative"></a></h3> <dl> <dt id="biblio-css-cascade-3">[CSS-CASCADE-3] <dd>Elika Etemad; Tab Atkins Jr.. <a href="https://drafts.csswg.org/css-cascade-3/"><cite>CSS Cascading and Inheritance Level 3</cite></a>. URL: <a href="https://drafts.csswg.org/css-cascade-3/">https://drafts.csswg.org/css-cascade-3/</a> <dt id="biblio-css-cascade-5">[CSS-CASCADE-5] <dd>Elika Etemad; Miriam Suzanne; Tab Atkins Jr.. <a href="https://drafts.csswg.org/css-cascade-5/"><cite>CSS Cascading and Inheritance Level 5</cite></a>. URL: <a href="https://drafts.csswg.org/css-cascade-5/">https://drafts.csswg.org/css-cascade-5/</a> <dt id="biblio-css-counter-styles-3">[CSS-COUNTER-STYLES-3] <dd>Tab Atkins Jr.. <a href="https://drafts.csswg.org/css-counter-styles/"><cite>CSS Counter Styles Level 3</cite></a>. URL: <a href="https://drafts.csswg.org/css-counter-styles/">https://drafts.csswg.org/css-counter-styles/</a> <dt id="biblio-css-fonts-4">[CSS-FONTS-4] <dd>Chris Lilley. <a href="https://drafts.csswg.org/css-fonts-4/"><cite>CSS Fonts Module Level 4</cite></a>. URL: <a href="https://drafts.csswg.org/css-fonts-4/">https://drafts.csswg.org/css-fonts-4/</a> <dt id="biblio-css-nesting-1">[CSS-NESTING-1] <dd>Tab Atkins Jr.; Adam Argyle. <a href="https://drafts.csswg.org/css-nesting/"><cite>CSS Nesting Module</cite></a>. URL: <a href="https://drafts.csswg.org/css-nesting/">https://drafts.csswg.org/css-nesting/</a> <dt id="biblio-css-page-3">[CSS-PAGE-3] <dd>Elika Etemad. <a href="https://drafts.csswg.org/css-page-3/"><cite>CSS Paged Media Module Level 3</cite></a>. URL: <a href="https://drafts.csswg.org/css-page-3/">https://drafts.csswg.org/css-page-3/</a> <dt id="biblio-css-syntax-3">[CSS-SYNTAX-3] <dd>Tab Atkins Jr.; Simon Sapin. <a href="https://drafts.csswg.org/css-syntax/"><cite>CSS Syntax Module Level 3</cite></a>. URL: <a href="https://drafts.csswg.org/css-syntax/">https://drafts.csswg.org/css-syntax/</a> <dt id="biblio-css-typed-om-1">[CSS-TYPED-OM-1] <dd>Tab Atkins Jr.; François Remy. <a href="https://drafts.css-houdini.org/css-typed-om-1/"><cite>CSS Typed OM Level 1</cite></a>. URL: <a href="https://drafts.css-houdini.org/css-typed-om-1/">https://drafts.css-houdini.org/css-typed-om-1/</a> <dt id="biblio-css-values-4">[CSS-VALUES-4] <dd>Tab Atkins Jr.; Elika Etemad. <a href="https://drafts.csswg.org/css-values-4/"><cite>CSS Values and Units Module Level 4</cite></a>. URL: <a href="https://drafts.csswg.org/css-values-4/">https://drafts.csswg.org/css-values-4/</a> <dt id="biblio-css-variables-2">[CSS-VARIABLES-2] <dd><a href="https://drafts.csswg.org/css-variables-2/"><cite>CSS Custom Properties for Cascading Variables Module Level 2</cite></a>. Editor's Draft. URL: <a href="https://drafts.csswg.org/css-variables-2/">https://drafts.csswg.org/css-variables-2/</a> <dt id="biblio-css3-conditional">[CSS3-CONDITIONAL] <dd>Chris Lilley; David Baron; Elika Etemad. <a href="https://drafts.csswg.org/css-conditional-3/"><cite>CSS Conditional Rules Module Level 3</cite></a>. URL: <a href="https://drafts.csswg.org/css-conditional-3/">https://drafts.csswg.org/css-conditional-3/</a> <dt id="biblio-cssom">[CSSOM] <dd>Daniel Glazman; Emilio Cobos Álvarez. <a href="https://drafts.csswg.org/cssom/"><cite>CSS Object Model (CSSOM)</cite></a>. URL: <a href="https://drafts.csswg.org/cssom/">https://drafts.csswg.org/cssom/</a> <dt id="biblio-encoding">[ENCODING] <dd>Anne van Kesteren. <a href="https://encoding.spec.whatwg.org/"><cite>Encoding Standard</cite></a>. Living Standard. URL: <a href="https://encoding.spec.whatwg.org/">https://encoding.spec.whatwg.org/</a> <dt id="biblio-html">[HTML] <dd>Anne van Kesteren; et al. <a href="https://html.spec.whatwg.org/multipage/"><cite>HTML Standard</cite></a>. Living Standard. URL: <a href="https://html.spec.whatwg.org/multipage/">https://html.spec.whatwg.org/multipage/</a> <dt id="biblio-infra">[INFRA] <dd>Anne van Kesteren; Domenic Denicola. <a href="https://infra.spec.whatwg.org/"><cite>Infra Standard</cite></a>. Living Standard. URL: <a href="https://infra.spec.whatwg.org/">https://infra.spec.whatwg.org/</a> <dt id="biblio-rfc2119">[RFC2119] <dd>S. Bradner. <a href="https://datatracker.ietf.org/doc/html/rfc2119"><cite>Key words for use in RFCs to Indicate Requirement Levels</cite></a>. March 1997. Best Current Practice. URL: <a href="https://datatracker.ietf.org/doc/html/rfc2119">https://datatracker.ietf.org/doc/html/rfc2119</a> <dt id="biblio-selectors-4">[SELECTORS-4] <dd>Elika Etemad; Tab Atkins Jr.. <a href="https://drafts.csswg.org/selectors/"><cite>Selectors Level 4</cite></a>. URL: <a href="https://drafts.csswg.org/selectors/">https://drafts.csswg.org/selectors/</a> <dt id="biblio-url">[URL] <dd>Anne van Kesteren. <a href="https://url.spec.whatwg.org/"><cite>URL Standard</cite></a>. Living Standard. URL: <a href="https://url.spec.whatwg.org/">https://url.spec.whatwg.org/</a> </dl> <h3 class="no-num no-ref heading settled" id="informative"><span class="content">Informative References</span><a class="self-link" href="#informative"></a></h3> <dl> <dt id="biblio-css-color-4">[CSS-COLOR-4] <dd>Chris Lilley; Tab Atkins Jr.; Lea Verou. <a href="https://drafts.csswg.org/css-color-4/"><cite>CSS Color Module Level 4</cite></a>. URL: <a href="https://drafts.csswg.org/css-color-4/">https://drafts.csswg.org/css-color-4/</a> <dt id="biblio-css-color-5">[CSS-COLOR-5] <dd>Chris Lilley; et al. <a href="https://drafts.csswg.org/css-color-5/"><cite>CSS Color Module Level 5</cite></a>. URL: <a href="https://drafts.csswg.org/css-color-5/">https://drafts.csswg.org/css-color-5/</a> <dt id="biblio-css-fonts-5">[CSS-FONTS-5] <dd>Chris Lilley. <a href="https://drafts.csswg.org/css-fonts-5/"><cite>CSS Fonts Module Level 5</cite></a>. URL: <a href="https://drafts.csswg.org/css-fonts-5/">https://drafts.csswg.org/css-fonts-5/</a> <dt id="biblio-css-namespaces-3">[CSS-NAMESPACES-3] <dd>Elika Etemad. <a href="https://drafts.csswg.org/css-namespaces/"><cite>CSS Namespaces Module Level 3</cite></a>. URL: <a href="https://drafts.csswg.org/css-namespaces/">https://drafts.csswg.org/css-namespaces/</a> <dt id="biblio-css-text-decor-3">[CSS-TEXT-DECOR-3] <dd>Elika Etemad; Koji Ishii. <a href="https://drafts.csswg.org/css-text-decor-3/"><cite>CSS Text Decoration Module Level 3</cite></a>. URL: <a href="https://drafts.csswg.org/css-text-decor-3/">https://drafts.csswg.org/css-text-decor-3/</a> <dt id="biblio-css-text-decor-4">[CSS-TEXT-DECOR-4] <dd>Elika Etemad; Koji Ishii. <a href="https://drafts.csswg.org/css-text-decor-4/"><cite>CSS Text Decoration Module Level 4</cite></a>. URL: <a href="https://drafts.csswg.org/css-text-decor-4/">https://drafts.csswg.org/css-text-decor-4/</a> <dt id="biblio-css-transforms-1">[CSS-TRANSFORMS-1] <dd>Simon Fraser; et al. <a href="https://drafts.csswg.org/css-transforms/"><cite>CSS Transforms Module Level 1</cite></a>. URL: <a href="https://drafts.csswg.org/css-transforms/">https://drafts.csswg.org/css-transforms/</a> <dt id="biblio-css-values-5">[CSS-VALUES-5] <dd>Tab Atkins Jr.; Elika Etemad; Miriam Suzanne. <a href="https://drafts.csswg.org/css-values-5/"><cite>CSS Values and Units Module Level 5</cite></a>. URL: <a href="https://drafts.csswg.org/css-values-5/">https://drafts.csswg.org/css-values-5/</a> <dt id="biblio-css-variables">[CSS-VARIABLES] <dd>Tab Atkins Jr.. <a href="https://drafts.csswg.org/css-variables/"><cite>CSS Custom Properties for Cascading Variables Module Level 1</cite></a>. URL: <a href="https://drafts.csswg.org/css-variables/">https://drafts.csswg.org/css-variables/</a> <dt id="biblio-css2">[CSS2] <dd>Bert Bos; et al. <a href="https://drafts.csswg.org/css2/"><cite>Cascading Style Sheets Level 2 Revision 1 (CSS 2.1) Specification</cite></a>. URL: <a href="https://drafts.csswg.org/css2/">https://drafts.csswg.org/css2/</a> <dt id="biblio-css3-animations">[CSS3-ANIMATIONS] <dd>David Baron; et al. <a href="https://drafts.csswg.org/css-animations/"><cite>CSS Animations Level 1</cite></a>. URL: <a href="https://drafts.csswg.org/css-animations/">https://drafts.csswg.org/css-animations/</a> <dt id="biblio-mediaq">[MEDIAQ] <dd>Florian Rivoal; Tab Atkins Jr.. <a href="https://drafts.csswg.org/mediaqueries-4/"><cite>Media Queries Level 4</cite></a>. URL: <a href="https://drafts.csswg.org/mediaqueries-4/">https://drafts.csswg.org/mediaqueries-4/</a> <dt id="biblio-mediaqueries-5">[MEDIAQUERIES-5] <dd>Dean Jackson; et al. <a href="https://drafts.csswg.org/mediaqueries-5/"><cite>Media Queries Level 5</cite></a>. URL: <a href="https://drafts.csswg.org/mediaqueries-5/">https://drafts.csswg.org/mediaqueries-5/</a> <dt id="biblio-select">[SELECT] <dd>Tantek Çelik; et al. <a href="https://drafts.csswg.org/selectors-3/"><cite>Selectors Level 3</cite></a>. URL: <a href="https://drafts.csswg.org/selectors-3/">https://drafts.csswg.org/selectors-3/</a> </dl> <script>/* Boilerplate: script-dom-helper */ "use strict"; function query(sel) { return document.querySelector(sel); } function queryAll(sel) { return [...document.querySelectorAll(sel)]; } function iter(obj) { if(!obj) return []; var it = obj[Symbol.iterator]; if(it) return it; return Object.entries(obj); } function mk(tagname, attrs, ...children) { const el = document.createElement(tagname); for(const [k,v] of iter(attrs)) { if(k.slice(0,3) == "_on") { const eventName = k.slice(3); el.addEventListener(eventName, v); } else if(k[0] == "_") { // property, not attribute el[k.slice(1)] = v; } else { if(v === false || v == null) { continue; } else if(v === true) { el.setAttribute(k, ""); continue; } else { el.setAttribute(k, v); } } } append(el, children); return el; } /* Create shortcuts for every known HTML element */ [ "a", "abbr", "acronym", "address", "applet", "area", "article", "aside", "audio", "b", "base", "basefont", "bdo", "big", "blockquote", "body", "br", "button", "canvas", "caption", "center", "cite", "code", "col", "colgroup", "datalist", "dd", "del", "details", "dfn", "dialog", "div", "dl", "dt", "em", "embed", "fieldset", "figcaption", "figure", "font", "footer", "form", "frame", "frameset", "head", "header", "h1", "h2", "h3", "h4", "h5", "h6", "hr", "html", "i", "iframe", "img", "input", "ins", "kbd", "label", "legend", "li", "link", "main", "map", "mark", "meta", "meter", "nav", "nobr", "noscript", "object", "ol", "optgroup", "option", "output", "p", "param", "pre", "progress", "q", "s", "samp", "script", "section", "select", "small", "source", "span", "strike", "strong", "style", "sub", "summary", "sup", "table", "tbody", "td", "template", "textarea", "tfoot", "th", "thead", "time", "title", "tr", "u", "ul", "var", "video", "wbr", "xmp", ].forEach(tagname=>{ mk[tagname] = (...args) => mk(tagname, ...args); }); function* nodesFromChildList(children) { for(const child of children.flat(Infinity)) { if(child instanceof Node) { yield child; } else { yield new Text(child); } } } function append(el, ...children) { for(const child of nodesFromChildList(children)) { if(el instanceof Node) el.appendChild(child); else el.push(child); } return el; } function insertAfter(el, ...children) { for(const child of nodesFromChildList(children)) { el.parentNode.insertBefore(child, el.nextSibling); } return el; } function clearContents(el) { el.innerHTML = ""; return el; } function parseHTML(markup) { if(markup.toLowerCase().trim().indexOf('<!doctype') === 0) { const doc = document.implementation.createHTMLDocument(""); doc.documentElement.innerHTML = markup; return doc; } else { const el = mk.template({}); el.innerHTML = markup; return el.content; } }</script> <script>/* Boilerplate: script-dfn-panel */ "use strict"; { let dfnPanelData = { "0497de86": {"dfnID":"0497de86","dfnText":"@font-face","external":true,"refSections":[{"refs":[{"id":"ref-for-at-font-face-rule"},{"id":"ref-for-at-font-face-rule\u2460"},{"id":"ref-for-at-font-face-rule\u2461"}],"title":"7.1. \nDefining Block Contents: the <block-contents>, <declaration-list>, <qualified-rule-list>, <declaration-rule-list>, and <rule-list> productions"}],"url":"https://drafts.csswg.org/css-fonts-5/#at-font-face-rule"}, "0698d556": {"dfnID":"0698d556","dfnText":"string","external":true,"refSections":[{"refs":[{"id":"ref-for-string"},{"id":"ref-for-string\u2460"},{"id":"ref-for-string\u2461"}],"title":"5.2. \nCSS Parsing Results"},{"refs":[{"id":"ref-for-string\u2462"}],"title":"5.4. \nParser Entry Points"},{"refs":[{"id":"ref-for-string\u2463"}],"title":"9.1. \nSerializing <an+b>"}],"url":"https://infra.spec.whatwg.org/#string"}, "069e89f6": {"dfnID":"069e89f6","dfnText":"selector list","external":true,"refSections":[{"refs":[{"id":"ref-for-selector-list"}],"title":"8.1. \nStyle rules"}],"url":"https://drafts.csswg.org/selectors-4/#selector-list"}, "0cf3964f": {"dfnID":"0cf3964f","dfnText":"script","external":true,"refSections":[{"refs":[{"id":"ref-for-script"}],"title":"5.5.1. \nConsume a stylesheet\u2019s contents"}],"url":"https://html.spec.whatwg.org/multipage/scripting.html#script"}, "0d25dea6": {"dfnID":"0d25dea6","dfnText":":left","external":true,"refSections":[{"refs":[{"id":"ref-for-valdef-page-left"}],"title":"2. \nDescription of CSS\u2019s Syntax"}],"url":"https://drafts.csswg.org/css-page-3/#valdef-page-left"}, "0f401002": {"dfnID":"0f401002","dfnText":"translateX()","external":true,"refSections":[{"refs":[{"id":"ref-for-funcdef-transform-translatex"}],"title":"2.2. \nError Handling"}],"url":"https://drafts.csswg.org/css-transforms-1/#funcdef-transform-translatex"}, "1548047a": {"dfnID":"1548047a","dfnText":"<color>","external":true,"refSections":[{"refs":[{"id":"ref-for-typedef-color"}],"title":"5.4.1. \nParse something according to a CSS grammar"}],"url":"https://drafts.csswg.org/css-color-5/#typedef-color"}, "15c9cf79": {"dfnID":"15c9cf79","dfnText":"valid custom element name","external":true,"refSections":[{"refs":[{"id":"ref-for-valid-custom-element-name"}],"title":"4.2. \nDefinitions"},{"refs":[{"id":"ref-for-valid-custom-element-name\u2460"}],"title":"12.6. \nChanges from CSS 2.1 and Selectors Level 3"}],"url":"https://html.spec.whatwg.org/multipage/custom-elements.html#valid-custom-element-name"}, "16d07e10": {"dfnID":"16d07e10","dfnText":"for each","external":true,"refSections":[{"refs":[{"id":"ref-for-list-iterate"}],"title":"5.4.2. \nParse a comma-separated list according to a CSS grammar"}],"url":"https://infra.spec.whatwg.org/#list-iterate"}, "198f1537": {"dfnID":"198f1537","dfnText":"custom property","external":true,"refSections":[{"refs":[{"id":"ref-for-custom-property"},{"id":"ref-for-custom-property\u2460"},{"id":"ref-for-custom-property\u2461"}],"title":"5.5.3. \nConsume a qualified rule"},{"refs":[{"id":"ref-for-custom-property\u2462"}],"title":"7.2. \nDefining Arbitrary Contents: the <declaration-value> and <any-value> productions"},{"refs":[{"id":"ref-for-custom-property\u2463"}],"title":"12.1. \nChanges from the 24 December 2021 Candidate Recommendation Draft"}],"url":"https://drafts.csswg.org/css-variables-2/#custom-property"}, "1d1029cb": {"dfnID":"1d1029cb","dfnText":"sizes","external":true,"refSections":[{"refs":[{"id":"ref-for-attr-img-sizes"}],"title":"5.4.2. \nParse a comma-separated list according to a CSS grammar"}],"url":"https://html.spec.whatwg.org/multipage/embedded-content.html#attr-img-sizes"}, "2c476514": {"dfnID":"2c476514","dfnText":"insertRule(rule)","external":true,"refSections":[{"refs":[{"id":"ref-for-dom-cssstylesheet-insertrule"}],"title":"5.4. \nParser Entry Points"}],"url":"https://drafts.csswg.org/cssom-1/#dom-cssstylesheet-insertrule"}, "2c57f900": {"dfnID":"2c57f900","dfnText":"font","external":true,"refSections":[{"refs":[{"id":"ref-for-propdef-font"}],"title":"5.5.5. \nConsume a block\u2019s contents"}],"url":"https://drafts.csswg.org/css-fonts-4/#propdef-font"}, "2edd539e": {"dfnID":"2edd539e","dfnText":"property","external":true,"refSections":[{"refs":[{"id":"ref-for-css-property"},{"id":"ref-for-css-property\u2460"}],"title":"5.2. \nCSS Parsing Results"},{"refs":[{"id":"ref-for-css-property\u2461"}],"title":"8.2. \nAt-rules"}],"url":"https://drafts.csswg.org/css-cascade-5/#css-property"}, "38314b9f": {"dfnID":"38314b9f","dfnText":"non-ASCII code point","external":true,"refSections":[{"refs":[{"id":"ref-for-non-ascii-code-point"}],"title":"12.1. \nChanges from the 24 December 2021 Candidate Recommendation Draft"}],"url":"https://www.w3.org/TR/css-syntax-3/#non-ascii-code-point"}, "4e55d7fb": {"dfnID":"4e55d7fb","dfnText":"@import","external":true,"refSections":[{"refs":[{"id":"ref-for-at-ruledef-import"}],"title":"2. \nDescription of CSS\u2019s Syntax"},{"refs":[{"id":"ref-for-at-ruledef-import\u2460"}],"title":"3.2. \nThe input byte stream"}],"url":"https://drafts.csswg.org/css-cascade-5/#at-ruledef-import"}, "4fdfba4e": {"dfnID":"4fdfba4e","dfnText":"get an encoding","external":true,"refSections":[{"refs":[{"id":"ref-for-concept-encoding-get"},{"id":"ref-for-concept-encoding-get\u2460"}],"title":"3.2. \nThe input byte stream"}],"url":"https://encoding.spec.whatwg.org/#concept-encoding-get"}, "537cf076": {"dfnID":"537cf076","dfnText":"?","external":true,"refSections":[{"refs":[{"id":"ref-for-mult-opt"},{"id":"ref-for-mult-opt\u2460"},{"id":"ref-for-mult-opt\u2461"},{"id":"ref-for-mult-opt\u2462"},{"id":"ref-for-mult-opt\u2463"}],"title":"6.2. \nThe <an+b> type"}],"url":"https://drafts.csswg.org/css-values-4/#mult-opt"}, "57699934": {"dfnID":"57699934","dfnText":"attr()","external":true,"refSections":[{"refs":[{"id":"ref-for-funcdef-attr"}],"title":"5.4. \nParser Entry Points"}],"url":"https://drafts.csswg.org/css-values-5/#funcdef-attr"}, "58b7ba18": {"dfnID":"58b7ba18","dfnText":"decode","external":true,"refSections":[{"refs":[{"id":"ref-for-decode"},{"id":"ref-for-decode\u2460"}],"title":"3.2. \nThe input byte stream"}],"url":"https://encoding.spec.whatwg.org/#decode"}, "5a2f7ea1": {"dfnID":"5a2f7ea1","dfnText":"url()","external":true,"refSections":[{"refs":[{"id":"ref-for-funcdef-url"}],"title":"2. \nDescription of CSS\u2019s Syntax"}],"url":"https://drafts.csswg.org/css-values-4/#funcdef-url"}, "5ee7eb9e": {"dfnID":"5ee7eb9e","dfnText":"@page","external":true,"refSections":[{"refs":[{"id":"ref-for-at-ruledef-page"}],"title":"2. \nDescription of CSS\u2019s Syntax"},{"refs":[{"id":"ref-for-at-ruledef-page\u2460"}],"title":"7.1. \nDefining Block Contents: the <block-contents>, <declaration-list>, <qualified-rule-list>, <declaration-rule-list>, and <rule-list> productions"},{"refs":[{"id":"ref-for-at-ruledef-page\u2461"}],"title":"12.6. \nChanges from CSS 2.1 and Selectors Level 3"}],"url":"https://drafts.csswg.org/css-page-3/#at-ruledef-page"}, "5f1b7f60": {"dfnID":"5f1b7f60","dfnText":"@media","external":true,"refSections":[{"refs":[{"id":"ref-for-at-ruledef-media"},{"id":"ref-for-at-ruledef-media\u2460"}],"title":"2. \nDescription of CSS\u2019s Syntax"},{"refs":[{"id":"ref-for-at-ruledef-media\u2461"}],"title":"7.1. \nDefining Block Contents: the <block-contents>, <declaration-list>, <qualified-rule-list>, <declaration-rule-list>, and <rule-list> productions"},{"refs":[{"id":"ref-for-at-ruledef-media\u2462"}],"title":"8.1. \nStyle rules"},{"refs":[{"id":"ref-for-at-ruledef-media\u2463"}],"title":"12.1. \nChanges from the 24 December 2021 Candidate Recommendation Draft"}],"url":"https://drafts.csswg.org/css-conditional-3/#at-ruledef-media"}, "649608b9": {"dfnID":"649608b9","dfnText":"list","external":true,"refSections":[{"refs":[{"id":"ref-for-list"}],"title":"5.3. \nToken Streams"},{"refs":[{"id":"ref-for-list\u2460"}],"title":"5.4.2. \nParse a comma-separated list according to a CSS grammar"},{"refs":[{"id":"ref-for-list\u2461"}],"title":"5.4.10. \nParse a comma-separated list of component values"},{"refs":[{"id":"ref-for-list\u2462"}],"title":"5.5.1. \nConsume a stylesheet\u2019s contents"},{"refs":[{"id":"ref-for-list\u2463"},{"id":"ref-for-list\u2464"}],"title":"5.5.2. \nConsume an at-rule"},{"refs":[{"id":"ref-for-list\u2465"},{"id":"ref-for-list\u2466"},{"id":"ref-for-list\u2467"},{"id":"ref-for-list\u2468"}],"title":"5.5.3. \nConsume a qualified rule"},{"refs":[{"id":"ref-for-list\u2460\u24ea"},{"id":"ref-for-list\u2460\u2460"},{"id":"ref-for-list\u2460\u2461"},{"id":"ref-for-list\u2460\u2462"},{"id":"ref-for-list\u2460\u2463"},{"id":"ref-for-list\u2460\u2464"},{"id":"ref-for-list\u2460\u2465"},{"id":"ref-for-list\u2460\u2466"},{"id":"ref-for-list\u2460\u2467"}],"title":"5.5.5. \nConsume a block\u2019s contents"},{"refs":[{"id":"ref-for-list\u2460\u2468"}],"title":"5.5.6. \nConsume a declaration"},{"refs":[{"id":"ref-for-list\u2461\u24ea"}],"title":"5.5.7. \nConsume a list of component values"},{"refs":[{"id":"ref-for-list\u2461\u2460"}],"title":"5.5.9. \nConsume a simple block"},{"refs":[{"id":"ref-for-list\u2461\u2461"}],"title":"5.5.10. \nConsume a function"}],"url":"https://infra.spec.whatwg.org/#list"}, "6524d004": {"dfnID":"6524d004","dfnText":"<urange>","external":true,"refSections":[{"refs":[{"id":"ref-for-typedef-urange"}],"title":"12.3. \nChanges from the 20 February 2014 Candidate Recommendation"},{"refs":[{"id":"ref-for-typedef-urange\u2460"}],"title":"12.6. \nChanges from CSS 2.1 and Selectors Level 3"}],"url":"https://www.w3.org/TR/css-syntax-3/#typedef-urange"}, "68bf3d31": {"dfnID":"68bf3d31","dfnText":"a","external":true,"refSections":[{"refs":[{"id":"ref-for-the-a-element"}],"title":"2. \nDescription of CSS\u2019s Syntax"}],"url":"https://html.spec.whatwg.org/multipage/text-level-semantics.html#the-a-element"}, "69aefbfb": {"dfnID":"69aefbfb","dfnText":"parse a list of declarations","external":true,"refSections":[{"refs":[{"id":"ref-for-parse-a-list-of-declarations"}],"title":"5.4.7. \nParse a declaration"}],"url":"https://www.w3.org/TR/css-syntax-3/#parse-a-list-of-declarations"}, "6ec67710": {"dfnID":"6ec67710","dfnText":"|","external":true,"refSections":[{"refs":[{"id":"ref-for-comb-one"},{"id":"ref-for-comb-one\u2460"},{"id":"ref-for-comb-one\u2461"},{"id":"ref-for-comb-one\u2462"},{"id":"ref-for-comb-one\u2463"},{"id":"ref-for-comb-one\u2464"},{"id":"ref-for-comb-one\u2465"},{"id":"ref-for-comb-one\u2466"},{"id":"ref-for-comb-one\u2467"},{"id":"ref-for-comb-one\u2468"},{"id":"ref-for-comb-one\u2460\u24ea"},{"id":"ref-for-comb-one\u2460\u2460"},{"id":"ref-for-comb-one\u2460\u2461"},{"id":"ref-for-comb-one\u2460\u2462"},{"id":"ref-for-comb-one\u2460\u2463"},{"id":"ref-for-comb-one\u2460\u2464"},{"id":"ref-for-comb-one\u2460\u2465"},{"id":"ref-for-comb-one\u2460\u2466"},{"id":"ref-for-comb-one\u2460\u2467"},{"id":"ref-for-comb-one\u2460\u2468"}],"title":"6.2. \nThe <an+b> type"}],"url":"https://drafts.csswg.org/css-values-4/#comb-one"}, "71aed09f": {"dfnID":"71aed09f","dfnText":"<selector-list>","external":true,"refSections":[{"refs":[{"id":"ref-for-typedef-selector-list"}],"title":"8.1. \nStyle rules"}],"url":"https://drafts.csswg.org/selectors-4/#typedef-selector-list"}, "73ea1d43": {"dfnID":"73ea1d43","dfnText":"color","external":true,"refSections":[{"refs":[{"id":"ref-for-propdef-color"}],"title":"2. \nDescription of CSS\u2019s Syntax"}],"url":"https://drafts.csswg.org/css-color-4/#propdef-color"}, "7f9469b5": {"dfnID":"7f9469b5","dfnText":"ASCII case-insensitive","external":true,"refSections":[{"refs":[{"id":"ref-for-ascii-case-insensitive"}],"title":"4.3.4. \nConsume an ident-like token"},{"refs":[{"id":"ref-for-ascii-case-insensitive\u2460"},{"id":"ref-for-ascii-case-insensitive\u2461"}],"title":"5.5.6. \nConsume a declaration"},{"refs":[{"id":"ref-for-ascii-case-insensitive\u2462"},{"id":"ref-for-ascii-case-insensitive\u2463"},{"id":"ref-for-ascii-case-insensitive\u2464"},{"id":"ref-for-ascii-case-insensitive\u2465"},{"id":"ref-for-ascii-case-insensitive\u2466"}],"title":"6.2. \nThe <an+b> type"},{"refs":[{"id":"ref-for-ascii-case-insensitive\u2467"}],"title":"8.1. \nStyle rules"}],"url":"https://infra.spec.whatwg.org/#ascii-case-insensitive"}, "88d7e451": {"dfnID":"88d7e451","dfnText":"custom property name string","external":true,"refSections":[{"refs":[{"id":"ref-for-custom-property-name-string"}],"title":"5.5.6. \nConsume a declaration"}],"url":"https://drafts.css-houdini.org/css-typed-om-1/#custom-property-name-string"}, "915aff5e": {"dfnID":"915aff5e","dfnText":"code point","external":true,"refSections":[{"refs":[{"id":"ref-for-code-point"}],"title":"1. \nIntroduction"},{"refs":[{"id":"ref-for-code-point\u2460"},{"id":"ref-for-code-point\u2461"}],"title":"2. \nDescription of CSS\u2019s Syntax"},{"refs":[{"id":"ref-for-code-point\u2462"},{"id":"ref-for-code-point\u2463"},{"id":"ref-for-code-point\u2464"},{"id":"ref-for-code-point\u2465"}],"title":"2.1. \nEscaping"},{"refs":[{"id":"ref-for-code-point\u2466"}],"title":"3.1. \nOverview of the Parsing Model"},{"refs":[{"id":"ref-for-code-point\u2467"},{"id":"ref-for-code-point\u2468"},{"id":"ref-for-code-point\u2460\u24ea"}],"title":"3.2. \nThe input byte stream"},{"refs":[{"id":"ref-for-code-point\u2460\u2460"},{"id":"ref-for-code-point\u2460\u2461"},{"id":"ref-for-code-point\u2460\u2462"},{"id":"ref-for-code-point\u2460\u2463"},{"id":"ref-for-code-point\u2460\u2464"},{"id":"ref-for-code-point\u2460\u2465"}],"title":"3.3. \nPreprocessing the input stream"},{"refs":[{"id":"ref-for-code-point\u2460\u2466"},{"id":"ref-for-code-point\u2460\u2467"},{"id":"ref-for-code-point\u2460\u2468"},{"id":"ref-for-code-point\u2461\u24ea"},{"id":"ref-for-code-point\u2461\u2460"}],"title":"4. \nTokenization"},{"refs":[{"id":"ref-for-code-point\u2461\u2461"},{"id":"ref-for-code-point\u2461\u2462"},{"id":"ref-for-code-point\u2461\u2463"},{"id":"ref-for-code-point\u2461\u2464"},{"id":"ref-for-code-point\u2461\u2465"},{"id":"ref-for-code-point\u2461\u2466"},{"id":"ref-for-code-point\u2461\u2467"},{"id":"ref-for-code-point\u2461\u2468"},{"id":"ref-for-code-point\u2462\u24ea"},{"id":"ref-for-code-point\u2462\u2460"},{"id":"ref-for-code-point\u2462\u2461"},{"id":"ref-for-code-point\u2462\u2462"},{"id":"ref-for-code-point\u2462\u2463"}],"title":"4.2. \nDefinitions"},{"refs":[{"id":"ref-for-code-point\u2462\u2464"}],"title":"4.3. \nTokenizer Algorithms"},{"refs":[{"id":"ref-for-code-point\u2462\u2465"}],"title":"4.3.1. \nConsume a token"},{"refs":[{"id":"ref-for-code-point\u2462\u2466"},{"id":"ref-for-code-point\u2462\u2467"}],"title":"4.3.2. \nConsume comments"},{"refs":[{"id":"ref-for-code-point\u2462\u2468"}],"title":"4.3.3. \nConsume a numeric token"},{"refs":[{"id":"ref-for-code-point\u2463\u24ea"}],"title":"4.3.4. \nConsume an ident-like token"},{"refs":[{"id":"ref-for-code-point\u2463\u2460"},{"id":"ref-for-code-point\u2463\u2461"},{"id":"ref-for-code-point\u2463\u2462"}],"title":"4.3.5. \nConsume a string token"},{"refs":[{"id":"ref-for-code-point\u2463\u2463"},{"id":"ref-for-code-point\u2463\u2464"}],"title":"4.3.6. \nConsume a url token"},{"refs":[{"id":"ref-for-code-point\u2463\u2465"},{"id":"ref-for-code-point\u2463\u2466"}],"title":"4.3.7. \nConsume an escaped code point"},{"refs":[{"id":"ref-for-code-point\u2463\u2467"},{"id":"ref-for-code-point\u2463\u2468"},{"id":"ref-for-code-point\u2464\u24ea"},{"id":"ref-for-code-point\u2464\u2460"},{"id":"ref-for-code-point\u2464\u2461"}],"title":"4.3.8. \nCheck if two code points are a valid escape"},{"refs":[{"id":"ref-for-code-point\u2464\u2462"},{"id":"ref-for-code-point\u2464\u2463"},{"id":"ref-for-code-point\u2464\u2464"},{"id":"ref-for-code-point\u2464\u2465"},{"id":"ref-for-code-point\u2464\u2466"},{"id":"ref-for-code-point\u2464\u2467"},{"id":"ref-for-code-point\u2464\u2468"}],"title":"4.3.9. \nCheck if three code points would start an ident sequence"},{"refs":[{"id":"ref-for-code-point\u2465\u24ea"},{"id":"ref-for-code-point\u2465\u2460"},{"id":"ref-for-code-point\u2465\u2461"},{"id":"ref-for-code-point\u2465\u2462"},{"id":"ref-for-code-point\u2465\u2463"},{"id":"ref-for-code-point\u2465\u2464"},{"id":"ref-for-code-point\u2465\u2465"},{"id":"ref-for-code-point\u2465\u2466"}],"title":"4.3.10. \nCheck if three code points would start a number"},{"refs":[{"id":"ref-for-code-point\u2465\u2467"},{"id":"ref-for-code-point\u2465\u2468"},{"id":"ref-for-code-point\u2466\u24ea"}],"title":"4.3.11. \nCheck if three code points would start a unicode-range"},{"refs":[{"id":"ref-for-code-point\u2466\u2460"},{"id":"ref-for-code-point\u2466\u2461"},{"id":"ref-for-code-point\u2466\u2462"},{"id":"ref-for-code-point\u2466\u2463"},{"id":"ref-for-code-point\u2466\u2464"},{"id":"ref-for-code-point\u2466\u2465"}],"title":"4.3.12. \nConsume an ident sequence"},{"refs":[{"id":"ref-for-code-point\u2466\u2466"},{"id":"ref-for-code-point\u2466\u2467"}],"title":"4.3.13. \nConsume a number"},{"refs":[{"id":"ref-for-code-point\u2466\u2468"},{"id":"ref-for-code-point\u2467\u24ea"},{"id":"ref-for-code-point\u2467\u2460"}],"title":"4.3.14. \nConsume a unicode-range token"},{"refs":[{"id":"ref-for-code-point\u2467\u2461"}],"title":"4.3.15. \nConsume the remnants of a bad url"},{"refs":[{"id":"ref-for-code-point\u2467\u2462"},{"id":"ref-for-code-point\u2467\u2463"}],"title":"6.2. \nThe <an+b> type"},{"refs":[{"id":"ref-for-code-point\u2467\u2464"}],"title":"12.6. \nChanges from CSS 2.1 and Selectors Level 3"}],"url":"https://infra.spec.whatwg.org/#code-point"}, "977d3003": {"dfnID":"977d3003","dfnText":"<string>","external":true,"refSections":[{"refs":[{"id":"ref-for-string-value"}],"title":"5.4.1. \nParse something according to a CSS grammar"}],"url":"https://drafts.csswg.org/css-values-4/#string-value"}, "984221ca": {"dfnID":"984221ca","dfnText":"struct","external":true,"refSections":[{"refs":[{"id":"ref-for-struct"}],"title":"5.3. \nToken Streams"}],"url":"https://infra.spec.whatwg.org/#struct"}, "99c988d6": {"dfnID":"99c988d6","dfnText":"remove","external":true,"refSections":[{"refs":[{"id":"ref-for-list-remove"}],"title":"5.5.6. \nConsume a declaration"}],"url":"https://infra.spec.whatwg.org/#list-remove"}, "9d795fd1": {"dfnID":"9d795fd1","dfnText":":nth-child()","external":true,"refSections":[{"refs":[{"id":"ref-for-nth-child-pseudo"}],"title":"6. \nThe An+B microsyntax"}],"url":"https://drafts.csswg.org/selectors-4/#nth-child-pseudo"}, "a015dd4d": {"dfnID":"a015dd4d","dfnText":"<style-block>","external":true,"refSections":[{"refs":[{"id":"ref-for-typedef-style-block"}],"title":"12.2. \nChanges from the 16 August 2019 Candidate Recommendation"}],"url":"https://www.w3.org/TR/css-syntax-3/#typedef-style-block"}, "a3fb968a": {"dfnID":"a3fb968a","dfnText":"surrogate","external":true,"refSections":[{"refs":[{"id":"ref-for-surrogate"},{"id":"ref-for-surrogate\u2460"}],"title":"3.3. \nPreprocessing the input stream"},{"refs":[{"id":"ref-for-surrogate\u2461"}],"title":"4.3.7. \nConsume an escaped code point"},{"refs":[{"id":"ref-for-surrogate\u2462"}],"title":"12.3. \nChanges from the 20 February 2014 Candidate Recommendation"},{"refs":[{"id":"ref-for-surrogate\u2463"}],"title":"12.6. \nChanges from CSS 2.1 and Selectors Level 3"}],"url":"https://infra.spec.whatwg.org/#surrogate"}, "a82a20ef": {"dfnID":"a82a20ef","dfnText":"CSSStyleDeclaration","external":true,"refSections":[{"refs":[{"id":"ref-for-cssstyledeclaration"}],"title":"5.5.5. \nConsume a block\u2019s contents"}],"url":"https://drafts.csswg.org/cssom-1/#cssstyledeclaration"}, "a83be41c": {"dfnID":"a83be41c","dfnText":"underline","external":true,"refSections":[{"refs":[{"id":"ref-for-valdef-text-decoration-line-underline"}],"title":"2. \nDescription of CSS\u2019s Syntax"}],"url":"https://drafts.csswg.org/css-text-decor-4/#valdef-text-decoration-line-underline"}, "anb": {"dfnID":"anb","dfnText":"An+B","external":false,"refSections":[],"url":"#anb"}, "anb-production": {"dfnID":"anb-production","dfnText":"<an+b>","external":false,"refSections":[{"refs":[{"id":"ref-for-anb-production"}],"title":"9.1. \nSerializing <an+b>"},{"refs":[{"id":"ref-for-anb-production\u2460"}],"title":"12.3. \nChanges from the 20 February 2014 Candidate Recommendation"}],"url":"#anb-production"}, "at-rule": {"dfnID":"at-rule","dfnText":"at-rule","external":false,"refSections":[{"refs":[{"id":"ref-for-at-rule"},{"id":"ref-for-at-rule\u2460"},{"id":"ref-for-at-rule\u2461"},{"id":"ref-for-at-rule\u2462"},{"id":"ref-for-at-rule\u2463"},{"id":"ref-for-at-rule\u2464"},{"id":"ref-for-at-rule\u2465"},{"id":"ref-for-at-rule\u2466"},{"id":"ref-for-at-rule\u2467"},{"id":"ref-for-at-rule\u2468"}],"title":"2. \nDescription of CSS\u2019s Syntax"},{"refs":[{"id":"ref-for-at-rule\u2460\u24ea"}],"title":"3.2. \nThe input byte stream"},{"refs":[{"id":"ref-for-at-rule\u2460\u2460"},{"id":"ref-for-at-rule\u2460\u2461"},{"id":"ref-for-at-rule\u2460\u2462"},{"id":"ref-for-at-rule\u2460\u2463"}],"title":"5.2. \nCSS Parsing Results"},{"refs":[{"id":"ref-for-at-rule\u2460\u2464"}],"title":"5.5.2. \nConsume an at-rule"},{"refs":[{"id":"ref-for-at-rule\u2460\u2465"},{"id":"ref-for-at-rule\u2460\u2466"},{"id":"ref-for-at-rule\u2460\u2467"},{"id":"ref-for-at-rule\u2460\u2468"},{"id":"ref-for-at-rule\u2461\u24ea"}],"title":"7.1. \nDefining Block Contents: the <block-contents>, <declaration-list>, <qualified-rule-list>, <declaration-rule-list>, and <rule-list> productions"},{"refs":[{"id":"ref-for-at-rule\u2461\u2460"}],"title":"8.1. \nStyle rules"},{"refs":[{"id":"ref-for-at-rule\u2461\u2461"},{"id":"ref-for-at-rule\u2461\u2462"},{"id":"ref-for-at-rule\u2461\u2463"},{"id":"ref-for-at-rule\u2461\u2464"},{"id":"ref-for-at-rule\u2461\u2465"},{"id":"ref-for-at-rule\u2461\u2466"}],"title":"8.2. \nAt-rules"},{"refs":[{"id":"ref-for-at-rule\u2461\u2467"},{"id":"ref-for-at-rule\u2461\u2468"}],"title":"8.3. \nThe @charset Rule"},{"refs":[{"id":"ref-for-at-rule\u2462\u24ea"}],"title":"12.2. \nChanges from the 16 August 2019 Candidate Recommendation"}],"url":"#at-rule"}, "at-ruledef-charset": {"dfnID":"at-ruledef-charset","dfnText":"@charset","external":false,"refSections":[{"refs":[{"id":"ref-for-at-ruledef-charset"},{"id":"ref-for-at-ruledef-charset\u2460"}],"title":"3.2. \nThe input byte stream"},{"refs":[{"id":"ref-for-at-ruledef-charset\u2461"},{"id":"ref-for-at-ruledef-charset\u2462"},{"id":"ref-for-at-ruledef-charset\u2463"},{"id":"ref-for-at-ruledef-charset\u2464"}],"title":"8.3. \nThe @charset Rule"},{"refs":[{"id":"ref-for-at-ruledef-charset\u2465"},{"id":"ref-for-at-ruledef-charset\u2466"}],"title":"12.6. \nChanges from CSS 2.1 and Selectors Level 3"}],"url":"#at-ruledef-charset"}, "b13bfb39": {"dfnID":"b13bfb39","dfnText":"cssText","external":true,"refSections":[{"refs":[{"id":"ref-for-dom-cssstyledeclaration-csstext"}],"title":"5.4. \nParser Entry Points"}],"url":"https://drafts.csswg.org/cssom-1/#dom-cssstyledeclaration-csstext"}, "b1b99838": {"dfnID":"b1b99838","dfnText":"counter style","external":true,"refSections":[{"refs":[{"id":"ref-for-counter-style"}],"title":"8.2. \nAt-rules"}],"url":"https://drafts.csswg.org/css-counter-styles-3/#counter-style"}, "b80d76a2": {"dfnID":"b80d76a2","dfnText":"p","external":true,"refSections":[{"refs":[{"id":"ref-for-the-p-element"}],"title":"2. \nDescription of CSS\u2019s Syntax"}],"url":"https://html.spec.whatwg.org/multipage/grouping-content.html#the-p-element"}, "ba920583": {"dfnID":"ba920583","dfnText":"style","external":true,"refSections":[{"refs":[{"id":"ref-for-the-style-element"}],"title":"5.5.1. \nConsume a stylesheet\u2019s contents"}],"url":"https://html.spec.whatwg.org/multipage/semantics.html#the-style-element"}, "bbc31c9d": {"dfnID":"bbc31c9d","dfnText":"location","external":true,"refSections":[{"refs":[{"id":"ref-for-concept-css-style-sheet-location"}],"title":"5.4.3. \nParse a stylesheet"},{"refs":[{"id":"ref-for-concept-css-style-sheet-location\u2460"}],"title":"12.2. \nChanges from the 16 August 2019 Candidate Recommendation"}],"url":"https://drafts.csswg.org/cssom-1/#concept-css-style-sheet-location"}, "bedd9d42": {"dfnID":"bedd9d42","dfnText":"+","external":true,"refSections":[{"refs":[{"id":"ref-for-mult-one-plus"}],"title":"6.2. \nThe <an+b> type"}],"url":"https://drafts.csswg.org/css-values-4/#mult-one-plus"}, "bf3ca8a7": {"dfnID":"bf3ca8a7","dfnText":"conditional group rule","external":true,"refSections":[{"refs":[{"id":"ref-for-conditional-group-rule"}],"title":"8.1. \nStyle rules"},{"refs":[{"id":"ref-for-conditional-group-rule\u2460"}],"title":"8.2. \nAt-rules"}],"url":"https://drafts.csswg.org/css-conditional-3/#conditional-group-rule"}, "block-at-rule": {"dfnID":"block-at-rule","dfnText":"block at-rules","external":false,"refSections":[{"refs":[{"id":"ref-for-block-at-rule"}],"title":"5.2. \nCSS Parsing Results"},{"refs":[{"id":"ref-for-block-at-rule\u2460"}],"title":"8.2. \nAt-rules"},{"refs":[{"id":"ref-for-block-at-rule\u2461"}],"title":"12.2. \nChanges from the 16 August 2019 Candidate Recommendation"}],"url":"#block-at-rule"}, "c16b1855": {"dfnID":"c16b1855","dfnText":"animation-timing-function","external":true,"refSections":[{"refs":[{"id":"ref-for-propdef-animation-timing-function"}],"title":"7.1. \nDefining Block Contents: the <block-contents>, <declaration-list>, <qualified-rule-list>, <declaration-rule-list>, and <rule-list> productions"}],"url":"https://drafts.csswg.org/css-animations-1/#propdef-animation-timing-function"}, "c1ebc639": {"dfnID":"c1ebc639","dfnText":"@supports","external":true,"refSections":[{"refs":[{"id":"ref-for-at-ruledef-supports"}],"title":"5.4. \nParser Entry Points"}],"url":"https://drafts.csswg.org/css-conditional-3/#at-ruledef-supports"}, "c4f8137c": {"dfnID":"c4f8137c","dfnText":"<general-enclosed>","external":true,"refSections":[{"refs":[{"id":"ref-for-typedef-general-enclosed"}],"title":"7.2. \nDefining Arbitrary Contents: the <declaration-value> and <any-value> productions"}],"url":"https://drafts.csswg.org/mediaqueries-5/#typedef-general-enclosed"}, "c5c89fde": {"dfnID":"c5c89fde","dfnText":"<keyframe-selector>","external":true,"refSections":[{"refs":[{"id":"ref-for-typedef-keyframe-selector"}],"title":"7.1. \nDefining Block Contents: the <block-contents>, <declaration-list>, <qualified-rule-list>, <declaration-rule-list>, and <rule-list> productions"}],"url":"https://drafts.csswg.org/css-animations-1/#typedef-keyframe-selector"}, "c88f3887": {"dfnID":"c88f3887","dfnText":"item","external":true,"refSections":[{"refs":[{"id":"ref-for-struct-item"}],"title":"5.3. \nToken Streams"}],"url":"https://infra.spec.whatwg.org/#struct-item"}, "cccedd30": {"dfnID":"cccedd30","dfnText":"CSSNestedDeclarations","external":true,"refSections":[{"refs":[{"id":"ref-for-cssnesteddeclarations"}],"title":"5.5.5. \nConsume a block\u2019s contents"}],"url":"https://drafts.csswg.org/css-nesting-1/#cssnesteddeclarations"}, "ceacaa1c": {"dfnID":"ceacaa1c","dfnText":"stack","external":true,"refSections":[{"refs":[{"id":"ref-for-stack"}],"title":"5.3. \nToken Streams"}],"url":"https://infra.spec.whatwg.org/#stack"}, "check-if-three-code-points-would-start-a-number": {"dfnID":"check-if-three-code-points-would-start-a-number","dfnText":"check if three code points would start a number","external":false,"refSections":[{"refs":[{"id":"ref-for-check-if-three-code-points-would-start-a-number"},{"id":"ref-for-check-if-three-code-points-would-start-a-number\u2460"},{"id":"ref-for-check-if-three-code-points-would-start-a-number\u2461"}],"title":"4.3.1. \nConsume a token"},{"refs":[{"id":"ref-for-check-if-three-code-points-would-start-a-number\u2462"}],"title":"4.3.13. \nConsume a number"}],"url":"#check-if-three-code-points-would-start-a-number"}, "check-if-three-code-points-would-start-a-unicode-range": {"dfnID":"check-if-three-code-points-would-start-a-unicode-range","dfnText":"check if three code points would start a unicode-range","external":false,"refSections":[{"refs":[{"id":"ref-for-check-if-three-code-points-would-start-a-unicode-range"}],"title":"4.3.1. \nConsume a token"},{"refs":[{"id":"ref-for-check-if-three-code-points-would-start-a-unicode-range\u2460"}],"title":"4.3.14. \nConsume a unicode-range token"}],"url":"#check-if-three-code-points-would-start-a-unicode-range"}, "check-if-three-code-points-would-start-an-ident-sequence": {"dfnID":"check-if-three-code-points-would-start-an-ident-sequence","dfnText":"check if three code points would start an ident sequence","external":false,"refSections":[{"refs":[{"id":"ref-for-check-if-three-code-points-would-start-an-ident-sequence"},{"id":"ref-for-check-if-three-code-points-would-start-an-ident-sequence\u2460"},{"id":"ref-for-check-if-three-code-points-would-start-an-ident-sequence\u2461"}],"title":"4.3.1. \nConsume a token"},{"refs":[{"id":"ref-for-check-if-three-code-points-would-start-an-ident-sequence\u2462"}],"title":"4.3.3. \nConsume a numeric token"},{"refs":[{"id":"ref-for-check-if-three-code-points-would-start-an-ident-sequence\u2463"}],"title":"4.3.12. \nConsume an ident sequence"}],"url":"#check-if-three-code-points-would-start-an-ident-sequence"}, "check-if-two-code-points-are-a-valid-escape": {"dfnID":"check-if-two-code-points-are-a-valid-escape","dfnText":"check if two code points are a valid escape","external":false,"refSections":[{"refs":[{"id":"ref-for-check-if-two-code-points-are-a-valid-escape"},{"id":"ref-for-check-if-two-code-points-are-a-valid-escape\u2460"}],"title":"4.3.1. \nConsume a token"},{"refs":[{"id":"ref-for-check-if-two-code-points-are-a-valid-escape\u2461"}],"title":"4.3.5. \nConsume a string token"},{"refs":[{"id":"ref-for-check-if-two-code-points-are-a-valid-escape\u2462"}],"title":"4.3.6. \nConsume a url token"},{"refs":[{"id":"ref-for-check-if-two-code-points-are-a-valid-escape\u2463"},{"id":"ref-for-check-if-two-code-points-are-a-valid-escape\u2464"}],"title":"4.3.9. \nCheck if three code points would start an ident sequence"},{"refs":[{"id":"ref-for-check-if-two-code-points-are-a-valid-escape\u2465"}],"title":"4.3.12. \nConsume an ident sequence"},{"refs":[{"id":"ref-for-check-if-two-code-points-are-a-valid-escape\u2466"}],"title":"4.3.15. \nConsume the remnants of a bad url"},{"refs":[{"id":"ref-for-check-if-two-code-points-are-a-valid-escape\u2467"}],"title":"12.3. \nChanges from the 20 February 2014 Candidate Recommendation"}],"url":"#check-if-two-code-points-are-a-valid-escape"}, "component-value": {"dfnID":"component-value","dfnText":"component value","external":false,"refSections":[{"refs":[{"id":"ref-for-component-value"},{"id":"ref-for-component-value\u2460"},{"id":"ref-for-component-value\u2461"}],"title":"5.2. \nCSS Parsing Results"},{"refs":[{"id":"ref-for-component-value\u2462"},{"id":"ref-for-component-value\u2463"}],"title":"5.3. \nToken Streams"},{"refs":[{"id":"ref-for-component-value\u2464"}],"title":"5.4. \nParser Entry Points"},{"refs":[{"id":"ref-for-component-value\u2465"}],"title":"5.5.7. \nConsume a list of component values"}],"url":"#component-value"}, "consume-a-block": {"dfnID":"consume-a-block","dfnText":"consume a block","external":false,"refSections":[{"refs":[{"id":"ref-for-consume-a-block"}],"title":"5.5.2. \nConsume an at-rule"},{"refs":[{"id":"ref-for-consume-a-block\u2460"},{"id":"ref-for-consume-a-block\u2461"}],"title":"5.5.3. \nConsume a qualified rule"}],"url":"#consume-a-block"}, "consume-a-blocks-contents": {"dfnID":"consume-a-blocks-contents","dfnText":"consume a block\u2019s contents","external":false,"refSections":[{"refs":[{"id":"ref-for-consume-a-blocks-contents"}],"title":"5.4.5. \nParse a block\u2019s contents"},{"refs":[{"id":"ref-for-consume-a-blocks-contents\u2460"}],"title":"5.5.4. \nConsume a block"},{"refs":[{"id":"ref-for-consume-a-blocks-contents\u2461"}],"title":"7.1. \nDefining Block Contents: the <block-contents>, <declaration-list>, <qualified-rule-list>, <declaration-rule-list>, and <rule-list> productions"},{"refs":[{"id":"ref-for-consume-a-blocks-contents\u2462"}],"title":"12.1. \nChanges from the 24 December 2021 Candidate Recommendation Draft"}],"url":"#consume-a-blocks-contents"}, "consume-a-component-value": {"dfnID":"consume-a-component-value","dfnText":"consume a component value","external":false,"refSections":[{"refs":[{"id":"ref-for-consume-a-component-value"}],"title":"5.4.8. \nParse a component value"},{"refs":[{"id":"ref-for-consume-a-component-value\u2460"}],"title":"5.5.2. \nConsume an at-rule"},{"refs":[{"id":"ref-for-consume-a-component-value\u2461"}],"title":"5.5.3. \nConsume a qualified rule"},{"refs":[{"id":"ref-for-consume-a-component-value\u2462"}],"title":"5.5.6. \nConsume a declaration"},{"refs":[{"id":"ref-for-consume-a-component-value\u2463"}],"title":"5.5.7. \nConsume a list of component values"},{"refs":[{"id":"ref-for-consume-a-component-value\u2464"}],"title":"5.5.9. \nConsume a simple block"},{"refs":[{"id":"ref-for-consume-a-component-value\u2465"}],"title":"5.5.10. \nConsume a function"}],"url":"#consume-a-component-value"}, "consume-a-declaration": {"dfnID":"consume-a-declaration","dfnText":"consume a declaration","external":false,"refSections":[{"refs":[{"id":"ref-for-consume-a-declaration"}],"title":"5.3. \nToken Streams"},{"refs":[{"id":"ref-for-consume-a-declaration\u2460"}],"title":"5.4.7. \nParse a declaration"},{"refs":[{"id":"ref-for-consume-a-declaration\u2461"}],"title":"5.5.5. \nConsume a block\u2019s contents"}],"url":"#consume-a-declaration"}, "consume-a-function": {"dfnID":"consume-a-function","dfnText":"consume a function","external":false,"refSections":[{"refs":[{"id":"ref-for-consume-a-function"}],"title":"5.5.8. \nConsume a component value"}],"url":"#consume-a-function"}, "consume-a-list-of-component-values": {"dfnID":"consume-a-list-of-component-values","dfnText":"consume a list of component values","external":false,"refSections":[{"refs":[{"id":"ref-for-consume-a-list-of-component-values"}],"title":"5.4.9. \nParse a list of component values"},{"refs":[{"id":"ref-for-consume-a-list-of-component-values\u2460"}],"title":"5.4.10. \nParse a comma-separated list of component values"},{"refs":[{"id":"ref-for-consume-a-list-of-component-values\u2461"},{"id":"ref-for-consume-a-list-of-component-values\u2462"}],"title":"5.5.6. \nConsume a declaration"},{"refs":[{"id":"ref-for-consume-a-list-of-component-values\u2463"}],"title":"5.5.11. \nConsume a unicode-range value"}],"url":"#consume-a-list-of-component-values"}, "consume-a-number": {"dfnID":"consume-a-number","dfnText":"consume a number","external":false,"refSections":[{"refs":[{"id":"ref-for-consume-a-number"}],"title":"4.3.3. \nConsume a numeric token"}],"url":"#consume-a-number"}, "consume-a-numeric-token": {"dfnID":"consume-a-numeric-token","dfnText":"consume a numeric token","external":false,"refSections":[{"refs":[{"id":"ref-for-consume-a-numeric-token"},{"id":"ref-for-consume-a-numeric-token\u2460"},{"id":"ref-for-consume-a-numeric-token\u2461"},{"id":"ref-for-consume-a-numeric-token\u2462"}],"title":"4.3.1. \nConsume a token"}],"url":"#consume-a-numeric-token"}, "consume-a-qualified-rule": {"dfnID":"consume-a-qualified-rule","dfnText":"consume a qualified rule","external":false,"refSections":[{"refs":[{"id":"ref-for-consume-a-qualified-rule"}],"title":"5.4.6. \nParse a rule"},{"refs":[{"id":"ref-for-consume-a-qualified-rule\u2460"}],"title":"5.5.1. \nConsume a stylesheet\u2019s contents"},{"refs":[{"id":"ref-for-consume-a-qualified-rule\u2461"}],"title":"5.5.5. \nConsume a block\u2019s contents"}],"url":"#consume-a-qualified-rule"}, "consume-a-simple-block": {"dfnID":"consume-a-simple-block","dfnText":"consume a simple block","external":false,"refSections":[{"refs":[{"id":"ref-for-consume-a-simple-block"}],"title":"5.5.8. \nConsume a component value"}],"url":"#consume-a-simple-block"}, "consume-a-string-token": {"dfnID":"consume-a-string-token","dfnText":"consume a string token","external":false,"refSections":[{"refs":[{"id":"ref-for-consume-a-string-token"},{"id":"ref-for-consume-a-string-token\u2460"}],"title":"4.3.1. \nConsume a token"}],"url":"#consume-a-string-token"}, "consume-a-stylesheets-contents": {"dfnID":"consume-a-stylesheets-contents","dfnText":"consume a stylesheet\u2019s contents","external":false,"refSections":[{"refs":[{"id":"ref-for-consume-a-stylesheets-contents"}],"title":"5.4.3. \nParse a stylesheet"},{"refs":[{"id":"ref-for-consume-a-stylesheets-contents\u2460"}],"title":"5.4.4. \nParse a stylesheet\u2019s contents"}],"url":"#consume-a-stylesheets-contents"}, "consume-a-unicode-range-token": {"dfnID":"consume-a-unicode-range-token","dfnText":"consume a unicode-range token","external":false,"refSections":[{"refs":[{"id":"ref-for-consume-a-unicode-range-token"}],"title":"4.3.1. \nConsume a token"}],"url":"#consume-a-unicode-range-token"}, "consume-a-url-token": {"dfnID":"consume-a-url-token","dfnText":"consume a url token","external":false,"refSections":[{"refs":[{"id":"ref-for-consume-a-url-token"}],"title":"4.3.4. \nConsume an ident-like token"}],"url":"#consume-a-url-token"}, "consume-an-at-rule": {"dfnID":"consume-an-at-rule","dfnText":"consume an at-rule","external":false,"refSections":[{"refs":[{"id":"ref-for-consume-an-at-rule"}],"title":"5.4.6. \nParse a rule"},{"refs":[{"id":"ref-for-consume-an-at-rule\u2460"}],"title":"5.5.1. \nConsume a stylesheet\u2019s contents"},{"refs":[{"id":"ref-for-consume-an-at-rule\u2461"}],"title":"5.5.5. \nConsume a block\u2019s contents"}],"url":"#consume-an-at-rule"}, "consume-an-escaped-code-point": {"dfnID":"consume-an-escaped-code-point","dfnText":"consume an escaped code point","external":false,"refSections":[{"refs":[{"id":"ref-for-consume-an-escaped-code-point"}],"title":"4.3.5. \nConsume a string token"},{"refs":[{"id":"ref-for-consume-an-escaped-code-point\u2460"}],"title":"4.3.6. \nConsume a url token"},{"refs":[{"id":"ref-for-consume-an-escaped-code-point\u2461"}],"title":"4.3.12. \nConsume an ident sequence"},{"refs":[{"id":"ref-for-consume-an-escaped-code-point\u2462"}],"title":"4.3.15. \nConsume the remnants of a bad url"}],"url":"#consume-an-escaped-code-point"}, "consume-an-ident-like-token": {"dfnID":"consume-an-ident-like-token","dfnText":"consume an ident-like token","external":false,"refSections":[{"refs":[{"id":"ref-for-consume-an-ident-like-token"},{"id":"ref-for-consume-an-ident-like-token\u2460"},{"id":"ref-for-consume-an-ident-like-token\u2461"},{"id":"ref-for-consume-an-ident-like-token\u2462"}],"title":"4.3.1. \nConsume a token"},{"refs":[{"id":"ref-for-consume-an-ident-like-token\u2463"}],"title":"4.3.6. \nConsume a url token"}],"url":"#consume-an-ident-like-token"}, "consume-an-ident-sequence": {"dfnID":"consume-an-ident-sequence","dfnText":"consume an ident sequence","external":false,"refSections":[{"refs":[{"id":"ref-for-consume-an-ident-sequence"},{"id":"ref-for-consume-an-ident-sequence\u2460"}],"title":"4.3.1. \nConsume a token"},{"refs":[{"id":"ref-for-consume-an-ident-sequence\u2461"}],"title":"4.3.3. \nConsume a numeric token"},{"refs":[{"id":"ref-for-consume-an-ident-sequence\u2462"}],"title":"4.3.4. \nConsume an ident-like token"}],"url":"#consume-an-ident-sequence"}, "consume-comments": {"dfnID":"consume-comments","dfnText":"consume comments","external":false,"refSections":[{"refs":[{"id":"ref-for-consume-comments"}],"title":"4.3.1. \nConsume a token"}],"url":"#consume-comments"}, "consume-the-remnants-of-a-bad-declaration": {"dfnID":"consume-the-remnants-of-a-bad-declaration","dfnText":"consume the remnants of a bad declaration","external":false,"refSections":[{"refs":[{"id":"ref-for-consume-the-remnants-of-a-bad-declaration"}],"title":"5.5.3. \nConsume a qualified rule"},{"refs":[{"id":"ref-for-consume-the-remnants-of-a-bad-declaration\u2460"},{"id":"ref-for-consume-the-remnants-of-a-bad-declaration\u2461"}],"title":"5.5.6. \nConsume a declaration"}],"url":"#consume-the-remnants-of-a-bad-declaration"}, "consume-the-remnants-of-a-bad-url": {"dfnID":"consume-the-remnants-of-a-bad-url","dfnText":"consume the remnants of a bad url","external":false,"refSections":[{"refs":[{"id":"ref-for-consume-the-remnants-of-a-bad-url"},{"id":"ref-for-consume-the-remnants-of-a-bad-url\u2460"},{"id":"ref-for-consume-the-remnants-of-a-bad-url\u2461"}],"title":"4.3.6. \nConsume a url token"}],"url":"#consume-the-remnants-of-a-bad-url"}, "consume-the-value-of-a-unicode-range-descriptor": {"dfnID":"consume-the-value-of-a-unicode-range-descriptor","dfnText":"consume the value of a unicode-range descriptor","external":false,"refSections":[{"refs":[{"id":"ref-for-consume-the-value-of-a-unicode-range-descriptor"}],"title":"4.3.14. \nConsume a unicode-range token"},{"refs":[{"id":"ref-for-consume-the-value-of-a-unicode-range-descriptor\u2460"}],"title":"5.5.6. \nConsume a declaration"}],"url":"#consume-the-value-of-a-unicode-range-descriptor"}, "css-decode-bytes": {"dfnID":"css-decode-bytes","dfnText":"decode","external":false,"refSections":[{"refs":[{"id":"ref-for-css-decode-bytes"}],"title":"5.4.3. \nParse a stylesheet"}],"url":"#css-decode-bytes"}, "css-descriptor": {"dfnID":"css-descriptor","dfnText":"Descriptors","external":false,"refSections":[{"refs":[{"id":"ref-for-css-descriptor"}],"title":"5.2. \nCSS Parsing Results"},{"refs":[{"id":"ref-for-css-descriptor\u2460"}],"title":"7.1. \nDefining Block Contents: the <block-contents>, <declaration-list>, <qualified-rule-list>, <declaration-rule-list>, and <rule-list> productions"},{"refs":[{"id":"ref-for-css-descriptor\u2461"}],"title":"12.2. \nChanges from the 16 August 2019 Candidate Recommendation"}],"url":"#css-descriptor"}, "css-descriptor-declarations": {"dfnID":"css-descriptor-declarations","dfnText":"descriptor declarations","external":false,"refSections":[{"refs":[{"id":"ref-for-css-descriptor-declarations"}],"title":"8.2. \nAt-rules"},{"refs":[{"id":"ref-for-css-descriptor-declarations\u2460"}],"title":"12.2. \nChanges from the 16 August 2019 Candidate Recommendation"}],"url":"#css-descriptor-declarations"}, "css-filter-code-points": {"dfnID":"css-filter-code-points","dfnText":"filter code points","external":false,"refSections":[{"refs":[{"id":"ref-for-css-filter-code-points"}],"title":"3.3. \nPreprocessing the input stream"},{"refs":[{"id":"ref-for-css-filter-code-points\u2460"}],"title":"5.4. \nParser Entry Points"}],"url":"#css-filter-code-points"}, "css-ignored": {"dfnID":"css-ignored","dfnText":"ignored","external":false,"refSections":[],"url":"#css-ignored"}, "css-invalid": {"dfnID":"css-invalid","dfnText":"invalid","external":false,"refSections":[{"refs":[{"id":"ref-for-css-invalid"}],"title":"8. \nCSS stylesheets"},{"refs":[{"id":"ref-for-css-invalid\u2460"},{"id":"ref-for-css-invalid\u2461"},{"id":"ref-for-css-invalid\u2462"}],"title":"8.1. \nStyle rules"}],"url":"#css-invalid"}, "css-parse-a-comma-separated-list-according-to-a-css-grammar": {"dfnID":"css-parse-a-comma-separated-list-according-to-a-css-grammar","dfnText":"parse a comma-separated list according to a CSS grammar","external":false,"refSections":[{"refs":[{"id":"ref-for-css-parse-a-comma-separated-list-according-to-a-css-grammar"}],"title":"5.4.1. \nParse something according to a CSS grammar"},{"refs":[{"id":"ref-for-css-parse-a-comma-separated-list-according-to-a-css-grammar\u2460"}],"title":"5.4.2. \nParse a comma-separated list according to a CSS grammar"}],"url":"#css-parse-a-comma-separated-list-according-to-a-css-grammar"}, "css-parse-something-according-to-a-css-grammar": {"dfnID":"css-parse-something-according-to-a-css-grammar","dfnText":"parse something according to a CSS grammar","external":false,"refSections":[{"refs":[{"id":"ref-for-css-parse-something-according-to-a-css-grammar"}],"title":"5.4.1. \nParse something according to a CSS grammar"},{"refs":[{"id":"ref-for-css-parse-something-according-to-a-css-grammar\u2460"},{"id":"ref-for-css-parse-something-according-to-a-css-grammar\u2461"},{"id":"ref-for-css-parse-something-according-to-a-css-grammar\u2462"}],"title":"5.4.2. \nParse a comma-separated list according to a CSS grammar"},{"refs":[{"id":"ref-for-css-parse-something-according-to-a-css-grammar\u2463"}],"title":"8.1. \nStyle rules"},{"refs":[{"id":"ref-for-css-parse-something-according-to-a-css-grammar\u2464"}],"title":"12.3. \nChanges from the 20 February 2014 Candidate Recommendation"}],"url":"#css-parse-something-according-to-a-css-grammar"}, "css-property-declarations": {"dfnID":"css-property-declarations","dfnText":"property declarations","external":false,"refSections":[{"refs":[{"id":"ref-for-css-property-declarations"}],"title":"7.1. \nDefining Block Contents: the <block-contents>, <declaration-list>, <qualified-rule-list>, <declaration-rule-list>, and <rule-list> productions"},{"refs":[{"id":"ref-for-css-property-declarations\u2460"}],"title":"12.2. \nChanges from the 16 August 2019 Candidate Recommendation"}],"url":"#css-property-declarations"}, "css-rule": {"dfnID":"css-rule","dfnText":"rule","external":false,"refSections":[{"refs":[{"id":"ref-for-css-rule"},{"id":"ref-for-css-rule\u2460"},{"id":"ref-for-css-rule\u2461"}],"title":"5.2. \nCSS Parsing Results"},{"refs":[{"id":"ref-for-css-rule\u2462"}],"title":"5.5.1. \nConsume a stylesheet\u2019s contents"},{"refs":[{"id":"ref-for-css-rule\u2463"}],"title":"5.5.2. \nConsume an at-rule"},{"refs":[{"id":"ref-for-css-rule\u2464"}],"title":"5.5.3. \nConsume a qualified rule"},{"refs":[{"id":"ref-for-css-rule\u2465"},{"id":"ref-for-css-rule\u2466"},{"id":"ref-for-css-rule\u2467"},{"id":"ref-for-css-rule\u2468"},{"id":"ref-for-css-rule\u2460\u24ea"}],"title":"5.5.5. \nConsume a block\u2019s contents"}],"url":"#css-rule"}, "css-stylesheet": {"dfnID":"css-stylesheet","dfnText":"stylesheet","external":false,"refSections":[],"url":"#css-stylesheet"}, "css-token-stream": {"dfnID":"css-token-stream","dfnText":"token stream","external":false,"refSections":[{"refs":[{"id":"ref-for-css-token-stream"}],"title":"5. \nParsing"},{"refs":[{"id":"ref-for-css-token-stream\u2460"},{"id":"ref-for-css-token-stream\u2461"},{"id":"ref-for-css-token-stream\u2462"},{"id":"ref-for-css-token-stream\u2463"}],"title":"5.3. \nToken Streams"},{"refs":[{"id":"ref-for-css-token-stream\u2464"},{"id":"ref-for-css-token-stream\u2465"},{"id":"ref-for-css-token-stream\u2466"}],"title":"5.4. \nParser Entry Points"},{"refs":[{"id":"ref-for-css-token-stream\u2467"}],"title":"5.5.1. \nConsume a stylesheet\u2019s contents"},{"refs":[{"id":"ref-for-css-token-stream\u2468"}],"title":"5.5.2. \nConsume an at-rule"},{"refs":[{"id":"ref-for-css-token-stream\u2460\u24ea"}],"title":"5.5.3. \nConsume a qualified rule"},{"refs":[{"id":"ref-for-css-token-stream\u2460\u2460"}],"title":"5.5.4. \nConsume a block"},{"refs":[{"id":"ref-for-css-token-stream\u2460\u2461"}],"title":"5.5.5. \nConsume a block\u2019s contents"},{"refs":[{"id":"ref-for-css-token-stream\u2460\u2462"},{"id":"ref-for-css-token-stream\u2460\u2463"}],"title":"5.5.6. \nConsume a declaration"},{"refs":[{"id":"ref-for-css-token-stream\u2460\u2464"}],"title":"5.5.7. \nConsume a list of component values"},{"refs":[{"id":"ref-for-css-token-stream\u2460\u2465"}],"title":"5.5.8. \nConsume a component value"},{"refs":[{"id":"ref-for-css-token-stream\u2460\u2466"}],"title":"5.5.9. \nConsume a simple block"},{"refs":[{"id":"ref-for-css-token-stream\u2460\u2467"}],"title":"5.5.10. \nConsume a function"},{"refs":[{"id":"ref-for-css-token-stream\u2460\u2468"}],"title":"5.5.11. \nConsume a unicode-range value"}],"url":"#css-token-stream"}, "css-tokenize": {"dfnID":"css-tokenize","dfnText":"tokenize","external":false,"refSections":[{"refs":[{"id":"ref-for-css-tokenize"}],"title":"5.4. \nParser Entry Points"},{"refs":[{"id":"ref-for-css-tokenize\u2460"}],"title":"5.5.11. \nConsume a unicode-range value"}],"url":"#css-tokenize"}, "curly-block": {"dfnID":"curly-block","dfnText":"{}-block","external":false,"refSections":[{"refs":[{"id":"ref-for-curly-block"}],"title":"5.2. \nCSS Parsing Results"},{"refs":[{"id":"ref-for-curly-block\u2460"}],"title":"8.2. \nAt-rules"}],"url":"#curly-block"}, "current-input-code-point": {"dfnID":"current-input-code-point","dfnText":"current input code point","external":false,"refSections":[{"refs":[{"id":"ref-for-current-input-code-point"},{"id":"ref-for-current-input-code-point\u2460"}],"title":"4.2. \nDefinitions"},{"refs":[{"id":"ref-for-current-input-code-point\u2461"},{"id":"ref-for-current-input-code-point\u2462"},{"id":"ref-for-current-input-code-point\u2463"},{"id":"ref-for-current-input-code-point\u2464"},{"id":"ref-for-current-input-code-point\u2465"},{"id":"ref-for-current-input-code-point\u2466"},{"id":"ref-for-current-input-code-point\u2467"},{"id":"ref-for-current-input-code-point\u2468"}],"title":"4.3.1. \nConsume a token"},{"refs":[{"id":"ref-for-current-input-code-point\u2460\u24ea"},{"id":"ref-for-current-input-code-point\u2460\u2460"}],"title":"4.3.5. \nConsume a string token"},{"refs":[{"id":"ref-for-current-input-code-point\u2460\u2461"}],"title":"4.3.6. \nConsume a url token"},{"refs":[{"id":"ref-for-current-input-code-point\u2460\u2462"}],"title":"4.3.7. \nConsume an escaped code point"},{"refs":[{"id":"ref-for-current-input-code-point\u2460\u2463"}],"title":"4.3.8. \nCheck if two code points are a valid escape"},{"refs":[{"id":"ref-for-current-input-code-point\u2460\u2464"}],"title":"4.3.9. \nCheck if three code points would start an ident sequence"},{"refs":[{"id":"ref-for-current-input-code-point\u2460\u2465"}],"title":"4.3.10. \nCheck if three code points would start a number"},{"refs":[{"id":"ref-for-current-input-code-point\u2460\u2466"}],"title":"4.3.11. \nCheck if three code points would start a unicode-range"}],"url":"#current-input-code-point"}, "da406a25": {"dfnID":"da406a25","dfnText":"replace(text)","external":true,"refSections":[{"refs":[{"id":"ref-for-dom-cssstylesheet-replace"}],"title":"5.4. \nParser Entry Points"}],"url":"https://drafts.csswg.org/cssom-1/#dom-cssstylesheet-replace"}, "dbba942a": {"dfnID":"dbba942a","dfnText":"var()","external":true,"refSections":[{"refs":[{"id":"ref-for-funcdef-var"}],"title":"5.5.3. \nConsume a qualified rule"}],"url":"https://drafts.csswg.org/css-variables-2/#funcdef-var"}, "dcffbccd": {"dfnID":"dcffbccd","dfnText":"URL","external":true,"refSections":[{"refs":[{"id":"ref-for-concept-url"}],"title":"5.4.3. \nParse a stylesheet"},{"refs":[{"id":"ref-for-concept-url\u2460"}],"title":"12.2. \nChanges from the 16 August 2019 Candidate Recommendation"}],"url":"https://url.spec.whatwg.org/#concept-url"}, "dea91031": {"dfnID":"dea91031","dfnText":"unicode-range","external":true,"refSections":[{"refs":[{"id":"ref-for-descdef-font-face-unicode-range"}],"title":"4.3.14. \nConsume a unicode-range token"},{"refs":[{"id":"ref-for-descdef-font-face-unicode-range\u2460"}],"title":"5.5.11. \nConsume a unicode-range value"},{"refs":[{"id":"ref-for-descdef-font-face-unicode-range\u2461"}],"title":"12.1. \nChanges from the 24 December 2021 Candidate Recommendation Draft"}],"url":"https://drafts.csswg.org/css-fonts-4/#descdef-font-face-unicode-range"}, "declaration": {"dfnID":"declaration","dfnText":"declaration","external":false,"refSections":[],"url":"#declaration"}, "determine-the-fallback-encoding": {"dfnID":"determine-the-fallback-encoding","dfnText":"determine the fallback encoding","external":false,"refSections":[{"refs":[{"id":"ref-for-determine-the-fallback-encoding"}],"title":"3.2. \nThe input byte stream"},{"refs":[{"id":"ref-for-determine-the-fallback-encoding\u2460"}],"title":"8.3. \nThe @charset Rule"},{"refs":[{"id":"ref-for-determine-the-fallback-encoding\u2461"}],"title":"12.4. \nChanges from the 5 November 2013 Last Call Working Draft"}],"url":"#determine-the-fallback-encoding"}, "digit": {"dfnID":"digit","dfnText":"digit","external":false,"refSections":[{"refs":[{"id":"ref-for-digit"},{"id":"ref-for-digit\u2460"}],"title":"4.2. \nDefinitions"},{"refs":[{"id":"ref-for-digit\u2461"}],"title":"4.3.1. \nConsume a token"},{"refs":[{"id":"ref-for-digit\u2462"},{"id":"ref-for-digit\u2463"},{"id":"ref-for-digit\u2464"},{"id":"ref-for-digit\u2465"}],"title":"4.3.10. \nCheck if three code points would start a number"},{"refs":[{"id":"ref-for-digit\u2466"},{"id":"ref-for-digit\u2467"},{"id":"ref-for-digit\u2468"},{"id":"ref-for-digit\u2460\u24ea"},{"id":"ref-for-digit\u2460\u2460"}],"title":"4.3.13. \nConsume a number"},{"refs":[{"id":"ref-for-digit\u2460\u2461"},{"id":"ref-for-digit\u2460\u2462"},{"id":"ref-for-digit\u2460\u2463"}],"title":"6.2. \nThe <an+b> type"}],"url":"#digit"}, "eb0095fe": {"dfnID":"eb0095fe","dfnText":"+","external":true,"refSections":[{"refs":[{"id":"ref-for-selectordef-adjacent"},{"id":"ref-for-selectordef-adjacent\u2460"},{"id":"ref-for-selectordef-adjacent\u2461"}],"title":"6.1. \nInformal Syntax Description"}],"url":"https://drafts.csswg.org/selectors-4/#selectordef-adjacent"}, "ecf251b4": {"dfnID":"ecf251b4","dfnText":"scalar value","external":true,"refSections":[{"refs":[{"id":"ref-for-scalar-value"}],"title":"12.3. \nChanges from the 20 February 2014 Candidate Recommendation"}],"url":"https://infra.spec.whatwg.org/#scalar-value"}, "environment-encoding": {"dfnID":"environment-encoding","dfnText":"environment encoding","external":false,"refSections":[{"refs":[{"id":"ref-for-environment-encoding"},{"id":"ref-for-environment-encoding\u2460"},{"id":"ref-for-environment-encoding\u2461"}],"title":"3.2. \nThe input byte stream"},{"refs":[{"id":"ref-for-environment-encoding\u2462"}],"title":"12.5. \nChanges from the 19 September 2013 Working Draft"}],"url":"#environment-encoding"}, "eof-code-point": {"dfnID":"eof-code-point","dfnText":"EOF code point","external":false,"refSections":[],"url":"#eof-code-point"}, "escape-codepoint": {"dfnID":"escape-codepoint","dfnText":"escaping","external":false,"refSections":[{"refs":[{"id":"ref-for-escape-codepoint"}],"title":"2. \nDescription of CSS\u2019s Syntax"}],"url":"#escape-codepoint"}, "f17eedd8": {"dfnID":"f17eedd8","dfnText":"blue","external":true,"refSections":[{"refs":[{"id":"ref-for-valdef-color-blue"}],"title":"2. \nDescription of CSS\u2019s Syntax"}],"url":"https://drafts.csswg.org/css-color-4/#valdef-color-blue"}, "f8cc2828": {"dfnID":"f8cc2828","dfnText":"nested declarations rule","external":true,"refSections":[{"refs":[{"id":"ref-for-nested-declarations-rule%E2%91%A0"}],"title":"5.5.2. \nConsume an at-rule"},{"refs":[{"id":"ref-for-nested-declarations-rule%E2%91%A0\u2460"}],"title":"5.5.3. \nConsume a qualified rule"}],"url":"https://drafts.csswg.org/css-nesting-1/#nested-declarations-rule%E2%91%A0"}, "fa19c68e": {"dfnID":"fa19c68e","dfnText":"@keyframes","external":true,"refSections":[{"refs":[{"id":"ref-for-at-ruledef-keyframes"},{"id":"ref-for-at-ruledef-keyframes\u2460"},{"id":"ref-for-at-ruledef-keyframes\u2461"},{"id":"ref-for-at-ruledef-keyframes\u2462"}],"title":"7.1. \nDefining Block Contents: the <block-contents>, <declaration-list>, <qualified-rule-list>, <declaration-rule-list>, and <rule-list> productions"},{"refs":[{"id":"ref-for-at-ruledef-keyframes\u2463"}],"title":"8.1. \nStyle rules"}],"url":"https://drafts.csswg.org/css-animations-1/#at-ruledef-keyframes"}, "fca74142": {"dfnID":"fca74142","dfnText":"pop","external":true,"refSections":[{"refs":[{"id":"ref-for-stack-pop"},{"id":"ref-for-stack-pop\u2460"}],"title":"5.3. \nToken Streams"}],"url":"https://infra.spec.whatwg.org/#stack-pop"}, "ffc192db": {"dfnID":"ffc192db","dfnText":"text-decoration","external":true,"refSections":[{"refs":[{"id":"ref-for-propdef-text-decoration"}],"title":"2. \nDescription of CSS\u2019s Syntax"}],"url":"https://drafts.csswg.org/css-text-decor-3/#propdef-text-decoration"}, "function": {"dfnID":"function","dfnText":"function","external":false,"refSections":[{"refs":[{"id":"ref-for-function"}],"title":"5.2. \nCSS Parsing Results"}],"url":"#function"}, "hex-digit": {"dfnID":"hex-digit","dfnText":"hex digit","external":false,"refSections":[{"refs":[{"id":"ref-for-hex-digit"},{"id":"ref-for-hex-digit\u2460"}],"title":"2.1. \nEscaping"},{"refs":[{"id":"ref-for-hex-digit\u2461"},{"id":"ref-for-hex-digit\u2462"},{"id":"ref-for-hex-digit\u2463"}],"title":"4.3.7. \nConsume an escaped code point"},{"refs":[{"id":"ref-for-hex-digit\u2464"}],"title":"4.3.11. \nCheck if three code points would start a unicode-range"},{"refs":[{"id":"ref-for-hex-digit\u2465"},{"id":"ref-for-hex-digit\u2466"},{"id":"ref-for-hex-digit\u2467"}],"title":"4.3.14. \nConsume a unicode-range token"}],"url":"#hex-digit"}, "ident-code-point": {"dfnID":"ident-code-point","dfnText":"ident code point","external":false,"refSections":[{"refs":[{"id":"ref-for-ident-code-point"}],"title":"2. \nDescription of CSS\u2019s Syntax"},{"refs":[{"id":"ref-for-ident-code-point\u2460"}],"title":"4.3.1. \nConsume a token"},{"refs":[{"id":"ref-for-ident-code-point\u2461"}],"title":"4.3.12. \nConsume an ident sequence"}],"url":"#ident-code-point"}, "ident-sequence": {"dfnID":"ident-sequence","dfnText":"ident sequence","external":false,"refSections":[{"refs":[{"id":"ref-for-ident-sequence"}],"title":"2. \nDescription of CSS\u2019s Syntax"},{"refs":[{"id":"ref-for-ident-sequence\u2460"},{"id":"ref-for-ident-sequence\u2461"}],"title":"2.1. \nEscaping"},{"refs":[{"id":"ref-for-ident-sequence\u2462"}],"title":"4.2. \nDefinitions"},{"refs":[{"id":"ref-for-ident-sequence\u2463"}],"title":"4.3.9. \nCheck if three code points would start an ident sequence"},{"refs":[{"id":"ref-for-ident-sequence\u2464"}],"title":"12.2. \nChanges from the 16 August 2019 Candidate Recommendation"}],"url":"#ident-sequence"}, "ident-start-code-point": {"dfnID":"ident-start-code-point","dfnText":"ident-start code point","external":false,"refSections":[{"refs":[{"id":"ref-for-ident-start-code-point"}],"title":"2. \nDescription of CSS\u2019s Syntax"},{"refs":[{"id":"ref-for-ident-start-code-point\u2460"}],"title":"4.2. \nDefinitions"},{"refs":[{"id":"ref-for-ident-start-code-point\u2461"}],"title":"4.3.1. \nConsume a token"},{"refs":[{"id":"ref-for-ident-start-code-point\u2462"},{"id":"ref-for-ident-start-code-point\u2463"}],"title":"4.3.9. \nCheck if three code points would start an ident sequence"}],"url":"#ident-start-code-point"}, "input-stream": {"dfnID":"input-stream","dfnText":"input stream","external":false,"refSections":[{"refs":[{"id":"ref-for-input-stream"},{"id":"ref-for-input-stream\u2460"},{"id":"ref-for-input-stream\u2461"},{"id":"ref-for-input-stream\u2462"}],"title":"4.2. \nDefinitions"}],"url":"#input-stream"}, "invalid-rule-error": {"dfnID":"invalid-rule-error","dfnText":"invalid rule error","external":false,"refSections":[{"refs":[{"id":"ref-for-invalid-rule-error"}],"title":"5.4.6. \nParse a rule"},{"refs":[{"id":"ref-for-invalid-rule-error\u2460"}],"title":"5.5.5. \nConsume a block\u2019s contents"}],"url":"#invalid-rule-error"}, "letter": {"dfnID":"letter","dfnText":"letter","external":false,"refSections":[{"refs":[{"id":"ref-for-letter"}],"title":"4.2. \nDefinitions"}],"url":"#letter"}, "lowercase-letter": {"dfnID":"lowercase-letter","dfnText":"lowercase letter","external":false,"refSections":[{"refs":[{"id":"ref-for-lowercase-letter"}],"title":"4.2. \nDefinitions"}],"url":"#lowercase-letter"}, "maximum-allowed-code-point": {"dfnID":"maximum-allowed-code-point","dfnText":"maximum allowed code point","external":false,"refSections":[{"refs":[{"id":"ref-for-maximum-allowed-code-point"}],"title":"4.3.7. \nConsume an escaped code point"}],"url":"#maximum-allowed-code-point"}, "newline": {"dfnID":"newline","dfnText":"newline","external":false,"refSections":[{"refs":[{"id":"ref-for-newline"}],"title":"2.1. \nEscaping"},{"refs":[{"id":"ref-for-newline\u2460"}],"title":"4.2. \nDefinitions"},{"refs":[{"id":"ref-for-newline\u2461"}],"title":"4.3.5. \nConsume a string token"},{"refs":[{"id":"ref-for-newline\u2462"}],"title":"4.3.8. \nCheck if two code points are a valid escape"},{"refs":[{"id":"ref-for-newline\u2463"}],"title":"9. \nSerialization"}],"url":"#newline"}, "next-input-code-point": {"dfnID":"next-input-code-point","dfnText":"next input code point","external":false,"refSections":[{"refs":[{"id":"ref-for-next-input-code-point"},{"id":"ref-for-next-input-code-point\u2460"}],"title":"4.2. \nDefinitions"},{"refs":[{"id":"ref-for-next-input-code-point\u2461"},{"id":"ref-for-next-input-code-point\u2462"},{"id":"ref-for-next-input-code-point\u2463"},{"id":"ref-for-next-input-code-point\u2464"},{"id":"ref-for-next-input-code-point\u2465"},{"id":"ref-for-next-input-code-point\u2466"},{"id":"ref-for-next-input-code-point\u2467"}],"title":"4.3.1. \nConsume a token"},{"refs":[{"id":"ref-for-next-input-code-point\u2468"}],"title":"4.3.2. \nConsume comments"},{"refs":[{"id":"ref-for-next-input-code-point\u2460\u24ea"},{"id":"ref-for-next-input-code-point\u2460\u2460"}],"title":"4.3.3. \nConsume a numeric token"},{"refs":[{"id":"ref-for-next-input-code-point\u2460\u2461"},{"id":"ref-for-next-input-code-point\u2460\u2462"},{"id":"ref-for-next-input-code-point\u2460\u2463"},{"id":"ref-for-next-input-code-point\u2460\u2464"},{"id":"ref-for-next-input-code-point\u2460\u2465"}],"title":"4.3.4. \nConsume an ident-like token"},{"refs":[{"id":"ref-for-next-input-code-point\u2460\u2466"},{"id":"ref-for-next-input-code-point\u2460\u2467"},{"id":"ref-for-next-input-code-point\u2460\u2468"}],"title":"4.3.5. \nConsume a string token"},{"refs":[{"id":"ref-for-next-input-code-point\u2461\u24ea"},{"id":"ref-for-next-input-code-point\u2461\u2460"}],"title":"4.3.6. \nConsume a url token"},{"refs":[{"id":"ref-for-next-input-code-point\u2461\u2461"},{"id":"ref-for-next-input-code-point\u2461\u2462"}],"title":"4.3.7. \nConsume an escaped code point"},{"refs":[{"id":"ref-for-next-input-code-point\u2461\u2463"}],"title":"4.3.8. \nCheck if two code points are a valid escape"},{"refs":[{"id":"ref-for-next-input-code-point\u2461\u2464"}],"title":"4.3.9. \nCheck if three code points would start an ident sequence"},{"refs":[{"id":"ref-for-next-input-code-point\u2461\u2465"}],"title":"4.3.10. \nCheck if three code points would start a number"},{"refs":[{"id":"ref-for-next-input-code-point\u2461\u2466"}],"title":"4.3.11. \nCheck if three code points would start a unicode-range"},{"refs":[{"id":"ref-for-next-input-code-point\u2461\u2467"}],"title":"4.3.12. \nConsume an ident sequence"},{"refs":[{"id":"ref-for-next-input-code-point\u2461\u2468"},{"id":"ref-for-next-input-code-point\u2462\u24ea"},{"id":"ref-for-next-input-code-point\u2462\u2460"},{"id":"ref-for-next-input-code-point\u2462\u2461"},{"id":"ref-for-next-input-code-point\u2462\u2462"},{"id":"ref-for-next-input-code-point\u2462\u2463"},{"id":"ref-for-next-input-code-point\u2462\u2464"},{"id":"ref-for-next-input-code-point\u2462\u2465"},{"id":"ref-for-next-input-code-point\u2462\u2466"}],"title":"4.3.13. \nConsume a number"},{"refs":[{"id":"ref-for-next-input-code-point\u2462\u2467"},{"id":"ref-for-next-input-code-point\u2462\u2468"},{"id":"ref-for-next-input-code-point\u2463\u24ea"}],"title":"4.3.14. \nConsume a unicode-range token"},{"refs":[{"id":"ref-for-next-input-code-point\u2463\u2460"}],"title":"4.3.15. \nConsume the remnants of a bad url"}],"url":"#next-input-code-point"}, "non-ascii-ident-code-point": {"dfnID":"non-ascii-ident-code-point","dfnText":"non-ASCII ident code point","external":false,"refSections":[{"refs":[{"id":"ref-for-non-ascii-ident-code-point"}],"title":"4.2. \nDefinitions"},{"refs":[{"id":"ref-for-non-ascii-ident-code-point\u2460"}],"title":"12.6. \nChanges from CSS 2.1 and Selectors Level 3"}],"url":"#non-ascii-ident-code-point"}, "non-printable-code-point": {"dfnID":"non-printable-code-point","dfnText":"non-printable code point","external":false,"refSections":[{"refs":[{"id":"ref-for-non-printable-code-point"}],"title":"4.3.6. \nConsume a url token"}],"url":"#non-printable-code-point"}, "normalize-into-a-token-stream": {"dfnID":"normalize-into-a-token-stream","dfnText":"normalize into a token stream","external":false,"refSections":[{"refs":[{"id":"ref-for-normalize-into-a-token-stream"}],"title":"5.4.1. \nParse something according to a CSS grammar"},{"refs":[{"id":"ref-for-normalize-into-a-token-stream\u2460"}],"title":"5.4.2. \nParse a comma-separated list according to a CSS grammar"},{"refs":[{"id":"ref-for-normalize-into-a-token-stream\u2461"}],"title":"5.4.3. \nParse a stylesheet"},{"refs":[{"id":"ref-for-normalize-into-a-token-stream\u2462"}],"title":"5.4.4. \nParse a stylesheet\u2019s contents"},{"refs":[{"id":"ref-for-normalize-into-a-token-stream\u2463"}],"title":"5.4.5. \nParse a block\u2019s contents"},{"refs":[{"id":"ref-for-normalize-into-a-token-stream\u2464"}],"title":"5.4.6. \nParse a rule"},{"refs":[{"id":"ref-for-normalize-into-a-token-stream\u2465"}],"title":"5.4.7. \nParse a declaration"},{"refs":[{"id":"ref-for-normalize-into-a-token-stream\u2466"}],"title":"5.4.8. \nParse a component value"},{"refs":[{"id":"ref-for-normalize-into-a-token-stream\u2467"}],"title":"5.4.9. \nParse a list of component values"},{"refs":[{"id":"ref-for-normalize-into-a-token-stream\u2468"}],"title":"5.4.10. \nParse a comma-separated list of component values"}],"url":"#normalize-into-a-token-stream"}, "paren-block": {"dfnID":"paren-block","dfnText":"()-block","external":false,"refSections":[{"refs":[{"id":"ref-for-paren-block"}],"title":"5.2. \nCSS Parsing Results"}],"url":"#paren-block"}, "parse-a-blocks-contents": {"dfnID":"parse-a-blocks-contents","dfnText":"parse a block\u2019s contents","external":false,"refSections":[{"refs":[{"id":"ref-for-parse-a-blocks-contents"}],"title":"5.4. \nParser Entry Points"}],"url":"#parse-a-blocks-contents"}, "parse-a-comma-separated-list-of-component-values": {"dfnID":"parse-a-comma-separated-list-of-component-values","dfnText":"parse a comma-separated list of component values","external":false,"refSections":[{"refs":[{"id":"ref-for-parse-a-comma-separated-list-of-component-values"}],"title":"5.4.2. \nParse a comma-separated list according to a CSS grammar"},{"refs":[{"id":"ref-for-parse-a-comma-separated-list-of-component-values\u2460"}],"title":"12.3. \nChanges from the 20 February 2014 Candidate Recommendation"}],"url":"#parse-a-comma-separated-list-of-component-values"}, "parse-a-component-value": {"dfnID":"parse-a-component-value","dfnText":"parse a component value","external":false,"refSections":[{"refs":[{"id":"ref-for-parse-a-component-value"}],"title":"5.4. \nParser Entry Points"}],"url":"#parse-a-component-value"}, "parse-a-css-stylesheet": {"dfnID":"parse-a-css-stylesheet","dfnText":"parse a CSS stylesheet","external":false,"refSections":[],"url":"#parse-a-css-stylesheet"}, "parse-a-declaration": {"dfnID":"parse-a-declaration","dfnText":"parse a declaration","external":false,"refSections":[{"refs":[{"id":"ref-for-parse-a-declaration"}],"title":"5.4. \nParser Entry Points"}],"url":"#parse-a-declaration"}, "parse-a-list-of-component-values": {"dfnID":"parse-a-list-of-component-values","dfnText":"parse a list of component values","external":false,"refSections":[{"refs":[{"id":"ref-for-parse-a-list-of-component-values"}],"title":"5.4. \nParser Entry Points"},{"refs":[{"id":"ref-for-parse-a-list-of-component-values\u2460"}],"title":"5.4.1. \nParse something according to a CSS grammar"}],"url":"#parse-a-list-of-component-values"}, "parse-a-rule": {"dfnID":"parse-a-rule","dfnText":"parse a rule","external":false,"refSections":[{"refs":[{"id":"ref-for-parse-a-rule"}],"title":"5.4. \nParser Entry Points"}],"url":"#parse-a-rule"}, "parse-a-stylesheet": {"dfnID":"parse-a-stylesheet","dfnText":"parse a stylesheet","external":false,"refSections":[{"refs":[{"id":"ref-for-parse-a-stylesheet"}],"title":"5.4. \nParser Entry Points"},{"refs":[{"id":"ref-for-parse-a-stylesheet\u2460"}],"title":"8. \nCSS stylesheets"},{"refs":[{"id":"ref-for-parse-a-stylesheet\u2461"},{"id":"ref-for-parse-a-stylesheet\u2462"}],"title":"12.2. \nChanges from the 16 August 2019 Candidate Recommendation"}],"url":"#parse-a-stylesheet"}, "parse-a-stylesheets-contents": {"dfnID":"parse-a-stylesheets-contents","dfnText":"parse a stylesheet\u2019s contents","external":false,"refSections":[{"refs":[{"id":"ref-for-parse-a-stylesheets-contents"}],"title":"5.4. \nParser Entry Points"}],"url":"#parse-a-stylesheets-contents"}, "parse-error": {"dfnID":"parse-error","dfnText":"parse errors","external":false,"refSections":[{"refs":[{"id":"ref-for-parse-error"}],"title":"4.3.1. \nConsume a token"},{"refs":[{"id":"ref-for-parse-error\u2460"}],"title":"4.3.2. \nConsume comments"},{"refs":[{"id":"ref-for-parse-error\u2461"},{"id":"ref-for-parse-error\u2462"}],"title":"4.3.5. \nConsume a string token"},{"refs":[{"id":"ref-for-parse-error\u2463"},{"id":"ref-for-parse-error\u2464"},{"id":"ref-for-parse-error\u2465"},{"id":"ref-for-parse-error\u2466"}],"title":"4.3.6. \nConsume a url token"},{"refs":[{"id":"ref-for-parse-error\u2467"}],"title":"4.3.7. \nConsume an escaped code point"},{"refs":[{"id":"ref-for-parse-error\u2468"},{"id":"ref-for-parse-error\u2460\u24ea"}],"title":"5.5.3. \nConsume a qualified rule"},{"refs":[{"id":"ref-for-parse-error\u2460\u2460"}],"title":"5.5.7. \nConsume a list of component values"},{"refs":[{"id":"ref-for-parse-error\u2460\u2461"}],"title":"8. \nCSS stylesheets"}],"url":"#parse-error"}, "preserved-tokens": {"dfnID":"preserved-tokens","dfnText":"preserved tokens","external":false,"refSections":[{"refs":[{"id":"ref-for-preserved-tokens"},{"id":"ref-for-preserved-tokens\u2460"}],"title":"5.2. \nCSS Parsing Results"}],"url":"#preserved-tokens"}, "qualified-rule": {"dfnID":"qualified-rule","dfnText":"qualified rule","external":false,"refSections":[{"refs":[{"id":"ref-for-qualified-rule"},{"id":"ref-for-qualified-rule\u2460"},{"id":"ref-for-qualified-rule\u2461"},{"id":"ref-for-qualified-rule\u2462"}],"title":"2. \nDescription of CSS\u2019s Syntax"},{"refs":[{"id":"ref-for-qualified-rule\u2463"},{"id":"ref-for-qualified-rule\u2464"}],"title":"5.2. \nCSS Parsing Results"},{"refs":[{"id":"ref-for-qualified-rule\u2465"},{"id":"ref-for-qualified-rule\u2466"},{"id":"ref-for-qualified-rule\u2467"}],"title":"5.5.3. \nConsume a qualified rule"},{"refs":[{"id":"ref-for-qualified-rule\u2468"},{"id":"ref-for-qualified-rule\u2460\u24ea"},{"id":"ref-for-qualified-rule\u2460\u2460"},{"id":"ref-for-qualified-rule\u2460\u2461"},{"id":"ref-for-qualified-rule\u2460\u2462"}],"title":"7.1. \nDefining Block Contents: the <block-contents>, <declaration-list>, <qualified-rule-list>, <declaration-rule-list>, and <rule-list> productions"},{"refs":[{"id":"ref-for-qualified-rule\u2460\u2463"}],"title":"8. \nCSS stylesheets"},{"refs":[{"id":"ref-for-qualified-rule\u2460\u2464"},{"id":"ref-for-qualified-rule\u2460\u2465"}],"title":"8.1. \nStyle rules"},{"refs":[{"id":"ref-for-qualified-rule\u2460\u2466"},{"id":"ref-for-qualified-rule\u2460\u2467"}],"title":"8.2. \nAt-rules"}],"url":"#qualified-rule"}, "reconsume-the-current-input-code-point": {"dfnID":"reconsume-the-current-input-code-point","dfnText":"reconsume the current input code point","external":false,"refSections":[{"refs":[{"id":"ref-for-reconsume-the-current-input-code-point"},{"id":"ref-for-reconsume-the-current-input-code-point\u2460"},{"id":"ref-for-reconsume-the-current-input-code-point\u2461"},{"id":"ref-for-reconsume-the-current-input-code-point\u2462"},{"id":"ref-for-reconsume-the-current-input-code-point\u2463"},{"id":"ref-for-reconsume-the-current-input-code-point\u2464"},{"id":"ref-for-reconsume-the-current-input-code-point\u2465"},{"id":"ref-for-reconsume-the-current-input-code-point\u2466"},{"id":"ref-for-reconsume-the-current-input-code-point\u2467"}],"title":"4.3.1. \nConsume a token"},{"refs":[{"id":"ref-for-reconsume-the-current-input-code-point\u2468"}],"title":"4.3.5. \nConsume a string token"},{"refs":[{"id":"ref-for-reconsume-the-current-input-code-point\u2460\u24ea"}],"title":"4.3.12. \nConsume an ident sequence"}],"url":"#reconsume-the-current-input-code-point"}, "serialize-an-anb-value": {"dfnID":"serialize-an-anb-value","dfnText":"serialize an <an+b> value","external":false,"refSections":[],"url":"#serialize-an-anb-value"}, "simple-block": {"dfnID":"simple-block","dfnText":"simple block","external":false,"refSections":[{"refs":[{"id":"ref-for-simple-block"},{"id":"ref-for-simple-block\u2460"}],"title":"5.2. \nCSS Parsing Results"},{"refs":[{"id":"ref-for-simple-block\u2461"}],"title":"5.5.6. \nConsume a declaration"},{"refs":[{"id":"ref-for-simple-block\u2462"}],"title":"5.5.9. \nConsume a simple block"}],"url":"#simple-block"}, "square-block": {"dfnID":"square-block","dfnText":"[]-block","external":false,"refSections":[{"refs":[{"id":"ref-for-square-block"}],"title":"5.2. \nCSS Parsing Results"}],"url":"#square-block"}, "statement-at-rule": {"dfnID":"statement-at-rule","dfnText":"statement at-rules","external":false,"refSections":[{"refs":[{"id":"ref-for-statement-at-rule"}],"title":"5.2. \nCSS Parsing Results"},{"refs":[{"id":"ref-for-statement-at-rule\u2460"}],"title":"12.2. \nChanges from the 16 August 2019 Candidate Recommendation"}],"url":"#statement-at-rule"}, "style-rule": {"dfnID":"style-rule","dfnText":"style rule","external":false,"refSections":[{"refs":[{"id":"ref-for-style-rule"},{"id":"ref-for-style-rule\u2460"}],"title":"2. \nDescription of CSS\u2019s Syntax"},{"refs":[{"id":"ref-for-style-rule\u2461"}],"title":"7.1. \nDefining Block Contents: the <block-contents>, <declaration-list>, <qualified-rule-list>, <declaration-rule-list>, and <rule-list> productions"},{"refs":[{"id":"ref-for-style-rule\u2462"}],"title":"8. \nCSS stylesheets"},{"refs":[{"id":"ref-for-style-rule\u2463"},{"id":"ref-for-style-rule\u2464"},{"id":"ref-for-style-rule\u2465"}],"title":"8.1. \nStyle rules"},{"refs":[{"id":"ref-for-style-rule\u2466"},{"id":"ref-for-style-rule\u2467"}],"title":"8.2. \nAt-rules"},{"refs":[{"id":"ref-for-style-rule\u2468"}],"title":"12.2. \nChanges from the 16 August 2019 Candidate Recommendation"}],"url":"#style-rule"}, "token-stream-consume-a-token": {"dfnID":"token-stream-consume-a-token","dfnText":"consume a token","external":false,"refSections":[{"refs":[{"id":"ref-for-token-stream-consume-a-token"},{"id":"ref-for-token-stream-consume-a-token\u2460"}],"title":"5.5.2. \nConsume an at-rule"},{"refs":[{"id":"ref-for-token-stream-consume-a-token\u2461"}],"title":"5.5.3. \nConsume a qualified rule"},{"refs":[{"id":"ref-for-token-stream-consume-a-token\u2462"}],"title":"5.5.6. \nConsume a declaration"},{"refs":[{"id":"ref-for-token-stream-consume-a-token\u2463"}],"title":"5.5.7. \nConsume a list of component values"},{"refs":[{"id":"ref-for-token-stream-consume-a-token\u2464"}],"title":"5.5.8. \nConsume a component value"},{"refs":[{"id":"ref-for-token-stream-consume-a-token\u2465"}],"title":"5.5.10. \nConsume a function"}],"url":"#token-stream-consume-a-token"}, "token-stream-discard-a-mark": {"dfnID":"token-stream-discard-a-mark","dfnText":"discard a mark","external":false,"refSections":[{"refs":[{"id":"ref-for-token-stream-discard-a-mark"}],"title":"5.5.5. \nConsume a block\u2019s contents"}],"url":"#token-stream-discard-a-mark"}, "token-stream-discard-a-token": {"dfnID":"token-stream-discard-a-token","dfnText":"discard a token","external":false,"refSections":[{"refs":[{"id":"ref-for-token-stream-discard-a-token"}],"title":"5.3. \nToken Streams"},{"refs":[{"id":"ref-for-token-stream-discard-a-token\u2460"}],"title":"5.4.10. \nParse a comma-separated list of component values"},{"refs":[{"id":"ref-for-token-stream-discard-a-token\u2461"},{"id":"ref-for-token-stream-discard-a-token\u2462"}],"title":"5.5.1. \nConsume a stylesheet\u2019s contents"},{"refs":[{"id":"ref-for-token-stream-discard-a-token\u2463"}],"title":"5.5.2. \nConsume an at-rule"},{"refs":[{"id":"ref-for-token-stream-discard-a-token\u2464"},{"id":"ref-for-token-stream-discard-a-token\u2465"}],"title":"5.5.4. \nConsume a block"},{"refs":[{"id":"ref-for-token-stream-discard-a-token\u2466"}],"title":"5.5.5. \nConsume a block\u2019s contents"},{"refs":[{"id":"ref-for-token-stream-discard-a-token\u2467"},{"id":"ref-for-token-stream-discard-a-token\u2468"},{"id":"ref-for-token-stream-discard-a-token\u2460\u24ea"}],"title":"5.5.6. \nConsume a declaration"},{"refs":[{"id":"ref-for-token-stream-discard-a-token\u2460\u2460"},{"id":"ref-for-token-stream-discard-a-token\u2460\u2461"}],"title":"5.5.9. \nConsume a simple block"},{"refs":[{"id":"ref-for-token-stream-discard-a-token\u2460\u2462"}],"title":"5.5.10. \nConsume a function"}],"url":"#token-stream-discard-a-token"}, "token-stream-discard-whitespace": {"dfnID":"token-stream-discard-whitespace","dfnText":"discard whitespace","external":false,"refSections":[{"refs":[{"id":"ref-for-token-stream-discard-whitespace"},{"id":"ref-for-token-stream-discard-whitespace\u2460"}],"title":"5.4.6. \nParse a rule"},{"refs":[{"id":"ref-for-token-stream-discard-whitespace\u2461"}],"title":"5.4.7. \nParse a declaration"},{"refs":[{"id":"ref-for-token-stream-discard-whitespace\u2462"},{"id":"ref-for-token-stream-discard-whitespace\u2463"}],"title":"5.4.8. \nParse a component value"},{"refs":[{"id":"ref-for-token-stream-discard-whitespace\u2464"},{"id":"ref-for-token-stream-discard-whitespace\u2465"}],"title":"5.5.6. \nConsume a declaration"}],"url":"#token-stream-discard-whitespace"}, "token-stream-empty": {"dfnID":"token-stream-empty","dfnText":"empty","external":false,"refSections":[{"refs":[{"id":"ref-for-token-stream-empty"}],"title":"5.3. \nToken Streams"},{"refs":[{"id":"ref-for-token-stream-empty\u2460"},{"id":"ref-for-token-stream-empty\u2461"}],"title":"5.4.8. \nParse a component value"},{"refs":[{"id":"ref-for-token-stream-empty\u2462"}],"title":"5.4.10. \nParse a comma-separated list of component values"}],"url":"#token-stream-empty"}, "token-stream-index": {"dfnID":"token-stream-index","dfnText":"index","external":false,"refSections":[{"refs":[{"id":"ref-for-token-stream-index"},{"id":"ref-for-token-stream-index\u2460"},{"id":"ref-for-token-stream-index\u2461"},{"id":"ref-for-token-stream-index\u2462"},{"id":"ref-for-token-stream-index\u2463"},{"id":"ref-for-token-stream-index\u2464"}],"title":"5.3. \nToken Streams"}],"url":"#token-stream-index"}, "token-stream-mark": {"dfnID":"token-stream-mark","dfnText":"mark","external":false,"refSections":[{"refs":[{"id":"ref-for-token-stream-mark"}],"title":"5.3. \nToken Streams"},{"refs":[{"id":"ref-for-token-stream-mark\u2460"}],"title":"5.5.5. \nConsume a block\u2019s contents"}],"url":"#token-stream-mark"}, "token-stream-marked-indexes": {"dfnID":"token-stream-marked-indexes","dfnText":"marked indexes","external":false,"refSections":[{"refs":[{"id":"ref-for-token-stream-marked-indexes"},{"id":"ref-for-token-stream-marked-indexes\u2460"},{"id":"ref-for-token-stream-marked-indexes\u2461"}],"title":"5.3. \nToken Streams"}],"url":"#token-stream-marked-indexes"}, "token-stream-next-token": {"dfnID":"token-stream-next-token","dfnText":"next token","external":false,"refSections":[{"refs":[{"id":"ref-for-token-stream-next-token"},{"id":"ref-for-token-stream-next-token\u2460"},{"id":"ref-for-token-stream-next-token\u2461"},{"id":"ref-for-token-stream-next-token\u2462"}],"title":"5.3. \nToken Streams"},{"refs":[{"id":"ref-for-token-stream-next-token\u2463"},{"id":"ref-for-token-stream-next-token\u2464"},{"id":"ref-for-token-stream-next-token\u2465"}],"title":"5.4.6. \nParse a rule"},{"refs":[{"id":"ref-for-token-stream-next-token\u2466"}],"title":"5.5.2. \nConsume an at-rule"},{"refs":[{"id":"ref-for-token-stream-next-token\u2467"}],"title":"5.5.4. \nConsume a block"},{"refs":[{"id":"ref-for-token-stream-next-token\u2468"},{"id":"ref-for-token-stream-next-token\u2460\u24ea"}],"title":"5.5.6. \nConsume a declaration"},{"refs":[{"id":"ref-for-token-stream-next-token\u2460\u2460"},{"id":"ref-for-token-stream-next-token\u2460\u2461"},{"id":"ref-for-token-stream-next-token\u2460\u2462"}],"title":"5.5.9. \nConsume a simple block"},{"refs":[{"id":"ref-for-token-stream-next-token\u2460\u2463"}],"title":"5.5.10. \nConsume a function"}],"url":"#token-stream-next-token"}, "token-stream-process": {"dfnID":"token-stream-process","dfnText":"process","external":false,"refSections":[{"refs":[{"id":"ref-for-token-stream-process"}],"title":"5.3. \nToken Streams"},{"refs":[{"id":"ref-for-token-stream-process\u2460"}],"title":"5.5.1. \nConsume a stylesheet\u2019s contents"},{"refs":[{"id":"ref-for-token-stream-process\u2461"}],"title":"5.5.2. \nConsume an at-rule"},{"refs":[{"id":"ref-for-token-stream-process\u2462"}],"title":"5.5.3. \nConsume a qualified rule"},{"refs":[{"id":"ref-for-token-stream-process\u2463"}],"title":"5.5.5. \nConsume a block\u2019s contents"},{"refs":[{"id":"ref-for-token-stream-process\u2464"}],"title":"5.5.6. \nConsume a declaration"},{"refs":[{"id":"ref-for-token-stream-process\u2465"}],"title":"5.5.7. \nConsume a list of component values"},{"refs":[{"id":"ref-for-token-stream-process\u2466"}],"title":"5.5.8. \nConsume a component value"},{"refs":[{"id":"ref-for-token-stream-process\u2467"}],"title":"5.5.9. \nConsume a simple block"},{"refs":[{"id":"ref-for-token-stream-process\u2468"}],"title":"5.5.10. \nConsume a function"}],"url":"#token-stream-process"}, "token-stream-restore-a-mark": {"dfnID":"token-stream-restore-a-mark","dfnText":"restore a mark","external":false,"refSections":[{"refs":[{"id":"ref-for-token-stream-restore-a-mark"}],"title":"5.5.5. \nConsume a block\u2019s contents"}],"url":"#token-stream-restore-a-mark"}, "token-stream-tokens": {"dfnID":"token-stream-tokens","dfnText":"tokens","external":false,"refSections":[{"refs":[{"id":"ref-for-token-stream-tokens"},{"id":"ref-for-token-stream-tokens\u2460"},{"id":"ref-for-token-stream-tokens\u2461"},{"id":"ref-for-token-stream-tokens\u2462"},{"id":"ref-for-token-stream-tokens\u2463"}],"title":"5.3. \nToken Streams"},{"refs":[{"id":"ref-for-token-stream-tokens\u2464"},{"id":"ref-for-token-stream-tokens\u2465"},{"id":"ref-for-token-stream-tokens\u2466"}],"title":"5.4. \nParser Entry Points"},{"refs":[{"id":"ref-for-token-stream-tokens\u2467"}],"title":"5.5.3. \nConsume a qualified rule"},{"refs":[{"id":"ref-for-token-stream-tokens\u2468"}],"title":"5.5.7. \nConsume a list of component values"}],"url":"#token-stream-tokens"}, "tokendef-close-curly": {"dfnID":"tokendef-close-curly","dfnText":"<}-token>","external":false,"refSections":[{"refs":[{"id":"ref-for-tokendef-close-curly"}],"title":"2.2. \nError Handling"},{"refs":[{"id":"ref-for-tokendef-close-curly"}],"title":"4.3.1. \nConsume a token"},{"refs":[{"id":"ref-for-tokendef-close-curly"}],"title":"5.2. \nCSS Parsing Results"},{"refs":[{"id":"ref-for-tokendef-close-curly"}],"title":"5.5.2. \nConsume an at-rule"},{"refs":[{"id":"ref-for-tokendef-close-curly"}],"title":"5.5.3. \nConsume a qualified rule"},{"refs":[{"id":"ref-for-tokendef-close-curly"}],"title":"5.5.5. \nConsume a block\u2019s contents"},{"refs":[{"id":"ref-for-tokendef-close-curly"}],"title":"5.5.6. \nConsume a declaration"},{"refs":[{"id":"ref-for-tokendef-close-curly"}],"title":"5.5.7. \nConsume a list of component values"},{"refs":[{"id":"ref-for-tokendef-close-curly"}],"title":"7.2. \nDefining Arbitrary Contents: the <declaration-value> and <any-value> productions"},{"refs":[{"id":"ref-for-tokendef-close-curly"}],"title":"12.6. \nChanges from CSS 2.1 and Selectors Level 3"}],"url":"#tokendef-close-curly"}, "tokendef-close-paren": {"dfnID":"tokendef-close-paren","dfnText":"<)-token>","external":false,"refSections":[{"refs":[{"id":"ref-for-tokendef-close-paren"}],"title":"4.3.1. \nConsume a token"},{"refs":[{"id":"ref-for-tokendef-close-paren"}],"title":"5.2. \nCSS Parsing Results"},{"refs":[{"id":"ref-for-tokendef-close-paren"}],"title":"5.5.10. \nConsume a function"},{"refs":[{"id":"ref-for-tokendef-close-paren"}],"title":"7.2. \nDefining Arbitrary Contents: the <declaration-value> and <any-value> productions"}],"url":"#tokendef-close-paren"}, "tokendef-close-square": {"dfnID":"tokendef-close-square","dfnText":"<]-token>","external":false,"refSections":[{"refs":[{"id":"ref-for-tokendef-close-square"}],"title":"4.3.1. \nConsume a token"},{"refs":[{"id":"ref-for-tokendef-close-square"}],"title":"5.2. \nCSS Parsing Results"},{"refs":[{"id":"ref-for-tokendef-close-square"}],"title":"5.5.9. \nConsume a simple block"},{"refs":[{"id":"ref-for-tokendef-close-square"}],"title":"7.2. \nDefining Arbitrary Contents: the <declaration-value> and <any-value> productions"}],"url":"#tokendef-close-square"}, "tokendef-open-curly": {"dfnID":"tokendef-open-curly","dfnText":"<{-token>","external":false,"refSections":[{"refs":[{"id":"ref-for-tokendef-open-curly"}],"title":"2.2. \nError Handling"},{"refs":[{"id":"ref-for-tokendef-open-curly"}],"title":"4.3.1. \nConsume a token"},{"refs":[{"id":"ref-for-tokendef-open-curly"},{"id":"ref-for-tokendef-open-curly"}],"title":"5.2. \nCSS Parsing Results"},{"refs":[{"id":"ref-for-tokendef-open-curly"}],"title":"5.5.2. \nConsume an at-rule"},{"refs":[{"id":"ref-for-tokendef-open-curly"}],"title":"5.5.3. \nConsume a qualified rule"},{"refs":[{"id":"ref-for-tokendef-open-curly"}],"title":"5.5.4. \nConsume a block"},{"refs":[{"id":"ref-for-tokendef-open-curly"},{"id":"ref-for-tokendef-open-curly\u2460"}],"title":"5.5.5. \nConsume a block\u2019s contents"},{"refs":[{"id":"ref-for-tokendef-open-curly\u2461"}],"title":"5.5.6. \nConsume a declaration"},{"refs":[{"id":"ref-for-tokendef-open-curly"}],"title":"5.5.8. \nConsume a component value"},{"refs":[{"id":"ref-for-tokendef-open-curly"}],"title":"5.5.9. \nConsume a simple block"}],"url":"#tokendef-open-curly"}, "tokendef-open-paren": {"dfnID":"tokendef-open-paren","dfnText":"<(-token>","external":false,"refSections":[{"refs":[{"id":"ref-for-tokendef-open-paren"}],"title":"4.3.1. \nConsume a token"},{"refs":[{"id":"ref-for-tokendef-open-paren"},{"id":"ref-for-tokendef-open-paren"}],"title":"5.2. \nCSS Parsing Results"},{"refs":[{"id":"ref-for-tokendef-open-paren"}],"title":"5.5.8. \nConsume a component value"},{"refs":[{"id":"ref-for-tokendef-open-paren"}],"title":"5.5.9. \nConsume a simple block"},{"refs":[{"id":"ref-for-tokendef-open-paren"}],"title":"9. \nSerialization"}],"url":"#tokendef-open-paren"}, "tokendef-open-square": {"dfnID":"tokendef-open-square","dfnText":"<[-token>","external":false,"refSections":[{"refs":[{"id":"ref-for-tokendef-open-square"}],"title":"4.3.1. \nConsume a token"},{"refs":[{"id":"ref-for-tokendef-open-square"},{"id":"ref-for-tokendef-open-square"}],"title":"5.2. \nCSS Parsing Results"},{"refs":[{"id":"ref-for-tokendef-open-square"}],"title":"5.5.8. \nConsume a component value"},{"refs":[{"id":"ref-for-tokendef-open-square"},{"id":"ref-for-tokendef-open-square"}],"title":"5.5.9. \nConsume a simple block"}],"url":"#tokendef-open-square"}, "tokenizer-consume-a-token": {"dfnID":"tokenizer-consume-a-token","dfnText":"consume a token","external":false,"refSections":[{"refs":[{"id":"ref-for-tokenizer-consume-a-token"},{"id":"ref-for-tokenizer-consume-a-token\u2460"}],"title":"4. \nTokenization"},{"refs":[{"id":"ref-for-tokenizer-consume-a-token\u2461"}],"title":"12.3. \nChanges from the 20 February 2014 Candidate Recommendation"}],"url":"#tokenizer-consume-a-token"}, "typedef-any-value": {"dfnID":"typedef-any-value","dfnText":"<any-value>","external":false,"refSections":[{"refs":[{"id":"ref-for-typedef-any-value"}],"title":"7.2. \nDefining Arbitrary Contents: the <declaration-value> and <any-value> productions"},{"refs":[{"id":"ref-for-typedef-any-value\u2460"}],"title":"12.3. \nChanges from the 20 February 2014 Candidate Recommendation"}],"url":"#typedef-any-value"}, "typedef-at-keyword-token": {"dfnID":"typedef-at-keyword-token","dfnText":"<at-keyword-token>","external":false,"refSections":[{"refs":[{"id":"ref-for-typedef-at-keyword-token"}],"title":"2.2. \nError Handling"},{"refs":[{"id":"ref-for-typedef-at-keyword-token\u2460"}],"title":"4. \nTokenization"},{"refs":[{"id":"ref-for-typedef-at-keyword-token\u2461"}],"title":"4.1. \nToken Railroad Diagrams"},{"refs":[{"id":"ref-for-typedef-at-keyword-token\u2462"}],"title":"4.2. \nDefinitions"},{"refs":[{"id":"ref-for-typedef-at-keyword-token\u2463"}],"title":"4.3.1. \nConsume a token"},{"refs":[{"id":"ref-for-typedef-at-keyword-token\u2464"}],"title":"5.4.6. \nParse a rule"},{"refs":[{"id":"ref-for-typedef-at-keyword-token\u2465"}],"title":"5.5.1. \nConsume a stylesheet\u2019s contents"},{"refs":[{"id":"ref-for-typedef-at-keyword-token\u2466"}],"title":"5.5.2. \nConsume an at-rule"},{"refs":[{"id":"ref-for-typedef-at-keyword-token\u2467"}],"title":"5.5.5. \nConsume a block\u2019s contents"},{"refs":[{"id":"ref-for-typedef-at-keyword-token\u2468"},{"id":"ref-for-typedef-at-keyword-token\u2460\u24ea"}],"title":"12.6. \nChanges from CSS 2.1 and Selectors Level 3"}],"url":"#typedef-at-keyword-token"}, "typedef-at-rule-list": {"dfnID":"typedef-at-rule-list","dfnText":"<at-rule-list>","external":false,"refSections":[],"url":"#typedef-at-rule-list"}, "typedef-bad-string-token": {"dfnID":"typedef-bad-string-token","dfnText":"<bad-string-token>","external":false,"refSections":[{"refs":[{"id":"ref-for-typedef-bad-string-token"},{"id":"ref-for-typedef-bad-string-token\u2460"}],"title":"4.3.5. \nConsume a string token"},{"refs":[{"id":"ref-for-typedef-bad-string-token\u2461"}],"title":"5.2. \nCSS Parsing Results"},{"refs":[{"id":"ref-for-typedef-bad-string-token\u2462"}],"title":"7.2. \nDefining Arbitrary Contents: the <declaration-value> and <any-value> productions"}],"url":"#typedef-bad-string-token"}, "typedef-bad-url-token": {"dfnID":"typedef-bad-url-token","dfnText":"<bad-url-token>","external":false,"refSections":[{"refs":[{"id":"ref-for-typedef-bad-url-token"}],"title":"4.3.4. \nConsume an ident-like token"},{"refs":[{"id":"ref-for-typedef-bad-url-token\u2460"},{"id":"ref-for-typedef-bad-url-token\u2461"},{"id":"ref-for-typedef-bad-url-token\u2462"},{"id":"ref-for-typedef-bad-url-token\u2463"}],"title":"4.3.6. \nConsume a url token"},{"refs":[{"id":"ref-for-typedef-bad-url-token\u2464"},{"id":"ref-for-typedef-bad-url-token\u2465"}],"title":"4.3.15. \nConsume the remnants of a bad url"},{"refs":[{"id":"ref-for-typedef-bad-url-token\u2466"}],"title":"5.2. \nCSS Parsing Results"},{"refs":[{"id":"ref-for-typedef-bad-url-token\u2467"}],"title":"7.2. \nDefining Arbitrary Contents: the <declaration-value> and <any-value> productions"},{"refs":[{"id":"ref-for-typedef-bad-url-token\u2468"},{"id":"ref-for-typedef-bad-url-token\u2460\u24ea"}],"title":"12.6. \nChanges from CSS 2.1 and Selectors Level 3"}],"url":"#typedef-bad-url-token"}, "typedef-block-contents": {"dfnID":"typedef-block-contents","dfnText":"<block-contents>","external":false,"refSections":[{"refs":[{"id":"ref-for-typedef-block-contents"},{"id":"ref-for-typedef-block-contents\u2460"},{"id":"ref-for-typedef-block-contents\u2461"},{"id":"ref-for-typedef-block-contents\u2462"}],"title":"7.1. \nDefining Block Contents: the <block-contents>, <declaration-list>, <qualified-rule-list>, <declaration-rule-list>, and <rule-list> productions"}],"url":"#typedef-block-contents"}, "typedef-cdc-token": {"dfnID":"typedef-cdc-token","dfnText":"<CDC-token>","external":false,"refSections":[{"refs":[{"id":"ref-for-typedef-cdc-token"}],"title":"4.1. \nToken Railroad Diagrams"},{"refs":[{"id":"ref-for-typedef-cdc-token\u2460"}],"title":"4.3.1. \nConsume a token"},{"refs":[{"id":"ref-for-typedef-cdc-token\u2461"}],"title":"5.5.1. \nConsume a stylesheet\u2019s contents"},{"refs":[{"id":"ref-for-typedef-cdc-token\u2462"}],"title":"12.3. \nChanges from the 20 February 2014 Candidate Recommendation"}],"url":"#typedef-cdc-token"}, "typedef-cdo-token": {"dfnID":"typedef-cdo-token","dfnText":"<CDO-token>","external":false,"refSections":[{"refs":[{"id":"ref-for-typedef-cdo-token"}],"title":"4.1. \nToken Railroad Diagrams"},{"refs":[{"id":"ref-for-typedef-cdo-token\u2460"}],"title":"4.3.1. \nConsume a token"},{"refs":[{"id":"ref-for-typedef-cdo-token\u2461"}],"title":"5.5.1. \nConsume a stylesheet\u2019s contents"}],"url":"#typedef-cdo-token"}, "typedef-colon-token": {"dfnID":"typedef-colon-token","dfnText":"<colon-token>","external":false,"refSections":[{"refs":[{"id":"ref-for-typedef-colon-token"}],"title":"4.3.1. \nConsume a token"},{"refs":[{"id":"ref-for-typedef-colon-token\u2460"}],"title":"5.5.3. \nConsume a qualified rule"},{"refs":[{"id":"ref-for-typedef-colon-token\u2461"}],"title":"5.5.5. \nConsume a block\u2019s contents"},{"refs":[{"id":"ref-for-typedef-colon-token\u2462"}],"title":"5.5.6. \nConsume a declaration"}],"url":"#typedef-colon-token"}, "typedef-comma-token": {"dfnID":"typedef-comma-token","dfnText":"<comma-token>","external":false,"refSections":[{"refs":[{"id":"ref-for-typedef-comma-token"}],"title":"4.3.1. \nConsume a token"},{"refs":[{"id":"ref-for-typedef-comma-token\u2460"}],"title":"5.4.10. \nParse a comma-separated list of component values"},{"refs":[{"id":"ref-for-typedef-comma-token\u2461"}],"title":"12.6. \nChanges from CSS 2.1 and Selectors Level 3"}],"url":"#typedef-comma-token"}, "typedef-dashndashdigit-ident": {"dfnID":"typedef-dashndashdigit-ident","dfnText":"<dashndashdigit-ident>","external":false,"refSections":[],"url":"#typedef-dashndashdigit-ident"}, "typedef-declaration-list": {"dfnID":"typedef-declaration-list","dfnText":"<declaration-list>","external":false,"refSections":[{"refs":[{"id":"ref-for-typedef-declaration-list"},{"id":"ref-for-typedef-declaration-list\u2460"},{"id":"ref-for-typedef-declaration-list\u2461"},{"id":"ref-for-typedef-declaration-list\u2462"}],"title":"7.1. \nDefining Block Contents: the <block-contents>, <declaration-list>, <qualified-rule-list>, <declaration-rule-list>, and <rule-list> productions"},{"refs":[{"id":"ref-for-typedef-declaration-list\u2463"}],"title":"8.1. \nStyle rules"}],"url":"#typedef-declaration-list"}, "typedef-declaration-rule-list": {"dfnID":"typedef-declaration-rule-list","dfnText":"<declaration-rule-list>","external":false,"refSections":[{"refs":[{"id":"ref-for-typedef-declaration-rule-list"},{"id":"ref-for-typedef-declaration-rule-list\u2460"}],"title":"7.1. \nDefining Block Contents: the <block-contents>, <declaration-list>, <qualified-rule-list>, <declaration-rule-list>, and <rule-list> productions"}],"url":"#typedef-declaration-rule-list"}, "typedef-declaration-value": {"dfnID":"typedef-declaration-value","dfnText":"<declaration-value>","external":false,"refSections":[{"refs":[{"id":"ref-for-typedef-declaration-value"},{"id":"ref-for-typedef-declaration-value\u2460"}],"title":"7.2. \nDefining Arbitrary Contents: the <declaration-value> and <any-value> productions"},{"refs":[{"id":"ref-for-typedef-declaration-value\u2461"}],"title":"12.3. \nChanges from the 20 February 2014 Candidate Recommendation"}],"url":"#typedef-declaration-value"}, "typedef-delim-token": {"dfnID":"typedef-delim-token","dfnText":"<delim-token>","external":false,"refSections":[{"refs":[{"id":"ref-for-typedef-delim-token"}],"title":"4. \nTokenization"},{"refs":[{"id":"ref-for-typedef-delim-token\u2460"},{"id":"ref-for-typedef-delim-token\u2461"},{"id":"ref-for-typedef-delim-token\u2462"},{"id":"ref-for-typedef-delim-token\u2463"},{"id":"ref-for-typedef-delim-token\u2464"},{"id":"ref-for-typedef-delim-token\u2465"},{"id":"ref-for-typedef-delim-token\u2466"},{"id":"ref-for-typedef-delim-token\u2467"}],"title":"4.3.1. \nConsume a token"},{"refs":[{"id":"ref-for-typedef-delim-token\u2468"}],"title":"5.5.6. \nConsume a declaration"},{"refs":[{"id":"ref-for-typedef-delim-token\u2460\u24ea"},{"id":"ref-for-typedef-delim-token\u2460\u2460"}],"title":"7.2. \nDefining Arbitrary Contents: the <declaration-value> and <any-value> productions"},{"refs":[{"id":"ref-for-typedef-delim-token\u2460\u2461"},{"id":"ref-for-typedef-delim-token\u2460\u2462"}],"title":"9. \nSerialization"},{"refs":[{"id":"ref-for-typedef-delim-token\u2460\u2463"}],"title":"12.3. \nChanges from the 20 February 2014 Candidate Recommendation"},{"refs":[{"id":"ref-for-typedef-delim-token\u2460\u2464"}],"title":"12.6. \nChanges from CSS 2.1 and Selectors Level 3"}],"url":"#typedef-delim-token"}, "typedef-dimension-token": {"dfnID":"typedef-dimension-token","dfnText":"<dimension-token>","external":false,"refSections":[{"refs":[{"id":"ref-for-typedef-dimension-token"},{"id":"ref-for-typedef-dimension-token\u2460"},{"id":"ref-for-typedef-dimension-token\u2461"}],"title":"4. \nTokenization"},{"refs":[{"id":"ref-for-typedef-dimension-token\u2462"}],"title":"4.1. \nToken Railroad Diagrams"},{"refs":[{"id":"ref-for-typedef-dimension-token\u2463"}],"title":"4.2. \nDefinitions"},{"refs":[{"id":"ref-for-typedef-dimension-token\u2464"},{"id":"ref-for-typedef-dimension-token\u2465"},{"id":"ref-for-typedef-dimension-token\u2466"},{"id":"ref-for-typedef-dimension-token\u2467"}],"title":"4.3.3. \nConsume a numeric token"},{"refs":[{"id":"ref-for-typedef-dimension-token\u2468"},{"id":"ref-for-typedef-dimension-token\u2460\u24ea"},{"id":"ref-for-typedef-dimension-token\u2460\u2460"}],"title":"6.2. \nThe <an+b> type"},{"refs":[{"id":"ref-for-typedef-dimension-token\u2460\u2461"}],"title":"9. \nSerialization"},{"refs":[{"id":"ref-for-typedef-dimension-token\u2460\u2462"},{"id":"ref-for-typedef-dimension-token\u2460\u2463"}],"title":"12.6. \nChanges from CSS 2.1 and Selectors Level 3"}],"url":"#typedef-dimension-token"}, "typedef-eof-token": {"dfnID":"typedef-eof-token","dfnText":"<eof-token>","external":false,"refSections":[{"refs":[{"id":"ref-for-typedef-eof-token"}],"title":"4. \nTokenization"},{"refs":[{"id":"ref-for-typedef-eof-token\u2460"}],"title":"4.3.1. \nConsume a token"},{"refs":[{"id":"ref-for-typedef-eof-token\u2461"},{"id":"ref-for-typedef-eof-token\u2462"},{"id":"ref-for-typedef-eof-token\u2463"}],"title":"5.3. \nToken Streams"},{"refs":[{"id":"ref-for-typedef-eof-token\u2464"},{"id":"ref-for-typedef-eof-token\u2465"}],"title":"5.4.6. \nParse a rule"},{"refs":[{"id":"ref-for-typedef-eof-token\u2466"}],"title":"5.5.1. \nConsume a stylesheet\u2019s contents"},{"refs":[{"id":"ref-for-typedef-eof-token\u2467"}],"title":"5.5.2. \nConsume an at-rule"},{"refs":[{"id":"ref-for-typedef-eof-token\u2468"}],"title":"5.5.3. \nConsume a qualified rule"},{"refs":[{"id":"ref-for-typedef-eof-token\u2460\u24ea"}],"title":"5.5.5. \nConsume a block\u2019s contents"},{"refs":[{"id":"ref-for-typedef-eof-token\u2460\u2460"}],"title":"5.5.6. \nConsume a declaration"},{"refs":[{"id":"ref-for-typedef-eof-token\u2460\u2461"}],"title":"5.5.7. \nConsume a list of component values"},{"refs":[{"id":"ref-for-typedef-eof-token\u2460\u2462"}],"title":"5.5.9. \nConsume a simple block"},{"refs":[{"id":"ref-for-typedef-eof-token\u2460\u2463"}],"title":"5.5.10. \nConsume a function"}],"url":"#typedef-eof-token"}, "typedef-function-token": {"dfnID":"typedef-function-token","dfnText":"<function-token>","external":false,"refSections":[{"refs":[{"id":"ref-for-typedef-function-token"}],"title":"4. \nTokenization"},{"refs":[{"id":"ref-for-typedef-function-token\u2460"}],"title":"4.1. \nToken Railroad Diagrams"},{"refs":[{"id":"ref-for-typedef-function-token\u2461"}],"title":"4.2. \nDefinitions"},{"refs":[{"id":"ref-for-typedef-function-token\u2462"},{"id":"ref-for-typedef-function-token\u2463"},{"id":"ref-for-typedef-function-token\u2464"}],"title":"4.3.4. \nConsume an ident-like token"},{"refs":[{"id":"ref-for-typedef-function-token\u2465"}],"title":"4.3.6. \nConsume a url token"},{"refs":[{"id":"ref-for-typedef-function-token\u2466"}],"title":"5.2. \nCSS Parsing Results"},{"refs":[{"id":"ref-for-typedef-function-token\u2467"}],"title":"5.5.8. \nConsume a component value"},{"refs":[{"id":"ref-for-typedef-function-token\u2468"}],"title":"5.5.10. \nConsume a function"},{"refs":[{"id":"ref-for-typedef-function-token\u2460\u24ea"}],"title":"12.3. \nChanges from the 20 February 2014 Candidate Recommendation"},{"refs":[{"id":"ref-for-typedef-function-token\u2460\u2460"}],"title":"12.6. \nChanges from CSS 2.1 and Selectors Level 3"}],"url":"#typedef-function-token"}, "typedef-hash-token": {"dfnID":"typedef-hash-token","dfnText":"<hash-token>","external":false,"refSections":[{"refs":[{"id":"ref-for-typedef-hash-token"}],"title":"4. \nTokenization"},{"refs":[{"id":"ref-for-typedef-hash-token\u2460"}],"title":"4.1. \nToken Railroad Diagrams"},{"refs":[{"id":"ref-for-typedef-hash-token\u2461"}],"title":"4.2. \nDefinitions"},{"refs":[{"id":"ref-for-typedef-hash-token\u2462"},{"id":"ref-for-typedef-hash-token\u2463"},{"id":"ref-for-typedef-hash-token\u2464"},{"id":"ref-for-typedef-hash-token\u2465"}],"title":"4.3.1. \nConsume a token"},{"refs":[{"id":"ref-for-typedef-hash-token\u2466"}],"title":"9. \nSerialization"}],"url":"#typedef-hash-token"}, "typedef-ident-token": {"dfnID":"typedef-ident-token","dfnText":"<ident-token>","external":false,"refSections":[{"refs":[{"id":"ref-for-typedef-ident-token"}],"title":"4. \nTokenization"},{"refs":[{"id":"ref-for-typedef-ident-token\u2460"}],"title":"4.1. \nToken Railroad Diagrams"},{"refs":[{"id":"ref-for-typedef-ident-token\u2461"}],"title":"4.2. \nDefinitions"},{"refs":[{"id":"ref-for-typedef-ident-token\u2462"},{"id":"ref-for-typedef-ident-token\u2463"}],"title":"4.3.4. \nConsume an ident-like token"},{"refs":[{"id":"ref-for-typedef-ident-token\u2464"}],"title":"4.3.12. \nConsume an ident sequence"},{"refs":[{"id":"ref-for-typedef-ident-token\u2465"}],"title":"5.5.3. \nConsume a qualified rule"},{"refs":[{"id":"ref-for-typedef-ident-token\u2466"}],"title":"5.5.5. \nConsume a block\u2019s contents"},{"refs":[{"id":"ref-for-typedef-ident-token\u2467"},{"id":"ref-for-typedef-ident-token\u2468"}],"title":"5.5.6. \nConsume a declaration"},{"refs":[{"id":"ref-for-typedef-ident-token\u2460\u24ea"},{"id":"ref-for-typedef-ident-token\u2460\u2460"}],"title":"6.2. \nThe <an+b> type"},{"refs":[{"id":"ref-for-typedef-ident-token\u2460\u2461"}],"title":"12.3. \nChanges from the 20 February 2014 Candidate Recommendation"},{"refs":[{"id":"ref-for-typedef-ident-token\u2460\u2462"},{"id":"ref-for-typedef-ident-token\u2460\u2463"}],"title":"12.6. \nChanges from CSS 2.1 and Selectors Level 3"}],"url":"#typedef-ident-token"}, "typedef-integer": {"dfnID":"typedef-integer","dfnText":"<integer>","external":false,"refSections":[],"url":"#typedef-integer"}, "typedef-n-dimension": {"dfnID":"typedef-n-dimension","dfnText":"<n-dimension>","external":false,"refSections":[],"url":"#typedef-n-dimension"}, "typedef-ndash-dimension": {"dfnID":"typedef-ndash-dimension","dfnText":"<ndash-dimension>","external":false,"refSections":[],"url":"#typedef-ndash-dimension"}, "typedef-ndashdigit-dimension": {"dfnID":"typedef-ndashdigit-dimension","dfnText":"<ndashdigit-dimension>","external":false,"refSections":[],"url":"#typedef-ndashdigit-dimension"}, "typedef-ndashdigit-ident": {"dfnID":"typedef-ndashdigit-ident","dfnText":"<ndashdigit-ident>","external":false,"refSections":[],"url":"#typedef-ndashdigit-ident"}, "typedef-number-token": {"dfnID":"typedef-number-token","dfnText":"<number-token>","external":false,"refSections":[{"refs":[{"id":"ref-for-typedef-number-token"},{"id":"ref-for-typedef-number-token\u2460"}],"title":"4. \nTokenization"},{"refs":[{"id":"ref-for-typedef-number-token\u2461"}],"title":"4.1. \nToken Railroad Diagrams"},{"refs":[{"id":"ref-for-typedef-number-token\u2462"},{"id":"ref-for-typedef-number-token\u2463"}],"title":"4.3.3. \nConsume a numeric token"},{"refs":[{"id":"ref-for-typedef-number-token\u2464"},{"id":"ref-for-typedef-number-token\u2465"},{"id":"ref-for-typedef-number-token\u2466"}],"title":"6.2. \nThe <an+b> type"},{"refs":[{"id":"ref-for-typedef-number-token\u2467"}],"title":"12.6. \nChanges from CSS 2.1 and Selectors Level 3"}],"url":"#typedef-number-token"}, "typedef-percentage-token": {"dfnID":"typedef-percentage-token","dfnText":"<percentage-token>","external":false,"refSections":[{"refs":[{"id":"ref-for-typedef-percentage-token"}],"title":"4. \nTokenization"},{"refs":[{"id":"ref-for-typedef-percentage-token\u2460"}],"title":"4.1. \nToken Railroad Diagrams"},{"refs":[{"id":"ref-for-typedef-percentage-token\u2461"},{"id":"ref-for-typedef-percentage-token\u2462"}],"title":"4.3.3. \nConsume a numeric token"},{"refs":[{"id":"ref-for-typedef-percentage-token\u2463"}],"title":"12.6. \nChanges from CSS 2.1 and Selectors Level 3"}],"url":"#typedef-percentage-token"}, "typedef-qualified-rule-list": {"dfnID":"typedef-qualified-rule-list","dfnText":"<qualified-rule-list>","external":false,"refSections":[{"refs":[{"id":"ref-for-typedef-qualified-rule-list"},{"id":"ref-for-typedef-qualified-rule-list\u2460"},{"id":"ref-for-typedef-qualified-rule-list\u2461"}],"title":"7.1. \nDefining Block Contents: the <block-contents>, <declaration-list>, <qualified-rule-list>, <declaration-rule-list>, and <rule-list> productions"}],"url":"#typedef-qualified-rule-list"}, "typedef-rule-list": {"dfnID":"typedef-rule-list","dfnText":"<rule-list>","external":false,"refSections":[{"refs":[{"id":"ref-for-typedef-rule-list"},{"id":"ref-for-typedef-rule-list\u2460"}],"title":"7.1. \nDefining Block Contents: the <block-contents>, <declaration-list>, <qualified-rule-list>, <declaration-rule-list>, and <rule-list> productions"}],"url":"#typedef-rule-list"}, "typedef-semicolon-token": {"dfnID":"typedef-semicolon-token","dfnText":"<semicolon-token>","external":false,"refSections":[{"refs":[{"id":"ref-for-typedef-semicolon-token"}],"title":"2.2. \nError Handling"},{"refs":[{"id":"ref-for-typedef-semicolon-token\u2460"}],"title":"4.3.1. \nConsume a token"},{"refs":[{"id":"ref-for-typedef-semicolon-token\u2461"}],"title":"5.5.2. \nConsume an at-rule"},{"refs":[{"id":"ref-for-typedef-semicolon-token\u2462"},{"id":"ref-for-typedef-semicolon-token\u2463"}],"title":"5.5.5. \nConsume a block\u2019s contents"},{"refs":[{"id":"ref-for-typedef-semicolon-token\u2464"},{"id":"ref-for-typedef-semicolon-token\u2465"}],"title":"5.5.6. \nConsume a declaration"},{"refs":[{"id":"ref-for-typedef-semicolon-token\u2466"},{"id":"ref-for-typedef-semicolon-token\u2467"}],"title":"7.2. \nDefining Arbitrary Contents: the <declaration-value> and <any-value> productions"},{"refs":[{"id":"ref-for-typedef-semicolon-token\u2468"},{"id":"ref-for-typedef-semicolon-token\u2460\u24ea"}],"title":"12.6. \nChanges from CSS 2.1 and Selectors Level 3"}],"url":"#typedef-semicolon-token"}, "typedef-signed-integer": {"dfnID":"typedef-signed-integer","dfnText":"<signed-integer>","external":false,"refSections":[],"url":"#typedef-signed-integer"}, "typedef-signless-integer": {"dfnID":"typedef-signless-integer","dfnText":"<signless-integer>","external":false,"refSections":[],"url":"#typedef-signless-integer"}, "typedef-string-token": {"dfnID":"typedef-string-token","dfnText":"<string-token>","external":false,"refSections":[{"refs":[{"id":"ref-for-typedef-string-token"}],"title":"4. \nTokenization"},{"refs":[{"id":"ref-for-typedef-string-token\u2460"}],"title":"4.1. \nToken Railroad Diagrams"},{"refs":[{"id":"ref-for-typedef-string-token\u2461"},{"id":"ref-for-typedef-string-token\u2462"},{"id":"ref-for-typedef-string-token\u2463"},{"id":"ref-for-typedef-string-token\u2464"},{"id":"ref-for-typedef-string-token\u2465"},{"id":"ref-for-typedef-string-token\u2466"}],"title":"4.3.5. \nConsume a string token"},{"refs":[{"id":"ref-for-typedef-string-token\u2467"}],"title":"12.6. \nChanges from CSS 2.1 and Selectors Level 3"}],"url":"#typedef-string-token"}, "typedef-unicode-range-token": {"dfnID":"typedef-unicode-range-token","dfnText":"<unicode-range-token>","external":false,"refSections":[{"refs":[{"id":"ref-for-typedef-unicode-range-token"}],"title":"4. \nTokenization"},{"refs":[{"id":"ref-for-typedef-unicode-range-token\u2460"}],"title":"4.1. \nToken Railroad Diagrams"},{"refs":[{"id":"ref-for-typedef-unicode-range-token\u2461"},{"id":"ref-for-typedef-unicode-range-token\u2462"},{"id":"ref-for-typedef-unicode-range-token\u2463"},{"id":"ref-for-typedef-unicode-range-token\u2464"},{"id":"ref-for-typedef-unicode-range-token\u2465"}],"title":"4.3.14. \nConsume a unicode-range token"},{"refs":[{"id":"ref-for-typedef-unicode-range-token\u2466"}],"title":"12.3. \nChanges from the 20 February 2014 Candidate Recommendation"},{"refs":[{"id":"ref-for-typedef-unicode-range-token\u2467"}],"title":"12.6. \nChanges from CSS 2.1 and Selectors Level 3"}],"url":"#typedef-unicode-range-token"}, "typedef-url-token": {"dfnID":"typedef-url-token","dfnText":"<url-token>","external":false,"refSections":[{"refs":[{"id":"ref-for-typedef-url-token"}],"title":"4. \nTokenization"},{"refs":[{"id":"ref-for-typedef-url-token\u2460"}],"title":"4.1. \nToken Railroad Diagrams"},{"refs":[{"id":"ref-for-typedef-url-token\u2461"}],"title":"4.3.4. \nConsume an ident-like token"},{"refs":[{"id":"ref-for-typedef-url-token\u2462"},{"id":"ref-for-typedef-url-token\u2463"},{"id":"ref-for-typedef-url-token\u2464"},{"id":"ref-for-typedef-url-token\u2465"},{"id":"ref-for-typedef-url-token\u2466"},{"id":"ref-for-typedef-url-token\u2467"},{"id":"ref-for-typedef-url-token\u2468"}],"title":"4.3.6. \nConsume a url token"},{"refs":[{"id":"ref-for-typedef-url-token\u2460\u24ea"}],"title":"4.3.15. \nConsume the remnants of a bad url"},{"refs":[{"id":"ref-for-typedef-url-token\u2460\u2460"}],"title":"12.3. \nChanges from the 20 February 2014 Candidate Recommendation"},{"refs":[{"id":"ref-for-typedef-url-token\u2460\u2461"},{"id":"ref-for-typedef-url-token\u2460\u2462"}],"title":"12.6. \nChanges from CSS 2.1 and Selectors Level 3"}],"url":"#typedef-url-token"}, "typedef-whitespace-token": {"dfnID":"typedef-whitespace-token","dfnText":"<whitespace-token>","external":false,"refSections":[{"refs":[{"id":"ref-for-typedef-whitespace-token"}],"title":"4.1. \nToken Railroad Diagrams"},{"refs":[{"id":"ref-for-typedef-whitespace-token\u2460"}],"title":"4.3.1. \nConsume a token"},{"refs":[{"id":"ref-for-typedef-whitespace-token\u2461"}],"title":"5.3. \nToken Streams"},{"refs":[{"id":"ref-for-typedef-whitespace-token\u2462"}],"title":"5.4.2. \nParse a comma-separated list according to a CSS grammar"},{"refs":[{"id":"ref-for-typedef-whitespace-token\u2463"}],"title":"5.5.1. \nConsume a stylesheet\u2019s contents"},{"refs":[{"id":"ref-for-typedef-whitespace-token\u2464"}],"title":"5.5.3. \nConsume a qualified rule"},{"refs":[{"id":"ref-for-typedef-whitespace-token\u2465"}],"title":"5.5.5. \nConsume a block\u2019s contents"},{"refs":[{"id":"ref-for-typedef-whitespace-token\u2466"},{"id":"ref-for-typedef-whitespace-token\u2467"},{"id":"ref-for-typedef-whitespace-token\u2468"}],"title":"5.5.6. \nConsume a declaration"},{"refs":[{"id":"ref-for-typedef-whitespace-token\u2460\u24ea"},{"id":"ref-for-typedef-whitespace-token\u2460\u2460"}],"title":"9. \nSerialization"}],"url":"#typedef-whitespace-token"}, "uppercase-letter": {"dfnID":"uppercase-letter","dfnText":"uppercase letter","external":false,"refSections":[{"refs":[{"id":"ref-for-uppercase-letter"}],"title":"4.2. \nDefinitions"}],"url":"#uppercase-letter"}, "whitespace": {"dfnID":"whitespace","dfnText":"whitespace","external":false,"refSections":[{"refs":[{"id":"ref-for-whitespace"}],"title":"2.1. \nEscaping"},{"refs":[{"id":"ref-for-whitespace\u2460"},{"id":"ref-for-whitespace\u2461"}],"title":"4.3.1. \nConsume a token"},{"refs":[{"id":"ref-for-whitespace\u2462"},{"id":"ref-for-whitespace\u2463"}],"title":"4.3.4. \nConsume an ident-like token"},{"refs":[{"id":"ref-for-whitespace\u2464"},{"id":"ref-for-whitespace\u2465"},{"id":"ref-for-whitespace\u2466"}],"title":"4.3.6. \nConsume a url token"},{"refs":[{"id":"ref-for-whitespace\u2467"}],"title":"4.3.7. \nConsume an escaped code point"}],"url":"#whitespace"}, }; document.addEventListener("DOMContentLoaded", ()=>{ genAllDfnPanels(); document.body.addEventListener("click", (e) => { // If not handled already, just hide all dfn panels. hideAllDfnPanels(); }); }); window.addEventListener("resize", () => { // Pin any visible dfn panel queryAll(".dfn-panel.on, .dfn-panel.activated").forEach(el=>positionDfnPanel(el)); }); function genAllDfnPanels() { for(const panelData of Object.values(dfnPanelData)) { const dfnID = panelData.dfnID; const dfn = document.getElementById(dfnID); if(!dfn) { console.log(`Can't find dfn#${dfnID}.`, panelData); continue; } dfn.panelData = panelData; insertDfnPopupAction(dfn); } } function genDfnPanel(dfn, { dfnID, url, dfnText, refSections, external }) { const dfnPanel = mk.aside({ class: "dfn-panel on", id: `infopanel-for-${dfnID}`, "data-for": dfnID, "aria-labelled-by":`infopaneltitle-for-${dfnID}`, }, mk.span({id:`infopaneltitle-for-${dfnID}`, style:"display:none"}, `Info about the '${dfnText}' ${external?"external":""} reference.`), mk.a({href:url, class:"dfn-link"}, url), refSections.length == 0 ? [] : mk.b({}, "Referenced in:"), mk.ul({}, ...refSections.map(section=> mk.li({}, ...section.refs.map((ref, refI)=> [ mk.a({ href: `#${ref.id}` }, (refI == 0) ? section.title : `(${refI + 1})` ), " ", ] ), ), ), ), genLinkingSyntaxes(dfn), ); dfnPanel.addEventListener('click', (event) => { if (event.target.nodeName == 'A') { scrollToTargetAndHighlight(event); pinDfnPanel(dfnPanel); } event.stopPropagation(); refocusOnTarget(event); }); dfnPanel.addEventListener('keydown', (event) => { if(event.keyCode == 27) { // Escape key hideDfnPanel({dfnPanel}); event.stopPropagation(); event.preventDefault(); } }); dfnPanel.dfn = dfn; dfn.dfnPanel = dfnPanel; return dfnPanel; } function hideAllDfnPanels() { // Delete the currently-active dfn panel. queryAll(".dfn-panel").forEach(dfnPanel=>hideDfnPanel({dfnPanel})); } function showDfnPanel(dfn) { hideAllDfnPanels(); // Only display one at a time. dfn.setAttribute("aria-expanded", "true"); const dfnPanel = genDfnPanel(dfn, dfn.panelData); // Give the dfn a unique tabindex, and then // give all the tabbable panel bits successive indexes. let tabIndex = 100; dfn.tabIndex = tabIndex++; const tabbable = dfnPanel.querySelectorAll(":is(a, button)"); for (const el of tabbable) { el.tabIndex = tabIndex++; } append(document.body, dfnPanel); positionDfnPanel(dfnPanel); } function positionDfnPanel(dfnPanel) { const dfn = dfnPanel.dfn; const dfnPos = getBounds(dfn); dfnPanel.style.top = dfnPos.bottom + "px"; dfnPanel.style.left = dfnPos.left + "px"; const panelPos = dfnPanel.getBoundingClientRect(); const panelMargin = 8; const maxRight = document.body.parentNode.clientWidth - panelMargin; if (panelPos.right > maxRight) { const overflowAmount = panelPos.right - maxRight; const newLeft = Math.max(panelMargin, dfnPos.left - overflowAmount); dfnPanel.style.left = newLeft + "px"; } } function pinDfnPanel(dfnPanel) { // Switch it to "activated" state, which pins it. dfnPanel.classList.add("activated"); dfnPanel.style.position = "fixed"; dfnPanel.style.left = null; dfnPanel.style.top = null; } function hideDfnPanel({dfn, dfnPanel}) { if(!dfnPanel) dfnPanel = dfn.dfnPanel; if(!dfn) dfn = dfnPanel.dfn; dfn.dfnPanel = undefined; dfnPanel.dfn = undefined; dfn.setAttribute("aria-expanded", "false"); dfn.tabIndex = undefined; dfnPanel.remove() } function toggleDfnPanel(dfn) { if(dfn.dfnPanel) { hideDfnPanel(dfn); } else { showDfnPanel(dfn); } } function insertDfnPopupAction(dfn) { dfn.setAttribute('role', 'button'); dfn.setAttribute('aria-expanded', 'false') dfn.tabIndex = 0; dfn.classList.add('has-dfn-panel'); dfn.addEventListener('click', (event) => { toggleDfnPanel(dfn); event.stopPropagation(); }); dfn.addEventListener('keypress', (event) => { const kc = event.keyCode; // 32->Space, 13->Enter if(kc == 32 || kc == 13) { toggleDfnPanel(dfn); event.stopPropagation(); event.preventDefault(); } }); } function refocusOnTarget(event) { const target = event.target; setTimeout(() => { // Refocus on the event.target element. // This is needed after browser scrolls to the destination. target.focus(); }); } // TODO: shared util // Returns the root-level absolute position {left and top} of element. function getBounds(el, relativeTo=document.body) { const relativeRect = relativeTo.getBoundingClientRect(); const elRect = el.getBoundingClientRect(); const top = elRect.top - relativeRect.top; const left = elRect.left - relativeRect.left; return { top, left, bottom: top + elRect.height, right: left + elRect.width, } } function scrollToTargetAndHighlight(event) { let hash = event.target.hash; if (hash) { hash = decodeURIComponent(hash.substring(1)); const dest = document.getElementById(hash); if (dest) { dest.classList.add('highlighted'); setTimeout(() => dest.classList.remove('highlighted'), 1000); } } } // Functions, divided by link type, that wrap an autolink's // contents with the appropriate outer syntax. // Alternately, a string naming another type they format // the same as. function needsFor(type) { switch(type) { case "descriptor": case "value": case "element-attr": case "attr-value": case "element-state": case "method": case "constructor": case "argument": case "attribute": case "const": case "dict-member": case "event": case "enum-value": case "stringifier": case "serializer": case "iterator": case "maplike": case "setlike": case "state": case "mode": case "context": case "facet": return true; default: return false; } } function refusesFor(type) { switch(type) { case "property": case "element": case "interface": case "namespace": case "callback": case "dictionary": case "enum": case "exception": case "typedef": case "http-header": case "permission": return true; default: return false; } } function linkFormatterFromType(type) { switch(type) { case 'scheme': case 'permission': case 'dfn': return (text) => `[=${text}=]`; case 'abstract-op': return (text) => `[\$${text}\$]`; case 'function': case 'at-rule': case 'selector': case 'value': return (text) => `''${text}''`; case 'http-header': return (text) => `[:${text}:]`; case 'interface': case 'constructor': case 'method': case 'argument': case 'attribute': case 'callback': case 'dictionary': case 'dict-member': case 'enum': case 'enum-value': case 'exception': case 'const': case 'typedef': case 'stringifier': case 'serializer': case 'iterator': case 'maplike': case 'setlike': case 'extended-attribute': case 'event': case 'idl': return (text) => `{{${text}}}`; case 'element-state': case 'element-attr': case 'attr-value': case 'element': return (element) => `<{${element}}>`; case 'grammar': return (text) => `${text} (within a <pre class=prod>)`; case 'type': return (text)=> `<<${text}>>`; case 'descriptor': case 'property': return (text) => `'${text}'`; default: return; }; }; function genLinkingSyntaxes(dfn) { if(dfn.tagName != "DFN") return; const type = dfn.getAttribute('data-dfn-type'); if(!type) { console.log(`<dfn> doesn't have a data-dfn-type:`, dfn); return []; } // Return a function that wraps link text based on the type const linkFormatter = linkFormatterFromType(type); if(!linkFormatter) { console.log(`<dfn> has an unknown data-dfn-type:`, dfn); return []; } let ltAlts; if(dfn.hasAttribute('data-lt')) { ltAlts = dfn.getAttribute('data-lt') .split("|") .map(x=>x.trim()); } else { ltAlts = [dfn.textContent.trim()]; } if(type == "type") { // lt of "<foo>", but "foo" is the interior; // <<foo/bar>> is how you write it with a for, // not <foo/<bar>> or whatever. for(var i = 0; i < ltAlts.length; i++) { const lt = ltAlts[i]; const match = /<(.*)>/.exec(lt); if(match) { ltAlts[i] = match[1]; } } } let forAlts; if(dfn.hasAttribute('data-dfn-for')) { forAlts = dfn.getAttribute('data-dfn-for') .split(",") .map(x=>x.trim()); } else { forAlts = ['']; } let linkingSyntaxes = []; if(!needsFor(type)) { for(const lt of ltAlts) { linkingSyntaxes.push(linkFormatter(lt)); } } if(!refusesFor(type)) { for(const f of forAlts) { linkingSyntaxes.push(linkFormatter(`${f}/${ltAlts[0]}`)) } } return [ mk.b({}, 'Possible linking syntaxes:'), mk.ul({}, ...linkingSyntaxes.map(link => { const copyLink = async () => await navigator.clipboard.writeText(link); return mk.li({}, mk.div({ class: 'link-item' }, mk.button({ class: 'copy-icon', title: 'Copy', type: 'button', _onclick: copyLink, tabindex: 0, }, mk.span({ class: 'icon' }) ), mk.span({}, link) ) ); }) ) ]; } } </script> <script>/* Boilerplate: script-link-titles */ "use strict"; { let linkTitleData = { "https://drafts.csswg.org/css-color-5/#typedef-color": "Expands to: <alpha-value> | aliceblue | antiquewhite | aqua | aquamarine | azure | beige | bisque | black | blanchedalmond | blue | blueviolet | brown | burlywood | cadetblue | chartreuse | chocolate | coral | cornflowerblue | cornsilk | crimson | currentcolor | cyan | darkblue | darkcyan | darkgoldenrod | darkgray | darkgreen | darkgrey | darkkhaki | darkmagenta | darkolivegreen | darkorange | darkorchid | darkred | darksalmon | darkseagreen | darkslateblue | darkslategray | darkslategrey | darkturquoise | darkviolet | deeppink | deepskyblue | dimgray | dimgrey | dodgerblue | firebrick | floralwhite | forestgreen | fuchsia | gainsboro | ghostwhite | gold | goldenrod | gray | green | greenyellow | grey | honeydew | hotpink | indianred | indigo | ivory | khaki | lavender | lavenderblush | lawngreen | lemonchiffon | lightblue | lightcoral | lightcyan | lightgoldenrodyellow | lightgray | lightgreen | lightgrey | lightpink | lightsalmon | lightseagreen | lightskyblue | lightslategray | lightslategrey | lightsteelblue | lightyellow | lime | limegreen | linen | magenta | maroon | mediumaquamarine | mediumblue | mediumorchid | mediumpurple | mediumseagreen | mediumslateblue | mediumspringgreen | mediumturquoise | mediumvioletred | midnightblue | mintcream | mistyrose | moccasin | navajowhite | navy | none | oldlace | olive | olivedrab | orange | orangered | orchid | palegoldenrod | palegreen | paleturquoise | palevioletred | papayawhip | peachpuff | peru | pink | plum | powderblue | purple | rebeccapurple | red | rosybrown | royalblue | saddlebrown | salmon | sandybrown | seagreen | seashell | sienna | silver | skyblue | slateblue | slategray | slategrey | snow | springgreen | steelblue | tan | teal | thistle | tomato | transparent | turquoise | violet | wheat | white | whitesmoke | yellow | yellowgreen", }; function setTypeTitles() { for(let el of document.querySelectorAll("a[href]")) { if(el.href in linkTitleData && !el.hasAttribute("title")) { el.setAttribute("title", linkTitleData[el.href]); } } } document.addEventListener("DOMContentLoaded", setTypeTitles); } </script> <script>/* Boilerplate: script-ref-hints */ "use strict"; { let refsData = { "#anb-production": {"displayText":"<an+b>","export":true,"for_":[],"level":"3","normative":true,"shortname":"css-syntax","spec":"css-syntax-3","status":"local","text":"<an+b>","type":"type","url":"#anb-production"}, "#at-rule": {"displayText":"at-rule","export":true,"for_":[],"level":"3","normative":true,"shortname":"css-syntax","spec":"css-syntax-3","status":"local","text":"at-rule","type":"dfn","url":"#at-rule"}, "#at-ruledef-charset": {"displayText":"@charset","export":true,"for_":[],"level":"3","normative":true,"shortname":"css-syntax","spec":"css-syntax-3","status":"local","text":"@charset","type":"at-rule","url":"#at-ruledef-charset"}, "#block-at-rule": {"displayText":"block at-rule","export":true,"for_":[],"level":"3","normative":true,"shortname":"css-syntax","spec":"css-syntax-3","status":"local","text":"block at-rule","type":"dfn","url":"#block-at-rule"}, "#check-if-three-code-points-would-start-a-number": {"displayText":"starts with a number","export":true,"for_":[],"level":"3","normative":true,"shortname":"css-syntax","spec":"css-syntax-3","status":"local","text":"starts with a number","type":"dfn","url":"#check-if-three-code-points-would-start-a-number"}, "#check-if-three-code-points-would-start-a-unicode-range": {"displayText":"would start a unicode-range","export":true,"for_":[],"level":"3","normative":true,"shortname":"css-syntax","spec":"css-syntax-3","status":"local","text":"would start a unicode-range","type":"dfn","url":"#check-if-three-code-points-would-start-a-unicode-range"}, "#check-if-three-code-points-would-start-an-ident-sequence": {"displayText":"would start an ident sequence","export":true,"for_":[],"level":"3","normative":true,"shortname":"css-syntax","spec":"css-syntax-3","status":"local","text":"would start an ident sequence","type":"dfn","url":"#check-if-three-code-points-would-start-an-ident-sequence"}, "#check-if-two-code-points-are-a-valid-escape": {"displayText":"are a valid escape","export":true,"for_":[],"level":"3","normative":true,"shortname":"css-syntax","spec":"css-syntax-3","status":"local","text":"are a valid escape","type":"dfn","url":"#check-if-two-code-points-are-a-valid-escape"}, "#component-value": {"displayText":"component value","export":true,"for_":["CSS"],"level":"3","normative":true,"shortname":"css-syntax","spec":"css-syntax-3","status":"local","text":"component value","type":"dfn","url":"#component-value"}, "#consume-a-block": {"displayText":"consume a block","export":true,"for_":[],"level":"3","normative":true,"shortname":"css-syntax","spec":"css-syntax-3","status":"local","text":"consume a block","type":"dfn","url":"#consume-a-block"}, "#consume-a-blocks-contents": {"displayText":"consume a block's contents","export":true,"for_":[],"level":"3","normative":true,"shortname":"css-syntax","spec":"css-syntax-3","status":"local","text":"consume a block's contents","type":"dfn","url":"#consume-a-blocks-contents"}, "#consume-a-component-value": {"displayText":"consume a component value","export":true,"for_":[],"level":"3","normative":true,"shortname":"css-syntax","spec":"css-syntax-3","status":"local","text":"consume a component value","type":"dfn","url":"#consume-a-component-value"}, "#consume-a-declaration": {"displayText":"consume a declaration","export":true,"for_":[],"level":"3","normative":true,"shortname":"css-syntax","spec":"css-syntax-3","status":"local","text":"consume a declaration","type":"dfn","url":"#consume-a-declaration"}, "#consume-a-function": {"displayText":"consume a function","export":true,"for_":[],"level":"3","normative":true,"shortname":"css-syntax","spec":"css-syntax-3","status":"local","text":"consume a function","type":"dfn","url":"#consume-a-function"}, "#consume-a-list-of-component-values": {"displayText":"consume a list of component values","export":true,"for_":[],"level":"3","normative":true,"shortname":"css-syntax","spec":"css-syntax-3","status":"local","text":"consume a list of component values","type":"dfn","url":"#consume-a-list-of-component-values"}, "#consume-a-number": {"displayText":"consume a number","export":true,"for_":[],"level":"3","normative":true,"shortname":"css-syntax","spec":"css-syntax-3","status":"local","text":"consume a number","type":"dfn","url":"#consume-a-number"}, "#consume-a-numeric-token": {"displayText":"consume a numeric token","export":true,"for_":[],"level":"3","normative":true,"shortname":"css-syntax","spec":"css-syntax-3","status":"local","text":"consume a numeric token","type":"dfn","url":"#consume-a-numeric-token"}, "#consume-a-qualified-rule": {"displayText":"consume a qualified rule","export":true,"for_":[],"level":"3","normative":true,"shortname":"css-syntax","spec":"css-syntax-3","status":"local","text":"consume a qualified rule","type":"dfn","url":"#consume-a-qualified-rule"}, "#consume-a-simple-block": {"displayText":"consume a simple block","export":true,"for_":[],"level":"3","normative":true,"shortname":"css-syntax","spec":"css-syntax-3","status":"local","text":"consume a simple block","type":"dfn","url":"#consume-a-simple-block"}, "#consume-a-string-token": {"displayText":"consume a string token","export":true,"for_":[],"level":"3","normative":true,"shortname":"css-syntax","spec":"css-syntax-3","status":"local","text":"consume a string token","type":"dfn","url":"#consume-a-string-token"}, "#consume-a-stylesheets-contents": {"displayText":"consume a stylesheet's contents","export":true,"for_":[],"level":"3","normative":true,"shortname":"css-syntax","spec":"css-syntax-3","status":"local","text":"consume a stylesheet's contents","type":"dfn","url":"#consume-a-stylesheets-contents"}, "#consume-a-unicode-range-token": {"displayText":"consume a unicode-range token","export":true,"for_":[],"level":"3","normative":true,"shortname":"css-syntax","spec":"css-syntax-3","status":"local","text":"consume a unicode-range token","type":"dfn","url":"#consume-a-unicode-range-token"}, "#consume-a-url-token": {"displayText":"consume a url token","export":true,"for_":[],"level":"3","normative":true,"shortname":"css-syntax","spec":"css-syntax-3","status":"local","text":"consume a url token","type":"dfn","url":"#consume-a-url-token"}, "#consume-an-at-rule": {"displayText":"consume an at-rule","export":true,"for_":[],"level":"3","normative":true,"shortname":"css-syntax","spec":"css-syntax-3","status":"local","text":"consume an at-rule","type":"dfn","url":"#consume-an-at-rule"}, "#consume-an-escaped-code-point": {"displayText":"consume an escaped code point","export":true,"for_":[],"level":"3","normative":true,"shortname":"css-syntax","spec":"css-syntax-3","status":"local","text":"consume an escaped code point","type":"dfn","url":"#consume-an-escaped-code-point"}, "#consume-an-ident-like-token": {"displayText":"consume an ident-like token","export":true,"for_":[],"level":"3","normative":true,"shortname":"css-syntax","spec":"css-syntax-3","status":"local","text":"consume an ident-like token","type":"dfn","url":"#consume-an-ident-like-token"}, "#consume-an-ident-sequence": {"displayText":"consume an ident sequence","export":true,"for_":[],"level":"3","normative":true,"shortname":"css-syntax","spec":"css-syntax-3","status":"local","text":"consume an ident sequence","type":"dfn","url":"#consume-an-ident-sequence"}, "#consume-comments": {"displayText":"consume comments","export":true,"for_":[],"level":"3","normative":true,"shortname":"css-syntax","spec":"css-syntax-3","status":"local","text":"consume comments","type":"dfn","url":"#consume-comments"}, "#consume-the-remnants-of-a-bad-declaration": {"displayText":"consume the remnants of a bad declaration","export":true,"for_":[],"level":"3","normative":true,"shortname":"css-syntax","spec":"css-syntax-3","status":"local","text":"consume the remnants of a bad declaration","type":"dfn","url":"#consume-the-remnants-of-a-bad-declaration"}, "#consume-the-remnants-of-a-bad-url": {"displayText":"consume the remnants of a bad url","export":true,"for_":[],"level":"3","normative":true,"shortname":"css-syntax","spec":"css-syntax-3","status":"local","text":"consume the remnants of a bad url","type":"dfn","url":"#consume-the-remnants-of-a-bad-url"}, "#consume-the-value-of-a-unicode-range-descriptor": {"displayText":"consume the value of a unicode-range descriptor","export":true,"for_":[],"level":"3","normative":true,"shortname":"css-syntax","spec":"css-syntax-3","status":"local","text":"consume the value of a unicode-range descriptor","type":"dfn","url":"#consume-the-value-of-a-unicode-range-descriptor"}, "#css-decode-bytes": {"displayText":"decode bytes","export":true,"for_":["CSS"],"level":"3","normative":true,"shortname":"css-syntax","spec":"css-syntax-3","status":"local","text":"decode bytes","type":"dfn","url":"#css-decode-bytes"}, "#css-descriptor": {"displayText":"descriptor","export":true,"for_":["CSS"],"level":"3","normative":true,"shortname":"css-syntax","spec":"css-syntax-3","status":"local","text":"descriptor","type":"dfn","url":"#css-descriptor"}, "#css-descriptor-declarations": {"displayText":"descriptor declarations","export":true,"for_":["CSS"],"level":"3","normative":true,"shortname":"css-syntax","spec":"css-syntax-3","status":"local","text":"descriptor declarations","type":"dfn","url":"#css-descriptor-declarations"}, "#css-filter-code-points": {"displayText":"filtered code points","export":true,"for_":["CSS"],"level":"3","normative":true,"shortname":"css-syntax","spec":"css-syntax-3","status":"local","text":"filtered code points","type":"dfn","url":"#css-filter-code-points"}, "#css-invalid": {"displayText":"invalid","export":true,"for_":["css"],"level":"3","normative":true,"shortname":"css-syntax","spec":"css-syntax-3","status":"local","text":"invalid","type":"dfn","url":"#css-invalid"}, "#css-parse-a-comma-separated-list-according-to-a-css-grammar": {"displayText":"parse a comma-separated list according to a css grammar","export":true,"for_":["CSS"],"level":"3","normative":true,"shortname":"css-syntax","spec":"css-syntax-3","status":"local","text":"parse a comma-separated list according to a css grammar","type":"dfn","url":"#css-parse-a-comma-separated-list-according-to-a-css-grammar"}, "#css-parse-something-according-to-a-css-grammar": {"displayText":"parse","export":true,"for_":["CSS"],"level":"3","normative":true,"shortname":"css-syntax","spec":"css-syntax-3","status":"local","text":"parse","type":"dfn","url":"#css-parse-something-according-to-a-css-grammar"}, "#css-property-declarations": {"displayText":"property declarations","export":true,"for_":["CSS"],"level":"3","normative":true,"shortname":"css-syntax","spec":"css-syntax-3","status":"local","text":"property declarations","type":"dfn","url":"#css-property-declarations"}, "#css-rule": {"displayText":"rule","export":true,"for_":["CSS"],"level":"3","normative":true,"shortname":"css-syntax","spec":"css-syntax-3","status":"local","text":"rule","type":"dfn","url":"#css-rule"}, "#css-token-stream": {"displayText":"token stream","export":true,"for_":["CSS"],"level":"3","normative":true,"shortname":"css-syntax","spec":"css-syntax-3","status":"local","text":"token stream","type":"dfn","url":"#css-token-stream"}, "#css-tokenize": {"displayText":"tokenize","export":true,"for_":["CSS"],"level":"3","normative":true,"shortname":"css-syntax","spec":"css-syntax-3","status":"local","text":"tokenize","type":"dfn","url":"#css-tokenize"}, "#curly-block": {"displayText":"{}-block","export":true,"for_":["CSS"],"level":"3","normative":true,"shortname":"css-syntax","spec":"css-syntax-3","status":"local","text":"{}-block","type":"dfn","url":"#curly-block"}, "#current-input-code-point": {"displayText":"current input code point","export":true,"for_":[],"level":"3","normative":true,"shortname":"css-syntax","spec":"css-syntax-3","status":"local","text":"current input code point","type":"dfn","url":"#current-input-code-point"}, "#determine-the-fallback-encoding": {"displayText":"determine the fallback encoding","export":true,"for_":[],"level":"3","normative":true,"shortname":"css-syntax","spec":"css-syntax-3","status":"local","text":"determine the fallback encoding","type":"dfn","url":"#determine-the-fallback-encoding"}, "#digit": {"displayText":"digit","export":true,"for_":[],"level":"3","normative":true,"shortname":"css-syntax","spec":"css-syntax-3","status":"local","text":"digit","type":"dfn","url":"#digit"}, "#environment-encoding": {"displayText":"environment encoding","export":true,"for_":[],"level":"3","normative":true,"shortname":"css-syntax","spec":"css-syntax-3","status":"local","text":"environment encoding","type":"dfn","url":"#environment-encoding"}, "#escape-codepoint": {"displayText":"escaping","export":true,"for_":[],"level":"3","normative":true,"shortname":"css-syntax","spec":"css-syntax-3","status":"local","text":"escaping","type":"dfn","url":"#escape-codepoint"}, "#function": {"displayText":"function","export":true,"for_":["CSS"],"level":"3","normative":true,"shortname":"css-syntax","spec":"css-syntax-3","status":"local","text":"function","type":"dfn","url":"#function"}, "#hex-digit": {"displayText":"hex digit","export":true,"for_":[],"level":"3","normative":true,"shortname":"css-syntax","spec":"css-syntax-3","status":"local","text":"hex digit","type":"dfn","url":"#hex-digit"}, "#ident-code-point": {"displayText":"ident code point","export":true,"for_":[],"level":"3","normative":true,"shortname":"css-syntax","spec":"css-syntax-3","status":"local","text":"ident code point","type":"dfn","url":"#ident-code-point"}, "#ident-sequence": {"displayText":"ident sequence","export":true,"for_":[],"level":"3","normative":true,"shortname":"css-syntax","spec":"css-syntax-3","status":"local","text":"ident sequence","type":"dfn","url":"#ident-sequence"}, "#ident-start-code-point": {"displayText":"ident-start code point","export":true,"for_":[],"level":"3","normative":true,"shortname":"css-syntax","spec":"css-syntax-3","status":"local","text":"ident-start code point","type":"dfn","url":"#ident-start-code-point"}, "#input-stream": {"displayText":"input stream","export":true,"for_":[],"level":"3","normative":true,"shortname":"css-syntax","spec":"css-syntax-3","status":"local","text":"input stream","type":"dfn","url":"#input-stream"}, "#invalid-rule-error": {"displayText":"invalid rule error","export":true,"for_":[],"level":"3","normative":true,"shortname":"css-syntax","spec":"css-syntax-3","status":"local","text":"invalid rule error","type":"dfn","url":"#invalid-rule-error"}, "#letter": {"displayText":"letter","export":true,"for_":[],"level":"3","normative":true,"shortname":"css-syntax","spec":"css-syntax-3","status":"local","text":"letter","type":"dfn","url":"#letter"}, "#lowercase-letter": {"displayText":"lowercase letter","export":true,"for_":[],"level":"3","normative":true,"shortname":"css-syntax","spec":"css-syntax-3","status":"local","text":"lowercase letter","type":"dfn","url":"#lowercase-letter"}, "#maximum-allowed-code-point": {"displayText":"maximum allowed code point","export":true,"for_":[],"level":"3","normative":true,"shortname":"css-syntax","spec":"css-syntax-3","status":"local","text":"maximum allowed code point","type":"dfn","url":"#maximum-allowed-code-point"}, "#newline": {"displayText":"newline","export":true,"for_":[],"level":"3","normative":true,"shortname":"css-syntax","spec":"css-syntax-3","status":"local","text":"newline","type":"dfn","url":"#newline"}, "#next-input-code-point": {"displayText":"next input code point","export":true,"for_":[],"level":"3","normative":true,"shortname":"css-syntax","spec":"css-syntax-3","status":"local","text":"next input code point","type":"dfn","url":"#next-input-code-point"}, "#non-ascii-ident-code-point": {"displayText":"non-ascii ident code point","export":true,"for_":[],"level":"3","normative":true,"shortname":"css-syntax","spec":"css-syntax-3","status":"local","text":"non-ascii ident code point","type":"dfn","url":"#non-ascii-ident-code-point"}, "#non-printable-code-point": {"displayText":"non-printable code point","export":true,"for_":[],"level":"3","normative":true,"shortname":"css-syntax","spec":"css-syntax-3","status":"local","text":"non-printable code point","type":"dfn","url":"#non-printable-code-point"}, "#normalize-into-a-token-stream": {"displayText":"normalize","export":true,"for_":[],"level":"3","normative":true,"shortname":"css-syntax","spec":"css-syntax-3","status":"local","text":"normalize","type":"dfn","url":"#normalize-into-a-token-stream"}, "#paren-block": {"displayText":"()-block","export":true,"for_":["CSS"],"level":"3","normative":true,"shortname":"css-syntax","spec":"css-syntax-3","status":"local","text":"()-block","type":"dfn","url":"#paren-block"}, "#parse-a-blocks-contents": {"displayText":"parse a block's contents","export":true,"for_":[],"level":"3","normative":true,"shortname":"css-syntax","spec":"css-syntax-3","status":"local","text":"parse a block's contents","type":"dfn","url":"#parse-a-blocks-contents"}, "#parse-a-comma-separated-list-of-component-values": {"displayText":"parse a comma-separated list of component values","export":true,"for_":[],"level":"3","normative":true,"shortname":"css-syntax","spec":"css-syntax-3","status":"local","text":"parse a comma-separated list of component values","type":"dfn","url":"#parse-a-comma-separated-list-of-component-values"}, "#parse-a-component-value": {"displayText":"parse a component value","export":true,"for_":[],"level":"3","normative":true,"shortname":"css-syntax","spec":"css-syntax-3","status":"local","text":"parse a component value","type":"dfn","url":"#parse-a-component-value"}, "#parse-a-declaration": {"displayText":"parse a declaration","export":true,"for_":[],"level":"3","normative":true,"shortname":"css-syntax","spec":"css-syntax-3","status":"local","text":"parse a declaration","type":"dfn","url":"#parse-a-declaration"}, "#parse-a-list-of-component-values": {"displayText":"parse a list of component values","export":true,"for_":[],"level":"3","normative":true,"shortname":"css-syntax","spec":"css-syntax-3","status":"local","text":"parse a list of component values","type":"dfn","url":"#parse-a-list-of-component-values"}, "#parse-a-rule": {"displayText":"parse a rule","export":true,"for_":[],"level":"3","normative":true,"shortname":"css-syntax","spec":"css-syntax-3","status":"local","text":"parse a rule","type":"dfn","url":"#parse-a-rule"}, "#parse-a-stylesheet": {"displayText":"parse a stylesheet","export":true,"for_":[],"level":"3","normative":true,"shortname":"css-syntax","spec":"css-syntax-3","status":"local","text":"parse a stylesheet","type":"dfn","url":"#parse-a-stylesheet"}, "#parse-a-stylesheets-contents": {"displayText":"parse a stylesheet's contents","export":true,"for_":[],"level":"3","normative":true,"shortname":"css-syntax","spec":"css-syntax-3","status":"local","text":"parse a stylesheet's contents","type":"dfn","url":"#parse-a-stylesheets-contents"}, "#parse-error": {"displayText":"parse error","export":true,"for_":[],"level":"3","normative":true,"shortname":"css-syntax","spec":"css-syntax-3","status":"local","text":"parse error","type":"dfn","url":"#parse-error"}, "#preserved-tokens": {"displayText":"preserved tokens","export":true,"for_":["CSS"],"level":"3","normative":true,"shortname":"css-syntax","spec":"css-syntax-3","status":"local","text":"preserved tokens","type":"dfn","url":"#preserved-tokens"}, "#qualified-rule": {"displayText":"qualified rule","export":true,"for_":["CSS"],"level":"3","normative":true,"shortname":"css-syntax","spec":"css-syntax-3","status":"local","text":"qualified rule","type":"dfn","url":"#qualified-rule"}, "#reconsume-the-current-input-code-point": {"displayText":"reconsume the current input code point","export":true,"for_":[],"level":"3","normative":true,"shortname":"css-syntax","spec":"css-syntax-3","status":"local","text":"reconsume the current input code point","type":"dfn","url":"#reconsume-the-current-input-code-point"}, "#simple-block": {"displayText":"simple block","export":true,"for_":["CSS"],"level":"3","normative":true,"shortname":"css-syntax","spec":"css-syntax-3","status":"local","text":"simple block","type":"dfn","url":"#simple-block"}, "#square-block": {"displayText":"[]-block","export":true,"for_":["CSS"],"level":"3","normative":true,"shortname":"css-syntax","spec":"css-syntax-3","status":"local","text":"[]-block","type":"dfn","url":"#square-block"}, "#statement-at-rule": {"displayText":"statement at-rule","export":true,"for_":[],"level":"3","normative":true,"shortname":"css-syntax","spec":"css-syntax-3","status":"local","text":"statement at-rule","type":"dfn","url":"#statement-at-rule"}, "#style-rule": {"displayText":"style rule","export":true,"for_":[],"level":"3","normative":true,"shortname":"css-syntax","spec":"css-syntax-3","status":"local","text":"style rule","type":"dfn","url":"#style-rule"}, "#token-stream-consume-a-token": {"displayText":"consume a token","export":true,"for_":["token stream"],"level":"3","normative":true,"shortname":"css-syntax","spec":"css-syntax-3","status":"local","text":"consume a token","type":"dfn","url":"#token-stream-consume-a-token"}, "#token-stream-discard-a-mark": {"displayText":"discard a mark","export":true,"for_":["token stream"],"level":"3","normative":true,"shortname":"css-syntax","spec":"css-syntax-3","status":"local","text":"discard a mark","type":"dfn","url":"#token-stream-discard-a-mark"}, "#token-stream-discard-a-token": {"displayText":"discard a token","export":true,"for_":["token stream"],"level":"3","normative":true,"shortname":"css-syntax","spec":"css-syntax-3","status":"local","text":"discard a token","type":"dfn","url":"#token-stream-discard-a-token"}, "#token-stream-discard-whitespace": {"displayText":"discard whitespace","export":true,"for_":["token stream"],"level":"3","normative":true,"shortname":"css-syntax","spec":"css-syntax-3","status":"local","text":"discard whitespace","type":"dfn","url":"#token-stream-discard-whitespace"}, "#token-stream-empty": {"displayText":"empty","export":true,"for_":["token stream"],"level":"3","normative":true,"shortname":"css-syntax","spec":"css-syntax-3","status":"local","text":"empty","type":"dfn","url":"#token-stream-empty"}, "#token-stream-index": {"displayText":"index","export":true,"for_":["token stream"],"level":"3","normative":true,"shortname":"css-syntax","spec":"css-syntax-3","status":"local","text":"index","type":"dfn","url":"#token-stream-index"}, "#token-stream-mark": {"displayText":"mark","export":true,"for_":["token stream"],"level":"3","normative":true,"shortname":"css-syntax","spec":"css-syntax-3","status":"local","text":"mark","type":"dfn","url":"#token-stream-mark"}, "#token-stream-marked-indexes": {"displayText":"marked indexes","export":true,"for_":["token stream"],"level":"3","normative":true,"shortname":"css-syntax","spec":"css-syntax-3","status":"local","text":"marked indexes","type":"dfn","url":"#token-stream-marked-indexes"}, "#token-stream-next-token": {"displayText":"next token","export":true,"for_":["token stream"],"level":"3","normative":true,"shortname":"css-syntax","spec":"css-syntax-3","status":"local","text":"next token","type":"dfn","url":"#token-stream-next-token"}, "#token-stream-process": {"displayText":"process","export":true,"for_":["token stream"],"level":"3","normative":true,"shortname":"css-syntax","spec":"css-syntax-3","status":"local","text":"process","type":"dfn","url":"#token-stream-process"}, "#token-stream-restore-a-mark": {"displayText":"restore a mark","export":true,"for_":["token stream"],"level":"3","normative":true,"shortname":"css-syntax","spec":"css-syntax-3","status":"local","text":"restore a mark","type":"dfn","url":"#token-stream-restore-a-mark"}, "#token-stream-tokens": {"displayText":"tokens","export":true,"for_":["token stream"],"level":"3","normative":true,"shortname":"css-syntax","spec":"css-syntax-3","status":"local","text":"tokens","type":"dfn","url":"#token-stream-tokens"}, "#tokendef-close-curly": {"displayText":"<}-token>","export":true,"for_":[],"level":"3","normative":true,"shortname":"css-syntax","spec":"css-syntax-3","status":"local","text":"<}-token>","type":"type","url":"#tokendef-close-curly"}, "#tokendef-close-paren": {"displayText":"<)-token>","export":true,"for_":[],"level":"3","normative":true,"shortname":"css-syntax","spec":"css-syntax-3","status":"local","text":"<)-token>","type":"type","url":"#tokendef-close-paren"}, "#tokendef-close-square": {"displayText":"<]-token>","export":true,"for_":[],"level":"3","normative":true,"shortname":"css-syntax","spec":"css-syntax-3","status":"local","text":"<]-token>","type":"type","url":"#tokendef-close-square"}, "#tokendef-open-curly": {"displayText":"<{-token>","export":true,"for_":[],"level":"3","normative":true,"shortname":"css-syntax","spec":"css-syntax-3","status":"local","text":"<{-token>","type":"type","url":"#tokendef-open-curly"}, "#tokenizer-consume-a-token": {"displayText":"consume a token","export":true,"for_":["tokenizer"],"level":"3","normative":true,"shortname":"css-syntax","spec":"css-syntax-3","status":"local","text":"consume a token","type":"dfn","url":"#tokenizer-consume-a-token"}, "#typedef-any-value": {"displayText":"<any-value>","export":true,"for_":[],"level":"3","normative":true,"shortname":"css-syntax","spec":"css-syntax-3","status":"local","text":"<any-value>","type":"type","url":"#typedef-any-value"}, "#typedef-at-keyword-token": {"displayText":"<at-keyword-token>","export":true,"for_":[],"level":"3","normative":true,"shortname":"css-syntax","spec":"css-syntax-3","status":"local","text":"<at-keyword-token>","type":"type","url":"#typedef-at-keyword-token"}, "#typedef-bad-string-token": {"displayText":"<bad-string-token>","export":true,"for_":[],"level":"3","normative":true,"shortname":"css-syntax","spec":"css-syntax-3","status":"local","text":"<bad-string-token>","type":"type","url":"#typedef-bad-string-token"}, "#typedef-bad-url-token": {"displayText":"<bad-url-token>","export":true,"for_":[],"level":"3","normative":true,"shortname":"css-syntax","spec":"css-syntax-3","status":"local","text":"<bad-url-token>","type":"type","url":"#typedef-bad-url-token"}, "#typedef-block-contents": {"displayText":"<block-contents>","export":true,"for_":[],"level":"3","normative":true,"shortname":"css-syntax","spec":"css-syntax-3","status":"local","text":"<block-contents>","type":"type","url":"#typedef-block-contents"}, "#typedef-cdc-token": {"displayText":"<cdc-token>","export":true,"for_":[],"level":"3","normative":true,"shortname":"css-syntax","spec":"css-syntax-3","status":"local","text":"<cdc-token>","type":"type","url":"#typedef-cdc-token"}, "#typedef-cdo-token": {"displayText":"<cdo-token>","export":true,"for_":[],"level":"3","normative":true,"shortname":"css-syntax","spec":"css-syntax-3","status":"local","text":"<cdo-token>","type":"type","url":"#typedef-cdo-token"}, "#typedef-colon-token": {"displayText":"<colon-token>","export":true,"for_":[],"level":"3","normative":true,"shortname":"css-syntax","spec":"css-syntax-3","status":"local","text":"<colon-token>","type":"type","url":"#typedef-colon-token"}, "#typedef-comma-token": {"displayText":"<comma-token>","export":true,"for_":[],"level":"3","normative":true,"shortname":"css-syntax","spec":"css-syntax-3","status":"local","text":"<comma-token>","type":"type","url":"#typedef-comma-token"}, "#typedef-declaration-list": {"displayText":"<declaration-list>","export":true,"for_":[],"level":"3","normative":true,"shortname":"css-syntax","spec":"css-syntax-3","status":"local","text":"<declaration-list>","type":"type","url":"#typedef-declaration-list"}, "#typedef-declaration-rule-list": {"displayText":"<declaration-rule-list>","export":true,"for_":[],"level":"3","normative":true,"shortname":"css-syntax","spec":"css-syntax-3","status":"local","text":"<declaration-rule-list>","type":"type","url":"#typedef-declaration-rule-list"}, "#typedef-declaration-value": {"displayText":"<declaration-value>","export":true,"for_":[],"level":"3","normative":true,"shortname":"css-syntax","spec":"css-syntax-3","status":"local","text":"<declaration-value>","type":"type","url":"#typedef-declaration-value"}, "#typedef-delim-token": {"displayText":"<delim-token>","export":true,"for_":[],"level":"3","normative":true,"shortname":"css-syntax","spec":"css-syntax-3","status":"local","text":"<delim-token>","type":"type","url":"#typedef-delim-token"}, "#typedef-dimension-token": {"displayText":"<dimension-token>","export":true,"for_":[],"level":"3","normative":true,"shortname":"css-syntax","spec":"css-syntax-3","status":"local","text":"<dimension-token>","type":"type","url":"#typedef-dimension-token"}, "#typedef-eof-token": {"displayText":"<eof-token>","export":true,"for_":[],"level":"3","normative":true,"shortname":"css-syntax","spec":"css-syntax-3","status":"local","text":"<eof-token>","type":"type","url":"#typedef-eof-token"}, "#typedef-function-token": {"displayText":"<function-token>","export":true,"for_":[],"level":"3","normative":true,"shortname":"css-syntax","spec":"css-syntax-3","status":"local","text":"<function-token>","type":"type","url":"#typedef-function-token"}, "#typedef-hash-token": {"displayText":"<hash-token>","export":true,"for_":[],"level":"3","normative":true,"shortname":"css-syntax","spec":"css-syntax-3","status":"local","text":"<hash-token>","type":"type","url":"#typedef-hash-token"}, "#typedef-ident-token": {"displayText":"<ident-token>","export":true,"for_":[],"level":"3","normative":true,"shortname":"css-syntax","spec":"css-syntax-3","status":"local","text":"<ident-token>","type":"type","url":"#typedef-ident-token"}, "#typedef-number-token": {"displayText":"<number-token>","export":true,"for_":[],"level":"3","normative":true,"shortname":"css-syntax","spec":"css-syntax-3","status":"local","text":"<number-token>","type":"type","url":"#typedef-number-token"}, "#typedef-percentage-token": {"displayText":"<percentage-token>","export":true,"for_":[],"level":"3","normative":true,"shortname":"css-syntax","spec":"css-syntax-3","status":"local","text":"<percentage-token>","type":"type","url":"#typedef-percentage-token"}, "#typedef-qualified-rule-list": {"displayText":"<qualified-rule-list>","export":true,"for_":[],"level":"3","normative":true,"shortname":"css-syntax","spec":"css-syntax-3","status":"local","text":"<qualified-rule-list>","type":"type","url":"#typedef-qualified-rule-list"}, "#typedef-rule-list": {"displayText":"<rule-list>","export":true,"for_":[],"level":"3","normative":true,"shortname":"css-syntax","spec":"css-syntax-3","status":"local","text":"<rule-list>","type":"type","url":"#typedef-rule-list"}, "#typedef-semicolon-token": {"displayText":"<semicolon-token>","export":true,"for_":[],"level":"3","normative":true,"shortname":"css-syntax","spec":"css-syntax-3","status":"local","text":"<semicolon-token>","type":"type","url":"#typedef-semicolon-token"}, "#typedef-string-token": {"displayText":"<string-token>","export":true,"for_":[],"level":"3","normative":true,"shortname":"css-syntax","spec":"css-syntax-3","status":"local","text":"<string-token>","type":"type","url":"#typedef-string-token"}, "#typedef-unicode-range-token": {"displayText":"<unicode-range-token>","export":true,"for_":[],"level":"3","normative":true,"shortname":"css-syntax","spec":"css-syntax-3","status":"local","text":"<unicode-range-token>","type":"type","url":"#typedef-unicode-range-token"}, "#typedef-url-token": {"displayText":"<url-token>","export":true,"for_":[],"level":"3","normative":true,"shortname":"css-syntax","spec":"css-syntax-3","status":"local","text":"<url-token>","type":"type","url":"#typedef-url-token"}, "#typedef-whitespace-token": {"displayText":"<whitespace-token>","export":true,"for_":[],"level":"3","normative":true,"shortname":"css-syntax","spec":"css-syntax-3","status":"local","text":"<whitespace-token>","type":"type","url":"#typedef-whitespace-token"}, "#uppercase-letter": {"displayText":"uppercase letter","export":true,"for_":[],"level":"3","normative":true,"shortname":"css-syntax","spec":"css-syntax-3","status":"local","text":"uppercase letter","type":"dfn","url":"#uppercase-letter"}, "#whitespace": {"displayText":"whitespace","export":true,"for_":[],"level":"3","normative":true,"shortname":"css-syntax","spec":"css-syntax-3","status":"local","text":"whitespace","type":"dfn","url":"#whitespace"}, "https://drafts.css-houdini.org/css-typed-om-1/#custom-property-name-string": {"displayText":"custom property name string","export":true,"for_":[],"level":"1","normative":true,"shortname":"css-typed-om","spec":"css-typed-om-1","status":"current","text":"custom property name string","type":"dfn","url":"https://drafts.css-houdini.org/css-typed-om-1/#custom-property-name-string"}, "https://drafts.csswg.org/css-animations-1/#at-ruledef-keyframes": {"displayText":"@keyframes","export":true,"for_":[],"level":"1","normative":true,"shortname":"css-animations","spec":"css-animations-1","status":"current","text":"@keyframes","type":"at-rule","url":"https://drafts.csswg.org/css-animations-1/#at-ruledef-keyframes"}, "https://drafts.csswg.org/css-animations-1/#propdef-animation-timing-function": {"displayText":"animation-timing-function","export":true,"for_":[],"level":"1","normative":true,"shortname":"css-animations","spec":"css-animations-1","status":"current","text":"animation-timing-function","type":"property","url":"https://drafts.csswg.org/css-animations-1/#propdef-animation-timing-function"}, "https://drafts.csswg.org/css-animations-1/#typedef-keyframe-selector": {"displayText":"<keyframe-selector>","export":true,"for_":[],"level":"1","normative":true,"shortname":"css-animations","spec":"css-animations-1","status":"current","text":"<keyframe-selector>","type":"type","url":"https://drafts.csswg.org/css-animations-1/#typedef-keyframe-selector"}, "https://drafts.csswg.org/css-cascade-5/#at-ruledef-import": {"displayText":"@import","export":true,"for_":[],"level":"5","normative":true,"shortname":"css-cascade","spec":"css-cascade-5","status":"current","text":"@import","type":"at-rule","url":"https://drafts.csswg.org/css-cascade-5/#at-ruledef-import"}, "https://drafts.csswg.org/css-cascade-5/#css-property": {"displayText":"property","export":true,"for_":["CSS"],"level":"5","normative":true,"shortname":"css-cascade","spec":"css-cascade-5","status":"current","text":"property","type":"dfn","url":"https://drafts.csswg.org/css-cascade-5/#css-property"}, "https://drafts.csswg.org/css-color-4/#propdef-color": {"displayText":"color","export":true,"for_":[],"level":"4","normative":true,"shortname":"css-color","spec":"css-color-4","status":"current","text":"color","type":"property","url":"https://drafts.csswg.org/css-color-4/#propdef-color"}, "https://drafts.csswg.org/css-color-4/#valdef-color-blue": {"displayText":"blue","export":true,"for_":["<color>","<named-color>"],"level":"4","normative":true,"shortname":"css-color","spec":"css-color-4","status":"current","text":"blue","type":"value","url":"https://drafts.csswg.org/css-color-4/#valdef-color-blue"}, "https://drafts.csswg.org/css-color-5/#typedef-color": {"displayText":"<color>","export":true,"for_":[],"level":"5","normative":true,"shortname":"css-color","spec":"css-color-5","status":"current","text":"<color>","type":"type","url":"https://drafts.csswg.org/css-color-5/#typedef-color"}, "https://drafts.csswg.org/css-conditional-3/#at-ruledef-media": {"displayText":"@media","export":true,"for_":[],"level":"3","normative":true,"shortname":"css-conditional","spec":"css-conditional-3","status":"current","text":"@media","type":"at-rule","url":"https://drafts.csswg.org/css-conditional-3/#at-ruledef-media"}, "https://drafts.csswg.org/css-conditional-3/#at-ruledef-supports": {"displayText":"@supports","export":true,"for_":[],"level":"3","normative":true,"shortname":"css-conditional","spec":"css-conditional-3","status":"current","text":"@supports","type":"at-rule","url":"https://drafts.csswg.org/css-conditional-3/#at-ruledef-supports"}, "https://drafts.csswg.org/css-conditional-3/#conditional-group-rule": {"displayText":"conditional group rule","export":true,"for_":[],"level":"3","normative":true,"shortname":"css-conditional","spec":"css-conditional-3","status":"current","text":"conditional group rule","type":"dfn","url":"https://drafts.csswg.org/css-conditional-3/#conditional-group-rule"}, "https://drafts.csswg.org/css-counter-styles-3/#counter-style": {"displayText":"counter style","export":true,"for_":[],"level":"3","normative":true,"shortname":"css-counter-styles","spec":"css-counter-styles-3","status":"current","text":"counter style","type":"dfn","url":"https://drafts.csswg.org/css-counter-styles-3/#counter-style"}, "https://drafts.csswg.org/css-fonts-4/#descdef-font-face-unicode-range": {"displayText":"unicode-range","export":true,"for_":["@font-face"],"level":"4","normative":true,"shortname":"css-fonts","spec":"css-fonts-4","status":"current","text":"unicode-range","type":"descriptor","url":"https://drafts.csswg.org/css-fonts-4/#descdef-font-face-unicode-range"}, "https://drafts.csswg.org/css-fonts-4/#propdef-font": {"displayText":"font","export":true,"for_":[],"level":"4","normative":true,"shortname":"css-fonts","spec":"css-fonts-4","status":"current","text":"font","type":"property","url":"https://drafts.csswg.org/css-fonts-4/#propdef-font"}, "https://drafts.csswg.org/css-fonts-5/#at-font-face-rule": {"displayText":"@font-face","export":true,"for_":[],"level":"5","normative":true,"shortname":"css-fonts","spec":"css-fonts-5","status":"current","text":"@font-face","type":"at-rule","url":"https://drafts.csswg.org/css-fonts-5/#at-font-face-rule"}, "https://drafts.csswg.org/css-nesting-1/#cssnesteddeclarations": {"displayText":"CSSNestedDeclarations","export":true,"for_":[],"level":"1","normative":true,"shortname":"css-nesting","spec":"css-nesting-1","status":"current","text":"CSSNestedDeclarations","type":"interface","url":"https://drafts.csswg.org/css-nesting-1/#cssnesteddeclarations"}, "https://drafts.csswg.org/css-nesting-1/#nested-declarations-rule%E2%91%A0": {"displayText":"nested declarations rule","export":true,"for_":[],"level":"1","normative":true,"shortname":"css-nesting","spec":"css-nesting-1","status":"current","text":"nested declarations rule","type":"dfn","url":"https://drafts.csswg.org/css-nesting-1/#nested-declarations-rule%E2%91%A0"}, "https://drafts.csswg.org/css-page-3/#at-ruledef-page": {"displayText":"@page","export":true,"for_":[],"level":"3","normative":true,"shortname":"css-page","spec":"css-page-3","status":"current","text":"@page","type":"at-rule","url":"https://drafts.csswg.org/css-page-3/#at-ruledef-page"}, "https://drafts.csswg.org/css-page-3/#valdef-page-left": {"displayText":":left","export":true,"for_":["@page"],"level":"3","normative":true,"shortname":"css-page","spec":"css-page-3","status":"current","text":":left","type":"value","url":"https://drafts.csswg.org/css-page-3/#valdef-page-left"}, "https://drafts.csswg.org/css-text-decor-3/#propdef-text-decoration": {"displayText":"text-decoration","export":true,"for_":[],"level":"3","normative":true,"shortname":"css-text-decor","spec":"css-text-decor-3","status":"current","text":"text-decoration","type":"property","url":"https://drafts.csswg.org/css-text-decor-3/#propdef-text-decoration"}, "https://drafts.csswg.org/css-text-decor-4/#valdef-text-decoration-line-underline": {"displayText":"underline","export":true,"for_":["text-decoration-line"],"level":"4","normative":true,"shortname":"css-text-decor","spec":"css-text-decor-4","status":"current","text":"underline","type":"value","url":"https://drafts.csswg.org/css-text-decor-4/#valdef-text-decoration-line-underline"}, "https://drafts.csswg.org/css-transforms-1/#funcdef-transform-translatex": {"displayText":"translateX()","export":true,"for_":["transform"],"level":"1","normative":true,"shortname":"css-transforms","spec":"css-transforms-1","status":"current","text":"translatex()","type":"function","url":"https://drafts.csswg.org/css-transforms-1/#funcdef-transform-translatex"}, "https://drafts.csswg.org/css-values-4/#comb-one": {"displayText":"|","export":true,"for_":[],"level":"4","normative":true,"shortname":"css-values","spec":"css-values-4","status":"current","text":"|","type":"grammar","url":"https://drafts.csswg.org/css-values-4/#comb-one"}, "https://drafts.csswg.org/css-values-4/#funcdef-url": {"displayText":"url()","export":true,"for_":[],"level":"4","normative":true,"shortname":"css-values","spec":"css-values-4","status":"current","text":"url()","type":"function","url":"https://drafts.csswg.org/css-values-4/#funcdef-url"}, "https://drafts.csswg.org/css-values-4/#mult-one-plus": {"displayText":"+","export":true,"for_":[],"level":"4","normative":true,"shortname":"css-values","spec":"css-values-4","status":"current","text":"+","type":"grammar","url":"https://drafts.csswg.org/css-values-4/#mult-one-plus"}, "https://drafts.csswg.org/css-values-4/#mult-opt": {"displayText":"?","export":true,"for_":[],"level":"4","normative":true,"shortname":"css-values","spec":"css-values-4","status":"current","text":"?","type":"grammar","url":"https://drafts.csswg.org/css-values-4/#mult-opt"}, "https://drafts.csswg.org/css-values-4/#string-value": {"displayText":"<string>","export":true,"for_":[],"level":"4","normative":true,"shortname":"css-values","spec":"css-values-4","status":"current","text":"<string>","type":"type","url":"https://drafts.csswg.org/css-values-4/#string-value"}, "https://drafts.csswg.org/css-values-5/#funcdef-attr": {"displayText":"attr()","export":true,"for_":[],"level":"5","normative":true,"shortname":"css-values","spec":"css-values-5","status":"current","text":"attr()","type":"function","url":"https://drafts.csswg.org/css-values-5/#funcdef-attr"}, "https://drafts.csswg.org/css-variables-2/#custom-property": {"displayText":"custom property","export":true,"for_":[],"level":"2","normative":true,"shortname":"css-variables","spec":"css-variables-2","status":"current","text":"custom property","type":"dfn","url":"https://drafts.csswg.org/css-variables-2/#custom-property"}, "https://drafts.csswg.org/css-variables-2/#funcdef-var": {"displayText":"var()","export":true,"for_":[],"level":"2","normative":true,"shortname":"css-variables","spec":"css-variables-2","status":"current","text":"var()","type":"function","url":"https://drafts.csswg.org/css-variables-2/#funcdef-var"}, "https://drafts.csswg.org/cssom-1/#concept-css-style-sheet-location": {"displayText":"location","export":false,"for_":["CSSStyleSheet"],"level":"1","normative":true,"shortname":"cssom","spec":"cssom-1","status":"current","text":"location","type":"dfn","url":"https://drafts.csswg.org/cssom-1/#concept-css-style-sheet-location"}, "https://drafts.csswg.org/cssom-1/#cssstyledeclaration": {"displayText":"CSSStyleDeclaration","export":true,"for_":[],"level":"1","normative":true,"shortname":"cssom","spec":"cssom-1","status":"current","text":"CSSStyleDeclaration","type":"interface","url":"https://drafts.csswg.org/cssom-1/#cssstyledeclaration"}, "https://drafts.csswg.org/cssom-1/#dom-cssstyledeclaration-csstext": {"displayText":"cssText","export":true,"for_":["CSSStyleDeclaration"],"level":"1","normative":true,"shortname":"cssom","spec":"cssom-1","status":"current","text":"cssText","type":"attribute","url":"https://drafts.csswg.org/cssom-1/#dom-cssstyledeclaration-csstext"}, "https://drafts.csswg.org/cssom-1/#dom-cssstylesheet-insertrule": {"displayText":"insertRule(rule)","export":true,"for_":["CSSStyleSheet"],"level":"1","normative":true,"shortname":"cssom","spec":"cssom-1","status":"current","text":"insertRule(rule)","type":"method","url":"https://drafts.csswg.org/cssom-1/#dom-cssstylesheet-insertrule"}, "https://drafts.csswg.org/cssom-1/#dom-cssstylesheet-replace": {"displayText":"replace(text)","export":true,"for_":["CSSStyleSheet"],"level":"1","normative":true,"shortname":"cssom","spec":"cssom-1","status":"current","text":"replace(text)","type":"method","url":"https://drafts.csswg.org/cssom-1/#dom-cssstylesheet-replace"}, "https://drafts.csswg.org/mediaqueries-5/#typedef-general-enclosed": {"displayText":"<general-enclosed>","export":true,"for_":[],"level":"5","normative":true,"shortname":"mediaqueries","spec":"mediaqueries-5","status":"current","text":"<general-enclosed>","type":"type","url":"https://drafts.csswg.org/mediaqueries-5/#typedef-general-enclosed"}, "https://drafts.csswg.org/selectors-4/#nth-child-pseudo": {"displayText":":nth-child()","export":true,"for_":[],"level":"4","normative":true,"shortname":"selectors","spec":"selectors-4","status":"current","text":":nth-child()","type":"selector","url":"https://drafts.csswg.org/selectors-4/#nth-child-pseudo"}, "https://drafts.csswg.org/selectors-4/#selector-list": {"displayText":"selector list","export":true,"for_":[],"level":"4","normative":true,"shortname":"selectors","spec":"selectors-4","status":"current","text":"selector list","type":"dfn","url":"https://drafts.csswg.org/selectors-4/#selector-list"}, "https://drafts.csswg.org/selectors-4/#selectordef-adjacent": {"displayText":"+","export":true,"for_":[],"level":"4","normative":true,"shortname":"selectors","spec":"selectors-4","status":"current","text":"+","type":"selector","url":"https://drafts.csswg.org/selectors-4/#selectordef-adjacent"}, "https://drafts.csswg.org/selectors-4/#typedef-selector-list": {"displayText":"<selector-list>","export":true,"for_":[],"level":"4","normative":true,"shortname":"selectors","spec":"selectors-4","status":"current","text":"<selector-list>","type":"type","url":"https://drafts.csswg.org/selectors-4/#typedef-selector-list"}, "https://encoding.spec.whatwg.org/#concept-encoding-get": {"displayText":"get an encoding","export":true,"for_":[],"level":"1","normative":true,"shortname":"encoding","spec":"encoding","status":"current","text":"get an encoding","type":"dfn","url":"https://encoding.spec.whatwg.org/#concept-encoding-get"}, "https://encoding.spec.whatwg.org/#decode": {"displayText":"decode","export":true,"for_":[],"level":"1","normative":true,"shortname":"encoding","spec":"encoding","status":"current","text":"decode","type":"dfn","url":"https://encoding.spec.whatwg.org/#decode"}, "https://html.spec.whatwg.org/multipage/custom-elements.html#valid-custom-element-name": {"displayText":"valid custom element name","export":true,"for_":[],"level":"1","normative":true,"shortname":"html","spec":"html","status":"current","text":"valid custom element name","type":"dfn","url":"https://html.spec.whatwg.org/multipage/custom-elements.html#valid-custom-element-name"}, "https://html.spec.whatwg.org/multipage/embedded-content.html#attr-img-sizes": {"displayText":"sizes","export":true,"for_":["img"],"level":"1","normative":true,"shortname":"html","spec":"html","status":"current","text":"sizes","type":"element-attr","url":"https://html.spec.whatwg.org/multipage/embedded-content.html#attr-img-sizes"}, "https://html.spec.whatwg.org/multipage/grouping-content.html#the-p-element": {"displayText":"p","export":true,"for_":[],"level":"1","normative":true,"shortname":"html","spec":"html","status":"current","text":"p","type":"element","url":"https://html.spec.whatwg.org/multipage/grouping-content.html#the-p-element"}, "https://html.spec.whatwg.org/multipage/scripting.html#script": {"displayText":"script","export":true,"for_":[],"level":"1","normative":true,"shortname":"html","spec":"html","status":"current","text":"script","type":"element","url":"https://html.spec.whatwg.org/multipage/scripting.html#script"}, "https://html.spec.whatwg.org/multipage/semantics.html#the-style-element": {"displayText":"style","export":true,"for_":[],"level":"1","normative":true,"shortname":"html","spec":"html","status":"current","text":"style","type":"element","url":"https://html.spec.whatwg.org/multipage/semantics.html#the-style-element"}, "https://html.spec.whatwg.org/multipage/text-level-semantics.html#the-a-element": {"displayText":"a","export":true,"for_":[],"level":"1","normative":true,"shortname":"html","spec":"html","status":"current","text":"a","type":"element","url":"https://html.spec.whatwg.org/multipage/text-level-semantics.html#the-a-element"}, "https://infra.spec.whatwg.org/#ascii-case-insensitive": {"displayText":"ASCII case-insensitive","export":true,"for_":[],"level":"1","normative":true,"shortname":"infra","spec":"infra","status":"current","text":"ascii case-insensitive","type":"dfn","url":"https://infra.spec.whatwg.org/#ascii-case-insensitive"}, "https://infra.spec.whatwg.org/#code-point": {"displayText":"code point","export":true,"for_":[],"level":"1","normative":true,"shortname":"infra","spec":"infra","status":"current","text":"code point","type":"dfn","url":"https://infra.spec.whatwg.org/#code-point"}, "https://infra.spec.whatwg.org/#list": {"displayText":"list","export":true,"for_":[],"level":"1","normative":true,"shortname":"infra","spec":"infra","status":"current","text":"list","type":"dfn","url":"https://infra.spec.whatwg.org/#list"}, "https://infra.spec.whatwg.org/#list-iterate": {"displayText":"for each","export":true,"for_":["list","set"],"level":"1","normative":true,"shortname":"infra","spec":"infra","status":"current","text":"for each","type":"dfn","url":"https://infra.spec.whatwg.org/#list-iterate"}, "https://infra.spec.whatwg.org/#list-remove": {"displayText":"remove","export":true,"for_":["list","set"],"level":"1","normative":true,"shortname":"infra","spec":"infra","status":"current","text":"remove","type":"dfn","url":"https://infra.spec.whatwg.org/#list-remove"}, "https://infra.spec.whatwg.org/#scalar-value": {"displayText":"scalar value","export":true,"for_":[],"level":"1","normative":true,"shortname":"infra","spec":"infra","status":"current","text":"scalar value","type":"dfn","url":"https://infra.spec.whatwg.org/#scalar-value"}, "https://infra.spec.whatwg.org/#stack": {"displayText":"stack","export":true,"for_":[],"level":"1","normative":true,"shortname":"infra","spec":"infra","status":"current","text":"stack","type":"dfn","url":"https://infra.spec.whatwg.org/#stack"}, "https://infra.spec.whatwg.org/#stack-pop": {"displayText":"pop","export":true,"for_":["stack"],"level":"1","normative":true,"shortname":"infra","spec":"infra","status":"current","text":"pop","type":"dfn","url":"https://infra.spec.whatwg.org/#stack-pop"}, "https://infra.spec.whatwg.org/#string": {"displayText":"string","export":true,"for_":[],"level":"1","normative":true,"shortname":"infra","spec":"infra","status":"current","text":"string","type":"dfn","url":"https://infra.spec.whatwg.org/#string"}, "https://infra.spec.whatwg.org/#struct": {"displayText":"struct","export":true,"for_":[],"level":"1","normative":true,"shortname":"infra","spec":"infra","status":"current","text":"struct","type":"dfn","url":"https://infra.spec.whatwg.org/#struct"}, "https://infra.spec.whatwg.org/#struct-item": {"displayText":"item","export":true,"for_":["struct","tuple"],"level":"1","normative":true,"shortname":"infra","spec":"infra","status":"current","text":"item","type":"dfn","url":"https://infra.spec.whatwg.org/#struct-item"}, "https://infra.spec.whatwg.org/#surrogate": {"displayText":"surrogate","export":true,"for_":[],"level":"1","normative":true,"shortname":"infra","spec":"infra","status":"current","text":"surrogate","type":"dfn","url":"https://infra.spec.whatwg.org/#surrogate"}, "https://url.spec.whatwg.org/#concept-url": {"displayText":"URL","export":true,"for_":[],"level":"1","normative":true,"shortname":"url","spec":"url","status":"current","text":"url","type":"dfn","url":"https://url.spec.whatwg.org/#concept-url"}, "https://www.w3.org/TR/css-syntax-3/#non-ascii-code-point": {"displayText":"non-ASCII code point","export":true,"for_":[],"level":"3","normative":true,"shortname":"css-syntax","spec":"css-syntax-3","status":"snapshot","text":"non-ascii code point","type":"dfn","url":"https://www.w3.org/TR/css-syntax-3/#non-ascii-code-point"}, "https://www.w3.org/TR/css-syntax-3/#parse-a-list-of-declarations": {"displayText":"parse a list of declarations","export":true,"for_":[],"level":"3","normative":true,"shortname":"css-syntax","spec":"css-syntax-3","status":"snapshot","text":"parse a list of declarations","type":"dfn","url":"https://www.w3.org/TR/css-syntax-3/#parse-a-list-of-declarations"}, "https://www.w3.org/TR/css-syntax-3/#typedef-style-block": {"displayText":"<style-block>","export":true,"for_":[],"level":"3","normative":true,"shortname":"css-syntax","spec":"css-syntax-3","status":"snapshot","text":"<style-block>","type":"type","url":"https://www.w3.org/TR/css-syntax-3/#typedef-style-block"}, "https://www.w3.org/TR/css-syntax-3/#typedef-urange": {"displayText":"<urange>","export":true,"for_":[],"level":"3","normative":true,"shortname":"css-syntax","spec":"css-syntax-3","status":"snapshot","text":"<urange>","type":"type","url":"https://www.w3.org/TR/css-syntax-3/#typedef-urange"}, }; function mkRefHint(link, ref) { const linkText = link.textContent; let dfnTextElements = ''; if (ref.displayText.toLowerCase() != linkText.toLowerCase()) { // Give the original term if it's being displayed in a different way. // But allow casing differences, they're insignificant. dfnTextElements = mk.li({}, mk.b({}, "Term: "), mk.span({}, ref.displayText) ); } const forList = ref.for_; let forListElements; if(forList.length == 0) { forListElements = []; } else if(forList.length == 1) { forListElements = mk.li({}, mk.b({}, "For: "), mk.span({}, forList[0]), ); } else { forListElements = mk.li({}, mk.b({}, "For: "), mk.ul({}, ...forList.map(forItem => mk.li({}, mk.span({}, forItem) ), ), ), ); } const url = ref.url; const safeUrl = encodeURIComponent(url); const hintPanel = mk.aside({ class: "ref-hint", id: `ref-hint-for-${safeUrl}`, "data-for": url, "aria-labelled-by": `ref-hint-for-${safeUrl}`, }, mk.ul({}, dfnTextElements, mk.li({}, mk.b({}, "URL: "), mk.a({ href: url, class: "ref" }, url), ), mk.li({}, mk.b({}, "Type: "), mk.span({}, `${ref.type}`), ), mk.li({}, mk.b({}, "Spec: "), mk.span({}, `${ref.spec ? ref.spec : ''}`), ), forListElements ), ); hintPanel.forLink = link; setupRefHintEventListeners(link, hintPanel); return hintPanel; } function hideAllRefHints() { queryAll(".ref-hint").forEach(el=>hideRefHint(el)); } function hideRefHint(refHint) { const link = refHint.forLink; link.setAttribute("aria-expanded", "false"); if(refHint.teardownEventListeners) { refHint.teardownEventListeners(); } refHint.remove(); } function showRefHint(link) { if(link.classList.contains("dfn-link")) return; const url = link.getAttribute("href"); const ref = refsData[url]; if(!ref) return; hideAllRefHints(); // Only display one at this time. const refHint = mkRefHint(link, ref); append(document.body, refHint); link.setAttribute("aria-expanded", "true"); positionRefHint(refHint); } function setupRefHintEventListeners(link, refHint) { if (refHint.teardownEventListeners) return; // Add event handlers to hide the refHint after the user moves away // from both the link and refHint, if not hovering either within one second. let timeout = null; const startHidingRefHint = (event) => { if (timeout) { clearTimeout(timeout); } timeout = setTimeout(() => { hideRefHint(refHint); }, 1000); } const resetHidingRefHint = (event) => { if (timeout) clearTimeout(timeout); timeout = null; }; link.addEventListener("mouseleave", startHidingRefHint); link.addEventListener("mouseenter", resetHidingRefHint); link.addEventListener("blur", startHidingRefHint); link.addEventListener("focus", resetHidingRefHint); refHint.addEventListener("mouseleave", startHidingRefHint); refHint.addEventListener("mouseenter", resetHidingRefHint); refHint.addEventListener("blur", startHidingRefHint); refHint.addEventListener("focus", resetHidingRefHint); refHint.teardownEventListeners = () => { // remove event listeners resetHidingRefHint(); link.removeEventListener("mouseleave", startHidingRefHint); link.removeEventListener("mouseenter", resetHidingRefHint); link.removeEventListener("blur", startHidingRefHint); link.removeEventListener("focus", resetHidingRefHint); refHint.removeEventListener("mouseleave", startHidingRefHint); refHint.removeEventListener("mouseenter", resetHidingRefHint); refHint.removeEventListener("blur", startHidingRefHint); refHint.removeEventListener("focus", resetHidingRefHint); }; } function positionRefHint(refHint) { const link = refHint.forLink; const linkPos = getBounds(link); refHint.style.top = linkPos.bottom + "px"; refHint.style.left = linkPos.left + "px"; const panelPos = refHint.getBoundingClientRect(); const panelMargin = 8; const maxRight = document.body.parentNode.clientWidth - panelMargin; if (panelPos.right > maxRight) { const overflowAmount = panelPos.right - maxRight; const newLeft = Math.max(panelMargin, linkPos.left - overflowAmount); refHint.style.left = newLeft + "px"; } } // TODO: shared util // Returns the root-level absolute position {left and top} of element. function getBounds(el, relativeTo=document.body) { const relativeRect = relativeTo.getBoundingClientRect(); const elRect = el.getBoundingClientRect(); const top = elRect.top - relativeRect.top; const left = elRect.left - relativeRect.left; return { top, left, bottom: top + elRect.height, right: left + elRect.width, } } function showRefHintListener(e) { // If the target isn't in a link (or is a link), // just ignore it. let link = e.target.closest("a"); if(!link) return; // If the target is in a ref-hint panel // (aka a link in the already-open one), // also just ignore it. if(link.closest(".ref-hint")) return; // Otherwise, show the panel for the link. showRefHint(link); } function hideAllHintsListener(e) { // If the click is inside a ref-hint panel, ignore it. if(e.target.closest(".ref-hint")) return; // Otherwise, close all the current panels. hideAllRefHints(); } document.addEventListener("DOMContentLoaded", () => { document.body.addEventListener("mousedown", showRefHintListener); document.body.addEventListener("focus", showRefHintListener); document.body.addEventListener("click", hideAllHintsListener); }); window.addEventListener("resize", () => { // Hide any open ref hint. hideAllRefHints(); }); } </script> <script>/* Boilerplate: script-var-click-highlighting */ "use strict"; { /* Color-choosing design: * Colors are ordered by goodness. * On clicking a var, give it the earliest color with the lowest usage in the algorithm. * On re-clicking, re-use the var's most recent color if that's not currently being used elsewhere. */ const COLOR_COUNT = 7; document.addEventListener("click", e=>{ if(e.target.nodeName == "VAR") { highlightSameAlgoVars(e.target); } }); function highlightSameAlgoVars(v) { // Find the algorithm container. let algoContainer = findAlgoContainer(v); // Not highlighting document-global vars, // too likely to be unrelated. if(algoContainer == null) return; const varName = nameFromVar(v); if(!v.hasAttribute("data-var-color")) { const newColor = chooseHighlightColor(algoContainer, v); for(const el of algoContainer.querySelectorAll("var")) { if(nameFromVar(el) == varName) { el.setAttribute("data-var-color", newColor); el.setAttribute("data-var-last-color", newColor); } } } else { for(const el of algoContainer.querySelectorAll("var")) { if(nameFromVar(el) == varName) { el.removeAttribute("data-var-color"); } } } } function findAlgoContainer(el) { while(el != document.body) { if(el.hasAttribute("data-algorithm")) return el; el = el.parentNode; } return null; } function nameFromVar(el) { return el.textContent.replace(/(\s|\xa0)+/g, " ").trim(); } function colorCountsFromContainer(container) { const namesFromColor = Array.from({length:COLOR_COUNT}, x=>new Set()); for(let v of container.querySelectorAll("var[data-var-color]")) { let color = +v.getAttribute("data-var-color"); namesFromColor[color].add(nameFromVar(v)); } return namesFromColor.map(x=>x.size); } function leastUsedColor(colors) { // Find the earliest color with the lowest count. let minCount = Infinity; let minColor = null; for(var i = 0; i < colors.length; i++) { if(colors[i] < minCount) { minColor = i; minCount = colors[i]; } } return minColor; } function chooseHighlightColor(container, v) { const colorCounts = colorCountsFromContainer(container); if(v.hasAttribute("data-var-last-color")) { let color = +v.getAttribute("data-var-last-color"); if(colorCounts[color] == 0) return color; } return leastUsedColor(colorCounts); } } </script>