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.3KB

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