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_border_padding.xml 10KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141
  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 inlines with border and padding 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" margin="5pt">
  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" language="en">
  31. <fo:flow flow-name="xsl-region-body" font-size="10pt">
  32. <fo:block background-color="silver" margin="2pt 0pt 2pt 0pt">
  33. To <fo:inline border="solid 1pt red" background-color="yellow">emphasize</fo:inline> a word we give it a 1pt border and a background.
  34. </fo:block>
  35. <fo:block background-color="silver" margin="10pt 0pt 10pt 0pt">
  36. Demonstrates a big border <fo:inline border="solid 5pt red" padding="5pt" background-color="yellow">inline with border="solid 5pt red" padding="5pt"</fo:inline> extending over the small allocation rectangle to the top and bottom.
  37. </fo:block>
  38. <fo:block background-color="silver" margin="10pt 0pt 10pt 0pt">
  39. Demonstrates <fo:inline border-style="solid" border-width="1pt 2pt 3pt 4pt" border-color="red" padding="1pt 2pt 3pt 4pt" background-color="yellow">unsymmetric borders and padding</fo:inline> but the baselines should align.
  40. </fo:block>
  41. <fo:block background-color="silver" margin="10pt 0pt 10pt 0pt" font-size="20pt">
  42. Big border <fo:inline border="solid 5pt red" padding="5pt" background-color="yellow" font-size="8pt">with a smaller font</fo:inline> but the baselines should align.
  43. </fo:block>
  44. <fo:block background-color="silver" margin="3pt 0pt 3pt 0pt">
  45. This demonstrates correct line breaking of a fo:inline because it does fit nicely..
  46. This demonstrates correct line breaking of a fo:inline because it does fit <fo:inline border="solid 1pt red" padding-start="2pt" padding-end="2pt" background-color="yellow">nicely..
  47. Not really as we started a fo:inline with border/padding just before the word "nicely" which forces it to the next line.</fo:inline>
  48. </fo:block>
  49. <fo:block background-color="silver" margin="3pt 0pt 3pt 0pt">
  50. Demonstrates nested
  51. <fo:inline border="solid 2pt red" padding-start="2pt" padding-end="2pt" background-color="yellow">inlines
  52. <fo:inline border="solid 1pt green" padding-start="2pt" padding-end="2pt" background-color="orange">finishing together
  53. </fo:inline>
  54. </fo:inline>
  55. </fo:block>
  56. </fo:flow>
  57. </fo:page-sequence>
  58. </fo:root>
  59. </fo>
  60. <checks>
  61. <eval expected="48350" xpath="//flow/block[1]/lineArea/inlineparent/@ipd"/>
  62. <eval expected="50350" xpath="//flow/block[1]/lineArea/inlineparent/@ipda"/>
  63. <eval expected="0" xpath="//flow/block[1]/lineArea/inlineparent/@offset"/>
  64. <eval expected="(solid,#ff0000,1000)" xpath="//flow/block[1]/lineArea/inlineparent/@border-after"/>
  65. <eval expected="(solid,#ff0000,1000)" xpath="//flow/block[1]/lineArea/inlineparent/@border-before"/>
  66. <eval expected="(solid,#ff0000,1000)" xpath="//flow/block[1]/lineArea/inlineparent/@border-end"/>
  67. <eval expected="(solid,#ff0000,1000)" xpath="//flow/block[1]/lineArea/inlineparent/@border-start"/>
  68. <eval expected="208190" xpath="//flow/block[2]/lineArea/inlineparent/@ipd"/>
  69. <eval expected="228190" xpath="//flow/block[2]/lineArea/inlineparent/@ipda"/>
  70. <eval expected="0" xpath="//flow/block[2]/lineArea/inlineparent/@offset"/>
  71. <eval expected="(solid,#ff0000,5000)" xpath="//flow/block[2]/lineArea/inlineparent/@border-after"/>
  72. <eval expected="(solid,#ff0000,5000)" xpath="//flow/block[2]/lineArea/inlineparent/@border-before"/>
  73. <eval expected="(solid,#ff0000,5000)" xpath="//flow/block[2]/lineArea/inlineparent/@border-end"/>
  74. <eval expected="(solid,#ff0000,5000)" xpath="//flow/block[2]/lineArea/inlineparent/@border-start"/>
  75. <eval expected="5000" xpath="//flow/block[2]/lineArea/inlineparent/@padding-after"/>
  76. <eval expected="5000" xpath="//flow/block[2]/lineArea/inlineparent/@padding-before"/>
  77. <eval expected="5000" xpath="//flow/block[2]/lineArea/inlineparent/@padding-end"/>
  78. <eval expected="5000" xpath="//flow/block[2]/lineArea/inlineparent/@padding-start"/>
  79. <eval expected="151170" xpath="//flow/block[3]/lineArea/inlineparent/@ipd"/>
  80. <eval expected="163170" xpath="//flow/block[3]/lineArea/inlineparent/@ipda"/>
  81. <eval expected="0" xpath="//flow/block[3]/lineArea/inlineparent/@offset"/>
  82. <eval expected="(solid,#ff0000,3000)" xpath="//flow/block[3]/lineArea/inlineparent/@border-after"/>
  83. <eval expected="(solid,#ff0000,1000)" xpath="//flow/block[3]/lineArea/inlineparent/@border-before"/>
  84. <eval expected="(solid,#ff0000,2000)" xpath="//flow/block[3]/lineArea/inlineparent/@border-end"/>
  85. <eval expected="(solid,#ff0000,4000)" xpath="//flow/block[3]/lineArea/inlineparent/@border-start"/>
  86. <eval expected="3000" xpath="//flow/block[3]/lineArea/inlineparent/@padding-after"/>
  87. <eval expected="1000" xpath="//flow/block[3]/lineArea/inlineparent/@padding-before"/>
  88. <eval expected="2000" xpath="//flow/block[3]/lineArea/inlineparent/@padding-end"/>
  89. <eval expected="4000" xpath="//flow/block[3]/lineArea/inlineparent/@padding-start"/>
  90. <eval expected="64464" xpath="//flow/block[4]/lineArea/inlineparent/@ipd"/>
  91. <eval expected="84464" xpath="//flow/block[4]/lineArea/inlineparent/@ipda"/>
  92. <eval expected="8616" xpath="//flow/block[4]/lineArea/inlineparent/@offset"/>
  93. <eval expected="(solid,#ff0000,5000)" xpath="//flow/block[4]/lineArea/inlineparent/@border-after"/>
  94. <eval expected="(solid,#ff0000,5000)" xpath="//flow/block[4]/lineArea/inlineparent/@border-before"/>
  95. <eval expected="(solid,#ff0000,5000)" xpath="//flow/block[4]/lineArea/inlineparent/@border-end"/>
  96. <eval expected="(solid,#ff0000,5000)" xpath="//flow/block[4]/lineArea/inlineparent/@border-start"/>
  97. <eval expected="5000" xpath="//flow/block[4]/lineArea/inlineparent/@padding-after"/>
  98. <eval expected="5000" xpath="//flow/block[4]/lineArea/inlineparent/@padding-before"/>
  99. <eval expected="5000" xpath="//flow/block[4]/lineArea/inlineparent/@padding-end"/>
  100. <eval expected="5000" xpath="//flow/block[4]/lineArea/inlineparent/@padding-start"/>
  101. <eval expected="340710" xpath="//flow/block[5]/lineArea[3]/inlineparent/@ipd"/>
  102. <eval expected="343710" xpath="//flow/block[5]/lineArea[3]/inlineparent/@ipda"/>
  103. <eval expected="0" xpath="//flow/block[5]/lineArea[3]/inlineparent/@offset"/>
  104. <eval expected="(solid,#ff0000,1000)" xpath="//flow/block[5]/lineArea[3]/inlineparent/@border-after"/>
  105. <eval expected="(solid,#ff0000,1000)" xpath="//flow/block[5]/lineArea[3]/inlineparent/@border-before"/>
  106. <eval expected="(solid,#ff0000,1000)" xpath="//flow/block[5]/lineArea[3]/inlineparent/@border-start"/>
  107. <eval expected="2000" xpath="//flow/block[5]/lineArea[3]/inlineparent/@padding-start"/>
  108. <eval expected="193840" xpath="//flow/block[5]/lineArea[4]/inlineparent/@ipd"/>
  109. <eval expected="196840" xpath="//flow/block[5]/lineArea[4]/inlineparent/@ipda"/>
  110. <eval expected="0" xpath="//flow/block[5]/lineArea[4]/inlineparent/@offset"/>
  111. <eval expected="(solid,#ff0000,1000)" xpath="//flow/block[5]/lineArea[4]/inlineparent/@border-after"/>
  112. <eval expected="(solid,#ff0000,1000)" xpath="//flow/block[5]/lineArea[4]/inlineparent/@border-before"/>
  113. <eval expected="(solid,#ff0000,1000)" xpath="//flow/block[5]/lineArea[4]/inlineparent/@border-end"/>
  114. <eval expected="2000" xpath="//flow/block[5]/lineArea[4]/inlineparent/@padding-end"/>
  115. <eval expected="113270" xpath="//flow/block[6]/lineArea/inlineparent/@ipd"/>
  116. <eval expected="121270" xpath="//flow/block[6]/lineArea/inlineparent/@ipda"/>
  117. <eval expected="0" xpath="//flow/block[6]/lineArea/inlineparent/@offset"/>
  118. <eval expected="(solid,#ff0000,2000)" xpath="//flow/block[6]/lineArea/inlineparent/@border-after"/>
  119. <eval expected="(solid,#ff0000,2000)" xpath="//flow/block[6]/lineArea/inlineparent/@border-before"/>
  120. <eval expected="(solid,#ff0000,2000)" xpath="//flow/block[6]/lineArea/inlineparent/@border-end"/>
  121. <eval expected="(solid,#ff0000,2000)" xpath="//flow/block[6]/lineArea/inlineparent/@border-start"/>
  122. <eval expected="2000" xpath="//flow/block[6]/lineArea/inlineparent/@padding-end"/>
  123. <eval expected="2000" xpath="//flow/block[6]/lineArea/inlineparent/@padding-start"/>
  124. <eval expected="76150" xpath="//flow/block[6]/lineArea/inlineparent/inlineparent/@ipd"/>
  125. <eval expected="82150" xpath="//flow/block[6]/lineArea/inlineparent/inlineparent/@ipda"/>
  126. <eval expected="0" xpath="//flow/block[6]/lineArea/inlineparent/inlineparent/@offset"/>
  127. <eval expected="(solid,#008000,1000)" xpath="//flow/block[6]/lineArea/inlineparent/inlineparent/@border-after"/>
  128. <eval expected="(solid,#008000,1000)" xpath="//flow/block[6]/lineArea/inlineparent/inlineparent/@border-before"/>
  129. <eval expected="(solid,#008000,1000)" xpath="//flow/block[6]/lineArea/inlineparent/inlineparent/@border-end"/>
  130. <eval expected="(solid,#008000,1000)" xpath="//flow/block[6]/lineArea/inlineparent/inlineparent/@border-start"/>
  131. <eval expected="2000" xpath="//flow/block[6]/lineArea/inlineparent/inlineparent/@padding-end"/>
  132. <eval expected="2000" xpath="//flow/block[6]/lineArea/inlineparent/inlineparent/@padding-start"/>
  133. </checks>
  134. </testcase>