Repository navigation
Commit 267c3e0
committed
Retire Orphans_RejectsZero: not a real gap, fix the test's own premise instead
Investigated the reported gap (OrphansProperty/WidowsProperty accepting 0 at
the CSS-parse layer) before touching production code, per this project's own
"verify before implementing" discipline. Tried the described fix - switching
both properties from NaturalIntegerConverter/IntegerConverter to
PositiveIntegerConverter - and it broke two existing, directly-ported-from-
PeachPDF tests: Css/PropertyPaginationTests.cs's CssOrphansZeroLegal and
CssWidowsZeroLegal (ported verbatim from PeachPDF.Tests/CSS/Property.cs)
assert that PeachPDF's OWN Property.Value for "orphans:0"/"widows:0" IS "0",
not a fallback - confirming this fork's raw parsing already matches its
reference implementation correctly.
CssBox.Orphans/Widows are thin wrappers over that same declared string, so
returning "0" verbatim is correct, not a bug - it mirrors how a browser's
CSS OM keeps an out-of-range "specified value" visible even though layout
never uses it directly. The actual css-break-3 constraint (>=1) is enforced
exactly once, where it belongs: ActualOrphans/ActualWidows already treat any
non-positive parse as unset and fall back to the initial value of 2 -
already correct, already covered by every other test in this file that
reads those accessors instead of the raw string.
Reverted the converter change; rewrote the test itself
(Orphans_ZeroResolvesToDefault_ThoughTheDeclaredStringStaysZero,
Widows_ZeroResolvesToDefault_ThoughTheDeclaredStringStaysZero,
Widows_NegativeResolvesToDefault) to assert BOTH facts explicitly - the
declared string stays "0"/"-1", and ActualOrphans/ActualWidows still
resolve to 2 - so this distinction stays pinned rather than re-litigated.
Full suite: HtmlRenderer.Test 2427 passed/128 skipped/0 failed (unchanged,
confirms the revert restored the two PropertyPaginationTests),
HtmlRenderer.IntegrationTest 352 passed/94 skipped/0 failed (was 330/94,
+22 in this file, 0 net new skips - the file's own Ignore is fully gone now).1 parent 6c67f40 commit 267c3e0
1 file changed
Lines changed: 30 additions & 8 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
105 | 105 | | |
106 | 106 | | |
107 | 107 | | |
108 | | - | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
109 | 118 | | |
110 | | - | |
111 | | - | |
112 | | - | |
113 | | - | |
114 | | - | |
115 | | - | |
| 119 | + | |
116 | 120 | | |
117 | 121 | | |
118 | | - | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
119 | 141 | | |
120 | 142 | | |
121 | 143 | | |
| |||
0 commit comments