Support lossless zero-blur box shadows - #2849
Closed
claell wants to merge 2 commits into
Closed
Conversation
* Validate the complete shadow grammar while rejecting nonzero blur radii with actionable diagnostics. * Compute absolute lengths and currentColor for painting. * Cover valid and invalid syntax, colors, inset, spread, and multiple shadows.
* Paint outer and inset shadows in CSS order with knockout, spread, and current rounded-corner rules. * Respect collapsed-border table behavior and preserve vector-only PDF output. * Document the supported subset and cover generic rendering behavior.
Member
|
Thanks for this pull request. We opened a shorter and more simple pull request, that also handles blur: #2863. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Partially addresses #13.
Summary
box-shadowgrammar when every blur radius is zero.currentColor, rounded corners, transparent-box knockout, and collapsed-border table rules.Rationale
The previous implementations in #149 and #859 rasterized shadows. That adds image data to PDF output, scales poorly, and was the central reason those approaches were not merged.
Zero-blur shadows do not have that constraint: their sharp perimeters can be represented directly with PDF paths. A maintainer explicitly noted that this subset would be useful and invited further work in the #13 discussion: #149 (comment).
This pull request deliberately implements only that lossless subset. It does not introduce Pillow, a blur library, image surfaces, or any new dependency. Blurred shadows,
text-shadow, andfilter: drop-shadow()remain separate concerns with different painting and output-policy tradeoffs.Implementation notes
Verification
currentColor, rounded geometry, negative inset spread, collapsed tables, and vector-only PDF output.test_command_line_render, where the test helper appliesargs.split()to this checkout's absolute path.The full suite used the Windows Ghostscript discovery from #2847 as a temporary local test-harness change; that unrelated change is not included in this branch.
AI assistance disclosure
This change was authored with ChatGPT Codex under human direction and review. Maintainer review remains necessary, particularly for CSS conformance, painting integration, and long-term architecture.