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