diff options
Diffstat (limited to 'test')
-rw-r--r-- | test/layoutengine/testcases/breaks1.xml | 38 | ||||
-rw-r--r-- | test/layoutengine/testcases/breaks2.xml | 38 | ||||
-rw-r--r-- | test/layoutengine/testcases/keep-together1.xml | 143 | ||||
-rw-r--r-- | test/layoutengine/testcases/keep-with-next1.xml | 95 | ||||
-rw-r--r-- | test/layoutengine/testcases/keep-with-previous1.xml | 95 | ||||
-rw-r--r-- | test/layoutengine/testcases/multi-column1.xml | 72 | ||||
-rw-r--r-- | test/layoutengine/testcases/multi-column2.xml | 76 | ||||
-rw-r--r-- | test/layoutengine/testcases/page-master3.xml | 14 | ||||
-rw-r--r-- | test/layoutengine/testcases/page-master4.xml | 64 |
9 files changed, 591 insertions, 44 deletions
diff --git a/test/layoutengine/testcases/breaks1.xml b/test/layoutengine/testcases/breaks1.xml index d0a5d8734..760e0697e 100644 --- a/test/layoutengine/testcases/breaks1.xml +++ b/test/layoutengine/testcases/breaks1.xml @@ -31,35 +31,35 @@ <fo:page-sequence master-reference="normal" white-space-collapse="true"> <fo:flow flow-name="xsl-region-body"> <fo:block>line1</fo:block> - <fo:block break-before="column">line2</fo:block> + <fo:block break-before="column">line2 break-before="column"</fo:block> <fo:block>line3</fo:block> - <fo:block break-before="page">line4</fo:block> + <fo:block break-before="page">line4 break-before="page"</fo:block> <fo:block>line5</fo:block> - <fo:block break-before="even-page">line6</fo:block> + <fo:block break-before="even-page">line6 break-before="even-page"</fo:block> <fo:block>line7</fo:block> - <fo:block break-before="even-page">line8</fo:block> + <fo:block break-before="even-page">line8 break-before="even-page"</fo:block> <fo:block>line9</fo:block> - <fo:block break-before="odd-page">line10</fo:block> + <fo:block break-before="odd-page">line10 break-before="odd-page"</fo:block> <fo:block>line11</fo:block> - <fo:block break-before="odd-page">line12</fo:block> + <fo:block break-before="odd-page">line12 break-before="odd-page"</fo:block> <fo:block>line13</fo:block> </fo:flow> </fo:page-sequence> </fo:root> </fo> <checks> - <eval expected="1" xpath="//lineArea[. = 'line1']/ancestor::pageViewport/@nr"/> - <eval expected="2" xpath="//lineArea[. = 'line2']/ancestor::pageViewport/@nr"/> - <eval expected="2" xpath="//lineArea[. = 'line3']/ancestor::pageViewport/@nr"/> - <eval expected="3" xpath="//lineArea[. = 'line4']/ancestor::pageViewport/@nr"/> - <eval expected="3" xpath="//lineArea[. = 'line5']/ancestor::pageViewport/@nr"/> - <eval expected="4" xpath="//lineArea[. = 'line6']/ancestor::pageViewport/@nr"/> - <eval expected="4" xpath="//lineArea[. = 'line7']/ancestor::pageViewport/@nr"/> - <eval expected="6" xpath="//lineArea[. = 'line8']/ancestor::pageViewport/@nr"/> - <eval expected="6" xpath="//lineArea[. = 'line9']/ancestor::pageViewport/@nr"/> - <eval expected="7" xpath="//lineArea[. = 'line10']/ancestor::pageViewport/@nr"/> - <eval expected="7" xpath="//lineArea[. = 'line11']/ancestor::pageViewport/@nr"/> - <eval expected="9" xpath="//lineArea[. = 'line12']/ancestor::pageViewport/@nr"/> - <eval expected="9" xpath="//lineArea[. = 'line13']/ancestor::pageViewport/@nr"/> + <eval expected="1" xpath="//lineArea[starts-with(., 'line1')]/ancestor::pageViewport/@nr"/> + <eval expected="2" xpath="//lineArea[starts-with(., 'line2')]/ancestor::pageViewport/@nr"/> + <eval expected="2" xpath="//lineArea[starts-with(., 'line3')]/ancestor::pageViewport/@nr"/> + <eval expected="3" xpath="//lineArea[starts-with(., 'line4')]/ancestor::pageViewport/@nr"/> + <eval expected="3" xpath="//lineArea[starts-with(., 'line5')]/ancestor::pageViewport/@nr"/> + <eval expected="4" xpath="//lineArea[starts-with(., 'line6')]/ancestor::pageViewport/@nr"/> + <eval expected="4" xpath="//lineArea[starts-with(., 'line7')]/ancestor::pageViewport/@nr"/> + <eval expected="6" xpath="//lineArea[starts-with(., 'line8')]/ancestor::pageViewport/@nr"/> + <eval expected="6" xpath="//lineArea[starts-with(., 'line9')]/ancestor::pageViewport/@nr"/> + <eval expected="7" xpath="//lineArea[starts-with(., 'line10')]/ancestor::pageViewport/@nr"/> + <eval expected="7" xpath="//lineArea[starts-with(., 'line11')]/ancestor::pageViewport/@nr"/> + <eval expected="9" xpath="//lineArea[starts-with(., 'line12')]/ancestor::pageViewport/@nr"/> + <eval expected="9" xpath="//lineArea[starts-with(., 'line13')]/ancestor::pageViewport/@nr"/> </checks> </testcase> diff --git a/test/layoutengine/testcases/breaks2.xml b/test/layoutengine/testcases/breaks2.xml index 943152afd..beab46358 100644 --- a/test/layoutengine/testcases/breaks2.xml +++ b/test/layoutengine/testcases/breaks2.xml @@ -31,35 +31,35 @@ <fo:page-sequence master-reference="normal" white-space-collapse="true"> <fo:flow flow-name="xsl-region-body"> <fo:block break-after="column">line1</fo:block> - <fo:block>line2</fo:block> + <fo:block>line2, last block had break-after="column"</fo:block> <fo:block break-after="page">line3</fo:block> - <fo:block>line4</fo:block> + <fo:block>line4, last block had break-after="page"</fo:block> <fo:block break-after="even-page">line5</fo:block> - <fo:block>line6</fo:block> + <fo:block>line6, last block had break-after="even-page"</fo:block> <fo:block break-after="even-page">line7</fo:block> - <fo:block>line8</fo:block> + <fo:block>line8, last block had break-after="even-page"</fo:block> <fo:block break-after="odd-page">line9</fo:block> - <fo:block>line10</fo:block> + <fo:block>line10, last block had break-after="odd-page"</fo:block> <fo:block break-after="odd-page">line11</fo:block> - <fo:block>line12</fo:block> + <fo:block>line12, last block had break-after="odd-page"</fo:block> <fo:block>line13</fo:block> </fo:flow> </fo:page-sequence> </fo:root> </fo> <checks> - <eval expected="1" xpath="//lineArea[. = 'line1']/ancestor::pageViewport/@nr"/> - <eval expected="2" xpath="//lineArea[. = 'line2']/ancestor::pageViewport/@nr"/> - <eval expected="2" xpath="//lineArea[. = 'line3']/ancestor::pageViewport/@nr"/> - <eval expected="3" xpath="//lineArea[. = 'line4']/ancestor::pageViewport/@nr"/> - <eval expected="3" xpath="//lineArea[. = 'line5']/ancestor::pageViewport/@nr"/> - <eval expected="4" xpath="//lineArea[. = 'line6']/ancestor::pageViewport/@nr"/> - <eval expected="4" xpath="//lineArea[. = 'line7']/ancestor::pageViewport/@nr"/> - <eval expected="6" xpath="//lineArea[. = 'line8']/ancestor::pageViewport/@nr"/> - <eval expected="6" xpath="//lineArea[. = 'line9']/ancestor::pageViewport/@nr"/> - <eval expected="7" xpath="//lineArea[. = 'line10']/ancestor::pageViewport/@nr"/> - <eval expected="7" xpath="//lineArea[. = 'line11']/ancestor::pageViewport/@nr"/> - <eval expected="9" xpath="//lineArea[. = 'line12']/ancestor::pageViewport/@nr"/> - <eval expected="9" xpath="//lineArea[. = 'line13']/ancestor::pageViewport/@nr"/> + <eval expected="1" xpath="//lineArea[starts-with(., 'line1')]/ancestor::pageViewport/@nr"/> + <eval expected="2" xpath="//lineArea[starts-with(., 'line2')]/ancestor::pageViewport/@nr"/> + <eval expected="2" xpath="//lineArea[starts-with(., 'line3')]/ancestor::pageViewport/@nr"/> + <eval expected="3" xpath="//lineArea[starts-with(., 'line4')]/ancestor::pageViewport/@nr"/> + <eval expected="3" xpath="//lineArea[starts-with(., 'line5')]/ancestor::pageViewport/@nr"/> + <eval expected="4" xpath="//lineArea[starts-with(., 'line6')]/ancestor::pageViewport/@nr"/> + <eval expected="4" xpath="//lineArea[starts-with(., 'line7')]/ancestor::pageViewport/@nr"/> + <eval expected="6" xpath="//lineArea[starts-with(., 'line8')]/ancestor::pageViewport/@nr"/> + <eval expected="6" xpath="//lineArea[starts-with(., 'line9')]/ancestor::pageViewport/@nr"/> + <eval expected="7" xpath="//lineArea[starts-with(., 'line10')]/ancestor::pageViewport/@nr"/> + <eval expected="7" xpath="//lineArea[starts-with(., 'line11')]/ancestor::pageViewport/@nr"/> + <eval expected="9" xpath="//lineArea[starts-with(., 'line12')]/ancestor::pageViewport/@nr"/> + <eval expected="9" xpath="//lineArea[starts-with(., 'line13')]/ancestor::pageViewport/@nr"/> </checks> </testcase> diff --git a/test/layoutengine/testcases/keep-together1.xml b/test/layoutengine/testcases/keep-together1.xml new file mode 100644 index 000000000..aa3c8085d --- /dev/null +++ b/test/layoutengine/testcases/keep-together1.xml @@ -0,0 +1,143 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + Copyright 2005 The Apache Software Foundation + + Licensed 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 keep-together. + </p> + <p> + Widows and Orphans are disabled in this test to avoid side-effects. + </p> + </info> + <fo> + <fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format" xmlns:svg="http://www.w3.org/2000/svg" white-space-collapse="true" widows="0" orphans="0"> + <fo:layout-master-set> + <fo:simple-page-master master-name="normal" page-width="5in" page-height="4.5 * 14.4pt"> + <fo:region-body/> + </fo:simple-page-master> + </fo:layout-master-set> + <fo:page-sequence master-reference="normal"> + <fo:flow flow-name="xsl-region-body"> + <fo:block>block1</fo:block> + <fo:block>block2</fo:block> + <fo:block keep-together.within-page="always">block3 + <fo:inline font-style="italic"> + The quick brown fox jumps over the lazy dog. + The quick brown fox jumps over the lazy dog. + The quick brown fox jumps over the lazy dog. + </fo:inline> + </fo:block> + <fo:block>block4</fo:block> + <fo:block>block5</fo:block> + <fo:block keep-together.within-page="always"> + <fo:block>block6</fo:block> + <fo:block>block7</fo:block> + <fo:block>block8</fo:block> + <fo:block>block9</fo:block> + </fo:block> + <fo:block>block10</fo:block> + </fo:flow> + </fo:page-sequence> + <fo:page-sequence master-reference="normal"> + <fo:flow flow-name="xsl-region-body"> + <fo:block>block11</fo:block> + <fo:block>block12</fo:block> + <fo:block keep-together.within-column="always">block13 + <fo:inline font-style="italic"> + The quick brown fox jumps over the lazy dog. + The quick brown fox jumps over the lazy dog. + The quick brown fox jumps over the lazy dog. + </fo:inline> + </fo:block> + <fo:block>block14</fo:block> + <fo:block>block15</fo:block> + <fo:block keep-together.within-column="always"> + <fo:block>block16</fo:block> + <fo:block>block17</fo:block> + <fo:block>block18</fo:block> + <fo:block>block19</fo:block> + </fo:block> + <fo:block>block20</fo:block> + </fo:flow> + </fo:page-sequence> + <fo:page-sequence master-reference="normal"> + <fo:flow flow-name="xsl-region-body"> + <fo:block>block21</fo:block> + <fo:block>block22</fo:block> + <fo:block-container keep-together.within-page="always"> + <fo:block>block23</fo:block> + <fo:block>block24</fo:block> + <fo:block>block25</fo:block> + </fo:block-container> + <fo:block>block26</fo:block> + </fo:flow> + </fo:page-sequence> + <fo:page-sequence master-reference="normal"> + <fo:flow flow-name="xsl-region-body"> + <fo:block>block31</fo:block> + <fo:block>block32</fo:block> + <fo:block keep-together.within-page="always"> + <fo:block-container> + <fo:block>block33</fo:block> + </fo:block-container> + <fo:block>block34</fo:block> + <fo:block>block35</fo:block> + </fo:block> + <fo:block>block36</fo:block> + </fo:flow> + </fo:page-sequence> + </fo:root> + </fo> + <checks> + <eval expected="1" xpath="//lineArea[starts-with(., 'block1')]/ancestor::pageViewport/@nr"/> + <eval expected="1" xpath="//lineArea[starts-with(., 'block2')]/ancestor::pageViewport/@nr"/> + <eval expected="2" xpath="//lineArea[starts-with(., 'block3')]/ancestor::pageViewport/@nr"/> + <eval expected="2" xpath="//lineArea[starts-with(., 'block4')]/ancestor::pageViewport/@nr"/> + <eval expected="3" xpath="//lineArea[starts-with(., 'block5')]/ancestor::pageViewport/@nr"/> + <eval expected="4" xpath="//lineArea[starts-with(., 'block6')]/ancestor::pageViewport/@nr"/> + <eval expected="4" xpath="//lineArea[starts-with(., 'block7')]/ancestor::pageViewport/@nr"/> + <eval expected="4" xpath="//lineArea[starts-with(., 'block8')]/ancestor::pageViewport/@nr"/> + <eval expected="4" xpath="//lineArea[starts-with(., 'block9')]/ancestor::pageViewport/@nr"/> + <eval expected="5" xpath="//lineArea[starts-with(., 'block10')]/ancestor::pageViewport/@nr"/> + + <eval expected="6" xpath="//lineArea[starts-with(., 'block11')]/ancestor::pageViewport/@nr"/> + <eval expected="6" xpath="//lineArea[starts-with(., 'block12')]/ancestor::pageViewport/@nr"/> + <eval expected="7" xpath="//lineArea[starts-with(., 'block13')]/ancestor::pageViewport/@nr"/> + <eval expected="7" xpath="//lineArea[starts-with(., 'block14')]/ancestor::pageViewport/@nr"/> + <eval expected="8" xpath="//lineArea[starts-with(., 'block15')]/ancestor::pageViewport/@nr"/> + <eval expected="9" xpath="//lineArea[starts-with(., 'block16')]/ancestor::pageViewport/@nr"/> + <eval expected="9" xpath="//lineArea[starts-with(., 'block17')]/ancestor::pageViewport/@nr"/> + <eval expected="9" xpath="//lineArea[starts-with(., 'block18')]/ancestor::pageViewport/@nr"/> + <eval expected="9" xpath="//lineArea[starts-with(., 'block19')]/ancestor::pageViewport/@nr"/> + <eval expected="10" xpath="//lineArea[starts-with(., 'block20')]/ancestor::pageViewport/@nr"/> + + <eval expected="11" xpath="//lineArea[starts-with(., 'block21')]/ancestor::pageViewport/@nr"/> + <eval expected="11" xpath="//lineArea[starts-with(., 'block22')]/ancestor::pageViewport/@nr"/> + <eval expected="12" xpath="//lineArea[starts-with(., 'block23')]/ancestor::pageViewport/@nr"/> + <eval expected="12" xpath="//lineArea[starts-with(., 'block24')]/ancestor::pageViewport/@nr"/> + <eval expected="12" xpath="//lineArea[starts-with(., 'block25')]/ancestor::pageViewport/@nr"/> + <eval expected="12" xpath="//lineArea[starts-with(., 'block26')]/ancestor::pageViewport/@nr"/> + + <eval expected="13" xpath="//lineArea[starts-with(., 'block31')]/ancestor::pageViewport/@nr"/> + <eval expected="13" xpath="//lineArea[starts-with(., 'block32')]/ancestor::pageViewport/@nr"/> + <eval expected="14" xpath="//lineArea[starts-with(., 'block33')]/ancestor::pageViewport/@nr"/> + <eval expected="14" xpath="//lineArea[starts-with(., 'block34')]/ancestor::pageViewport/@nr"/> + <eval expected="14" xpath="//lineArea[starts-with(., 'block35')]/ancestor::pageViewport/@nr"/> + <eval expected="14" xpath="//lineArea[starts-with(., 'block36')]/ancestor::pageViewport/@nr"/> + </checks> +</testcase> diff --git a/test/layoutengine/testcases/keep-with-next1.xml b/test/layoutengine/testcases/keep-with-next1.xml new file mode 100644 index 000000000..120c2c806 --- /dev/null +++ b/test/layoutengine/testcases/keep-with-next1.xml @@ -0,0 +1,95 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + Copyright 2005 The Apache Software Foundation + + Licensed 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 keep-with-next. + </p> + <p> + Widows and Orphans are disabled in this test to avoid side-effects. + </p> + </info> + <fo> + <fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format" xmlns:svg="http://www.w3.org/2000/svg" white-space-collapse="true" widows="0" orphans="0"> + <fo:layout-master-set> + <fo:simple-page-master master-name="normal" page-width="5in" page-height="4.5 * 14.4pt"> + <fo:region-body/> + </fo:simple-page-master> + </fo:layout-master-set> + <fo:page-sequence master-reference="normal"> + <fo:flow flow-name="xsl-region-body"> + <fo:block>block1</fo:block> + <fo:block>block2</fo:block> + <fo:block keep-with-next.within-page="always">block3</fo:block> + <fo:block keep-with-next.within-page="always">block4</fo:block> + <fo:block>block5</fo:block> + <fo:block keep-with-next.within-page="always"> + <fo:block>block6</fo:block> + <fo:block>block7</fo:block> + <fo:block>block8</fo:block> + <fo:block>block9</fo:block> + <fo:block>block10</fo:block> + </fo:block> + <fo:block>block11</fo:block> + </fo:flow> + </fo:page-sequence> + <fo:page-sequence master-reference="normal"> + <fo:flow flow-name="xsl-region-body"> + <fo:block>block21</fo:block> + <fo:block>block22</fo:block> + <fo:block keep-with-next.within-column="always">block23</fo:block> + <fo:block keep-with-next.within-column="always">block24</fo:block> + <fo:block>block25</fo:block> + <fo:block keep-with-next.within-column="always"> + <fo:block>block26</fo:block> + <fo:block>block27</fo:block> + <fo:block>block28</fo:block> + <fo:block>block29</fo:block> + <fo:block>block30</fo:block> + </fo:block> + <fo:block>block31</fo:block> + </fo:flow> + </fo:page-sequence> + </fo:root> + </fo> + <checks> + <eval expected="1" xpath="//lineArea[starts-with(., 'block1')]/ancestor::pageViewport/@nr"/> + <eval expected="1" xpath="//lineArea[starts-with(., 'block2')]/ancestor::pageViewport/@nr"/> + <eval expected="2" xpath="//lineArea[starts-with(., 'block3')]/ancestor::pageViewport/@nr"/> + <eval expected="2" xpath="//lineArea[starts-with(., 'block4')]/ancestor::pageViewport/@nr"/> + <eval expected="2" xpath="//lineArea[starts-with(., 'block5')]/ancestor::pageViewport/@nr"/> + <eval expected="2" xpath="//lineArea[starts-with(., 'block6')]/ancestor::pageViewport/@nr"/> + <eval expected="3" xpath="//lineArea[starts-with(., 'block7')]/ancestor::pageViewport/@nr"/> + <eval expected="3" xpath="//lineArea[starts-with(., 'block8')]/ancestor::pageViewport/@nr"/> + <eval expected="3" xpath="//lineArea[starts-with(., 'block9')]/ancestor::pageViewport/@nr"/> + <eval expected="4" xpath="//lineArea[starts-with(., 'block10')]/ancestor::pageViewport/@nr"/> + <eval expected="4" xpath="//lineArea[starts-with(., 'block11')]/ancestor::pageViewport/@nr"/> + + <eval expected="5" xpath="//lineArea[starts-with(., 'block21')]/ancestor::pageViewport/@nr"/> + <eval expected="5" xpath="//lineArea[starts-with(., 'block22')]/ancestor::pageViewport/@nr"/> + <eval expected="6" xpath="//lineArea[starts-with(., 'block23')]/ancestor::pageViewport/@nr"/> + <eval expected="6" xpath="//lineArea[starts-with(., 'block24')]/ancestor::pageViewport/@nr"/> + <eval expected="6" xpath="//lineArea[starts-with(., 'block25')]/ancestor::pageViewport/@nr"/> + <eval expected="6" xpath="//lineArea[starts-with(., 'block26')]/ancestor::pageViewport/@nr"/> + <eval expected="7" xpath="//lineArea[starts-with(., 'block27')]/ancestor::pageViewport/@nr"/> + <eval expected="7" xpath="//lineArea[starts-with(., 'block28')]/ancestor::pageViewport/@nr"/> + <eval expected="7" xpath="//lineArea[starts-with(., 'block29')]/ancestor::pageViewport/@nr"/> + <eval expected="8" xpath="//lineArea[starts-with(., 'block30')]/ancestor::pageViewport/@nr"/> + <eval expected="8" xpath="//lineArea[starts-with(., 'block31')]/ancestor::pageViewport/@nr"/> + </checks> +</testcase> diff --git a/test/layoutengine/testcases/keep-with-previous1.xml b/test/layoutengine/testcases/keep-with-previous1.xml new file mode 100644 index 000000000..8dd297802 --- /dev/null +++ b/test/layoutengine/testcases/keep-with-previous1.xml @@ -0,0 +1,95 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + Copyright 2005 The Apache Software Foundation + + Licensed 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 keep-with-previous. + </p> + <p> + Widows and Orphans are disabled in this test to avoid side-effects. + </p> + </info> + <fo> + <fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format" xmlns:svg="http://www.w3.org/2000/svg" white-space-collapse="true" widows="0" orphans="0"> + <fo:layout-master-set> + <fo:simple-page-master master-name="normal" page-width="5in" page-height="4.5 * 14.4pt"> + <fo:region-body/> + </fo:simple-page-master> + </fo:layout-master-set> + <fo:page-sequence master-reference="normal"> + <fo:flow flow-name="xsl-region-body"> + <fo:block>block1</fo:block> + <fo:block>block2</fo:block> + <fo:block>block3</fo:block> + <fo:block keep-with-previous.within-page="always">block4</fo:block> + <fo:block keep-with-previous.within-page="always">block5</fo:block> + <fo:block> + <fo:block>block6</fo:block> + <fo:block>block7</fo:block> + <fo:block>block8</fo:block> + <fo:block>block9</fo:block> + <fo:block>block10</fo:block> + </fo:block> + <fo:block keep-with-previous.within-page="always">block11</fo:block> + </fo:flow> + </fo:page-sequence> + <fo:page-sequence master-reference="normal"> + <fo:flow flow-name="xsl-region-body"> + <fo:block>block21</fo:block> + <fo:block>block22</fo:block> + <fo:block>block23</fo:block> + <fo:block keep-with-previous.within-column="always">block24</fo:block> + <fo:block keep-with-previous.within-column="always">block25</fo:block> + <fo:block> + <fo:block>block26</fo:block> + <fo:block>block27</fo:block> + <fo:block>block28</fo:block> + <fo:block>block29</fo:block> + <fo:block>block30</fo:block> + </fo:block> + <fo:block keep-with-previous.within-column="always">block31</fo:block> + </fo:flow> + </fo:page-sequence> + </fo:root> + </fo> + <checks> + <eval expected="1" xpath="//lineArea[starts-with(., 'block1')]/ancestor::pageViewport/@nr"/> + <eval expected="1" xpath="//lineArea[starts-with(., 'block2')]/ancestor::pageViewport/@nr"/> + <eval expected="2" xpath="//lineArea[starts-with(., 'block3')]/ancestor::pageViewport/@nr"/> + <eval expected="2" xpath="//lineArea[starts-with(., 'block4')]/ancestor::pageViewport/@nr"/> + <eval expected="2" xpath="//lineArea[starts-with(., 'block5')]/ancestor::pageViewport/@nr"/> + <eval expected="2" xpath="//lineArea[starts-with(., 'block6')]/ancestor::pageViewport/@nr"/> + <eval expected="3" xpath="//lineArea[starts-with(., 'block7')]/ancestor::pageViewport/@nr"/> + <eval expected="3" xpath="//lineArea[starts-with(., 'block8')]/ancestor::pageViewport/@nr"/> + <eval expected="3" xpath="//lineArea[starts-with(., 'block9')]/ancestor::pageViewport/@nr"/> + <eval expected="4" xpath="//lineArea[starts-with(., 'block10')]/ancestor::pageViewport/@nr"/> + <eval expected="4" xpath="//lineArea[starts-with(., 'block11')]/ancestor::pageViewport/@nr"/> + + <eval expected="5" xpath="//lineArea[starts-with(., 'block21')]/ancestor::pageViewport/@nr"/> + <eval expected="5" xpath="//lineArea[starts-with(., 'block22')]/ancestor::pageViewport/@nr"/> + <eval expected="6" xpath="//lineArea[starts-with(., 'block23')]/ancestor::pageViewport/@nr"/> + <eval expected="6" xpath="//lineArea[starts-with(., 'block24')]/ancestor::pageViewport/@nr"/> + <eval expected="6" xpath="//lineArea[starts-with(., 'block25')]/ancestor::pageViewport/@nr"/> + <eval expected="6" xpath="//lineArea[starts-with(., 'block26')]/ancestor::pageViewport/@nr"/> + <eval expected="7" xpath="//lineArea[starts-with(., 'block27')]/ancestor::pageViewport/@nr"/> + <eval expected="7" xpath="//lineArea[starts-with(., 'block28')]/ancestor::pageViewport/@nr"/> + <eval expected="7" xpath="//lineArea[starts-with(., 'block29')]/ancestor::pageViewport/@nr"/> + <eval expected="8" xpath="//lineArea[starts-with(., 'block30')]/ancestor::pageViewport/@nr"/> + <eval expected="8" xpath="//lineArea[starts-with(., 'block31')]/ancestor::pageViewport/@nr"/> + </checks> +</testcase> diff --git a/test/layoutengine/testcases/multi-column1.xml b/test/layoutengine/testcases/multi-column1.xml new file mode 100644 index 000000000..af1741210 --- /dev/null +++ b/test/layoutengine/testcases/multi-column1.xml @@ -0,0 +1,72 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + Copyright 2005 The Apache Software Foundation + + Licensed 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 multi-column documents. + </p> + </info> + <fo> + <fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format" xmlns:svg="http://www.w3.org/2000/svg"> + <fo:layout-master-set> + <fo:simple-page-master master-name="normal" page-width="360pt" page-height="4in"> + <fo:region-body column-count="2" column-gap="20pt"/> + </fo:simple-page-master> + </fo:layout-master-set> + <fo:page-sequence master-reference="normal" white-space-collapse="true"> + <fo:flow flow-name="xsl-region-body"> + <fo:block> + <fo:block>line1</fo:block> + <fo:block>line2</fo:block> + <fo:block background-color="orange">line3</fo:block> + <fo:block>line4</fo:block> + <fo:block>line5</fo:block> + <fo:block>line6</fo:block> + <fo:block>line7</fo:block> + <fo:block>line8</fo:block> + <fo:block>line9</fo:block> + <fo:block>line10</fo:block> + <fo:block>line11</fo:block> + <fo:block>line12</fo:block> + <fo:block>line13</fo:block> + <fo:block>line14</fo:block> + <fo:block>line15</fo:block> + <fo:block>line16</fo:block> + <fo:block>line17</fo:block> + <fo:block>line18</fo:block> + <fo:block>line19</fo:block> + <fo:block>line20</fo:block> + <fo:block>line21</fo:block> + <fo:block>line22</fo:block> + <fo:block>line23</fo:block> + <fo:block>line24</fo:block> + <fo:block>line25</fo:block> + <fo:block>line26</fo:block> + <fo:block>line27</fo:block> + <fo:block>line28</fo:block> + <fo:block>line29</fo:block> + <fo:block>line30</fo:block> + </fo:block> + </fo:flow> + </fo:page-sequence> + </fo:root> + </fo> + <checks> + <eval expected="1" xpath="count(//pageViewport)"/> + </checks> +</testcase> diff --git a/test/layoutengine/testcases/multi-column2.xml b/test/layoutengine/testcases/multi-column2.xml new file mode 100644 index 000000000..a05d515e9 --- /dev/null +++ b/test/layoutengine/testcases/multi-column2.xml @@ -0,0 +1,76 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + Copyright 2005 The Apache Software Foundation + + Licensed 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 multi-column documents. + </p> + </info> + <fo> + <fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format" xmlns:svg="http://www.w3.org/2000/svg"> + <fo:layout-master-set> + <fo:simple-page-master master-name="normal" page-width="320pt" page-height="4in"> + <fo:region-body column-count="3" column-gap="10pt"/> + </fo:simple-page-master> + </fo:layout-master-set> + <fo:page-sequence master-reference="normal" white-space-collapse="true"> + <fo:flow flow-name="xsl-region-body"> + <fo:block> + <fo:block>line1</fo:block> + <fo:block>line2</fo:block> + <fo:block>line3</fo:block> + <fo:block>line4</fo:block> + <fo:block>line5</fo:block> + <fo:block>line6</fo:block> + <fo:block>line7</fo:block> + <fo:block>line8</fo:block> + <fo:block>line9</fo:block> + <fo:block>line10</fo:block> + <fo:block>line11</fo:block> + <fo:block>line12</fo:block> + <fo:block>line13</fo:block> + </fo:block> + <fo:block span="all"> + <fo:block>This line is spanned over all columns.</fo:block> + <fo:block>This line is spanned over all columns.</fo:block> + <fo:block>This line is spanned over all columns.</fo:block> + <fo:block>This line is spanned over all columns.</fo:block> + </fo:block> + <fo:block> + <fo:block>line1</fo:block> + <fo:block>line2</fo:block> + <fo:block>line3</fo:block> + <fo:block>line4</fo:block> + <fo:block>line5</fo:block> + <fo:block>line6</fo:block> + <fo:block>line7</fo:block> + <fo:block>line8</fo:block> + <fo:block>line9</fo:block> + <fo:block>line10</fo:block> + <fo:block>line11</fo:block> + <fo:block>line12</fo:block> + <fo:block>line13</fo:block> + </fo:block> + </fo:flow> + </fo:page-sequence> + </fo:root> + </fo> + <checks> + <eval expected="1" xpath="count(//pageViewport)"/> + </checks> +</testcase> diff --git a/test/layoutengine/testcases/page-master3.xml b/test/layoutengine/testcases/page-master3.xml index 1eda8648d..a0fd0b761 100644 --- a/test/layoutengine/testcases/page-master3.xml +++ b/test/layoutengine/testcases/page-master3.xml @@ -29,8 +29,8 @@ <fo:region-before background-color="lightgray" extent="20pt"/> </fo:simple-page-master> <fo:simple-page-master master-name="master2" page-width="5in" page-height="5in" margin-left="10pt" margin-top="20pt" margin-right="30pt" margin-bottom="40pt" background-color="rgb(100%, 90%, 90%)" reference-orientation="90"> - <fo:region-body background-color="rgb(100%, 80%, 80%)" margin-top="20pt"/> - <fo:region-before background-color="lightgray" extent="20pt" margin-left="50pt"/> + <fo:region-body background-color="rgb(100%, 80%, 80%)" margin-top="35pt"/> + <fo:region-before background-color="lightgray" extent="20pt" margin-left="50pt" overflow="hidden"/> </fo:simple-page-master> </fo:layout-master-set> <fo:page-sequence master-reference="master1" white-space-collapse="true"> @@ -42,8 +42,10 @@ </fo:flow> </fo:page-sequence> <fo:page-sequence master-reference="master2" white-space-collapse="true"> - <fo:static-content flow-name="xsl-region-before"> - <fo:block>region-before</fo:block> + <fo:static-content flow-name="xsl-region-before" widows="0" orphans="0"> + <fo:block>region-before1</fo:block> + <fo:block>region-before2</fo:block> + <fo:block>region-before3</fo:block> </fo:static-content> <fo:flow flow-name="xsl-region-body"> <fo:block>testing margin with reference-orientation="90"</fo:block> @@ -66,8 +68,8 @@ <eval expected="20000" xpath="//pageViewport[2]/page/regionViewport[1]/regionBefore/@bpda"/> <eval expected="300000" xpath="//pageViewport[2]/page/regionViewport[1]/regionBefore/block[1]/@ipda"/> <eval expected="14400" xpath="//pageViewport[2]/page/regionViewport[1]/regionBefore/block[1]/@bpda"/> - <eval expected="30000 20000 300000 300000" xpath="//pageViewport[2]/page/regionViewport[2]/@rect"/> + <eval expected="45000 20000 285000 300000" xpath="//pageViewport[2]/page/regionViewport[2]/@rect"/> <eval expected="300000" xpath="//pageViewport[2]/page/regionViewport[2]/regionBody/@ipda"/> - <eval expected="300000" xpath="//pageViewport[2]/page/regionViewport[2]/regionBody/@bpda"/> + <eval expected="285000" xpath="//pageViewport[2]/page/regionViewport[2]/regionBody/@bpda"/> </checks> </testcase> diff --git a/test/layoutengine/testcases/page-master4.xml b/test/layoutengine/testcases/page-master4.xml new file mode 100644 index 000000000..0aed299bd --- /dev/null +++ b/test/layoutengine/testcases/page-master4.xml @@ -0,0 +1,64 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + Copyright 2005 The Apache Software Foundation + + Licensed 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 page-masters (all regions). + </p> + </info> + <fo> + <fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format" xmlns:svg="http://www.w3.org/2000/svg"> + <fo:layout-master-set> + <fo:simple-page-master master-name="master1" page-width="5in" page-height="5in" background-color="rgb(100%, 90%, 90%)"> + <fo:region-body background-color="rgb(100%, 100%, 80%)" margin="30pt" display-align="fill"/> + <fo:region-before background-color="rgb(100%, 80%, 80%)" extent="20pt"/> + <fo:region-after background-color="rgb(80%, 80%, 80%)" extent="20pt" precedence="true" display-align="after"/> + <fo:region-start background-color="rgb(80%, 100%, 80%)" extent="20pt"/> + <fo:region-end background-color="rgb(80%, 80%, 100%)" extent="20pt" reference-orientation="270"/> + </fo:simple-page-master> + </fo:layout-master-set> + <fo:page-sequence master-reference="master1" white-space-collapse="true" orphans="0" widows="0"> + <fo:static-content flow-name="xsl-region-before"> + <fo:block>region-before1</fo:block> + <fo:block>region-before2</fo:block> + <fo:block>region-before3</fo:block> + </fo:static-content> + <fo:static-content flow-name="xsl-region-after"> + <fo:block font-size="50%">region-after1 with precedence and display-align="after"</fo:block> + </fo:static-content> + <fo:static-content flow-name="xsl-region-start"> + <fo:block>region-start1</fo:block> + <fo:block>region-start2</fo:block> + <fo:block>region-start3</fo:block> + </fo:static-content> + <fo:static-content flow-name="xsl-region-end"> + <fo:block>region-end1</fo:block> + <fo:block>region-end2</fo:block> + <fo:block>region-end3</fo:block> + </fo:static-content> + <fo:flow flow-name="xsl-region-body"> + <fo:block>testing all-regions1</fo:block> + <fo:block>testing all-regions2</fo:block> + <fo:block>testing all-regions3</fo:block> + </fo:flow> + </fo:page-sequence> + </fo:root> + </fo> + <checks> + </checks> +</testcase> |