|
16 | 16 | <h1>CSS Object Model (CSSOM)</h1> |
17 | 17 |
|
18 | 18 |
|
19 | | - <h2 class="no-num no-toc" id="w3c-doctype">Editor's Draft 2 September 2013</h2> |
| 19 | + <h2 class="no-num no-toc" id="w3c-doctype">Editor's Draft 5 September 2013</h2> |
20 | 20 |
|
21 | 21 | <dl> |
22 | 22 |
|
@@ -90,7 +90,7 @@ <h2 class="no-num no-toc" id="sotd">Status of This Document</h2> |
90 | 90 | can be found in the |
91 | 91 | <a href="http://www.w3.org/TR/">W3C technical reports index at http://www.w3.org/TR/.</a></em> |
92 | 92 |
|
93 | | -<p class="dontpublish">This is the 2 September 2013 Editor's Draft of CSSOM. Please send comments to |
| 93 | +<p class="dontpublish">This is the 5 September 2013 Editor's Draft of CSSOM. Please send comments to |
94 | 94 | <a href="mailto:www-style@w3.org?subject=%5Bcssom%5D%20">www-style@w3.org</a> |
95 | 95 | (<a href="http://lists.w3.org/Archives/Public/www-style/">archived</a>) |
96 | 96 | with <samp>[cssom]</samp> at the start of the subject line. |
@@ -1738,8 +1738,15 @@ <h3 id="css-rules"><span class="secno">6.4 </span>CSS Rules</h3> |
1738 | 1738 | <p>In addition to the above state, each <a href="#css-rule">CSS rule</a> may be associated |
1739 | 1739 | with other state in accordance with its <a href="#concept-css-rule-type" title="concept-css-rule-type">type</a>.</p> |
1740 | 1740 |
|
1741 | | -<p>To <dfn id="parse-a-css-rule">parse a CSS rule</dfn> from a string <var>string</var>, invoke <a class="external" data-anolis-spec="csssyntax" href="http://dev.w3.org/csswg/css-syntax/#parse-a-rule0">parse a rule</a> with <var>string</var> and return |
1742 | | -the value returned.</p> |
| 1741 | +<p>To <dfn id="parse-a-css-rule">parse a CSS rule</dfn> from a string <var>string</var>, run the following steps: |
| 1742 | + |
| 1743 | +<ol> |
| 1744 | + <li><p>Let <var>rule</var> be the return value of invoking <a class="external" data-anolis-spec="csssyntax" href="http://dev.w3.org/csswg/css-syntax/#parse-a-rule0">parse a rule</a> with <var>string</var>. |
| 1745 | + <li><p>If <var>rule</var> is a syntax error, return <var>rule</var>. |
| 1746 | + <li><p>Let <var>parsed rule</var> be the result of parsing <var>rule</var> according to the appropriate CSS specifications, dropping parts that are said to be |
| 1747 | + ignored. If the whole style rule is dropped, return a syntax error. |
| 1748 | + <li><p>Return <var>parsed rule</var>. |
| 1749 | +</ol> |
1743 | 1750 |
|
1744 | 1751 | <p>To <dfn id="serialize-a-css-rule">serialize a CSS rule</dfn>, perform one of the following in accordance with the <a href="#css-rule">CSS rule</a>'s |
1745 | 1752 | <a href="#concept-css-rule-type" title="concept-css-rule-type">type</a>:</p> |
@@ -1813,8 +1820,6 @@ <h3 id="css-rules"><span class="secno">6.4 </span>CSS Rules</h3> |
1813 | 1820 | on argument <var>rule</var>. |
1814 | 1821 | <li><p>If <var>new rule</var> is a syntax error, <a class="external" data-anolis-spec="dom" href="http://dom.spec.whatwg.org/#concept-throw" title="concept-throw">throw</a> |
1815 | 1822 | a <code class="external" data-anolis-spec="dom"><a href="http://dom.spec.whatwg.org/#syntaxerror">SyntaxError</a></code> exception.</li> |
1816 | | - <li><p>Parse <var>new rule</var> according to the appropriate CSS specifications, dropping parts that are said to be ignored. If the whole style rule is |
1817 | | - dropped, <a class="external" data-anolis-spec="dom" href="http://dom.spec.whatwg.org/#concept-throw" title="concept-throw">throw</a> a <code class="external" data-anolis-spec="dom"><a href="http://dom.spec.whatwg.org/#syntaxerror">SyntaxError</a></code> exception. |
1818 | 1823 | <li><p>If <var>new rule</var> is an <code title="">@charset</code> at-rule, <a class="external" data-anolis-spec="dom" href="http://dom.spec.whatwg.org/#concept-throw" title="concept-throw">throw</a> a |
1819 | 1824 | <code class="external" data-anolis-spec="dom"><a href="http://dom.spec.whatwg.org/#syntaxerror">SyntaxError</a></code> exception. |
1820 | 1825 | <li><p>Set <var>length</var> to the number of items in <var>list</var>.</li> |
@@ -2210,8 +2215,19 @@ <h3 id="css-declaration-blocks"><span class="secno">6.6 </span>CSS Declaration B |
2210 | 2215 | null otherwise. |
2211 | 2216 | </dl> |
2212 | 2217 |
|
2213 | | -<p>To <dfn id="parse-a-css-declaration-block">parse a CSS declaration block</dfn> from a string <var>string</var>, invoke <a class="external" data-anolis-spec="csssyntax" href="http://dev.w3.org/csswg/css-syntax/#parse-a-list-of-declarations0">parse a list of declarations</a> with |
2214 | | -<var>string</var> and return the value returned.</p> |
| 2218 | +<p>To <dfn id="parse-a-css-declaration-block">parse a CSS declaration block</dfn> from a string <var>string</var>, follow these steps: |
| 2219 | + |
| 2220 | +<ol> |
| 2221 | + <li><p>Let <var>declarations</var> be the return value of invoking <a class="external" data-anolis-spec="csssyntax" href="http://dev.w3.org/csswg/css-syntax/#parse-a-list-of-declarations0">parse a list of declarations</a> with <var>string</var>. |
| 2222 | + <li><p>Let <var>parsed declarations</var> be a new empty list. |
| 2223 | + <li><p>For each item <var>declaration</var> in <var>declarations</var>, follow these substeps: |
| 2224 | + <ol> |
| 2225 | + <li><p>Let <var>parsed declaration</var> be the result of parsing <var>declaration</var> according to the appropriate CSS specifications, dropping parts that |
| 2226 | + are said to be ignored. If the whole declaration is dropped, let <var>parsed declaration</var> be null. |
| 2227 | + <li><p>If <var>parsed declaration</var> is not null, append it to <var>parsed declarations</var>. |
| 2228 | + </ol> |
| 2229 | + <li><p>Return <var>parsed declarations</var>. |
| 2230 | +</ol> |
2215 | 2231 |
|
2216 | 2232 | <p>To <dfn id="serialize-a-css-declaration">serialize a CSS declaration</dfn> with property name <var>property</var>, value <var>value</var> and optionally an <i>important</i> flag set, follow |
2217 | 2233 | these steps: |
|
0 commit comments