Repository navigation
Commit 03aa597
committed
Fix R1 regression: forced breaks nested inside table cells corrupted layout
Found while investigating the plan's R7 stage (table resumption), before
writing any new table code: CssLayoutEngineTable's row loop calls
cell.PerformLayout directly and does not participate in the
PendingBreakToken bubbling protocol an ordinary block-child loop does -
a table row is not itself laid out via that loop, so nothing ever reads
a cell's own PendingBreakToken and turns it into a real pass boundary.
Before R1, a forced break inside a table cell just computed an adjusted
top inline, in the same single continuous pass everything else used -
harmless. After R1, a forced break anywhere (including inside a table
cell) requests deferral to a later pass and returns from PerformLayoutImp
without calling CreateLineBoxes - but MeasureWordsSize already ran
unconditionally before that point, so the deferred content's words had
real sizes but stale/default (0,0) positions. Confirmed by direct
fragment-tree inspection: the content wasn't lost, it silently rendered
overlapping whatever else was in the cell, with no new page ever
created for it.
Fix: CssBox.CanDeferToLaterPass() walks a box's own ancestor chain for
a table-cell boundary; a forced break found there falls back to
immediate same-pass placement (the pre-R1 behavior) instead of
deferring, since deferring here could never actually be resumed. Not
full parity (this content doesn't get its own fresh fragmentainer pass
the way top-level content does), but correct rather than silently
corrupted - matching this port's established pattern of local
correction where true resumption isn't wired up yet.
R3 (avoid/monolithic relocation) and R4 (keep-with-next) are unaffected -
both relayout within the same pass rather than deferring across passes,
so they never depended on the block-child-loop bubbling chain reaching
past a table cell boundary in the first place.
New regression test constructs the exact scenario and verifies both
markers are present and correctly ordered by ABSOLUTE document-Y
(reconstructed from each fragmentainer's own band top, since raw
fragment-local Y values aren't comparable across different pages).
Full regression suite (42 IntegrationTest + 16 PdfSharp tests) passes.1 parent 380a207 commit 03aa597
2 files changed
Lines changed: 129 additions & 6 deletions
File tree
- Source
- HtmlRenderer/Core/Dom
- Test/HtmlRenderer.IntegrationTest
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
594 | 594 | | |
595 | 595 | | |
596 | 596 | | |
| 597 | + | |
| 598 | + | |
| 599 | + | |
| 600 | + | |
| 601 | + | |
| 602 | + | |
| 603 | + | |
| 604 | + | |
| 605 | + | |
| 606 | + | |
| 607 | + | |
| 608 | + | |
| 609 | + | |
| 610 | + | |
| 611 | + | |
| 612 | + | |
| 613 | + | |
| 614 | + | |
| 615 | + | |
| 616 | + | |
| 617 | + | |
| 618 | + | |
597 | 619 | | |
598 | 620 | | |
599 | 621 | | |
| |||
873 | 895 | | |
874 | 896 | | |
875 | 897 | | |
876 | | - | |
877 | | - | |
878 | | - | |
879 | | - | |
880 | | - | |
881 | | - | |
| 898 | + | |
| 899 | + | |
| 900 | + | |
| 901 | + | |
| 902 | + | |
| 903 | + | |
| 904 | + | |
| 905 | + | |
| 906 | + | |
| 907 | + | |
| 908 | + | |
| 909 | + | |
| 910 | + | |
| 911 | + | |
| 912 | + | |
| 913 | + | |
| 914 | + | |
882 | 915 | | |
883 | 916 | | |
884 | 917 | | |
| |||
| 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 | + | |
0 commit comments