Skip to content

css: bound nested-prelude substitution output across the stylesheet - #32451

Open
robobun wants to merge 6 commits into
mainfrom
farm/122506dc/css-nesting-expansion-bytes-hang
Open

css: bound nested-prelude substitution output across the stylesheet#32451
robobun wants to merge 6 commits into
mainfrom
farm/122506dc/css-nesting-expansion-bytes-hang

css: also meter @scope preludes when <scope-end> expands against <sco…

9519df0
Select commit
Loading
Failed to load commit list.
Claude / Claude Code Review completed Jun 17, 2026 in 19m 29s

Code review found 1 important issue

Found 2 candidates, confirmed 1. See review comments for details.

Details

Severity Count
🔴 Important 1
🟡 Nit 0
🟣 Pre-existing 0
Severity File:Line Issue
🔴 Important src/css/rules/scope.rs:78-87 @scope to (...) without scope-start: early return bypasses nesting-expansion byte metering

Annotations

Check failure on line 87 in src/css/rules/scope.rs

See this annotation in the file changed.

@claude claude / Claude Code Review

@scope to (...) without scope-start: early return bypasses nesting-expansion byte metering

The `@scope to (...)` (no `<scope-start>`) branch does `return serialize_selector_list(...)` at line 73, which exits before the new `nesting_expansion_bytes` charge/check at lines 78–87. When such a rule is nested inside a parent style rule with nesting compiled away, `dest.ctx` is set so `has_expanding_context` is true and `&` in `<scope-end>` expands the parent — but the bytes are never charged, so many sibling `@scope to (& & & ...)` rules under a large parent selector still bypass the budget