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.

block_space-before_space-after_2.xml 5.5KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <!--
  3. Licensed to the Apache Software Foundation (ASF) under one or more
  4. contributor license agreements. See the NOTICE file distributed with
  5. this work for additional information regarding copyright ownership.
  6. The ASF licenses this file to You under the Apache License, Version 2.0
  7. (the "License"); you may not use this file except in compliance with
  8. the License. You may obtain a copy of the License at
  9. http://www.apache.org/licenses/LICENSE-2.0
  10. Unless required by applicable law or agreed to in writing, software
  11. distributed under the License is distributed on an "AS IS" BASIS,
  12. WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  13. See the License for the specific language governing permissions and
  14. limitations under the License.
  15. -->
  16. <!-- $Id$ -->
  17. <testcase>
  18. <info>
  19. <p>
  20. This test checks block-level space properties.
  21. </p>
  22. </info>
  23. <fo>
  24. <fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format" xmlns:svg="http://www.w3.org/2000/svg">
  25. <fo:layout-master-set>
  26. <fo:simple-page-master master-name="normal" page-width="5in" page-height="5in">
  27. <fo:region-body/>
  28. </fo:simple-page-master>
  29. </fo:layout-master-set>
  30. <fo:page-sequence master-reference="normal" id="retain">
  31. <fo:flow flow-name="xsl-region-body">
  32. <fo:block space-before.optimum="20pt" space-before.conditionality="retain" space-after.optimum="10pt" space-after.conditionality="retain" text-align="justify">
  33. In olden times when wishing still helped one, there lived a king whose daughters
  34. were all beautiful; and the youngest was so beautiful that the sun itself, which
  35. has seen so much, was astonished whenever it shone in her face. Close by the king's
  36. castle lay a great dark forest, and under an old lime-tree in the forest was a well,
  37. and when the day was very warm, the king's child went out into the forest and sat
  38. down by the side of the cool fountain; and when she was bored she took a golden ball,
  39. and threw it up on high and caught it; and this ball was her favorite plaything.
  40. </fo:block>
  41. <fo:block space-before.optimum="10pt" space-before.conditionality="retain" space-after.optimum="20pt" space-after.conditionality="retain">
  42. Two blocks, testing conditionality="retain".
  43. </fo:block>
  44. </fo:flow>
  45. </fo:page-sequence>
  46. <fo:page-sequence master-reference="normal" id="discard">
  47. <fo:flow flow-name="xsl-region-body">
  48. <fo:block space-before.optimum="20pt" space-before.conditionality="discard" space-after.optimum="10pt" space-after.conditionality="discard" text-align="justify">
  49. In olden times when wishing still helped one, there lived a king whose daughters
  50. were all beautiful; and the youngest was so beautiful that the sun itself, which
  51. has seen so much, was astonished whenever it shone in her face. Close by the king's
  52. castle lay a great dark forest, and under an old lime-tree in the forest was a well,
  53. and when the day was very warm, the king's child went out into the forest and sat
  54. down by the side of the cool fountain; and when she was bored she took a golden ball,
  55. and threw it up on high and caught it; and this ball was her favorite plaything.
  56. </fo:block>
  57. <fo:block space-before.optimum="10pt" space-before.conditionality="discard" space-after.optimum="20pt" space-after.conditionality="discard">
  58. Two blocks, testing conditionality="discard".
  59. </fo:block>
  60. </fo:flow>
  61. </fo:page-sequence>
  62. </fo:root>
  63. </fo>
  64. <checks>
  65. <element-list category="breaker" id="retain">
  66. <box w="0"/> <!-- Helper box bearing the SpaceHandlingPosition and making sure the glue gets processed -->
  67. <penalty w="0" p="INF"/>
  68. <glue w="20000" y="0" z="20000"/>
  69. <box w="14400"/>
  70. <box w="14400"/>
  71. <penalty w="0" p="0"/>
  72. <box w="14400"/>
  73. <penalty w="0" p="0"/>
  74. <box w="14400"/>
  75. <!-- skip three more lines -->
  76. <skip>2</skip>
  77. <skip>2</skip>
  78. <skip>2</skip>
  79. <penalty w="0" p="0"/>
  80. <box w="14400"/>
  81. <box w="14400"/>
  82. <penalty w="0" p="INF" aux="true"/>
  83. <glue w="10000" aux="true"/>
  84. <penalty w="0" p="0"/>
  85. <glue w="-10000" aux="true"/>
  86. <box w="0" aux="true"/>
  87. <penalty w="0" p="INF" aux="true"/>
  88. <glue w="10000" aux="true"/>
  89. <box w="14400"/> <!-- second block -->
  90. <box w="0" aux="true"/>
  91. <penalty w="0" p="INF" aux="true"/>
  92. <glue w="20000" aux="true"/>
  93. <box w="0" aux="true"/> <!-- This is used to make sure the preceding glue is not cut off -->
  94. <skip>3</skip>
  95. </element-list>
  96. <element-list category="breaker" id="discard">
  97. <box w="0"/> <!-- Helper box used to notify the LM for the addAreas stage about the discarded spaces -->
  98. <box w="14400"/>
  99. <box w="14400"/>
  100. <penalty w="0" p="0"/>
  101. <box w="14400"/>
  102. <penalty w="0" p="0"/>
  103. <box w="14400"/>
  104. <penalty w="0" p="0"/>
  105. <box w="14400"/>
  106. <penalty w="0" p="0"/>
  107. <box w="14400"/>
  108. <penalty w="0" p="0"/>
  109. <box w="14400"/>
  110. <penalty w="0" p="0"/>
  111. <box w="14400"/>
  112. <box w="14400"/>
  113. <penalty w="0" p="0"/>
  114. <glue w="10000"/>
  115. <box w="14400"/> <!-- second block -->
  116. <box w="0"/> <!-- SpaceHandlingPosition-bearing helper box -->
  117. <skip>3</skip>
  118. </element-list>
  119. </checks>
  120. </testcase>