您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

block-container_background-image_background-position-relative.xml 6.9KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118
  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:block-container.
  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="0pt">
  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:block-container margin="0pt" padding="5pt 10pt 20pt 15pt" left="0in" top="0in" width="90pt" height="70pt" absolute-position="absolute" background-color="blue"
  36. background-image="##img"
  37. background-position-horizontal="right"
  38. background-repeat="no-repeat">
  39. <fo:block>image in top right corner</fo:block>
  40. </fo:block-container>
  41. <fo:block-container margin="0pt" padding="5pt 10pt 20pt 15pt" left="120pt" top="0in" width="90pt" height="70pt" absolute-position="absolute" background-color="green"
  42. background-image="##img"
  43. background-position-horizontal="right"
  44. background-position-vertical="center"
  45. background-repeat="no-repeat">
  46. <fo:block>image in center right</fo:block>
  47. </fo:block-container>
  48. <fo:block-container margin="0pt" padding="5pt 10pt 20pt 15pt" left="240pt" top="0in" width="90pt" height="70pt" absolute-position="absolute" background-color="yellow"
  49. background-image="##img"
  50. background-position-horizontal="right"
  51. background-position-vertical="bottom"
  52. background-repeat="no-repeat">
  53. <fo:block>image in bottom right corner</fo:block>
  54. </fo:block-container>
  55. <fo:block-container margin="0pt" padding="5pt 10pt 20pt 15pt" left="0in" top="100pt" width="90pt" height="70pt" absolute-position="absolute" background-color="yellow"
  56. background-image="##img"
  57. background-position-horizontal="center"
  58. background-repeat="no-repeat">
  59. <fo:block>image in top center</fo:block>
  60. </fo:block-container>
  61. <fo:block-container margin="0pt" padding="5pt 10pt 20pt 15pt" left="120pt" top="100pt" width="90pt" height="70pt" absolute-position="absolute" background-color="blue"
  62. background-image="##img"
  63. background-position-horizontal="center"
  64. background-position-vertical="center"
  65. background-repeat="no-repeat">
  66. <fo:block>image in center</fo:block>
  67. </fo:block-container>
  68. <fo:block-container margin="0pt" padding="5pt 10pt 20pt 15pt" left="240pt" top="100pt" width="90pt" height="70pt" absolute-position="absolute" background-color="green"
  69. background-image="##img"
  70. background-position-horizontal="center"
  71. background-position-vertical="bottom"
  72. background-repeat="no-repeat">
  73. <fo:block>image in bottom center</fo:block>
  74. </fo:block-container>
  75. <fo:block-container margin="0pt" padding="5pt 10pt 20pt 15pt" left="0in" top="200pt" width="90pt" height="70pt" absolute-position="absolute" background-color="green"
  76. background-image="##img"
  77. background-repeat="no-repeat">
  78. <fo:block>image in top left</fo:block>
  79. </fo:block-container>
  80. <fo:block-container margin="0pt" padding="5pt 10pt 20pt 15pt" left="120pt" top="200pt" width="90pt" height="70pt" absolute-position="absolute" background-color="yellow"
  81. background-image="##img"
  82. background-position-vertical="center"
  83. background-repeat="no-repeat">
  84. <fo:block>image in center left</fo:block>
  85. </fo:block-container>
  86. <fo:block-container margin="0pt" padding="5pt 10pt 20pt 15pt" left="240pt" top="200pt" width="90pt" height="70pt" absolute-position="absolute" background-color="blue"
  87. background-image="##img"
  88. background-position-vertical="bottom"
  89. background-repeat="no-repeat">
  90. <fo:block>image in bottom left</fo:block>
  91. </fo:block-container>
  92. </fo:flow>
  93. </fo:page-sequence>
  94. </fo:root>
  95. </fo>
  96. <checks>
  97. <!-- first container in row 1 -->
  98. <eval expected="color=#0000ff,url=../../resources/images/box1.png,repeat=no-repeat,horiz=74991,vertical=0" xpath="//flow/block[1]/@background"/>
  99. <!-- second container in row 1 -->
  100. <eval expected="color=#008000,url=../../resources/images/box1.png,repeat=no-repeat,horiz=74991,vertical=27495" xpath="//flow/block[2]/@background"/>
  101. <!-- third container in row 1 -->
  102. <eval expected="color=#ffff00,url=../../resources/images/box1.png,repeat=no-repeat,horiz=74991,vertical=54991" xpath="//flow/block[3]/@background"/>
  103. <!-- first container in row 2 -->
  104. <eval expected="color=#ffff00,url=../../resources/images/box1.png,repeat=no-repeat,horiz=37495,vertical=0" xpath="//flow/block[4]/@background"/>
  105. <!-- second container in row 2 -->
  106. <eval expected="color=#0000ff,url=../../resources/images/box1.png,repeat=no-repeat,horiz=37495,vertical=27495" xpath="//flow/block[5]/@background"/>
  107. <!-- third container in row 2 -->
  108. <eval expected="color=#008000,url=../../resources/images/box1.png,repeat=no-repeat,horiz=37495,vertical=54991" xpath="//flow/block[6]/@background"/>
  109. <!-- first container in row 3 -->
  110. <eval expected="color=#008000,url=../../resources/images/box1.png,repeat=no-repeat,horiz=0,vertical=0" xpath="//flow/block[7]/@background"/>
  111. <!-- second container in row 3 -->
  112. <eval expected="color=#ffff00,url=../../resources/images/box1.png,repeat=no-repeat,horiz=0,vertical=27495" xpath="//flow/block[8]/@background"/>
  113. <!-- third container in row 3 -->
  114. <eval expected="color=#0000ff,url=../../resources/images/box1.png,repeat=no-repeat,horiz=0,vertical=54991" xpath="//flow/block[9]/@background"/>
  115. </checks>
  116. </testcase>