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: cssom-1/Overview.bs
+25-8Lines changed: 25 additions & 8 deletions
Original file line number
Diff line number
Diff line change
@@ -1523,17 +1523,34 @@ To <dfn export>serialize a CSS rule</dfn>, perform one of the following in accor
1523
1523
<dl class="switch">
1524
1524
<dt>{{CSSStyleRule}}
1525
1525
<dd>
1526
-
The result of concatenating the following:
1526
+
Return the result of the following steps:
1527
+
1527
1528
<ol>
1528
-
<li>The result of performing <a>serialize a group of selectors</a> on the rule's associated selectors.
1529
-
<li>The string "<code> { </code>", i.e., a single SPACE (U+0020), followed by LEFT CURLY BRACKET (U+007B),
1530
-
followed by a single SPACE (U+0020).
1531
-
<li>The result of performing <a>serialize a CSS declaration block</a> on the rule's associated declarations.
1532
-
<li>If the rule is associated with one or more declarations, the string "<code></code>", i.e., a single SPACE (U+0020).
1533
-
<li>The string "<code>}</code>", RIGHT CURLY BRACKET (U+007D).
1529
+
<li>Let |s| initially be
1530
+
the result of performing <a>serialize a group of selectors</a> on the rule's associated selectors,
1531
+
followed by the string "<code> {</code>", i.e., a single SPACE (U+0020), followed by LEFT CURLY BRACKET (U+007B).
1532
+
<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.
1533
+
<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.
1534
+
<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|.
1535
+
<li>If |rules| is null:
1536
+
<ol>
1537
+
<li>Append a single SPACE (U+0020) to |s|
1538
+
<li>Append |decls| to |s|
1539
+
<li>Append " }" to |s| (i.e. a single SPACE (U+0020) followed by RIGHT CURLY BRACKET (U+007D)).
1540
+
<li>Return |s|.
1541
+
</ol>
1542
+
<li>Otherwise:
1543
+
<ol>
1544
+
<li>If |decls| is not null, prepend it to |rules|.
1545
+
<li>For each |rule| in |rules|:
1546
+
<ol>
1547
+
<li>Append a newline followed by two spaces to |s|.
1548
+
<li>Append |rule| to |s|.
1549
+
</ol>
1550
+
<li>Append a newline followed by RIGHT CURLY BRACKET (U+007D) to |s|.
0 commit comments