Thu, 30 May 2013 16:39:35 +0200
[cssom] Disallow changes to @namespace if there are other rules, and allow changes otherwise. https://www.w3.org/Bugs/Public/show_bug.cgi?id=22208
cssom/Overview.html | file | annotate | diff | comparison | revisions | |
cssom/Overview.src.html | file | annotate | diff | comparison | revisions |
1.1 --- a/cssom/Overview.html Thu May 30 14:32:24 2013 +0200 1.2 +++ b/cssom/Overview.html Thu May 30 16:39:35 2013 +0200 1.3 @@ -1737,6 +1737,9 @@ 1.4 by CSS, then <a class="external" href="http://dom.spec.whatwg.org/#concept-throw" title="concept-throw">throw</a> 1.5 a <code class="external"><a href="http://dom.spec.whatwg.org/#hierarchyrequesterror">HierarchyRequestError</a></code> exception. <a href="#refsCSS">[CSS]</a></p> 1.6 <p class="note">For example, a CSS style sheet cannot contain an <code title="">@import</code> at-rule after a rule set.</li> 1.7 + <li><p>If <var title="">newRule</var> is an <code title="">@namespace</code> at-rule, and <var title="">list</var> contains anything other than 1.8 + <code title="">@charset</code> at-rules, <code title="">@import</code> at-rules, and <code title="">@namespace</code> at-rules, 1.9 + <a class="external" href="http://dom.spec.whatwg.org/#concept-throw" title="concept-throw">throw</a> an <code class="external"><a href="http://dom.spec.whatwg.org/#invalidstateerror">InvalidStateError</a></code> exception. 1.10 <li><p>Insert <var>newRule</var> into <var>list</var> at the zero-indexed position <var>index</var>.<p></li> 1.11 <li><p>Return <var>index</var>.</li> 1.12 </ol> 1.13 @@ -1749,6 +1752,9 @@ 1.14 <li><p>If <var>index</var> is greater than or equal to <var>N</var>, then <a class="external" href="http://dom.spec.whatwg.org/#concept-throw" title="concept-throw">throw</a> 1.15 an <code class="external"><a href="http://dom.spec.whatwg.org/#indexsizeerror">IndexSizeError</a></code> exception.</li> 1.16 <li><p>Set <var>oldRule</var> to the <var>index</var>th item in <var>list</var>.</li> 1.17 + <li><p>If <var title="">oldRule</var> is an <code title="">@namespace</code> at-rule, and <var title="">list</var> contains anything other than 1.18 + <code title="">@charset</code> at-rules, <code title="">@import</code> at-rules, and <code title="">@namespace</code> at-rules, 1.19 + <a class="external" href="http://dom.spec.whatwg.org/#concept-throw" title="concept-throw">throw</a> an <code class="external"><a href="http://dom.spec.whatwg.org/#invalidstateerror">InvalidStateError</a></code> exception. 1.20 <li><p>Remove rule <var>oldRule</var> from <var>list</var> at the zero-indexed position <var>index</var>.<p></li> 1.21 </ol> 1.22 1.23 @@ -1976,15 +1982,35 @@ 1.24 <p>The <code><a href="#cssnamespacerule">CSSNamespaceRule</a></code> interface represents a <code>@namespace</code> rule.</p> 1.25 1.26 <pre class="idl">interface <dfn id="cssnamespacerule">CSSNamespaceRule</dfn> : <a href="#cssrule">CSSRule</a> { 1.27 - readonly attribute DOMString namespaceURI; 1.28 - readonly attribute DOMString? prefix;<!-- XXX not nullable? --> 1.29 + [TreatNullAs=EmptyString] attribute DOMString namespaceURI; 1.30 + [TreatNullAs=EmptyString] attribute DOMString prefix; 1.31 };</pre> 1.32 1.33 -<p>The <dfn id="dom-cssnamespacerule-namespaceuri" title="dom-CSSNamespaceRule-namespaceURI"><code>namespaceURI</code></dfn> attribute must return the namespace of the <code>@namespace</code> rule.</p> 1.34 +<p>The <dfn id="dom-cssnamespacerule-namespaceuri" title="dom-CSSNamespaceRule-namespaceURI"><code>namespaceURI</code></dfn> attribute, on getting, must return the namespace of the 1.35 +<code>@namespace</code> rule. On setting, the <code title="dom-CSSNamespaceRule-namespaceURI"><a href="#dom-cssnamespacerule-namespaceuri">namespaceURI</a></code> attribute must run the following steps:</p> 1.36 + 1.37 +<ol> 1.38 + <li><p>Let <var title="">style sheet</var> be the value returned by <code title="dom-CSSRule-parentStyleSheet"><a href="#dom-cssrule-parentstylesheet">parentStyleSheet</a></code>. 1.39 + <li><p>Let <var title="">list</var> be the value returned by <code title="dom-CSSStyleSheet-cssRules"><a href="#dom-cssstylesheet-cssrules">cssRules</a></code> of <var title="">style sheet</var>, or 1.40 + <code title="">null</code> if <var title="">style sheet</var> is <code title="">null</code>. 1.41 + <li><p>If <var title="">list</var> is not <code title="">null</code> and contains anything other than 1.42 + <code title="">@charset</code> at-rules, <code title="">@import</code> at-rules, and <code title="">@namespace</code> at-rules, 1.43 + <a class="external" href="http://dom.spec.whatwg.org/#concept-throw" title="concept-throw">throw</a> an <code class="external"><a href="http://dom.spec.whatwg.org/#invalidstateerror">InvalidStateError</a></code> exception. 1.44 + <li><p>Set the namespace of the <code title="">@namespace</code> at-rule to the given value. 1.45 +</ol> 1.46 1.47 <p>The <dfn id="dom-cssnamespacerule-prefix" title="dom-CSSNamespaceRule-prefix"><code>prefix</code></dfn> attribute must return the prefix of the <code>@namespace</code> rule or the 1.48 -empty string if there is no prefix.</p> 1.49 - 1.50 +empty string if there is no prefix. On setting, the <code title="dom-CSSNamespaceRule-prefix"><a href="#dom-cssnamespacerule-prefix">prefix</a></code> attribute must run the following steps:</p> 1.51 + 1.52 +<ol> 1.53 + <li><p>Let <var title="">style sheet</var> be the value returned by <code title="dom-CSSRule-parentStyleSheet"><a href="#dom-cssrule-parentstylesheet">parentStyleSheet</a></code>. 1.54 + <li><p>Let <var title="">list</var> be the value returned by <code title="dom-CSSStyleSheet-cssRules"><a href="#dom-cssstylesheet-cssrules">cssRules</a></code> of <var title="">style sheet</var>, or 1.55 + <code title="">null</code> if <var title="">style sheet</var> is <code title="">null</code>. 1.56 + <li><p>If <var title="">list</var> is not <code title="">null</code> and contains anything other than 1.57 + <code title="">@charset</code> at-rules, <code title="">@import</code> at-rules, and <code title="">@namespace</code> at-rules, 1.58 + <a class="external" href="http://dom.spec.whatwg.org/#concept-throw" title="concept-throw">throw</a> an <code class="external"><a href="http://dom.spec.whatwg.org/#invalidstateerror">InvalidStateError</a></code> exception. 1.59 + <li><p>Set the prefix of the <code title="">@namespace</code> at-rule to the given value. 1.60 +</ol> 1.61 1.62 1.63 <h3 id="css-declaration-blocks"><span class="secno">6.5 </span>CSS Declaration Blocks</h3>
2.1 --- a/cssom/Overview.src.html Thu May 30 14:32:24 2013 +0200 2.2 +++ b/cssom/Overview.src.html Thu May 30 16:39:35 2013 +0200 2.3 @@ -1667,6 +1667,9 @@ 2.4 by CSS, then <span data-anolis-spec='dom' title='concept-throw'>throw</span> 2.5 a <code data-anolis-spec='dom'>HierarchyRequestError</code> exception. <span data-anolis-ref>CSS</span></p> 2.6 <p class='note'>For example, a CSS style sheet cannot contain an <code title>@import</code> at-rule after a rule set.</p></li> 2.7 + <li><p>If <var title>newRule</var> is an <code title>@namespace</code> at-rule, and <var title>list</var> contains anything other than 2.8 + <code title>@charset</code> at-rules, <code title>@import</code> at-rules, and <code title>@namespace</code> at-rules, 2.9 + <span data-anolis-spec='dom' title='concept-throw'>throw</span> an <code data-anolis-spec=dom>InvalidStateError</code> exception. 2.10 <li><p>Insert <var>newRule</var> into <var>list</var> at the zero-indexed position <var>index</var>.<p></li> 2.11 <li><p>Return <var>index</var>.</p></li> 2.12 </ol> 2.13 @@ -1679,6 +1682,9 @@ 2.14 <li><p>If <var>index</var> is greater than or equal to <var>N</var>, then <span data-anolis-spec='dom' title='concept-throw'>throw</span> 2.15 an <code data-anolis-spec='dom'>IndexSizeError</code> exception.</p></li> 2.16 <li><p>Set <var>oldRule</var> to the <var>index</var>th item in <var>list</var>.</p></li> 2.17 + <li><p>If <var title>oldRule</var> is an <code title>@namespace</code> at-rule, and <var title>list</var> contains anything other than 2.18 + <code title>@charset</code> at-rules, <code title>@import</code> at-rules, and <code title>@namespace</code> at-rules, 2.19 + <span data-anolis-spec='dom' title='concept-throw'>throw</span> an <code data-anolis-spec=dom>InvalidStateError</code> exception. 2.20 <li><p>Remove rule <var>oldRule</var> from <var>list</var> at the zero-indexed position <var>index</var>.<p></li> 2.21 </ol> 2.22 2.23 @@ -1906,15 +1912,35 @@ 2.24 <p>The <code>CSSNamespaceRule</code> interface represents a <code>@namespace</code> rule.</p> 2.25 2.26 <pre class=idl>interface <dfn>CSSNamespaceRule</dfn> : <span>CSSRule</span> { 2.27 - readonly attribute DOMString namespaceURI; 2.28 - readonly attribute DOMString? prefix;<!-- XXX not nullable? --> 2.29 + [TreatNullAs=EmptyString] attribute DOMString namespaceURI; 2.30 + [TreatNullAs=EmptyString] attribute DOMString prefix; 2.31 };</pre> 2.32 2.33 -<p>The <dfn title=dom-CSSNamespaceRule-namespaceURI><code>namespaceURI</code></dfn> attribute must return the namespace of the <code>@namespace</code> rule.</p> 2.34 +<p>The <dfn title=dom-CSSNamespaceRule-namespaceURI><code>namespaceURI</code></dfn> attribute, on getting, must return the namespace of the 2.35 +<code>@namespace</code> rule. On setting, the <code title=dom-CSSNamespaceRule-namespaceURI>namespaceURI</code> attribute must run the following steps:</p> 2.36 + 2.37 +<ol> 2.38 + <li><p>Let <var title>style sheet</var> be the value returned by <code title=dom-CSSRule-parentStyleSheet>parentStyleSheet</code>. 2.39 + <li><p>Let <var title>list</var> be the value returned by <code title=dom-CSSStyleSheet-cssRules>cssRules</code> of <var title>style sheet</var>, or 2.40 + <code title>null</code> if <var title>style sheet</var> is <code title>null</code>. 2.41 + <li><p>If <var title>list</var> is not <code title>null</code> and contains anything other than 2.42 + <code title>@charset</code> at-rules, <code title>@import</code> at-rules, and <code title>@namespace</code> at-rules, 2.43 + <span data-anolis-spec='dom' title='concept-throw'>throw</span> an <code data-anolis-spec=dom>InvalidStateError</code> exception. 2.44 + <li><p>Set the namespace of the <code title>@namespace</code> at-rule to the given value. 2.45 +</ol> 2.46 2.47 <p>The <dfn title=dom-CSSNamespaceRule-prefix><code>prefix</code></dfn> attribute must return the prefix of the <code>@namespace</code> rule or the 2.48 -empty string if there is no prefix.</p> 2.49 - 2.50 +empty string if there is no prefix. On setting, the <code title=dom-CSSNamespaceRule-prefix>prefix</code> attribute must run the following steps:</p> 2.51 + 2.52 +<ol> 2.53 + <li><p>Let <var title>style sheet</var> be the value returned by <code title=dom-CSSRule-parentStyleSheet>parentStyleSheet</code>. 2.54 + <li><p>Let <var title>list</var> be the value returned by <code title=dom-CSSStyleSheet-cssRules>cssRules</code> of <var title>style sheet</var>, or 2.55 + <code title>null</code> if <var title>style sheet</var> is <code title>null</code>. 2.56 + <li><p>If <var title>list</var> is not <code title>null</code> and contains anything other than 2.57 + <code title>@charset</code> at-rules, <code title>@import</code> at-rules, and <code title>@namespace</code> at-rules, 2.58 + <span data-anolis-spec='dom' title='concept-throw'>throw</span> an <code data-anolis-spec=dom>InvalidStateError</code> exception. 2.59 + <li><p>Set the prefix of the <code title>@namespace</code> at-rule to the given value. 2.60 +</ol> 2.61 2.62 2.63 <h3>CSS Declaration Blocks</h3>