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
unsigned long insertRule(CSSOMString rule, optional unsigned long index = 0);
931
-
undefined deleteRule(unsigned long index);
932
-
};
933
-
</pre>
934
-
935
-
The <dfn attribute for=CSSNestingRule>selectorText</dfn> attribute,
936
-
on getting,
937
-
must return the result of [=serialize a group of selectors|serializing=]
938
-
the associated [=selector list=].
939
-
On setting the {{CSSStyleRule/selectorText}} attribute these steps must be run:
940
-
941
-
1. Run the <a>parse a group of selectors</a> algorithm on the given value.
942
-
2. If the algorithm returns a non-null value replace the associated [=selector list=] with the returned value.
943
-
3. Otherwise, if the algorithm returns a null value, do nothing.
944
-
945
-
The <dfn attribute for=CSSNestingRule>style</dfn> attribute
946
-
must return a {{CSSStyleDeclaration}} object for the style rule,
947
-
with the following properties:
948
-
949
-
<dl>
950
-
: [=CSSStyleDeclaration/computed flag=]
951
-
:: Unset.
952
-
: [=CSSStyleDeclaration/declarations=]
953
-
:: The declared declarations in the rule, in <a>specified order</a>.
954
-
: [=CSSStyleDeclaration/parent CSS rule=]
955
-
:: The [=this=] object.
956
-
: [=CSSStyleDeclaration/owner node=]
957
-
:: Null.
958
-
</dl>
959
-
960
-
The <dfn attribute for=CSSNestingRule>cssRules</dfn> attribute
961
-
must return a {{CSSRuleList}} object for the [=CSSRule/child CSS rules=].
962
-
963
-
The <dfn method for=CSSNestingRule>insertRule(<var>rule</var>, <var>index</var>)</dfn> method
964
-
must return the result of
965
-
invoking [=insert a CSS rule=]<var>rule</var>
966
-
into the [=CSSRule/child CSS rules=] at <var>index</var>.
967
-
968
-
The <dfn method for=CSSNestingRule>deleteRule(<var>index</var>)</dfn> method
969
-
must [=remove a CSS rule=] from the [=CSSRule/child CSS rules=] at <var>index</var>.
970
-
971
-
To serialize a {{CSSNestingRule}}:
972
-
return the result of the following steps:
973
-
974
-
<ol>
975
-
<li>Let |s| initially be the string "<code>@nest</code>" followed by a single SPACE (U+0020).
976
-
<li>Append to |s| the result of performing <a>serialize a group of selectors</a> on the rule's associated selectors,
977
-
followed by the string "<code> {</code>", i.e., a single SPACE (U+0020), followed by LEFT CURLY BRACKET (U+007B).
978
-
<li>Let |decls| be the result of performing <a>serialize a CSS declaration block</a> on the rule's associated declarations, or null if there are no such declarations.
979
-
<li>Let |rules| be the result of performing [=serialize a CSS rule=] on each rule in the rule's {{CSSStyleRule/cssRules}} list, or null if there are no such rules.
980
-
<li>If |decls| and |rules| are both null, append " }" to |s| (i.e. a single SPACE (U+0020) followed by RIGHT CURLY BRACKET (U+007D)) and return |s|.
981
-
<li>If |rules| is null:
982
-
<ol>
983
-
<li>Append a single SPACE (U+0020) to |s|
984
-
<li>Append |decls| to |s|
985
-
<li>Append " }" to |s| (i.e. a single SPACE (U+0020) followed by RIGHT CURLY BRACKET (U+007D)).
986
-
<li>Return |s|.
987
-
</ol>
988
-
<li>Otherwise:
989
-
<ol>
990
-
<li>If |decls| is not null, prepend it to |rules|.
991
-
<li>For each |rule| in |rules|:
992
-
<ol>
993
-
<li>Append a newline followed by two spaces to |s|.
994
-
<li>Append |rule| to |s|.
995
-
</ol>
996
-
<li>Append a newline followed by RIGHT CURLY BRACKET (U+007D) to |s|.
0 commit comments