Files
sousa-gecko/testing/web-platform/tests/css/cssom/CSSRuleList-appendRule-keyframe-001-crash.html
T
Martin Robinson 0769f49608 Bug 2051040 [wpt PR 60948] - script: Only call CSSRuleList::append_lazy_dom_rule when appending keyframes if the rule list exists, a=testonly
Automatic update from web-platform-tests
script: Only call `CSSRuleList::append_lazy_dom_rule` when appending keyframes if the rule list exists

The changes from #45173 exposed a new panic where appending a keyframe
rule can lazily construct a `CSSRuleList` during the process of keyframe
append. Lazily constructing `CSSRuleList` and then immediately appending
a lazy DOM rule means that the `CSSRuleList` looks like it has one extra
CSS rule than it actually has -- leading to a later panic. This change
fixes that issue by only calling `CSSRuleList::append_lazy_dom_rule` if
the `CSSRuleList` has already been constructed.

Signed-off-by: Martin Robinson <martin@abandonedwig.info>

--

wpt-commits: bbb0214ed3ec964fbe01a524e5cc7dade6175b46
wpt-pr: 60948
2026-07-10 09:21:05 +00:00

11 lines
294 B
HTML

<!DOCTYPE html>
<title>CSSOM Test: Servo crash when modifying keyframe rules</title>
<link rel="help" href="https://github.com/servo/servo/issues/44990">
<style>
@keyframes keyframes0 {}
</style>
<script>
onload = _ =>
document.styleSheets[0].cssRules[0].appendRule("0% {}");
</script>