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.

inline-block1.xml 4.3KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
  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. <testcase>
  16. <info>
  17. <p>
  18. This test checks block content in fo:inline. It stresses the nesting by letting the fo:inline have a background color.
  19. </p>
  20. </info>
  21. <fo>
  22. <fo:root
  23. xmlns:fo="http://www.w3.org/1999/XSL/Format"
  24. xmlns:svg="http://www.w3.org/2000/svg">
  25. <fo:layout-master-set>
  26. <fo:simple-page-master master-name="simpleA4"
  27. page-height="29.7cm" page-width="21cm"
  28. margin-top="2cm" margin-bottom="2cm"
  29. margin-left="2cm" margin-right="2cm">
  30. <fo:region-body
  31. margin-top="1.2in" margin-bottom="1in"
  32. margin-left="1in" margin-right="1in"/>
  33. </fo:simple-page-master>
  34. </fo:layout-master-set>
  35. <fo:page-sequence master-reference="simpleA4">
  36. <fo:flow flow-name="xsl-region-body">
  37. <fo:block language="en" country="US"
  38. hyphenate="true" text-align="justify">
  39. The appropriate values of the parameters can be obtained from <fo:inline background-color="lightgray">the following equations:
  40. <fo:block>
  41. w1 + w2 + w3 = W,
  42. </fo:block>
  43. <fo:block>
  44. y1 + y2 + y3 = Y,
  45. </fo:block>where W and Y follow from the previous rule</fo:inline>. This completes our argument.
  46. </fo:block>
  47. </fo:flow>
  48. </fo:page-sequence>
  49. </fo:root>
  50. </fo>
  51. <checks>
  52. <element-list category="breaker">
  53. <box w="14400"/>
  54. <box w="14400"/>
  55. <penalty w="0" p="0"/>
  56. <box w="14400"/>
  57. <penalty w="0" p="0"/>
  58. <box w="14400"/>
  59. <penalty w="0" p="0"/>
  60. <box w="14400"/>
  61. <box w="14400"/>
  62. <skip>3</skip>
  63. </element-list>
  64. <!-- the following check sequence verifies background traits caused by the inline element. -->
  65. <true xpath="not(boolean(//flow/block/@background))"/>
  66. <true xpath="not(boolean(//flow/block/lineArea[1]/child::*[1]/@background))"/>
  67. <true xpath="boolean(//flow/block/lineArea[2]/inlineparent[1])"/>
  68. <eval expected="color=#d3d3d3,repeat=0,horiz=0,vertical=0" xpath="//flow/block/lineArea[2]/child::*[1]/@background"/>
  69. <true xpath="boolean(//flow/block/lineArea[3]/inlineblockparent[1])"/>
  70. <eval expected="color=#d3d3d3,repeat=0,horiz=0,vertical=0" xpath="//flow/block/lineArea[3]/child::*[1]/@background"/>
  71. <true xpath="not(boolean(//flow/block/lineArea[3]/inlineblockparent[1]/block/@background))"/>
  72. <true xpath="boolean(//flow/block/lineArea[4]/inlineblockparent[1])"/>
  73. <eval expected="color=#d3d3d3,repeat=0,horiz=0,vertical=0" xpath="//flow/block/lineArea[4]/child::*[1]/@background"/>
  74. <true xpath="not(boolean(//flow/block/lineArea[4]/inlineblockparent[1]/block/@background))"/>
  75. <eval expected="inlineparent" xpath="local-name(//flow/block/lineArea[5]/child::*[1])"/>
  76. <eval expected="text" xpath="local-name(//flow/block/lineArea[5]/child::*[2])"/>
  77. <eval expected="color=#d3d3d3,repeat=0,horiz=0,vertical=0" xpath="//flow/block/lineArea[5]/child::*[1]/@background"/>
  78. <true xpath="not(boolean(//flow/block/lineArea[6]/child::*[1]/@background))"/>
  79. <!-- the following check sequence verifies size traits so the background is actually painted correctly. -->
  80. <eval expected="86400" xpath="//flow/block/@bpd"/>
  81. <eval expected="337891" xpath="//flow/block/@ipd"/>
  82. <eval expected="14400" xpath="//flow/block/lineArea[3]/inlineblockparent[1]/@bpd"/>
  83. <eval expected="337891" xpath="//flow/block/lineArea[3]/inlineblockparent[1]/@ipd"/>
  84. <eval expected="14400" xpath="//flow/block/lineArea[4]/inlineblockparent[1]/@bpd"/>
  85. <eval expected="337891" xpath="//flow/block/lineArea[4]/inlineblockparent[1]/@ipd"/>
  86. </checks>
  87. </testcase>