Skip to content

Commit 8a3de92

Browse files
committed
Start on parser.
--HG-- extra : rebase_source : fd77a74b7e66794aba3adace75ca600dddf51f4c
1 parent 2380962 commit 8a3de92

2 files changed

Lines changed: 137 additions & 4 deletions

File tree

css3-syntax/Overview.html

Lines changed: 77 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,13 +36,13 @@
3636

3737
<h1>CSS Syntax Module Level 3</h1>
3838

39-
<h2 class="no-num no-toc" id=longstatus-date>Editor's Draft 16 April 2012</h2>
39+
<h2 class="no-num no-toc" id=longstatus-date>Editor's Draft 17 April 2012</h2>
4040

4141
<dl>
4242
<dt>This version:
4343

4444
<dd><a class=replaceme
45-
href="http://www.w3.org/TR/2012/ED-cssN-FIXME-20120416/">http://www.w3.org/TR/2012/ED-cssN-FIXME-20120416/</a>
45+
href="http://www.w3.org/TR/2012/ED-cssN-FIXME-20120417/">http://www.w3.org/TR/2012/ED-cssN-FIXME-20120417/</a>
4646

4747

4848
<dt>Latest version:
@@ -267,6 +267,15 @@ <h2 class="no-num no-toc" id=contents> Table of contents</h2>
267267

268268
<li><a href="#tree-construction"><span class=secno>3.5. </span> Tree
269269
Construction</a>
270+
<ul class=toc>
271+
<li><a href="#creating-and-inserting-rules"><span class=secno>3.5.1.
272+
</span> Creating and Inserting Rules</a>
273+
274+
<li><a href="#terms"><span class=secno>3.5.2. </span> Terms</a>
275+
276+
<li><a href="#top-level-insertion-mode-"><span class=secno>3.5.3.
277+
</span> Top-level insertion mode </a>
278+
</ul>
270279
</ul>
271280

272281
<li><a href="#conformance"><span class=secno>4. </span> Conformance</a>
@@ -1821,7 +1830,63 @@ <h4 id=set-the-unicode-range-tokens-range><span class=secno>3.4.26. </span>
18211830
<h3 id=tree-construction><span class=secno>3.5. </span> Tree Construction</h3>
18221831

18231832
<p> The input to the tree construction stage is a sequence of tokens from
1824-
the tokenization stage. <!--
1833+
the tokenization stage. The tree construction stage is associated with a
1834+
stylesheet (sometimes a full CSSStyleSheet object, other times a "virtual"
1835+
stylesheet). The "output" of this stage consists of dynamically modifying
1836+
or extending that stylesheet's CSSOM.
1837+
1838+
<h4 id=creating-and-inserting-rules><span class=secno>3.5.1. </span>
1839+
Creating and Inserting Rules</h4>
1840+
1841+
<p> ...
1842+
1843+
<h4 id=terms><span class=secno>3.5.2. </span> Terms</h4>
1844+
1845+
<dl>
1846+
<dt><dfn id=stack-of-pending-rules>Stack of pending rules</dfn>
1847+
1848+
<dd> ...
1849+
1850+
<dt><dfn id=stack-of-open-blocks>Stack of open blocks</dfn>
1851+
</dl>
1852+
1853+
<h4 id=top-level-insertion-mode-><span class=secno>3.5.3. </span> <dfn
1854+
id=top-level-insertion-mode>Top-level insertion mode</dfn></h4>
1855+
1856+
<p> Consume the next input token.
1857+
1858+
<dl>
1859+
<dt>cdo token
1860+
1861+
<dt>cdc token
1862+
1863+
<dt>whitespace token
1864+
1865+
<dd> Do nothing. Remain in this mode.
1866+
1867+
<dt>at-keyword token
1868+
1869+
<dd> If the at-keyword's value is the name of an at-rule that the UA
1870+
recognizes, create a new <i>AtRule</i> rule and push it onto the <a
1871+
href="#stack-of-pending-rules"><i>stack of pending rules</i></a>. Switch
1872+
to the <i>after at-keyword insertion mode</i>.
1873+
<p> Otherwise, this is a <i>parse error</i>. Switch to the <i>at-rule
1874+
error mode</i>.
1875+
1876+
<dt>start-block token
1877+
1878+
<dd> This is a <i>parse error</i>. Push the token onto the <a
1879+
href="#stack-of-open-blocks"><i>stack of open blocks</i></a>. Switch to
1880+
the <i>block error mode</i>.
1881+
1882+
<dt>anything else
1883+
1884+
<dd> Create a new <i>Style</i> rule and append it to the <a
1885+
href="#stack-of-pending-rules"><i>stack of pending rules</i></a>. Switch
1886+
to the <i>in selector mode</i>. Reprocess the <i>current input token</i>.
1887+
1888+
</dl>
1889+
<!--
18251890
18261891
TTTTTTTTTTTTTTTTTTTTTTTHHHHHHHHH HHHHHHHHHEEEEEEEEEEEEEEEEEEEEEE
18271892
T:::::::::::::::::::::TH:::::::H H:::::::HE::::::::::::::::::::E
@@ -1859,7 +1924,6 @@ <h3 id=tree-construction><span class=secno>3.5. </span> Tree Construction</h3>
18591924
E::::::::::::::::::::EN::::::N N::::::ND::::::::::::DDD
18601925
EEEEEEEEEEEEEEEEEEEEEENNNNNNNN NNNNNNNDDDDDDDDDDDDD
18611926
-->
1862-
18631927

18641928
<h2 id=conformance><span class=secno>4. </span> Conformance</h2>
18651929

@@ -2168,6 +2232,12 @@ <h2 class=no-num id=index> Index</h2>
21682232
<li>Single-quote-string state, <a href="#single-quote-string-state0"
21692233
title="Single-quote-string state"><strong>3.4.5.</strong></a>
21702234

2235+
<li>Stack of open blocks, <a href="#stack-of-open-blocks"
2236+
title="Stack of open blocks"><strong>3.5.2.</strong></a>
2237+
2238+
<li>Stack of pending rules, <a href="#stack-of-pending-rules"
2239+
title="Stack of pending rules"><strong>3.5.2.</strong></a>
2240+
21712241
<li>start of the range, <a href="#start-of-the-range"
21722242
title="start of the range"><strong>3.4.26.</strong></a>
21732243

@@ -2180,6 +2250,9 @@ <h2 class=no-num id=index> Index</h2>
21802250
<li>supports scientific notation, <a href="#supports-scientific-notation"
21812251
title="supports scientific notation"><strong>3.4.1.</strong></a>
21822252

2253+
<li>Top-level insertion mode, <a href="#top-level-insertion-mode"
2254+
title="Top-level insertion mode"><strong>3.5.3.</strong></a>
2255+
21832256
<li>transform function whitespace, <a
21842257
href="#transform-function-whitespace"
21852258
title="transform function whitespace"><strong>3.4.1.</strong></a>

css3-syntax/Overview.src.html

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1857,6 +1857,66 @@ <h3>
18571857

18581858
<p>
18591859
The input to the tree construction stage is a sequence of tokens from the tokenization stage.
1860+
The tree construction stage is associated with a stylesheet
1861+
(sometimes a full CSSStyleSheet object, other times a "virtual" stylesheet).
1862+
The "output" of this stage consists of dynamically modifying or extending that stylesheet's CSSOM.
1863+
1864+
<h4>
1865+
Creating and Inserting Rules</h4>
1866+
1867+
<p>
1868+
...
1869+
1870+
<h4>
1871+
Terms</h4>
1872+
1873+
<dl>
1874+
<dt><dfn>Stack of pending rules</dfn>
1875+
<dd>
1876+
...
1877+
1878+
<dt><dfn>Stack of open blocks</dfn>
1879+
</dl>
1880+
1881+
<h4>
1882+
<dfn>Top-level insertion mode</dfn>
1883+
1884+
<p>
1885+
Consume the next input token.
1886+
1887+
<dl>
1888+
<dt>cdo token
1889+
<dt>cdc token
1890+
<dt>whitespace token
1891+
<dd>
1892+
Do nothing.
1893+
Remain in this mode.
1894+
1895+
<dt>at-keyword token
1896+
<dd>
1897+
If the at-keyword's value is the name of an at-rule that the UA recognizes,
1898+
create a new <i>AtRule</i> rule
1899+
and push it onto the <i>stack of pending rules</i>.
1900+
Switch to the <i>after at-keyword insertion mode</i>.
1901+
1902+
<p>
1903+
Otherwise, this is a <i>parse error</i>.
1904+
Switch to the <i>at-rule error mode</i>.
1905+
1906+
<dt>start-block token
1907+
<dd>
1908+
This is a <i>parse error</i>.
1909+
Push the token onto the <i>stack of open blocks</i>.
1910+
Switch to the <i>block error mode</i>.
1911+
1912+
<dt>anything else
1913+
<dd>
1914+
Create a new <i>Style</i> rule
1915+
and append it to the <i>stack of pending rules</i>.
1916+
Switch to the <i>in selector mode</i>.
1917+
Reprocess the <i>current input token</i>.
1918+
</dl>
1919+
18601920

18611921

18621922
<!--

0 commit comments

Comments
 (0)