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
long addRule(optional DOMString selector = "undefined", optional DOMString style = "undefined", optional unsigned long index);
964
+
void removeRule(optional unsigned long index = 0);
965
+
};
966
+
</pre>
967
+
968
+
The <dfn attribute for=CSSStyleSheet>rules</dfn> attribute must follow the same steps as {{CSSStyleSheet/cssRules}}, and return the same object {{CSSStyleSheet/cssRules}} would return.
969
+
970
+
The <dfn method for=CSSStyleSheet>removeRule(<var>index</var>)</dfn> method must run the same steps as {{CSSStyleSheet/deleteRule()}}.
971
+
972
+
The <dfn method for=CSSStyleSheet>addRule(<var>selector</var>, <var>block</var>, <var>optionalIndex</var>)</dfn> method must run the following steps:
973
+
974
+
<ol>
975
+
<li>Let <var>rule</var> be an empty string.
976
+
<li>Append <var>selector</var> to <var>rule</var>.
977
+
<li>Append <code>" { "</code> to <var>rule</var>.
978
+
<li>If <var>block</var> is not empty, append <var>block</var>, followed by a space, to <var>rule</var>.
979
+
<li>Append <code>"}"</code> to <var>rule</var>
980
+
<li>Let <var>index</var> be <var>optionalIndex</var> if provided, or the number of <a for=CSSStyleSheet>CSS rules</a> in the stylesheet otherwise.
981
+
<li>Call {{CSSStyleSheet/insertRule()}}, with <var>rule</var> and <var>index</var> as arguments.
0 commit comments