diff options
author | Adrian Cumiskey <acumiskey@apache.org> | 2008-06-23 09:46:41 +0000 |
---|---|---|
committer | Adrian Cumiskey <acumiskey@apache.org> | 2008-06-23 09:46:41 +0000 |
commit | 2f451f9c4dae507df76e77bc13e0839c98724fd0 (patch) | |
tree | 1c82c51e1a4cf8f89a9e587179a0b91dc1a6b60c /test | |
parent | 08f0da8adadb9fda358992ad204948570ad41d11 (diff) | |
download | xmlgraphics-fop-2f451f9c4dae507df76e77bc13e0839c98724fd0.tar.gz xmlgraphics-fop-2f451f9c4dae507df76e77bc13e0839c98724fd0.zip |
Merged revisions 669423,669436,669835,670217,670222,670323,670325,670332,670335-670336,670341,670344,670401,670409,670411-670412,670422-670424,670492 via svnmerge from
https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk
........
r669423 | jeremias | 2008-06-19 09:25:46 +0100 (Thu, 19 Jun 2008) | 1 line
Simplifications and a Checkstyle fix.
........
r669436 | jeremias | 2008-06-19 10:46:12 +0100 (Thu, 19 Jun 2008) | 2 lines
Separation of concerns:
Split FOEventHandler into FOEventHandler and FOTreeBuilderContext. The latter contains stuff only used at tree-building stage. FOEventHandler is oriented towards output.
........
r669835 | acumiskey | 2008-06-20 10:18:56 +0100 (Fri, 20 Jun 2008) | 1 line
Strict/loose validation of <fo:table-footer/> ordering somehow got lost in processing feedback branch merge.
........
r670217 | acumiskey | 2008-06-21 17:10:03 +0100 (Sat, 21 Jun 2008) | 1 line
Moved the contents of TableBody into a new abstract base class TablePart, which is now subclassed by TableBody, TableHeader and TableFooter.
........
r670222 | acumiskey | 2008-06-21 17:28:56 +0100 (Sat, 21 Jun 2008) | 1 line
Moved the contents of TableBody into a new abstract base class TablePart, which is now subclassed by TableBody, TableHeader and TableFooter.
........
r670323 | adelmelle | 2008-06-22 10:07:47 +0100 (Sun, 22 Jun 2008) | 1 line
Addition to r670217
........
r670325 | adelmelle | 2008-06-22 10:28:56 +0100 (Sun, 22 Jun 2008) | 1 line
Minor javadoc correction
........
r670332 | adelmelle | 2008-06-22 11:21:03 +0100 (Sun, 22 Jun 2008) | 1 line
Minor tweak: avoid warning when running through Saxon
........
r670335 | adelmelle | 2008-06-22 11:53:51 +0100 (Sun, 22 Jun 2008) | 1 line
Avoid StackOverflow on TableColumn.toString() during debugging.
........
r670336 | adelmelle | 2008-06-22 12:01:27 +0100 (Sun, 22 Jun 2008) | 1 line
Minor tweak: use XG Commons version of the interface
........
r670341 | adelmelle | 2008-06-22 12:18:03 +0100 (Sun, 22 Jun 2008) | 2 lines
Changed FONode.addCharacters() signature to match the characters() event (use 'length' as a parameter instead of 'end')
........
r670344 | adelmelle | 2008-06-22 12:28:06 +0100 (Sun, 22 Jun 2008) | 1 line
Changed signature for static handleWhiteSpaceFor(), and used internally to make the code a bit more compact
........
r670401 | adelmelle | 2008-06-22 20:19:17 +0100 (Sun, 22 Jun 2008) | 1 line
Correction: characters() expects a 'length' not an 'endIndex'
........
r670409 | adelmelle | 2008-06-22 21:18:27 +0100 (Sun, 22 Jun 2008) | 1 line
Very minor tweak: simplify conditional
........
r670411 | adelmelle | 2008-06-22 21:38:28 +0100 (Sun, 22 Jun 2008) | 2 lines
Deleted deprecated interface; unused after r670336
........
r670412 | adelmelle | 2008-06-22 21:57:43 +0100 (Sun, 22 Jun 2008) | 6 lines
Partial fix of FOEventHandler call sequence (see also Bugzilla #45237):
call startOfNode() after addChildNode()
moved initialization for tableFOs to processNode()
moved finishing code to a finalizeNode() method (which is now also used by AbstractRetrieveMarker)
restored protected status of startOfNode()/endOfNode() in fo.flow.table package
........
r670422 | adelmelle | 2008-06-22 23:10:55 +0100 (Sun, 22 Jun 2008) | 4 lines
Switch FOText to use a java.nio.CharBuffer, and implement the CharSequence interface.
TextLayoutManager no longer duplicates the char array, operates on the FOText (charAt(i))
Additionally: endOfNode() for FOText and Character deferred until after white-space handling.
........
r670423 | adelmelle | 2008-06-22 23:17:00 +0100 (Sun, 22 Jun 2008) | 1 line
Added missing file from r670422
........
r670424 | adelmelle | 2008-06-22 23:18:53 +0100 (Sun, 22 Jun 2008) | 1 line
Another missing file...
........
r670492 | lfurini | 2008-06-23 10:24:14 +0100 (Mon, 23 Jun 2008) | 2 lines
Added support for non-zero borders and padding on page regions.
Testcase included, now disabled because it is supposed to run with relaxed validation switched on.
........
git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/branches/Temp_AFPGOCAResources@670500 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'test')
5 files changed, 153 insertions, 14 deletions
diff --git a/test/java/org/apache/fop/fo/flow/table/CollapsedConditionalBorderTestCase.java b/test/java/org/apache/fop/fo/flow/table/CollapsedConditionalBorderTestCase.java index 3abc2f73b..d26426513 100644 --- a/test/java/org/apache/fop/fo/flow/table/CollapsedConditionalBorderTestCase.java +++ b/test/java/org/apache/fop/fo/flow/table/CollapsedConditionalBorderTestCase.java @@ -108,7 +108,7 @@ public class CollapsedConditionalBorderTestCase extends AbstractTableTestCase { super(); } - private static GridUnit getGridUnit(TableBody part) { + private static GridUnit getGridUnit(TablePart part) { return (GridUnit) ((List) ((List) part.getRowGroups().get(0)).get(0)).get(0); } @@ -137,8 +137,8 @@ public class CollapsedConditionalBorderTestCase extends AbstractTableTestCase { do { String baseErrorMsge = "table " + Integer.toString(tableNum) + " (0-based), "; Table table = (Table) tableIterator.next(); - TableBody body = (TableBody) table.getChildNodes().nextNode(); - GridUnit gu = getGridUnit(body); + TablePart part = (TablePart) table.getChildNodes().nextNode(); + GridUnit gu = getGridUnit(part); String errorMsge = baseErrorMsge + "border-before"; checkBorder(errorMsge, gu.borderBefore.normal, 8000, Color.black); @@ -163,14 +163,14 @@ public class CollapsedConditionalBorderTestCase extends AbstractTableTestCase { int borderNum = 0; Table table = (Table) tableIterator.next(); - TableBody header = table.getTableHeader(); + TableHeader header = table.getTableHeader(); GridUnit gu = getGridUnit(header); checkBorder(errorMsge, gu.borderBefore.normal, resolvedBordersHF[tableNum][borderNum++]); checkBorder(errorMsge, gu.borderBefore.rest, resolvedBordersHF[tableNum][borderNum++]); - TableBody footer = table.getTableFooter(); + TableFooter footer = table.getTableFooter(); gu = getGridUnit(footer); checkBorder(errorMsge, gu.borderAfter.normal, resolvedBordersHF[tableNum][borderNum++]); diff --git a/test/java/org/apache/fop/fo/flow/table/RowGroupBuilderTestCase.java b/test/java/org/apache/fop/fo/flow/table/RowGroupBuilderTestCase.java index a89ff2eea..498df92b4 100644 --- a/test/java/org/apache/fop/fo/flow/table/RowGroupBuilderTestCase.java +++ b/test/java/org/apache/fop/fo/flow/table/RowGroupBuilderTestCase.java @@ -38,12 +38,12 @@ public class RowGroupBuilderTestCase extends AbstractTableTestCase { * given array, and that the number of rows inside each row group is equal to the * corresponding integer in the array. * - * @param body a body whose row groups are to be checked + * @param part a table part whose row groups are to be checked * @param expectedRowLengths expected lengths of all the row groups of this part of * the table */ - private void checkTablePartRowGroups(TableBody body, int[] expectedRowLengths) { - Iterator rowGroupIter = body.getRowGroups().iterator(); + private void checkTablePartRowGroups(TablePart part, int[] expectedRowLengths) { + Iterator rowGroupIter = part.getRowGroups().iterator(); for (int i = 0; i < expectedRowLengths.length; i++) { assertTrue(rowGroupIter.hasNext()); List rowGroup = (List) rowGroupIter.next(); diff --git a/test/layoutengine/disabled-testcases.xml b/test/layoutengine/disabled-testcases.xml index ba985bf8d..ca05b156b 100644 --- a/test/layoutengine/disabled-testcases.xml +++ b/test/layoutengine/disabled-testcases.xml @@ -216,4 +216,11 @@ <description>A soft hyphen should be a preferred as break compared to a normal hyphenation point but is not.</description> </testcase> + <testcase> + <name>Borders and padding on page regions</name> + <file>simple-page-master_borders_padding.xml</file> + <description>Borders and padding on regions are now implemented but + relaxed validation must be switched on, otherwise there is a validation + exception.</description> + </testcase> </disabled-testcases> diff --git a/test/layoutengine/standard-testcases/simple-page-master_borders_padding.xml b/test/layoutengine/standard-testcases/simple-page-master_borders_padding.xml new file mode 100644 index 000000000..8ce6101a3 --- /dev/null +++ b/test/layoutengine/standard-testcases/simple-page-master_borders_padding.xml @@ -0,0 +1,136 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + Licensed to the Apache Software Foundation (ASF) under one or more + contributor license agreements. See the NOTICE file distributed with + this work for additional information regarding copyright ownership. + The ASF licenses this file to You 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 page-masters (all regions). The empty block-containers are used to check that all the base widths are set correctly so + length evaluation using percentages is possible. + </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="master1" page-width="5in" page-height="5in" margin="10pt"> + <fo:region-body background-color="rgb(100%, 100%, 80%)" margin="50pt" border-before-width="1pt" border-color="rgb(50%, 50%, 40%)" border-style="solid" border-end-width="2pt" border-after-width="3pt" border-start-width="4pt" padding-before="9pt" padding-end="8pt" padding-after="7pt" padding-start="6pt"/> + <fo:region-before background-color="rgb(100%, 80%, 80%)" border="solid 5pt rgb(50%, 40%, 40%)" extent="50pt"/> + <fo:region-after background-color="rgb(80%, 80%, 80%)" border="solid 1pt rgb(40%, 40%, 50%)" padding="3pt" extent="50pt" precedence="true" display-align="after"/> + <fo:region-start background-color="rgb(80%, 100%, 80%)" padding="3pt" extent="50pt"/> + <fo:region-end background-color="rgb(80%, 80%, 100%)" extent="50pt" reference-orientation="270"/> + </fo:simple-page-master> + </fo:layout-master-set> + <fo:page-sequence master-reference="master1" white-space-collapse="true" orphans="0" widows="0"> + <fo:static-content flow-name="xsl-region-before"> + <fo:block-container absolute-position="absolute" width="100%" height="100%" top="0pt" left="0pt"> + <fo:block/> + </fo:block-container> + <fo:block>region-before1</fo:block> + </fo:static-content> + <fo:static-content flow-name="xsl-region-after"> + <fo:block-container absolute-position="absolute" width="100%" height="100%" top="0pt" left="0pt"> + <fo:block/> + </fo:block-container> + <fo:block font-size="50%">region-after1 with precedence and display-align="after"</fo:block> + </fo:static-content> + <fo:static-content flow-name="xsl-region-start"> + <fo:block-container absolute-position="absolute" width="100%" height="100%" top="0pt" left="0pt"> + <fo:block/> + </fo:block-container> + <fo:block>region-start1</fo:block> + </fo:static-content> + <fo:static-content flow-name="xsl-region-end"> + <fo:block-container absolute-position="absolute" width="100%" height="100%" top="0pt" left="0pt"> + <fo:block/> + </fo:block-container> + <fo:block>region-end1</fo:block> + </fo:static-content> + <fo:flow flow-name="xsl-region-body"> + <fo:block-container absolute-position="absolute" width="100%" height="100%" top="0pt" left="0pt"> + <fo:block/> + </fo:block-container> + <fo:block>testing all-regions1</fo:block> + <fo:block>testing all-regions2</fo:block> + <fo:block>testing all-regions3</fo:block> + </fo:flow> + </fo:page-sequence> + </fo:root> + </fo> + <checks> + <eval expected="0 0 360000 360000" xpath="//pageViewport/@bounds"/> + + <eval expected="50000" xpath="//regionBefore/@bpda"/> + <eval expected="240000" xpath="//regionBefore/@ipda"/> + <eval expected="40000" xpath="//regionBefore/@bpd"/> + <eval expected="230000" xpath="//regionBefore/@ipd"/> + <eval expected="(solid,#806666,5000)" xpath="//regionBefore/@border-before"/> + <eval expected="(solid,#806666,5000)" xpath="//regionBefore/@border-after"/> + <eval expected="(solid,#806666,5000)" xpath="//regionBefore/@border-start"/> + <eval expected="(solid,#806666,5000)" xpath="//regionBefore/@border-end"/> + <eval expected="40000" xpath="//regionBefore/block[@positioning='absolute']/@bpda"/> + <eval expected="230000" xpath="//regionBefore/block[@positioning='absolute']/@ipda"/> + + <eval expected="50000" xpath="//regionAfter/@bpda"/> + <eval expected="340000" xpath="//regionAfter/@ipda"/> + <eval expected="42000" xpath="//regionAfter/@bpd"/> + <eval expected="332000" xpath="//regionAfter/@ipd"/> + <eval expected="(solid,#666680,1000)" xpath="//regionAfter/@border-before"/> + <eval expected="(solid,#666680,1000)" xpath="//regionAfter/@border-after"/> + <eval expected="(solid,#666680,1000)" xpath="//regionAfter/@border-start"/> + <eval expected="(solid,#666680,1000)" xpath="//regionAfter/@border-end"/> + <eval expected="3000" xpath="//regionAfter/@padding-before"/> + <eval expected="3000" xpath="//regionAfter/@padding-after"/> + <eval expected="3000" xpath="//regionAfter/@padding-start"/> + <eval expected="3000" xpath="//regionAfter/@padding-end"/> + <eval expected="42000" xpath="//regionAfter/block[@positioning='absolute']/@bpda"/> + <eval expected="332000" xpath="//regionAfter/block[@positioning='absolute']/@ipda"/> + + <eval expected="290000" xpath="//regionStart/@bpda"/> + <eval expected="50000" xpath="//regionStart/@ipda"/> + <eval expected="284000" xpath="//regionStart/@bpd"/> + <eval expected="44000" xpath="//regionStart/@ipd"/> + <eval expected="3000" xpath="//regionStart/@padding-before"/> + <eval expected="3000" xpath="//regionStart/@padding-after"/> + <eval expected="3000" xpath="//regionStart/@padding-start"/> + <eval expected="3000" xpath="//regionStart/@padding-end"/> + <eval expected="284000" xpath="//regionStart/block[@positioning='absolute']/@bpda"/> + <eval expected="44000" xpath="//regionStart/block[@positioning='absolute']/@ipda"/> + + <eval expected="50000" xpath="//regionEnd/@bpda"/> + <eval expected="290000" xpath="//regionEnd/@ipda"/> + <eval expected="50000" xpath="//regionEnd/@bpd"/> + <eval expected="290000" xpath="//regionEnd/@ipd"/> + <eval expected="50000" xpath="//regionEnd/block[@positioning='absolute']/@bpda"/> + <eval expected="290000" xpath="//regionEnd/block[@positioning='absolute']/@ipda"/> + + <eval expected="240000" xpath="//regionBody/@bpda"/> + <eval expected="240000" xpath="//regionBody/@ipda"/> + <eval expected="220000" xpath="//regionBody/@bpda"/> + <eval expected="220000" xpath="//regionBody/@ipda"/> + <eval expected="(solid,#808066,1000)" xpath="//regionBody/@border-before"/> + <eval expected="(solid,#808066,3000)" xpath="//regionBody/@border-after"/> + <eval expected="(solid,#808066,4000)" xpath="//regionBody/@border-start"/> + <eval expected="(solid,#808066,2000)" xpath="//regionBody/@border-end"/> + <eval expected="9000" xpath="//regionBody/@padding-before"/> + <eval expected="7000" xpath="//regionBody/@padding-after"/> + <eval expected="6000" xpath="//regionBody/@padding-start"/> + <eval expected="8000" xpath="//regionBody/@padding-end"/> + <eval expected="220000" xpath="//regionBody/mainReference/span/flow/block[@positioning='absolute']/@bpda"/> + <eval expected="220000" xpath="//regionBody/mainReference/span/flow/block[@positioning='absolute']/@ipda"/> + + </checks> +</testcase> diff --git a/test/layoutengine/testcase2fo.xsl b/test/layoutengine/testcase2fo.xsl index 0b677471d..522f53fa7 100644 --- a/test/layoutengine/testcase2fo.xsl +++ b/test/layoutengine/testcase2fo.xsl @@ -50,16 +50,12 @@ value as subsitution value. </xsl:when> <xsl:otherwise> <!-- if variable isn't defined, just copy --> - <xsl:copy> - <xsl:apply-templates select="node()" mode="copy"/> - </xsl:copy> + <xsl:copy-of select="." /> </xsl:otherwise> </xsl:choose> </xsl:when> <xsl:otherwise> - <xsl:copy> - <xsl:apply-templates select="node()" mode="copy"/> - </xsl:copy> + <xsl:copy-of select="." /> </xsl:otherwise> </xsl:choose> </xsl:template> |