commit 32021f0854e3f7c9778c7e6321dab0528adf6594
parent 4d53abad09f0207fe090a56597f50578fa699935
Author: Steinar H. Gunderson <sesse@chromium.org>
Date: Thu, 9 Oct 2025 20:35:06 +0000
Bug 1992311 [wpt PR 55195] - Fix mixin crash on @apply with empty contents block., a=testonly
Automatic update from web-platform-tests
Fix mixin crash on @apply with empty contents block.
Fix: 448672221
Change-Id: I88bb46935c01ac418a15da8199ccbadf8c9b12be
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/7002358
Auto-Submit: Steinar H Gunderson <sesse@chromium.org>
Commit-Queue: Rune Lillesveen <futhark@chromium.org>
Reviewed-by: Rune Lillesveen <futhark@chromium.org>
Commit-Queue: Steinar H Gunderson <sesse@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1524144}
--
wpt-commits: dcf3b6c08cd046b30dba73731559d32ae5bde2ce
wpt-pr: 55195
Diffstat:
1 file changed, 14 insertions(+), 0 deletions(-)
diff --git a/testing/web-platform/tests/css/css-mixins/contents-rule.html b/testing/web-platform/tests/css/css-mixins/contents-rule.html
@@ -57,6 +57,14 @@
#e6 {
@apply --m6;
}
+
+ @mixin --m7(@contents) {
+ @contents;
+ color: green;
+ }
+ #e7 {
+ @apply --m7 {};
+ }
</style>
</head>
<body>
@@ -66,6 +74,7 @@
<div class="c d" id="e4">This text should be green.</div>
<div id="e5">This text should be green.</div>
<div id="e6">This text should be green.</div>
+ <div id="e7">This text should be green.</div>
<script>
test(() => {
let target = document.getElementById('e1');
@@ -96,6 +105,11 @@
let target = document.getElementById('e6');
assert_equals(getComputedStyle(target).color, 'rgb(0, 128, 0)');
}, 'Empty @contents block is allowed, but does nothing');
+
+ test(() => {
+ let target = document.getElementById('e7');
+ assert_equals(getComputedStyle(target).color, 'rgb(0, 128, 0)');
+ }, 'Empty @contents parameter does not crash');
</script>
</body>
</html>