Skip to content

Commit 6b2c546

Browse files
committed
[cssom] Define the serialization of CSSKeyframesRule and CSSKeyframesRule
Part of w3c#4828.
1 parent 42d0b59 commit 6b2c546

File tree

1 file changed

+25
-1
lines changed

1 file changed

+25
-1
lines changed

cssom-1/Overview.bs

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1561,7 +1561,7 @@ To <dfn export>serialize a CSS rule</dfn>, perform one of the following in accor
15611561
<li>The string "<code>@media</code>", followed by a single SPACE (U+0020).</li>
15621562
<li>The result of performing <a>serialize a media query list</a> on rule's media query list.</li>
15631563
<li>A single SPACE (U+0020), followed by the string "{", i.e., LEFT CURLY BRACKET (U+007B), followed by a newline.</li>
1564-
<li>The result of performing <a>serialize a CSS rule</a> on each rule, separated by a newline and indented by two spaces, in rule's CSSRules list.</li>
1564+
<li>The result of performing <a>serialize a CSS rule</a> on each rule in the rule's {{CSSGroupingRule/cssRules}} list, separated by a newline and indented by two spaces.</li>
15651565
<li>A newline, followed by the string "}", i.e., RIGHT CURLY BRACKET (U+007D)</li>
15661566
</ol>
15671567

@@ -1636,8 +1636,32 @@ To <dfn export>serialize a CSS rule</dfn>, perform one of the following in accor
16361636
<a lt="serialize a URL">serialization as URL</a> of the
16371637
{{CSSNamespaceRule/namespaceURI}}
16381638
attribute, followed the character "<code>;</code>" (U+003B).
1639+
1640+
<dt>{{CSSKeyframesRule}}
1641+
<dd>
1642+
The result of concatenating the following:
1643+
<ol>
1644+
<li>The literal string "<code>@keyframes</code>", followed by a single SPACE (U+0020).
1645+
<li>The <a lt="serialize an identifier">serialization as an identifier</a> of the
1646+
{{CSSKeyframesRule/name}} attribute.
1647+
<li>The result of performing <a>serialize a CSS rule</a> on each rule in the rule's {{CSSKeyframesRule/cssRules}} list, separated by a newline and indented by two spaces.</li>
1648+
<li>A newline, followed by the string "}", i.e., RIGHT CURLY BRACKET (U+007D)</li>
1649+
</ol>
1650+
1651+
<dt>{{CSSKeyframeRule}}
1652+
<dd>
1653+
The result of concatenating the following:
1654+
<ol>
1655+
<li>The {{CSSKeyframeRule/keyText}}.
1656+
<li>The string "<code> { </code>", i.e., a single SPACE (U+0020), followed by LEFT CURLY BRACKET (U+007B),
1657+
<li>The result of performing <a>serialize a CSS declaration block</a> on the rule's associated declarations.
1658+
<li>If the rule is associated with one or more declarations, the string "<code> </code>", i.e., a single SPACE (U+0020).
1659+
<li>The string "<code>}</code>", RIGHT CURLY BRACKET (U+007D).
1660+
</ol>
16391661
</dl>
16401662

1663+
Issue: The "indented by two spaces" bit matches browsers, but needs work, see <a href="https://github.com/w3c/csswg-drafts/issues/5494">#5494</a>
1664+
16411665
To <dfn export>insert a CSS rule</dfn> <var>rule</var> in a CSS rule list <var>list</var> at index <var>index</var>, follow these steps:
16421666
<ol>
16431667
<li>Set <var>length</var> to the number of items in <var>list</var>.

0 commit comments

Comments
 (0)