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_keep-together.xml 3.4KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  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 keep-together.within-line.
  21. </p>
  22. <p>
  23. This test builds on the results from page-breaking_6.xml.
  24. </p>
  25. </info>
  26. <fo>
  27. <fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format">
  28. <fo:layout-master-set>
  29. <fo:simple-page-master master-name="simple" page-height="5in" page-width="5in">
  30. <fo:region-body/>
  31. </fo:simple-page-master>
  32. </fo:layout-master-set>
  33. <fo:page-sequence master-reference="simple">
  34. <fo:flow flow-name="xsl-region-body">
  35. <fo:block-container width="100pt" background-color="yellow">
  36. <fo:block keep-together.within-line="always">This is Blah blah blah blah!</fo:block>
  37. <fo:block>This is <fo:inline keep-together.within-line="always">Blah blah blah blah!</fo:inline></fo:block>
  38. <fo:block>This is <fo:wrapper keep-together.within-line="always">Blah blah blah blah!</fo:wrapper></fo:block>
  39. <fo:block>
  40. <fo:inline keep-together.within-line="always">
  41. This<fo:inline> entire</fo:inline> sentence
  42. <fo:inline>should be </fo:inline>kept
  43. <fo:inline>together
  44. <fo:inline>on
  45. <fo:inline>one
  46. <fo:inline>very,
  47. <fo:inline>very,</fo:inline>
  48. <fo:inline>very,</fo:inline>
  49. <fo:inline>very,</fo:inline>
  50. <fo:inline>long</fo:inline>
  51. </fo:inline></fo:inline></fo:inline>line
  52. </fo:inline>
  53. </fo:inline>
  54. </fo:block>
  55. </fo:block-container>
  56. </fo:flow>
  57. </fo:page-sequence>
  58. </fo:root>
  59. </fo>
  60. <checks>
  61. <!-- The layout engine should warn the user about the overflow in this case. -->
  62. <eval expected="This is Blah blah blah blah!" xpath="//flow/block[1]/block[1]/block[1]/lineArea[1]"/>
  63. <!-- The layout engine should warn the user about the overflow in this case. -->
  64. <eval expected="This is" xpath="//flow/block[1]/block[1]/block[2]/lineArea[1]"/>
  65. <eval expected="Blah blah blah blah!" xpath="//flow/block[1]/block[1]/block[2]/lineArea[2]"/>
  66. <!-- The layout engine should warn the user about the overflow in this case. -->
  67. <eval expected="This is" xpath="//flow/block[1]/block[1]/block[3]/lineArea[1]"/>
  68. <eval expected="Blah blah blah blah!" xpath="//flow/block[1]/block[1]/block[3]/lineArea[2]"/>
  69. <!-- check effect of nested inlines (see Bugzilla #49848) -->
  70. <eval expected="1" xpath="count(//flow/block[1]/block[1]/block[4]/lineArea)" />
  71. </checks>
  72. </testcase>