Repository navigation
CSS 2.1 test parity: outline and background paint coverage (stacked on #265) - #266
Merged
eXpl0it3r merged 3 commits intoNov 9, 2026
Merged
Conversation
4 tasks done
eXpl0it3r
force-pushed
the
feature/css21-paint-coverage
branch
2 times, most recently
from
November 9, 2026 07:49
053fd68 to
4691ef1
Compare
Collaborator
|
Rebased onto the updated #265 and added a few outline fixes:
All of them have tests in |
eXpl0it3r
force-pushed
the
feature/css21-paint-coverage
branch
2 times, most recently
from
November 9, 2026 08:14
55a21d6 to
319babd
Compare
eXpl0it3r
approved these changes
Nov 9, 2026
…nted outline-style/-color/-width had CSS-OM parsing (and a shorthand) but no CssBoxProperties fields and no paint code anywhere - an authored outline had zero visual effect. Adds OutlineDrawHandler: unlike border, an outline isn't part of the box model and has no per-side bevel/corner-joining to account for, so it paints as four flat filled rectangles forming a ring around the border-box edge, hooked in right after DrawBoxBorders in FragmentPainter (matching CSS2.1 Appendix E's after-border painting order). Deliberately scoped to the common case: only solid/auto paint (every other style is a no-op, same as none/hidden), and outline-offset isn't implemented - this fork's CSS-OM has no OutlineOffsetProperty at all to read a value from, and adding outline-style:auto recognition would require a dedicated converter rather than a shared-map edit (Map.LineStyles is also border-style's own keyword table - adding "auto" there would wrongly make it a legal border-style value too). outline-color falls back to currentColor when unset, matching real browser behavior for the property's nominal (and here unimplemented) "invert" initial value. Ports the CSS2.1-relevant subset of PeachPDF's OutlineStylePaintIntegrationTests.cs against this simpler implementation - solid ring geometry, currentColor fallback, paint-order after border, none/hidden/zero-width no-op all pass; auto and outline-offset are ported [Ignore]d with the gaps above.
No test anywhere verified background-color actually paints a fill, despite the paint code (CssBox.PaintBackground) already working - only CSS-OM parsing (BackgroundPropertyTests.cs) was covered. Verifies fill geometry, the transparent/default (also transparent) no-op cases, and paint order relative to border/outline per CSS2.1 Appendix E.
- Paint the outline for replaced elements and <hr> - Copy the outline when a box gets cloned - Treat outline-color: invert as currentColor
eXpl0it3r
force-pushed
the
feature/css21-paint-coverage
branch
from
November 9, 2026 08:21
319babd to
73e9021
Compare
Collaborator
|
Thank you! |
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.
Part 3 of a CSS 2.1 test-parity sweep against PeachPDF's Integration test suite. Stacked on #265/#264/#263 - the diff below includes all three until they merge. Only the last 2 commits (outline paint, background paint tests) are this PR's own.
Summary
Scope: chapter 18 (
outline) and chapter 14 (background-color) - both had zero paint-level coverage.outline-style/-color/-widthparsed fine at the CSS-OM level but had noCssBoxPropertiesfields and no paint code anywhere - an authored outline had zero visual effect. ImplementedOutlineDrawHandler: a flat four-rectangle ring around the border-box edge (outline has no per-side bevel/corner-joining, unlike border), hooked in right after border painting per CSS2.1 Appendix E's paint order. Scoped to the common case - onlysolid/autopaint,outline-offsetisn't implemented (no CSS-OM property for it exists here at all), andoutline-style:autocan't actually be parsed from CSS text yet (would need a dedicated converter, not a shared-map edit - see the commit message).outline-colorfalls back tocurrentColorwhen unset.Test plan
HtmlRenderer.Testfull suite: 2449 passed, 0 failedHtmlRenderer.IntegrationTestfull suite: 384 passed, 0 failedHtmlRenderer.PdfSharp.Testfull suite: 39 passed, 0 failed:lang()untested) and jhaygood86/PeachPDF#865 (legacyclip: rect()untested beyond parsing) for gaps in PeachPDF's own suite, per this sweep's scope