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);
917
+
void removeRule(optional unsigned long index = 0);
914
918
};
915
919
</pre>
916
920
@@ -949,6 +953,25 @@ The <dfn method for=CSSStyleSheet>deleteRule(<var>index</var>)</dfn> method must
949
953
<li><a>Remove a CSS rule</a> in the <a for=CSSStyleSheet>CSS rules</a> at <var>index</var>.
950
954
</ol>
951
955
956
+
Legacy CSSStyleSheet members
957
+
----------------------------
958
+
959
+
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.
960
+
961
+
The <dfn attribute for=CSSStyleSheet>removeRule(<var>index</var>)</dfn> method must run the same steps as {{CSSStyleSheet/deleteRule()}}.
962
+
963
+
The <dfn method for=CSSStyleSheet>addRule(<var>selector</var>, <var>block</var>, <var>optionalIndex</var>)</dfn> method must run the following steps:
964
+
965
+
<ol>
966
+
<li>Let <var>rule</var> be an empty string.
967
+
<li>Append <var>selector</var> to <var>rule</var>.
968
+
<li>Append <code>" { "</code> to <var>rule</var>.
969
+
<li>If <var>block</var> is not empty, append <var>block</var>, followed by an space, to <var>rule</var>.
970
+
<li>Append <code>"}"</code> to <var>rule</var>
971
+
<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.
972
+
<li>Call {{CSSStyleSheet/insertRule()}}, with <var>rule</var> and <var>index</var> as arguments.
0 commit comments