]> source.dussan.org Git - xmlgraphics-fop.git/blob
b9a26ce7cdff0448364a6dd9685bf319e2dee858
[xmlgraphics-fop.git] /
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 relative margin on region (region-body).
23     </p>
24   </info>
25   <variables>
26     <img>../../resources/images/bgimg300dpi.jpg</img>
27   </variables>
28   <fo>
29     <fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format" xmlns:svg="http://www.w3.org/2000/svg">
30       <fo:layout-master-set>
31         <fo:simple-page-master master-name="normal" page-width="3in" page-height="5in" margin="5%" reference-orientation="180" writing-mode="rl">
32           <fo:region-body margin-top="10%" margin-bottom="5%" margin-left="10%" margin-right="5%" background-color="yellow" />
33           <fo:region-before extent="10%" background-color="blue" precedence="true" />
34           <fo:region-after extent="5%" background-color="green" precedence="true" />
35           <fo:region-start extent="5%" background-color="red" />
36           <fo:region-end extent="10%" background-color="orange" />
37         </fo:simple-page-master>
38       </fo:layout-master-set>
39       <fo:page-sequence master-reference="normal" white-space-collapse="true">
40         <fo:static-content flow-name="xsl-region-before">
41           <fo:block>
42             r e g i o n  b e f o r e
43           </fo:block>
44         </fo:static-content>
45         <fo:static-content flow-name="xsl-region-after">
46           <fo:block>
47             r e g i o n  a f t e r
48           </fo:block>
49         </fo:static-content>
50         <fo:static-content flow-name="xsl-region-start">
51           <fo:block>
52             r e g i o n  s t a r t
53           </fo:block>
54         </fo:static-content>
55         <fo:static-content flow-name="xsl-region-end">
56           <fo:block>
57             r e g i o n  e n d
58           </fo:block>
59         </fo:static-content>
60         <fo:flow flow-name="xsl-region-body">
61           <fo:block>
62             Demonstrates relative 5% margin on the page master, 10% margin on regions before
63             and end and 5% margin on regions start and after. Corresponding margins are set
64             on the region body. The page size is 5in x 3in with the page reference rotated by 
65             180 degrees and a rl writing-mode.
66           </fo:block>
67         </fo:flow>
68       </fo:page-sequence>
69     </fo:root>
70   </fo>
71   <checks>
72     <!-- region before -->
73     <eval expected="color=#0000ff" xpath="//page/regionViewport[1]/@background"/>
74     <eval expected="194400" xpath="//page/regionViewport[1]/@ipd"/>
75     <eval expected="36000" xpath="//page/regionViewport[1]/@bpd"/>
76     <eval expected="10800 306000 194400 36000" xpath="//page/regionViewport[1]/@rect"/>
77     <eval expected="194400" xpath="//page/regionViewport[1]/regionBefore/@ipd"/>
78     <eval expected="36000" xpath="//page/regionViewport[1]/regionBefore/@bpd"/>
79     <eval expected="[1.0 0.0 0.0 -1.0 10800.0 342000.0]" xpath="//page/regionViewport[1]/regionBefore/@ctm"/>
80     <!-- region start -->
81     <eval expected="color=#ff0000" xpath="//page/regionViewport[2]/@background"/>
82     <eval expected="10800" xpath="//page/regionViewport[2]/@ipd"/>
83     <eval expected="270000" xpath="//page/regionViewport[2]/@bpd"/>
84     <eval expected="10800 36000 10800 270000" xpath="//page/regionViewport[2]/@rect"/>
85     <eval expected="10800" xpath="//page/regionViewport[2]/regionStart/@ipd"/>
86     <eval expected="270000" xpath="//page/regionViewport[2]/regionStart/@bpd"/>
87     <eval expected="[1.0 0.0 0.0 -1.0 10800.0 306000.0]" xpath="//page/regionViewport[2]/regionStart/@ctm"/>
88     <!-- region end -->
89     <eval expected="color=#ffa500" xpath="//page/regionViewport[3]/@background"/>
90     <eval expected="21600" xpath="//page/regionViewport[3]/@ipd"/>
91     <eval expected="270000" xpath="//page/regionViewport[3]/@bpd"/>
92     <eval expected="183600 36000 21600 270000" xpath="//page/regionViewport[3]/@rect"/>
93     <eval expected="21600" xpath="//page/regionViewport[3]/regionEnd/@ipd"/>
94     <eval expected="270000" xpath="//page/regionViewport[3]/regionEnd/@bpd"/>
95     <eval expected="[1.0 0.0 0.0 -1.0 183600.0 306000.0]" xpath="//page/regionViewport[3]/regionEnd/@ctm"/>
96     <!-- region after -->
97     <eval expected="color=#008000" xpath="//page/regionViewport[4]/@background"/>
98     <eval expected="194400" xpath="//page/regionViewport[4]/@ipd"/>
99     <eval expected="18000" xpath="//page/regionViewport[4]/@bpd"/>
100     <eval expected="10800 18000 194400 18000" xpath="//page/regionViewport[4]/@rect"/>
101     <eval expected="194400" xpath="//page/regionViewport[4]/regionAfter/@ipd"/>
102     <eval expected="18000" xpath="//page/regionViewport[4]/regionAfter/@bpd"/>
103     <eval expected="[1.0 0.0 0.0 -1.0 10800.0 36000.0]" xpath="//page/regionViewport[4]/regionAfter/@ctm"/>
104     <!-- region body -->
105     <eval expected="color=#ffff00" xpath="//page/regionViewport[5]/@background"/>
106     <eval expected="162000" xpath="//page/regionViewport[5]/@ipd"/>
107     <eval expected="270000" xpath="//page/regionViewport[5]/@bpd"/>
108     <eval expected="21600 36000 162000 270000" xpath="//page/regionViewport[5]/@rect"/>
109     <eval expected="162000" xpath="//page/regionViewport[5]/regionBody/@ipd"/>
110     <eval expected="270000" xpath="//page/regionViewport[5]/regionBody/@bpd"/>
111     <eval expected="[1.0 0.0 0.0 -1.0 21600.0 306000.0]" xpath="//page/regionViewport[5]/regionBody/@ctm"/>
112   </checks>
113 </testcase>