Skip to content

Commit

Permalink
Add indexed getter and length property to CSSKeyframesRule
Browse files Browse the repository at this point in the history
Implements spec change w3c/csswg-drafts@354c40d

Differential Revision: https://phabricator.services.mozilla.com/D162526

bugzilla-url: https://bugzilla.mozilla.org/show_bug.cgi?id=1789776
gecko-commit: dc87d30b82c79a1e07fb762d699a1adf4a8113bd
gecko-reviewers: emilio
  • Loading branch information
birtles authored and moz-wptsync-bot committed Nov 21, 2022
1 parent 35c08ba commit a133038
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion css/cssom/CSSKeyframesRule.html
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@
100% { top: 200px; }
}
@keyframes empty {}
@keyframes indexed-access {
0% { top: 0px; }
100% { top: 200px; }
}
</style>

<script>
Expand Down Expand Up @@ -68,7 +72,14 @@
empty.name = "none";
assert_equals(empty.name, "none", "CSSKeyframesRule name setter, 'none'");
assert_equals(empty.cssText.replace(/\s/g, ""), "@keyframes\"none\"{}", "CSSKeyframesRule cssText attribute with 'none' name");
});
}, 'name, cssRules, appendRule, findRule, deleteRule');

test(function () {
const keyframes = document.styleSheets[0].cssRules[2];
assert_equals(keyframes[0].cssText, "0% { top: 0px; }", "CSSKeyframesRule indexed getter [0]");
assert_equals(keyframes[1].cssText, "100% { top: 200px; }", "CSSKeyframesRule indexed getter [1]");
assert_equals(keyframes.length, 2, "CSSKeyframesRule.length");
}, 'indexed getter, length');
</script>
</head>
</html>

0 comments on commit a133038

Please sign in to comment.