Du kannst nicht mehr als 25 Themen auswählen Themen müssen mit entweder einem Buchstaben oder einer Ziffer beginnen. Sie können Bindestriche („-“) enthalten und bis zu 35 Zeichen lang sein.

block_space-before_space-after_bug38102.xml 6.5KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157
  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 if the element list is generated correctly if space-before.optimum is used
  21. instead of space-before directly in the case where a nested block needs to shrink.
  22. This tests bug #38102.
  23. </p>
  24. </info>
  25. <fo>
  26. <fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format" xmlns:svg="http://www.w3.org/2000/svg">
  27. <fo:layout-master-set>
  28. <fo:simple-page-master master-name="normal" page-width="5in" page-height="1.5in">
  29. <fo:region-body/>
  30. </fo:simple-page-master>
  31. </fo:layout-master-set>
  32. <fo:page-sequence master-reference="normal" id="block">
  33. <fo:flow flow-name="xsl-region-body">
  34. <fo:block>
  35. <fo:block>line1</fo:block>
  36. <fo:block space-before="16pt">line2</fo:block>
  37. <fo:block space-before.optimum="16pt">line3</fo:block>
  38. <fo:block>line4</fo:block>
  39. <fo:block>line5</fo:block>
  40. <fo:block>line6</fo:block>
  41. </fo:block>
  42. </fo:flow>
  43. </fo:page-sequence>
  44. <fo:page-sequence master-reference="normal" id="b-c-1">
  45. <fo:flow flow-name="xsl-region-body">
  46. <fo:block-container>
  47. <fo:block>line1</fo:block>
  48. <fo:block space-before="16pt">line2</fo:block>
  49. <fo:block space-before.optimum="16pt">line3</fo:block>
  50. <fo:block>line4</fo:block>
  51. <fo:block>line5</fo:block>
  52. <fo:block>line6</fo:block>
  53. </fo:block-container>
  54. </fo:flow>
  55. </fo:page-sequence>
  56. <fo:page-sequence master-reference="normal" id="b-c-2">
  57. <fo:flow flow-name="xsl-region-body">
  58. <fo:block-container height="1.5in">
  59. <fo:block>line1</fo:block>
  60. <fo:block space-before="16pt">line2</fo:block>
  61. <fo:block space-before.optimum="16pt">line3</fo:block>
  62. <fo:block>line4</fo:block>
  63. <fo:block>line5</fo:block>
  64. <fo:block>line6</fo:block>
  65. </fo:block-container>
  66. </fo:flow>
  67. </fo:page-sequence>
  68. <!-- Spaces inside tables don't get adjusted. The element list combination process is not that advanced, yet.
  69. <fo:page-sequence master-reference="normal" id="table">
  70. <fo:flow flow-name="xsl-region-body">
  71. <fo:table table-layout="fixed" width="100%">
  72. <fo:table-column column-width="100%"/>
  73. <fo:table-body>
  74. <fo:table-row>
  75. <fo:table-cell>
  76. <fo:block>line1</fo:block>
  77. <fo:block space-before="16pt">line2</fo:block>
  78. <fo:block space-before.optimum="16pt">line3</fo:block>
  79. <fo:block>line4</fo:block>
  80. <fo:block>line5</fo:block>
  81. <fo:block>line6</fo:block>
  82. </fo:table-cell>
  83. </fo:table-row>
  84. </fo:table-body>
  85. </fo:table>
  86. </fo:flow>
  87. </fo:page-sequence-->
  88. <!-- The same applies to lists, too.
  89. <fo:page-sequence master-reference="normal" id="list">
  90. <fo:flow flow-name="xsl-region-body">
  91. <fo:list-block>
  92. <fo:list-item>
  93. <fo:list-item-label>
  94. <fo:block/>
  95. </fo:list-item-label>
  96. <fo:list-item-body>
  97. <fo:block>line1</fo:block>
  98. <fo:block space-before="16pt">line2</fo:block>
  99. <fo:block space-before.optimum="16pt">line3</fo:block>
  100. <fo:block>line4</fo:block>
  101. <fo:block>line5</fo:block>
  102. <fo:block>line6</fo:block>
  103. </fo:list-item-body>
  104. </fo:list-item>
  105. </fo:list-block>
  106. </fo:flow>
  107. </fo:page-sequence-->
  108. </fo:root>
  109. </fo>
  110. <checks>
  111. <element-list category="breaker" id="block">
  112. <box w="14400"/>
  113. <penalty w="0" p="0"/>
  114. <glue w="16000" y="0" z="0"/>
  115. <box w="14400"/>
  116. <penalty w="0" p="0"/>
  117. <glue w="16000" y="0" z="16000"/>
  118. <box w="14400"/>
  119. <penalty w="0" p="0"/>
  120. <box w="14400"/>
  121. <penalty w="0" p="0"/>
  122. <box w="14400"/>
  123. <penalty w="0" p="0"/>
  124. <box w="14400"/>
  125. <skip>3</skip>
  126. </element-list>
  127. <!-- page-sequence 1 with fo:block -->
  128. <eval expected="1" xpath="count(//pageSequence[1]//pageViewport)"/>
  129. <eval expected="16000" xpath="//pageSequence[1]//flow/block[1]/block[2]/@space-before"/>
  130. <!-- The breaker needs to shrink the optimal 1600mpt to 5600mpt to fit everything into the one page -->
  131. <eval expected="5600" xpath="//pageSequence[1]//flow/block[1]/block[3]/@space-before"/>
  132. <true xpath="//pageSequence[1]//flow/@bpd = //pageSequence[1]//regionBody/@bpd"/>
  133. <!-- page-sequence 2 with fo:block-container (auto-height)-->
  134. <eval expected="1" xpath="count(//pageSequence[2]//pageViewport)"/>
  135. <eval expected="16000" xpath="//pageSequence[2]//flow/block[1]/block[1]/block[2]/@space-before"/>
  136. <!-- The breaker needs to shrink the optimal 1600mpt to 5600mpt to fit everything into the one page -->
  137. <eval expected="5600" xpath="//pageSequence[2]//flow/block[1]/block[1]/block[3]/@space-before"/>
  138. <true xpath="//pageSequence[2]//flow/@bpd = //pageSequence[2]//regionBody/@bpd"/>
  139. <!-- page-sequence 3 with fo:block-container (fixed height)-->
  140. <eval expected="1" xpath="count(//pageSequence[3]//pageViewport)"/>
  141. <eval expected="16000" xpath="//pageSequence[3]//flow/block[1]/block[1]/block[2]/@space-before"/>
  142. <!-- The breaker needs to shrink the optimal 1600mpt to 5600mpt to fit everything into the one page -->
  143. <eval expected="5600" xpath="//pageSequence[3]//flow/block[1]/block[1]/block[3]/@space-before"/>
  144. <true xpath="//pageSequence[3]//flow/@bpd = //pageSequence[3]//regionBody/@bpd"/>
  145. </checks>
  146. </testcase>