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.

marker_white-space_static-content.xml 2.3KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  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 is a regression check for a ClassCastException which occured because
  21. white-space before and after a block in a marker wasn't removed when it's
  22. copied into a static-contant element through retrieve-marker. The element list
  23. returned contained InlineKnuthSequences which cause the ClassCastException in
  24. wrapPositionElements().
  25. </p>
  26. </info>
  27. <fo>
  28. <fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format">
  29. <fo:layout-master-set>
  30. <fo:simple-page-master master-name="normal" page-width="8.5in" page-height="14in" margin="36pt">
  31. <fo:region-body margin-top="18pt" margin-bottom="0pt"/>
  32. <fo:region-before extent="11in"/>
  33. </fo:simple-page-master>
  34. </fo:layout-master-set>
  35. <fo:page-sequence master-reference="normal">
  36. <fo:static-content flow-name="xsl-region-before">
  37. <fo:retrieve-marker retrieve-class-name="header" retrieve-position="first-including-carryover" retrieve-boundary="page"/>
  38. </fo:static-content>
  39. <fo:flow flow-name="xsl-region-body">
  40. <fo:marker marker-class-name="header">
  41. <fo:block>x</fo:block>
  42. </fo:marker>
  43. <fo:block>Blah blah</fo:block>
  44. </fo:flow>
  45. </fo:page-sequence>
  46. </fo:root>
  47. </fo>
  48. <checks>
  49. <!-- Only check that a page is produced. The bug originally caused a ClassCastException in StaticContentLayoutManager.StaticContentBreaker. -->
  50. <eval expected="1" xpath="count(//pageViewport)"/>
  51. </checks>
  52. </testcase>