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-container_content_size_percentage.xml 4.4KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  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 block-container provides the right base values for percentage evaluations for its children.
  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-container width="100pt" height="100pt" background-color="yellow">
  33. <fo:block-container width="50%" height="50%" background-color="orange"><fo:block>50% nested</fo:block></fo:block-container>
  34. </fo:block-container>
  35. <fo:block-container width="100pt" background-color="yellow" space-before="10pt">
  36. <fo:block-container width="50%" height="10%" background-color="orange"><fo:block>50% nested autoheight</fo:block></fo:block-container>
  37. </fo:block-container>
  38. <fo:block-container width="100pt" height="100pt" absolute-position="absolute" left="150pt" top="50pt" background-color="yellow">
  39. <fo:block-container width="50%" height="50%" background-color="orange"><fo:block>50% nested abs</fo:block></fo:block-container>
  40. </fo:block-container>
  41. <fo:block-container width="100pt" absolute-position="absolute" left="150pt" top="200pt" background-color="yellow">
  42. <fo:block-container width="50%" height="10%" background-color="orange"><fo:block>50% nested abs autoheight</fo:block></fo:block-container>
  43. </fo:block-container>
  44. </fo:flow>
  45. </fo:page-sequence>
  46. </fo:root>
  47. </fo>
  48. <checks>
  49. <eval expected="360000" xpath="//regionBody/@bpd"/>
  50. <eval expected="360000" xpath="//regionBody/@ipd"/>
  51. <!-- relative -->
  52. <eval expected="100000" xpath="//flow/block[1]/@bpd"/>
  53. <eval expected="100000" xpath="//flow/block[1]/@ipd"/>
  54. <eval expected="50000" xpath="//flow/block[1]/block[1]/block[1]/@bpd"/>
  55. <eval expected="50000" xpath="//flow/block[1]/block[1]/block[1]/@ipd"/>
  56. <!-- relative with autoheight -->
  57. <!-- from the spec: If that dimension is not specified explicitly (i.e., it depends on
  58. content's blockprogression-dimension), the value is interpreted as "auto". -->
  59. <!-- The 10% are ignored in this case. -->
  60. <eval expected="43200" xpath="//flow/block[2]/@bpd"/> <!-- 3 lines -->
  61. <eval expected="100000" xpath="//flow/block[2]/@ipd"/>
  62. <eval expected="43200" xpath="//flow/block[2]/block[1]/block[1]/@bpd"/>
  63. <eval expected="50000" xpath="//flow/block[2]/block[1]/block[1]/@ipd"/>
  64. <!-- absolute -->
  65. <eval expected="100000" xpath="//flow/block[3]/@bpd"/>
  66. <eval expected="100000" xpath="//flow/block[3]/@ipd"/>
  67. <eval expected="50000" xpath="//flow/block[3]/block[1]/block[1]/@bpd"/>
  68. <eval expected="50000" xpath="//flow/block[3]/block[1]/block[1]/@ipd"/>
  69. <!-- absolute with autoheight -->
  70. <!-- from the spec: If that dimension is not specified explicitly (i.e., it depends on
  71. content's blockprogression-dimension), the value is interpreted as "auto". -->
  72. <!-- The 10% are ignored in this case. -->
  73. <eval expected="57600" xpath="//flow/block[4]/@bpd"/> <!-- 4 lines -->
  74. <eval expected="100000" xpath="//flow/block[4]/@ipd"/>
  75. <eval expected="57600" xpath="//flow/block[4]/block[1]/block[1]/@bpd"/>
  76. <eval expected="50000" xpath="//flow/block[4]/block[1]/block[1]/@ipd"/>
  77. </checks>
  78. </testcase>