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.

table-cell_background-image.xml 6.9KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131
  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 relative positioned background images on a fo:table-cell.
  21. </p>
  22. </info>
  23. <variables>
  24. <img>../../resources/images/box1.png</img>
  25. </variables>
  26. <fo>
  27. <fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format">
  28. <fo:layout-master-set>
  29. <fo:simple-page-master master-name="normal" page-width="5in" page-height="5in" margin="15pt">
  30. <fo:region-body/>
  31. </fo:simple-page-master>
  32. </fo:layout-master-set>
  33. <fo:page-sequence master-reference="normal" white-space-collapse="true">
  34. <fo:flow flow-name="xsl-region-body">
  35. <fo:table border-collapse="separate" table-layout="fixed">
  36. <fo:table-column />
  37. <fo:table-column />
  38. <fo:table-column />
  39. <fo:table-body>
  40. <fo:table-row>
  41. <fo:table-cell margin="0pt" padding="5pt 10pt 20pt 15pt" height="1in" background-color="blue"
  42. background-image="##img"
  43. background-position-horizontal="right"
  44. background-repeat="no-repeat">
  45. <fo:block>image in top right corner</fo:block>
  46. </fo:table-cell>
  47. <fo:table-cell margin="0pt" padding="5pt 10pt 20pt 15pt" height="1in" background-color="green"
  48. background-image="##img"
  49. background-position-horizontal="right"
  50. background-position-vertical="center"
  51. background-repeat="no-repeat">
  52. <fo:block>image in center right</fo:block>
  53. </fo:table-cell>
  54. <fo:table-cell margin="0pt" padding="5pt 10pt 20pt 15pt" height="1in" background-color="yellow"
  55. background-image="##img"
  56. background-position-horizontal="right"
  57. background-position-vertical="bottom"
  58. background-repeat="no-repeat">
  59. <fo:block>image in bottom right corner</fo:block>
  60. </fo:table-cell>
  61. </fo:table-row>
  62. <fo:table-row>
  63. <fo:table-cell margin="0pt" padding="5pt 10pt 20pt 15pt" height="1in" background-color="yellow"
  64. background-image="##img"
  65. background-position-horizontal="center"
  66. background-repeat="no-repeat">
  67. <fo:block>image in top center</fo:block>
  68. </fo:table-cell>
  69. <fo:table-cell margin="0pt" padding="5pt 10pt 20pt 15pt" height="1in" background-color="blue"
  70. background-image="##img"
  71. background-position-horizontal="center"
  72. background-position-vertical="center"
  73. background-repeat="no-repeat">
  74. <fo:block>image in center</fo:block>
  75. </fo:table-cell>
  76. <fo:table-cell margin="0pt" padding="5pt 10pt 20pt 15pt" height="1in" background-color="green"
  77. background-image="##img"
  78. background-position-horizontal="center"
  79. background-position-vertical="bottom"
  80. background-repeat="no-repeat">
  81. <fo:block>image in bottom center</fo:block>
  82. </fo:table-cell>
  83. </fo:table-row>
  84. <fo:table-row>
  85. <fo:table-cell margin="0pt" padding="5pt 10pt 20pt 15pt" height="1in" background-color="green"
  86. background-image="##img"
  87. background-repeat="no-repeat">
  88. <fo:block>image in top left</fo:block>
  89. </fo:table-cell>
  90. <fo:table-cell margin="0pt" padding="5pt 10pt 20pt 15pt" height="1in" background-color="yellow"
  91. background-image="##img"
  92. background-position-vertical="center"
  93. background-repeat="no-repeat">
  94. <fo:block>image in center left</fo:block>
  95. </fo:table-cell>
  96. <fo:table-cell margin="0pt" padding="5pt 10pt 20pt 15pt" height="1in" background-color="blue"
  97. background-image="##img"
  98. background-position-vertical="bottom"
  99. background-repeat="no-repeat">
  100. <fo:block>image in bottom left</fo:block>
  101. </fo:table-cell>
  102. </fo:table-row>
  103. </fo:table-body>
  104. </fo:table>
  105. </fo:flow>
  106. </fo:page-sequence>
  107. </fo:root>
  108. </fo>
  109. <checks>
  110. <!-- first cell in row 1 -->
  111. <eval expected="color=#0000ff,url=../../resources/images/box1.png,repeat=no-repeat,horiz=69991,vertical=0" xpath="//flow/block/block[1]/@background"/>
  112. <!-- second cell in row 1 -->
  113. <eval expected="color=#008000,url=../../resources/images/box1.png,repeat=no-repeat,horiz=69991,vertical=28495" xpath="//flow/block/block[2]/@background"/>
  114. <!-- third cell in row 1 -->
  115. <eval expected="color=#ffff00,url=../../resources/images/box1.png,repeat=no-repeat,horiz=69991,vertical=56991" xpath="//flow/block/block[3]/@background"/>
  116. <!-- first cell in row 2 -->
  117. <eval expected="color=#ffff00,url=../../resources/images/box1.png,repeat=no-repeat,horiz=34995,vertical=0" xpath="//flow/block/block[4]/@background"/>
  118. <!-- second cell in row 2 -->
  119. <eval expected="color=#0000ff,url=../../resources/images/box1.png,repeat=no-repeat,horiz=34995,vertical=28495" xpath="//flow/block/block[5]/@background"/>
  120. <!-- third cell in row 2 -->
  121. <eval expected="color=#008000,url=../../resources/images/box1.png,repeat=no-repeat,horiz=34995,vertical=56991" xpath="//flow/block/block[6]/@background"/>
  122. <!-- first cell in row 3 -->
  123. <eval expected="color=#008000,url=../../resources/images/box1.png,repeat=no-repeat,horiz=0,vertical=0" xpath="//flow/block/block[7]/@background"/>
  124. <!-- second cell in row 3 -->
  125. <eval expected="color=#ffff00,url=../../resources/images/box1.png,repeat=no-repeat,horiz=0,vertical=28495" xpath="//flow/block/block[8]/@background"/>
  126. <!-- third cell in row 3 -->
  127. <eval expected="color=#0000ff,url=../../resources/images/box1.png,repeat=no-repeat,horiz=0,vertical=56991" xpath="//flow/block/block[9]/@background"/>
  128. </checks>
  129. </testcase>