From 7430d346394d3b608e4451eeee4105c0c9fb69fb Mon Sep 17 00:00:00 2001 From: Stephanie Zhang Date: Tue, 21 Jul 2026 09:18:46 -0700 Subject: [PATCH] [css-mixins] Make @apply and @contents rules StyleRuleGroups @apply and @contents carry child rules but extended StyleRuleBase, stashing them on a throwaway "fake parent" StyleRule. This CL makes them extend StyleRuleGroup, owning their children directly and joining DowncastTraits and continuing the work from CL:7755161. This is a behavior-preserving refactor. A web test was added confirming that an empty `@apply --foo {}` block suppresses the mixin's @contents fallback, while `@apply --foo;` still lets it apply. Change-Id: I033b0d0b0e6d399152cb6ce3e1ac4dfd0c563c48 Fixed: 502048295 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/8114919 Commit-Queue: Stephanie Zhang Reviewed-by: Kevin Babbitt Cr-Commit-Position: refs/heads/main@{#1665525} --- css/css-mixins/mixins/contents-rule.html | 41 ++++++++++++++++++++++++ 1 file changed, 41 insertions(+) diff --git a/css/css-mixins/mixins/contents-rule.html b/css/css-mixins/mixins/contents-rule.html index 0e7c4afc767b11..8d84186ae5eb82 100644 --- a/css/css-mixins/mixins/contents-rule.html +++ b/css/css-mixins/mixins/contents-rule.html @@ -130,5 +130,46 @@ assert_equals(getComputedStyle(target).color, 'rgb(0, 128, 0)'); }, 'Empty @contents parameter does not crash'); + + + +
This text should be green.
+ + + + +
This text should be green.
+