fix(css): preserve geometry-box values in mask shorthand parsing#27680
fix(css): preserve geometry-box values in mask shorthand parsing#27680anthonybaldwin wants to merge 1 commit intooven-sh:mainfrom
geometry-box values in mask shorthand parsing#27680Conversation
Wrap parse calls in `Mask.parse()` with `input.tryParse()` to restore parser state on failure, matching the pattern used in `background.zig`. Without this, failed parsers consume tokens before returning errors, causing `geometry-box` values (`padding-box`, `content-box`) to be silently dropped and rules with different geometry boxes to be incorrectly merged. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review infoConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Pro Disabled knowledge base sources:
📒 Files selected for processing (2)
WalkthroughModified mask property parsing in Zig to use tryParse instead of synchronous parse calls for image, position, repeat, origin, clip, composite, and mode fields. Added new test file with CSS bundling tests for mask-geometry-box and webkit-mask properties. Changes
🚥 Pre-merge checks | ✅ 2✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. Tip Try Coding Plans. Let us write the prompt for your AI agent so you can ship faster (with fewer bugs). Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
What does this PR do?
Wrap parse calls in
Mask.parse()withinput.tryParse()to restore parser state on failure, matching the pattern used inbackground.zig(#L55-L105). Without this, failed parsers consume tokens before returning errors, causinggeometry-boxvalues (padding-box,content-box) to be silently dropped and rules with different geometry boxes to be incorrectly merged.How did you verify your code works?
Ran
test/bundler/css/mask-geometry-box.test.tsagainst the fixed build and againstv1.3.10+v1.3.11-canary.60:v1.3.10/v1.3.11-canary.60: 0 pass, 2 failgeometry-boxvalues (padding-box,content-box) are stripped and rules are incorrectly merged