Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.

block_last-line-end-indent.xml 6.1KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <!--
  3. Copyright 2006 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 the last-line-end-indent property.
  19. </p>
  20. </info>
  21. <fo>
  22. <fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format">
  23. <fo:layout-master-set>
  24. <fo:simple-page-master master-name="normal" page-width="5in" page-height="5in">
  25. <fo:region-body/>
  26. </fo:simple-page-master>
  27. </fo:layout-master-set>
  28. <fo:page-sequence master-reference="normal">
  29. <fo:flow flow-name="xsl-region-body">
  30. <fo:block last-line-end-indent="20pt" text-align="end" id="end">
  31. In olden times when wishing still helped one, there lived a king whose daughters
  32. were all beautiful; and the youngest was so beautiful that the sun itself, which
  33. has seen so much, was astonished whenever it shone in her face.
  34. </fo:block>
  35. <fo:block last-line-end-indent="20pt" text-align="justify" text-align-last="justify" id="justify">
  36. In olden times when wishing still helped one, there lived a king whose daughters
  37. were all beautiful; and the youngest was so beautiful that the sun itself, which
  38. has seen so much, was astonished whenever it shone in her face.
  39. </fo:block>
  40. <fo:block last-line-end-indent="-20pt" end-indent="20pt" text-align="justify" text-align-last="justify" id="lastneg">
  41. In olden times when wishing still helped one, there lived a king whose daughters
  42. were all beautiful; and the youngest was so beautiful that the sun itself, which
  43. has seen so much, was astonished whenever it shone in her face.
  44. </fo:block>
  45. <fo:block last-line-end-indent="50%" text-align="justify" text-align-last="justify" id="justify50">
  46. In olden times when wishing still helped one, there lived a king whose daughters
  47. were all beautiful; and the youngest was so beautiful that the sun itself, which
  48. has seen so much, was astonished whenever it shone in her face.
  49. </fo:block>
  50. <fo:block last-line-end-indent="50%" text-align="center" id="center">
  51. In olden times when wishing still helped one, there lived a king whose daughters
  52. were all beautiful; and the youngest was so beautiful that the sun itself, which
  53. has seen so much, was astonished whenever it shone in her face.
  54. </fo:block>
  55. <fo:block last-line-end-indent="20pt" text-align="justify" text-align-last="justify" id="nested">
  56. This is just for testing purpose and this line will be indented.
  57. <fo:block>This is the nested block.</fo:block>
  58. The text following the nested block should be indented as well. The text following
  59. the nested block should be indented as well.
  60. </fo:block>
  61. </fo:flow>
  62. </fo:page-sequence>
  63. </fo:root>
  64. </fo>
  65. <checks>
  66. <eval expected="360000" xpath="//block[@prod-id='end']/lineArea[1]/@start-indent + //block[@prod-id='end']/lineArea[1]/text/@ipd"/>
  67. <eval expected="360000" xpath="//block[@prod-id='end']/lineArea[2]/@start-indent + //block[@prod-id='end']/lineArea[2]/text/@ipd"/>
  68. <eval expected="360000" xpath="//block[@prod-id='end']/lineArea[3]/@start-indent + //block[@prod-id='end']/lineArea[3]/text/@ipd"/>
  69. <eval expected="340000" xpath="//block[@prod-id='end']/lineArea[4]/@start-indent + //block[@prod-id='end']/lineArea[4]/text/@ipd"/>
  70. <!-- 360000 - 20000 = 340000 -->
  71. <eval expected="360000" xpath="//block[@prod-id='justify']/lineArea[1]/text/@ipd"/>
  72. <eval expected="360000" xpath="//block[@prod-id='justify']/lineArea[2]/text/@ipd"/>
  73. <eval expected="360000" xpath="//block[@prod-id='justify']/lineArea[3]/text/@ipd"/>
  74. <eval expected="340000" xpath="//block[@prod-id='justify']/lineArea[4]/text/@ipd"/>
  75. <eval expected="340000" xpath="//block[@prod-id='lastneg']/lineArea[1]/text/@ipd"/>
  76. <eval expected="340000" xpath="//block[@prod-id='lastneg']/lineArea[2]/text/@ipd"/>
  77. <eval expected="340000" xpath="//block[@prod-id='lastneg']/lineArea[3]/text/@ipd"/>
  78. <eval expected="360000" xpath="//block[@prod-id='lastneg']/lineArea[4]/text/@ipd"/>
  79. <eval expected="360000" xpath="//block[@prod-id='justify50']/lineArea[1]/text/@ipd"/>
  80. <eval expected="360000" xpath="//block[@prod-id='justify50']/lineArea[2]/text/@ipd"/>
  81. <eval expected="360000" xpath="//block[@prod-id='justify50']/lineArea[3]/text/@ipd"/>
  82. <eval expected="180000" xpath="//block[@prod-id='justify50']/lineArea[4]/text/@ipd"/>
  83. <eval expected="360000" xpath="(2 * //block[@prod-id='center']/lineArea[1]/@start-indent) + //block[@prod-id='center']/lineArea[1]/text/@ipd"/>
  84. <eval expected="360000" xpath="(2 * //block[@prod-id='center']/lineArea[2]/@start-indent) + //block[@prod-id='center']/lineArea[2]/text/@ipd"/>
  85. <eval expected="360000" xpath="(2 * //block[@prod-id='center']/lineArea[3]/@start-indent) + //block[@prod-id='center']/lineArea[3]/text/@ipd"/>
  86. <eval expected="360000" xpath="(2 * //block[@prod-id='center']/lineArea[4]/@start-indent) + //block[@prod-id='center']/lineArea[4]/text/@ipd"/>
  87. <eval expected="180000" xpath="(2 * //block[@prod-id='center']/lineArea[5]/@start-indent) + //block[@prod-id='center']/lineArea[5]/text/@ipd"/>
  88. <!-- 7.15.3, XSL 1.0: this block is end-indented because its following sibling is a block and not a line. This is in contrast to the specified behaviour of text-indent. -->
  89. <eval expected="340000" xpath="//block[@prod-id='nested']/lineArea[1]/text/@ipd"/>
  90. <eval expected="340000" xpath="//block[@prod-id='nested']/block[1]/lineArea[1]/text/@ipd"/>
  91. <eval expected="360000" xpath="//block[@prod-id='nested']/lineArea[2]/text/@ipd"/>
  92. <eval expected="340000" xpath="//block[@prod-id='nested']/lineArea[3]/text/@ipd"/>
  93. </checks>
  94. </testcase>