diff options
author | Simon Steiner <ssteiner@apache.org> | 2016-01-06 12:13:52 +0000 |
---|---|---|
committer | Simon Steiner <ssteiner@apache.org> | 2016-01-06 12:13:52 +0000 |
commit | 51f22319512e0a50b6f2c0e63da01b79a392275c (patch) | |
tree | 401b2816e43bd2d610321c93096a57c55045b588 /test | |
parent | d88b17f110e6d3e9683c316d460ae5e6e2ed4f1b (diff) | |
download | xmlgraphics-fop-51f22319512e0a50b6f2c0e63da01b79a392275c.tar.gz xmlgraphics-fop-51f22319512e0a50b6f2c0e63da01b79a392275c.zip |
FOP-2335: Content is missing after IPD change
git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@1723297 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'test')
12 files changed, 831 insertions, 1 deletions
diff --git a/test/layoutengine/standard-testcases/basic_link_to_last_page.xml b/test/layoutengine/standard-testcases/basic_link_to_last_page.xml index df99c7cde..892e85fcf 100644 --- a/test/layoutengine/standard-testcases/basic_link_to_last_page.xml +++ b/test/layoutengine/standard-testcases/basic_link_to_last_page.xml @@ -74,7 +74,7 @@ <checks> <eval expected="(P2,par2)" xpath="((/areaTree/pageSequence/pageViewport)[4]//inlineparent[@internal-link])[1]/@internal-link"/> <eval expected="(P3,par3)" xpath="((/areaTree/pageSequence/pageViewport)[4]//inlineparent[@internal-link])[2]/@internal-link"/> - <eval expected="(P5,title)" xpath="/areaTree/bookmarkTree/bookmark/@internal-link"/> + <eval expected="(P6,title)" xpath="/areaTree/bookmarkTree/bookmark/@internal-link"/> <eval expected="4" xpath="count(/areaTree/pageSequence/pageViewport)"/> </checks> </testcase> diff --git a/test/layoutengine/standard-testcases/flow_changing-ipd_columns.xml b/test/layoutengine/standard-testcases/flow_changing-ipd_columns.xml new file mode 100644 index 000000000..ab6321adc --- /dev/null +++ b/test/layoutengine/standard-testcases/flow_changing-ipd_columns.xml @@ -0,0 +1,69 @@ +<?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> + Check that an IPD change is detected when switching from single column to multi-column layout. + </p> + </info> + <fo> + <fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format"> + <fo:layout-master-set> + <fo:simple-page-master master-name="page1" + page-height="120pt" page-width="320pt" margin="10pt"> + <fo:region-body/> + </fo:simple-page-master> + <fo:simple-page-master master-name="page2" + page-height="120pt" page-width="320pt" margin="10pt"> + <fo:region-body column-count="2" column-gap="20pt"/> + </fo:simple-page-master> + <fo:simple-page-master master-name="page" + page-height="120pt" page-width="320pt" margin="10pt"> + <fo:region-body/> + </fo:simple-page-master> + <fo:page-sequence-master master-name="pages"> + <fo:single-page-master-reference master-reference="page1"/> + <fo:single-page-master-reference master-reference="page2"/> + <fo:repeatable-page-master-reference master-reference="page"/> + </fo:page-sequence-master> + </fo:layout-master-set> + <fo:page-sequence master-reference="pages"> + <fo:flow flow-name="xsl-region-body" text-align="justify"> + <fo:block>Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod + tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et + accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus + est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed + diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam + voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd + gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit + amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et + dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores + et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit + amet.</fo:block> + </fo:flow> + </fo:page-sequence> + </fo:root> + </fo> + <checks> + <eval expected="300000" xpath="//pageViewport[1]//flow/block/@ipd"/> + <eval expected="140000" xpath="//pageViewport[2]//flow[1]/block/@ipd"/> + <eval expected="140000" xpath="//pageViewport[2]//flow[2]/block/@ipd"/> + <eval expected="300000" xpath="//pageViewport[3]//flow/block/@ipd"/> + </checks> +</testcase> diff --git a/test/layoutengine/standard-testcases/flow_changing-ipd_last-page_1.xml b/test/layoutengine/standard-testcases/flow_changing-ipd_last-page_1.xml new file mode 100644 index 000000000..5024cd2d0 --- /dev/null +++ b/test/layoutengine/standard-testcases/flow_changing-ipd_last-page_1.xml @@ -0,0 +1,58 @@ +<?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 that the definition of a special page-master for the last page with a + different width that the previous "rest" page causes FOP to redo the line breaking layout. + </p> + </info> + <fo> +<fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format"> + <fo:layout-master-set> + <fo:simple-page-master master-name="Page-Portrait" page-width="8.5in" page-height="11in" margin-bottom="0in" margin-right="0in" margin-top="0in" margin-left="0in"> + <fo:region-body margin-bottom="0.5in" margin-right="0.5in" margin-top="0.5in" margin-left="0.5in" region-name="letterPageBody"/> + </fo:simple-page-master> + <fo:simple-page-master master-name="Page_Landscape" page-width="11in" page-height="8.5in" margin-bottom="0in" margin-right="0in" margin-top="0in" margin-left="0in"> + <fo:region-body margin-bottom="0.5in" margin-right="0.5in" margin-top="0.5in" margin-left="0.5in" region-name="letterPageBody"/> + </fo:simple-page-master> + <fo:page-sequence-master master-name="LetterPages"> + <fo:repeatable-page-master-alternatives> + <fo:conditional-page-master-reference page-position="first" master-reference="Page-Portrait"/> + <fo:conditional-page-master-reference master-reference="Page_Landscape" page-position="rest"/> + <fo:conditional-page-master-reference master-reference="Page-Portrait" page-position="last"/> + </fo:repeatable-page-master-alternatives> + </fo:page-sequence-master> + </fo:layout-master-set> + <fo:page-sequence master-reference="LetterPages"> + <fo:flow flow-name="letterPageBody"> + <fo:block>This is just some generic text to use for testing. This is just some generic text to use for testing. This is just some generic text to use for testing. This is just some generic text to use for testing. This is just some generic text to use for testing. This is just some generic text to use for testing. This is just some generic text to use for testing. This is just some generic text to use for testing. </fo:block> + <fo:block break-before="page"/> + <fo:block>This is just some generic text to use for testing. This is just some generic text to use for testing. This is just some generic text to use for testing. This is just some generic text to use for testing. This is just some generic text to use for testing. This is just some generic text to use for testing. This is just some generic text to use for testing. This is just some generic text to use for testing. </fo:block> + <fo:block break-before="page"/> + <fo:block>This is just some generic text to use for testing. This is just some generic text to use for testing. This is just some generic text to use for testing. This is just some generic text to use for testing. This is just some generic text to use for testing. This is just some generic text to use for testing. This is just some generic text to use for testing. This is just some generic text to use for testing. </fo:block> + <fo:block>Check this works!</fo:block> + </fo:flow> + </fo:page-sequence> +</fo:root> + </fo> + <checks> + <eval expected="is just some generic text to use for testing. This is just some generic text to use for testing. This is just" xpath="//pageViewport[3]//flow/block[1]/lineArea[2]//text"/> + </checks> +</testcase> diff --git a/test/layoutengine/standard-testcases/flow_changing-ipd_last-page_2.xml b/test/layoutengine/standard-testcases/flow_changing-ipd_last-page_2.xml new file mode 100644 index 000000000..c636d3980 --- /dev/null +++ b/test/layoutengine/standard-testcases/flow_changing-ipd_last-page_2.xml @@ -0,0 +1,54 @@ +<?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 that the definition of a special page-master for the last page with a + different width that the previous "rest" page causes FOP to redo the line breaking layout. + </p> + </info> + <fo> +<fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format"> + <fo:layout-master-set> + <fo:simple-page-master master-name="Page-Portrait" page-width="3in" page-height="4.5in" margin-bottom="0in" margin-right="0in" margin-top="0in" margin-left="0in"> + <fo:region-body margin-bottom="0.5in" margin-right="0.5in" margin-top="0.5in" margin-left="0.5in" region-name="letterPageBody"/> + </fo:simple-page-master> + <fo:simple-page-master master-name="Page_Landscape" page-width="4.5in" page-height="3in" margin-bottom="0in" margin-right="0in" margin-top="0in" margin-left="0in"> + <fo:region-body margin-bottom="0.5in" margin-right="0.5in" margin-top="0.5in" margin-left="0.5in" region-name="letterPageBody"/> + </fo:simple-page-master> + <fo:page-sequence-master master-name="LetterPages"> + <fo:repeatable-page-master-alternatives> + <fo:conditional-page-master-reference page-position="first" master-reference="Page-Portrait"/> + <fo:conditional-page-master-reference master-reference="Page_Landscape" page-position="rest"/> + <fo:conditional-page-master-reference master-reference="Page-Portrait" page-position="last"/> + </fo:repeatable-page-master-alternatives> + </fo:page-sequence-master> + </fo:layout-master-set> + <fo:page-sequence master-reference="LetterPages"> + <fo:flow flow-name="letterPageBody"> + <fo:block>This is just some generic text to use for testing. This is just some generic text to use for testing. This is just some generic text to use for testing. This is just some generic text to use for testing. This is just some generic text to use for testing. This is just some generic text to use for testing. This is just some generic text to use for testing. This is just some generic text to use for testing. This is just some generic text to use for testing. This is just some generic text to use for testing. This is just some generic text to use for testing. This is just some generic text to use for testing. This is just some generic text to use for testing. This is just some generic text to use for testing. This is just some generic text to use for testing. This is just some generic text to use for testing. This is just some generic text to use for testing. This is just some generic text to use for testing. This is just some generic text to use for testing. This is just some generic text to use for testing. This is just some generic text to use for testing. This is just some generic text to use for testing. This is just some generic text to use for testing. This is just some generic text to use for testing. </fo:block> + <fo:block>Check this works!</fo:block> + </fo:flow> + </fo:page-sequence> +</fo:root> + </fo> + <checks> + <eval expected="is just some generic text" xpath="//pageViewport[3]//flow/block[1]/lineArea[2]//text"/> + </checks> +</testcase> diff --git a/test/layoutengine/standard-testcases/flow_changing-ipd_last-page_3.xml b/test/layoutengine/standard-testcases/flow_changing-ipd_last-page_3.xml new file mode 100644 index 000000000..b683d320c --- /dev/null +++ b/test/layoutengine/standard-testcases/flow_changing-ipd_last-page_3.xml @@ -0,0 +1,55 @@ +<?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 that the definition of a special page-master for the last page with a + different width that the previous "rest" page causes FOP to redo the line breaking layout. + </p> + </info> + <fo> +<fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format"> + <fo:layout-master-set> + <fo:simple-page-master master-name="Page-Portrait" page-width="3in" page-height="4.5in" margin-bottom="0in" margin-right="0in" margin-top="0in" margin-left="0in"> + <fo:region-body margin-bottom="0.5in" margin-right="0.5in" margin-top="0.5in" margin-left="0.5in" region-name="letterPageBody"/> + </fo:simple-page-master> + <fo:simple-page-master master-name="Page_Landscape" page-width="4.5in" page-height="3in" margin-bottom="0in" margin-right="0in" margin-top="0in" margin-left="0in"> + <fo:region-body margin-bottom="0.5in" margin-right="0.5in" margin-top="0.5in" margin-left="0.5in" region-name="letterPageBody"/> + </fo:simple-page-master> + <fo:page-sequence-master master-name="LetterPages"> + <fo:repeatable-page-master-alternatives> + <fo:conditional-page-master-reference page-position="first" master-reference="Page-Portrait"/> + <fo:conditional-page-master-reference master-reference="Page_Landscape" page-position="rest"/> + <fo:conditional-page-master-reference master-reference="Page-Portrait" page-position="last"/> + </fo:repeatable-page-master-alternatives> + </fo:page-sequence-master> + </fo:layout-master-set> + <fo:page-sequence master-reference="LetterPages"> + <fo:flow flow-name="letterPageBody"> + <fo:block>This is just some generic text to use for testing. This is just some generic text to use for testing. This is just some generic text to use for testing. This is just some generic text to use for testing. This is just some generic text to use for testing. This is just some generic text to use for testing. This is just some generic text to use for testing. This is just some generic text to use for testing. This is just some generic text to use for testing. This is just some generic text to use for testing. This is just some generic text to use for testing. This is just some generic text to use for testing. This is just some generic text to use for testing. This is just some generic text to use for testing. This is just some generic text to use for testing. This is just some generic text to use for testing. This is just some generic text to use for testing. This is just some generic text to use for testing.</fo:block> + <fo:block>This is just some generic text to use for testing. This is just some generic text to use for testing. This is just some generic text to use for testing. This is just some generic text to use for testing. This is just some generic text to use for testing. This is just some generic text to use for testing.</fo:block> + <fo:block>Check this works!</fo:block> + </fo:flow> + </fo:page-sequence> +</fo:root> + </fo> + <checks> + <eval expected="text to use for testing. This" xpath="//pageViewport[3]//flow/block[1]/lineArea[2]//text"/> + </checks> +</testcase> diff --git a/test/layoutengine/standard-testcases/flow_changing-ipd_last-page_4.xml b/test/layoutengine/standard-testcases/flow_changing-ipd_last-page_4.xml new file mode 100644 index 000000000..ab209a14b --- /dev/null +++ b/test/layoutengine/standard-testcases/flow_changing-ipd_last-page_4.xml @@ -0,0 +1,56 @@ +<?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 that the definition of a special page-master for the last page with a + different width that the previous "rest" page causes FOP to redo the line breaking layout. + </p> + </info> + <fo> +<fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format"> + <fo:layout-master-set> + <fo:simple-page-master master-name="Page-First" page-width="3.5in" page-height="3.5in" margin-bottom="0in" margin-right="0in" margin-top="0in" margin-left="0in"> + <fo:region-body background-color="yellow" margin-bottom="0.5in" margin-right="0.5in" margin-top="0.5in" margin-left="0.5in" region-name="letterPageBody"/> + </fo:simple-page-master> + <fo:simple-page-master master-name="Page-Rest" page-width="3.5in" page-height="3.5in" margin-bottom="0in" margin-right="0in" margin-top="0in" margin-left="0in"> + <fo:region-body background-color="orange" margin-bottom="0.5in" margin-right="0.5in" margin-top="0.5in" margin-left="0.5in" region-name="letterPageBody"/> + </fo:simple-page-master> + <fo:simple-page-master master-name="Page-Last" page-width="4.0in" page-height="3.5in" margin-bottom="0in" margin-right="0in" margin-top="0in" margin-left="0in"> + <fo:region-body background-color="pink" margin-bottom="1.5in" margin-right="0.5in" margin-top="0.5in" margin-left="0.5in" region-name="letterPageBody"/> + </fo:simple-page-master> + <fo:page-sequence-master master-name="LetterPages"> + <fo:repeatable-page-master-alternatives> + <fo:conditional-page-master-reference page-position="first" master-reference="Page-First"/> + <fo:conditional-page-master-reference master-reference="Page-Rest" page-position="rest"/> + <fo:conditional-page-master-reference master-reference="Page-Last" page-position="last"/> + </fo:repeatable-page-master-alternatives> + </fo:page-sequence-master> + </fo:layout-master-set> + <fo:page-sequence master-reference="LetterPages"> + <fo:flow flow-name="letterPageBody"> + <fo:block>This is just some generic text to use for testing. This is just some generic text to use for testing. This is just some generic text to use for testing. This is just some generic text to use for testing. This is just some generic text to use for testing. This is just some generic text to use for testing. This is just some generic text to use for testing. This is just some generic text to use for testing. This is just some generic text to use for testing. This is just some generic text to use for testing. This is just some generic text to use for testing. This is just some generic text to use for testing. This is just some generic text to use for testing. This is just some generic text to use for testing. This is just some generic text to use for testing. This is just some generic text to use for testing. This is just some generic text to use for testing. This is just some generic text to use for testing. This is just some generic text to use for testing. This is just some generic text to use for testing.</fo:block> + </fo:flow> + </fo:page-sequence> +</fo:root> + </fo> + <checks> + <eval expected="testing. This is just some generic text to" xpath="//pageViewport[3]//flow/block[1]/lineArea[2]//text"/> + </checks> +</testcase> diff --git a/test/layoutengine/standard-testcases/flow_changing-ipd_last-page_5.xml b/test/layoutengine/standard-testcases/flow_changing-ipd_last-page_5.xml new file mode 100644 index 000000000..1deb24a11 --- /dev/null +++ b/test/layoutengine/standard-testcases/flow_changing-ipd_last-page_5.xml @@ -0,0 +1,99 @@ +<?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 that the definition of a special page-master for the last page with a + different width that the previous "rest" page causes FOP to redo the line breaking layout. + </p> + </info> + <fo> + + <fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format" xmlns:fox="http://xmlgraphics.apache.org/fop/extensions" xmlns:svg="http://www.w3.org/2000/svg" xmlns:th="http://www.thunderhead.com/XSL/Extensions" xmlns:rx="http://www.renderx.com/XSL/Extensions" xmlns:ps="http://xmlgraphics.apache.org/fop/postscript"> + <fo:layout-master-set> + <fo:simple-page-master margin-left="0mm" master-name="PageOneFront" page-width="210mm" page-height="297mm" margin-bottom="6mm" margin-right="10mm" margin-top="0mm"> + + <fo:region-body margin-right="60mm" margin-left="25mm" margin-bottom="15mm" margin-top="44mm" region-name="letterPageBody"/> + + </fo:simple-page-master> + <fo:simple-page-master master-name="PageRest" page-width="210mm" page-height="297mm" margin-bottom="6mm" margin-right="25mm" margin-top="0mm" margin-left="25mm"> + <fo:region-body margin-top="44mm" margin-bottom="15mm" margin-right="0mm" margin-left="0mm" region-name="letterPageBody"/> + + </fo:simple-page-master> + + <fo:page-sequence-master master-name="LetterPages"> + <fo:repeatable-page-master-alternatives> + <fo:conditional-page-master-reference page-position="first" master-reference="PageOneFront"/> + <fo:conditional-page-master-reference page-position="rest" master-reference="PageRest"/> + <fo:conditional-page-master-reference blank-or-not-blank="not-blank" page-position="last" master-reference="PageRest"/> + <fo:conditional-page-master-reference blank-or-not-blank="blank" 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="letterPageBody"> + <fo:block-container min-height="50mm"> + <fo:block> + + </fo:block> + </fo:block-container> + </fo:flow> + </fo:page-sequence> + <fo:page-sequence format="1" id="th_default_sequence2" initial-page-number="auto" force-page-count="auto" master-reference="LetterPages"> + + <fo:flow flow-name="letterPageBody"> + <fo:block-container min-height="50mm"> + <fo:block> + <fo:table table-layout="fixed" width="100%"> + <fo:table-column column-width="98%" column-number="1"/> + <fo:table-column column-width="1%" column-number="2"/> + <fo:table-column column-width="1%" column-number="3"/> + <fo:table-body> + <fo:table-row height="10mm"> + <fo:table-cell number-columns-spanned="3"> + <fo:block>test</fo:block> + </fo:table-cell> + </fo:table-row> + <fo:table-row height="29.5mm"> + <fo:table-cell column-number="1"> + <fo:block/> + </fo:table-cell> + <fo:table-cell column-number="2"> + <fo:block/> + </fo:table-cell> + <fo:table-cell column-number="3"> + <fo:block/> + </fo:table-cell> + </fo:table-row> + </fo:table-body> + </fo:table> + </fo:block> + </fo:block-container> + + </fo:flow> + </fo:page-sequence> + </fo:root> + </fo> + <checks> + <eval expected="test" xpath="//word"/> + </checks> +</testcase> diff --git a/test/layoutengine/standard-testcases/flow_changing-ipd_last-page_6.xml b/test/layoutengine/standard-testcases/flow_changing-ipd_last-page_6.xml new file mode 100644 index 000000000..bcd6c30ad --- /dev/null +++ b/test/layoutengine/standard-testcases/flow_changing-ipd_last-page_6.xml @@ -0,0 +1,64 @@ +<?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 that the definition of a special page-master for the last page with a + different width that the previous "rest" page causes FOP to redo the line breaking layout. + </p> + </info> + <fo> + +<fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format" xmlns:fox="http://xmlgraphics.apache.org/fop/extensions" xmlns:svg="http://www.w3.org/2000/svg" xmlns:th="http://www.thunderhead.com/XSL/Extensions" xmlns:rx="http://www.renderx.com/XSL/Extensions"> + <fo:layout-master-set> + <fo:simple-page-master margin-right="10mm" margin-left="0mm" margin-bottom="6mm" master-name="PageFront" page-width="210mm" page-height="297mm" margin-top="0mm"> + <fo:region-body background-color="blue" margin-right="60mm" margin-left="25mm" margin-top="44mm" margin-bottom="15mm" region-name="letterPageBody"/> + </fo:simple-page-master> + <fo:simple-page-master margin-right="25mm" margin-left="25mm" margin-bottom="6mm" master-name="PageRest" page-width="210mm" page-height="297mm" margin-top="0mm"> + <fo:region-body background-color="red" margin-top="44mm" margin-bottom="15mm" margin-right="0mm" margin-left="0mm" region-name="letterPageBody"/> + </fo:simple-page-master> + <fo:simple-page-master margin-right="25mm" margin-left="25mm" margin-bottom="6mm" master-name="PageLast" page-width="210mm" page-height="297mm" margin-top="0mm"> + <fo:region-body background-color="green" margin-top="44mm" margin-bottom="15mm" margin-right="0mm" margin-left="0mm" region-name="letterPageBody"/> + </fo:simple-page-master> + <fo:page-sequence-master master-name="LetterPages"> + <fo:repeatable-page-master-alternatives> + <fo:conditional-page-master-reference page-position="first" master-reference="PageFront"/> + <fo:conditional-page-master-reference blank-or-not-blank="not-blank" page-position="rest" master-reference="PageRest"/> + <fo:conditional-page-master-reference blank-or-not-blank="not-blank" 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>page 1</fo:block> + </fo:flow> + </fo:page-sequence> + <fo:page-sequence format="1" id="th_default_sequence2" initial-page-number="auto" force-page-count="auto" master-reference="LetterPages"> + <fo:flow flow-name="letterPageBody"> + <fo:block>page 2</fo:block> + <fo:block break-before="page">page 3</fo:block> + </fo:flow> + </fo:page-sequence> +</fo:root> + + </fo> + <checks> + <eval expected="color=#008000" xpath="/areaTree/pageSequence[2]/pageViewport[2]/page/regionViewport[1]/@background"/> + </checks> +</testcase> diff --git a/test/layoutengine/standard-testcases/flow_changing-ipd_last-page_7.xml b/test/layoutengine/standard-testcases/flow_changing-ipd_last-page_7.xml new file mode 100644 index 000000000..4e5f048e8 --- /dev/null +++ b/test/layoutengine/standard-testcases/flow_changing-ipd_last-page_7.xml @@ -0,0 +1,154 @@ +<?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 that the definition of a special page-master for the last page with a + different width that the previous "rest" page causes FOP to redo the line breaking layout. + </p> + </info> + <fo> + + <fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format"> + <fo:layout-master-set> + <fo:simple-page-master margin-left="0mm" margin-right="10mm" margin-bottom="6mm" master-name="PageFront" page-width="210mm" page-height="297mm" margin-top="0mm"> + <fo:region-body margin-right="60mm" margin-left="25mm" margin-top="44mm" margin-bottom="15mm" region-name="letterPageBody"/> + + </fo:simple-page-master> + <fo:simple-page-master master-name="PageRest" page-width="210mm" page-height="297mm" margin-bottom="6mm" margin-right="25mm" margin-top="0mm" margin-left="25mm"> + <fo:region-body margin-top="44mm" margin-bottom="15mm" margin-right="0mm" margin-left="0mm" region-name="letterPageBody"/> + + </fo:simple-page-master> + <fo:simple-page-master master-name="PageFrontLogoRight" margin-right="10mm" margin-left="25mm" margin-bottom="6mm" page-width="210mm" page-height="297mm" margin-top="0mm"> + <fo:region-body margin-right="60mm" margin-top="44mm" margin-left="0" margin-bottom="15mm" region-name="letterPageBody"/> + + </fo:simple-page-master> + <fo:simple-page-master master-name="PageFrontRestMediaType" margin-left="0mm" margin-right="10mm" margin-bottom="6mm" page-width="210mm" page-height="297mm" margin-top="0mm"> + <fo:region-body margin-right="60mm" margin-top="44mm" margin-left="25mm" margin-bottom="15mm" region-name="letterPageBody"/> + + </fo:simple-page-master> + <fo:page-sequence-master master-name="LetterPages"> + <fo:repeatable-page-master-alternatives> + <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="PageRest"/> + </fo:repeatable-page-master-alternatives> + </fo:page-sequence-master> + <fo:page-sequence-master master-name="LetterPagesMYLocal"> + <fo:repeatable-page-master-alternatives> + <fo:conditional-page-master-reference master-reference="PageFrontRestMediaType" page-position="first"/> + <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="letterPageBody"> + <fo:block> + + <fo:block page-break-after="always"> + <fo:leader/> + </fo:block> + + <fo:block> + test + </fo:block> + + </fo:block> + </fo:flow> + </fo:page-sequence> + <fo:page-sequence format="1" id="th_default_sequence4" master-reference="LetterPagesMYLocal" initial-page-number="auto" force-page-count="auto"> + + <fo:flow flow-name="letterPageBody"> + + <fo:block> + + <fo:block page-break-after="always"> + <fo:leader/> + </fo:block> + <fo:block page-break-after="always"> + <fo:leader/> + </fo:block> + <fo:table table-layout="fixed" width="100%"> + <fo:table-column column-width="proportional-column-width(100)" column-number="1"/> + <fo:table-body> + <fo:table-row> + <fo:table-cell> + <fo:block> + <fo:table table-layout="fixed" width="100%"> + <fo:table-column column-width="proportional-column-width(1)" column-number="1"/> + <fo:table-column column-width="proportional-column-width(28.49)" column-number="2"/> + <fo:table-column column-width="proportional-column-width(21.55)" column-number="3"/> + <fo:table-column column-width="proportional-column-width(47.96)" column-number="4"/> + <fo:table-column column-width="proportional-column-width(1)" column-number="5"/> + <fo:table-body> + <fo:table-row height="16px"> + <fo:table-cell> + <fo:block> + <fo:block> + <fo:leader/> + </fo:block> + </fo:block> + </fo:table-cell> + <fo:table-cell number-columns-spanned="3"> + <fo:block> + test + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block> + <fo:block> + <fo:leader/> + </fo:block> + </fo:block> + </fo:table-cell> + </fo:table-row> + <fo:table-row> + <fo:table-cell> + <fo:block> + <fo:block> + <fo:leader/> + </fo:block> + </fo:block> + </fo:table-cell> + + </fo:table-row> + + + </fo:table-body> + </fo:table> + + </fo:block> + </fo:table-cell> + </fo:table-row> + </fo:table-body> + </fo:table> + </fo:block> + + </fo:flow> + </fo:page-sequence> + </fo:root> + + </fo> + <checks> + <eval expected="test" xpath="//word"/> + </checks> +</testcase> diff --git a/test/layoutengine/standard-testcases/flow_changing-ipd_last-page_8.xml b/test/layoutengine/standard-testcases/flow_changing-ipd_last-page_8.xml new file mode 100644 index 000000000..53c83e847 --- /dev/null +++ b/test/layoutengine/standard-testcases/flow_changing-ipd_last-page_8.xml @@ -0,0 +1,70 @@ +<?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 that the definition of a special page-master for the last page with a + different width that the previous "rest" page causes FOP to redo the line breaking layout. + </p> + </info> + <fo> +<fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format"> + <fo:layout-master-set> + <fo:simple-page-master master-name="Page-Portrait" page-width="8.5in" page-height="11in" margin-bottom="0in" margin-right="0in" margin-top="0in" margin-left="0in"> + <fo:region-body margin-bottom="0.5in" margin-right="0.5in" margin-top="0.5in" margin-left="0.5in" region-name="letterPageBody"/> + </fo:simple-page-master> + <fo:simple-page-master master-name="Page_Landscape" page-width="11in" page-height="8.5in" margin-bottom="0in" margin-right="0in" margin-top="0in" margin-left="0in"> + <fo:region-body margin-bottom="0.5in" margin-right="0.5in" margin-top="0.5in" margin-left="0.5in" region-name="letterPageBody"/> + </fo:simple-page-master> + <fo:page-sequence-master master-name="LetterPages"> + <fo:repeatable-page-master-alternatives> + <fo:conditional-page-master-reference page-position="first" master-reference="Page-Portrait"/> + <fo:conditional-page-master-reference master-reference="Page_Landscape" page-position="rest"/> + <fo:conditional-page-master-reference master-reference="Page-Portrait" page-position="last"/> + </fo:repeatable-page-master-alternatives> + </fo:page-sequence-master> + </fo:layout-master-set> + <fo:page-sequence master-reference="LetterPages"> + <fo:flow flow-name="letterPageBody"> + <fo:block>This is just some generic text to use for testing. This is just some generic text to use for testing. This is just some generic text to use for testing. This is just some generic text to use for testing. This is just some generic text to use for testing. This is just some generic text to use for testing. This is just some generic text to use for testing. This is just some generic text to use for testing. </fo:block> + <fo:block break-before="page"/> + <fo:block>This is just some generic text to use for testing. This is just some generic text to use for testing. This is just some generic text to use for testing. This is just some generic text to use for testing. This is just some generic text to use for testing. This is just some generic text to use for testing. This is just some generic text to use for testing. This is just some generic text to use for testing. </fo:block> + <fo:block break-before="page"/> + <fo:table> + <fo:table-body> + <fo:table-row> + <fo:table-cell> + <fo:block></fo:block> + </fo:table-cell> + </fo:table-row> + <fo:table-row> + <fo:table-cell> + <fo:block>A table with first row empty after change in IPD and forced break before page...</fo:block> + </fo:table-cell> + </fo:table-row> + </fo:table-body> + </fo:table> + </fo:flow> + </fo:page-sequence> +</fo:root> + </fo> + <checks> + <eval expected="A table with first row empty after change in IPD and forced break before page..." xpath="//pageViewport[3]//lineArea"/> + </checks> +</testcase> diff --git a/test/layoutengine/standard-testcases/flow_changing-ipd_last-page_9.xml b/test/layoutengine/standard-testcases/flow_changing-ipd_last-page_9.xml new file mode 100644 index 000000000..2517aaa37 --- /dev/null +++ b/test/layoutengine/standard-testcases/flow_changing-ipd_last-page_9.xml @@ -0,0 +1,70 @@ +<?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 that the definition of a special page-master for the last page with a + different width that the previous "rest" page causes FOP to redo the line breaking layout. + </p> + </info> + <fo> +<fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format"> + <fo:layout-master-set> + <fo:simple-page-master master-name="Page-Portrait" page-width="8.5in" page-height="11in" margin-bottom="0in" margin-right="0in" margin-top="0in" margin-left="0in"> + <fo:region-body margin-bottom="0.5in" margin-right="0.5in" margin-top="0.5in" margin-left="0.5in" region-name="letterPageBody"/> + </fo:simple-page-master> + <fo:simple-page-master master-name="Page_Landscape" page-width="11in" page-height="8.5in" margin-bottom="0in" margin-right="0in" margin-top="0in" margin-left="0in"> + <fo:region-body margin-bottom="0.5in" margin-right="0.5in" margin-top="0.5in" margin-left="0.5in" region-name="letterPageBody"/> + </fo:simple-page-master> + <fo:page-sequence-master master-name="LetterPages"> + <fo:repeatable-page-master-alternatives> + <fo:conditional-page-master-reference page-position="first" master-reference="Page-Portrait"/> + <fo:conditional-page-master-reference master-reference="Page_Landscape" page-position="rest"/> + <fo:conditional-page-master-reference master-reference="Page-Portrait" page-position="last"/> + </fo:repeatable-page-master-alternatives> + </fo:page-sequence-master> + </fo:layout-master-set> + <fo:page-sequence master-reference="LetterPages"> + <fo:flow flow-name="letterPageBody"> + <fo:block>This is just some generic text to use for testing. This is just some generic text to use for testing. This is just some generic text to use for testing. This is just some generic text to use for testing. This is just some generic text to use for testing. This is just some generic text to use for testing. This is just some generic text to use for testing. This is just some generic text to use for testing. </fo:block> + <fo:block break-before="page"/> + <fo:block>This is just some generic text to use for testing. This is just some generic text to use for testing. This is just some generic text to use for testing. This is just some generic text to use for testing. This is just some generic text to use for testing. This is just some generic text to use for testing. This is just some generic text to use for testing. This is just some generic text to use for testing. </fo:block> + <fo:block break-after="page"/> + <fo:table> + <fo:table-body> + <fo:table-row> + <fo:table-cell> + <fo:block></fo:block> + </fo:table-cell> + </fo:table-row> + <fo:table-row> + <fo:table-cell> + <fo:block>A table with first row empty after change in IPD and forced break after page...</fo:block> + </fo:table-cell> + </fo:table-row> + </fo:table-body> + </fo:table> + </fo:flow> + </fo:page-sequence> +</fo:root> + </fo> + <checks> + <eval expected="A table with first row empty after change in IPD and forced break after page..." xpath="//pageViewport[3]//lineArea"/> + </checks> +</testcase> diff --git a/test/layoutengine/standard-testcases/flow_changing-ipd_no-last-page.xml b/test/layoutengine/standard-testcases/flow_changing-ipd_no-last-page.xml new file mode 100644 index 000000000..bf9441371 --- /dev/null +++ b/test/layoutengine/standard-testcases/flow_changing-ipd_no-last-page.xml @@ -0,0 +1,81 @@ +<?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 that the definition of a special page-master for the last page does not + interfere with the changing IPD code. + </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 margin-right="0mm" margin-top="4mm" margin-left="7mm" margin-bottom="8mm" master-name="PageFront" page-width="210mm" page-height="297mm"> + <fo:region-body margin-right="20mm" region-name="letterPageBody" margin-top="46mm" margin-left="26mm" margin-bottom="10mm"/> + </fo:simple-page-master> + <fo:simple-page-master margin-right="0mm" margin-top="4mm" margin-left="7mm" master-name="PageRest" page-width="210mm" page-height="297mm" margin-bottom="8mm"> + <fo:region-body margin-right="20mm" margin-top="35mm" margin-left="13mm" region-name="letterPageBody" margin-bottom="10mm"/> + </fo:simple-page-master> + <fo:simple-page-master margin-right="0mm" master-name="PageBlank" margin-top="4mm" margin-left="7mm" page-width="210mm" page-height="297mm" margin-bottom="8mm"> + <fo:region-body margin-right="20mm" margin-top="38mm" margin-bottom="12mm" margin-left="26mm" region-name="letterPageBody"/> + </fo:simple-page-master> + <fo:page-sequence-master master-name="LetterPages"> + <fo:repeatable-page-master-alternatives> + <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 blank-or-not-blank="not-blank" odd-or-even="even" page-position="last" master-reference="PageRest"/> + <fo:conditional-page-master-reference blank-or-not-blank="blank" odd-or-even="even" page-position="last" master-reference="PageBlank"/> + </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="end-on-even" master-reference="LetterPages"> + + <fo:flow flow-name="letterPageBody"> + <fo:block> + <fo:table table-layout="fixed"> + <fo:table-body> + <fo:table-row height="30mm"> + <fo:table-cell width="157mm"> + <fo:block/> + </fo:table-cell> + </fo:table-row> + <fo:table-row height="199mm" display-align="after"> + <fo:table-cell width="157mm"> + <fo:block margin-bottom="0mm"/> + </fo:table-cell> + </fo:table-row> + </fo:table-body> + </fo:table> + </fo:block> + <fo:block> + <fo:block font-size="9pt"> + <fo:leader/> + <fo:block break-before="page"/> + </fo:block> + </fo:block> + + </fo:flow> + </fo:page-sequence> + </fo:root> + </fo> + <checks> + <eval expected="" xpath="//pageViewport[1]//flow/block[2]//text"/> + <eval expected="" xpath="//pageViewport[2]//flow/block[1]//text"/> + </checks> +</testcase> |