Repository navigation
Commit 416ea3d
committed
Preserve a box's own top margin at a forced page break
Confirmed gap: BlockFragmentation.TryGetForcedBreakTarget's targetTop was
always the raw page-content-top boundary - the box's own MarginTopCollapse
was used only to decide WHICH slot the natural (unshifted) position falls
in, never added back into the actual placement. css-break-3 5.2 preserves
(does not truncate) a box's own margin specifically at a FORCED break -
truncation only applies to an UNFORCED break where a margin alone happens
to cross a page boundary (BlockFragmentation.ResolveBlockTop, unaffected by
this change).
Fixed at the two places breakTop actually becomes a box's placement
(Dom/CssBox.cs): the immediate-placement path (top = breakTop) and the
deferred-pass path (RequestedBreakBeforeTop, which flows through
BlockBreakToken.ResumeTopOverride into _resumeTopOverride on the resuming
pass) - not inside TryGetForcedBreakTarget itself, which stays a pure
boundary value on purpose (its own slot/target output is asserted directly
in ForcedBreakTargetIsTheFramesTests.cs and needs to keep meaning "the
boundary", not "the boundary plus whatever margin happened to apply").
Un-ignores TargetIsTheBoundary_AndThePreservedMarginIsAddedToIt
(HtmlRenderer.Test, ported in Batch 1) and
ForcedBreak_MarginAfterBreak_IsPreservedNotTruncated
(HtmlRenderer.IntegrationTest, ported in Batch 2).
Full suite: HtmlRenderer.Test 2428 passed/127 skipped/0 failed (was
2427/128), HtmlRenderer.IntegrationTest 335 passed/91 skipped/0 failed (was
334/92), HtmlRenderer.PdfSharp.Test 39 passed/0 failed (unchanged).1 parent dbe33fe commit 416ea3d
3 files changed
Lines changed: 13 additions & 21 deletions
File tree
- Source
- HtmlRenderer/Core/Dom
- Test
- HtmlRenderer.IntegrationTest/Fragmentation
- HtmlRenderer.Test/Fragmentation
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
895 | 895 | | |
896 | 896 | | |
897 | 897 | | |
| 898 | + | |
| 899 | + | |
| 900 | + | |
| 901 | + | |
| 902 | + | |
| 903 | + | |
| 904 | + | |
| 905 | + | |
898 | 906 | | |
899 | 907 | | |
900 | 908 | | |
901 | 909 | | |
902 | 910 | | |
903 | 911 | | |
904 | 912 | | |
905 | | - | |
| 913 | + | |
906 | 914 | | |
907 | 915 | | |
908 | 916 | | |
| |||
911 | 919 | | |
912 | 920 | | |
913 | 921 | | |
914 | | - | |
| 922 | + | |
915 | 923 | | |
916 | 924 | | |
917 | 925 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
28 | 28 | | |
29 | 29 | | |
30 | 30 | | |
31 | | - | |
| 31 | + | |
32 | 32 | | |
33 | 33 | | |
34 | | - | |
35 | | - | |
36 | | - | |
37 | | - | |
| 34 | + | |
| 35 | + | |
38 | 36 | | |
39 | 37 | | |
40 | 38 | | |
| |||
283 | 281 | | |
284 | 282 | | |
285 | 283 | | |
286 | | - | |
287 | | - | |
288 | | - | |
289 | | - | |
290 | | - | |
291 | | - | |
292 | 284 | | |
293 | 285 | | |
294 | 286 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
143 | 143 | | |
144 | 144 | | |
145 | 145 | | |
146 | | - | |
147 | | - | |
148 | | - | |
149 | | - | |
150 | | - | |
151 | | - | |
152 | | - | |
153 | | - | |
154 | 146 | | |
155 | 147 | | |
156 | 148 | | |
| |||
0 commit comments