Skip to content

Commit d543cbd

Browse files
committed
[cssom] (1) add copy of (minimal) anolis xref/ref data to ensure accurate data as required by cssom;
(2) elaborate CSS rule serialization rules for style and charset rules;
1 parent ee5c285 commit d543cbd

9 files changed

Lines changed: 3694 additions & 71 deletions

File tree

cssom/Overview.html

Lines changed: 75 additions & 59 deletions
Large diffs are not rendered by default.

cssom/cssom-source

Lines changed: 31 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1181,11 +1181,11 @@
11811181

11821182
<li>
11831183
<p>When the resource is available, the document is in
1184-
<span data-anolis-spec=dom title=concept-quirks-mode>quirks mode</span>
1184+
<span data-anolis-spec=html>quirks mode</span>
11851185
and the
1186-
<span data-anolis-spec=html>Content-Type metadata</span> of
1186+
<span data-anolis-spec=html title="content-type">Content-Type metadata</span> of
11871187
the resource is not a <span>supported styling language</span> change the
1188-
<span data-anolis-spec=html>Content-Type metadata</span> of the resource
1188+
<span data-anolis-spec=html title="content-type">Content-Type metadata</span> of the resource
11891189
to <code>text/css</code>.</p>
11901190

11911191
<p class="note">This step might never actually happen, but is included
@@ -1259,10 +1259,10 @@
12591259
<span data-anolis-spec=html>fetch</span> it.</p></li>
12601260

12611261
<li><p>When the resource is available, the document is in
1262-
<span data-anolis-spec=dom title=concept-quirks-mode>quirks mode</span>
1263-
and the <span data-anolis-spec=html>Content-Type metadata</span> of
1262+
<span data-anolis-spec=html>quirks mode</span>
1263+
and the <span data-anolis-spec=html title="content-type">Content-Type metadata</span> of
12641264
the resource is not a <span>supported styling language</span> change the
1265-
<span data-anolis-spec=html>Content-Type metadata</span> of the resource
1265+
<span data-anolis-spec=html title="content-type">Content-Type metadata</span> of the resource
12661266
to <code>text/css</code>.</p></li>
12671267

12681268
<li><p>If the resource is not in a
@@ -1340,21 +1340,40 @@
13401340
<p class="issue">Should a rule be instantiated in OM if there is a parse error? To
13411341
what extent should original (but non-valid) CSS text be captured in cssText?</p>
13421342

1343-
<p>To <dfn>serialize a CSS rule</dfn> depends on the type of CSS rule, as
1344-
follows:</p>
1343+
<p>To <dfn>serialize a CSS rule</dfn>, perform one of the following in accordance with the its <span>rule type</span>:</p>
13451344

13461345
<dl class="switch">
13471346
<dt><code>CSSStyleRule</code></dt>
1348-
<dd><p class="issue">...</p></dd>
1347+
<dd>
1348+
<p>The result of concatenating the following:</p>
1349+
<ol>
1350+
<li>The result of performing <span>serialize a group of selectors</span> on the rule's associated selectors.</li>
1351+
<li>The string "<code> { </code>", i.e., a single SPACE (U+0020), followed by LEFT CURLY BRACKET (U+007B),
1352+
followed by a single SPACE (U+0020).</li>
1353+
<li>The result of performing <span>serialize a CSS declaration block</span> on the rule's associated declarations.</li>
1354+
<li>If the rule is associated with one or more declarations, the string "<code> </code>", i.e., a single SPACE (U+0020).</li>
1355+
<li>The string "<code>}</code>", RIGHT CURLY BRACKET (U+007D).
1356+
</ol>
1357+
</dd>
13491358

13501359
<dt><code>CSSCharsetRule</code></dt>
1351-
<dd><p class="issue">...</p></dd>
1360+
<dd>
1361+
<p>The result of concatenating the following:</p>
1362+
<ol>
1363+
<li>The string "<code>@charset</code>" followed by a single SPACE (U+0020).</li>
1364+
<li>The result of performing <span>serialize a string</span> on the <span data-anolis-spec=html>preferred MIME name</span> of the rule's encoding.</li>
1365+
<li>The string "<code>;</code>", i.e., SEMICOLON (U+003B).
1366+
</ol>
1367+
<div class="example">
1368+
<pre>@charset "UTF-8";</pre>
1369+
</div>
1370+
</dd>
13521371

13531372
<dt><code>CSSImportRule</code></dt>
13541373
<dd>
1355-
<p>The result of concatenating these strings:</p>
1374+
<p>The result of concatenating the following:</p>
13561375
<ol>
1357-
<li>The literal string "<code>@import</code>", followed by a single SPACE
1376+
<li>The string "<code>@import</code>" followed by a single SPACE
13581377
(U+0020), followed by the <span title="serialize a URL">URL escaped</span>
13591378
value of the <code title="dom-CSSImportRule-href">href</code>
13601379
attribute.</li>

cssom/data/references.json

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
{
2+
"CSS" : {
3+
"href" : "http://www.w3.org/TR/CSS2/",
4+
"title" : "CSS",
5+
"authors" : ["Bert Bos", "Tantek Çelik", "Ian Hickson", "Håkon Wium Lie"],
6+
"publisher" : "W3C"
7+
},
8+
"DOM" : {
9+
"href" : "http://dom.spec.whatwg.org/",
10+
"oldhref" : "http://www.w3.org/TR/domcore/",
11+
"title" : "DOM",
12+
"authors" : ["Anne van Kesteren", "Aryeh Gregor", "Ms2ger"],
13+
"publisher" : "WHATWG"
14+
},
15+
"DOM2STYLE" : {
16+
"href" : "http://www.w3.org/TR/DOM-Level-2-Style/",
17+
"title" : "Document Object Model (DOM) Level 2 Style Specification",
18+
"authors" : ["Chris Wilson", "Philippe Le Hégaret", "Vidur Apparao"],
19+
"publisher" : "W3C"
20+
},
21+
"HTML" : {
22+
"href" : "http://www.whatwg.org/specs/web-apps/current-work/multipage/",
23+
"title" : "HTML",
24+
"authors" : ["Ian Hickson"],
25+
"publisher" : "WHATWG"
26+
},
27+
"RFC2119" : {
28+
"href" : "http://tools.ietf.org/html/rfc2119",
29+
"title" : "Key words for use in RFCs to Indicate Requirement Levels",
30+
"authors" : ["Scott Bradner"],
31+
"publisher" : "IETF"
32+
},
33+
"XML" : {
34+
"href" : "http://www.w3.org/TR/xml/",
35+
"title" : "Extensible Markup Language",
36+
"authors" : ["Tim Bray", "Jean Paoli", "C. M. Sperberg-McQueen", "Eve Maler", "François Yergeau"],
37+
"publisher" : "W3C"
38+
},
39+
"XMLSS" : {
40+
"href" : "http://www.w3.org/TR/xml-stylesheet/",
41+
"title" : "Associating Style Sheets with XML documents 1.0 (Second Edition)",
42+
"authors" : ["James Clark", "Simon Pieters", "Henry S. Thompson"],
43+
"publisher" : "W3C"
44+
}
45+
}

cssom/data/specs.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"dom": "dom/dom.json",
3+
"html": "dom/html.json",
4+
"xml": "dom/xml.json",
5+
"xmlss": "dom/xmlss.json"
6+
}

cssom/data/xrefs/css/cssom.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{ "definitions": {}, "url": "http://dvcs.w3.org/hg/csswg/raw-file/tip/cssom/Overview.html#" }

0 commit comments

Comments
 (0)