diff options
author | Finn Bock <bckfnn@apache.org> | 2005-08-31 20:29:33 +0000 |
---|---|---|
committer | Finn Bock <bckfnn@apache.org> | 2005-08-31 20:29:33 +0000 |
commit | e194fdd5cfe3f1bc823d93c57420db87eb7efed0 (patch) | |
tree | e4e195d6e88bd85e02c48bffac90176543aba0cc /test | |
parent | 0c4637012c7a394bb3ae1b621ca89c7742b0612d (diff) | |
download | xmlgraphics-fop-e194fdd5cfe3f1bc823d93c57420db87eb7efed0.tar.gz xmlgraphics-fop-e194fdd5cfe3f1bc823d93c57420db87eb7efed0.zip |
Bugzilla #36379:
Revised percentage resolution system.
Submitted by: Manuel Mall <mm.at.arcus.com.au>
Slightly modified to avoid early evaluation of getValue().
git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@265577 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'test')
35 files changed, 1449 insertions, 205 deletions
diff --git a/test/java/org/apache/fop/layoutengine/LayoutEngineTestSuite.java b/test/java/org/apache/fop/layoutengine/LayoutEngineTestSuite.java index f3fb7ee54..1d96f163d 100644 --- a/test/java/org/apache/fop/layoutengine/LayoutEngineTestSuite.java +++ b/test/java/org/apache/fop/layoutengine/LayoutEngineTestSuite.java @@ -118,6 +118,7 @@ public class LayoutEngineTestSuite { final LayoutEngineTester tester, final File f) { suite.addTest(new LayoutEngineTestCase(f.getName()) { public void runTest() throws Exception { + org.apache.commons.logging.LogFactory.getLog(this.getClass()).info("Starting " + f.getName()); prepare(tester, f); testMain(); } diff --git a/test/layoutengine/disabled-testcases.txt b/test/layoutengine/disabled-testcases.txt index 752b94bed..450c6c90e 100644 --- a/test/layoutengine/disabled-testcases.txt +++ b/test/layoutengine/disabled-testcases.txt @@ -1,16 +1,8 @@ -background-image-list1.xml -background-image-list2.xml +background-image6.xml background-image-table2.xml -background-image-table3.xml -background-image-table4.xml background-image-table5.xml -background-image3.xml -background-image5.xml -background-image6.xml -background-image7.xml block-container4a.xml -external-graphic1.xml -external-graphic2.xml +font-stretch.xml external-graphic4.xml inline-block2.xml inline-container1.xml @@ -19,11 +11,11 @@ keep-with-previous2.xml keep-with-previous3.xml keep-with-previous4.xml keep-with-previous5.xml -leader-dots.xml -leader-rule.xml -leader-space.xml +leader-alignment.xml +leader-use-content.xml letter-spacing3.xml list4a.xml +margin-region3.xml multi-column3.xml multi-column4.xml normal-breaking4.xml diff --git a/test/layoutengine/testcases/background-image-list1.xml b/test/layoutengine/testcases/background-image-list1.xml index 091be019e..e4b81b117 100644 --- a/test/layoutengine/testcases/background-image-list1.xml +++ b/test/layoutengine/testcases/background-image-list1.xml @@ -18,14 +18,14 @@ <testcase> <info> <p> - This test checks background image on lists (list-item). + This test checks background image on lists (list-block). </p> </info> <variables> <img>../../resources/images/bgimg300dpi.jpg</img> </variables> <fo> - <fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format" xmlns:svg="http://www.w3.org/2000/svg"> + <fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format"> <fo:layout-master-set> <fo:simple-page-master master-name="normal" page-width="5in" page-height="5in"> <fo:region-body/> @@ -33,7 +33,7 @@ </fo:layout-master-set> <fo:page-sequence master-reference="normal" white-space-collapse="true"> <fo:flow flow-name="xsl-region-body"> - <fo:list-block provisional-distance-between-starts="1in" provisional-label-separation="0.1in" background-repeat="no-repeat" background-position-horizontal="center" background-position-vertical="center" background-image="##img"> + <fo:list-block provisional-distance-between-starts="1in" provisional-label-separation="0.1in" background-color="yellow" background-repeat="no-repeat" background-position-horizontal="center" background-position-vertical="center" background-image="##img"> <fo:list-item> <fo:list-item-label end-indent="label-end()"> <fo:block>label 1</fo:block> @@ -62,7 +62,7 @@ <fo:list-item-label end-indent="label-end()"> <fo:block>label 3</fo:block> </fo:list-item-label> - <fo:list-item-body start-indent="body-start()" background-repeat="no-repeat" background-position-horizontal="center" background-position-vertical="center" background-image="##img"> + <fo:list-item-body start-indent="body-start()"> <fo:block> body 3: The whole list should have a centered background. The whole list should have a centered background. @@ -71,11 +71,13 @@ </fo:list-item-body> </fo:list-item> </fo:list-block> - <fo:block></fo:block> </fo:flow> </fo:page-sequence> </fo:root> </fo> <checks> + <eval expected="360000" xpath="//flow/block/@ipd"/> + <eval expected="172800" xpath="//flow/block/@bpd"/> + <eval expected="color=#ffff00,url=../../resources/images/bgimg300dpi.jpg,repeat=no-repeat,horiz=156960,vertical=63360" xpath="//flow/block/@background"/> </checks> </testcase> diff --git a/test/layoutengine/testcases/background-image-list2.xml b/test/layoutengine/testcases/background-image-list2.xml index 687e278b4..9fa6ee7f3 100644 --- a/test/layoutengine/testcases/background-image-list2.xml +++ b/test/layoutengine/testcases/background-image-list2.xml @@ -25,7 +25,7 @@ <img>../../resources/images/bgimg300dpi.jpg</img> </variables> <fo> - <fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format" xmlns:svg="http://www.w3.org/2000/svg"> + <fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format"> <fo:layout-master-set> <fo:simple-page-master master-name="normal" page-width="5in" page-height="5in"> <fo:region-body/> @@ -34,7 +34,7 @@ <fo:page-sequence master-reference="normal" white-space-collapse="true"> <fo:flow flow-name="xsl-region-body"> <fo:list-block provisional-distance-between-starts="1in" provisional-label-separation="0.1in"> - <fo:list-item background-repeat="no-repeat" background-position-horizontal="center" background-position-vertical="center" background-image="##img"> + <fo:list-item background-repeat="no-repeat" background-color="yellow" background-position-horizontal="center" background-position-vertical="center" background-image="##img"> <fo:list-item-label end-indent="label-end()"> <fo:block>label 1</fo:block> </fo:list-item-label> @@ -62,20 +62,22 @@ <fo:list-item-label end-indent="label-end()"> <fo:block>label 3</fo:block> </fo:list-item-label> - <fo:list-item-body start-indent="body-start()" background-repeat="no-repeat" background-position-horizontal="center" background-position-vertical="center" background-image="##img"> + <fo:list-item-body start-indent="body-start()"> <fo:block> - body 3: The whole list should have a centered background. - The whole list should have a centered background. - The whole list should have a centered background. + body 3: We should have no background on this list item. + We should have no background on this list item. + We should have no background on this list item. </fo:block> </fo:list-item-body> </fo:list-item> </fo:list-block> - <fo:block></fo:block> </fo:flow> </fo:page-sequence> </fo:root> </fo> <checks> + <eval expected="360000" xpath="//flow/block/block/@ipd"/> + <eval expected="72000" xpath="//flow/block/block/@bpd"/> + <eval expected="color=#ffff00,url=../../resources/images/bgimg300dpi.jpg,repeat=no-repeat,horiz=156960,vertical=12960" xpath="//flow/block/block/@background"/> </checks> </testcase> diff --git a/test/layoutengine/testcases/background-image-table1.xml b/test/layoutengine/testcases/background-image-table1.xml index c6b597a94..2a8f1984c 100644 --- a/test/layoutengine/testcases/background-image-table1.xml +++ b/test/layoutengine/testcases/background-image-table1.xml @@ -18,7 +18,7 @@ <testcase> <info> <p> - This test checks background image on a table. + This test checks background image on a fo:table. </p> </info> <variables> @@ -33,7 +33,7 @@ </fo:layout-master-set> <fo:page-sequence master-reference="normal" white-space-collapse="true"> <fo:flow flow-name="xsl-region-body"> - <fo:table background-repeat="no-repeat" background-position-horizontal="center" background-position-vertical="center" background-image="##img"> + <fo:table background-color="yellow" background-repeat="no-repeat" background-position-horizontal="center" background-position-vertical="center" background-image="##img"> <fo:table-column column-number="1" /> <fo:table-column column-number="2" /> <fo:table-column column-number="3" /> @@ -97,12 +97,12 @@ </fo:table-row> </fo:table-body> </fo:table> - <fo:block>Table with centered background</fo:block> + <fo:block>Table with centered background image</fo:block> </fo:flow> </fo:page-sequence> </fo:root> </fo> <checks> - <eval expected="color=null,url=../../resources/images/bgimg300dpi.jpg,repeat=no-repeat,horiz=156960,vertical=12960" xpath="//flow/block[1]/@background"/> + <eval expected="color=#ffff00,url=../../resources/images/bgimg300dpi.jpg,repeat=no-repeat,horiz=156960,vertical=12960" xpath="//flow/block[1]/@background"/> </checks> </testcase> diff --git a/test/layoutengine/testcases/background-image-table2.xml b/test/layoutengine/testcases/background-image-table2.xml index be87ea653..d212685cd 100644 --- a/test/layoutengine/testcases/background-image-table2.xml +++ b/test/layoutengine/testcases/background-image-table2.xml @@ -18,7 +18,7 @@ <testcase> <info> <p> - This test checks background image on a table. + This test checks background image on a fo:table-body. </p> </info> <variables> @@ -50,7 +50,7 @@ </fo:table-cell> </fo:table-row> </fo:table-header> - <fo:table-body background-repeat="no-repeat" background-position-horizontal="center" background-position-vertical="center" background-image="##img"> + <fo:table-body background-color="yellow" background-repeat="no-repeat" background-position-horizontal="center" background-position-vertical="center" background-image="##img"> <fo:table-row> <fo:table-cell> <fo:block>Row 1 Col 1</fo:block> @@ -97,11 +97,13 @@ </fo:table-row> </fo:table-body> </fo:table> - <fo:block>Table with centered body background</fo:block> + <fo:block>Table with centered background image on body</fo:block> </fo:flow> </fo:page-sequence> </fo:root> </fo> <checks> + <!-- backgrounds on table-body are not supported at the time this test + was written. Therefore no checks! --> </checks> </testcase> diff --git a/test/layoutengine/testcases/background-image-table3.xml b/test/layoutengine/testcases/background-image-table3.xml index c6d5e7de0..2f05e343a 100644 --- a/test/layoutengine/testcases/background-image-table3.xml +++ b/test/layoutengine/testcases/background-image-table3.xml @@ -18,7 +18,7 @@ <testcase> <info> <p> - This test checks background image on a table. + This test checks background image on a fo:table-row. </p> </info> <variables> @@ -51,7 +51,7 @@ </fo:table-row> </fo:table-header> <fo:table-body> - <fo:table-row background-repeat="no-repeat" background-position-horizontal="center" background-position-vertical="center" background-image="##img"> + <fo:table-row height="1in" background-color="yellow" background-repeat="no-repeat" background-position-horizontal="center" background-position-vertical="center" background-image="##img"> <fo:table-cell> <fo:block>Row 1 Col 1</fo:block> </fo:table-cell> @@ -73,35 +73,16 @@ <fo:block>Row 2 Col 3</fo:block> </fo:table-cell> </fo:table-row> - <fo:table-row> - <fo:table-cell> - <fo:block>Row 3 Col 1</fo:block> - </fo:table-cell> - <fo:table-cell> - <fo:block>Row 3 Col 2</fo:block> - </fo:table-cell> - <fo:table-cell> - <fo:block>Row 3 Col 3</fo:block> - </fo:table-cell> - </fo:table-row> - <fo:table-row> - <fo:table-cell> - <fo:block>Row 4 Col 1</fo:block> - </fo:table-cell> - <fo:table-cell> - <fo:block>Row 4 Col 2</fo:block> - </fo:table-cell> - <fo:table-cell> - <fo:block>Row 4 Col 3</fo:block> - </fo:table-cell> - </fo:table-row> </fo:table-body> </fo:table> - <fo:block>Table with centered row 1 background</fo:block> + <fo:block>Table with centered background image on row 1</fo:block> </fo:flow> </fo:page-sequence> </fo:root> </fo> <checks> + <eval expected="360000" xpath="//flow/block/block[4]/@ipd"/> + <eval expected="72000" xpath="//flow/block/block[4]/@bpd"/> + <eval expected="color=#ffff00,url=../../resources/images/bgimg300dpi.jpg,repeat=no-repeat,horiz=156960,vertical=12960" xpath="//flow/block/block[4]/@background"/> </checks> </testcase> diff --git a/test/layoutengine/testcases/background-image-table4.xml b/test/layoutengine/testcases/background-image-table4.xml index 4c5e7c691..b36bba6ce 100644 --- a/test/layoutengine/testcases/background-image-table4.xml +++ b/test/layoutengine/testcases/background-image-table4.xml @@ -18,7 +18,7 @@ <testcase> <info> <p> - This test checks background image on a table. + This test checks background image on a fo:table-cell. </p> </info> <variables> @@ -37,22 +37,9 @@ <fo:table-column column-number="1" /> <fo:table-column column-number="2" /> <fo:table-column column-number="3" /> - <fo:table-header> - <fo:table-row> - <fo:table-cell> - <fo:block>Header Col 1</fo:block> - </fo:table-cell> - <fo:table-cell> - <fo:block>Header Col 2</fo:block> - </fo:table-cell> - <fo:table-cell> - <fo:block>Header Col 3</fo:block> - </fo:table-cell> - </fo:table-row> - </fo:table-header> <fo:table-body> <fo:table-row> - <fo:table-cell background-repeat="no-repeat" background-position-horizontal="center" background-position-vertical="center" background-image="##img"> + <fo:table-cell> <fo:block>Row 1 Col 1</fo:block> </fo:table-cell> <fo:table-cell> @@ -63,45 +50,42 @@ </fo:table-cell> </fo:table-row> <fo:table-row> - <fo:table-cell> + <fo:table-cell background-color="yellow" background-repeat="no-repeat" background-position-horizontal="center" background-position-vertical="center" background-image="##img"> + <fo:block>Row 2 Col 1</fo:block> + <fo:block>Row 2 Col 1</fo:block> + <fo:block>Row 2 Col 1</fo:block> + <fo:block>Row 2 Col 1</fo:block> <fo:block>Row 2 Col 1</fo:block> </fo:table-cell> - <fo:table-cell> + <fo:table-cell padding="5pt" display-align="center" background-color="blue" background-repeat="no-repeat" background-position-horizontal="center" background-position-vertical="center" background-image="##img"> <fo:block>Row 2 Col 2</fo:block> </fo:table-cell> - <fo:table-cell> + <fo:table-cell display-align="center" background-color="yellow" background-repeat="no-repeat" background-position-horizontal="center" background-position-vertical="center" background-image="##img"> <fo:block>Row 2 Col 3</fo:block> </fo:table-cell> </fo:table-row> - <fo:table-row> - <fo:table-cell> - <fo:block>Row 3 Col 1</fo:block> - </fo:table-cell> - <fo:table-cell> - <fo:block>Row 3 Col 2</fo:block> - </fo:table-cell> - <fo:table-cell> - <fo:block>Row 3 Col 3</fo:block> - </fo:table-cell> - </fo:table-row> - <fo:table-row> - <fo:table-cell> - <fo:block>Row 4 Col 1</fo:block> - </fo:table-cell> - <fo:table-cell> - <fo:block>Row 4 Col 2</fo:block> - </fo:table-cell> - <fo:table-cell> - <fo:block>Row 4 Col 3</fo:block> - </fo:table-cell> - </fo:table-row> </fo:table-body> </fo:table> - <fo:block>Table with centered row 1 col 1 background</fo:block> + <fo:block>Table with centered background images on row 2 col 1, and 3</fo:block> </fo:flow> </fo:page-sequence> </fo:root> </fo> <checks> + <!-- first cell in row 2 --> + <eval expected="120000" xpath="//flow/block/block[4]/@ipd"/> + <eval expected="72000" xpath="//flow/block/block[4]/@bpd"/> + <eval expected="72000" xpath="//flow/block/block[4]/@bpda"/> + <eval expected="color=#ffff00,url=../../resources/images/bgimg300dpi.jpg,repeat=no-repeat,horiz=36960,vertical=12960" xpath="//flow/block/block[4]/@background"/> + <!-- second cell in row 2 --> + <eval expected="110000" xpath="//flow/block/block[5]/@ipd"/> + <eval expected="62000" xpath="//flow/block/block[5]/@bpd"/> + <eval expected="72000" xpath="//flow/block/block[5]/@bpda"/> + <eval expected="color=#0000ff,url=../../resources/images/bgimg300dpi.jpg,repeat=no-repeat,horiz=36960,vertical=12960" xpath="//flow/block/block[5]/@background"/> + <!-- second cell in row 2 --> + <eval expected="120000" xpath="//flow/block/block[6]/@ipd"/> + <eval expected="72000" xpath="//flow/block/block[6]/@bpd"/> + <eval expected="72000" xpath="//flow/block/block[6]/@bpda"/> + <eval expected="color=#ffff00,url=../../resources/images/bgimg300dpi.jpg,repeat=no-repeat,horiz=36960,vertical=12960" xpath="//flow/block/block[6]/@background"/> </checks> </testcase> diff --git a/test/layoutengine/testcases/background-image-table5.xml b/test/layoutengine/testcases/background-image-table5.xml index b4bd72372..1101b3f95 100644 --- a/test/layoutengine/testcases/background-image-table5.xml +++ b/test/layoutengine/testcases/background-image-table5.xml @@ -18,7 +18,7 @@ <testcase> <info> <p> - This test checks background image on a table. + This test checks background image on a fo:table-header and footer. </p> </info> <variables> @@ -37,7 +37,7 @@ <fo:table-column column-number="1" /> <fo:table-column column-number="2" /> <fo:table-column column-number="3" /> - <fo:table-header background-repeat="no-repeat" background-position-horizontal="center" background-position-vertical="center" background-image="##img"> + <fo:table-header background-color="yellow" background-repeat="no-repeat" background-position-horizontal="center" background-position-vertical="center" background-image="##img"> <fo:table-row> <fo:table-cell> <fo:block>Header Col 1</fo:block> @@ -50,58 +50,51 @@ </fo:table-cell> </fo:table-row> </fo:table-header> - <fo:table-body> + <fo:table-footer background-color="yellow" background-repeat="no-repeat" background-position-horizontal="center" background-position-vertical="center" background-image="##img"> <fo:table-row> <fo:table-cell> - <fo:block>Row 1 Col 1</fo:block> - </fo:table-cell> - <fo:table-cell> - <fo:block>Row 1 Col 2</fo:block> - </fo:table-cell> - <fo:table-cell> - <fo:block>Row 1 Col 3</fo:block> - </fo:table-cell> - </fo:table-row> - <fo:table-row> - <fo:table-cell> - <fo:block>Row 2 Col 1</fo:block> + <fo:block>Footer Col 1</fo:block> </fo:table-cell> <fo:table-cell> - <fo:block>Row 2 Col 2</fo:block> + <fo:block>Footer Col 2</fo:block> </fo:table-cell> <fo:table-cell> - <fo:block>Row 2 Col 3</fo:block> + <fo:block>Footer Col 3</fo:block> </fo:table-cell> </fo:table-row> - <fo:table-row> + </fo:table-footer> + <fo:table-body background-color="blue"> + <fo:table-row height="4in" background-color="blue"> <fo:table-cell> - <fo:block>Row 3 Col 1</fo:block> + <fo:block>Row 1 Col 1</fo:block> </fo:table-cell> <fo:table-cell> - <fo:block>Row 3 Col 2</fo:block> + <fo:block>Row 1 Col 2</fo:block> </fo:table-cell> <fo:table-cell> - <fo:block>Row 3 Col 3</fo:block> + <fo:block>Row 1 Col 3</fo:block> </fo:table-cell> </fo:table-row> - <fo:table-row> + <fo:table-row height="4in" background-color="blue"> <fo:table-cell> - <fo:block>Row 4 Col 1</fo:block> + <fo:block>Row 2 Col 1</fo:block> </fo:table-cell> <fo:table-cell> - <fo:block>Row 4 Col 2</fo:block> + <fo:block>Row 2 Col 2</fo:block> </fo:table-cell> <fo:table-cell> - <fo:block>Row 4 Col 3</fo:block> + <fo:block>Row 2 Col 3</fo:block> </fo:table-cell> </fo:table-row> </fo:table-body> </fo:table> - <fo:block>Table with centered header background</fo:block> + <fo:block>Table with centered background image in header and footer</fo:block> </fo:flow> </fo:page-sequence> </fo:root> </fo> <checks> + <!-- backgrounds on table-header/footer are not supported at the time this test + was written. Therefore no checks! --> </checks> </testcase> diff --git a/test/layoutengine/testcases/background-image2.xml b/test/layoutengine/testcases/background-image2.xml index 2b3bbeb0a..2ed43b0ce 100644 --- a/test/layoutengine/testcases/background-image2.xml +++ b/test/layoutengine/testcases/background-image2.xml @@ -18,7 +18,7 @@ <testcase> <info> <p> - This test checks background images. + This test checks background images in block-containers. </p> </info> <variables> diff --git a/test/layoutengine/testcases/background-image3.xml b/test/layoutengine/testcases/background-image3.xml index 2f480ac03..ec99b9646 100644 --- a/test/layoutengine/testcases/background-image3.xml +++ b/test/layoutengine/testcases/background-image3.xml @@ -33,18 +33,19 @@ </fo:layout-master-set> <fo:page-sequence master-reference="normal" white-space-collapse="true"> <fo:flow flow-name="xsl-region-body"> - <fo:block-container height="100%" width="100%" background-color="yellow"> - <fo:block background-repeat="no-repeat" background-position-horizontal="center" background-position-vertical="center" background-image="##img"> - normal block<fo:block/> - normal block - </fo:block> + <fo:block-container height="50%" width="50%" background-repeat="no-repeat" background-position-horizontal="center" background-position-vertical="center" background-image="##img"> + <fo:block background-repeat="no-repeat" background-position-horizontal="center" background-position-vertical="center" background-image="##img"> + normal block<fo:block/> + normal block + </fo:block> </fo:block-container> </fo:flow> </fo:page-sequence> </fo:root> </fo> <checks> - <eval expected="color=#ffff00" xpath="//flow/block[1]/@background"/> - <eval expected="color=null,url=../../resources/images/bgimg300dpi.jpg,repeat=no-repeat,horiz=136960,vertical=-8640" xpath="//flow/block[1]/block[1]/block[1]/@background"/> + <eval expected="color=null,url=../../resources/images/bgimg300dpi.jpg,repeat=no-repeat,horiz=136960,vertical=136960" xpath="//regionViewport/@background"/> + <eval expected="color=null,url=../../resources/images/bgimg300dpi.jpg,repeat=no-repeat,horiz=56960,vertical=56960" xpath="//flow/block[1]/@background"/> + <eval expected="color=null,url=../../resources/images/bgimg300dpi.jpg,repeat=no-repeat,horiz=56960,vertical=-8640" xpath="//flow/block[1]/block[1]/block[1]/@background"/> </checks> </testcase> diff --git a/test/layoutengine/testcases/background-image5.xml b/test/layoutengine/testcases/background-image5.xml index 353f36fb9..92f3c31f3 100644 --- a/test/layoutengine/testcases/background-image5.xml +++ b/test/layoutengine/testcases/background-image5.xml @@ -18,7 +18,7 @@ <testcase> <info> <p> - This test checks background image on a fo:basic-link. + This test checks background image on a fo:inline. </p> </info> <variables> @@ -34,12 +34,15 @@ <fo:page-sequence master-reference="normal" white-space-collapse="true"> <fo:flow flow-name="xsl-region-body"> <fo:block> - Why is <fo:inline font-size="96pt" background-repeat="no-repeat" background-position-horizontal="center" background-position-vertical="center" background-image="##img" background-color="lightgray">FOP</fo:inline> so cool? + Why is <fo:inline font-size="96pt" background-color="yellow" background-repeat="no-repeat" background-position-horizontal="center" background-position-vertical="center" background-image="##img">FOP</fo:inline> so cool? </fo:block> </fo:flow> </fo:page-sequence> </fo:root> </fo> <checks> + <eval expected="197376" xpath="//flow/block/lineArea/inlineparent/@ipd"/> + <eval expected="92100" xpath="//flow/block/lineArea/inlineparent/@bpd"/> + <eval expected="color=#ffff00,url=../../resources/images/bgimg300dpi.jpg,repeat=no-repeat,horiz=75648,vertical=23010" xpath="//flow/block/lineArea/inlineparent/@background"/> </checks> </testcase> diff --git a/test/layoutengine/testcases/background-image7.xml b/test/layoutengine/testcases/background-image7.xml index 0e8d0d210..ce3c7bdd6 100644 --- a/test/layoutengine/testcases/background-image7.xml +++ b/test/layoutengine/testcases/background-image7.xml @@ -34,12 +34,15 @@ <fo:page-sequence master-reference="normal" white-space-collapse="true"> <fo:flow flow-name="xsl-region-body"> <fo:block> - Why is <fo:basic-link external-destination="http://xmlgraphics.apache.org/fop" font-size="96pt" background-repeat="no-repeat" background-position-horizontal="center" background-position-vertical="center" background-image="##img">FOP</fo:basic-link> so cool? + Why is <fo:basic-link external-destination="http://xmlgraphics.apache.org/fop" font-size="96pt" background-color="yellow" background-repeat="no-repeat" background-position-horizontal="center" background-position-vertical="center" background-image="##img">FOP</fo:basic-link> so cool? </fo:block> </fo:flow> </fo:page-sequence> </fo:root> </fo> <checks> + <eval expected="197376" xpath="//flow/block/lineArea/inlineparent/@ipd"/> + <eval expected="92100" xpath="//flow/block/lineArea/inlineparent/@bpd"/> + <eval expected="color=#ffff00,url=../../resources/images/bgimg300dpi.jpg,repeat=no-repeat,horiz=75648,vertical=23010" xpath="//flow/block/lineArea/inlineparent/@background"/> </checks> </testcase> diff --git a/test/layoutengine/testcases/external-graphic1.xml b/test/layoutengine/testcases/external-graphic1.xml index 76c839ee2..736ade4b7 100644 --- a/test/layoutengine/testcases/external-graphic1.xml +++ b/test/layoutengine/testcases/external-graphic1.xml @@ -41,7 +41,7 @@ </fo> <checks> <eval expected="360000" xpath="/areaTree/pageSequence/pageViewport/page[1]/regionViewport/regionBody/mainReference/span/flow/block[2]/@ipd"/> - <eval expected="50214" xpath="/areaTree/pageSequence/pageViewport/page[1]/regionViewport/regionBody/mainReference/span/flow/block[2]/@bpd"/> + <eval expected="51864" xpath="/areaTree/pageSequence/pageViewport/page[1]/regionViewport/regionBody/mainReference/span/flow/block[2]/@bpd"/> <eval expected="46080" xpath="/areaTree/pageSequence/pageViewport/page[1]/regionViewport/regionBody/mainReference/span/flow/block[2]/lineArea/viewport/@ipd"/> <eval expected="46080" xpath="/areaTree/pageSequence/pageViewport/page[1]/regionViewport/regionBody/mainReference/span/flow/block[2]/lineArea/viewport/@ipda"/> <eval expected="46080" xpath="/areaTree/pageSequence/pageViewport/page[1]/regionViewport/regionBody/mainReference/span/flow/block[2]/lineArea/viewport/@bpd"/> diff --git a/test/layoutengine/testcases/external-graphic2.xml b/test/layoutengine/testcases/external-graphic2.xml index a6203e7f7..ae099e6d6 100644 --- a/test/layoutengine/testcases/external-graphic2.xml +++ b/test/layoutengine/testcases/external-graphic2.xml @@ -46,14 +46,14 @@ <checks> <!-- first image --> <eval expected="360000" xpath="/areaTree/pageSequence/pageViewport/page[1]/regionViewport/regionBody/mainReference/span/flow/block[2]/@ipd"/> - <eval expected="44134" xpath="/areaTree/pageSequence/pageViewport/page[1]/regionViewport/regionBody/mainReference/span/flow/block[2]/@bpd"/> + <eval expected="45784" xpath="/areaTree/pageSequence/pageViewport/page[1]/regionViewport/regionBody/mainReference/span/flow/block[2]/@bpd"/> <eval expected="46080" xpath="/areaTree/pageSequence/pageViewport/page[1]/regionViewport/regionBody/mainReference/span/flow/block[2]/lineArea/viewport/@ipd"/> <eval expected="46080" xpath="/areaTree/pageSequence/pageViewport/page[1]/regionViewport/regionBody/mainReference/span/flow/block[2]/lineArea/viewport/@ipda"/> <eval expected="40000" xpath="/areaTree/pageSequence/pageViewport/page[1]/regionViewport/regionBody/mainReference/span/flow/block[2]/lineArea/viewport/@bpd"/> <eval expected="40000" xpath="/areaTree/pageSequence/pageViewport/page[1]/regionViewport/regionBody/mainReference/span/flow/block[2]/lineArea/viewport/@bpda"/> - <!-- first image --> + <!-- second image --> <eval expected="360000" xpath="/areaTree/pageSequence/pageViewport/page[1]/regionViewport/regionBody/mainReference/span/flow/block[4]/@ipd"/> - <eval expected="50214" xpath="/areaTree/pageSequence/pageViewport/page[1]/regionViewport/regionBody/mainReference/span/flow/block[4]/@bpd"/> + <eval expected="51864" xpath="/areaTree/pageSequence/pageViewport/page[1]/regionViewport/regionBody/mainReference/span/flow/block[4]/@bpd"/> <eval expected="40000" xpath="/areaTree/pageSequence/pageViewport/page[1]/regionViewport/regionBody/mainReference/span/flow/block[4]/lineArea/viewport/@ipd"/> <eval expected="40000" xpath="/areaTree/pageSequence/pageViewport/page[1]/regionViewport/regionBody/mainReference/span/flow/block[4]/lineArea/viewport/@ipda"/> <eval expected="46080" xpath="/areaTree/pageSequence/pageViewport/page[1]/regionViewport/regionBody/mainReference/span/flow/block[4]/lineArea/viewport/@bpd"/> diff --git a/test/layoutengine/testcases/external-graphic4.xml b/test/layoutengine/testcases/external-graphic4.xml index 3b091a8c0..eec2e7b70 100644 --- a/test/layoutengine/testcases/external-graphic4.xml +++ b/test/layoutengine/testcases/external-graphic4.xml @@ -1,52 +1,49 @@ -<?xml version="1.0" encoding="UTF-8"?>
-<!--
- Copyright 2005 The Apache Software Foundation
-
- Licensed 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$ -->
-<testcase>
- <info>
- <p>
- This test checks external-graphics. An oversized image is to be squeezed into page using min/opt/max values.
- </p>
- </info>
- <fo>
- <fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format" xmlns:svg="http://www.w3.org/2000/svg">
- <fo:layout-master-set>
- <fo:simple-page-master master-name="normal" page-width="21cm" page-height="29.7cm" margin="2cm">
- <fo:region-body background-color="yellow"/>
- </fo:simple-page-master>
- </fo:layout-master-set>
- <fo:page-sequence master-reference="normal" white-space-collapse="true">
- <fo:flow flow-name="xsl-region-body">
- <fo:block font-size="8pt">This first block is only to force an infinite loop if the image is not scaled down.</fo:block>
- <!-- TODO If you remove the above block, the image is placed on the page although it's too big. No warnings. -->
- <fo:block>
- <fo:external-graphic src="../../resources/images/big-image.png"
- inline-progression-dimension.maximum="100%" block-progression-dimension.maximum="100%"
- content-width="scale-to-fit" content-height="scale-to-fit" overflow="hidden"/>
- </fo:block>
- <fo:block>EOF</fo:block>
- </fo:flow>
- </fo:page-sequence>
- </fo:root>
- </fo>
- <checks>
- <eval expected="0 0 595275 841889" xpath="//pageViewport/@bounds"/>
- <eval expected="481891" xpath="//regionBody/@ipda"/>
- <eval expected="728505" xpath="//regionBody/@bpda"/>
- <eval expected="481891" xpath="//flow/block[2]/lineArea/viewport/@ipda"/>
- <eval expected="728505" xpath="//flow/block[2]/lineArea/viewport/@bpda + //flow/block[1]/@bpda"/>
- </checks>
-</testcase>
+<?xml version="1.0" encoding="UTF-8"?> +<!-- + Copyright 2005 The Apache Software Foundation + + Licensed 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$ --> +<testcase> + <info> + <p> + This test checks external-graphics with relative content-height + </p> + </info> + <fo> + <fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format" xmlns:svg="http://www.w3.org/2000/svg"> + <fo:layout-master-set> + <fo:simple-page-master master-name="normal" page-width="5in" page-height="5in"> + <fo:region-body/> + </fo:simple-page-master> + </fo:layout-master-set> + <fo:page-sequence master-reference="normal" white-space-collapse="true"> + <fo:flow flow-name="xsl-region-body"> + <fo:block>plain external-graphic</fo:block> + <fo:block> + <fo:external-graphic src="../../resources/images/bgimg300dpi.jpg" content-height="200%" content-width="200%" />EOG + </fo:block> + <fo:block>EOF</fo:block> + </fo:flow> + </fo:page-sequence> + </fo:root> + </fo> + <checks> + <eval expected="360000" xpath="//flow/block[2]/@ipd"/> + <eval expected="92160" xpath="//flow/block[2]/lineArea/viewport/@ipd"/> + <eval expected="92160" xpath="//flow/block[2]/lineArea/viewport/@ipda"/> + <eval expected="92160" xpath="//flow/block[2]/lineArea/viewport/@bpd"/> + <eval expected="92160" xpath="//flow/block[2]/lineArea/viewport/@bpda"/> + </checks> +</testcase> diff --git a/test/layoutengine/testcases/font-stretch.xml b/test/layoutengine/testcases/font-stretch.xml new file mode 100644 index 000000000..07d7ab7cf --- /dev/null +++ b/test/layoutengine/testcases/font-stretch.xml @@ -0,0 +1,55 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + Copyright 2005 The Apache Software Foundation + + Licensed 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$ --> +<testcase> + <info> + <p> + This test checks font stretches. + </p> + </info> + <fo> + <fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format" xmlns:svg="http://www.w3.org/2000/svg"> + <fo:layout-master-set> + <fo:simple-page-master master-name="normal" page-width="210mm" page-height="297mm"> + <fo:region-body/> + </fo:simple-page-master> + </fo:layout-master-set> + <fo:page-sequence master-reference="normal" white-space-collapse="true"> + <fo:flow flow-name="xsl-region-body"> + <fo:block font-family="serif">font-family="serif" font-stretch not given</fo:block> + <fo:block font-family="serif" font-stretch="ultra-condensed">font-family="serif" font-stretch="ultra-condensed" + <fo:block font-family="serif" font-stretch="narrower">font-family="serif" font-stretch="narrower"</fo:block> + </fo:block> + <fo:block font-family="serif" font-stretch="extra-condensed">font-family="serif" font-stretch="extra-condensed"</fo:block> + <fo:block font-family="serif" font-stretch="condensed">font-family="serif" font-stretch="condensed"</fo:block> + <fo:block font-family="serif" font-stretch="semi-condensed">font-family="serif" font-stretch="semi-condensed"</fo:block> + <fo:block font-family="serif" font-stretch="normal">font-family="serif" font-stretch="normal"</fo:block> + <fo:block font-family="serif" font-stretch="semi-expanded">font-family="serif" font-stretch="semi-expanded"</fo:block> + <fo:block font-family="serif" font-stretch="expanded">font-family="serif" font-stretch="expanded"</fo:block> + <fo:block font-family="serif" font-stretch="extra-expanded">font-family="serif" font-stretch="extra-expanded"</fo:block> + <fo:block font-family="serif" font-stretch="ultra-expanded">font-family="serif" font-stretch="ultra-expanded" + <fo:block font-family="serif" font-stretch="wider">font-family="serif" font-stretch="wider"</fo:block> + </fo:block> + <fo:block font-family="serif" font-stretch="narrower">font-family="serif" font-stretch="narrower"</fo:block> + <fo:block font-family="serif" font-stretch="wider">font-family="serif" font-stretch="wider"</fo:block> + </fo:flow> + </fo:page-sequence> + </fo:root> + </fo> + <checks> + </checks> +</testcase> diff --git a/test/layoutengine/testcases/leader-alignment.xml b/test/layoutengine/testcases/leader-alignment.xml new file mode 100644 index 000000000..c8257ab48 --- /dev/null +++ b/test/layoutengine/testcases/leader-alignment.xml @@ -0,0 +1,67 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + Copyright 2005 The Apache Software Foundation + + Licensed 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$ --> +<testcase> + <info> + <p> + This test checks leaders + </p> + </info> + <fo> + <fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format" xmlns:svg="http://www.w3.org/2000/svg"> + <fo:layout-master-set> + <fo:simple-page-master master-name="normal" page-width="5in" page-height="6in"> + <fo:region-body/> + </fo:simple-page-master> + </fo:layout-master-set> + <fo:page-sequence master-reference="normal" white-space-collapse="true"> + <fo:flow flow-name="xsl-region-body"> + <fo:block margin="0pt" padding-left="10mm"> + margin="0pt" padding-left="10mm" + </fo:block> + <fo:block padding-left="10mm"> + padding-left="10mm" + </fo:block> + <fo:block> + <fo:leader leader-length.minimum="12pt" + leader-length.optimum="80pt" + leader-length.maximum="100%" leader-pattern="dots" leader-alignment="page"/> + leader-alignment="page" + </fo:block> + <fo:block margin="0pt" padding-left="10mm"> + <fo:leader leader-length.minimum="12pt" + leader-length.optimum="80pt" + leader-length.maximum="100%" leader-pattern="dots" leader-alignment="page"/> + leader-alignment="page" + </fo:block> + <fo:block margin="0pt" padding-left="5mm"> + <fo:leader leader-length.minimum="12pt" + leader-length.optimum="80pt" + leader-length.maximum="100%" leader-pattern="dots" leader-alignment="reference-area"/> + leader-alignment="reference-area" + <fo:leader leader-length.minimum="12pt" + leader-length.optimum="80pt" + leader-length.maximum="100%" leader-pattern="dots" leader-alignment="reference-area"/> + leader-alignment="reference-area" Leader-pattern is aligned as if it began on the current reference-area's content-rectangle start-edge. + </fo:block> + </fo:flow> + </fo:page-sequence> + </fo:root> + </fo> + <checks> + </checks> +</testcase> diff --git a/test/layoutengine/testcases/leader-dots.xml b/test/layoutengine/testcases/leader-dots.xml index 52b7c67b9..d5ac49b92 100644 --- a/test/layoutengine/testcases/leader-dots.xml +++ b/test/layoutengine/testcases/leader-dots.xml @@ -43,17 +43,48 @@ leader-length="20mm" leader-pattern-width="5mm" </fo:block> <fo:block> + <fo:leader leader-pattern="dots" leader-length="20%" leader-pattern-width="5mm"/> + leader-length="20%" leader-pattern-width="5mm" + </fo:block> + <fo:block> <fo:leader leader-pattern="dots" leader-pattern-width="1pt"/> leader-pattern-width="1pt" </fo:block> <fo:block> - <fo:leader leader-pattern="dots" leader-pattern-width="5%"/> - leader-pattern-width="5%" + <fo:leader leader-pattern="dots" leader-length="20%" leader-pattern-width="5%"/> + leader-length="20%" leader-pattern-width="5%" </fo:block> </fo:flow> </fo:page-sequence> </fo:root> </fo> <checks> + <eval expected="14400" xpath="//flow/block[1]/lineArea/@bpd"/> + <eval expected="360000" xpath="//flow/block[1]/lineArea/@ipd"/> + <eval expected="12000" xpath="//flow/block[1]/lineArea/inlineparent/@ipd"/> + <eval expected="3" xpath="count(//flow/block[1]/lineArea/inlineparent/text)"/> + <eval expected="14400" xpath="//flow/block[2]/lineArea/@bpd"/> + <eval expected="360000" xpath="//flow/block[2]/lineArea/@ipd"/> + <eval expected="12000" xpath="//flow/block[2]/lineArea/inlineparent/@ipd"/> + <eval expected="3" xpath="count(//flow/block[2]/lineArea/inlineparent/text)"/> + <eval expected="14400" xpath="//flow/block[3]/lineArea/@bpd"/> + <eval expected="360000" xpath="//flow/block[3]/lineArea/@ipd"/> + <eval expected="56692" xpath="//flow/block[3]/lineArea/inlineparent/@ipd"/> + <eval expected="4" xpath="count(//flow/block[3]/lineArea/inlineparent/text)"/> + <eval expected="4" xpath="count(//flow/block[3]/lineArea/inlineparent/space)"/> + <eval expected="14400" xpath="//flow/block[4]/lineArea/@bpd"/> + <eval expected="360000" xpath="//flow/block[4]/lineArea/@ipd"/> + <eval expected="72000" xpath="//flow/block[4]/lineArea/inlineparent/@ipd"/> + <eval expected="5" xpath="count(//flow/block[4]/lineArea/inlineparent/text)"/> + <eval expected="5" xpath="count(//flow/block[4]/lineArea/inlineparent/space)"/> + <eval expected="14400" xpath="//flow/block[5]/lineArea/@bpd"/> + <eval expected="360000" xpath="//flow/block[5]/lineArea/@ipd"/> + <eval expected="12000" xpath="//flow/block[5]/lineArea/inlineparent/@ipd"/> + <eval expected="3" xpath="count(//flow/block[5]/lineArea/inlineparent/text)"/> + <eval expected="14400" xpath="//flow/block[6]/lineArea/@bpd"/> + <eval expected="360000" xpath="//flow/block[6]/lineArea/@ipd"/> + <eval expected="72000" xpath="//flow/block[6]/lineArea/inlineparent/@ipd"/> + <eval expected="4" xpath="count(//flow/block[6]/lineArea/inlineparent/text)"/> + <eval expected="4" xpath="count(//flow/block[6]/lineArea/inlineparent/space)"/> </checks> </testcase> diff --git a/test/layoutengine/testcases/leader-rule.xml b/test/layoutengine/testcases/leader-rule.xml index ee5b77450..4e65823fa 100644 --- a/test/layoutengine/testcases/leader-rule.xml +++ b/test/layoutengine/testcases/leader-rule.xml @@ -123,5 +123,77 @@ </fo:root> </fo> <checks> + <eval expected="14400" xpath="//flow/block[1]/lineArea/@bpd"/> + <eval expected="360000" xpath="//flow/block[1]/lineArea/@ipd"/> + <eval expected="12000" xpath="//flow/block[1]/lineArea/leader/@ipd"/> + <eval expected="solid" xpath="//flow/block[1]/lineArea/leader/@ruleStyle"/> + <eval expected="1000" xpath="//flow/block[1]/lineArea/leader/@ruleThickness"/> + <eval expected="14400" xpath="//flow/block[2]/lineArea/@bpd"/> + <eval expected="360000" xpath="//flow/block[2]/lineArea/@ipd"/> + <eval expected="12000" xpath="//flow/block[2]/lineArea/leader/@ipd"/> + <eval expected="--NYI--" xpath="//flow/block[2]/lineArea/leader/@ruleStyle"/> + <eval expected="1000" xpath="//flow/block[2]/lineArea/leader/@ruleThickness"/> + <eval expected="14400" xpath="//flow/block[3]/lineArea/@bpd"/> + <eval expected="360000" xpath="//flow/block[3]/lineArea/@ipd"/> + <eval expected="12000" xpath="//flow/block[3]/lineArea/leader/@ipd"/> + <eval expected="dotted" xpath="//flow/block[3]/lineArea/leader/@ruleStyle"/> + <eval expected="1000" xpath="//flow/block[3]/lineArea/leader/@ruleThickness"/> + <eval expected="14400" xpath="//flow/block[4]/lineArea/@bpd"/> + <eval expected="360000" xpath="//flow/block[4]/lineArea/@ipd"/> + <eval expected="12000" xpath="//flow/block[4]/lineArea/leader/@ipd"/> + <eval expected="dashed" xpath="//flow/block[4]/lineArea/leader/@ruleStyle"/> + <eval expected="1000" xpath="//flow/block[4]/lineArea/leader/@ruleThickness"/> + <eval expected="14400" xpath="//flow/block[5]/lineArea/@bpd"/> + <eval expected="360000" xpath="//flow/block[5]/lineArea/@ipd"/> + <eval expected="12000" xpath="//flow/block[5]/lineArea/leader/@ipd"/> + <eval expected="solid" xpath="//flow/block[5]/lineArea/leader/@ruleStyle"/> + <eval expected="1000" xpath="//flow/block[5]/lineArea/leader/@ruleThickness"/> + <eval expected="14400" xpath="//flow/block[6]/lineArea/@bpd"/> + <eval expected="360000" xpath="//flow/block[6]/lineArea/@ipd"/> + <eval expected="12000" xpath="//flow/block[6]/lineArea/leader/@ipd"/> + <eval expected="double" xpath="//flow/block[6]/lineArea/leader/@ruleStyle"/> + <eval expected="1000" xpath="//flow/block[6]/lineArea/leader/@ruleThickness"/> + <eval expected="14400" xpath="//flow/block[7]/lineArea/@bpd"/> + <eval expected="360000" xpath="//flow/block[7]/lineArea/@ipd"/> + <eval expected="12000" xpath="//flow/block[7]/lineArea/leader/@ipd"/> + <eval expected="groove" xpath="//flow/block[7]/lineArea/leader/@ruleStyle"/> + <eval expected="1000" xpath="//flow/block[7]/lineArea/leader/@ruleThickness"/> + <eval expected="14400" xpath="//flow/block[8]/lineArea/@bpd"/> + <eval expected="360000" xpath="//flow/block[8]/lineArea/@ipd"/> + <eval expected="12000" xpath="//flow/block[8]/lineArea/leader/@ipd"/> + <eval expected="ridge" xpath="//flow/block[8]/lineArea/leader/@ruleStyle"/> + <eval expected="1000" xpath="//flow/block[8]/lineArea/leader/@ruleThickness"/> + <eval expected="14400" xpath="//flow/block[9]/lineArea/@bpd"/> + <eval expected="360000" xpath="//flow/block[9]/lineArea/@ipd"/> + <eval expected="12000" xpath="//flow/block[9]/lineArea/leader/@ipd"/> + <eval expected="dotted" xpath="//flow/block[9]/lineArea/leader/@ruleStyle"/> + <eval expected="3000" xpath="//flow/block[9]/lineArea/leader/@ruleThickness"/> + <eval expected="14400" xpath="//flow/block[10]/lineArea/@bpd"/> + <eval expected="360000" xpath="//flow/block[10]/lineArea/@ipd"/> + <eval expected="12000" xpath="//flow/block[10]/lineArea/leader/@ipd"/> + <eval expected="dashed" xpath="//flow/block[10]/lineArea/leader/@ruleStyle"/> + <eval expected="3000" xpath="//flow/block[10]/lineArea/leader/@ruleThickness"/> + <eval expected="14400" xpath="//flow/block[11]/lineArea/@bpd"/> + <eval expected="360000" xpath="//flow/block[11]/lineArea/@ipd"/> + <eval expected="12000" xpath="//flow/block[11]/lineArea/leader/@ipd"/> + <eval expected="solid" xpath="//flow/block[11]/lineArea/leader/@ruleStyle"/> + <eval expected="3000" xpath="//flow/block[11]/lineArea/leader/@ruleThickness"/> + <eval expected="14400" xpath="//flow/block[12]/lineArea/@bpd"/> + <eval expected="360000" xpath="//flow/block[12]/lineArea/@ipd"/> + <eval expected="12000" xpath="//flow/block[12]/lineArea/leader/@ipd"/> + <eval expected="double" xpath="//flow/block[12]/lineArea/leader/@ruleStyle"/> + <eval expected="3000" xpath="//flow/block[12]/lineArea/leader/@ruleThickness"/> + <eval expected="14400" xpath="//flow/block[13]/lineArea/@bpd"/> + <eval expected="360000" xpath="//flow/block[13]/lineArea/@ipd"/> + <eval expected="12000" xpath="//flow/block[13]/lineArea/leader/@ipd"/> + <eval expected="groove" xpath="//flow/block[13]/lineArea/leader/@ruleStyle"/> + <eval expected="3000" xpath="//flow/block[13]/lineArea/leader/@ruleThickness"/> + <eval expected="14400" xpath="//flow/block[14]/lineArea/@bpd"/> + <eval expected="360000" xpath="//flow/block[14]/lineArea/@ipd"/> + <eval expected="12000" xpath="//flow/block[14]/lineArea/leader/@ipd"/> + <eval expected="ridge" xpath="//flow/block[14]/lineArea/leader/@ruleStyle"/> + <eval expected="3000" xpath="//flow/block[14]/lineArea/leader/@ruleThickness"/> + <!-- No checks for the "alignment-baseline=..." section as this property is currently + not supported --> </checks> </testcase> diff --git a/test/layoutengine/testcases/leader-space.xml b/test/layoutengine/testcases/leader-space.xml index 2f8e3fa81..e82dfa680 100644 --- a/test/layoutengine/testcases/leader-space.xml +++ b/test/layoutengine/testcases/leader-space.xml @@ -35,25 +35,26 @@ Default space pattern </fo:block> <fo:block> - <fo:leader leader-pattern="space" leader-pattern-width="use-font-metrics"/> - leader-pattern-width="use-font-metrics" + <fo:leader leader-pattern="space" leader-length="0.5in"/> + leader-length="0.5in" </fo:block> <fo:block> - <fo:leader leader-pattern="space" leader-length="20mm" leader-pattern-width="5mm"/> - leader-length="20mm" leader-pattern-width="5mm" - </fo:block> - <fo:block> - <fo:leader leader-pattern="space" leader-pattern-width="1pt"/> - leader-pattern-width="1pt" - </fo:block> - <fo:block> - <fo:leader leader-pattern="space" leader-pattern-width="5%"/> - leader-pattern-width="5%" + <fo:leader leader-pattern="space" leader-length="5%"/> + leader-length="5%" </fo:block> </fo:flow> </fo:page-sequence> </fo:root> </fo> <checks> + <eval expected="14400" xpath="//flow/block[1]/lineArea/@bpd"/> + <eval expected="360000" xpath="//flow/block[1]/lineArea/@ipd"/> + <eval expected="12000" xpath="//flow/block[1]/lineArea/space/@ipd"/> + <eval expected="14400" xpath="//flow/block[2]/lineArea/@bpd"/> + <eval expected="360000" xpath="//flow/block[2]/lineArea/@ipd"/> + <eval expected="36000" xpath="//flow/block[2]/lineArea/space/@ipd"/> + <eval expected="14400" xpath="//flow/block[3]/lineArea/@bpd"/> + <eval expected="360000" xpath="//flow/block[3]/lineArea/@ipd"/> + <eval expected="18000" xpath="//flow/block[3]/lineArea/space/@ipd"/> </checks> </testcase> diff --git a/test/layoutengine/testcases/leader-use-content.xml b/test/layoutengine/testcases/leader-use-content.xml new file mode 100644 index 000000000..00b0d97fd --- /dev/null +++ b/test/layoutengine/testcases/leader-use-content.xml @@ -0,0 +1,59 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + Copyright 2005 The Apache Software Foundation + + Licensed 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$ --> +<testcase> + <info> + <p> + This test checks leaders with leader-pattern="use-content" + </p> + </info> + <fo> + <fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format" xmlns:svg="http://www.w3.org/2000/svg"> + <fo:layout-master-set> + <fo:simple-page-master master-name="normal" page-width="5in" page-height="5in"> + <fo:region-body/> + </fo:simple-page-master> + </fo:layout-master-set> + <fo:page-sequence master-reference="normal" white-space-collapse="true"> + <fo:flow flow-name="xsl-region-body"> + <fo:block> + <fo:leader leader-pattern="use-content"/> + Default dots pattern + </fo:block> + <fo:block> + <fo:leader leader-pattern="use-content" leader-pattern-width="use-font-metrics"/> + leader-pattern-width="use-font-metrics" + </fo:block> + <fo:block> + <fo:leader leader-pattern="use-content" leader-length="20mm" leader-pattern-width="5mm"/> + leader-length="20mm" leader-pattern-width="5mm" + </fo:block> + <fo:block> + <fo:leader leader-pattern="use-content" leader-pattern-width="1pt"/> + leader-pattern-width="1pt" + </fo:block> + <fo:block> + <fo:leader leader-pattern="use-content" leader-pattern-width="5%"/> + leader-pattern-width="5%" + </fo:block> + </fo:flow> + </fo:page-sequence> + </fo:root> + </fo> + <checks> + </checks> +</testcase> diff --git a/test/layoutengine/testcases/line-height.xml b/test/layoutengine/testcases/line-height.xml new file mode 100644 index 000000000..5908e14ce --- /dev/null +++ b/test/layoutengine/testcases/line-height.xml @@ -0,0 +1,74 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + Copyright 2005 The Apache Software Foundation + + Licensed 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$ --> +<testcase> + <info> + <p> + This test checks line height and its special inheritance behaviour + </p> + </info> + <fo> + <fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format" xmlns:svg="http://www.w3.org/2000/svg"> + <fo:layout-master-set> + <fo:simple-page-master master-name="normal" page-width="5in" page-height="5in"> + <fo:region-body/> + </fo:simple-page-master> + </fo:layout-master-set> + <fo:page-sequence master-reference="normal" white-space-collapse="true"> + <fo:flow flow-name="xsl-region-body"> + <fo:block line-height="normal" background-color="yellow">line-height="normal" + <fo:block font-size="larger" margin-left="10pt" background-color="blue">font-size="larger" - line height grows</fo:block> + <fo:block font-size="smaller" margin-left="10pt" background-color="red">font-size="smaller" - line height shrinks</fo:block> + </fo:block> + <fo:block line-height="150%" background-color="yellow">line-height="150%" + <fo:block font-size="larger" margin-left="10pt" background-color="blue">font-size="larger" - line height same as above</fo:block> + <fo:block font-size="smaller" margin-left="10pt" background-color="red">font-size="smaller" - line height same as above</fo:block> + </fo:block> + <fo:block line-height="20pt" background-color="yellow">line-height="20pt" + <fo:block font-size="larger" margin-left="10pt" background-color="blue">font-size="larger" - line height same as above</fo:block> + <fo:block font-size="smaller" margin-left="10pt" background-color="red">font-size="smaller" - line height same as above</fo:block> + </fo:block> + <fo:block line-height="1.5" background-color="yellow">line-height="1.5" + <fo:block font-size="larger" margin-left="10pt" background-color="blue">font-size="larger" - line height grows</fo:block> + <fo:block font-size="smaller" margin-left="10pt" background-color="red">font-size="smaller" - line height shrinks</fo:block> + </fo:block> + <fo:block line-height="150% - 5pt" background-color="yellow">line-height="150% - 5pt" + <fo:block font-size="larger" margin-left="10pt" background-color="blue">font-size="larger" - line height same as above</fo:block> + <fo:block font-size="smaller" margin-left="10pt" background-color="red">font-size="smaller" - line height same as above</fo:block> + </fo:block> + </fo:flow> + </fo:page-sequence> + </fo:root> + </fo> + <checks> + <eval expected="14400" xpath="//flow/block[1]/lineArea/@bpd"/> + <eval expected="17280" xpath="//flow/block[1]/block[1]/lineArea/@bpd"/> + <eval expected="12000" xpath="//flow/block[1]/block[2]/lineArea/@bpd"/> + <eval expected="18000" xpath="//flow/block[2]/lineArea/@bpd"/> + <eval expected="18000" xpath="//flow/block[2]/block[1]/lineArea/@bpd"/> + <eval expected="18000" xpath="//flow/block[2]/block[2]/lineArea/@bpd"/> + <eval expected="20000" xpath="//flow/block[3]/lineArea/@bpd"/> + <eval expected="20000" xpath="//flow/block[3]/block[1]/lineArea/@bpd"/> + <eval expected="20000" xpath="//flow/block[3]/block[2]/lineArea/@bpd"/> + <eval expected="18000" xpath="//flow/block[4]/lineArea/@bpd"/> + <eval expected="21600" xpath="//flow/block[4]/block[1]/lineArea/@bpd"/> + <eval expected="15000" xpath="//flow/block[4]/block[2]/lineArea/@bpd"/> + <eval expected="13000" xpath="//flow/block[5]/lineArea/@bpd"/> + <eval expected="13000" xpath="//flow/block[5]/block[1]/lineArea/@bpd"/> + <eval expected="13000" xpath="//flow/block[5]/block[2]/lineArea/@bpd"/> + </checks> +</testcase> diff --git a/test/layoutengine/testcases/margin-block1.xml b/test/layoutengine/testcases/margin-block1.xml new file mode 100644 index 000000000..f3f9b531c --- /dev/null +++ b/test/layoutengine/testcases/margin-block1.xml @@ -0,0 +1,63 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + Copyright 2005 The Apache Software Foundation + + Licensed 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$ --> +<testcase> + <info> + <p> + This test checks margin percentages on fo:block. + </p> + </info> + <fo> + <fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format" xmlns:svg="http://www.w3.org/2000/svg"> + <fo:layout-master-set> + <fo:simple-page-master master-name="normal" page-width="5in" page-height="5in"> + <fo:region-body/> + </fo:simple-page-master> + </fo:layout-master-set> + <fo:page-sequence master-reference="normal" white-space-collapse="true"> + <fo:flow flow-name="xsl-region-body"> + <fo:block margin="5%" background-color="yellow"> + <fo:block margin="5%" background-color="blue"> + margin="5%" - should have the slightly smaller margin than the enclosing block + </fo:block> + </fo:block> + <fo:block>Yellow block has margin="5%" - 18pt margin based on 5in page width</fo:block> + </fo:flow> + </fo:page-sequence> + </fo:root> + </fo> + <checks> + <eval expected="0" xpath="//flow/block[1]/@ipd"/> + <eval expected="18000" xpath="//flow/block[1]/@bpd"/> + <eval expected="324000" xpath="//flow/block[2]/@ipd"/> + <eval expected="18000" xpath="//flow/block[2]/@start-indent"/> + <eval expected="18000" xpath="//flow/block[2]/@end-indent"/> + <eval expected="18000" xpath="//flow/block[2]/@space-start"/> + <eval expected="18000" xpath="//flow/block[2]/@space-end"/> + <eval expected="0" xpath="//flow/block[2]/block[1]/@ipd"/> + <eval expected="16200" xpath="//flow/block[2]/block[1]/@bpd"/> + <eval expected="291600" xpath="//flow/block[2]/block[2]/@ipd"/> + <eval expected="34200" xpath="//flow/block[2]/block[2]/@start-indent"/> + <eval expected="34200" xpath="//flow/block[2]/block[2]/@end-indent"/> + <eval expected="34200" xpath="//flow/block[2]/block[2]/@space-start"/> + <eval expected="34200" xpath="//flow/block[2]/block[2]/@space-end"/> + <eval expected="0" xpath="//flow/block[2]/block[3]/@ipd"/> + <eval expected="16200" xpath="//flow/block[2]/block[3]/@bpd"/> + <eval expected="0" xpath="//flow/block[3]/@ipd"/> + <eval expected="18000" xpath="//flow/block[3]/@bpd"/> + </checks> +</testcase> diff --git a/test/layoutengine/testcases/margin-block2.xml b/test/layoutengine/testcases/margin-block2.xml new file mode 100644 index 000000000..da022fb3b --- /dev/null +++ b/test/layoutengine/testcases/margin-block2.xml @@ -0,0 +1,63 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + Copyright 2005 The Apache Software Foundation + + Licensed 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$ --> +<testcase> + <info> + <p> + This test checks margin percentages on fo:block with explict inheritance. + </p> + </info> + <fo> + <fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format" xmlns:svg="http://www.w3.org/2000/svg"> + <fo:layout-master-set> + <fo:simple-page-master master-name="normal" page-width="5in" page-height="5in"> + <fo:region-body/> + </fo:simple-page-master> + </fo:layout-master-set> + <fo:page-sequence master-reference="normal" white-space-collapse="true"> + <fo:flow flow-name="xsl-region-body"> + <fo:block margin="5%" background-color="yellow"> + <fo:block margin="inherit" background-color="blue"> + margin="inherit" - should have the same margin as the enclosing block + </fo:block> + </fo:block> + <fo:block>Yellow block has margin="5%" - 18pt margin based on 5in page width</fo:block> + </fo:flow> + </fo:page-sequence> + </fo:root> + </fo> + <checks> + <eval expected="0" xpath="//flow/block[1]/@ipd"/> + <eval expected="18000" xpath="//flow/block[1]/@bpd"/> + <eval expected="324000" xpath="//flow/block[2]/@ipd"/> + <eval expected="18000" xpath="//flow/block[2]/@start-indent"/> + <eval expected="18000" xpath="//flow/block[2]/@end-indent"/> + <eval expected="18000" xpath="//flow/block[2]/@space-start"/> + <eval expected="18000" xpath="//flow/block[2]/@space-end"/> + <eval expected="0" xpath="//flow/block[2]/block[1]/@ipd"/> + <eval expected="18000" xpath="//flow/block[2]/block[1]/@bpd"/> + <eval expected="288000" xpath="//flow/block[2]/block[2]/@ipd"/> + <eval expected="36000" xpath="//flow/block[2]/block[2]/@start-indent"/> + <eval expected="36000" xpath="//flow/block[2]/block[2]/@end-indent"/> + <eval expected="36000" xpath="//flow/block[2]/block[2]/@space-start"/> + <eval expected="36000" xpath="//flow/block[2]/block[2]/@space-end"/> + <eval expected="0" xpath="//flow/block[2]/block[3]/@ipd"/> + <eval expected="18000" xpath="//flow/block[2]/block[3]/@bpd"/> + <eval expected="0" xpath="//flow/block[3]/@ipd"/> + <eval expected="18000" xpath="//flow/block[3]/@bpd"/> + </checks> +</testcase> diff --git a/test/layoutengine/testcases/margin-region1.xml b/test/layoutengine/testcases/margin-region1.xml new file mode 100644 index 000000000..b1a734133 --- /dev/null +++ b/test/layoutengine/testcases/margin-region1.xml @@ -0,0 +1,106 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + Copyright 2005 The Apache Software Foundation + + Licensed 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$ --> +<testcase> + <info> + <p> + This test checks relative margin on region (region-body). + </p> + </info> + <variables> + <img>../../resources/images/bgimg300dpi.jpg</img> + </variables> + <fo> + <fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format" xmlns:svg="http://www.w3.org/2000/svg"> + <fo:layout-master-set> + <fo:simple-page-master master-name="normal" page-width="3in" page-height="5in" margin="5%"> + <fo:region-body margin="5%" background-color="yellow" /> + <fo:region-before extent="5%" background-color="blue" precedence="true" /> + <fo:region-after extent="5%" background-color="green" precedence="true" /> + <fo:region-start extent="5%" background-color="red" /> + <fo:region-end extent="5%" background-color="orange" /> + </fo:simple-page-master> + </fo:layout-master-set> + <fo:page-sequence master-reference="normal" white-space-collapse="true"> + <fo:static-content flow-name="xsl-region-before"> + <fo:block> + r e g i o n b e f o r e + </fo:block> + </fo:static-content> + <fo:static-content flow-name="xsl-region-after"> + <fo:block> + r e g i o n a f t e r + </fo:block> + </fo:static-content> + <fo:static-content flow-name="xsl-region-start"> + <fo:block> + r e g i o n s t a r t + </fo:block> + </fo:static-content> + <fo:static-content flow-name="xsl-region-end"> + <fo:block> + r e g i o n e n d + </fo:block> + </fo:static-content> + <fo:flow flow-name="xsl-region-body"> + <fo:block> + Demonstrates relative 5% margins on all regions and the page master. + The page size is 5in x 3in. This gives top and bottom margins of 0.25in and + left and right margins 0.15in. + </fo:block> + </fo:flow> + </fo:page-sequence> + </fo:root> + </fo> + <checks> + <!-- region before --> + <eval expected="color=#0000ff" xpath="//page/regionViewport[1]/@background"/> + <eval expected="194400" xpath="//page/regionViewport[1]/@ipd"/> + <eval expected="18000" xpath="//page/regionViewport[1]/@bpd"/> + <eval expected="10800 18000 194400 18000" xpath="//page/regionViewport[1]/@rect"/> + <eval expected="194400" xpath="//page/regionViewport[1]/regionBefore/@ipd"/> + <eval expected="18000" xpath="//page/regionViewport[1]/regionBefore/@bpd"/> + <!-- region start --> + <eval expected="color=#ff0000" xpath="//page/regionViewport[2]/@background"/> + <eval expected="10800" xpath="//page/regionViewport[2]/@ipd"/> + <eval expected="288000" xpath="//page/regionViewport[2]/@bpd"/> + <eval expected="10800 36000 10800 288000" xpath="//page/regionViewport[2]/@rect"/> + <eval expected="10800" xpath="//page/regionViewport[2]/regionStart/@ipd"/> + <eval expected="288000" xpath="//page/regionViewport[2]/regionStart/@bpd"/> + <!-- region end --> + <eval expected="color=#ffa500" xpath="//page/regionViewport[3]/@background"/> + <eval expected="10800" xpath="//page/regionViewport[3]/@ipd"/> + <eval expected="288000" xpath="//page/regionViewport[3]/@bpd"/> + <eval expected="194400 36000 10800 288000" xpath="//page/regionViewport[3]/@rect"/> + <eval expected="10800" xpath="//page/regionViewport[3]/regionEnd/@ipd"/> + <eval expected="288000" xpath="//page/regionViewport[3]/regionEnd/@bpd"/> + <!-- region after --> + <eval expected="color=#008000" xpath="//page/regionViewport[4]/@background"/> + <eval expected="194400" xpath="//page/regionViewport[4]/@ipd"/> + <eval expected="18000" xpath="//page/regionViewport[4]/@bpd"/> + <eval expected="10800 324000 194400 18000" xpath="//page/regionViewport[4]/@rect"/> + <eval expected="194400" xpath="//page/regionViewport[4]/regionAfter/@ipd"/> + <eval expected="18000" xpath="//page/regionViewport[4]/regionAfter/@bpd"/> + <!-- region body --> + <eval expected="color=#ffff00" xpath="//page/regionViewport[5]/@background"/> + <eval expected="172800" xpath="//page/regionViewport[5]/@ipd"/> + <eval expected="288000" xpath="//page/regionViewport[5]/@bpd"/> + <eval expected="21600 36000 172800 288000" xpath="//page/regionViewport[5]/@rect"/> + <eval expected="172800" xpath="//page/regionViewport[5]/regionBody/@ipd"/> + <eval expected="288000" xpath="//page/regionViewport[5]/regionBody/@bpd"/> + </checks> +</testcase> diff --git a/test/layoutengine/testcases/margin-region2.xml b/test/layoutengine/testcases/margin-region2.xml new file mode 100644 index 000000000..fa05f777c --- /dev/null +++ b/test/layoutengine/testcases/margin-region2.xml @@ -0,0 +1,107 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + Copyright 2005 The Apache Software Foundation + + Licensed 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$ --> +<testcase> + <info> + <p> + This test checks relative margin on region (region-body). + </p> + </info> + <variables> + <img>../../resources/images/bgimg300dpi.jpg</img> + </variables> + <fo> + <fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format" xmlns:svg="http://www.w3.org/2000/svg"> + <fo:layout-master-set> + <fo:simple-page-master master-name="normal" page-width="3in" page-height="5in" margin="5%" reference-orientation="90"> + <fo:region-body margin="5%" background-color="yellow" /> + <fo:region-before extent="5%" background-color="blue" precedence="true" /> + <fo:region-after extent="5%" background-color="green" precedence="true" /> + <fo:region-start extent="5%" background-color="red" /> + <fo:region-end extent="5%" background-color="orange" /> + </fo:simple-page-master> + </fo:layout-master-set> + <fo:page-sequence master-reference="normal" white-space-collapse="true"> + <fo:static-content flow-name="xsl-region-before"> + <fo:block> + r e g i o n b e f o r e + </fo:block> + </fo:static-content> + <fo:static-content flow-name="xsl-region-after"> + <fo:block> + r e g i o n a f t e r + </fo:block> + </fo:static-content> + <fo:static-content flow-name="xsl-region-start"> + <fo:block> + r e g i o n s t a r t + </fo:block> + </fo:static-content> + <fo:static-content flow-name="xsl-region-end"> + <fo:block> + r e g i o n e n d + </fo:block> + </fo:static-content> + <fo:flow flow-name="xsl-region-body"> + <fo:block> + Demonstrates relative 5% margins on all regions and the page master with a + landscape reference orientation. + The page size is 5in x 3in. This gives top and bottom margins of 0.25in and + left and right margins 0.15in. + </fo:block> + </fo:flow> + </fo:page-sequence> + </fo:root> + </fo> + <checks> + <!-- region before --> + <eval expected="color=#0000ff" xpath="//page/regionViewport[1]/@background"/> + <eval expected="324000" xpath="//page/regionViewport[1]/@ipd"/> + <eval expected="18000" xpath="//page/regionViewport[1]/@bpd"/> + <eval expected="10800 18000 18000 324000" xpath="//page/regionViewport[1]/@rect"/> + <eval expected="324000" xpath="//page/regionViewport[1]/regionBefore/@ipd"/> + <eval expected="18000" xpath="//page/regionViewport[1]/regionBefore/@bpd"/> + <!-- region start --> + <eval expected="color=#ff0000" xpath="//page/regionViewport[2]/@background"/> + <eval expected="10800" xpath="//page/regionViewport[2]/@ipd"/> + <eval expected="158400" xpath="//page/regionViewport[2]/@bpd"/> + <eval expected="28800 331200 158400 10800" xpath="//page/regionViewport[2]/@rect"/> + <eval expected="10800" xpath="//page/regionViewport[2]/regionStart/@ipd"/> + <eval expected="158400" xpath="//page/regionViewport[2]/regionStart/@bpd"/> + <!-- region end --> + <eval expected="color=#ffa500" xpath="//page/regionViewport[3]/@background"/> + <eval expected="10800" xpath="//page/regionViewport[3]/@ipd"/> + <eval expected="158400" xpath="//page/regionViewport[3]/@bpd"/> + <eval expected="28800 18000 158400 10800" xpath="//page/regionViewport[3]/@rect"/> + <eval expected="10800" xpath="//page/regionViewport[3]/regionEnd/@ipd"/> + <eval expected="158400" xpath="//page/regionViewport[3]/regionEnd/@bpd"/> + <!-- region after --> + <eval expected="color=#008000" xpath="//page/regionViewport[4]/@background"/> + <eval expected="324000" xpath="//page/regionViewport[4]/@ipd"/> + <eval expected="18000" xpath="//page/regionViewport[4]/@bpd"/> + <eval expected="187200 18000 18000 324000" xpath="//page/regionViewport[4]/@rect"/> + <eval expected="324000" xpath="//page/regionViewport[4]/regionAfter/@ipd"/> + <eval expected="18000" xpath="//page/regionViewport[4]/regionAfter/@bpd"/> + <!-- region body --> + <eval expected="color=#ffff00" xpath="//page/regionViewport[5]/@background"/> + <eval expected="302400" xpath="//page/regionViewport[5]/@ipd"/> + <eval expected="158400" xpath="//page/regionViewport[5]/@bpd"/> + <eval expected="28800 28800 158400 302400" xpath="//page/regionViewport[5]/@rect"/> + <eval expected="302400" xpath="//page/regionViewport[5]/regionBody/@ipd"/> + <eval expected="158400" xpath="//page/regionViewport[5]/regionBody/@bpd"/> + </checks> +</testcase> diff --git a/test/layoutengine/testcases/margin-region3.xml b/test/layoutengine/testcases/margin-region3.xml new file mode 100644 index 000000000..a4861456d --- /dev/null +++ b/test/layoutengine/testcases/margin-region3.xml @@ -0,0 +1,109 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + Copyright 2005 The Apache Software Foundation + + Licensed 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$ --> +<testcase> + <info> + <p> + This test checks relative margin on regions (region-body). + </p> + </info> + <variables> + <img>../../resources/images/bgimg300dpi.jpg</img> + </variables> + <fo> + <fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format" xmlns:svg="http://www.w3.org/2000/svg"> + <fo:layout-master-set> + <fo:simple-page-master master-name="normal" page-width="3in" page-height="5in" margin="5%" writing-mode="rl"> + <fo:region-body margin-top="5%" margin-bottom="5%" margin-left="5%" margin-right="10%" background-color="yellow" /> + <fo:region-before extent="5%" background-color="blue" precedence="true" /> + <fo:region-after extent="5%" background-color="green" precedence="true" /> + <fo:region-start extent="10%" background-color="red" /> + <fo:region-end extent="5%" background-color="orange" /> + </fo:simple-page-master> + </fo:layout-master-set> + <fo:page-sequence master-reference="normal" white-space-collapse="true"> + <fo:static-content flow-name="xsl-region-before"> + <fo:block> + r e g i o n b e f o r e + </fo:block> + </fo:static-content> + <fo:static-content flow-name="xsl-region-after"> + <fo:block> + r e g i o n a f t e r + </fo:block> + </fo:static-content> + <fo:static-content flow-name="xsl-region-start"> + <fo:block> + r e g i o n s t a r t + </fo:block> + </fo:static-content> + <fo:static-content flow-name="xsl-region-end"> + <fo:block> + r e g i o n e n d + </fo:block> + </fo:static-content> + <fo:flow flow-name="xsl-region-body"> + <fo:block> + Demonstrates relative 5% margins on all regions and the page master. + The page size is 5in x 3in. This gives top and bottom margins of 0.25in and + left and right margins 0.15in. + </fo:block> + </fo:flow> + </fo:page-sequence> + </fo:root> + </fo> + <checks> + <!-- The values in these checks are currently not correct. However, there is also a bug + in the rl writing mode causing a swap of left and right margin. Both should be fixed at + the same time. --> + <!-- region before --> + <eval expected="color=#0000ff" xpath="//page/regionViewport[1]/@background"/> + <eval expected="194400" xpath="//page/regionViewport[1]/@ipd"/> + <eval expected="18000" xpath="//page/regionViewport[1]/@bpd"/> + <eval expected="10800 18000 194400 18000" xpath="//page/regionViewport[1]/@rect"/> + <eval expected="194400" xpath="//page/regionViewport[1]/regionBefore/@ipd"/> + <eval expected="18000" xpath="//page/regionViewport[1]/regionBefore/@bpd"/> + <!-- region start --> + <eval expected="color=#ff0000" xpath="//page/regionViewport[2]/@background"/> + <eval expected="10800" xpath="//page/regionViewport[2]/@ipd"/> + <eval expected="288000" xpath="//page/regionViewport[2]/@bpd"/> + <eval expected="10800 36000 10800 288000" xpath="//page/regionViewport[2]/@rect"/> + <eval expected="10800" xpath="//page/regionViewport[2]/regionStart/@ipd"/> + <eval expected="288000" xpath="//page/regionViewport[2]/regionStart/@bpd"/> + <!-- region end --> + <eval expected="color=#ffa500" xpath="//page/regionViewport[3]/@background"/> + <eval expected="10800" xpath="//page/regionViewport[3]/@ipd"/> + <eval expected="288000" xpath="//page/regionViewport[3]/@bpd"/> + <eval expected="194400 36000 10800 288000" xpath="//page/regionViewport[3]/@rect"/> + <eval expected="10800" xpath="//page/regionViewport[3]/regionEnd/@ipd"/> + <eval expected="288000" xpath="//page/regionViewport[3]/regionEnd/@bpd"/> + <!-- region after --> + <eval expected="color=#008000" xpath="//page/regionViewport[4]/@background"/> + <eval expected="194400" xpath="//page/regionViewport[4]/@ipd"/> + <eval expected="18000" xpath="//page/regionViewport[4]/@bpd"/> + <eval expected="10800 324000 194400 18000" xpath="//page/regionViewport[4]/@rect"/> + <eval expected="194400" xpath="//page/regionViewport[4]/regionAfter/@ipd"/> + <eval expected="18000" xpath="//page/regionViewport[4]/regionAfter/@bpd"/> + <!-- region body --> + <eval expected="color=#ffff00" xpath="//page/regionViewport[5]/@background"/> + <eval expected="172800" xpath="//page/regionViewport[5]/@ipd"/> + <eval expected="288000" xpath="//page/regionViewport[5]/@bpd"/> + <eval expected="21600 36000 172800 288000" xpath="//page/regionViewport[5]/@rect"/> + <eval expected="172800" xpath="//page/regionViewport[5]/regionBody/@ipd"/> + <eval expected="288000" xpath="//page/regionViewport[5]/regionBody/@bpd"/> + </checks> +</testcase> diff --git a/test/layoutengine/testcases/padding-block-container1.xml b/test/layoutengine/testcases/padding-block-container1.xml new file mode 100644 index 000000000..ca76d9afe --- /dev/null +++ b/test/layoutengine/testcases/padding-block-container1.xml @@ -0,0 +1,53 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + Copyright 2005 The Apache Software Foundation + + Licensed 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$ --> +<testcase> + <info> + <p> + This test checks relative padding on block containers. + </p> + </info> + <fo> + <fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format"> + <fo:layout-master-set> + <fo:simple-page-master master-name="normal" page-width="5in" page-height="5in"> + <fo:region-body/> + </fo:simple-page-master> + </fo:layout-master-set> + <fo:page-sequence master-reference="normal" white-space-collapse="true"> + <fo:flow flow-name="xsl-region-body"> + <fo:block-container width="2in" height="1in" background-color="yellow" padding="5%"> + <fo:block>margin not specified padding="5%" on this 2x1in yellow container</fo:block> + </fo:block-container> + <fo:block-container width="2in" height="1in" margin="0pt" background-color="blue" padding="5%"> + <fo:block>margin="0pt" padding="5%" on this 2x1in blue container</fo:block> + </fo:block-container> + </fo:flow> + </fo:page-sequence> + </fo:root> + </fo> + <checks> + <eval expected="18000 18000 18000 18000" xpath="//flow/block[1]/@bap"/> + <eval expected="-18000" xpath="//flow/block[1]/@space-start"/> + <eval expected="-18000" xpath="//flow/block[1]/@space-end"/> + <eval expected="color=#ffff00" xpath="//flow/block[1]/@background"/> + <eval expected="18000 18000 18000 18000" xpath="//flow/block[2]/@bap"/> + <eval expected="18000" xpath="//flow/block[2]/@start-indent"/> + <eval expected="18000" xpath="//flow/block[2]/@end-indent"/> + <eval expected="color=#0000ff" xpath="//flow/block[2]/@background"/> + </checks> +</testcase> diff --git a/test/layoutengine/testcases/padding-block1.xml b/test/layoutengine/testcases/padding-block1.xml new file mode 100644 index 000000000..45856b7cf --- /dev/null +++ b/test/layoutengine/testcases/padding-block1.xml @@ -0,0 +1,53 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + Copyright 2005 The Apache Software Foundation + + Licensed 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$ --> +<testcase> + <info> + <p> + This test checks relative padding on blocks. + </p> + </info> + <fo> + <fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format"> + <fo:layout-master-set> + <fo:simple-page-master master-name="normal" page-width="5in" page-height="5in"> + <fo:region-body/> + </fo:simple-page-master> + </fo:layout-master-set> + <fo:page-sequence master-reference="normal" white-space-collapse="true"> + <fo:flow flow-name="xsl-region-body"> + <fo:block background-color="yellow" padding="5%"> + margin not specified padding="5%" + </fo:block> + <fo:block margin="0pt" background-color="yellow" padding="5%"> + margin="0pt" padding="5%" + </fo:block> + </fo:flow> + </fo:page-sequence> + </fo:root> + </fo> + <checks> + <eval expected="18000 18000 18000 18000" xpath="//flow/block[1]/@bap"/> + <eval expected="-18000" xpath="//flow/block[1]/@space-start"/> + <eval expected="-18000" xpath="//flow/block[1]/@space-end"/> + <eval expected="color=#ffff00" xpath="//flow/block[1]/@background"/> + <eval expected="18000 18000 18000 18000" xpath="//flow/block[2]/@bap"/> + <eval expected="18000" xpath="//flow/block[2]/@start-indent"/> + <eval expected="18000" xpath="//flow/block[2]/@end-indent"/> + <eval expected="color=#ffff00" xpath="//flow/block[2]/@background"/> + </checks> +</testcase> diff --git a/test/layoutengine/testcases/padding-list1.xml b/test/layoutengine/testcases/padding-list1.xml new file mode 100644 index 000000000..2b49e5dc7 --- /dev/null +++ b/test/layoutengine/testcases/padding-list1.xml @@ -0,0 +1,75 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + Copyright 2005 The Apache Software Foundation + + Licensed 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$ --> +<testcase> + <info> + <p> + This test checks relative padding on lists (list-block). + </p> + </info> + <fo> + <fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format"> + <fo:layout-master-set> + <fo:simple-page-master master-name="normal" page-width="5in" page-height="5in"> + <fo:region-body/> + </fo:simple-page-master> + </fo:layout-master-set> + <fo:page-sequence master-reference="normal" white-space-collapse="true"> + <fo:flow flow-name="xsl-region-body"> + <fo:list-block provisional-distance-between-starts="1in" provisional-label-separation="0.1in" margin="0pt" padding="5%" background-color="yellow"> + <fo:list-item background-color="white"> + <fo:list-item-label end-indent="label-end()"> + <fo:block>label 1</fo:block> + </fo:list-item-label> + <fo:list-item-body start-indent="body-start()"> + <fo:block> + body 1: The whole list should have a 5% padding shown in yellow. + </fo:block> + </fo:list-item-body> + </fo:list-item> + <fo:list-item background-color="white"> + <fo:list-item-label end-indent="label-end()"> + <fo:block>label 2</fo:block> + </fo:list-item-label> + <fo:list-item-body start-indent="body-start()"> + <fo:block> + body 2: The whole list should have a 5% padding shown in yellow. + </fo:block> + </fo:list-item-body> + </fo:list-item> + <fo:list-item background-color="white"> + <fo:list-item-label end-indent="label-end()"> + <fo:block>label 3</fo:block> + </fo:list-item-label> + <fo:list-item-body start-indent="body-start()"> + <fo:block> + body 3: The whole list should have a 5% padding shown in yellow. + </fo:block> + </fo:list-item-body> + </fo:list-item> + </fo:list-block> + </fo:flow> + </fo:page-sequence> + </fo:root> + </fo> + <checks> + <eval expected="18000 18000 18000 18000" xpath="//flow/block/@bap"/> + <eval expected="18000" xpath="//flow/block/@start-indent"/> + <eval expected="18000" xpath="//flow/block/@end-indent"/> + <eval expected="color=#ffff00" xpath="//flow/block/@background"/> + </checks> +</testcase> diff --git a/test/layoutengine/testcases/padding-list2.xml b/test/layoutengine/testcases/padding-list2.xml new file mode 100644 index 000000000..1c56ac9b9 --- /dev/null +++ b/test/layoutengine/testcases/padding-list2.xml @@ -0,0 +1,78 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + Copyright 2005 The Apache Software Foundation + + Licensed 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$ --> +<testcase> + <info> + <p> + This test checks relative padding widths on lists (list-item). + </p> + </info> + <variables> + <img>../../resources/images/bgimg300dpi.jpg</img> + </variables> + <fo> + <fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format"> + <fo:layout-master-set> + <fo:simple-page-master master-name="normal" page-width="5in" page-height="5in"> + <fo:region-body/> + </fo:simple-page-master> + </fo:layout-master-set> + <fo:page-sequence master-reference="normal" white-space-collapse="true"> + <fo:flow flow-name="xsl-region-body"> + <fo:list-block provisional-distance-between-starts="1in" provisional-label-separation="0.1in"> + <fo:list-item margin="0pt" padding="5%" background-color="yellow"> + <fo:list-item-label end-indent="label-end()"> + <fo:block>label 1</fo:block> + </fo:list-item-label> + <fo:list-item-body start-indent="body-start()"> + <fo:block> + body 1: We should have 5% padding around this whole yellow list item. + </fo:block> + </fo:list-item-body> + </fo:list-item> + <fo:list-item> + <fo:list-item-label end-indent="label-end()"> + <fo:block>label 2</fo:block> + </fo:list-item-label> + <fo:list-item-body start-indent="body-start()"> + <fo:block> + body 2: We should have no padding around this whole list item. + </fo:block> + </fo:list-item-body> + </fo:list-item> + <fo:list-item> + <fo:list-item-label end-indent="label-end()"> + <fo:block>label 3</fo:block> + </fo:list-item-label> + <fo:list-item-body start-indent="body-start()"> + <fo:block> + body 3: We should have no padding around this whole list item. + </fo:block> + </fo:list-item-body> + </fo:list-item> + </fo:list-block> + </fo:flow> + </fo:page-sequence> + </fo:root> + </fo> + <checks> + <eval expected="18000 18000 18000 18000" xpath="//flow/block/block/@bap"/> + <eval expected="18000" xpath="//flow/block/block/@start-indent"/> + <eval expected="18000" xpath="//flow/block/block/@end-indent"/> + <eval expected="color=#ffff00" xpath="//flow/block/block/@background"/> + </checks> +</testcase> diff --git a/test/layoutengine/testcases/padding-table1.xml b/test/layoutengine/testcases/padding-table1.xml new file mode 100644 index 000000000..73345c44a --- /dev/null +++ b/test/layoutengine/testcases/padding-table1.xml @@ -0,0 +1,74 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + Copyright 2005 The Apache Software Foundation + + Licensed 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$ --> +<testcase> + <info> + <p> + This test checks relative padding on a fo:table. + </p> + </info> + <fo> + <fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format"> + <fo:layout-master-set> + <fo:simple-page-master master-name="normal" page-width="5in" page-height="5in"> + <fo:region-body/> + </fo:simple-page-master> + </fo:layout-master-set> + <fo:page-sequence master-reference="normal" white-space-collapse="true"> + <fo:flow flow-name="xsl-region-body"> + <fo:table margin="0pt" padding="5%" background-color="yellow" border-collapse="separate"> + <fo:table-column column-number="1" /> + <fo:table-column column-number="2" /> + <fo:table-column column-number="3" /> + <fo:table-header> + <fo:table-row> + <fo:table-cell> + <fo:block>Header Col 1</fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block>Header Col 2</fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block>Header Col 3</fo:block> + </fo:table-cell> + </fo:table-row> + </fo:table-header> + <fo:table-body> + <fo:table-row> + <fo:table-cell> + <fo:block>Row 1 Col 1</fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block>Row 1 Col 2</fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block>Row 1 Col 3</fo:block> + </fo:table-cell> + </fo:table-row> + </fo:table-body> + </fo:table> + <fo:block>Table on yellow background with 5% padding</fo:block> + </fo:flow> + </fo:page-sequence> + </fo:root> + </fo> + <checks> + <eval expected="18000" xpath="//flow/block/@start-indent"/> + <eval expected="18000" xpath="//flow/block/@end-indent"/> + <eval expected="color=#ffff00" xpath="//flow/block/@background"/> + </checks> +</testcase> diff --git a/test/layoutengine/testcases/padding-table2.xml b/test/layoutengine/testcases/padding-table2.xml new file mode 100644 index 000000000..b7178c940 --- /dev/null +++ b/test/layoutengine/testcases/padding-table2.xml @@ -0,0 +1,64 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + Copyright 2005 The Apache Software Foundation + + Licensed 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$ --> +<testcase> + <info> + <p> + This test checks relative padding on a fo:table-cell. + </p> + </info> + <fo> + <fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format"> + <fo:layout-master-set> + <fo:simple-page-master master-name="normal" page-width="5in" page-height="5in"> + <fo:region-body/> + </fo:simple-page-master> + </fo:layout-master-set> + <fo:page-sequence master-reference="normal" white-space-collapse="true"> + <fo:flow flow-name="xsl-region-body"> + <fo:table> + <fo:table-column column-number="1" /> + <fo:table-column column-number="2" /> + <fo:table-column column-number="3" /> + <fo:table-body> + <fo:table-row> + <fo:table-cell> + <fo:block>Row 1 Col 1</fo:block> + </fo:table-cell> + <fo:table-cell margin="0pt" padding="2%" background-color="yellow"> + <fo:block>Row 1 Col 2</fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block>Row 1 Col 3</fo:block> + </fo:table-cell> + </fo:table-row> + </fo:table-body> + </fo:table> + <fo:block>Table a yellow cell having 2% padding.</fo:block> + </fo:flow> + </fo:page-sequence> + </fo:root> + </fo> + <checks> + <eval expected="7200 7200 7200 7200" xpath="//flow/block/block[2]/@bap"/> + <eval expected="color=#ffff00" xpath="//flow/block/block[2]/@background"/> + <eval expected="7200" xpath="//flow/block/block[2]/block/@start-indent"/> + <eval expected="7200" xpath="//flow/block/block[2]/block/@end-indent"/> + <eval expected="7200" xpath="//flow/block/block[2]/block/@space-start"/> + <eval expected="7200" xpath="//flow/block/block[2]/block/@space-end"/> + </checks> +</testcase> diff --git a/test/layoutengine/testcases/table3.xml b/test/layoutengine/testcases/table3.xml new file mode 100644 index 000000000..d791e965f --- /dev/null +++ b/test/layoutengine/testcases/table3.xml @@ -0,0 +1,79 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + Copyright 2005 The Apache Software Foundation + + Licensed 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$ --> +<testcase> + <info> + <p> + This test checks basic tables with percentages in cells. + </p> + </info> + <fo> + <fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format" xmlns:svg="http://www.w3.org/2000/svg"> + <fo:layout-master-set> + <fo:simple-page-master master-name="normal" page-width="5in" page-height="5in"> + <fo:region-body/> + </fo:simple-page-master> + </fo:layout-master-set> + <fo:page-sequence master-reference="normal" white-space-collapse="true"> + <fo:flow flow-name="xsl-region-body"> + <fo:table table-layout="fixed" width="100%"> + <fo:table-column column-width="2in"/> + <fo:table-column column-width="3in"/> + <fo:table-body> + <fo:table-row> + <fo:table-cell> + <fo:block margin="10%">cell1</fo:block> + </fo:table-cell> + <fo:table-cell background-color="yellow"> + <fo:block margin-left="5%" margin-right="5%">cell2</fo:block> + </fo:table-cell> + </fo:table-row> + </fo:table-body> + </fo:table> + </fo:flow> + </fo:page-sequence> + </fo:root> + </fo> + <checks> + <!-- table dimensions --> + <eval expected="360000" xpath="//flow/block[1]/@ipd"/> + <eval expected="43200" xpath="//flow/block[1]/@bpd"/> + + <!-- cell 1 --> + <true xpath="//flow/block[1]/block[1]/@is-reference-area"/> + <eval expected="144000" xpath="//flow/block[1]/block[1]/@ipd"/> + <eval expected="43200" xpath="//flow/block[1]/block[1]/@bpd"/> + <eval expected="115200" xpath="//flow/block[1]/block[1]/block[2]/@ipd"/> + <eval expected="14400" xpath="//flow/block[1]/block[1]/block[2]/@bpd"/> + <eval expected="14400" xpath="//flow/block[1]/block[1]/block[2]/@start-indent"/> + <eval expected="14400" xpath="//flow/block[1]/block[1]/block[2]/@space-start"/> + <eval expected="14400" xpath="//flow/block[1]/block[1]/block[2]/@end-indent"/> + <eval expected="14400" xpath="//flow/block[1]/block[1]/block[2]/@space-end"/> + + <!-- cell 2 --> + <true xpath="//flow/block[1]/block[2]/@is-reference-area"/> + <eval expected="144000" xpath="//flow/block[1]/block[2]/@left-offset"/> + <eval expected="216000" xpath="//flow/block[1]/block[2]/@ipd"/> + <eval expected="43200" xpath="//flow/block[1]/block[2]/@bpd"/> + <eval expected="194400" xpath="//flow/block[1]/block[2]/block[1]/@ipd"/> + <eval expected="14400" xpath="//flow/block[1]/block[2]/block[1]/@bpd"/> + <eval expected="10800" xpath="//flow/block[1]/block[2]/block[1]/@start-indent"/> + <eval expected="10800" xpath="//flow/block[1]/block[2]/block[1]/@space-start"/> + <eval expected="10800" xpath="//flow/block[1]/block[2]/block[1]/@end-indent"/> + <eval expected="10800" xpath="//flow/block[1]/block[2]/block[1]/@space-end"/> + </checks> +</testcase> |