From 3ae46a94cd16b8190edc6a91b3e5998916ee66ab Mon Sep 17 00:00:00 2001 From: PgBiel <9021226+PgBiel@users.noreply.github.com> Date: Fri, 11 Apr 2025 14:35:15 -0300 Subject: [PATCH] add orphan prevention tests --- ...header-non-repeating-orphan-prevention.png | Bin 0 -> 453 bytes ...eaders-non-repeating-orphan-prevention.png | Bin 0 -> 347 bytes ...-subheaders-repeat-replace-short-lived.png | Bin 754 -> 795 bytes ...subheaders-repeating-orphan-prevention.png | Bin 0 -> 347 bytes ...aders-short-lived-no-orphan-prevention.png | Bin 0 -> 287 bytes tests/suite/layout/grid/headers.typ | 11 ++++ tests/suite/layout/grid/subheaders.typ | 52 ++++++++++++++++++ 7 files changed, 63 insertions(+) create mode 100644 tests/ref/grid-header-non-repeating-orphan-prevention.png create mode 100644 tests/ref/grid-subheaders-non-repeating-orphan-prevention.png create mode 100644 tests/ref/grid-subheaders-repeating-orphan-prevention.png create mode 100644 tests/ref/grid-subheaders-short-lived-no-orphan-prevention.png diff --git a/tests/ref/grid-header-non-repeating-orphan-prevention.png b/tests/ref/grid-header-non-repeating-orphan-prevention.png new file mode 100644 index 0000000000000000000000000000000000000000..d0dbc59748ce0e8462187568367c72b122387107 GIT binary patch literal 453 zcmeAS@N?(olHy`uVBq!ia0vp^6+k?L14uA%c^CCCFfjIbx;TbZ+y*RqZXeQh$X>hg>89Mje8Hk~*2HhJV$}T*Br<=6ar@>~ z4-S5wvi*x}6oaau``TSA=D#^mdr;<-JHPh5wC=B8{arsa*>~p7|F5`7s)pr|a_9g3 z4tb02D}DG_bVi#=y7Q-)poP)YJdsBBIo(skg+8RP+bJ;4|H@!gaQMs)MW*eCg~hw7 zj;b@2A1u{nRBu~W{`t++%zHDHJ`_K%+syIiwu>9fx0V*GeJlF%Iu3ZuPx~3I0`{N{ z?}lWccmIo>d$XkF!7^q^iFe9^7E8iA4JNHQEdv@jsG0~9}=u6{1-oD!M}8ba4!+xb^nhelMp&iDQMw z7f5I5axBW`SY)_j<-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>QwVs* z3_8_uvr@sp^+TFv%oU5<1%i752sqX-bMPku{1bk6T|;92t^$FR z_R3}m+}Sa3wSS6$uQ)(^{B>uO4Fb#Yq7MSsG@x5OyfJ`*OZB2MIJ*@D2hYdU_MIyq zNrVuvVovWVBH(bBXaxcPFa%~HaPrvoNC^Rt2VdOoM8F**m9Z%V9BMw&E(mz4VtfvP zC2SW6oZDRqLExc_zAkkQiSN050Rs2B&$L3|)uN^dfq%sm#lVw>_a`9mhgfuu{}u@o zCQMlV45JqJm@r|&gc*`CB>S&Ivc%!GZ7BpSdig8}_{;VsfxxjXasK{UANb*h3_00*-gf4$O2iw z*zL4H;McXiix61c9)ZB=CUHaH$6lXTU8nj}H1-k#_f9(<5V*Rmt3qJWrxeUQ)(;-r5ZB5$qW7QMd!0000}8ba4!+xb^nhelMp&iDQMw z7f5I5axBW`SY)_j<-(TB-1T>3!D zZqky4@4VGEG^I-(DE=DvRI2a0NOkw@74yn?eoyz`Xa7-d&jrIfw`DzoO0;J`|7Eqg zF?b>G9bZ5HWab@Gb#*e&WDifBd*^&-h@G5uoAueS&AMBqFK)Z?Na^!E^G5Hhw-$5S xc-O_xIFNty;!e((il2MAB4!@I3Z!}U8CPDIc=*0T)i+S6dAjW|_HDUg$ zrM6O4E!P$-GE!QxSL$}q9G+QHSshhPF-PjVyPMDP{bE}5>9e9t-=Xrj2hGL$-^08# zL=7Z(*qRR}pi_HfZCnq2fzhV27KD_l`@#_2KuNq9#f8F)e-*VM_Eyo^-IF|>JTk8cH z=l?%d%Tkxo_Tb&a=NBWH^gf>~d1>8<=?0*o-?{EFxJu3spK@qX8p!9Ku6{1-oD!M< D=nr>z literal 0 HcmV?d00001 diff --git a/tests/suite/layout/grid/headers.typ b/tests/suite/layout/grid/headers.typ index 20595c9f8..882397695 100644 --- a/tests/suite/layout/grid/headers.typ +++ b/tests/suite/layout/grid/headers.typ @@ -250,6 +250,17 @@ ..([Test], [Test], [Test]) * 20 ) +--- grid-header-non-repeating-orphan-prevention --- +#set page(height: 5em) +#v(2em) +#grid( + grid.header(repeat: false)[*Abc*], + [a], + [b], + [c], + [d] +) + --- grid-header-empty --- // Empty header should just be a repeated blank row #set page(height: 12em) diff --git a/tests/suite/layout/grid/subheaders.typ b/tests/suite/layout/grid/subheaders.typ index 8fc9e4987..5c28f1065 100644 --- a/tests/suite/layout/grid/subheaders.typ +++ b/tests/suite/layout/grid/subheaders.typ @@ -197,6 +197,8 @@ ) --- grid-subheaders-repeat-replace-short-lived --- +// No orphan prevention for short-lived headers +// (followed by replacing headers). #set page(height: 8em) #grid( grid.header( @@ -345,6 +347,56 @@ grid.cell(x: 0)[done.] ) +--- grid-subheaders-short-lived-no-orphan-prevention --- +// No orphan prevention for short-lived headers. +#set page(height: 8em) +#v(5em) +#grid( + grid.header( + level: 2, + [b] + ), + grid.header( + level: 2, + [c] + ), + [d] +) + +--- grid-subheaders-repeating-orphan-prevention --- +#set page(height: 8em) +#v(4.5em) +#grid( + grid.header( + repeat: true, + level: 2, + [L2] + ), + grid.header( + repeat: true, + level: 4, + [L4] + ), + [a] +) + +--- grid-subheaders-non-repeating-orphan-prevention --- +#set page(height: 8em) +#v(4.5em) +#grid( + grid.header( + repeat: false, + level: 2, + [L2] + ), + grid.header( + repeat: false, + level: 4, + [L4] + ), + [a] +) + --- grid-subheaders-alone --- #table( table.header(