You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

list-block_space-before_space-after_1.xml 9.2KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <!--
  3. Copyright 2005 The Apache Software Foundation
  4. Licensed under the Apache License, Version 2.0 (the "License");
  5. you may not use this file except in compliance with the License.
  6. You may obtain a copy of the License at
  7. http://www.apache.org/licenses/LICENSE-2.0
  8. Unless required by applicable law or agreed to in writing, software
  9. distributed under the License is distributed on an "AS IS" BASIS,
  10. WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  11. See the License for the specific language governing permissions and
  12. limitations under the License.
  13. -->
  14. <!-- $Id$ -->
  15. <testcase>
  16. <info>
  17. <p>
  18. This test checks spaces on tables.
  19. </p>
  20. </info>
  21. <fo>
  22. <fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format" xmlns:svg="http://www.w3.org/2000/svg">
  23. <fo:layout-master-set>
  24. <fo:simple-page-master master-name="normal" page-width="5in" page-height="1.7in">
  25. <fo:region-body/>
  26. </fo:simple-page-master>
  27. </fo:layout-master-set>
  28. <fo:page-sequence master-reference="normal" id="retain">
  29. <fo:flow flow-name="xsl-region-body">
  30. <fo:list-block provisional-distance-between-starts="8pt" provisional-label-separation="5pt"
  31. space-before="20pt" space-before.conditionality="retain"
  32. space-after="10pt" space-after.conditionality="retain">
  33. <fo:list-item space-before="1em">
  34. <fo:list-item-label end-indent="label-end()">
  35. <fo:block>•</fo:block>
  36. </fo:list-item-label>
  37. <fo:list-item-body start-indent="body-start()">
  38. <fo:block text-align="justify">
  39. In olden times when wishing still helped one, there lived a king whose daughters
  40. were all beautiful; and the youngest was so beautiful that the sun itself, which
  41. has seen so much, was astonished whenever it shone in her face. Close by the king's
  42. castle lay a great dark forest, and under an old lime-tree in the forest was a well,
  43. and when the day was very warm, the king's child went out into the forest and sat
  44. down by the side of the cool fountain; and when she was bored she took a golden ball,
  45. and threw it up on high and caught it; and this ball was her favorite plaything.
  46. </fo:block>
  47. </fo:list-item-body>
  48. </fo:list-item>
  49. <fo:list-item>
  50. <fo:list-item-label end-indent="label-end()">
  51. <fo:block>•</fo:block>
  52. </fo:list-item-label>
  53. <fo:list-item-body start-indent="body-start()">
  54. <fo:block>here is text in the list item body</fo:block>
  55. </fo:list-item-body>
  56. </fo:list-item>
  57. </fo:list-block>
  58. <fo:block space-before.optimum="10pt" space-before.conditionality="retain" space-after.optimum="20pt" space-after.conditionality="retain">
  59. Two blocks, testing conditionality="retain".
  60. </fo:block>
  61. </fo:flow>
  62. </fo:page-sequence>
  63. <fo:page-sequence master-reference="normal" id="discard">
  64. <fo:flow flow-name="xsl-region-body">
  65. <fo:list-block provisional-distance-between-starts="8pt" provisional-label-separation="5pt"
  66. space-before="20pt" space-before.conditionality="discard"
  67. space-after="10pt" space-after.conditionality="discard">
  68. <fo:list-item space-before="1em">
  69. <fo:list-item-label end-indent="label-end()">
  70. <fo:block>•</fo:block>
  71. </fo:list-item-label>
  72. <fo:list-item-body start-indent="body-start()">
  73. <fo:block text-align="justify">
  74. In olden times when wishing still helped one, there lived a king whose daughters
  75. were all beautiful; and the youngest was so beautiful that the sun itself, which
  76. has seen so much, was astonished whenever it shone in her face. Close by the king's
  77. castle lay a great dark forest, and under an old lime-tree in the forest was a well,
  78. and when the day was very warm, the king's child went out into the forest and sat
  79. down by the side of the cool fountain; and when she was bored she took a golden ball,
  80. and threw it up on high and caught it; and this ball was her favorite plaything.
  81. </fo:block>
  82. </fo:list-item-body>
  83. </fo:list-item>
  84. <fo:list-item>
  85. <fo:list-item-label end-indent="label-end()">
  86. <fo:block>•</fo:block>
  87. </fo:list-item-label>
  88. <fo:list-item-body start-indent="body-start()">
  89. <fo:block>here is text in the list item body</fo:block>
  90. </fo:list-item-body>
  91. </fo:list-item>
  92. </fo:list-block>
  93. <fo:block space-before.optimum="10pt" space-before.conditionality="discard" space-after.optimum="20pt" space-after.conditionality="discard">
  94. Two blocks, testing conditionality="discard".
  95. </fo:block>
  96. </fo:flow>
  97. </fo:page-sequence>
  98. </fo:root>
  99. </fo>
  100. <checks>
  101. <element-list category="breaker" id="retain">
  102. <box w="0"/> <!-- Helper box bearing the SpaceHandlingPosition and making sure the glue gets processed -->
  103. <penalty w="0" p="INF"/>
  104. <glue w="20000"/>
  105. <box w="28800"/>
  106. <penalty w="0" p="INF"/>
  107. <glue w="10000"/>
  108. <penalty w="0" p="0"/>
  109. <glue w="-30000"/>
  110. <box w="0"/>
  111. <penalty w="0" p="INF"/>
  112. <glue w="20000"/>
  113. <box w="14400"/>
  114. <penalty w="0" p="INF"/>
  115. <glue w="10000"/>
  116. <penalty w="0" p="0"/>
  117. <glue w="-30000"/>
  118. <box w="0"/>
  119. <penalty w="0" p="INF"/>
  120. <glue w="20000"/>
  121. <box w="14400"/>
  122. <!-- skip three more lines -->
  123. <skip>8</skip>
  124. <skip>8</skip>
  125. <skip>8</skip>
  126. <penalty w="0" p="INF"/>
  127. <glue w="10000"/>
  128. <penalty w="0" p="0"/>
  129. <glue w="-30000"/>
  130. <box w="0"/>
  131. <penalty w="0" p="INF"/>
  132. <glue w="20000"/>
  133. <box w="28800"/> <!-- end of first list item -->
  134. <penalty w="0" p="INF"/>
  135. <glue w="10000"/>
  136. <penalty w="0" p="0"/>
  137. <glue w="-30000"/>
  138. <box w="0"/>
  139. <penalty w="0" p="INF"/>
  140. <glue w="20000"/>
  141. <box w="14400"/> <!-- second list-item -->
  142. <penalty w="0" p="INF" aux="true"/>
  143. <glue w="10000"/>
  144. <penalty w="0" p="0"/>
  145. <glue w="-10000"/>
  146. <box w="0"/>
  147. <penalty w="0" p="INF"/>
  148. <glue w="10000"/>
  149. <box w="14400"/> <!-- second block -->
  150. <box w="0"/>
  151. <penalty w="0" p="INF"/>
  152. <glue w="20000"/>
  153. <box w="0"/> <!-- This is used to make sure the preceding glue is not cut off -->
  154. <skip>3</skip>
  155. </element-list>
  156. <element-list category="breaker" id="discard">
  157. <box w="0"/> <!-- Helper box used to notify the LM for the addAreas stage about the discarded spaces -->
  158. <box w="28800"/>
  159. <penalty w="0" p="0"/>
  160. <box w="14400"/>
  161. <penalty w="0" p="0"/>
  162. <box w="14400"/>
  163. <penalty w="0" p="0"/>
  164. <box w="14400"/>
  165. <penalty w="0" p="0"/>
  166. <box w="14400"/>
  167. <penalty w="0" p="0"/>
  168. <box w="14400"/>
  169. <penalty w="0" p="0"/>
  170. <box w="28800"/>
  171. <penalty w="0" p="0"/>
  172. <box w="14400"/>
  173. <penalty w="0" p="0"/>
  174. <glue w="10000"/>
  175. <box w="14400"/> <!-- second block -->
  176. <box w="0"/> <!-- SpaceHandlingPosition-bearing helper box -->
  177. <skip>3</skip>
  178. </element-list>
  179. <eval expected="4" xpath="count(//pageViewport)"/>
  180. <!-- 1: retain -->
  181. <eval expected="20000" xpath="//pageViewport[@nr=1]/page/regionViewport/regionBody/mainReference/span/flow/block[1]/@space-before"/>
  182. <eval expected="10000" xpath="//pageViewport[@nr=1]/page/regionViewport/regionBody/mainReference/span/flow/block[1]/@space-after"/>
  183. <eval expected="20000" xpath="//pageViewport[@nr=2]/page/regionViewport/regionBody/mainReference/span/flow/block[1]/@space-before"/>
  184. <!-- the following space is eliminated/collapsed through space resolution -->
  185. <true xpath="not(boolean(//pageViewport[@nr=2]/page/regionViewport/regionBody/mainReference/span/flow/block[1]/@space-after))"/>
  186. <eval expected="10000" xpath="//pageViewport[@nr=2]/page/regionViewport/regionBody/mainReference/span/flow/block[2]/@space-before"/>
  187. <eval expected="20000" xpath="//pageViewport[@nr=2]/page/regionViewport/regionBody/mainReference/span/flow/block[2]/@space-after"/>
  188. <!-- 2: discard -->
  189. <true xpath="not(boolean(//pageViewport[@nr=3]/page/regionViewport/regionBody/mainReference/span/flow/block[1]/@space-before))"/>
  190. <true xpath="not(boolean(//pageViewport[@nr=3]/page/regionViewport/regionBody/mainReference/span/flow/block[1]/@space-before))"/>
  191. <true xpath="not(boolean(//pageViewport[@nr=4]/page/regionViewport/regionBody/mainReference/span/flow/block[1]/@space-before))"/>
  192. <true xpath="not(boolean(//pageViewport[@nr=4]/page/regionViewport/regionBody/mainReference/span/flow/block[1]/@space-after))"/>
  193. <eval expected="10000" xpath="//pageViewport[@nr=4]/page/regionViewport/regionBody/mainReference/span/flow/block[2]/@space-before"/>
  194. <true xpath="not(boolean(//pageViewport[@nr=4]/page/regionViewport/regionBody/mainReference/span/flow/block[2]/@space-after))"/>
  195. </checks>
  196. </testcase>