File: keep-together_overflow-recovery_bug49835.xml

package info (click to toggle)
fop 1%3A1.1.dfsg2-1%2Bdeb8u1
  • links: PTS, VCS
  • area: main
  • in suites: jessie
  • size: 100,492 kB
  • ctags: 28,219
  • sloc: java: 179,129; xml: 129,894; sh: 387; python: 316; makefile: 46
file content (161 lines) | stat: -rw-r--r-- 7,925 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
<?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: keep-together_overflow-recovery_bug49835.xml 1079013 2011-03-07 23:04:03Z adelmelle $ -->
<testcase>
  <info>
    <p>This test checks for an issue with overflow recovery if there is no 
    previous break. See also Bugzilla 49835. The test checks behavior both
    in single- and multi-column layout. 
    Expected behavior: in case the next page does not have more space available, 
    content should just overflow on the first page. Otherwise, the entire block 
    should be deferred to the next page, but only if it can be kept together there.
    </p>
  </info>
  <fo>
    <fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format">
      <fo:layout-master-set>
        <fo:simple-page-master master-name="master-short-single" page-width="10cm" page-height="2cm">
          <fo:region-body />
        </fo:simple-page-master>
        <fo:simple-page-master master-name="master-longer-single" page-width="10cm" page-height="2.5cm">
          <fo:region-body />
        </fo:simple-page-master>
        <fo:simple-page-master master-name="master-long-single" page-width="10cm" page-height="5cm">
          <fo:region-body />
        </fo:simple-page-master>
        <fo:simple-page-master master-name="master-short-multi" page-width="10cm" page-height="2cm">
          <fo:region-body column-count="3"/>
        </fo:simple-page-master>
        <fo:simple-page-master master-name="master-longer-multi" page-width="10cm" page-height="2.5cm">
          <fo:region-body column-count="3"/>
        </fo:simple-page-master>
        <fo:simple-page-master master-name="master-long-multi" page-width="10cm" page-height="5cm">
          <fo:region-body column-count="3"/>
        </fo:simple-page-master>
        <fo:page-sequence-master master-name="master-one">
          <fo:single-page-master-reference master-reference="master-short-single"/>
        </fo:page-sequence-master>
        <fo:page-sequence-master master-name="master-two">
          <fo:single-page-master-reference master-reference="master-short-single"/>
          <fo:single-page-master-reference master-reference="master-long-single"/>
        </fo:page-sequence-master>
        <fo:page-sequence-master master-name="master-three">
          <fo:single-page-master-reference master-reference="master-short-multi"/>
        </fo:page-sequence-master>
        <fo:page-sequence-master master-name="master-four">
          <fo:single-page-master-reference master-reference="master-short-multi"/>
          <fo:single-page-master-reference master-reference="master-long-multi"/>
        </fo:page-sequence-master>
        <fo:page-sequence-master master-name="master-five">
          <fo:single-page-master-reference master-reference="master-short-single"/>
          <fo:single-page-master-reference master-reference="master-longer-single"/>
        </fo:page-sequence-master>
        <fo:page-sequence-master master-name="master-six">
          <fo:single-page-master-reference master-reference="master-short-multi"/>
          <fo:single-page-master-reference master-reference="master-longer-multi"/>
        </fo:page-sequence-master>
      </fo:layout-master-set>
      <fo:page-sequence master-reference="master-one">
        <fo:flow flow-name="xsl-region-body">
          <fo:block id="block-1" keep-together.within-column="always">
            <fo:block>Line 1</fo:block>
            <fo:block>Line 2</fo:block>
            <fo:block>Line 3</fo:block>
            <fo:block>Line 4</fo:block>
            <fo:block>Line 5</fo:block>
          </fo:block>
        </fo:flow>
      </fo:page-sequence>
      <fo:page-sequence master-reference="master-two">
        <fo:flow flow-name="xsl-region-body">
          <fo:block id="block-2" keep-together.within-column="always">
            <fo:block>Line 1</fo:block>
            <fo:block>Line 2</fo:block>
            <fo:block>Line 3</fo:block>
            <fo:block>Line 4</fo:block>
            <fo:block>Line 5</fo:block>
          </fo:block>
        </fo:flow>
      </fo:page-sequence>
      <fo:page-sequence master-reference="master-three">
        <fo:flow flow-name="xsl-region-body">
          <fo:block id="block-3" keep-together.within-column="always">
            <fo:block>Line 1</fo:block>
            <fo:block>Line 2</fo:block>
            <fo:block>Line 3</fo:block>
            <fo:block>Line 4</fo:block>
            <fo:block>Line 5</fo:block>
          </fo:block>
        </fo:flow>
      </fo:page-sequence>
      <fo:page-sequence master-reference="master-four">
        <fo:flow flow-name="xsl-region-body">
          <fo:block id="block-4" keep-together.within-column="always">
            <fo:block>Line 1</fo:block>
            <fo:block>Line 2</fo:block>
            <fo:block>Line 3</fo:block>
            <fo:block>Line 4</fo:block>
            <fo:block>Line 5</fo:block>
          </fo:block>
        </fo:flow>
      </fo:page-sequence>
      <fo:page-sequence master-reference="master-five">
        <fo:flow flow-name="xsl-region-body">
          <fo:block id="block-5" keep-together.within-column="always">
            <fo:block>Line 1</fo:block>
            <fo:block>Line 2</fo:block>
            <fo:block>Line 3</fo:block>
            <fo:block>Line 4</fo:block>
            <fo:block>Line 5</fo:block>
          </fo:block>
        </fo:flow>
      </fo:page-sequence>
      <fo:page-sequence master-reference="master-six">
        <fo:flow flow-name="xsl-region-body">
          <fo:block id="block-6" keep-together.within-column="always">
            <fo:block>Line 1</fo:block>
            <fo:block>Line 2</fo:block>
            <fo:block>Line 3</fo:block>
            <fo:block>Line 4</fo:block>
            <fo:block>Line 5</fo:block>
          </fo:block>
        </fo:flow>
      </fo:page-sequence>
    </fo:root>
  </fo>
  <checks>
    <!-- overflow on first page -->
    <eval expected="1" xpath="count(//pageSequence[1]/pageViewport)" />
    <eval expected="1" xpath="count(//pageSequence[1]//span[.//block[@prod-id='block-1']])" />
    <!-- deferral to second page -->
    <eval expected="2" xpath="count(//pageSequence[2]/pageViewport)" />
    <eval expected="1" xpath="count(//pageSequence[2]//span[.//block[@prod-id='block-2']])" />
    <!-- overflow on first page, first column -->
    <eval expected="1" xpath="count(//pageSequence[3]/pageViewport)" />
    <eval expected="1" xpath="count(//pageSequence[3]//span[.//block[@prod-id='block-3']])" />
    <!-- deferral to second page, first column -->
    <eval expected="2" xpath="count(//pageSequence[4]/pageViewport)" />
    <eval expected="1" xpath="count(//pageSequence[4]//span[.//block[@prod-id='block-4']])" />
    <!-- overflow on first page -->
    <eval expected="1" xpath="count(//pageSequence[5]/pageViewport)" />
    <eval expected="1" xpath="count(//pageSequence[5]//span[.//block[@prod-id='block-5']])" />
    <!-- overflow on first page, first column -->
    <eval expected="1" xpath="count(//pageSequence[6]/pageViewport)" />
    <eval expected="1" xpath="count(//pageSequence[6]//span[.//block[@prod-id='block-6']])" />
  </checks>
</testcase>