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_white-space.xml 4.2KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  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 white space handling for white-space shorthand property.
  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">
  31. <fo:flow flow-name="xsl-region-body">
  32. <fo:block white-space="normal" background-color="silver" margin="1pt 0pt 1pt 0pt" text-decoration="underline">
  33. normal
  34. whitespace
  35. handling
  36. </fo:block>
  37. <fo:block white-space="pre" background-color="silver" margin="1pt 0pt 1pt 0pt" text-decoration="underline">
  38. preserve
  39. whitespace
  40. handling
  41. </fo:block>
  42. <fo:block white-space="nowrap" background-color="silver" margin="1pt 0pt 1pt 0pt" text-decoration="underline">
  43. nowrap
  44. whitespace
  45. handling
  46. nowrap
  47. whitespace
  48. handling
  49. nowrap
  50. whitespace
  51. handling
  52. </fo:block>
  53. </fo:flow>
  54. </fo:page-sequence>
  55. </fo:root>
  56. </fo>
  57. <checks>
  58. <eval expected="3" xpath="count(//flow/block[1]/lineArea[1]/text/word)"/>
  59. <eval expected="2" xpath="count(//flow/block[1]/lineArea[1]/text/space)"/>
  60. <eval expected="0" xpath="count(//flow/block[2]/lineArea[1]/text/word)"/>
  61. <eval expected="0" xpath="count(//flow/block[2]/lineArea[1]/text/space)"/>
  62. <eval expected="1" xpath="count(//flow/block[2]/lineArea[2]/text/word)"/>
  63. <eval expected="91" xpath="count(//flow/block[2]/lineArea[2]/text/space)"/>
  64. <eval expected="1" xpath="count(//flow/block[2]/lineArea[3]/text/word)"/>
  65. <eval expected="89" xpath="count(//flow/block[2]/lineArea[3]/text/space)"/>
  66. <eval expected="1" xpath="count(//flow/block[2]/lineArea[4]/text/word)"/>
  67. <eval expected="91" xpath="count(//flow/block[2]/lineArea[4]/text/space)"/>
  68. <eval expected="9" xpath="count(//flow/block[3]/lineArea[1]/text/word)"/>
  69. <eval expected="8" xpath="count(//flow/block[3]/lineArea[1]/text/space)"/>
  70. </checks>
  71. </testcase>