Repository navigation
Commit 11c35b3
committed
Port PeachPDF's fragment-claiming, marker and paint tests (Batch 3)
Ports PeachPDF.Tests/Integration/{StraddlingLineClaimTests,UnreachedWordClaimTests,
StraddlingListMarkerTests,BlockContentListMarkerTests}.cs into
HtmlRenderer.IntegrationTest/Fragmentation/ (real WinForms.HtmlContainer, same
reflect-out-HtmlContainerInt pattern as Batch 2) and
{FragmentPaintIntegrationTests,FragmentContentPainterTests,
GhostTextOnPreviousPageIntegrationTests}.cs into
HtmlRenderer.IntegrationTest/Painting/ (PaintHarness, extended with a LayoutPaginated
multi-page overload and a PaintPage helper that exercises the same per-page entry
point PdfGenerator itself uses, HtmlContainerInt.PerformPaint(RGraphics,
FragmentainerFragment)).
Marker tests are a real architectural adaptation, not a rename: HTML-Renderer's
outside ::marker is CssBox.ListItemBox, a field kept entirely separate from Boxes
and recomputed unconditionally from the item's own current Location on every
PerformLayoutImp call - so PeachPDF's root defects for these two files (marker
positioned by a stale per-pass epilogue; marker re-parented into an item's
anonymous inline-run block, hiding it from a direct-children-only scan) do not
exist here by construction. The invariant they protect is still worth pinning:
- StraddlingListMarkerTests: 5 of 8 ported (3 dropped - column-count/
column-fill:balance tests require a multi-column engine this fork doesn't have).
- BlockContentListMarkerTests: 2 of 9 ported (only the fragment-claiming half, per
the plan; the other 7 are general list-layout correctness the marker's-not-in-
Boxes architecture already makes moot, or require multicol).
- StraddlingLineClaimTests: 1 of 3 (the oversized-word case; dropped
ContentAfterAWordTallerThanTheBand's CursorSpills, PeachPDF-only per-pass cursor
concept, and the flex/grid Theory - neither engine exists here).
- UnreachedWordClaimTests: 3 of 3, Theory trimmed from 6 to 5 rows (dropped
column-count).
BandMembershipToleranceTests is dropped outright rather than Ignored: HTML-Renderer
has no PageBoundaryEpsilon/SlotStartingAt analog, and more fundamentally,
InlineFragmentation.ApplyLineBreaking's break decisions and FragmentEmitter's own
band-overlap test both derive from the same PageTopOf/PageBottomOf arithmetic via
one uniform per-run shift, not two independently-rounded fitting tests - so there
is no separate computation left for the emitter to disagree with, and no fixture
can be built to land in a disagreement window that doesn't exist.
GhostTextOnPreviousPageIntegrationTests's sibling PageMarginPixelsPerPointIntegrationTests
(3 tests) is also dropped: HTML-Renderer's @page has no margin cascade into
HtmlContainerInt.MarginTop at all (confirmed by grepping Core/ for PixelsPerPoint -
no matches - and for any @page-margin consumer; MarginTop/Bottom/Left/Right are
set only by the hosting application). GhostTextOnPreviousPageIntegrationTests'
own 2 tests still port, as a regression pin of the same observable invariant on
this port's different (fragment-tree-driven, not live-tree-clip-driven) paint
architecture.
One test is Ignored, not fixed: StackingOrder_IsPreservedWhenPaintingFromFragments
- z-index is parsed and stored but never consulted by paint order anywhere in
Core/Paint/ (confirmed by grep), so FragmentPainter paints absolutely-positioned
siblings in DOM order regardless of z-index. A second Ignore,
AnItemDeferredBeforeItsContentWasEverFlowed_TravelsWholeWithItsMarker, hits a
confirmed, pre-existing, differently-documented gap:
BlockFragmentation.TryGetForcedBreakTarget suppresses a forced break entirely when
the box has no previous sibling (full css-break-3 3.1 ancestor propagation is out
of scope per that method's own doc comment) - here the break-before:page box is
its <li>'s only child, so the break never even reaches the <li> that does have one.
One real, confirmed production bug was found and fixed (not just documented) while
adapting EveryMarker_IsDrawnOnExactlyOnePage: HtmlContainerInt.PerformPaint(RGraphics,
FragmentainerFragment) - the per-page paint entry point PdfGenerator's own page
loop calls for every real multi-page PDF - pushed its paint clip starting at
Y=MarginTop rather than Y=0. Fragment-tree geometry is already band-local (a
band's own top is local Y=0, per FragmentEmitter's own doc comment), so this
silently clipped away the first MarginTop-tall strip of every single page's own
content, with no exception raised (a quiet visibility-cull no-op, not a thrown
error) - caught here by a list item landing entirely within that clipped strip
and never appearing in any page's paint log. Fixed at its source in
HtmlContainerInt.cs; see that method's own remarks for the full mechanism.
38 tests added (36 passing, 2 Ignored with cited evidence), 12 explicitly dropped
with documented reasons (9 architecturally inapplicable - multicol/flex/grid/
PeachPDF-only pass cursor/@page margin cascade - plus 3 duplicated by the
BandMembershipToleranceTests removal).
Full suite: HtmlRenderer.Test 2426 passed/129 skipped/0 failed (unchanged),
HtmlRenderer.IntegrationTest 275 passed/95 skipped/0 failed (was 246/93/0),
HtmlRenderer.PdfSharp.Test 30 passed/0 skipped/0 failed (unchanged).1 parent d8b2587 commit 11c35b3
9 files changed
Lines changed: 1262 additions & 2 deletions
File tree
- Source
- HtmlRenderer/Core
- Test/HtmlRenderer.IntegrationTest
- Fragmentation
- Painting
- TestSupport
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
874 | 874 | | |
875 | 875 | | |
876 | 876 | | |
| 877 | + | |
| 878 | + | |
| 879 | + | |
| 880 | + | |
| 881 | + | |
| 882 | + | |
| 883 | + | |
| 884 | + | |
| 885 | + | |
| 886 | + | |
| 887 | + | |
| 888 | + | |
| 889 | + | |
| 890 | + | |
877 | 891 | | |
878 | 892 | | |
879 | 893 | | |
880 | 894 | | |
881 | 895 | | |
882 | 896 | | |
883 | 897 | | |
884 | | - | |
| 898 | + | |
885 | 899 | | |
886 | 900 | | |
887 | 901 | | |
888 | | - | |
| 902 | + | |
889 | 903 | | |
890 | 904 | | |
891 | 905 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
0 commit comments