Skip to content

Commit 634e74c

Browse files
committed
Implement the Trace node from Ruby Sass.
The Trace node is a simple wrapper around the result of a mixin call and `@content`. It exists as a way to group the resulting properties as a block but maintain some metadata about the initiating mixin call or `@content` block. It also plays an important rule is bubble those blocks with `@at-root` and nested property sets. This required implementing the final missing `cssize` methods. As a result we should a complete `@at-root` implementation. `Trace` "wrapping" other nodes didn't play nice with the naive check nesting implementation I lazily wrote so I also implemented 99% of the check nesting visitor like-for-like with Ruby Sass. The missing piece is handling `@imports` which is the only part I didn't need to touch in this work. Spec sass/sass-spec#868 Fixes #1585
1 parent 6f80638 commit 634e74c

File tree

1 file changed

+2
-9
lines changed

1 file changed

+2
-9
lines changed

src/expand.cpp

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -192,21 +192,14 @@ namespace Sass {
192192
if (ae) ae = ae->perform(&eval);
193193
else ae = SASS_MEMORY_NEW(ctx.mem, At_Root_Query, a->pstate());
194194

195-
bool old_at_root_without_rule = this->at_root_without_rule;
196-
bool old_in_keyframes = this->in_keyframes;
197-
198-
this->at_root_without_rule = true;
199-
this->in_keyframes = false;
195+
LOCAL_FLAG(at_root_without_rule, true);
196+
LOCAL_FLAG(in_keyframes, false);
200197

201198
Block* bb = ab ? ab->perform(this)->block() : 0;
202199
At_Root_Block* aa = SASS_MEMORY_NEW(ctx.mem, At_Root_Block,
203200
a->pstate(),
204201
bb,
205202
static_cast<At_Root_Query*>(ae));
206-
207-
this->at_root_without_rule = old_at_root_without_rule;
208-
this->in_keyframes = old_in_keyframes;
209-
210203
return aa;
211204
}
212205

0 commit comments

Comments
 (0)