--- /dev/null
+<?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.
+-->
+<testcase>
+ <info>
+ <p>
+ This test checks the positioning of a content line with respect to the footnotes cited in it.
+ </p>
+ </info>
+ <fo>
+ <fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format">
+ <fo:layout-master-set>
+ <fo:simple-page-master master-name="simple"
+ page-height="841.9pt"
+ page-width="595.3pt"
+ margin-top="112.42pt"
+ margin-bottom="69.48pt"
+ margin-left="99.88pt"
+ margin-right="99.88pt">
+ <fo:region-body margin-top="120pt"
+ margin-bottom="140pt"
+ background-color="lightgrey"/>
+ </fo:simple-page-master>
+ </fo:layout-master-set>
+ <fo:page-sequence master-reference="simple">
+ <fo:flow flow-name="xsl-region-body" font-family="Courier">
+ <fo:block background-color="white" line-height="20pt" line-stacking-strategy="font-height">line 1. The last content line in this page has a</fo:block>
+ <fo:block background-color="white" line-height="20pt" line-stacking-strategy="font-height">line 2. reference to a huge footnote; the footnote</fo:block>
+ <fo:block background-color="white" line-height="20pt" line-stacking-strategy="font-height">line 3. is broken, part of it will be placed in the</fo:block>
+ <fo:block background-color="white" line-height="20pt" line-stacking-strategy="font-height">line 4. second page, together with a content line,</fo:block>
+ <fo:block background-color="white" line-height="20pt" line-stacking-strategy="font-height">line 5. and the last part will be placed in page three</fo:block>
+ <fo:block background-color="white" line-height="20pt" line-stacking-strategy="font-height">line 6. together with the remaining content and .</fo:block>
+ <fo:block background-color="white" line-height="20pt" line-stacking-strategy="font-height">line 7. footnote lines.</fo:block>
+ <fo:block background-color="white" line-height="20pt" line-stacking-strategy="font-height">line 8. ---------+---------+---------+---------+------</fo:block>
+ <fo:block background-color="white" line-height="20pt" line-stacking-strategy="font-height">line 9.</fo:block>
+ <fo:block background-color="white" line-height="20pt" line-stacking-strategy="font-height">line 10.</fo:block>
+ <fo:block background-color="white" line-height="20pt" line-stacking-strategy="font-height">line 11.</fo:block>
+ <fo:block background-color="white" line-height="20pt" line-stacking-strategy="font-height">line 12.</fo:block>
+ <fo:block background-color="white" line-height="20pt" line-stacking-strategy="font-height">line 13.</fo:block>
+ <fo:block background-color="white" line-height="20pt" line-stacking-strategy="font-height">line 14.</fo:block>
+ <fo:block background-color="white" line-height="20pt" line-stacking-strategy="font-height">line 15.</fo:block>
+ <fo:block background-color="white" line-height="20pt" line-stacking-strategy="font-height">line 16.</fo:block>
+ <fo:block background-color="white" line-height="20pt" line-stacking-strategy="font-height">line 17.</fo:block>
+ <fo:block background-color="white" line-height="20pt" line-stacking-strategy="font-height">line 18.
+ <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> footnote line 1/43.</fo:block>
+ <fo:block background-color="pink" line-height="20pt" line-stacking-strategy="font-height">footnote line 2/43.</fo:block>
+ <fo:block background-color="pink" line-height="20pt" line-stacking-strategy="font-height">footnote line 3/43.</fo:block>
+ <fo:block background-color="pink" line-height="20pt" line-stacking-strategy="font-height">footnote line 4/43.</fo:block>
+ <fo:block background-color="pink" line-height="20pt" line-stacking-strategy="font-height">footnote line 5/43.</fo:block>
+ <fo:block background-color="pink" line-height="20pt" line-stacking-strategy="font-height">footnote line 6/43.</fo:block>
+ <fo:block background-color="pink" line-height="20pt" line-stacking-strategy="font-height">footnote line 7/43.</fo:block>
+ <fo:block background-color="pink" line-height="20pt" line-stacking-strategy="font-height">footnote line 8/43.</fo:block>
+ <fo:block background-color="pink" line-height="20pt" line-stacking-strategy="font-height">footnote line 9/43.</fo:block>
+ <fo:block background-color="pink" line-height="20pt" line-stacking-strategy="font-height">footnote line 10/43.</fo:block>
+ <fo:block background-color="pink" line-height="20pt" line-stacking-strategy="font-height">footnote line 11/43.</fo:block>
+ <fo:block background-color="pink" line-height="20pt" line-stacking-strategy="font-height">footnote line 12/43.</fo:block>
+ <fo:block background-color="pink" line-height="20pt" line-stacking-strategy="font-height">footnote line 13/43.</fo:block>
+ <fo:block background-color="pink" line-height="20pt" line-stacking-strategy="font-height">footnote line 14/43.</fo:block>
+ <fo:block background-color="pink" line-height="20pt" line-stacking-strategy="font-height">footnote line 15/43.</fo:block>
+ <fo:block background-color="pink" line-height="20pt" line-stacking-strategy="font-height">footnote line 16/43.</fo:block>
+ <fo:block background-color="pink" line-height="20pt" line-stacking-strategy="font-height">footnote line 17/43.</fo:block>
+ <fo:block background-color="pink" line-height="20pt" line-stacking-strategy="font-height">footnote line 18/43.</fo:block>
+ <fo:block background-color="pink" line-height="20pt" line-stacking-strategy="font-height">footnote line 19/43.</fo:block>
+ <fo:block background-color="pink" line-height="20pt" line-stacking-strategy="font-height">footnote line 20/43.</fo:block>
+ <fo:block background-color="pink" line-height="20pt" line-stacking-strategy="font-height">footnote line 21/43.</fo:block>
+ <fo:block background-color="pink" line-height="20pt" line-stacking-strategy="font-height">footnote line 22/43.</fo:block>
+ <fo:block background-color="pink" line-height="20pt" line-stacking-strategy="font-height">footnote line 23/43.</fo:block>
+ <fo:block background-color="pink" line-height="20pt" line-stacking-strategy="font-height">footnote line 24/43.</fo:block>
+ <fo:block background-color="pink" line-height="20pt" line-stacking-strategy="font-height">footnote line 25/43.</fo:block>
+ <fo:block background-color="pink" line-height="20pt" line-stacking-strategy="font-height">footnote line 26/43.</fo:block>
+ <fo:block background-color="pink" line-height="20pt" line-stacking-strategy="font-height">footnote line 27/43.</fo:block>
+ <fo:block background-color="pink" line-height="20pt" line-stacking-strategy="font-height">footnote line 28/43.</fo:block>
+ <fo:block background-color="pink" line-height="20pt" line-stacking-strategy="font-height">footnote line 29/43.</fo:block>
+ <fo:block background-color="pink" line-height="20pt" line-stacking-strategy="font-height">footnote line 30/43.</fo:block>
+ <fo:block background-color="pink" line-height="20pt" line-stacking-strategy="font-height">footnote line 31/43.</fo:block>
+ <fo:block background-color="pink" line-height="20pt" line-stacking-strategy="font-height">footnote line 32/43.</fo:block>
+ <fo:block background-color="pink" line-height="20pt" line-stacking-strategy="font-height">footnote line 33/43.</fo:block>
+ <fo:block background-color="pink" line-height="20pt" line-stacking-strategy="font-height">footnote line 34/43.</fo:block>
+ <fo:block background-color="pink" line-height="20pt" line-stacking-strategy="font-height">footnote line 35/43.</fo:block>
+ <fo:block background-color="pink" line-height="20pt" line-stacking-strategy="font-height">footnote line 36/43.</fo:block>
+ <fo:block background-color="pink" line-height="20pt" line-stacking-strategy="font-height">footnote line 37/43.</fo:block>
+ <fo:block background-color="pink" line-height="20pt" line-stacking-strategy="font-height">footnote line 38/43.</fo:block>
+ <fo:block background-color="pink" line-height="20pt" line-stacking-strategy="font-height">footnote line 39/43.</fo:block>
+ <fo:block background-color="pink" line-height="20pt" line-stacking-strategy="font-height">footnote line 40/43.</fo:block>
+ <fo:block background-color="pink" line-height="20pt" line-stacking-strategy="font-height">footnote line 41/43.</fo:block>
+ <fo:block background-color="pink" line-height="20pt" line-stacking-strategy="font-height">footnote line 42/43.</fo:block>
+ <fo:block background-color="pink" line-height="20pt" line-stacking-strategy="font-height">footnote line 43/43.</fo:block>
+ </fo:footnote-body>
+ </fo:footnote>
+ </fo:block>
+ <fo:block background-color="white" line-height="20pt" line-stacking-strategy="font-height">line 19.</fo:block>
+ <fo:block background-color="white" line-height="20pt" line-stacking-strategy="font-height">line 20.</fo:block>
+ <fo:block background-color="white" line-height="20pt" line-stacking-strategy="font-height">line 21.</fo:block>
+ <fo:block background-color="white" line-height="20pt" line-stacking-strategy="font-height">line 22.</fo:block>
+ <fo:block background-color="white" line-height="20pt" line-stacking-strategy="font-height">line 23.</fo:block>
+ <fo:block background-color="white" line-height="20pt" line-stacking-strategy="font-height">line 24.</fo:block>
+ <fo:block background-color="white" line-height="20pt" line-stacking-strategy="font-height">line 25.</fo:block>
+ <fo:block background-color="white" line-height="20pt" line-stacking-strategy="font-height">line 26.</fo:block>
+ <fo:block background-color="white" line-height="20pt" line-stacking-strategy="font-height">line 27.</fo:block>
+ <fo:block background-color="white" line-height="20pt" line-stacking-strategy="font-height">line 28.</fo:block>
+ <fo:block background-color="white" line-height="20pt" line-stacking-strategy="font-height">line 29.</fo:block>
+ <fo:block background-color="white" line-height="20pt" line-stacking-strategy="font-height">line 30.</fo:block>
+ </fo:flow>
+ </fo:page-sequence>
+ </fo:root>
+ </fo>
+ <checks>
+ <eval expected="4" xpath="count(//pageViewport)"/>
+ <!-- last content line in page 1 -->
+ <eval expected="line 18. " xpath="//pageViewport[1]/page/regionViewport/regionBody/mainReference/span/flow/block[last()]/lineArea/text[1]"/>
+ <eval expected="1" xpath="//pageViewport[1]/page/regionViewport/regionBody/mainReference/span/flow/block[last()]/lineArea/inlineparent[1]/text[1]"/>
+ <!-- last footnote line in page 1 -->
+ <eval expected="footnote line 2/43." xpath="//pageViewport[1]/page/regionViewport/regionBody/footnote//block[last()]/lineArea/text[1]"/>
+ <!-- first content line in page 2 -->
+ <eval expected="line 19." xpath="//pageViewport[2]/page/regionViewport/regionBody/mainReference/span/flow/block[1]/lineArea/text[1]"/>
+ <!-- last content line in page 2 -->
+ <eval expected="line 19." xpath="//pageViewport[2]/page/regionViewport/regionBody/mainReference/span/flow/block[last()]/lineArea/text[1]"/>
+ <!-- first footnote line in page 2 -->
+ <eval expected="footnote line 3/43." xpath="//pageViewport[2]/page/regionViewport/regionBody/footnote//block[1]/lineArea/text[1]"/>
+ <!-- last footnote line in page 2 -->
+ <eval expected="footnote line 21/43." xpath="//pageViewport[2]/page/regionViewport/regionBody/footnote//block[last()]/lineArea/text[1]"/>
+ <!-- first content line in page 3 -->
+ <eval expected="line 20." xpath="//pageViewport[3]/page/regionViewport/regionBody/mainReference/span/flow/block[1]/lineArea/text[1]"/>
+ <!-- last content line in page 3 -->
+ <eval expected="line 20." xpath="//pageViewport[3]/page/regionViewport/regionBody/mainReference/span/flow/block[last()]/lineArea/text[1]"/>
+ <!-- first footnote line in page 3 -->
+ <eval expected="footnote line 22/43." xpath="//pageViewport[3]/page/regionViewport/regionBody/footnote//block[1]/lineArea/text[1]"/>
+ <!-- last footnote line in page 3 -->
+ <eval expected="footnote line 40/43." xpath="//pageViewport[3]/page/regionViewport/regionBody/footnote//block[last()]/lineArea/text[1]"/>
+
+
+ <!-- first content line in page 4 -->
+ <eval expected="line 21." xpath="//pageViewport[4]/page/regionViewport/regionBody/mainReference/span/flow/block[1]/lineArea/text[1]"/>
+ <!-- last content line in page 3 -->
+ <eval expected="line 30." xpath="//pageViewport[4]/page/regionViewport/regionBody/mainReference/span/flow/block[last()]/lineArea/text[1]"/>
+ <!-- first footnote line in page 3 -->
+ <eval expected="footnote line 41/43." xpath="//pageViewport[4]/page/regionViewport/regionBody/footnote//block[1]/lineArea/text[1]"/>
+ <!-- last footnote line in page 3 -->
+ <eval expected="footnote line 43/43." xpath="//pageViewport[4]/page/regionViewport/regionBody/footnote//block[last()]/lineArea/text[1]"/>
+
+ </checks>
+</testcase>
--- /dev/null
+<?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.
+-->
+<testcase>
+ <info>
+ <p>
+ This test checks the creation of a page containing the remaining of a footnote and no content lines.
+ </p>
+ </info>
+ <fo>
+ <fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format">
+ <fo:layout-master-set>
+ <fo:simple-page-master master-name="simple"
+ page-height="841.9pt"
+ page-width="595.3pt"
+ margin-top="112.42pt"
+ margin-bottom="69.48pt"
+ margin-left="99.88pt"
+ margin-right="99.88pt">
+ <fo:region-body margin-top="120pt"
+ margin-bottom="140pt"
+ background-color="lightgrey"/>
+ </fo:simple-page-master>
+ </fo:layout-master-set>
+ <fo:page-sequence master-reference="simple">
+ <fo:flow flow-name="xsl-region-body" font-family="Courier">
+ <fo:block background-color="white" line-height="20pt" line-stacking-strategy="font-height">line 1. There is a footnote citation in the last</fo:block>
+ <fo:block background-color="white" line-height="20pt" line-stacking-strategy="font-height">line 2. content line of this page.</fo:block>
+ <fo:block background-color="white" line-height="20pt" line-stacking-strategy="font-height">line 3. The footnote body does not fit in the</fo:block>
+ <fo:block background-color="white" line-height="20pt" line-stacking-strategy="font-height">line 4. remaining space so it is broken: the last</fo:block>
+ <fo:block background-color="white" line-height="20pt" line-stacking-strategy="font-height">line 5. part of it will be placed in a new page</fo:block>
+ <fo:block background-color="white" line-height="20pt" line-stacking-strategy="font-height">line 6. with no content lines.</fo:block>
+ <fo:block background-color="white" line-height="20pt" line-stacking-strategy="font-height">line 7. ---------+---------+---------+---------+------</fo:block>
+ <fo:block background-color="white" line-height="20pt" line-stacking-strategy="font-height">line 8.</fo:block>
+ <fo:block background-color="white" line-height="20pt" line-stacking-strategy="font-height">line 9.</fo:block>
+ <fo:block background-color="white" line-height="20pt" line-stacking-strategy="font-height">line 10.</fo:block>
+ <fo:block background-color="white" line-height="20pt" line-stacking-strategy="font-height">line 11.</fo:block>
+ <fo:block background-color="white" line-height="20pt" line-stacking-strategy="font-height">line 12.</fo:block>
+ <fo:block background-color="white" line-height="20pt" line-stacking-strategy="font-height">line 13.</fo:block>
+ <fo:block background-color="white" line-height="20pt" line-stacking-strategy="font-height">line 14.</fo:block>
+ <fo:block background-color="white" line-height="20pt" line-stacking-strategy="font-height">line 15.</fo:block>
+ <fo:block background-color="white" line-height="20pt" line-stacking-strategy="font-height">line 16.</fo:block>
+ <fo:block background-color="white" line-height="20pt" line-stacking-strategy="font-height">line 17.</fo:block>
+ <fo:block background-color="white" line-height="20pt" line-stacking-strategy="font-height">line 18.
+ <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> footnote line 1/3.</fo:block>
+ <fo:block background-color="pink" line-height="20pt" line-stacking-strategy="font-height">footnote line 2/3.</fo:block>
+ <fo:block background-color="pink" line-height="20pt" line-stacking-strategy="font-height">footnote line 3/3.</fo:block>
+ </fo:footnote-body>
+ </fo:footnote>
+ </fo:block>
+ </fo:flow>
+ </fo:page-sequence>
+ </fo:root>
+ </fo>
+ <checks>
+ <eval expected="2" xpath="count(//pageViewport)"/>
+ <!-- last content line in page 1 -->
+ <eval expected="line 18. " xpath="//pageViewport[1]/page/regionViewport/regionBody/mainReference/span/flow/block[last()]/lineArea/text[1]"/>
+ <eval expected="1" xpath="//pageViewport[1]/page/regionViewport/regionBody/mainReference/span/flow/block[last()]/lineArea/inlineparent/text[1]"/>
+ <!-- last footnote line in page 1 -->
+ <eval expected="footnote line 2/3." xpath="//pageViewport[1]/page/regionViewport/regionBody/footnote//block[last()]/lineArea/text[1]"/>
+ <!-- first footnote line in page 2 -->
+ <eval expected="footnote line 3/3." xpath="//pageViewport[2]/page/regionViewport/regionBody/footnote//block[1]/lineArea/text[1]"/>
+ </checks>
+</testcase>
--- /dev/null
+<?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.
+-->
+<testcase>
+ <info>
+ <p>
+ This test checks the creation of two pages containing the remaining of a footnote and no content lines.
+ </p>
+ </info>
+ <fo>
+ <fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format">
+ <fo:layout-master-set>
+ <fo:simple-page-master master-name="simple"
+ page-height="841.9pt"
+ page-width="595.3pt"
+ margin-top="112.42pt"
+ margin-bottom="69.48pt"
+ margin-left="99.88pt"
+ margin-right="99.88pt">
+ <fo:region-body margin-top="120pt"
+ margin-bottom="140pt"
+ background-color="lightgrey"/>
+ </fo:simple-page-master>
+ </fo:layout-master-set>
+ <fo:page-sequence master-reference="simple">
+ <fo:flow flow-name="xsl-region-body" font-family="Courier">
+ <fo:block background-color="white" line-height="20pt" line-stacking-strategy="font-height">line 1. There is a footnote citation in the last</fo:block>
+ <fo:block background-color="white" line-height="20pt" line-stacking-strategy="font-height">line 2. content line of this page.</fo:block>
+ <fo:block background-color="white" line-height="20pt" line-stacking-strategy="font-height">line 3. The footnote body does not fit in the</fo:block>
+ <fo:block background-color="white" line-height="20pt" line-stacking-strategy="font-height">line 4. remaining space so it is broken: il will fill</fo:block>
+ <fo:block background-color="white" line-height="20pt" line-stacking-strategy="font-height">line 5. a page and will end in another one.</fo:block>
+ <fo:block background-color="white" line-height="20pt" line-stacking-strategy="font-height">line 6. ---------+---------+---------+---------+------</fo:block>
+ <fo:block background-color="white" line-height="20pt" line-stacking-strategy="font-height">line 7.</fo:block>
+ <fo:block background-color="white" line-height="20pt" line-stacking-strategy="font-height">line 8.</fo:block>
+ <fo:block background-color="white" line-height="20pt" line-stacking-strategy="font-height">line 9.</fo:block>
+ <fo:block background-color="white" line-height="20pt" line-stacking-strategy="font-height">line 10.</fo:block>
+ <fo:block background-color="white" line-height="20pt" line-stacking-strategy="font-height">line 11.</fo:block>
+ <fo:block background-color="white" line-height="20pt" line-stacking-strategy="font-height">line 12.</fo:block>
+ <fo:block background-color="white" line-height="20pt" line-stacking-strategy="font-height">line 13.</fo:block>
+ <fo:block background-color="white" line-height="20pt" line-stacking-strategy="font-height">line 14.</fo:block>
+ <fo:block background-color="white" line-height="20pt" line-stacking-strategy="font-height">line 15.</fo:block>
+ <fo:block background-color="white" line-height="20pt" line-stacking-strategy="font-height">line 16.</fo:block>
+ <fo:block background-color="white" line-height="20pt" line-stacking-strategy="font-height">line 17.</fo:block>
+ <fo:block background-color="white" line-height="20pt" line-stacking-strategy="font-height">line 18.
+ <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> footnote line 1/23.</fo:block>
+ <fo:block background-color="pink" line-height="20pt" line-stacking-strategy="font-height">footnote line 2/23.</fo:block>
+ <fo:block background-color="pink" line-height="20pt" line-stacking-strategy="font-height">footnote line 3/23.</fo:block>
+ <fo:block background-color="pink" line-height="20pt" line-stacking-strategy="font-height">footnote line 4/23.</fo:block>
+ <fo:block background-color="pink" line-height="20pt" line-stacking-strategy="font-height">footnote line 5/23.</fo:block>
+ <fo:block background-color="pink" line-height="20pt" line-stacking-strategy="font-height">footnote line 6/23.</fo:block>
+ <fo:block background-color="pink" line-height="20pt" line-stacking-strategy="font-height">footnote line 7/23.</fo:block>
+ <fo:block background-color="pink" line-height="20pt" line-stacking-strategy="font-height">footnote line 8/23.</fo:block>
+ <fo:block background-color="pink" line-height="20pt" line-stacking-strategy="font-height">footnote line 9/23.</fo:block>
+ <fo:block background-color="pink" line-height="20pt" line-stacking-strategy="font-height">footnote line 10/23.</fo:block>
+ <fo:block background-color="pink" line-height="20pt" line-stacking-strategy="font-height">footnote line 11/23.</fo:block>
+ <fo:block background-color="pink" line-height="20pt" line-stacking-strategy="font-height">footnote line 12/23.</fo:block>
+ <fo:block background-color="pink" line-height="20pt" line-stacking-strategy="font-height">footnote line 13/23.</fo:block>
+ <fo:block background-color="pink" line-height="20pt" line-stacking-strategy="font-height">footnote line 14/23.</fo:block>
+ <fo:block background-color="pink" line-height="20pt" line-stacking-strategy="font-height">footnote line 15/23.</fo:block>
+ <fo:block background-color="pink" line-height="20pt" line-stacking-strategy="font-height">footnote line 16/23.</fo:block>
+ <fo:block background-color="pink" line-height="20pt" line-stacking-strategy="font-height">footnote line 17/23.</fo:block>
+ <fo:block background-color="pink" line-height="20pt" line-stacking-strategy="font-height">footnote line 18/23.</fo:block>
+ <fo:block background-color="pink" line-height="20pt" line-stacking-strategy="font-height">footnote line 19/23.</fo:block>
+ <fo:block background-color="pink" line-height="20pt" line-stacking-strategy="font-height">footnote line 20/23.</fo:block>
+ <fo:block background-color="pink" line-height="20pt" line-stacking-strategy="font-height">footnote line 21/23.</fo:block>
+ <fo:block background-color="pink" line-height="20pt" line-stacking-strategy="font-height">footnote line 22/23.</fo:block>
+ <fo:block background-color="pink" line-height="20pt" line-stacking-strategy="font-height">footnote line 23/23.</fo:block>
+ </fo:footnote-body>
+ </fo:footnote>
+ </fo:block>
+ </fo:flow>
+ </fo:page-sequence>
+ </fo:root>
+ </fo>
+ <checks>
+ <eval expected="3" xpath="count(//pageViewport)"/>
+ <!-- last content line in page 1 -->
+ <eval expected="line 18. " xpath="//pageViewport[1]/page/regionViewport/regionBody/mainReference/span/flow/block[last()]/lineArea/text[1]"/>
+ <eval expected="1" xpath="//pageViewport[1]/page/regionViewport/regionBody/mainReference/span/flow/block[last()]/lineArea/inlineparent/text[1]"/>
+ <!-- last footnote line in page 1 -->
+ <eval expected="footnote line 2/23." xpath="//pageViewport[1]/page/regionViewport/regionBody/footnote//block[last()]/lineArea/text[1]"/>
+ <!-- first footnote line in page 2 -->
+ <eval expected="footnote line 3/23." xpath="//pageViewport[2]/page/regionViewport/regionBody/footnote//block[1]/lineArea/text[1]"/>
+ <!-- last footnote line in page 2 -->
+ <eval expected="footnote line 22/23." xpath="//pageViewport[2]/page/regionViewport/regionBody/footnote//block[last()]/lineArea/text[1]"/>
+ <!-- first footnote line in page 3 -->
+ <eval expected="footnote line 23/23." xpath="//pageViewport[3]/page/regionViewport/regionBody/footnote//block[1]/lineArea/text[1]"/>
+ </checks>
+</testcase>
--- /dev/null
+<?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.
+-->
+<testcase>
+ <info>
+ <p>
+ This test checks the positioning of a content line with respect to the footnotes cited in it.
+ </p>
+ </info>
+ <fo>
+ <fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format">
+ <fo:layout-master-set>
+ <fo:simple-page-master master-name="simple"
+ page-height="841.9pt"
+ page-width="595.3pt"
+ margin-top="112.42pt"
+ margin-bottom="69.48pt"
+ margin-left="99.88pt"
+ margin-right="99.88pt">
+ <fo:region-body margin-top="120pt"
+ margin-bottom="140pt"
+ background-color="lightgrey"/>
+ </fo:simple-page-master>
+ </fo:layout-master-set>
+ <fo:page-sequence master-reference="simple">
+ <fo:flow flow-name="xsl-region-body" font-family="Courier">
+ <fo:block background-color="white" line-height="20pt" line-stacking-strategy="font-height">line 1. There are two footnote citation in the last</fo:block>
+ <fo:block background-color="white" line-height="20pt" line-stacking-strategy="font-height">line 2. content line of this page.</fo:block>
+ <fo:block background-color="white" line-height="20pt" line-stacking-strategy="font-height">line 3. The first footnote body does not fit in the</fo:block>
+ <fo:block background-color="white" line-height="20pt" line-stacking-strategy="font-height">line 4. remaining space so it is broken, the second</fo:block>
+ <fo:block background-color="white" line-height="20pt" line-stacking-strategy="font-height">line 5. one is deferred to the next page.</fo:block>
+ <fo:block background-color="white" line-height="20pt" line-stacking-strategy="font-height">line 6. ---------+---------+---------+---------+------</fo:block>
+ <fo:block background-color="white" line-height="20pt" line-stacking-strategy="font-height">line 7.</fo:block>
+ <fo:block background-color="white" line-height="20pt" line-stacking-strategy="font-height">line 8.</fo:block>
+ <fo:block background-color="white" line-height="20pt" line-stacking-strategy="font-height">line 9.</fo:block>
+ <fo:block background-color="white" line-height="20pt" line-stacking-strategy="font-height">line 10.</fo:block>
+ <fo:block background-color="white" line-height="20pt" line-stacking-strategy="font-height">line 11.</fo:block>
+ <fo:block background-color="white" line-height="20pt" line-stacking-strategy="font-height">line 12.</fo:block>
+ <fo:block background-color="white" line-height="20pt" line-stacking-strategy="font-height">line 13.</fo:block>
+ <fo:block background-color="white" line-height="20pt" line-stacking-strategy="font-height">line 14.</fo:block>
+ <fo:block background-color="white" line-height="20pt" line-stacking-strategy="font-height">line 15.</fo:block>
+ <fo:block background-color="white" line-height="20pt" line-stacking-strategy="font-height">line 16.</fo:block>
+ <fo:block background-color="white" line-height="20pt" line-stacking-strategy="font-height">line 17.</fo:block>
+ <fo:block background-color="white" line-height="20pt" line-stacking-strategy="font-height">line 18.
+ <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> footnote line 1/3.</fo:block>
+ <fo:block background-color="pink" line-height="20pt" line-stacking-strategy="font-height">footnote line 2/3.</fo:block>
+ <fo:block background-color="pink" line-height="20pt" line-stacking-strategy="font-height">footnote line 3/3.</fo:block>
+ </fo:footnote-body>
+ </fo:footnote>
+ <fo:footnote>
+ <fo:inline font-size="50%" vertical-align="top">2</fo:inline>
+ <fo:footnote-body>
+ <fo:block background-color="lightgreen" line-height="20pt" line-stacking-strategy="font-height"><fo:inline font-size="50%" vertical-align="top">2</fo:inline> footnote line 1/2.</fo:block>
+ <fo:block background-color="lightgreen" line-height="20pt" line-stacking-strategy="font-height">footnote line 2/2.</fo:block>
+ </fo:footnote-body>
+ </fo:footnote>
+ </fo:block>
+ <fo:block background-color="white" line-height="20pt" line-stacking-strategy="font-height">line 19.</fo:block>
+ <fo:block background-color="white" line-height="20pt" line-stacking-strategy="font-height">line 20.</fo:block>
+ </fo:flow>
+ </fo:page-sequence>
+ </fo:root>
+ </fo>
+ <checks>
+ <eval expected="2" xpath="count(//pageViewport)"/>
+ <!-- last content line in page 1 -->
+ <eval expected="line 18. " xpath="//pageViewport[1]/page/regionViewport/regionBody/mainReference/span/flow/block[last()]/lineArea/text[1]"/>
+ <eval expected="1" xpath="//pageViewport[1]/page/regionViewport/regionBody/mainReference/span/flow/block[last()]/lineArea/inlineparent[1]/text[1]"/>
+ <eval expected="2" xpath="//pageViewport[1]/page/regionViewport/regionBody/mainReference/span/flow/block[last()]/lineArea/inlineparent[2]/text[1]"/>
+ <!-- last footnote line in page 1 -->
+ <eval expected="footnote line 2/3." xpath="//pageViewport[1]/page/regionViewport/regionBody/footnote//block[last()]/lineArea/text[1]"/>
+ <!-- first content line in page 2 -->
+ <eval expected="line 19." xpath="//pageViewport[2]/page/regionViewport/regionBody/mainReference/span/flow/block[1]/lineArea/text[1]"/>
+ <!-- last content line in page 2 -->
+ <eval expected="line 20." xpath="//pageViewport[2]/page/regionViewport/regionBody/mainReference/span/flow/block[last()]/lineArea/text[1]"/>
+ <!-- first footnote line in page 2 -->
+ <eval expected="footnote line 3/3." xpath="//pageViewport[2]/page/regionViewport/regionBody/footnote//block[1]/lineArea/text[1]"/>
+ <!-- last footnote line in page 2 -->
+ <eval expected="footnote line 2/2." xpath="//pageViewport[2]/page/regionViewport/regionBody/footnote//block[last()]/lineArea/text[1]"/>
+ </checks>
+</testcase>
--- /dev/null
+<?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.
+-->
+<testcase>
+ <info>
+ <p>
+ This test checks the positioning of a content line with respect to the footnotes cited in it.
+ </p>
+ </info>
+ <fo>
+ <fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format">
+ <fo:layout-master-set>
+ <fo:simple-page-master master-name="simple"
+ page-height="841.9pt"
+ page-width="595.3pt"
+ margin-top="112.42pt"
+ margin-bottom="69.48pt"
+ margin-left="99.88pt"
+ margin-right="99.88pt">
+ <fo:region-body margin-top="120pt"
+ margin-bottom="140pt"
+ background-color="lightgrey"/>
+ </fo:simple-page-master>
+ </fo:layout-master-set>
+ <fo:page-sequence master-reference="simple">
+ <fo:flow flow-name="xsl-region-body" font-family="Courier">
+ <fo:block background-color="white" line-height="20pt" line-stacking-strategy="font-height">line 1. There are three footnote citation in the last</fo:block>
+ <fo:block background-color="white" line-height="20pt" line-stacking-strategy="font-height">line 2. content line of this page.</fo:block>
+ <fo:block background-color="white" line-height="20pt" line-stacking-strategy="font-height">line 3. The third one does not fit in the remaining</fo:block>
+ <fo:block background-color="white" line-height="20pt" line-stacking-strategy="font-height">line 4. space so it is deferred to the next page.</fo:block>
+ <fo:block background-color="white" line-height="20pt" line-stacking-strategy="font-height">line 5. ---------+---------+---------+---------+------</fo:block>
+ <fo:block background-color="white" line-height="20pt" line-stacking-strategy="font-height">line 6.</fo:block>
+ <fo:block background-color="white" line-height="20pt" line-stacking-strategy="font-height">line 7.</fo:block>
+ <fo:block background-color="white" line-height="20pt" line-stacking-strategy="font-height">line 8.</fo:block>
+ <fo:block background-color="white" line-height="20pt" line-stacking-strategy="font-height">line 9.</fo:block>
+ <fo:block background-color="white" line-height="20pt" line-stacking-strategy="font-height">line 10.</fo:block>
+ <fo:block background-color="white" line-height="20pt" line-stacking-strategy="font-height">line 11.</fo:block>
+ <fo:block background-color="white" line-height="20pt" line-stacking-strategy="font-height">line 12.</fo:block>
+ <fo:block background-color="white" line-height="20pt" line-stacking-strategy="font-height">line 13.</fo:block>
+ <fo:block background-color="white" line-height="20pt" line-stacking-strategy="font-height">line 14.</fo:block>
+ <fo:block background-color="white" line-height="20pt" line-stacking-strategy="font-height">line 15.</fo:block>
+ <fo:block background-color="white" line-height="20pt" line-stacking-strategy="font-height">line 16.</fo:block>
+ <fo:block background-color="white" line-height="20pt" line-stacking-strategy="font-height">line 17.</fo:block>
+ <fo:block background-color="white" line-height="20pt" line-stacking-strategy="font-height">line 18.
+ <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> footnote line 1/1.</fo:block>
+ </fo:footnote-body>
+ </fo:footnote>
+ <fo:footnote>
+ <fo:inline font-size="50%" vertical-align="top">2</fo:inline>
+ <fo:footnote-body>
+ <fo:block background-color="lightgreen" line-height="20pt" line-stacking-strategy="font-height"><fo:inline font-size="50%" vertical-align="top">2</fo:inline> footnote line 1/1.</fo:block>
+ </fo:footnote-body>
+ </fo:footnote>
+ <fo:footnote>
+ <fo:inline font-size="50%" vertical-align="top">3</fo:inline>
+ <fo:footnote-body>
+ <fo:block background-color="lightblue" line-height="20pt" line-stacking-strategy="font-height"><fo:inline font-size="50%" vertical-align="top">3</fo:inline> footnote line 1/2.</fo:block>
+ <fo:block background-color="lightblue" line-height="20pt" line-stacking-strategy="font-height">footnote line 2/2.</fo:block>
+ </fo:footnote-body>
+ </fo:footnote>
+ </fo:block>
+ <fo:block background-color="white" line-height="20pt" line-stacking-strategy="font-height">line 19.</fo:block>
+ <fo:block background-color="white" line-height="20pt" line-stacking-strategy="font-height">line 20.</fo:block>
+ </fo:flow>
+ </fo:page-sequence>
+ </fo:root>
+ </fo>
+ <checks>
+ <eval expected="2" xpath="count(//pageViewport)"/>
+ <!-- last content line in page 1 -->
+ <eval expected="line 18. " xpath="//pageViewport[1]/page/regionViewport/regionBody/mainReference/span/flow/block[last()]/lineArea/text[1]"/>
+ <eval expected="1" xpath="//pageViewport[1]/page/regionViewport/regionBody/mainReference/span/flow/block[last()]/lineArea/inlineparent[1]/text[1]"/>
+ <eval expected="2" xpath="//pageViewport[1]/page/regionViewport/regionBody/mainReference/span/flow/block[last()]/lineArea/inlineparent[2]/text[1]"/>
+ <eval expected="3" xpath="//pageViewport[1]/page/regionViewport/regionBody/mainReference/span/flow/block[last()]/lineArea/inlineparent[3]/text[1]"/>
+ <!-- last footnote line in page 1 -->
+ <eval expected="2" xpath="//pageViewport[1]/page/regionViewport/regionBody/footnote/block[last()]/lineArea/inlineparent[1]/text[1]"/>
+ <eval expected=" footnote line 1/1." xpath="//pageViewport[1]/page/regionViewport/regionBody/footnote//block[last()]/lineArea/text[1]"/>
+ <!-- first content line in page 2 -->
+ <eval expected="line 19." xpath="//pageViewport[2]/page/regionViewport/regionBody/mainReference/span/flow/block[1]/lineArea/text[1]"/>
+ <!-- last content line in page 2 -->
+ <eval expected="line 20." xpath="//pageViewport[2]/page/regionViewport/regionBody/mainReference/span/flow/block[last()]/lineArea/text[1]"/>
+ <!-- first footnote line in page 2 -->
+ <eval expected="3" xpath="//pageViewport[2]/page/regionViewport/regionBody/footnote/block[1]/lineArea/inlineparent[1]/text[1]"/>
+ <eval expected=" footnote line 1/2." xpath="//pageViewport[2]/page/regionViewport/regionBody/footnote//block[1]/lineArea/text[1]"/>
+ <!-- last footnote line in page 2 -->
+ <eval expected="footnote line 2/2." xpath="//pageViewport[2]/page/regionViewport/regionBody/footnote//block[last()]/lineArea/text[1]"/>
+ </checks>
+</testcase>
--- /dev/null
+<?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.
+-->
+<testcase>
+ <info>
+ <p>
+ This test checks the positioning of a content line with respect to the footnotes cited in it.
+ </p>
+ </info>
+ <fo>
+ <fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format">
+ <fo:layout-master-set>
+ <fo:simple-page-master master-name="simple"
+ page-height="841.9pt"
+ page-width="595.3pt"
+ margin-top="112.42pt"
+ margin-bottom="69.48pt"
+ margin-left="99.88pt"
+ margin-right="99.88pt">
+ <fo:region-body margin-top="120pt"
+ margin-bottom="140pt"
+ background-color="lightgrey"/>
+ </fo:simple-page-master>
+ </fo:layout-master-set>
+ <fo:page-sequence master-reference="simple">
+ <fo:flow flow-name="xsl-region-body" font-family="Courier">
+ <fo:block background-color="white" line-height="20pt" line-stacking-strategy="font-height">line 1. There are three footnote citations in the last</fo:block>
+ <fo:block background-color="white" line-height="20pt" line-stacking-strategy="font-height">line 2. content line that could be placed in this</fo:block>
+ <fo:block background-color="white" line-height="20pt" line-stacking-strategy="font-height">line 3. page, but there is not enough space to insert</fo:block>
+ <fo:block background-color="white" line-height="20pt" line-stacking-strategy="font-height">line 4. at least a piece of the first one, so the line</fo:block>
+ <fo:block background-color="white" line-height="20pt" line-stacking-strategy="font-height">line 5. is deferred to the next page together with all</fo:block>
+ <fo:block background-color="white" line-height="20pt" line-stacking-strategy="font-height">line 6. its footnotes.</fo:block>
+ <fo:block background-color="white" line-height="20pt" line-stacking-strategy="font-height">line 7. ---------+---------+---------+---------+------</fo:block>
+ <fo:block background-color="white" line-height="20pt" line-stacking-strategy="font-height">line 8.</fo:block>
+ <fo:block background-color="white" line-height="20pt" line-stacking-strategy="font-height">line 9.</fo:block>
+ <fo:block background-color="white" line-height="20pt" line-stacking-strategy="font-height">line 10.
+ <fo:footnote>
+ <fo:inline font-size="50%" vertical-align="top">1</fo:inline>
+ <fo:footnote-body>
+ <fo:block background-color="violet" line-height="20pt" line-stacking-strategy="font-height"><fo:inline font-size="50%" vertical-align="top">1</fo:inline> footnote line 1/1.</fo:block>
+ </fo:footnote-body>
+ </fo:footnote>
+ </fo:block>
+ <fo:block background-color="white" line-height="20pt" line-stacking-strategy="font-height">line 11.</fo:block>
+ <fo:block background-color="white" line-height="20pt" line-stacking-strategy="font-height">line 12.</fo:block>
+ <fo:block background-color="white" line-height="20pt" line-stacking-strategy="font-height">line 13.</fo:block>
+ <fo:block background-color="white" line-height="20pt" line-stacking-strategy="font-height">line 14.</fo:block>
+ <fo:block background-color="white" line-height="20pt" line-stacking-strategy="font-height">line 15.</fo:block>
+ <fo:block background-color="white" line-height="20pt" line-stacking-strategy="font-height">line 16.</fo:block>
+ <fo:block background-color="white" line-height="20pt" line-stacking-strategy="font-height">line 17.</fo:block>
+ <fo:block background-color="white" line-height="20pt" line-stacking-strategy="font-height">line 18.</fo:block>
+ <fo:block background-color="white" line-height="20pt" line-stacking-strategy="font-height">line 19.
+ <fo:footnote>
+ <fo:inline font-size="50%" vertical-align="top">2</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">2</fo:inline> footnote line 1/1.</fo:block>
+ </fo:footnote-body>
+ </fo:footnote>
+ <fo:footnote>
+ <fo:inline font-size="50%" vertical-align="top">3</fo:inline>
+ <fo:footnote-body>
+ <fo:block background-color="lightgreen" line-height="20pt" line-stacking-strategy="font-height"><fo:inline font-size="50%" vertical-align="top">3</fo:inline> footnote line 1/1.</fo:block>
+ </fo:footnote-body>
+ </fo:footnote>
+ <fo:footnote>
+ <fo:inline font-size="50%" vertical-align="top">4</fo:inline>
+ <fo:footnote-body>
+ <fo:block background-color="lightblue" line-height="20pt" line-stacking-strategy="font-height"><fo:inline font-size="50%" vertical-align="top">4</fo:inline> footnote line 1/2.</fo:block>
+ <fo:block background-color="lightblue" line-height="20pt" line-stacking-strategy="font-height">footnote line 2/2.</fo:block>
+ </fo:footnote-body>
+ </fo:footnote>
+ </fo:block>
+ <fo:block background-color="white" line-height="20pt" line-stacking-strategy="font-height">line 20.</fo:block>
+ </fo:flow>
+ </fo:page-sequence>
+ </fo:root>
+ </fo>
+ <checks>
+ <eval expected="2" xpath="count(//pageViewport)"/>
+ <!-- last content line in page 1 -->
+ <eval expected="line 18." xpath="//pageViewport[1]/page/regionViewport/regionBody/mainReference/span/flow/block[last()]/lineArea/text[1]"/>
+ <!-- last footnote line in page 1 -->
+ <eval expected="1" xpath="//pageViewport[1]/page/regionViewport/regionBody/footnote/block[last()]/lineArea/inlineparent[1]/text[1]"/>
+ <eval expected=" footnote line 1/1." xpath="//pageViewport[1]/page/regionViewport/regionBody/footnote//block[last()]/lineArea/text[1]"/>
+ <!-- first content line in page 2 -->
+ <eval expected="line 19. " xpath="//pageViewport[2]/page/regionViewport/regionBody/mainReference/span/flow/block[1]/lineArea/text[1]"/>
+ <eval expected="2" xpath="//pageViewport[2]/page/regionViewport/regionBody/mainReference/span/flow/block[1]/lineArea/inlineparent[1]/text[1]"/>
+ <eval expected="3" xpath="//pageViewport[2]/page/regionViewport/regionBody/mainReference/span/flow/block[1]/lineArea/inlineparent[2]/text[1]"/>
+ <eval expected="4" xpath="//pageViewport[2]/page/regionViewport/regionBody/mainReference/span/flow/block[1]/lineArea/inlineparent[3]/text[1]"/>
+ <!-- last content line in page 2 -->
+ <eval expected="line 20." xpath="//pageViewport[2]/page/regionViewport/regionBody/mainReference/span/flow/block[last()]/lineArea/text[1]"/>
+ <!-- first footnote line in page 2 -->
+ <eval expected="2" xpath="//pageViewport[2]/page/regionViewport/regionBody/footnote/block[1]/lineArea/inlineparent[1]/text[1]"/>
+ <eval expected=" footnote line 1/1." xpath="//pageViewport[2]/page/regionViewport/regionBody/footnote//block[1]/lineArea/text[1]"/>
+ <!-- last footnote line in page 2 -->
+ <eval expected="footnote line 2/2." xpath="//pageViewport[2]/page/regionViewport/regionBody/footnote//block[last()]/lineArea/text[1]"/>
+ </checks>
+</testcase>
--- /dev/null
+<?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.
+-->
+<testcase>
+ <info>
+ <p>
+ This test checks the positioning of a content line with respect to the footnotes cited in it.
+ </p>
+ </info>
+ <fo>
+ <fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format">
+ <fo:layout-master-set>
+ <fo:simple-page-master master-name="simple"
+ page-height="841.9pt"
+ page-width="595.3pt"
+ margin-top="112.42pt"
+ margin-bottom="69.48pt"
+ margin-left="99.88pt"
+ margin-right="99.88pt">
+ <fo:region-body margin-top="120pt"
+ margin-bottom="140pt"
+ background-color="lightgrey"/>
+ </fo:simple-page-master>
+ </fo:layout-master-set>
+ <fo:page-sequence master-reference="simple">
+ <fo:flow flow-name="xsl-region-body" font-family="Courier">
+ <fo:block background-color="white" line-height="20pt" line-stacking-strategy="font-height">line 1. The last content line in this page has a</fo:block>
+ <fo:block background-color="white" line-height="20pt" line-stacking-strategy="font-height">line 2. reference to a huge footnote; the footnote</fo:block>
+ <fo:block background-color="white" line-height="20pt" line-stacking-strategy="font-height">line 3. is broken, part of it will be placed in the</fo:block>
+ <fo:block background-color="white" line-height="20pt" line-stacking-strategy="font-height">line 4. second page, together with a content line,</fo:block>
+ <fo:block background-color="white" line-height="20pt" line-stacking-strategy="font-height">line 5. and the last part will be placed in page three</fo:block>
+ <fo:block background-color="white" line-height="20pt" line-stacking-strategy="font-height">line 6. together with the remaining content and .</fo:block>
+ <fo:block background-color="white" line-height="20pt" line-stacking-strategy="font-height">line 7. footnote lines.</fo:block>
+ <fo:block background-color="white" line-height="20pt" line-stacking-strategy="font-height">line 8. ---------+---------+---------+---------+------</fo:block>
+ <fo:block background-color="white" line-height="20pt" line-stacking-strategy="font-height">line 9.</fo:block>
+ <fo:block background-color="white" line-height="20pt" line-stacking-strategy="font-height">line 10.</fo:block>
+ <fo:block background-color="white" line-height="20pt" line-stacking-strategy="font-height">line 11.</fo:block>
+ <fo:block background-color="white" line-height="20pt" line-stacking-strategy="font-height">line 12.</fo:block>
+ <fo:block background-color="white" line-height="20pt" line-stacking-strategy="font-height">line 13.</fo:block>
+ <fo:block background-color="white" line-height="20pt" line-stacking-strategy="font-height">line 14.</fo:block>
+ <fo:block background-color="white" line-height="20pt" line-stacking-strategy="font-height">line 15.</fo:block>
+ <fo:block background-color="white" line-height="20pt" line-stacking-strategy="font-height">line 16.</fo:block>
+ <fo:block background-color="white" line-height="20pt" line-stacking-strategy="font-height">line 17.</fo:block>
+ <fo:block background-color="white" line-height="20pt" line-stacking-strategy="font-height">line 18.
+ <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> footnote line 1/23.</fo:block>
+ <fo:block background-color="pink" line-height="20pt" line-stacking-strategy="font-height">footnote line 2/23.</fo:block>
+ <fo:block background-color="pink" line-height="20pt" line-stacking-strategy="font-height">footnote line 3/23.</fo:block>
+ <fo:block background-color="pink" line-height="20pt" line-stacking-strategy="font-height">footnote line 4/23.</fo:block>
+ <fo:block background-color="pink" line-height="20pt" line-stacking-strategy="font-height">footnote line 5/23.</fo:block>
+ <fo:block background-color="pink" line-height="20pt" line-stacking-strategy="font-height">footnote line 6/23.</fo:block>
+ <fo:block background-color="pink" line-height="20pt" line-stacking-strategy="font-height">footnote line 7/23.</fo:block>
+ <fo:block background-color="pink" line-height="20pt" line-stacking-strategy="font-height">footnote line 8/23.</fo:block>
+ <fo:block background-color="pink" line-height="20pt" line-stacking-strategy="font-height">footnote line 9/23.</fo:block>
+ <fo:block background-color="pink" line-height="20pt" line-stacking-strategy="font-height">footnote line 10/23.</fo:block>
+ <fo:block background-color="pink" line-height="20pt" line-stacking-strategy="font-height">footnote line 11/23.</fo:block>
+ <fo:block background-color="pink" line-height="20pt" line-stacking-strategy="font-height">footnote line 12/23.</fo:block>
+ <fo:block background-color="pink" line-height="20pt" line-stacking-strategy="font-height">footnote line 13/23.</fo:block>
+ <fo:block background-color="pink" line-height="20pt" line-stacking-strategy="font-height">footnote line 14/23.</fo:block>
+ <fo:block background-color="pink" line-height="20pt" line-stacking-strategy="font-height">footnote line 15/23.</fo:block>
+ <fo:block background-color="pink" line-height="20pt" line-stacking-strategy="font-height">footnote line 16/23.</fo:block>
+ <fo:block background-color="pink" line-height="20pt" line-stacking-strategy="font-height">footnote line 17/23.</fo:block>
+ <fo:block background-color="pink" line-height="20pt" line-stacking-strategy="font-height">footnote line 18/23.</fo:block>
+ <fo:block background-color="pink" line-height="20pt" line-stacking-strategy="font-height">footnote line 19/23.</fo:block>
+ <fo:block background-color="pink" line-height="20pt" line-stacking-strategy="font-height">footnote line 20/23.</fo:block>
+ <fo:block background-color="pink" line-height="20pt" line-stacking-strategy="font-height">footnote line 21/23.</fo:block>
+ <fo:block background-color="pink" line-height="20pt" line-stacking-strategy="font-height">footnote line 22/23.</fo:block>
+ <fo:block background-color="pink" line-height="20pt" line-stacking-strategy="font-height">footnote line 23/23.</fo:block>
+ </fo:footnote-body>
+ </fo:footnote>
+ </fo:block>
+ <fo:block background-color="white" line-height="20pt" line-stacking-strategy="font-height">line 19.</fo:block>
+ <fo:block background-color="white" line-height="20pt" line-stacking-strategy="font-height">line 20.</fo:block>
+ <fo:block background-color="white" line-height="20pt" line-stacking-strategy="font-height">line 21.</fo:block>
+ <fo:block background-color="white" line-height="20pt" line-stacking-strategy="font-height">line 22.</fo:block>
+ <fo:block background-color="white" line-height="20pt" line-stacking-strategy="font-height">line 23.</fo:block>
+ <fo:block background-color="white" line-height="20pt" line-stacking-strategy="font-height">line 24.</fo:block>
+ <fo:block background-color="white" line-height="20pt" line-stacking-strategy="font-height">line 25.</fo:block>
+ <fo:block background-color="white" line-height="20pt" line-stacking-strategy="font-height">line 26.</fo:block>
+ <fo:block background-color="white" line-height="20pt" line-stacking-strategy="font-height">line 27.</fo:block>
+ <fo:block background-color="white" line-height="20pt" line-stacking-strategy="font-height">line 28.</fo:block>
+ <fo:block background-color="white" line-height="20pt" line-stacking-strategy="font-height">line 29.</fo:block>
+ <fo:block background-color="white" line-height="20pt" line-stacking-strategy="font-height">line 30.</fo:block>
+ </fo:flow>
+ </fo:page-sequence>
+ </fo:root>
+ </fo>
+ <checks>
+ <eval expected="3" xpath="count(//pageViewport)"/>
+ <!-- last content line in page 1 -->
+ <eval expected="line 18. " xpath="//pageViewport[1]/page/regionViewport/regionBody/mainReference/span/flow/block[last()]/lineArea/text[1]"/>
+ <eval expected="1" xpath="//pageViewport[1]/page/regionViewport/regionBody/mainReference/span/flow/block[last()]/lineArea/inlineparent[1]/text[1]"/>
+ <!-- last footnote line in page 1 -->
+ <eval expected="footnote line 2/23." xpath="//pageViewport[1]/page/regionViewport/regionBody/footnote//block[last()]/lineArea/text[1]"/>
+ <!-- first content line in page 2 -->
+ <eval expected="line 19." xpath="//pageViewport[2]/page/regionViewport/regionBody/mainReference/span/flow/block[1]/lineArea/text[1]"/>
+ <!-- last content line in page 2 -->
+ <eval expected="line 19." xpath="//pageViewport[2]/page/regionViewport/regionBody/mainReference/span/flow/block[last()]/lineArea/text[1]"/>
+ <!-- first footnote line in page 2 -->
+ <eval expected="footnote line 3/23." xpath="//pageViewport[2]/page/regionViewport/regionBody/footnote//block[1]/lineArea/text[1]"/>
+ <!-- last footnote line in page 2 -->
+ <eval expected="footnote line 21/23." xpath="//pageViewport[2]/page/regionViewport/regionBody/footnote//block[last()]/lineArea/text[1]"/>
+ <!-- first content line in page 3 -->
+ <eval expected="line 20." xpath="//pageViewport[3]/page/regionViewport/regionBody/mainReference/span/flow/block[1]/lineArea/text[1]"/>
+ <!-- last content line in page 3 -->
+ <eval expected="line 30." xpath="//pageViewport[3]/page/regionViewport/regionBody/mainReference/span/flow/block[last()]/lineArea/text[1]"/>
+ <!-- first footnote line in page 3 -->
+ <eval expected="footnote line 22/23." xpath="//pageViewport[3]/page/regionViewport/regionBody/footnote//block[1]/lineArea/text[1]"/>
+ <!-- last footnote line in page 3 -->
+ <eval expected="footnote line 23/23." xpath="//pageViewport[3]/page/regionViewport/regionBody/footnote//block[last()]/lineArea/text[1]"/>
+ </checks>
+</testcase>
--- /dev/null
+<?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.
+-->
+<testcase>
+ <info>
+ <p>
+ This test checks the positioning of a content line with respect to the footnotes cited in it.
+ </p>
+ </info>
+ <fo>
+ <fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format">
+ <fo:layout-master-set>
+ <fo:simple-page-master master-name="simple"
+ page-height="841.9pt"
+ page-width="595.3pt"
+ margin-top="112.42pt"
+ margin-bottom="69.48pt"
+ margin-left="99.88pt"
+ margin-right="99.88pt">
+ <fo:region-body margin-top="120pt"
+ margin-bottom="140pt"
+ background-color="lightgrey"/>
+ </fo:simple-page-master>
+ </fo:layout-master-set>
+ <fo:page-sequence master-reference="simple">
+ <fo:flow flow-name="xsl-region-body" font-family="Courier">
+ <fo:block background-color="white" line-height="20pt" line-stacking-strategy="font-height">line 1. The last content line in this page has a</fo:block>
+ <fo:block background-color="white" line-height="20pt" line-stacking-strategy="font-height">line 2. reference to a huge footnote; the footnote</fo:block>
+ <fo:block background-color="white" line-height="20pt" line-stacking-strategy="font-height">line 3. is broken, part of it will be placed in the</fo:block>
+ <fo:block background-color="white" line-height="20pt" line-stacking-strategy="font-height">line 4. second page, together with a content line,</fo:block>
+ <fo:block background-color="white" line-height="20pt" line-stacking-strategy="font-height">line 5. and the last part will be placed in page three</fo:block>
+ <fo:block background-color="white" line-height="20pt" line-stacking-strategy="font-height">line 6. together with the remaining content and </fo:block>
+ <fo:block background-color="white" line-height="20pt" line-stacking-strategy="font-height">line 7. footnote lines.</fo:block>
+ <fo:block background-color="white" line-height="20pt" line-stacking-strategy="font-height">line 8. ---------+---------+---------+---------+------</fo:block>
+ <fo:block background-color="white" line-height="20pt" line-stacking-strategy="font-height">line 9.</fo:block>
+ <fo:block background-color="white" line-height="20pt" line-stacking-strategy="font-height">line 10.</fo:block>
+ <fo:block background-color="white" line-height="20pt" line-stacking-strategy="font-height">line 11.</fo:block>
+ <fo:block background-color="white" line-height="20pt" line-stacking-strategy="font-height">line 12.</fo:block>
+ <fo:block background-color="white" line-height="20pt" line-stacking-strategy="font-height">line 13.</fo:block>
+ <fo:block background-color="white" line-height="20pt" line-stacking-strategy="font-height">line 14.</fo:block>
+ <fo:block background-color="white" line-height="20pt" line-stacking-strategy="font-height">line 15.</fo:block>
+ <fo:block background-color="white" line-height="20pt" line-stacking-strategy="font-height">line 16.</fo:block>
+ <fo:block background-color="white" line-height="20pt" line-stacking-strategy="font-height">line 17.</fo:block>
+ <fo:block background-color="white" line-height="20pt" line-stacking-strategy="font-height">line 18.
+ <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> footnote line 1/23.</fo:block>
+ <fo:block background-color="pink" line-height="20pt" line-stacking-strategy="font-height">footnote line 2/23.</fo:block>
+ <fo:block background-color="pink" line-height="20pt" line-stacking-strategy="font-height">footnote line 3/23.</fo:block>
+ <fo:block background-color="pink" line-height="20pt" line-stacking-strategy="font-height">footnote line 4/23.</fo:block>
+ <fo:block background-color="pink" line-height="20pt" line-stacking-strategy="font-height">footnote line 5/23.</fo:block>
+ <fo:block background-color="pink" line-height="20pt" line-stacking-strategy="font-height">footnote line 6/23.</fo:block>
+ <fo:block background-color="pink" line-height="20pt" line-stacking-strategy="font-height">footnote line 7/23.</fo:block>
+ <fo:block background-color="pink" line-height="20pt" line-stacking-strategy="font-height">footnote line 8/23.</fo:block>
+ <fo:block background-color="pink" line-height="20pt" line-stacking-strategy="font-height">footnote line 9/23.</fo:block>
+ <fo:block background-color="pink" line-height="20pt" line-stacking-strategy="font-height">footnote line 10/23.</fo:block>
+ <fo:block background-color="pink" line-height="20pt" line-stacking-strategy="font-height">footnote line 11/23.</fo:block>
+ <fo:block background-color="pink" line-height="20pt" line-stacking-strategy="font-height">footnote line 12/23.</fo:block>
+ <fo:block background-color="pink" line-height="20pt" line-stacking-strategy="font-height">footnote line 13/23.</fo:block>
+ <fo:block background-color="pink" line-height="20pt" line-stacking-strategy="font-height">footnote line 14/23.</fo:block>
+ <fo:block background-color="pink" line-height="20pt" line-stacking-strategy="font-height">footnote line 15/23.</fo:block>
+ <fo:block background-color="pink" line-height="20pt" line-stacking-strategy="font-height">footnote line 16/23.</fo:block>
+ <fo:block background-color="pink" line-height="20pt" line-stacking-strategy="font-height">footnote line 17/23.</fo:block>
+ <fo:block background-color="pink" line-height="20pt" line-stacking-strategy="font-height">footnote line 18/23.</fo:block>
+ <fo:block background-color="pink" line-height="20pt" line-stacking-strategy="font-height">footnote line 19/23.</fo:block>
+ <fo:block background-color="pink" line-height="20pt" line-stacking-strategy="font-height">footnote line 20/23.</fo:block>
+ <fo:block background-color="pink" line-height="20pt" line-stacking-strategy="font-height">footnote line 21/23.</fo:block>
+ <fo:block background-color="pink" line-height="20pt" line-stacking-strategy="font-height">footnote line 22/23.</fo:block>
+ <fo:block background-color="pink" line-height="20pt" line-stacking-strategy="font-height">footnote line 23/23.</fo:block>
+ </fo:footnote-body>
+ </fo:footnote>
+ </fo:block>
+ <fo:block background-color="white" line-height="20pt" line-stacking-strategy="font-height">line 19.
+ <fo:footnote>
+ <fo:inline font-size="50%" vertical-align="top">2</fo:inline>
+ <fo:footnote-body>
+ <fo:block background-color="lightgreen" line-height="20pt" line-stacking-strategy="font-height"><fo:inline font-size="50%" vertical-align="top">2</fo:inline> footnote line 1/1.</fo:block>
+ </fo:footnote-body>
+ </fo:footnote>
+ </fo:block>
+ <fo:block background-color="white" line-height="20pt" line-stacking-strategy="font-height">line 20.</fo:block>
+ <fo:block background-color="white" line-height="20pt" line-stacking-strategy="font-height">line 21.</fo:block>
+ <fo:block background-color="white" line-height="20pt" line-stacking-strategy="font-height">line 22.</fo:block>
+ <fo:block background-color="white" line-height="20pt" line-stacking-strategy="font-height">line 23.</fo:block>
+ <fo:block background-color="white" line-height="20pt" line-stacking-strategy="font-height">line 24.</fo:block>
+ <fo:block background-color="white" line-height="20pt" line-stacking-strategy="font-height">line 25.</fo:block>
+ <fo:block background-color="white" line-height="20pt" line-stacking-strategy="font-height">line 26.</fo:block>
+ <fo:block background-color="white" line-height="20pt" line-stacking-strategy="font-height">line 27.</fo:block>
+ <fo:block background-color="white" line-height="20pt" line-stacking-strategy="font-height">line 28.</fo:block>
+ <fo:block background-color="white" line-height="20pt" line-stacking-strategy="font-height">line 29.</fo:block>
+ <fo:block background-color="white" line-height="20pt" line-stacking-strategy="font-height">line 30.</fo:block>
+ </fo:flow>
+ </fo:page-sequence>
+ </fo:root>
+ </fo>
+ <checks>
+ <eval expected="3" xpath="count(//pageViewport)"/>
+ <!-- last content line in page 1 -->
+ <eval expected="line 18. " xpath="//pageViewport[1]/page/regionViewport/regionBody/mainReference/span/flow/block[last()]/lineArea/text[1]"/>
+ <eval expected="1" xpath="//pageViewport[1]/page/regionViewport/regionBody/mainReference/span/flow/block[last()]/lineArea/inlineparent[1]/text[1]"/>
+ <!-- last footnote line in page 1 -->
+ <eval expected="footnote line 2/23." xpath="//pageViewport[1]/page/regionViewport/regionBody/footnote//block[last()]/lineArea/text[1]"/>
+ <!-- first content line in page 2 -->
+ <eval expected="line 19. " xpath="//pageViewport[2]/page/regionViewport/regionBody/mainReference/span/flow/block[1]/lineArea/text[1]"/>
+ <eval expected="2" xpath="//pageViewport[2]/page/regionViewport/regionBody/mainReference/span/flow/block[1]/lineArea/inlineparent[1]/text[1]"/>
+ <!-- last content line in page 2 -->
+ <eval expected="line 19. " xpath="//pageViewport[2]/page/regionViewport/regionBody/mainReference/span/flow/block[last()]/lineArea/text[1]"/>
+ <eval expected="2" xpath="//pageViewport[2]/page/regionViewport/regionBody/mainReference/span/flow/block[last()]/lineArea/inlineparent[1]/text[1]"/>
+ <!-- first footnote line in page 2 -->
+ <eval expected="footnote line 3/23." xpath="//pageViewport[2]/page/regionViewport/regionBody/footnote//block[1]/lineArea/text[1]"/>
+ <!-- last footnote line in page 2 -->
+ <eval expected="footnote line 21/23." xpath="//pageViewport[2]/page/regionViewport/regionBody/footnote//block[last()]/lineArea/text[1]"/>
+ <!-- first content line in page 3 -->
+ <eval expected="line 20." xpath="//pageViewport[3]/page/regionViewport/regionBody/mainReference/span/flow/block[1]/lineArea/text[1]"/>
+ <!-- last content line in page 3 -->
+ <eval expected="line 30." xpath="//pageViewport[3]/page/regionViewport/regionBody/mainReference/span/flow/block[last()]/lineArea/text[1]"/>
+ <!-- first footnote line in page 3 -->
+ <eval expected="footnote line 22/23." xpath="//pageViewport[3]/page/regionViewport/regionBody/footnote//block[1]/lineArea/text[1]"/>
+ <!-- last footnote line in page 3 -->
+ <eval expected="2" xpath="//pageViewport[3]/page/regionViewport/regionBody/footnote/block[last()]/lineArea/inlineparent[1]/text[1]"/>
+ <eval expected=" footnote line 1/1." xpath="//pageViewport[3]/page/regionViewport/regionBody/footnote//block[last()]/lineArea/text[1]"/>
+ </checks>
+</testcase>