Skip to content

fix(usvgr): name the clip path and mask in the zero-sized element warnings - #22

Merged
dmtrKovalenko merged 1 commit into
dmtrKovalenko:mainfrom
FarisTF:fix/name-clip-path-and-mask-in-zero-sized-warning
Oct 16, 2026
Merged

dmtrKovalenko merged 1 commit into
dmtrKovalenko:mainfrom
FarisTF:fix/name-clip-path-and-mask-in-zero-sized-warning

Conversation

@FarisTF

@FarisTF FarisTF commented Oct 14, 2026 •

Copy link
Copy Markdown

Follow-up to #20.

The clip path and mask warnings now say which clip path or mask they are about, same as the filter one.

Before:

Clipping of zero-sized shapes is not allowed.
Masking of zero-sized shapes is not allowed.

After:

Clip path 'porthole' cannot be applied to a zero-sized element (it uses objectBoundingBox units). Skipped.
Mask 'fade' cannot be applied to a zero-sized element (its content uses objectBoundingBox units). Skipped.

Only the text changes. My test file renders the same picture as before.

All tests pass (cargo test --release, 1705 integration tests).

I used Claude Code to help investigate and draft this. I checked the before and after output and ran the tests on my machine.

Summary by CodeRabbit

  • Bug Fixes
    • Warnings for clip paths and masks that cannot be applied to zero-sized elements now identify the affected item and clarify that it was skipped.

@coderabbitai

coderabbitai Bot commented Oct 14, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 39f787f9-8501-45fa-94b3-221bbe19d9ee
📥 Commits

Reviewing files that changed from the base of the PR and between 0a18b63 and 416641b.

📒 Files selected for processing: 2
  • crates/usvgr/src/parser/clippath.rs
  • crates/usvgr/src/parser/mask.rs

Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.

📝 Walkthrough

Warnings for clip paths and masks that use objectBoundingBox units now identify the affected element when its bounding box is zero-sized. Both parsers keep their existing return behavior.

Changes: Zero-sized bounding-box warnings

Layer / File(s) Summary
Update clip-path and mask warnings
crates/usvgr/src/parser/clippath.rs, crates/usvgr/src/parser/mask.rs
The clip-path warning identifies the clip-path element and says it is skipped. The mask warning identifies the mask and says it cannot be applied. Both keep the existing return behavior.

Priority: ⬇️ Low

Estimated code review effort: 1 (Trivial) | ~3 minutes

Change: Bug fix

Merge Risk: ⚪ Minimal · up to 41664

This change makes skipped clip-path and mask warnings identify the affected element without changing rendering behavior. No actionable merge-blocking risk remains.

Pre-merge checks: Passed 4 · Failed 1

Failed Failed checks: 1 warning

Check name Status Explanation Resolution
Docstring Coverage Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 2 functions across 2 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed Passed checks: 4 passed
Check name Status Explanation
Title check Passed The title clearly and concisely describes the main change: naming the clip path and mask in zero-sized element warnings.
Description check Passed The description explains the motivation, shows the warning text changes, states that rendering behavior is unchanged, and reports successful tests. It also documents a meaningful improvement and does …
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
  • Fix all pre-merge checks with AI
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@dmtrKovalenko
dmtrKovalenko merged commit f52ec53 into dmtrKovalenko:main Oct 16, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants