Repository navigation
Commit 8903205
committed
R3: break-inside:avoid/monolithic relocation via real relayout (R2 folded in)
R2 ("overflow-driven block breaks") turned out to be a no-op given this
architecture: RelocateIfNeeded already does nothing for ordinary
(non-avoid, non-monolithic) content - it's left to split naturally via
the same recursive child-loop/InlineFragmentation math that already
produces correct positions, with no "does this fit" decision applicable
to a plain block container. There was no core case for R2 to convert.
Folding straight into R3, the first stage with a real behavior/code
change.
RelocateIfNeeded now relays the child out fresh at its target position
(CssBox.ResumeAt + a second PerformLayout call, within the same pass)
instead of OffsetTop-shifting its already-finished geometry. This is
strictly more correct, not just architecturally purer: a relaid-out
child's own descendants that have their own break-inside:avoid or a
nested forced break get to make that decision relative to the real page
boundaries at the NEW position, where a flat OffsetTop shift would have
carried whatever decision they made at the old one unchanged - possibly
wrong once the shift lands them against a different boundary. Keep-with-
next (the preceding-run shift) stays the older OffsetTop correction for
now; R4 converts that together with margin truncation.
Fixed a real ordering bug surfaced while touching this code: the child
loop called RelocateIfNeeded before checking whether the child's own
child loop had stopped mid-way (a nested forced break) - a child in
that state never reaches its own epilogue, so ActualBottom/Location only
reflect a partial pass, and RelocateIfNeeded's straddle test would have
read meaningless geometry. Reordered so a pending nested break is
checked and bubbled first; also re-checked after the relocation relayout
itself, since that relayout can surface its own nested break. Extracted
the repeated bubble-and-stop logic into CssBox.BubbleChildPendingToken.
New test: a scroll-container (overflow:hidden) taller than one page
confirms it's left straddling the boundary in place, not moved (nowhere
to move it to would help) or looped. Full regression suite (38
IntegrationTest + 16 PdfSharp tests) passes unchanged.1 parent b5b1408 commit 8903205
3 files changed
Lines changed: 113 additions & 22 deletions
File tree
- Source
- HtmlRenderer/Core
- Dom
- Fragmentation
- Test/HtmlRenderer.IntegrationTest
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
930 | 930 | | |
931 | 931 | | |
932 | 932 | | |
933 | | - | |
| 933 | + | |
| 934 | + | |
| 935 | + | |
| 936 | + | |
| 937 | + | |
| 938 | + | |
934 | 939 | | |
935 | | - | |
936 | | - | |
937 | | - | |
938 | | - | |
939 | | - | |
940 | | - | |
941 | | - | |
| 940 | + | |
| 941 | + | |
| 942 | + | |
| 943 | + | |
| 944 | + | |
| 945 | + | |
942 | 946 | | |
943 | | - | |
944 | 947 | | |
945 | 948 | | |
946 | 949 | | |
| |||
980 | 983 | | |
981 | 984 | | |
982 | 985 | | |
| 986 | + | |
| 987 | + | |
| 988 | + | |
| 989 | + | |
| 990 | + | |
| 991 | + | |
| 992 | + | |
| 993 | + | |
| 994 | + | |
| 995 | + | |
| 996 | + | |
| 997 | + | |
| 998 | + | |
| 999 | + | |
| 1000 | + | |
| 1001 | + | |
| 1002 | + | |
983 | 1003 | | |
984 | 1004 | | |
985 | 1005 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
| 3 | + | |
3 | 4 | | |
4 | 5 | | |
5 | 6 | | |
6 | 7 | | |
7 | 8 | | |
8 | 9 | | |
9 | 10 | | |
10 | | - | |
11 | | - | |
12 | | - | |
13 | | - | |
14 | | - | |
15 | | - | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
16 | 19 | | |
17 | 20 | | |
18 | 21 | | |
| |||
85 | 88 | | |
86 | 89 | | |
87 | 90 | | |
88 | | - | |
89 | | - | |
90 | | - | |
91 | | - | |
92 | | - | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
93 | 98 | | |
94 | | - | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
95 | 109 | | |
96 | 110 | | |
97 | 111 | | |
| |||
123 | 137 | | |
124 | 138 | | |
125 | 139 | | |
126 | | - | |
| 140 | + | |
| 141 | + | |
127 | 142 | | |
128 | 143 | | |
129 | 144 | | |
| |||
| 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 | + | |
0 commit comments