aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorAdrian Cumiskey <acumiskey@apache.org>2008-06-17 10:30:54 +0000
committerAdrian Cumiskey <acumiskey@apache.org>2008-06-17 10:30:54 +0000
commit08f0da8adadb9fda358992ad204948570ad41d11 (patch)
tree63839a088e22c7224abbd11ffa8befff0715169f /test
parentf25d75a80cbb96a31e6d5b5a4da9d5e95d164cd8 (diff)
downloadxmlgraphics-fop-08f0da8adadb9fda358992ad204948570ad41d11.tar.gz
xmlgraphics-fop-08f0da8adadb9fda358992ad204948570ad41d11.zip
Merged revisions 666596,666967,667367,667831,667862,667864,667893,668177,668576 via svnmerge from
https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk ........ r666596 | vhennebert | 2008-06-11 10:52:04 +0100 (Wed, 11 Jun 2008) | 2 lines Fixed typo ........ r666967 | maxberger | 2008-06-12 07:07:28 +0100 (Thu, 12 Jun 2008) | 1 line Added PMD and Findbugs report, 'reports' target' ........ r667367 | maxberger | 2008-06-13 07:03:30 +0100 (Fri, 13 Jun 2008) | 1 line Disabled retroweaver task definition, because it breaks gump ........ r667831 | maxberger | 2008-06-14 17:21:15 +0100 (Sat, 14 Jun 2008) | 1 line minor spelling fixes ........ r667862 | maxberger | 2008-06-14 19:18:14 +0100 (Sat, 14 Jun 2008) | 1 line minor spelling fixes ........ r667864 | maxberger | 2008-06-14 19:23:28 +0100 (Sat, 14 Jun 2008) | 1 line minor spelling & checkstyle fixes ........ r667893 | maxberger | 2008-06-14 23:20:42 +0100 (Sat, 14 Jun 2008) | 1 line removed double storage of 'fobj' ........ r668177 | lfurini | 2008-06-16 15:52:14 +0100 (Mon, 16 Jun 2008) | 2 lines Fixing the PageBreakingAlgorithm, replacing calls to getLineWidth() with getLineWidth(int) so as to take into account each page's real height. This fixes the positioning of footnotes when the page bpd is not the same for all pages. ........ r668576 | jeremias | 2008-06-17 10:04:05 +0100 (Tue, 17 Jun 2008) | 1 line Wrong line number reported in the case of a line overflow. ........ git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/branches/Temp_AFPGOCAResources@668608 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'test')
-rw-r--r--test/layoutengine/standard-testcases/footnote_changing-page-bpd.xml97
-rw-r--r--test/layoutengine/standard-testcases/footnote_changing-page-bpd_2.xml102
2 files changed, 199 insertions, 0 deletions
diff --git a/test/layoutengine/standard-testcases/footnote_changing-page-bpd.xml b/test/layoutengine/standard-testcases/footnote_changing-page-bpd.xml
new file mode 100644
index 000000000..672bea7bf
--- /dev/null
+++ b/test/layoutengine/standard-testcases/footnote_changing-page-bpd.xml
@@ -0,0 +1,97 @@
+<?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 positioning of footnotes when the body bpd changes
+ from page to page.
+ </p>
+ </info>
+ <fo>
+ <fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format">
+ <fo:layout-master-set>
+ <fo:simple-page-master master-name="first"
+ page-height="200pt"
+ page-width="140pt">
+ <fo:region-body background-color="lightgrey"/>
+ </fo:simple-page-master>
+ <fo:simple-page-master master-name="other"
+ page-height="200pt"
+ page-width="140pt">
+ <fo:region-body margin-top="20pt"
+ background-color="lightgrey"/>
+ </fo:simple-page-master>
+ <fo:page-sequence-master master-name="all">
+ <fo:single-page-master-reference master-reference="first"/>
+ <fo:repeatable-page-master-reference master-reference="other"/>
+ </fo:page-sequence-master>
+ </fo:layout-master-set>
+ <fo:page-sequence master-reference="all">
+ <fo:flow flow-name="xsl-region-body" font-family="Courier">
+ <fo:block line-height="20pt" line-stacking-strategy="font-height">line 1.</fo:block>
+ <fo:block line-height="20pt" line-stacking-strategy="font-height">line 2.</fo:block>
+ <fo:block line-height="20pt" line-stacking-strategy="font-height">line 3.</fo:block>
+ <fo:block line-height="20pt" line-stacking-strategy="font-height">line 4.</fo:block>
+ <fo:block line-height="20pt" line-stacking-strategy="font-height">line 5.</fo:block>
+ <fo:block line-height="20pt" line-stacking-strategy="font-height">line 6.</fo:block>
+ <fo:block line-height="20pt" line-stacking-strategy="font-height">line 7.</fo:block>
+ <fo:block line-height="20pt" line-stacking-strategy="font-height">line 8.</fo:block>
+ <fo:block line-height="20pt" line-stacking-strategy="font-height">line 9.</fo:block>
+ <fo:block line-height="20pt" line-stacking-strategy="font-height">line 10.</fo:block>
+ <fo:block line-height="20pt" line-stacking-strategy="font-height">line 11.</fo:block>
+ <fo:block line-height="20pt" line-stacking-strategy="font-height">line 12.</fo:block>
+ <fo:block line-height="20pt" line-stacking-strategy="font-height">line 13.</fo:block>
+ <fo:block line-height="20pt" line-stacking-strategy="font-height">line 14.</fo:block>
+ <fo:block line-height="20pt" line-stacking-strategy="font-height">line 15.</fo:block>
+ <fo:block line-height="20pt" line-stacking-strategy="font-height">line 16.</fo:block>
+ <fo:block line-height="20pt" line-stacking-strategy="font-height">line 17.
+ <fo:footnote>
+ <fo:inline font-size="50%" vertical-align="top">1</fo:inline>
+ <fo:footnote-body>
+ <fo:block background-color="pink" line-height="20pt" line-stacking-strategy="font-height"><fo:inline font-size="50%" vertical-align="top">1</fo:inline> ftnt line 1/3.</fo:block>
+ <fo:block background-color="pink" line-height="20pt" line-stacking-strategy="font-height">ftnt line 2/3.</fo:block>
+ <fo:block background-color="pink" line-height="20pt" line-stacking-strategy="font-height">ftnt line 3/3.</fo:block>
+ </fo:footnote-body>
+ </fo:footnote>
+ </fo:block>
+ <fo:block line-height="20pt" line-stacking-strategy="font-height">line 18.</fo:block>
+ <fo:block line-height="20pt" line-stacking-strategy="font-height">line 19.</fo:block>
+ <fo:block line-height="20pt" line-stacking-strategy="font-height">line 20.</fo:block>
+ </fo:flow>
+ </fo:page-sequence>
+ </fo:root>
+ </fo>
+ <checks>
+ <eval expected="3" xpath="count(//pageViewport)"/>
+ <!-- body height for page 1 -->
+ <eval expected="200000" xpath="//pageViewport[1]/page/regionViewport/@bpd"/>
+ <!-- body height for page 2 -->
+ <eval expected="180000" xpath="//pageViewport[2]/page/regionViewport/@bpd"/>
+ <!-- last content line in page 2 -->
+ <eval expected="line 17. " xpath="//pageViewport[2]/page/regionViewport/regionBody/mainReference/span/flow/block[last()]/lineArea/text[1]"/>
+ <!-- last footnote line in page 2 -->
+ <eval expected="ftnt line 2/3." xpath="//pageViewport[2]/page/regionViewport/regionBody/footnote//block[last()]/lineArea/text[1]"/>
+ <!-- body height for page 3 -->
+ <eval expected="180000" xpath="//pageViewport[3]/page/regionViewport/@bpd"/>
+ <!-- first content line in page 3 -->
+ <eval expected="line 18." xpath="//pageViewport[3]/page/regionViewport/regionBody/mainReference/span/flow/block[1]/lineArea/text[1]"/>
+ <!-- footnote line in page 3 -->
+ <eval expected="ftnt line 3/3." xpath="//pageViewport[3]/page/regionViewport/regionBody/footnote//block[1]/lineArea/text[1]"/>
+ </checks>
+</testcase>
diff --git a/test/layoutengine/standard-testcases/footnote_changing-page-bpd_2.xml b/test/layoutengine/standard-testcases/footnote_changing-page-bpd_2.xml
new file mode 100644
index 000000000..635cb171b
--- /dev/null
+++ b/test/layoutengine/standard-testcases/footnote_changing-page-bpd_2.xml
@@ -0,0 +1,102 @@
+<?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 positioning of footnotes when the body bpd changes
+ from page to page, in particular when footnote pages are created.
+ </p>
+ </info>
+ <fo>
+ <fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format">
+ <fo:layout-master-set>
+ <fo:simple-page-master master-name="first"
+ page-height="200pt"
+ page-width="140pt">
+ <fo:region-body background-color="lightgrey"/>
+ </fo:simple-page-master>
+ <fo:simple-page-master master-name="second"
+ page-height="200pt"
+ page-width="140pt">
+ <fo:region-body margin-top="60pt"
+ background-color="lightgrey"/>
+ </fo:simple-page-master>
+ <fo:simple-page-master master-name="other"
+ page-height="200pt"
+ page-width="140pt">
+ <fo:region-body margin-top="20pt"
+ background-color="lightgrey"/>
+ </fo:simple-page-master>
+ <fo:page-sequence-master master-name="all">
+ <fo:single-page-master-reference master-reference="first"/>
+ <fo:single-page-master-reference master-reference="second"/>
+ <fo:repeatable-page-master-reference master-reference="other"/>
+ </fo:page-sequence-master>
+ </fo:layout-master-set>
+ <fo:page-sequence master-reference="all">
+ <fo:flow flow-name="xsl-region-body" font-family="Courier">
+ <fo:block line-height="20pt" line-stacking-strategy="font-height">line 1.</fo:block>
+ <fo:block line-height="20pt" line-stacking-strategy="font-height">line 2.</fo:block>
+ <fo:block line-height="20pt" line-stacking-strategy="font-height">line 3.</fo:block>
+ <fo:block line-height="20pt" line-stacking-strategy="font-height">line 4.
+ <fo:footnote>
+ <fo:inline font-size="50%" vertical-align="top">1</fo:inline>
+ <fo:footnote-body>
+ <fo:block background-color="pink" line-height="20pt" line-stacking-strategy="font-height"><fo:inline font-size="50%" vertical-align="top">1</fo:inline> ftnt line 1.</fo:block>
+ <fo:block background-color="pink" line-height="20pt" line-stacking-strategy="font-height">ftnt line 2.</fo:block>
+ <fo:block background-color="pink" line-height="20pt" line-stacking-strategy="font-height">ftnt line 3.</fo:block>
+ <fo:block background-color="pink" line-height="20pt" line-stacking-strategy="font-height">ftnt line 4.</fo:block>
+ <fo:block background-color="pink" line-height="20pt" line-stacking-strategy="font-height">ftnt line 5.</fo:block>
+ <fo:block background-color="pink" line-height="20pt" line-stacking-strategy="font-height">ftnt line 6.</fo:block>
+ <fo:block background-color="pink" line-height="20pt" line-stacking-strategy="font-height">ftnt line 7.</fo:block>
+ <fo:block background-color="pink" line-height="20pt" line-stacking-strategy="font-height">ftnt line 8.</fo:block>
+ <fo:block background-color="pink" line-height="20pt" line-stacking-strategy="font-height">ftnt line 9.</fo:block>
+ <fo:block background-color="pink" line-height="20pt" line-stacking-strategy="font-height">ftnt line 10.</fo:block>
+ <fo:block background-color="pink" line-height="20pt" line-stacking-strategy="font-height">ftnt line 11.</fo:block>
+ <fo:block background-color="pink" line-height="20pt" line-stacking-strategy="font-height">ftnt line 12.</fo:block>
+ <fo:block background-color="pink" line-height="20pt" line-stacking-strategy="font-height">ftnt line 13.</fo:block>
+ <fo:block background-color="pink" line-height="20pt" line-stacking-strategy="font-height">ftnt line 14.</fo:block>
+ <fo:block background-color="pink" line-height="20pt" line-stacking-strategy="font-height">ftnt line 15.</fo:block>
+ </fo:footnote-body>
+ </fo:footnote>
+ </fo:block>
+ </fo:flow>
+ </fo:page-sequence>
+ </fo:root>
+ </fo>
+ <checks>
+ <eval expected="3" xpath="count(//pageViewport)"/>
+ <!-- body height for page 1 -->
+ <eval expected="200000" xpath="//pageViewport[1]/page/regionViewport/@bpd"/>
+
+ <!-- body height for page 2 -->
+ <eval expected="140000" xpath="//pageViewport[2]/page/regionViewport/@bpd"/>
+ <!-- first footnote line in page 2 -->
+ <eval expected="ftnt line 7." xpath="//pageViewport[2]/page/regionViewport/regionBody/footnote//block[1]/lineArea/text[1]"/>
+ <!-- last footnote line in page 2 -->
+ <eval expected="ftnt line 13." xpath="//pageViewport[2]/page/regionViewport/regionBody/footnote//block[last()]/lineArea/text[1]"/>
+
+ <!-- body height for page 3 -->
+ <eval expected="180000" xpath="//pageViewport[3]/page/regionViewport/@bpd"/>
+ <!-- first footnote line in page 3 -->
+ <eval expected="ftnt line 14." xpath="//pageViewport[3]/page/regionViewport/regionBody/footnote//block[1]/lineArea/text[1]"/>
+ <!-- last footnote line in page 3 -->
+ <eval expected="ftnt line 15." xpath="//pageViewport[3]/page/regionViewport/regionBody/footnote//block[last()]/lineArea/text[1]"/>
+ </checks>
+</testcase>