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.

indent-inheritance2a.fo 9.1KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163
  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. <!-- This test verifies basic start-indent and end-indent inheritance with broken indent inheritance enabled. -->
  16. <?fop-useragent-break-indent-inheritance true?>
  17. <fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format" xmlns:test="http://xmlgraphics.apache.org/fop/test">
  18. <fo:layout-master-set>
  19. <fo:simple-page-master master-name="A4" page-height="29.7cm" page-width="21cm" margin="2cm">
  20. <fo:region-body background-color="lightgrey"/>
  21. </fo:simple-page-master>
  22. </fo:layout-master-set>
  23. <fo:page-sequence master-reference="A4">
  24. <fo:flow flow-name="xsl-region-body">
  25. <fo:block font-style="italic">start-indent specified on outer block</fo:block>
  26. <fo:block background-color="#FFFFCC">unindented
  27. <test:assert property="start-indent" expected="0mpt"/>
  28. <test:assert property="end-indent" expected="0mpt"/>
  29. </fo:block>
  30. <fo:block background-color="yellow" start-indent="10pt">fo:block
  31. <test:assert property="start-indent" expected="10000mpt"/>
  32. <test:assert property="end-indent" expected="0mpt"/>
  33. <fo:block background-color="orange">fo:block|fo:block
  34. <test:assert property="start-indent" expected="10000mpt"/>
  35. <test:assert property="end-indent" expected="0mpt"/>
  36. </fo:block>
  37. <fo:block-container>
  38. <test:assert property="start-indent" expected="10000mpt"/>
  39. <test:assert property="end-indent" expected="0mpt"/>
  40. <fo:block background-color="red">fo:block|fo:block-container|fo:block
  41. <test:assert property="start-indent" expected="10000mpt"/>
  42. <test:assert property="end-indent" expected="0mpt"/>
  43. </fo:block>
  44. </fo:block-container>
  45. </fo:block>
  46. <fo:block space-before="10pt" font-style="italic">start-indent specified on outer block (reset to 0pt on inner block and the block-container)</fo:block>
  47. <fo:block background-color="#FFFFCC">unindented</fo:block>
  48. <fo:block background-color="yellow" start-indent="10pt">fo:block
  49. <test:assert property="start-indent" expected="10000mpt"/>
  50. <test:assert property="end-indent" expected="0mpt"/>
  51. <fo:block start-indent="0pt" background-color="orange">fo:block|fo:block
  52. <test:assert property="start-indent" expected="0mpt"/>
  53. <test:assert property="end-indent" expected="0mpt"/>
  54. </fo:block>
  55. <fo:block-container start-indent="0pt">
  56. <test:assert property="start-indent" expected="0mpt"/>
  57. <test:assert property="end-indent" expected="0mpt"/>
  58. <fo:block background-color="red">fo:block|fo:block-container|fo:block
  59. <test:assert property="start-indent" expected="0mpt"/>
  60. <test:assert property="end-indent" expected="0mpt"/>
  61. </fo:block>
  62. </fo:block-container>
  63. </fo:block>
  64. <fo:block space-before="10pt" font-style="italic">start-indent specified on outer block (reset to 0pt on nested block in the block-container)</fo:block>
  65. <fo:block background-color="#FFFFCC">unindented</fo:block>
  66. <fo:block background-color="yellow" start-indent="10pt">fo:block
  67. <test:assert property="start-indent" expected="10000mpt"/>
  68. <test:assert property="end-indent" expected="0mpt"/>
  69. <fo:block-container>
  70. <test:assert property="start-indent" expected="10000mpt"/>
  71. <test:assert property="end-indent" expected="0mpt"/>
  72. <fo:block start-indent="0pt" background-color="red">fo:block|fo:block-container|fo:block
  73. <test:assert property="start-indent" expected="0mpt"/>
  74. <test:assert property="end-indent" expected="0mpt"/>
  75. </fo:block>
  76. </fo:block-container>
  77. </fo:block>
  78. <fo:block space-before="10pt" font-style="italic">margin-left specified on outer block</fo:block>
  79. <fo:block background-color="#FFFFCC">unindented</fo:block>
  80. <fo:block background-color="yellow" margin-left="10pt">fo:block
  81. <test:assert property="start-indent" expected="10000mpt"/>
  82. <test:assert property="end-indent" expected="0mpt"/>
  83. <fo:block background-color="orange">fo:block|fo:block
  84. <test:assert property="start-indent" expected="10000mpt"/>
  85. <test:assert property="end-indent" expected="0mpt"/>
  86. </fo:block>
  87. <fo:block margin-left="5pt" background-color="orange">fo:block|fo:block (further indented using margin-left)
  88. <test:assert property="start-indent" expected="15000mpt"/>
  89. <test:assert property="end-indent" expected="0mpt"/>
  90. </fo:block>
  91. <fo:block-container>
  92. <test:assert property="start-indent" expected="10000mpt"/>
  93. <test:assert property="end-indent" expected="0mpt"/>
  94. <fo:block background-color="red">fo:block|fo:block-container|fo:block
  95. <test:assert property="start-indent" expected="0mpt"/>
  96. <test:assert property="end-indent" expected="0mpt"/>
  97. </fo:block>
  98. </fo:block-container>
  99. </fo:block>
  100. <fo:block space-before="10pt" font-style="italic">margin-left specified on outer block (set to 0pt on inner block and the block-container)</fo:block>
  101. <fo:block background-color="#FFFFCC">unindented</fo:block>
  102. <fo:block background-color="yellow" margin-left="10pt">fo:block
  103. <test:assert property="start-indent" expected="10000mpt"/>
  104. <test:assert property="end-indent" expected="0mpt"/>
  105. <fo:block margin-left="0pt" background-color="orange">fo:block|fo:block
  106. <test:assert property="start-indent" expected="10000mpt"/>
  107. <test:assert property="end-indent" expected="0mpt"/>
  108. </fo:block>
  109. <fo:block-container margin-left="0pt">
  110. <test:assert property="start-indent" expected="10000mpt"/>
  111. <test:assert property="end-indent" expected="0mpt"/>
  112. <fo:block background-color="red">fo:block|fo:block-container|fo:block
  113. <test:assert property="start-indent" expected="0mpt"/>
  114. <test:assert property="end-indent" expected="0mpt"/>
  115. </fo:block>
  116. </fo:block-container>
  117. </fo:block>
  118. <fo:block space-before="10pt" font-style="italic">margin-left specified on outer block (reset to 0pt on nested block in the block-container)</fo:block>
  119. <fo:block background-color="#FFFFCC">unindented</fo:block>
  120. <fo:block background-color="yellow" margin-left="10pt">fo:block
  121. <test:assert property="start-indent" expected="10000mpt"/>
  122. <test:assert property="end-indent" expected="0mpt"/>
  123. <fo:block-container>
  124. <test:assert property="start-indent" expected="10000mpt"/>
  125. <test:assert property="end-indent" expected="0mpt"/>
  126. <fo:block margin-left="0pt" background-color="red">fo:block|fo:block-container|fo:block
  127. <test:assert property="start-indent" expected="0mpt"/>
  128. <test:assert property="end-indent" expected="0mpt"/>
  129. </fo:block>
  130. </fo:block-container>
  131. </fo:block>
  132. <fo:block space-before="10pt" font-style="italic">margin-left specified on outer block and start-indent on nested elements</fo:block>
  133. <fo:block background-color="#FFFFCC">unindented</fo:block>
  134. <fo:block background-color="yellow" margin-left="10pt">fo:block
  135. <test:assert property="start-indent" expected="10000mpt"/>
  136. <test:assert property="end-indent" expected="0mpt"/>
  137. <fo:block start-indent="30pt" background-color="orange">fo:block|fo:block
  138. <test:assert property="start-indent" expected="30000mpt"/>
  139. <test:assert property="end-indent" expected="0mpt"/>
  140. </fo:block>
  141. <fo:block-container start-indent="30pt" background-color="gray">
  142. <test:assert property="start-indent" expected="30000mpt"/>
  143. <test:assert property="end-indent" expected="0mpt"/>
  144. <fo:block background-color="red">fo:block|fo:block-container|fo:block
  145. <test:assert property="start-indent" expected="30000mpt"/>
  146. <test:assert property="end-indent" expected="0mpt"/>
  147. </fo:block>
  148. <fo:block start-indent="0pt" background-color="red">fo:block|fo:block-container|fo:block
  149. <test:assert property="start-indent" expected="0mpt"/>
  150. <test:assert property="end-indent" expected="0mpt"/>
  151. </fo:block>
  152. <fo:block margin-left="0pt" background-color="red">fo:block|fo:block-container|fo:block
  153. <test:assert property="start-indent" expected="0mpt"/>
  154. <test:assert property="end-indent" expected="0mpt"/>
  155. </fo:block>
  156. </fo:block-container>
  157. </fo:block>
  158. </fo:flow>
  159. </fo:page-sequence>
  160. </fo:root>