You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
client-authored script), it can nevertheless change over time due to its liveness status. For example, invoking
991
991
the <codetitle="dom-CSSStyleSheet-insertRule"><ahref="#dom-cssstylesheet-insertrule">insertRule()</a></code> or <codetitle="dom-CSSStyleSheet-deleteRule"><ahref="#dom-cssstylesheet-deleterule">deleteRule()</a></code> methods can result in mutations reflected in the returned object.</p>
992
992
993
-
<p>The <dfnid="dom-cssstylesheet-insertrule" title="dom-CSSStyleSheet-insertRule"><code>insertRule(<var>rule</var>, <var>index</var>)</code></dfn> method performs <dfnid="insert-a-css-rule">insert a CSS rule</dfn><var>rule</var> as follows:</p>
994
-
<ol>
995
-
<li><p>Set <var>newRule</var> to the results of performing <ahref="#parse-a-css-rule">parse a CSS rule</a>
996
-
on argument <var>rule</var>, <aclass="external" href="http://dom.spec.whatwg.org/#concept-throw" title="concept-throw">throwing</a>
997
-
a <codeclass="external"><ahref="http://dom.spec.whatwg.org/#syntaxerror">SyntaxError</a></code> exception if a parse error occurs.</li>
998
-
<li><p>If <vartitle="">newRule</var> is an <codetitle="">@charset</code> at-rule, <aclass="external" href="http://dom.spec.whatwg.org/#concept-throw" title="concept-throw">throw</a> a
<li><p>Set <var>N</var> to <code>cssLength.length</code>.</li>
1001
-
<li><p>If argument <var>index</var> is greater than <var>N</var>, then <aclass="external" href="http://dom.spec.whatwg.org/#concept-throw" title="concept-throw">throw</a>
1002
-
an <codeclass="external"><ahref="http://dom.spec.whatwg.org/#indexsizeerror">IndexSizeError</a></code> exception.</li>
1003
-
<li><p>If the rule <var>newRule</var> cannot be inserted into the specified <var>index</var> due to constraints specified
1004
-
by <ahref="#refsCSS">[CSS]</a>, then <aclass="external" href="http://dom.spec.whatwg.org/#concept-throw" title="concept-throw">throw</a>
1005
-
a <codeclass="external"><ahref="http://dom.spec.whatwg.org/#hierarchyrequesterror">HierarchyRequestError</a></code> exception.</p>
1006
-
<pclass="note">For example, a CSS style sheet cannot contain an <codetitle="">@import</code> at-rule after a rule set.</li>
1007
-
<li><p>Set <var>newRule</var><code>.parentStyleSheet</code> to <code>this</code> (i.e., this <code><ahref="#cssstylesheet">CSSStyleSheet</a></code> instance object).</li>
1008
-
<li><p>Insert rule <var>newRule</var> into <code>cssRules</code> at the zero-indexed position <var>index</var>.<p></li>
1009
-
<li><p>Return <var>index</var>.</li>
1010
-
</ol>
1011
-
<pclass="note">If a new rule is inserted, then any rule previously located at position <var>index</var> through
1012
-
<var>N</var> minus 1 is shifted to position <var>index</var> plus 1 through <var>N</var>,
1013
-
In addition, <code>cssRules.length</code> is (internally) incremented.</p>
1014
-
<pclass="XXX">DOM-2 CSS specifies that a <code>NO_MODIFICATION_ALLOWED_ERR</code> exception is thrown
1015
-
if the style sheet is read-only. Are there any read-only style sheets?</p>
993
+
<p>The <dfnid="dom-cssstylesheet-insertrule" title="dom-CSSStyleSheet-insertRule"><code>insertRule(<var>rule</var>, <var>index</var>)</code></dfn> method must <ahref="#insert-a-css-rule">insert a CSS rule</a>
994
+
<var>rule</var> in the CSS rule list returned by <codetitle="dom-CSSStyleSheet-cssRules"><ahref="#dom-cssstylesheet-cssrules">cssRules</a></code> at <var>index</var>.
1016
995
1017
-
<p>The <dfnid="dom-cssstylesheet-deleterule" title="dom-CSSStyleSheet-deleteRule"><code>deleteRule(<var>index</var>)</code></dfn> method performs <dfnid="remove-a-css-rule">remove a CSS rule</dfn> as follows:</p>
1018
-
<ol>
1019
-
<li><p>Set <var>N</var> to <code>cssLength.length</code>.</li>
1020
-
<li><p>If argument <var>index</var> is greater than or equal to <var>N</var>, then <aclass="external" href="http://dom.spec.whatwg.org/#concept-throw" title="concept-throw">throw</a>
1021
-
an <codeclass="external"><ahref="http://dom.spec.whatwg.org/#indexsizeerror">IndexSizeError</a></code> exception.</li>
1022
-
<li><p>Set <var>oldRule</var> to <code>cssRules.prototype.item(<var>index</var>)</code>.</li>
1023
-
<li><p>Set <var>oldRule</var><code>.parentStyleSheet</code> to <code>null</code>.</li>
1024
-
<li><p>Remove rule <var>oldRule</var> from <code>cssRules</code> at the zero-indexed position <var>index</var>.<p></li>
1025
-
</ol>
1026
-
<pclass="note">If an existing rule is deleted, then any rule previously located at position <var>index</var> plus 1 through
1027
-
<var>N</var> minus 1 is shifted to position <var>index</var> through <var>N</var> minus 2,
1028
-
In addition, <code>cssRules.length</code> is (internally) decremented.</p>
996
+
<p>The <dfnid="dom-cssstylesheet-deleterule" title="dom-CSSStyleSheet-deleteRule"><code>deleteRule(<var>index</var>)</code></dfn> method must <ahref="#remove-a-css-rule">remove a CSS rule</a> in the CSS rule list
997
+
returned by <codetitle="dom-CSSStyleSheet-cssRules"><ahref="#dom-cssstylesheet-cssrules">cssRules</a></code> at <var>index</var>.
attribute, followed the character "<code>;</code>" (U+003B).</dd>
1755
1724
</dl>
1756
1725
1726
+
<p>To <dfnid="insert-a-css-rule">insert a CSS rule</dfn><var>rule</var> in a CSS rule list <var>list</var> at index <var>index</var>, follow these steps:</p>
1727
+
<ol>
1728
+
<li><p>Set <var>newRule</var> to the results of performing <ahref="#parse-a-css-rule">parse a CSS rule</a>
1729
+
on argument <var>rule</var>, <aclass="external" href="http://dom.spec.whatwg.org/#concept-throw" title="concept-throw">throwing</a>
1730
+
a <codeclass="external"><ahref="http://dom.spec.whatwg.org/#syntaxerror">SyntaxError</a></code> exception if a parse error occurs.</li>
1731
+
<li><p>If <vartitle="">newRule</var> is an <codetitle="">@charset</code> at-rule, <aclass="external" href="http://dom.spec.whatwg.org/#concept-throw" title="concept-throw">throw</a> a
<li><p>Set <var>N</var> to the number of items in <var>list</var>.</li>
1734
+
<li><p>If <var>index</var> is greater than <var>N</var>, then <aclass="external" href="http://dom.spec.whatwg.org/#concept-throw" title="concept-throw">throw</a>
1735
+
an <codeclass="external"><ahref="http://dom.spec.whatwg.org/#indexsizeerror">IndexSizeError</a></code> exception.</li>
1736
+
<li><p>If <var>newRule</var> cannot be inserted into <var>list</var> at the zero-index position <var>index</var> due to constraints specified
1737
+
by CSS, then <aclass="external" href="http://dom.spec.whatwg.org/#concept-throw" title="concept-throw">throw</a>
1738
+
a <codeclass="external"><ahref="http://dom.spec.whatwg.org/#hierarchyrequesterror">HierarchyRequestError</a></code> exception. <ahref="#refsCSS">[CSS]</a></p>
1739
+
<pclass="note">For example, a CSS style sheet cannot contain an <codetitle="">@import</code> at-rule after a rule set.</li>
1740
+
<li><p>Insert <var>newRule</var> into <var>list</var> at the zero-indexed position <var>index</var>.<p></li>
1741
+
<li><p>Return <var>index</var>.</li>
1742
+
</ol>
1743
+
<pclass="XXX">DOM-2 CSS specifies that a <code>NO_MODIFICATION_ALLOWED_ERR</code> exception is thrown
1744
+
if the style sheet is read-only. Are there any read-only style sheets?</p>
1745
+
1746
+
<p>To <dfnid="remove-a-css-rule">remove a CSS rule</dfn> from a CSS rule list <var>list</var> at index <var>index</var>, follow these steps:</p>
1747
+
<ol>
1748
+
<li><p>Set <var>N</var> to the number of items in <var>list</var>.</li>
1749
+
<li><p>If <var>index</var> is greater than or equal to <var>N</var>, then <aclass="external" href="http://dom.spec.whatwg.org/#concept-throw" title="concept-throw">throw</a>
1750
+
an <codeclass="external"><ahref="http://dom.spec.whatwg.org/#indexsizeerror">IndexSizeError</a></code> exception.</li>
1751
+
<li><p>Set <var>oldRule</var> to the <var>index</var>th item in <var>list</var>.</li>
1752
+
<li><p>Remove rule <var>oldRule</var> from <var>list</var> at the zero-indexed position <var>index</var>.<p></li>
<p>The <dfnid="dom-cssrule-parentstylesheet" title="dom-CSSRule-parentStyleSheet"><code>parentStyleSheet</code></dfn> attribute must return the <code><ahref="#cssstylesheet">CSSStyleSheet</a></code> object that contains the the
1848
1846
current rule or <code>null</code> if there is none.</p>
1849
-
<pclass="note">The only circumstance where <code>null</code> is returned is in the case that
1850
-
<code>CSSStyleSheet.prototype.deleteRule</code> has been invoked to <ahref="#remove-a-css-rule">remove a CSS rule</a>
1851
-
from a CSS style sheet, in which case its <code>parentStyleSheet</code> property will have been set to <code>null</code>.</p>
1852
-
<pclass="note">Removing an <code>Node</code> that implements the <code><ahref="#linkstyle">LinkStyle</a></code> interface from a <code>Document</code> instance
1853
-
does not (by itself) cause the <code><ahref="#cssstylesheet">CSSStyleSheet</a></code> referenced by a <code><ahref="#cssrule">CSSRule</a></code> to be unreachable; that is, as long as
1854
-
there exists a reachable reference to a <code><ahref="#cssrule">CSSRule</a></code> object, then its <code>parentStyleSheet</code> property remains viable
1855
-
if it has not been previously removed from the style sheet by using the <code>deleteRule</code> operation.</p>
1847
+
<pclass="note">The only circumstance where <code>null</code> is returned when a rule has been <ahref="#remove-a-css-rule" title="remove a CSS rule">removed</a>.</p>
1848
+
<pclass="note">Removing a <code>Node</code> that implements the <code><ahref="#linkstyle">LinkStyle</a></code> interface from a <code>Document</code> instance
1849
+
does not (by itself) cause the <code><ahref="#cssstylesheet">CSSStyleSheet</a></code> referenced by a <code><ahref="#cssrule">CSSRule</a></code> to be unreachable.</p>
client-authored script), it can nevertheless change over time due to its liveness status. For example, invoking
921
921
the <codetitle=dom-CSSStyleSheet-insertRule>insertRule()</code> or <codetitle=dom-CSSStyleSheet-deleteRule>deleteRule()</code> methods can result in mutations reflected in the returned object.</p>
922
922
923
-
<p>The <dfntitle=dom-CSSStyleSheet-insertRule><code>insertRule(<var>rule</var>, <var>index</var>)</code></dfn> method performs <dfn>insert a CSS rule</dfn><var>rule</var> as follows:</p>
924
-
<ol>
925
-
<li><p>Set <var>newRule</var> to the results of performing <span>parse a CSS rule</span>
926
-
on argument <var>rule</var>, <spandata-anolis-spec='dom' title='concept-throw'>throwing</span>
927
-
a <codedata-anolis-spec='dom'>SyntaxError</code> exception if a parse error occurs.</p></li>
928
-
<li><p>If <vartitle>newRule</var> is an <codetitle>@charset</code> at-rule, <spandata-anolis-spec='dom' title='concept-throw'>throw</span> a
<li><p>Set <var>N</var> to <code>cssLength.length</code>.</p></li>
931
-
<li><p>If argument <var>index</var> is greater than <var>N</var>, then <spandata-anolis-spec='dom' title='concept-throw'>throw</span>
932
-
an <codedata-anolis-spec='dom'>IndexSizeError</code> exception.</p></li>
933
-
<li><p>If the rule <var>newRule</var> cannot be inserted into the specified <var>index</var> due to constraints specified
934
-
by <spandata-anolis-ref>CSS</span>, then <spandata-anolis-spec='dom' title='concept-throw'>throw</span>
935
-
a <codedata-anolis-spec='dom'>HierarchyRequestError</code> exception.</p>
936
-
<pclass='note'>For example, a CSS style sheet cannot contain an <codetitle>@import</code> at-rule after a rule set.</p></li>
937
-
<li><p>Set <var>newRule</var><code>.parentStyleSheet</code> to <code>this</code> (i.e., this <code>CSSStyleSheet</code> instance object).</p></li>
938
-
<li><p>Insert rule <var>newRule</var> into <code>cssRules</code> at the zero-indexed position <var>index</var>.<p></li>
939
-
<li><p>Return <var>index</var>.</p></li>
940
-
</ol>
941
-
<pclass='note'>If a new rule is inserted, then any rule previously located at position <var>index</var> through
942
-
<var>N</var> minus 1 is shifted to position <var>index</var> plus 1 through <var>N</var>,
943
-
In addition, <code>cssRules.length</code> is (internally) incremented.</p>
944
-
<pclass='XXX'>DOM-2 CSS specifies that a <code>NO_MODIFICATION_ALLOWED_ERR</code> exception is thrown
945
-
if the style sheet is read-only. Are there any read-only style sheets?</p>
923
+
<p>The <dfntitle=dom-CSSStyleSheet-insertRule><code>insertRule(<var>rule</var>, <var>index</var>)</code></dfn> method must <span>insert a CSS rule</span>
924
+
<var>rule</var> in the CSS rule list returned by <codetitle=dom-CSSStyleSheet-cssRules>cssRules</code> at <var>index</var>.
946
925
947
-
<p>The <dfntitle=dom-CSSStyleSheet-deleteRule><code>deleteRule(<var>index</var>)</code></dfn> method performs <dfn>remove a CSS rule</dfn> as follows:</p>
948
-
<ol>
949
-
<li><p>Set <var>N</var> to <code>cssLength.length</code>.</p></li>
950
-
<li><p>If argument <var>index</var> is greater than or equal to <var>N</var>, then <spandata-anolis-spec='dom' title='concept-throw'>throw</span>
951
-
an <codedata-anolis-spec='dom'>IndexSizeError</code> exception.</p></li>
952
-
<li><p>Set <var>oldRule</var> to <code>cssRules.prototype.item(<var>index</var>)</code>.</p></li>
953
-
<li><p>Set <var>oldRule</var><code>.parentStyleSheet</code> to <code>null</code>.</p></li>
954
-
<li><p>Remove rule <var>oldRule</var> from <code>cssRules</code> at the zero-indexed position <var>index</var>.<p></li>
955
-
</ol>
956
-
<pclass='note'>If an existing rule is deleted, then any rule previously located at position <var>index</var> plus 1 through
957
-
<var>N</var> minus 1 is shifted to position <var>index</var> through <var>N</var> minus 2,
958
-
In addition, <code>cssRules.length</code> is (internally) decremented.</p>
926
+
<p>The <dfntitle=dom-CSSStyleSheet-deleteRule><code>deleteRule(<var>index</var>)</code></dfn> method must <span>remove a CSS rule</span> in the CSS rule list
927
+
returned by <codetitle=dom-CSSStyleSheet-cssRules>cssRules</code> at <var>index</var>.
959
928
960
929
<h3>Style Sheet Collections</h3>
961
930
@@ -1684,6 +1653,35 @@ <h3>CSS Rules</h3>
1684
1653
attribute, followed the character "<code>;</code>" (U+003B).</p></dd>
1685
1654
</dl>
1686
1655
1656
+
<p>To <dfn>insert a CSS rule</dfn><var>rule</var> in a CSS rule list <var>list</var> at index <var>index</var>, follow these steps:</p>
1657
+
<ol>
1658
+
<li><p>Set <var>newRule</var> to the results of performing <span>parse a CSS rule</span>
1659
+
on argument <var>rule</var>, <spandata-anolis-spec='dom' title='concept-throw'>throwing</span>
1660
+
a <codedata-anolis-spec='dom'>SyntaxError</code> exception if a parse error occurs.</p></li>
1661
+
<li><p>If <vartitle>newRule</var> is an <codetitle>@charset</code> at-rule, <spandata-anolis-spec='dom' title='concept-throw'>throw</span> a
<p>The <dfntitle=dom-CSSRule-parentStyleSheet><code>parentStyleSheet</code></dfn> attribute must return the <code>CSSStyleSheet</code> object that contains the the
1778
1776
current rule or <code>null</code> if there is none.</p>
1779
-
<pclass='note'>The only circumstance where <code>null</code> is returned is in the case that
1780
-
<code>CSSStyleSheet.prototype.deleteRule</code> has been invoked to <span>remove a CSS rule</span>
1781
-
from a CSS style sheet, in which case its <code>parentStyleSheet</code> property will have been set to <code>null</code>.</p>
1782
-
<pclass='note'>Removing an <code>Node</code> that implements the <code>LinkStyle</code> interface from a <code>Document</code> instance
1783
-
does not (by itself) cause the <code>CSSStyleSheet</code> referenced by a <code>CSSRule</code> to be unreachable; that is, as long as
1784
-
there exists a reachable reference to a <code>CSSRule</code> object, then its <code>parentStyleSheet</code> property remains viable
1785
-
if it has not been previously removed from the style sheet by using the <code>deleteRule</code> operation.</p>
1777
+
<pclass='note'>The only circumstance where <code>null</code> is returned when a rule has been <spantitle="remove a CSS rule">removed</span>.</p>
1778
+
<pclass='note'>Removing a <code>Node</code> that implements the <code>LinkStyle</code> interface from a <code>Document</code> instance
1779
+
does not (by itself) cause the <code>CSSStyleSheet</code> referenced by a <code>CSSRule</code> to be unreachable.</p>
0 commit comments