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
Copy file name to clipboardExpand all lines: css-nesting-1/Overview.bs
+30-1Lines changed: 30 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -747,4 +747,33 @@ invoking [=insert a CSS rule=] <var>rule</var>
747
747
into the [=CSSRule/child CSS rules=] at <var>index</var>.
748
748
749
749
The <dfn method for=CSSNestingRule>deleteRule(<var>index</var>)</dfn> method
750
-
must [=remove a CSS rule=] from the [=CSSRule/child CSS rules=] at <var>index</var>.
750
+
must [=remove a CSS rule=] from the [=CSSRule/child CSS rules=] at <var>index</var>.
751
+
752
+
To serialize a {{CSSNestingRule}}:
753
+
return the result of the following steps:
754
+
755
+
<ol>
756
+
<li>Let |s| initially be the string "<code>@nest</code>" followed by a single SPACE (U+0020).
757
+
<li>Append to |s| the result of performing <a>serialize a group of selectors</a> on the rule's associated selectors,
758
+
followed by the string "<code> {</code>", i.e., a single SPACE (U+0020), followed by LEFT CURLY BRACKET (U+007B).
759
+
<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.
760
+
<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.
761
+
<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|.
762
+
<li>If |rules| is null:
763
+
<ol>
764
+
<li>Append a single SPACE (U+0020) to |s|
765
+
<li>Append |decls| to |s|
766
+
<li>Append " }" to |s| (i.e. a single SPACE (U+0020) followed by RIGHT CURLY BRACKET (U+007D)).
767
+
<li>Return |s|.
768
+
</ol>
769
+
<li>Otherwise:
770
+
<ol>
771
+
<li>If |decls| is not null, prepend it to |rules|.
772
+
<li>For each |rule| in |rules|:
773
+
<ol>
774
+
<li>Append a newline followed by two spaces to |s|.
775
+
<li>Append |rule| to |s|.
776
+
</ol>
777
+
<li>Append a newline followed by RIGHT CURLY BRACKET (U+007D) to |s|.
0 commit comments