Repository navigation
Commit d710fff
committed
Update a table's own Location when row-atomicity shifts its first row
Confirmed gap: CssLayoutEngineTable's css-tables-3 6.1 row-atomicity shift
(LayoutCells) moves each straddling row's cells (cell.OffsetTop) but never
touched the outer <table> box's own Location - so when the shifted row was
the table's own first content (a single-row table straddling a boundary,
or any table whose first row alone needed the shift), the table's visual
top effectively moved but Location/EffectiveTop stayed stale at the
original page. EnforceKeepWithNext(table) - called on a table exactly like
any other block child - reads EffectiveTop to decide whether a break falls
between the table and its previous sibling, so it never saw the crossing
and could never pull an avoid-chained heading along with it.
Fixed by updating _tableBox.Location when the shifting row's own cury
equals starty (nothing rendered above it within the table yet - the
row moving IS the table's content moving wholesale, not one of several
independently-straddling rows further down a multi-page table).
Deliberately does NOT call BlockFragmentation.PropagateContainerRelocation
to climb further into the table's own ancestors, unlike every other
relocation trigger in this file: this method can run more than once per
overall document pass whenever an ancestor is independently relocated by
RelocateIfNeeded (which re-lays the whole subtree out fresh at its own
target) - climbing here too double-counted that ancestor's already-correct
shift on top of RelocateIfNeeded's own. Confirmed by a real regression this
caused on first attempt: BoxContainingARepeatingTable_IsStillRelocated (a
table inside its own break-inside:avoid card) landed 2px past its correct
relocated position - reverted the propagation call once the full suite
caught it. A plain, non-avoid wrapper div around a table whose first row
alone triggers this path is consequently not covered - narrower than full
css-break-3 3.1 propagation, matching what the two tests this fixes
actually exercise (the table itself as EnforceKeepWithNext's own child).
Un-ignores TableMovedToNextPage_PullsAvoidChainedHeadingAlong and
TableMovedToNextPage_ChainSkipsDisplayNoneSibling_PullsHeadingAndIntroAlong
in KeepWithNextIntegrationTests.cs. Two other Ignored tests in the same
file (HeaderFitsButNoBodyRowDoes_MovesWholeTableAndHeadingTogether,
LongRepeatingHeaderTable_StartingNearPageBottom_...) cover a related but
different <thead>-interaction gap this fix does not address, left as-is.
Full suite: HtmlRenderer.Test 2428 passed/127 skipped/0 failed (unchanged),
HtmlRenderer.IntegrationTest 337 passed/89 skipped/0 failed (was 335/91,
+2 unignored here, 0 regressions elsewhere after reverting the propagation
call), HtmlRenderer.PdfSharp.Test 39 passed/0 failed (unchanged).1 parent 416ea3d commit d710fff
2 files changed
Lines changed: 30 additions & 8 deletions
File tree
- Source
- HtmlRenderer/Core/Dom
- Test/HtmlRenderer.IntegrationTest/Fragmentation
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
757 | 757 | | |
758 | 758 | | |
759 | 759 | | |
| 760 | + | |
| 761 | + | |
| 762 | + | |
| 763 | + | |
| 764 | + | |
| 765 | + | |
| 766 | + | |
| 767 | + | |
| 768 | + | |
| 769 | + | |
| 770 | + | |
| 771 | + | |
| 772 | + | |
| 773 | + | |
| 774 | + | |
| 775 | + | |
| 776 | + | |
| 777 | + | |
| 778 | + | |
| 779 | + | |
| 780 | + | |
| 781 | + | |
| 782 | + | |
| 783 | + | |
| 784 | + | |
760 | 785 | | |
761 | 786 | | |
762 | 787 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
102 | 102 | | |
103 | 103 | | |
104 | 104 | | |
105 | | - | |
106 | | - | |
107 | | - | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
108 | 110 | | |
109 | 111 | | |
110 | 112 | | |
111 | 113 | | |
112 | 114 | | |
113 | | - | |
114 | | - | |
115 | | - | |
116 | 115 | | |
117 | 116 | | |
118 | 117 | | |
| |||
157 | 156 | | |
158 | 157 | | |
159 | 158 | | |
160 | | - | |
161 | | - | |
162 | 159 | | |
163 | 160 | | |
164 | 161 | | |
| |||
0 commit comments