<?xml version="1.0" encoding="UTF-8"?>
<!--
  Licensed to the Apache Software Foundation (ASF) under one or more
  contributor license agreements.  See the NOTICE file distributed with
  this work for additional information regarding copyright ownership.
  The ASF licenses this file to You under the Apache License, Version 2.0
  (the "License"); you may not use this file except in compliance with
  the License.  You may obtain a copy of the License at

       http://www.apache.org/licenses/LICENSE-2.0

  Unless required by applicable law or agreed to in writing, software
  distributed under the License is distributed on an "AS IS" BASIS,
  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  See the License for the specific language governing permissions and
  limitations under the License.
-->
<!-- $Id: static-content_overflow_1.xml 627324 2008-02-13 09:35:01Z maxberger $ -->
<testcase>
  <info>
    <p>
      This test checks behaviour with overflowing content on static-content.
    </p>
    <p>
      Visual check: If there's a red line between the second and third line, the
      behaviour is wrong.
    </p>
  </info>
  <fo>
    <fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format">
      <fo:layout-master-set>
        <fo:simple-page-master master-name="normal" page-width="5in" page-height="5in" margin="20pt">
          <fo:region-body margin-top="2em" margin-bottom="2em"/>
          <fo:region-before extent="2em" background-color="lightgray"/>
          <fo:region-after extent="2em" background-color="lightgray"/>
        </fo:simple-page-master>
      </fo:layout-master-set>
      <fo:page-sequence master-reference="normal" text-align="justify">
        <fo:static-content flow-name="xsl-region-before">
          <fo:block id="text-before" border="solid 1pt red" border-before-width.conditionality="retain">Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Pellentesque hendrerit euismod velit. Nulla facilisi. Etiam et risus at neque ultrices facilisis. Donec lectus est, nonummy quis, rhoncus bibendum, porta at, nisl.</fo:block>
        </fo:static-content>
        <fo:static-content flow-name="xsl-region-after">
          <fo:block id="text-after" border="solid 1pt red" border-before-width.conditionality="retain">Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Pellentesque hendrerit euismod velit. Nulla facilisi. Etiam et risus at neque ultrices facilisis. Donec lectus est, nonummy quis, rhoncus bibendum, porta at, nisl.</fo:block>
        </fo:static-content>
        <fo:flow flow-name="xsl-region-body">
          <fo:block>xsl-region-body</fo:block>
        </fo:flow>
      </fo:page-sequence>
    </fo:root>
  </fo>
  <checks>
    <!-- fo:block must not be broken into multiple parts! -->
    <eval expected="1" xpath="count(//block[@prod-id='text-before'])"/>
    <eval expected="1" xpath="count(//block[@prod-id='text-after'])"/>
    
    <!-- The following shows the overflow -->
    <true expected="24000" xpath="//regionBefore/@bpd"/>
    <true expected="24000" xpath="//regionAfter/@bpd"/>
    <true expected="60600" xpath="sum(//block[@prod-id='text-before']/@bpda)"/>
    <true expected="60600" xpath="sum(//block[@prod-id='text-after']/@bpda)"/>
  </checks>
</testcase>
