diff options
author | Simon Steiner <ssteiner@apache.org> | 2024-07-16 08:34:38 +0100 |
---|---|---|
committer | Simon Steiner <ssteiner@apache.org> | 2024-07-16 08:34:38 +0100 |
commit | eb335e3f4be1670ef58a608f492f97f6c566c824 (patch) | |
tree | eaee7d9e8c5a8bfa51d8f3830dfaea0dc9df5ec7 /fop | |
parent | add90d5797769dbe4da40882b15a557449a27728 (diff) | |
download | xmlgraphics-fop-eb335e3f4be1670ef58a608f492f97f6c566c824.tar.gz xmlgraphics-fop-eb335e3f4be1670ef58a608f492f97f6c566c824.zip |
FOP-3192: Redo layout for multipage columns
Diffstat (limited to 'fop')
4 files changed, 224 insertions, 0 deletions
diff --git a/fop/test/layoutengine/standard-testcases/page-position_only_5.xml b/fop/test/layoutengine/standard-testcases/page-position_only_5.xml index 631948534..24ccfe8c2 100644 --- a/fop/test/layoutengine/standard-testcases/page-position_only_5.xml +++ b/fop/test/layoutengine/standard-testcases/page-position_only_5.xml @@ -80,6 +80,7 @@ </fo:root> </fo> <checks> + <eval expected="236" xpath="count(//word)"/> <eval expected="1" xpath="count(//page)"/> <eval expected="PageOnly" xpath="//pageViewport/@simple-page-master-name"/> </checks> diff --git a/fop/test/layoutengine/standard-testcases/page-position_only_5_legacy.xml b/fop/test/layoutengine/standard-testcases/page-position_only_5_legacy.xml new file mode 100644 index 000000000..c0c72e2d0 --- /dev/null +++ b/fop/test/layoutengine/standard-testcases/page-position_only_5_legacy.xml @@ -0,0 +1,90 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + Licensed to the Apache Software Foundation (ASF) under one or more + contributor license agreements. See the NOTICE file distributed with + this work for additional information regarding copyright ownership. + The ASF licenses this file to You under the Apache License, Version 2.0 + (the "License"); you may not use this file except in compliance with + the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +--> +<!-- $Id$ --> +<testcase> + <info> + <p> + This test checks for the use of an 'only' conditional-page-master-reference (XSL 1.1) + </p> + </info> + <cfg> + <legacy-skip-page-position-only>true</legacy-skip-page-position-only> + </cfg> + <fo> + <fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format" xmlns:fox="http://xmlgraphics.apache.org/fop/extensions"> + <fo:layout-master-set> + <fo:simple-page-master master-name="PageOnly" page-width="8.5in" page-height="11in" margin-bottom="0.5cm" margin-right="1cm" margin-top="1cm" margin-left="1cm"> + <fo:region-body margin-bottom="2cm" margin-right="0cm" margin-top="0cm" margin-left="0cm" background-color="red" column-count="2"/> + <fo:region-after extent="1cm" region-name="Footer1"/> + </fo:simple-page-master> + <fo:simple-page-master margin-bottom="0.5cm" master-name="PageFirst" page-width="8.5in" page-height="11in" margin-right="1cm" margin-top="1cm" margin-left="1cm"> + <fo:region-body margin-bottom="2cm" margin-right="0cm" margin-top="0cm" margin-left="0cm" background-color="yellow" column-count="2"/> + <fo:region-after extent="1cm" region-name="Footer2"/> + </fo:simple-page-master> + <fo:simple-page-master master-name="PageLast" page-width="8.5in" page-height="11in" margin-bottom="0.3cm" margin-right="1cm" margin-top="1cm" margin-left="1cm"> + <fo:region-body margin-bottom="2cm" column-count="2" background-color="green" margin-right="0cm" margin-top="0cm" margin-left="0cm"/> + <fo:region-after extent="1cm" region-name="Footer3"/> + </fo:simple-page-master> + <fo:simple-page-master master-name="PageRestEven" page-width="8.5in" page-height="11in" margin-bottom="0.3cm" margin-right="1cm" margin-top="1cm" margin-left="1cm"> + <fo:region-body margin-bottom="2cm" column-count="2" background-color="aqua" margin-right="0cm" margin-top="0cm" margin-left="0cm"/> + <fo:region-after extent="1cm" region-name="Footer4"/> + </fo:simple-page-master> + <fo:simple-page-master master-name="PageRestOdd" page-width="8.5in" page-height="11in" margin-bottom="0.3cm" margin-right="1cm" margin-top="1cm" margin-left="1cm"> + <fo:region-body margin-bottom="2cm" column-count="2" background-color="fuchsia" margin-right="0cm" margin-top="0cm" margin-left="0cm"/> + <fo:region-after extent="1cm" region-name="Footer5"/> + </fo:simple-page-master> + <fo:page-sequence-master master-name="LetterPages"> + <fo:repeatable-page-master-alternatives> + <fo:conditional-page-master-reference page-position="only" master-reference="PageOnly"/> + <fo:conditional-page-master-reference page-position="first" master-reference="PageFirst"/> + <fo:conditional-page-master-reference odd-or-even="even" page-position="rest" master-reference="PageRestEven"/> + <fo:conditional-page-master-reference odd-or-even="odd" page-position="rest" master-reference="PageRestOdd"/> + <fo:conditional-page-master-reference page-position="last" master-reference="PageLast"/> + </fo:repeatable-page-master-alternatives> + </fo:page-sequence-master> + </fo:layout-master-set> + <fo:page-sequence format="1" id="th_default_sequence1" initial-page-number="1" force-page-count="auto" master-reference="LetterPages"> + <fo:static-content flow-name="Footer1"> + <fo:block line-height="16pt" font-size="10pt" space-before="12pt" span="all">Footer 1</fo:block> + </fo:static-content> + <fo:static-content flow-name="Footer2"> + <fo:block line-height="16pt" font-size="10pt" space-before="12pt" span="all">Footer 2</fo:block> + </fo:static-content> + <fo:static-content flow-name="Footer3"> + <fo:block line-height="16pt" font-size="10pt" space-before="12pt" span="all">Footer 3</fo:block> + </fo:static-content> + <fo:static-content flow-name="Footer4"> + <fo:block line-height="16pt" font-size="10pt" space-before="12pt" span="all">Footer 4</fo:block> + </fo:static-content> + <fo:static-content flow-name="Footer5"> + <fo:block line-height="16pt" font-size="10pt" space-before="12pt" span="all">Footer 5</fo:block> + </fo:static-content> + <fo:flow flow-name="xsl-region-body"> + <fo:block line-height="16pt" font-size="10pt" space-before="12pt" span="all">Page 1 Page 1 Page 1 Page 1 Page 1 Page 1 Page 1 Page 1 Page 1 Page 1</fo:block> + <fo:block line-height="16pt" font-size="10pt" space-before="12pt">bgbg gresgfe rwfwr rfrw fwrfrw bgbg gresgfe rwfwr rfrw fwrfrw bgbg gresgfe rwfwr rfrw fwrfrw bgbg gresgfe rwfwr rfrw fwrfrw bgbg gresgfe rwfwr rfrw fwrfrw bgbg gresgfe rwfwr rfrw fwrfrw bgbg gresgfe rwfwr rfrw fwrfrw bgbg gresgfe rwfwr rfrw fwrfrw bgbg gresgfe rwfwr rfrw fwrfrw bgbg gresgfe rwfwr rfrw fwrfrw bgbg gresgfe rwfwr rfrw fwrfrw bgbg gresgfe rwfwr rfrw fwrfrw bgbg gresgfe rwfwr rfrw fwrfrw bgbg gresgfe rwfwr rfrw fwrfrw bgbg gresgfe rwfwr rfrw fwrfrw bgbg gresgfe rwfwr rfrw fwrfrw bgbg gresgfe rwfwr rfrw fwrfrw bgbg gresgfe rwfwr rfrw fwrfrw bgbg gresgfe rwfwr rfrw fwrfrw bgbg gresgfe rwfwr rfrw fwrfrw bgbg gresgfe rwfwr rfrw fwrfrw bgbg gresgfe rwfwr rfrw fwrfrw bgbg gresgfe rwfwr rfrw fwrfrw bgbg gresgfe rwfwr rfrw fwrfrw bgbg gresgfe rwfwr rfrw fwrfrw </fo:block> + <fo:block line-height="16pt" font-size="10pt" space-before="12pt" span="all">end end end end end end end end end end end end end end end end end end end end end end end end end end end end end end end end end end end end end end end end end end end end end end end end end end end end end end end end end end end end end end end end end end end end end end end end end end end end end end end end end end end end end end end end end </fo:block> + </fo:flow> + </fo:page-sequence> + </fo:root> + </fo> + <checks> + <eval expected="236" xpath="count(//word)"/> + <eval expected="1" xpath="count(//page)"/> + <eval expected="PageFirst" xpath="//pageViewport/@simple-page-master-name"/> + </checks> +</testcase> diff --git a/fop/test/layoutengine/standard-testcases/page-position_only_6.xml b/fop/test/layoutengine/standard-testcases/page-position_only_6.xml new file mode 100644 index 000000000..51cb97e0a --- /dev/null +++ b/fop/test/layoutengine/standard-testcases/page-position_only_6.xml @@ -0,0 +1,72 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + Licensed to the Apache Software Foundation (ASF) under one or more + contributor license agreements. See the NOTICE file distributed with + this work for additional information regarding copyright ownership. + The ASF licenses this file to You under the Apache License, Version 2.0 + (the "License"); you may not use this file except in compliance with + the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +--> +<!-- $Id$ --> +<testcase> + <info> + <p> + This test checks the page-position first is used as there is not enough space on page-position only. + </p> + </info> + <fo> + <fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format" xmlns:fox="http://xmlgraphics.apache.org/fop/extensions"> + <fo:layout-master-set> + <fo:simple-page-master master-name="PageOnly" page-width="8.5in" page-height="11in" margin-bottom="0.25in" margin-right="0.5in" margin-top="0.35in" margin-left="0.5in"> + <fo:region-body background-color="red" margin-top="0.85in" margin-bottom="2.1in" column-gap="0.3in" column-count="2" region-name="PageBody"/> + </fo:simple-page-master> + <fo:simple-page-master margin-right="0.5in" margin-left="0.5in" margin-top="0.35in" margin-bottom="0.25in" master-name="PageFirst" page-width="8.5in" page-height="11in"> + <fo:region-body background-color="blue" margin-top="0.85in" column-count="2" column-gap="0.3in" margin-bottom="1in" region-name="PageBody"/> + </fo:simple-page-master> + <fo:simple-page-master master-name="PageRest" margin-right="0.5in" margin-left="0.5in" margin-top="0.35in" margin-bottom="0.25in" page-width="8.5in" page-height="11in"> + <fo:region-body margin-bottom="1in" margin-top="0.5in" column-gap="0.3in" column-count="2" region-name="PageBody"/> + </fo:simple-page-master> + <fo:page-sequence-master master-name="LetterPages"> + <fo:repeatable-page-master-alternatives> + <fo:conditional-page-master-reference page-position="only" master-reference="PageOnly"/> + <fo:conditional-page-master-reference page-position="first" master-reference="PageFirst"/> + <fo:conditional-page-master-reference page-position="rest" master-reference="PageRest"/> + <fo:conditional-page-master-reference page-position="last" master-reference="PageRest"/> + </fo:repeatable-page-master-alternatives> + </fo:page-sequence-master> + </fo:layout-master-set> + <fo:page-sequence format="1" id="th_default_sequence1" initial-page-number="auto" force-page-count="auto" master-reference="LetterPages"> + <fo:flow flow-name="PageBody"> + <fo:block-container span="all" id="1"> + <fo:block>test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test </fo:block> + </fo:block-container> + <fo:block-container id="2"> + <fo:block> + <fo:block font-size="30pt">test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test </fo:block> + </fo:block> + </fo:block-container> + <fo:block-container span="all" id="3"> + <fo:block> + <fo:block> + <fo:leader/> + </fo:block> + </fo:block> + </fo:block-container> + </fo:flow> + </fo:page-sequence> + </fo:root> + </fo> + <checks> + <eval expected="216" xpath="count(//word)"/> + <eval expected="1" xpath="count(//page)"/> + <eval expected="PageFirst" xpath="//pageViewport/@simple-page-master-name"/> + </checks> +</testcase> diff --git a/fop/test/layoutengine/standard-testcases/page-position_only_7.xml b/fop/test/layoutengine/standard-testcases/page-position_only_7.xml new file mode 100644 index 000000000..48bc50220 --- /dev/null +++ b/fop/test/layoutengine/standard-testcases/page-position_only_7.xml @@ -0,0 +1,61 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + Licensed to the Apache Software Foundation (ASF) under one or more + contributor license agreements. See the NOTICE file distributed with + this work for additional information regarding copyright ownership. + The ASF licenses this file to You under the Apache License, Version 2.0 + (the "License"); you may not use this file except in compliance with + the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +--> +<!-- $Id$ --> +<testcase> + <info> + <p> + This test checks the page-position only is not used as there is more than 1 page + </p> + </info> + <fo> + <fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format" xmlns:fox="http://xmlgraphics.apache.org/fop/extensions" font-family="Helvetica"> + <fo:layout-master-set> + <fo:simple-page-master master-name="PageFrontSingle" page-width="8.5in" page-height="11in" margin-bottom="0.32in" margin-right="1in" margin-top="0.2in" margin-left="0.9in"> + <fo:region-body margin-bottom="1.35in" margin-right="0in" margin-top="0.5in" margin-left="0in" column-gap=".5in" column-count="2" region-name="letterPageBody" background-color="yellow"/> + </fo:simple-page-master> + <fo:simple-page-master master-name="PageFront" page-width="8.5in" page-height="11in" margin-bottom="0.32in" margin-right="1in" margin-top="0.2in" margin-left="0.9in"> + <fo:region-body margin-bottom="0.7in" margin-right="0in" margin-top="0.5in" margin-left="0in" column-gap=".5in" column-count="2" region-name="letterPageBody" background-color="orange"/> + </fo:simple-page-master> + <fo:simple-page-master master-name="PageRest" page-width="8.5in" page-height="11in" margin-bottom="0.32in" margin-right="1in" margin-top="0.7in" margin-left="0.9in"> + <fo:region-body margin-bottom="0.7in" margin-right="0in" margin-top="0in" margin-left="0in" column-gap=".5in" column-count="2" region-name="letterPageBody" background-color="red"/> + </fo:simple-page-master> + <fo:simple-page-master master-name="PageLast" page-width="8.5in" page-height="11in" margin-bottom="0.32in" margin-right="1in" margin-top="0.7in" margin-left="0.9in"> + <fo:region-body margin-bottom="1.35in" margin-right="0in" margin-top="0in" margin-left="0in" region-name="LetterPageBody" background-color="pink"/> + </fo:simple-page-master> + <fo:page-sequence-master master-name="LetterPages"> + <fo:repeatable-page-master-alternatives> + <fo:conditional-page-master-reference page-position="only" master-reference="PageFrontSingle"/> + <fo:conditional-page-master-reference page-position="first" master-reference="PageFront"/> + <fo:conditional-page-master-reference page-position="rest" master-reference="PageRest"/> + <fo:conditional-page-master-reference page-position="last" master-reference="PageLast"/> + </fo:repeatable-page-master-alternatives> + </fo:page-sequence-master> + </fo:layout-master-set> + <fo:page-sequence format="1" id="th_default_sequence1" initial-page-number="auto" force-page-count="auto" master-reference="LetterPages"> + <fo:flow flow-name="letterPageBody"> + <fo:block font-size="60pt">test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test </fo:block> + </fo:flow> + </fo:page-sequence> + </fo:root> + </fo> + <checks> + <eval expected="124" xpath="count(//word)"/> + <eval expected="4" xpath="count(//page)"/> + <eval expected="PageFront" xpath="//pageViewport/@simple-page-master-name"/> + </checks> +</testcase> |