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_1.xml 3.4KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  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" white-space-collapse="true">
  31. <fo:flow flow-name="xsl-region-body">
  32. <fo:block space-after="-8pt">overlapping block1, negative space-after</fo:block>
  33. <fo:block background-color="orange">normal block1</fo:block>
  34. <fo:block space-before="5pt">spaced block1</fo:block>
  35. <fo:block space-after="5pt">spaced block2</fo:block>
  36. <fo:block background-color="orange">normal block2</fo:block>
  37. <fo:block space-before="-8pt">overlapping block2, negative space-before</fo:block>
  38. </fo:flow>
  39. </fo:page-sequence>
  40. </fo:root>
  41. </fo>
  42. <checks>
  43. <!-- overlapping block1 -->
  44. <eval expected="360000" xpath="//flow/block[1]/@ipda"/>
  45. <eval expected="14400" xpath="//flow/block[1]/@bpd"/>
  46. <eval expected="6400" xpath="//flow/block[1]/@bpda"/>
  47. <!-- space after overlapping block1 -->
  48. <eval expected="-8000" xpath="//flow/block[1]/@space-after"/>
  49. <!-- normal block1 -->
  50. <eval expected="360000" xpath="//flow/block[2]/@ipda"/>
  51. <eval expected="14400" xpath="//flow/block[2]/@bpda"/>
  52. <!-- space before spaced block1 -->
  53. <eval expected="5000" xpath="//flow/block[3]/@space-before"/>
  54. <!-- spaced block1 -->
  55. <eval expected="360000" xpath="//flow/block[3]/@ipda"/>
  56. <eval expected="14400" xpath="//flow/block[3]/@bpd"/>
  57. <eval expected="19400" xpath="//flow/block[3]/@bpda"/>
  58. <!-- spaced block2 -->
  59. <eval expected="360000" xpath="//flow/block[4]/@ipda"/>
  60. <eval expected="14400" xpath="//flow/block[4]/@bpd"/>
  61. <eval expected="19400" xpath="//flow/block[4]/@bpda"/>
  62. <!-- space after spaced block2 -->
  63. <eval expected="5000" xpath="//flow/block[4]/@space-after"/>
  64. <!-- normal block2 -->
  65. <eval expected="360000" xpath="//flow/block[5]/@ipda"/>
  66. <eval expected="14400" xpath="//flow/block[5]/@bpda"/>
  67. <!-- space before overlapping block2 -->
  68. <eval expected="-8000" xpath="//flow/block[6]/@space-before"/>
  69. <!-- overlapping block2 -->
  70. <eval expected="360000" xpath="//flow/block[6]/@ipda"/>
  71. <eval expected="14400" xpath="//flow/block[6]/@bpd"/>
  72. <eval expected="6400" xpath="//flow/block[6]/@bpda"/>
  73. </checks>
  74. </testcase>