<?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: leader-alignment.xml 1293736 2012-02-26 02:29:01Z gadams $ -->
<testcase>
  <info>
    <p>
      This test checks leaders
    </p>
  </info>
  <fo>
    <fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format" xmlns:svg="http://www.w3.org/2000/svg">
      <fo:layout-master-set>
        <fo:simple-page-master master-name="normal" page-width="5in" page-height="6in">
          <fo:region-body/>
        </fo:simple-page-master>
      </fo:layout-master-set>
      <fo:page-sequence master-reference="normal" white-space-collapse="true">
        <fo:flow flow-name="xsl-region-body">
          <fo:block margin="0pt" padding-start="10mm">
                margin="0pt" padding-start="10mm"
          </fo:block>
          <fo:block padding-start="10mm">
                padding-start="10mm"
          </fo:block>
          <fo:block>
            <fo:leader leader-length.minimum="12pt"
              leader-length.optimum="80pt"
              leader-length.maximum="100%" leader-pattern="dots" leader-alignment="page"/>
              leader-alignment="page"
          </fo:block>
          <fo:block margin="0pt" padding-start="10mm">
            <fo:leader leader-length.minimum="12pt"
              leader-length.optimum="80pt"
              leader-length.maximum="100%" leader-pattern="dots" leader-alignment="page"/>
              leader-alignment="page"
          </fo:block>
          <fo:block margin="0pt" padding-start="5mm">
            <fo:leader leader-length.minimum="12pt"
              leader-length.optimum="80pt"
              leader-length.maximum="100%" leader-pattern="dots" leader-alignment="reference-area"/>
              leader-alignment="reference-area"
            <fo:leader leader-length.minimum="12pt"
              leader-length.optimum="80pt"
              leader-length.maximum="100%" leader-pattern="dots" leader-alignment="reference-area"/>
              leader-alignment="reference-area" Leader-pattern is aligned as if it began on the current reference-area's content-rectangle start-edge.
          </fo:block>
        </fo:flow>
      </fo:page-sequence>
    </fo:root>
  </fo>
  <checks>
    <eval expected="331654" xpath="//flow/block[1]/@ipd"/>
    <eval expected="28346" xpath="//flow/block[1]/@padding-start"/>
    <eval expected="28346" xpath="//flow/block[1]/@start-indent"/>
    <eval expected="331654" xpath="//flow/block[1]/lineArea/@ipd"/>
    <eval expected="140542" xpath="//flow/block[1]/lineArea/@end-indent"/>
    <eval expected="1" xpath="count(//flow/block[1]/lineArea/*)"/>
    <eval expected="text" xpath="local-name(//flow/block[1]/lineArea/*[position()=1])"/>
    <eval expected="191112" xpath="//flow/block[1]/lineArea/text/@ipd"/>

    <eval expected="360000" xpath="//flow/block[2]/@ipd"/>
    <eval expected="28346" xpath="//flow/block[2]/@padding-start"/>
    <eval expected="-28346" xpath="//flow/block[2]/@space-start"/>
    <eval expected="360000" xpath="//flow/block[2]/lineArea/@ipd"/>
    <eval expected="241104" xpath="//flow/block[2]/lineArea/@end-indent"/>
    <eval expected="1" xpath="count(//flow/block[2]/lineArea/*)"/>
    <eval expected="text" xpath="local-name(//flow/block[2]/lineArea/*[position()=1])"/>
    <eval expected="118896" xpath="//flow/block[2]/lineArea/text/@ipd"/>

    <eval expected="360000" xpath="//flow/block[3]/@ipd"/>
    <true xpath="//flow/block[3]/@padding-start = 'false'"/>
    <true xpath="//flow/block[3]/@space-start = 'false'"/>
    <true xpath="//flow/block[3]/@start-indent = 'false'"/>
    <true xpath="//flow/block[3]/@end-indent = 'false'"/>
    <eval expected="360000" xpath="//flow/block[3]/lineArea/@ipd"/>
    <eval expected="145084" xpath="//flow/block[3]/lineArea/@end-indent"/>
    <eval expected="2" xpath="count(//flow/block[3]/lineArea/*)"/>
    <eval expected="inlineparent" xpath="local-name(//flow/block[3]/lineArea/*[position()=1])"/>
    <eval expected="text" xpath="local-name(//flow/block[3]/lineArea/*[position()=2])"/>
    <eval expected="80000" xpath="//flow/block[3]/lineArea/inlineparent/@ipd"/>
    <eval expected="134916" xpath="//flow/block[3]/lineArea/text/@ipd"/>

    <eval expected="331654" xpath="//flow/block[4]/@ipd"/>
    <eval expected="28346" xpath="//flow/block[4]/@padding-start"/>
    <eval expected="28346" xpath="//flow/block[4]/@start-indent"/>
    <true xpath="//flow/block[4]/@space-start = 'false'"/>
    <true xpath="//flow/block[4]/@end-indent = 'false'"/>
    <eval expected="331654" xpath="//flow/block[4]/lineArea/@ipd"/>
    <eval expected="116738" xpath="//flow/block[4]/lineArea/@end-indent"/>
    <eval expected="2" xpath="count(//flow/block[4]/lineArea/*)"/>
    <eval expected="inlineparent" xpath="local-name(//flow/block[4]/lineArea/*[position()=1])"/>
    <eval expected="text" xpath="local-name(//flow/block[4]/lineArea/*[position()=2])"/>
    <eval expected="80000" xpath="//flow/block[4]/lineArea/inlineparent/@ipd"/>
    <eval expected="134916" xpath="//flow/block[4]/lineArea/text/@ipd"/>

    <eval expected="345827" xpath="//flow/block[5]/@ipd"/>
    <eval expected="14173" xpath="//flow/block[5]/@padding-start"/>
    <eval expected="14173" xpath="//flow/block[5]/@start-indent"/>
    <true xpath="//flow/block[5]/@space-start = 'false'"/>
    <true xpath="//flow/block[5]/@end-indent = 'false'"/>
    <eval expected="4" xpath="count(//flow/block[5]/lineArea)"/>
    <eval expected="345827" xpath="//flow/block[5]/lineArea[1]/@ipd"/>
    <eval expected="78903" xpath="//flow/block[5]/lineArea[1]/@end-indent"/>
    <eval expected="2" xpath="count(//flow/block[5]/lineArea[1]/*)"/>
    <eval expected="inlineparent" xpath="local-name(//flow/block[5]/lineArea[1]/*[position()=1])"/>
    <eval expected="text" xpath="local-name(//flow/block[5]/lineArea[1]/*[position()=2])"/>
    <eval expected="80000" xpath="//flow/block[5]/lineArea[1]/inlineparent/@ipd"/>
    <eval expected="186924" xpath="//flow/block[5]/lineArea[1]/text/@ipd"/>
    <eval expected="345827" xpath="//flow/block[5]/lineArea[2]/@ipd"/>
    <eval expected="34215" xpath="//flow/block[5]/lineArea[2]/@end-indent"/>
    <eval expected="2" xpath="count(//flow/block[5]/lineArea[2]/*)"/>
    <eval expected="inlineparent" xpath="local-name(//flow/block[5]/lineArea[2]/*[position()=1])"/>
    <eval expected="text" xpath="local-name(//flow/block[5]/lineArea[2]/*[position()=2])"/>
    <eval expected="80000" xpath="//flow/block[5]/lineArea[2]/inlineparent/@ipd"/>
    <eval expected="231612" xpath="//flow/block[5]/lineArea[2]/text/@ipd"/>
    <eval expected="345827" xpath="//flow/block[5]/lineArea[3]/@ipd"/>
    <eval expected="15371" xpath="//flow/block[5]/lineArea[3]/@end-indent"/>
    <eval expected="1" xpath="count(//flow/block[5]/lineArea[3]/*)"/>
    <eval expected="text" xpath="local-name(//flow/block[5]/lineArea[3]/*[position()=1])"/>
    <eval expected="330456" xpath="//flow/block[5]/lineArea[3]/text/@ipd"/>
    <eval expected="345827" xpath="//flow/block[5]/lineArea[4]/@ipd"/>
    <eval expected="192419" xpath="//flow/block[5]/lineArea[4]/@end-indent"/>
    <eval expected="1" xpath="count(//flow/block[5]/lineArea[4]/*)"/>
    <eval expected="text" xpath="local-name(//flow/block[5]/lineArea[4]/*[position()=1])"/>
    <eval expected="153408" xpath="//flow/block[5]/lineArea[4]/text/@ipd"/>
  </checks>
</testcase>
