Line 0
Link Here
|
|
|
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 |
|
10 |
http://www.apache.org/licenses/LICENSE-2.0 |
11 |
|
12 |
Unless required by applicable law or agreed to in writing, software |
13 |
distributed under the License is distributed on an "AS IS" BASIS, |
14 |
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
15 |
See the License for the specific language governing permissions and |
16 |
limitations under the License. |
17 |
--> |
18 |
<!-- $Id$ --> |
19 |
<testcase> |
20 |
<info> |
21 |
<p> |
22 |
This test checks the default behavior of the "orphans" property. |
23 |
</p> |
24 |
</info> |
25 |
<fo> |
26 |
<fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format"> |
27 |
<fo:layout-master-set> |
28 |
<fo:simple-page-master master-name="normal" page-width="3in" page-height="2in"> |
29 |
<fo:region-body /> |
30 |
</fo:simple-page-master> |
31 |
</fo:layout-master-set> |
32 |
<fo:page-sequence master-reference="normal"> |
33 |
<fo:flow flow-name="xsl-region-body"> |
34 |
<fo:block id="block-1" break-before="page"> |
35 |
<!-- Basic test: 1 paragraph with 9 lines and 1 with 4. |
36 |
All 4 lines of the second paragraph should be kept |
37 |
together due to initial value for orphans. |
38 |
--> |
39 |
<fo:block> |
40 |
Lorem ipsum dolor sit amet, consectetur |
41 |
adipiscing elit. Cras placerat, lectus vel |
42 |
iaculis euismod, ipsum enim dapibus |
43 |
urna, eu pellentesque velit dolor ac |
44 |
purus. Maecenas vitae pulvinar turpis. |
45 |
Duis venenatis tincidunt velit, fringilla |
46 |
dignissim sapien faucibus vel. Quisque |
47 |
placerat ornare consectetur. Aenean |
48 |
dui tortor, tempor ut convallis in, |
49 |
</fo:block> |
50 |
<fo:block> |
51 |
Lorem ipsum dolor sit amet, consectetur |
52 |
adipiscing elit. Cras placerat, lectus vel |
53 |
iaculis euismod, ipsum enim dapibus |
54 |
urna, eu pellentesque velit dolor ac |
55 |
</fo:block> |
56 |
</fo:block> |
57 |
<fo:block id="block-2" break-before="page"> |
58 |
<!-- Basic test: 1 block with 9 lines and 1 paragraph with 4 lines. |
59 |
A break after the first line of the second paragraph is allowed. |
60 |
--> |
61 |
<fo:block> |
62 |
Lorem ipsum dolor sit amet, consectetur |
63 |
adipiscing elit. Cras placerat, lectus vel |
64 |
iaculis euismod, ipsum enim dapibus |
65 |
urna, eu pellentesque velit dolor ac |
66 |
purus. Maecenas vitae pulvinar turpis. |
67 |
Duis venenatis tincidunt velit, fringilla |
68 |
dignissim sapien faucibus vel. Quisque |
69 |
placerat ornare consectetur. Aenean |
70 |
dui tortor, tempor ut convallis in, |
71 |
</fo:block> |
72 |
Lorem ipsum dolor sit amet, consectetur |
73 |
adipiscing elit. Cras placerat, lectus vel |
74 |
iaculis euismod, ipsum enim dapibus |
75 |
urna, eu pellentesque velit dolor ac |
76 |
</fo:block> |
77 |
<fo:block id="block-3" break-before="page"> |
78 |
<!-- Basic test: 1 regular paragraph of 9 lines followed by 1 consisting |
79 |
of 4 single-line subparagraphs. |
80 |
All 4 lines of the second paragraph should be kept together due |
81 |
to initial value for orphans. |
82 |
--> |
83 |
<fo:block id="block-3a"> |
84 |
Lorem ipsum dolor sit amet, consectetur |
85 |
adipiscing elit. Cras placerat, lectus vel |
86 |
iaculis euismod, ipsum enim dapibus |
87 |
urna, eu pellentesque velit dolor ac |
88 |
purus. Maecenas vitae pulvinar turpis. |
89 |
Duis venenatis tincidunt velit, fringilla |
90 |
dignissim sapien faucibus vel. Quisque |
91 |
placerat ornare consectetur. Aenean |
92 |
dui tortor, tempor ut convallis in, |
93 |
</fo:block> |
94 |
<fo:block id="block-3b"> |
95 |
<fo:block>Lorem ipsum</fo:block> |
96 |
<fo:block>Lorem ipsum</fo:block> |
97 |
<fo:block>Lorem ipsum</fo:block> |
98 |
<fo:block>Lorem ipsum</fo:block> |
99 |
</fo:block> |
100 |
</fo:block> |
101 |
<fo:block id="block-4" break-before="page"> |
102 |
<!-- Special case: linefeed-treatment="preserve" (see Bugzilla 44328) --> |
103 |
<fo:block> |
104 |
Lorem ipsum dolor sit amet, consectetur |
105 |
adipiscing elit. Cras placerat, lectus vel |
106 |
iaculis euismod, ipsum enim dapibus |
107 |
urna, eu pellentesque velit dolor ac |
108 |
purus. Maecenas vitae pulvinar turpis. |
109 |
Duis venenatis tincidunt velit, fringilla |
110 |
dignissim sapien faucibus vel. Quisque |
111 |
placerat ornare consectetur. Aenean |
112 |
dui tortor, tempor ut convallis in, |
113 |
</fo:block> |
114 |
<fo:block linefeed-treatment="preserve">Lorem ipsum |
115 |
dolor sit amet, |
116 |
consectetur |
117 |
velit dolor</fo:block> |
118 |
</fo:block> |
119 |
<fo:block id="block-5" break-before="page" widows="1"> |
120 |
<!-- Last but not least, demonstrate peculiar side-effect in case |
121 |
of convoluted nesting... |
122 |
Even though widows would allow a break before the last line, |
123 |
all 10 last lines are moved to the next page due to stacked |
124 |
orphans constraints |
125 |
--> |
126 |
<fo:block id="level-1">Lorem ipsum |
127 |
<fo:block>Lorem ipsum</fo:block> |
128 |
<fo:block id="level-2">Lorem ipsum |
129 |
<fo:block id="level-3">Lorem ipsum |
130 |
<fo:block id="level-4">Lorem ipsum |
131 |
<fo:block id="level-5">Lorem ipsum |
132 |
<fo:block id="level-6">Lorem ipsum |
133 |
<fo:block id="level-7">Lorem ipsum |
134 |
<fo:block id="level-8">Lorem ipsum |
135 |
<fo:block id="level-9">Lorem ipsum |
136 |
<fo:block id="level-10">Lorem ipsum |
137 |
<fo:block id="level-11"> |
138 |
Lorem ipsum |
139 |
</fo:block> |
140 |
</fo:block> |
141 |
</fo:block> |
142 |
</fo:block> |
143 |
</fo:block> |
144 |
</fo:block> |
145 |
</fo:block> |
146 |
</fo:block> |
147 |
</fo:block> |
148 |
</fo:block> |
149 |
</fo:block> |
150 |
</fo:block> |
151 |
</fo:flow> |
152 |
</fo:page-sequence> |
153 |
</fo:root> |
154 |
</fo> |
155 |
<checks> |
156 |
<eval expected="9" xpath="count((//page)[1]//lineArea)" /> |
157 |
<eval expected="4" xpath="count((//page)[2]//lineArea)" /> |
158 |
<eval expected="10" xpath="count((//page)[3]//lineArea)" /> |
159 |
<eval expected="3" xpath="count((//page)[4]//lineArea)" /> |
160 |
<eval expected="9" xpath="count((//page)[5]//lineArea)" /> |
161 |
<eval expected="4" xpath="count((//page)[6]//lineArea)" /> |
162 |
<eval expected="9" xpath="count((//page)[7]//lineArea)" /> |
163 |
<eval expected="4" xpath="count((//page)[8]//lineArea)" /> |
164 |
<eval expected="2" xpath="count((//page)[9]//lineArea)" /> |
165 |
<eval expected="10" xpath="count((//page)[10]//lineArea)" /> |
166 |
</checks> |
167 |
</testcase> |