]> source.dussan.org Git - xmlgraphics-fop.git/commitdiff
Test case showing a bug with table width determination.
authorJeremias Maerki <jeremias@apache.org>
Thu, 15 Sep 2005 14:27:54 +0000 (14:27 +0000)
committerJeremias Maerki <jeremias@apache.org>
Thu, 15 Sep 2005 14:27:54 +0000 (14:27 +0000)
git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@289242 13f79535-47bb-0310-9956-ffa450edef68

test/layoutengine/testcases/table_width.xml [new file with mode: 0644]

diff --git a/test/layoutengine/testcases/table_width.xml b/test/layoutengine/testcases/table_width.xml
new file mode 100644 (file)
index 0000000..8897ab5
--- /dev/null
@@ -0,0 +1,97 @@
+<?xml version="1.0" encoding="UTF-8"?>\r
+<!--\r
+  Copyright 2005 The Apache Software Foundation\r
+\r
+  Licensed under the Apache License, Version 2.0 (the "License");\r
+  you may not use this file except in compliance with the License.\r
+  You may obtain a copy of the License at\r
+\r
+       http://www.apache.org/licenses/LICENSE-2.0\r
+\r
+  Unless required by applicable law or agreed to in writing, software\r
+  distributed under the License is distributed on an "AS IS" BASIS,\r
+  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+  See the License for the specific language governing permissions and\r
+  limitations under the License.\r
+-->\r
+<!-- $Id$ -->\r
+<testcase>\r
+  <info>\r
+    <p>\r
+      This test checks table width in certain situations.\r
+    </p>\r
+  </info>\r
+  <fo>\r
+    <fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format" xmlns:svg="http://www.w3.org/2000/svg">\r
+      <fo:layout-master-set>\r
+        <fo:simple-page-master master-name="normal" page-width="5in" page-height="5in">\r
+          <fo:region-body/>\r
+        </fo:simple-page-master>\r
+      </fo:layout-master-set>\r
+      <fo:page-sequence master-reference="normal" white-space-collapse="true">\r
+        <fo:flow flow-name="xsl-region-body">\r
+          <fo:block-container width="100%" height="10pt" background-color="lightgray">\r
+            <fo:block/>\r
+          </fo:block-container>\r
+          <fo:table table-layout="fixed" width="100%" border-collapse="separate">\r
+            <fo:table-column column-width="proportional-column-width(3)"/>\r
+            <fo:table-column column-width="proportional-column-width(2)"/>\r
+            <fo:table-body>\r
+              <fo:table-row>\r
+                <fo:table-cell>\r
+                  <fo:block>cell1</fo:block>\r
+                </fo:table-cell>\r
+                <fo:table-cell background-color="yellow">\r
+                  <fo:block>cell2</fo:block>\r
+                </fo:table-cell>\r
+              </fo:table-row>\r
+            </fo:table-body>\r
+          </fo:table>\r
+          <fo:block start-indent="1in" end-indent="1in">\r
+            <fo:block-container width="100%" height="10pt" background-color="lightgray">\r
+              <fo:block/>\r
+            </fo:block-container>\r
+            <fo:table table-layout="fixed" width="100%" border-collapse="separate" background-color="gray">\r
+              <fo:table-column column-width="proportional-column-width(3)"/>\r
+              <fo:table-column column-width="proportional-column-width(2)"/>\r
+              <fo:table-body start-indent="0cm" end-indent="0cm">\r
+                <fo:table-row>\r
+                  <fo:table-cell>\r
+                    <fo:block>cell1</fo:block>\r
+                  </fo:table-cell>\r
+                  <fo:table-cell background-color="yellow">\r
+                    <fo:block>cell2</fo:block>\r
+                  </fo:table-cell>\r
+                </fo:table-row>\r
+              </fo:table-body>\r
+            </fo:table>\r
+          </fo:block>\r
+        </fo:flow>\r
+      </fo:page-sequence>\r
+    </fo:root>\r
+  </fo>\r
+  <checks>\r
+    <!-- width of the first block-container -->\r
+    <eval expected="360000" xpath="//flow/block[1]/@ipd"/>\r
+\r
+    <!-- width of the first table -->\r
+    <eval expected="360000" xpath="//flow/block[2]/@ipd"/>\r
+    <eval expected="216000" xpath="//flow/block[2]/block[1]/@ipd"/>\r
+    <eval expected="144000" xpath="//flow/block[2]/block[2]/@ipd"/>\r
+    \r
+    <!-- width of the enclosing block establishing the indents -->\r
+    <eval expected="216000" xpath="//flow/block[3]/@ipd"/>\r
+    <eval expected="72000" xpath="//flow/block[3]/@start-indent"/>\r
+    <eval expected="72000" xpath="//flow/block[3]/@end-indent"/>\r
+    \r
+    <!-- width of the second block-container -->\r
+    <eval expected="216000" xpath="//flow/block[3]/block[1]/@ipd"/>\r
+    <eval expected="72000" xpath="//flow/block[3]/block[1]/@start-indent"/>\r
+    <eval expected="72000" xpath="//flow/block[3]/block[1]/@end-indent"/>\r
+\r
+    <!-- width of the second table -->\r
+    <eval expected="216000" xpath="//flow/block[3]/block[2]/@ipd"/>\r
+    <eval expected="129600" xpath="//flow/block[3]/block[2]/block[1]/@ipd"/>\r
+    <eval expected="86400" xpath="//flow/block[3]/block[2]/block[2]/@ipd"/>\r
+  </checks>\r
+</testcase>\r