diff options
16 files changed, 69 insertions, 208 deletions
diff --git a/src/java/org/apache/fop/layoutmgr/BlockContainerLayoutManager.java b/src/java/org/apache/fop/layoutmgr/BlockContainerLayoutManager.java index 455a7d8fc..658a92e0d 100644 --- a/src/java/org/apache/fop/layoutmgr/BlockContainerLayoutManager.java +++ b/src/java/org/apache/fop/layoutmgr/BlockContainerLayoutManager.java @@ -129,8 +129,8 @@ public class BlockContainerLayoutManager extends BlockStackingLayoutManager this.discardBorderAfter = false; this.discardPaddingBefore = false; this.discardPaddingAfter = false; - this.effSpaceBefore = foSpaceBefore; - this.effSpaceAfter = foSpaceAfter; + this.effSpaceBefore = null; + this.effSpaceAfter = null; } /** @return the content IPD */ @@ -241,17 +241,19 @@ public class BlockContainerLayoutManager extends BlockStackingLayoutManager LinkedList contentList = new LinkedList(); LinkedList returnList = new LinkedList(); - if (!bBreakBeforeServed) { + if (!breakBeforeServed) { try { if (addKnuthElementsForBreakBefore(returnList, context)) { return returnList; } } finally { - bBreakBeforeServed = true; + breakBeforeServed = true; } } - addKnuthElementsForSpaceBefore(returnList, alignment); + if (!firstVisibleMarkServed) { + addKnuthElementsForSpaceBefore(returnList, alignment); + } addKnuthElementsForBorderPaddingBefore(returnList, !firstVisibleMarkServed); firstVisibleMarkServed = true; diff --git a/src/java/org/apache/fop/layoutmgr/BlockLayoutManager.java b/src/java/org/apache/fop/layoutmgr/BlockLayoutManager.java index 0db92b30f..a303f18fd 100644 --- a/src/java/org/apache/fop/layoutmgr/BlockLayoutManager.java +++ b/src/java/org/apache/fop/layoutmgr/BlockLayoutManager.java @@ -110,8 +110,8 @@ public class BlockLayoutManager extends BlockStackingLayoutManager this.discardBorderAfter = false; this.discardPaddingBefore = false; this.discardPaddingAfter = false; - this.effSpaceBefore = foSpaceBefore; - this.effSpaceAfter = foSpaceAfter; + this.effSpaceBefore = null; + this.effSpaceAfter = null; } /** diff --git a/src/java/org/apache/fop/layoutmgr/BlockStackingLayoutManager.java b/src/java/org/apache/fop/layoutmgr/BlockStackingLayoutManager.java index c09ae8ae5..eb7a2599c 100644 --- a/src/java/org/apache/fop/layoutmgr/BlockStackingLayoutManager.java +++ b/src/java/org/apache/fop/layoutmgr/BlockStackingLayoutManager.java @@ -55,7 +55,7 @@ public abstract class BlockStackingLayoutManager extends AbstractLayoutManager /** Only used to store the original list when createUnitElements is called */ protected LinkedList storedList = null; /** Indicates whether break before has been served or not */ - protected boolean bBreakBeforeServed = false; + protected boolean breakBeforeServed = false; /** Indicates whether the first visible mark has been returned by this LM, yet */ protected boolean firstVisibleMarkServed = false; /** Reference IPD available */ @@ -235,17 +235,19 @@ public abstract class BlockStackingLayoutManager extends AbstractLayoutManager LinkedList contentList = new LinkedList(); LinkedList returnList = new LinkedList(); - if (!bBreakBeforeServed) { + if (!breakBeforeServed) { try { if (addKnuthElementsForBreakBefore(returnList, context)) { return returnList; } } finally { - bBreakBeforeServed = true; + breakBeforeServed = true; } } - addKnuthElementsForSpaceBefore(returnList, alignment); + if (!firstVisibleMarkServed) { + addKnuthElementsForSpaceBefore(returnList, alignment); + } addKnuthElementsForBorderPaddingBefore(returnList, !firstVisibleMarkServed); firstVisibleMarkServed = true; @@ -316,18 +318,10 @@ public abstract class BlockStackingLayoutManager extends AbstractLayoutManager // blocks contentList.add(new BreakElement( new Position(this), KnuthElement.INFINITE, context)); - /* - contentList.add(new KnuthPenalty(0, - KnuthElement.INFINITE, false, - new Position(this), false)); - */ } else if (!((ListElement) contentList.getLast()).isGlue()) { // add a null penalty to allow a break between blocks contentList.add(new BreakElement( new Position(this), 0, context)); - /* - contentList.add(new KnuthPenalty(0, 0, false, - new Position(this), false));*/ } else { // the last element in contentList is a glue; // it is a feasible breakpoint, there is no need to add @@ -763,22 +757,6 @@ public abstract class BlockStackingLayoutManager extends AbstractLayoutManager * @param context the layout context */ protected void addPendingMarks(LayoutContext context) { - SpaceProperty spaceBefore = getSpaceBeforeProperty(); - if (spaceBefore != null - && !(spaceBefore.getMinimum(this).getLength().getValue(this) == 0 - && spaceBefore.getMaximum(this).getLength().getValue(this) == 0)) { - context.addPendingBeforeMark(new SpaceElement(getAuxiliaryPosition(), spaceBefore, - RelSide.BEFORE, - true, false, this)); - } - SpaceProperty spaceAfter = getSpaceAfterProperty(); - if (spaceAfter != null - && !(spaceAfter.getMinimum(this).getLength().getValue(this) == 0 - && spaceAfter.getMaximum(this).getLength().getValue(this) == 0)) { - context.addPendingAfterMark(new SpaceElement(getAuxiliaryPosition(), spaceAfter, - RelSide.AFTER, - false, true, this)); - } CommonBorderPaddingBackground borderAndPadding = getBorderPaddingBackground(); if (borderAndPadding != null) { if (borderAndPadding.getBorderBeforeWidth(false) > 0) { diff --git a/src/java/org/apache/fop/layoutmgr/list/ListBlockLayoutManager.java b/src/java/org/apache/fop/layoutmgr/list/ListBlockLayoutManager.java index dcedfdbcb..e23639e0d 100644 --- a/src/java/org/apache/fop/layoutmgr/list/ListBlockLayoutManager.java +++ b/src/java/org/apache/fop/layoutmgr/list/ListBlockLayoutManager.java @@ -109,8 +109,8 @@ public class ListBlockLayoutManager extends BlockStackingLayoutManager this.discardBorderAfter = false; this.discardPaddingBefore = false; this.discardPaddingAfter = false; - this.effSpaceBefore = foSpaceBefore; - this.effSpaceAfter = foSpaceAfter; + this.effSpaceBefore = null; + this.effSpaceAfter = null; } /** @see org.apache.fop.layoutmgr.BlockStackingLayoutManager */ diff --git a/src/java/org/apache/fop/layoutmgr/list/ListItemLayoutManager.java b/src/java/org/apache/fop/layoutmgr/list/ListItemLayoutManager.java index 2dd7020a7..c402f37ae 100644 --- a/src/java/org/apache/fop/layoutmgr/list/ListItemLayoutManager.java +++ b/src/java/org/apache/fop/layoutmgr/list/ListItemLayoutManager.java @@ -168,8 +168,8 @@ public class ListItemLayoutManager extends BlockStackingLayoutManager this.discardBorderAfter = false; this.discardPaddingBefore = false; this.discardPaddingAfter = false; - this.effSpaceBefore = foSpaceBefore; - this.effSpaceAfter = foSpaceAfter; + this.effSpaceBefore = null; + this.effSpaceAfter = null; } /** @see org.apache.fop.layoutmgr.LayoutManager */ diff --git a/src/java/org/apache/fop/layoutmgr/table/TableLayoutManager.java b/src/java/org/apache/fop/layoutmgr/table/TableLayoutManager.java index 5bfab332e..9aea85080 100644 --- a/src/java/org/apache/fop/layoutmgr/table/TableLayoutManager.java +++ b/src/java/org/apache/fop/layoutmgr/table/TableLayoutManager.java @@ -126,8 +126,8 @@ public class TableLayoutManager extends BlockStackingLayoutManager this.discardBorderAfter = false; this.discardPaddingBefore = false; this.discardPaddingAfter = false; - this.effSpaceBefore = foSpaceBefore; - this.effSpaceAfter = foSpaceAfter; + this.effSpaceBefore = null; + this.effSpaceAfter = null; } /** @return half the value of border-separation.block-progression-dimension. */ @@ -145,13 +145,13 @@ public class TableLayoutManager extends BlockStackingLayoutManager LinkedList returnList = new LinkedList(); - if (!bBreakBeforeServed) { + if (!breakBeforeServed) { try { if (addKnuthElementsForBreakBefore(returnList, context)) { return returnList; } } finally { - bBreakBeforeServed = true; + breakBeforeServed = true; } } @@ -202,7 +202,9 @@ public class TableLayoutManager extends BlockStackingLayoutManager } } - addKnuthElementsForSpaceBefore(returnList, alignment); + if (!firstVisibleMarkServed) { + addKnuthElementsForSpaceBefore(returnList, alignment); + } if (getTable().isSeparateBorderModel()) { addKnuthElementsForBorderPaddingBefore(returnList, !firstVisibleMarkServed); diff --git a/status.xml b/status.xml index 37d891f97..612d116f6 100644 --- a/status.xml +++ b/status.xml @@ -27,6 +27,10 @@ <changes> <release version="FOP Trunk"> + <action context="Code" dev="JM" type="fix"> + Following a clarification by the XSL FO SG, space traits are only set on the + first and last area generated by an FO, and not on every area anymore. + </action> <action context="Code" dev="JM" type="add"> New feature: "Intermediate format" (IF). The IF is basically the XML dialect written by the area tree renderer (XMLRenderer). A new parser for this format diff --git a/test/layoutengine/disabled-testcases.xml b/test/layoutengine/disabled-testcases.xml index 684e5c4c1..78ef2a7eb 100755 --- a/test/layoutengine/disabled-testcases.xml +++ b/test/layoutengine/disabled-testcases.xml @@ -260,6 +260,11 @@ content to disappear.</description> </testcase> <testcase> + <name>Column Balancing problems</name> + <file>region-body_column-count_bug36356.xml</file> + <description>Column balancing doesn't work as expected.</description> + </testcase> + <testcase> <name>No background-images on table-body</name> <file>table-body_background-image.xml</file> <description>The backgrounds of table-body, table-header, diff --git a/test/layoutengine/standard-testcases/block-container_space-before_space-after_1.xml b/test/layoutengine/standard-testcases/block-container_space-before_space-after_1.xml index 37b7b87c2..5397d516e 100644 --- a/test/layoutengine/standard-testcases/block-container_space-before_space-after_1.xml +++ b/test/layoutengine/standard-testcases/block-container_space-before_space-after_1.xml @@ -75,38 +75,20 @@ Two blocks, testing conditionality="discard". <box w="14400"/> <box w="14400"/> - <penalty w="0" p="INF"/> - <glue w="10000" y="0" z="10000"/> <penalty w="0" p="0"/> - <glue w="-30000" y="0" z="-30000"/> - <box w="0"/> - <penalty w="0" p="INF"/> - <glue w="20000" y="0" z="20000"/> <box w="14400"/> - <penalty w="0" p="INF"/> - <glue w="10000" y="0" z="10000"/> <penalty w="0" p="0"/> - <glue w="-30000" y="0" z="-30000"/> - <box w="0"/> - <penalty w="0" p="INF"/> - <glue w="20000" y="0" z="20000"/> <box w="14400"/> <!-- skip three more lines --> - <skip>8</skip> - <skip>8</skip> - <skip>8</skip> + <skip>2</skip> + <skip>2</skip> + <skip>2</skip> - <penalty w="0" p="INF"/> - <glue w="10000" y="0" z="10000"/> <penalty w="0" p="0"/> - <glue w="-30000" y="0" z="-30000"/> - <box w="0"/> - <penalty w="0" p="INF"/> - <glue w="20000" y="0" z="20000"/> <box w="14400"/> <box w="14400"/> diff --git a/test/layoutengine/standard-testcases/block-container_space-before_space-after_2.xml b/test/layoutengine/standard-testcases/block-container_space-before_space-after_2.xml index d742b3e85..8ed83492e 100644 --- a/test/layoutengine/standard-testcases/block-container_space-before_space-after_2.xml +++ b/test/layoutengine/standard-testcases/block-container_space-before_space-after_2.xml @@ -18,13 +18,13 @@ <testcase> <info> <p> - This test checks block-level space properties. Demonstrates that spaces are repeated on every generated area. + This test checks block-level space properties. Demonstrates that spaces are only on the first (or last) generated area. </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="30pt"> + <fo:simple-page-master master-name="normal" page-width="5in" page-height="28pt"> <fo:region-body/> </fo:simple-page-master> </fo:layout-master-set> @@ -46,42 +46,23 @@ <box w="0"/> <penalty w="0" p="INF"/> <glue w="5000"/> + <box w="10000"/> <penalty w="0" p="0"/> - <glue w="-5000"/> - - <box w="0"/> - <penalty w="0" p="INF"/> - <glue w="5000"/> <box w="10000"/> <penalty w="0" p="0"/> - <glue w="-5000"/> - - <box w="0"/> - <penalty w="0" p="INF"/> - <glue w="5000"/> <box w="10000"/> <penalty w="0" p="0"/> - <glue w="-5000"/> - - <box w="0"/> - <penalty w="0" p="INF"/> - <glue w="5000"/> <box w="10000"/> <penalty w="0" p="0"/> - <glue w="-5000"/> - - <box w="0"/> - <penalty w="0" p="INF"/> - <glue w="5000"/> <box w="10000"/> <skip>3</skip> </element-list> <eval expected="3" xpath="count(//pageViewport)"/> <eval expected="5000" xpath="//pageViewport[@nr=1]/page/regionViewport/regionBody/mainReference/span/flow/block[1]/@space-before"/> - <eval expected="5000" xpath="//pageViewport[@nr=2]/page/regionViewport/regionBody/mainReference/span/flow/block[1]/@space-before"/> - <eval expected="5000" xpath="//pageViewport[@nr=3]/page/regionViewport/regionBody/mainReference/span/flow/block[1]/@space-before"/> + <true xpath="not(boolean(//pageViewport[@nr=2]/page/regionViewport/regionBody/mainReference/span/flow/block[1]/@space-before))"/> + <true xpath="not(boolean(//pageViewport[@nr=3]/page/regionViewport/regionBody/mainReference/span/flow/block[1]/@space-before))"/> <eval expected="1" xpath="count(//pageViewport[@nr=1]/page/regionViewport/regionBody/mainReference/span/flow/block)"/> <eval expected="1" xpath="count(//pageViewport[@nr=2]/page/regionViewport/regionBody/mainReference/span/flow/block)"/> <eval expected="1" xpath="count(//pageViewport[@nr=3]/page/regionViewport/regionBody/mainReference/span/flow/block)"/> diff --git a/test/layoutengine/standard-testcases/block_space-before_space-after_2.xml b/test/layoutengine/standard-testcases/block_space-before_space-after_2.xml index 0676277f9..4b2d67212 100644 --- a/test/layoutengine/standard-testcases/block_space-before_space-after_2.xml +++ b/test/layoutengine/standard-testcases/block_space-before_space-after_2.xml @@ -71,38 +71,20 @@ Two blocks, testing conditionality="discard". <box w="14400"/> <box w="14400"/> - <penalty w="0" p="INF"/> - <glue w="10000" y="0" z="10000"/> <penalty w="0" p="0"/> - <glue w="-30000" y="0" z="-30000"/> - <box w="0"/> - <penalty w="0" p="INF"/> - <glue w="20000" y="0" z="20000"/> <box w="14400"/> - <penalty w="0" p="INF"/> - <glue w="10000" y="0" z="10000"/> <penalty w="0" p="0"/> - <glue w="-30000" y="0" z="-30000"/> - <box w="0"/> - <penalty w="0" p="INF"/> - <glue w="20000" y="0" z="20000"/> <box w="14400"/> <!-- skip three more lines --> - <skip>8</skip> - <skip>8</skip> - <skip>8</skip> + <skip>2</skip> + <skip>2</skip> + <skip>2</skip> - <penalty w="0" p="INF"/> - <glue w="10000" y="0" z="10000"/> <penalty w="0" p="0"/> - <glue w="-30000" y="0" z="-30000"/> - <box w="0"/> - <penalty w="0" p="INF"/> - <glue w="20000" y="0" z="20000"/> <box w="14400"/> <box w="14400"/> diff --git a/test/layoutengine/standard-testcases/block_space-before_space-after_4.xml b/test/layoutengine/standard-testcases/block_space-before_space-after_4.xml index 3d4fb9f58..d00e18cb4 100644 --- a/test/layoutengine/standard-testcases/block_space-before_space-after_4.xml +++ b/test/layoutengine/standard-testcases/block_space-before_space-after_4.xml @@ -18,13 +18,13 @@ <testcase> <info> <p> - This test checks block-level space properties. Demonstrates that spaces are repeated on every generated area. + This test checks block-level space properties. Demonstrates that space-before is only on the first generated area. </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="30pt"> + <fo:simple-page-master master-name="normal" page-width="5in" page-height="28pt"> <fo:region-body/> </fo:simple-page-master> </fo:layout-master-set> @@ -48,30 +48,22 @@ <glue w="5000"/> <box w="10000"/> <penalty w="0" p="0"/> - <glue w="-5000"/> - <box w="0"/> - <penalty w="0" p="INF"/> - <glue w="5000"/> <box w="10000"/> <penalty w="0" p="0"/> - <glue w="-5000"/> <!-- skip two more lines --> - <skip>6</skip> - <skip>6</skip> + <skip>2</skip> + <skip>2</skip> - <box w="0"/> - <penalty w="0" p="INF"/> - <glue w="5000"/> <box w="10000"/> <skip>3</skip> </element-list> <eval expected="3" xpath="count(//pageViewport)"/> <eval expected="5000" xpath="//pageViewport[@nr=1]/page/regionViewport/regionBody/mainReference/span/flow/block[1]/@space-before"/> - <eval expected="5000" xpath="//pageViewport[@nr=2]/page/regionViewport/regionBody/mainReference/span/flow/block[1]/@space-before"/> - <eval expected="5000" xpath="//pageViewport[@nr=3]/page/regionViewport/regionBody/mainReference/span/flow/block[1]/@space-before"/> + <true xpath="not(boolean(//pageViewport[@nr=2]/page/regionViewport/regionBody/mainReference/span/flow/block[1]/@space-before))"/> + <true xpath="not(boolean(//pageViewport[@nr=3]/page/regionViewport/regionBody/mainReference/span/flow/block[1]/@space-before))"/> <eval expected="1" xpath="count(//pageViewport[@nr=1]/page/regionViewport/regionBody/mainReference/span/flow/block)"/> <eval expected="1" xpath="count(//pageViewport[@nr=2]/page/regionViewport/regionBody/mainReference/span/flow/block)"/> <eval expected="1" xpath="count(//pageViewport[@nr=3]/page/regionViewport/regionBody/mainReference/span/flow/block)"/> diff --git a/test/layoutengine/standard-testcases/block_space-before_space-after_6.xml b/test/layoutengine/standard-testcases/block_space-before_space-after_6.xml index 7b6737252..b21963bed 100644 --- a/test/layoutengine/standard-testcases/block_space-before_space-after_6.xml +++ b/test/layoutengine/standard-testcases/block_space-before_space-after_6.xml @@ -78,12 +78,6 @@ <penalty w="0" p="0"/> - <glue w="-10000"/> - - <box w="0"/> - <penalty w="0" p="INF"/> - <glue w="10000"/> - <box w="14400"/> <skip>3</skip> diff --git a/test/layoutengine/standard-testcases/list-block_space-before_space-after_1.xml b/test/layoutengine/standard-testcases/list-block_space-before_space-after_1.xml index 82af9d20d..2219cdfa1 100644 --- a/test/layoutengine/standard-testcases/list-block_space-before_space-after_1.xml +++ b/test/layoutengine/standard-testcases/list-block_space-before_space-after_1.xml @@ -108,48 +108,24 @@ Two blocks, testing conditionality="discard". <box w="28800"/> - <penalty w="0" p="INF"/> - <glue w="10000"/> <penalty w="0" p="0"/> - <glue w="-30000"/> - <box w="0"/> - <penalty w="0" p="INF"/> - <glue w="20000"/> <box w="14400"/> - <penalty w="0" p="INF"/> - <glue w="10000"/> <penalty w="0" p="0"/> - <glue w="-30000"/> - <box w="0"/> - <penalty w="0" p="INF"/> - <glue w="20000"/> <box w="14400"/> <!-- skip three more lines --> - <skip>8</skip> - <skip>8</skip> - <skip>8</skip> + <skip>2</skip> + <skip>2</skip> + <skip>2</skip> - <penalty w="0" p="INF"/> - <glue w="10000"/> <penalty w="0" p="0"/> - <glue w="-30000"/> - <box w="0"/> - <penalty w="0" p="INF"/> - <glue w="20000"/> <box w="28800"/> <!-- end of first list item --> - <penalty w="0" p="INF"/> - <glue w="10000"/> <penalty w="0" p="0"/> - <glue w="-30000"/> - <box w="0"/> - <penalty w="0" p="INF"/> - <glue w="20000"/> <box w="14400"/> <!-- second list-item --> @@ -203,8 +179,8 @@ Two blocks, testing conditionality="discard". <!-- 1: retain --> <eval expected="20000" xpath="//pageViewport[@nr=1]/page/regionViewport/regionBody/mainReference/span/flow/block[1]/@space-before"/> - <eval expected="10000" xpath="//pageViewport[@nr=1]/page/regionViewport/regionBody/mainReference/span/flow/block[1]/@space-after"/> - <eval expected="20000" xpath="//pageViewport[@nr=2]/page/regionViewport/regionBody/mainReference/span/flow/block[1]/@space-before"/> + <true xpath="not(boolean(//pageViewport[@nr=1]/page/regionViewport/regionBody/mainReference/span/flow/block[1]/@space-after))"/> + <true xpath="not(boolean(//pageViewport[@nr=2]/page/regionViewport/regionBody/mainReference/span/flow/block[1]/@space-before))"/> <!-- the following space is eliminated/collapsed through space resolution --> <true xpath="not(boolean(//pageViewport[@nr=2]/page/regionViewport/regionBody/mainReference/span/flow/block[1]/@space-after))"/> <eval expected="10000" xpath="//pageViewport[@nr=2]/page/regionViewport/regionBody/mainReference/span/flow/block[2]/@space-before"/> diff --git a/test/layoutengine/standard-testcases/table_space-before_space-after_1.xml b/test/layoutengine/standard-testcases/table_space-before_space-after_1.xml index 430d8689a..c151d293f 100644 --- a/test/layoutengine/standard-testcases/table_space-before_space-after_1.xml +++ b/test/layoutengine/standard-testcases/table_space-before_space-after_1.xml @@ -96,40 +96,22 @@ Two blocks, testing conditionality="discard". <box w="0"/> - <penalty w="0" p="INF"/> - <glue w="10000"/> <penalty w="14400"/> <!-- p is not of interest here --> - <glue w="-30000"/> - <box w="0"/> - <penalty w="0" p="INF"/> - <glue w="20000"/> <box w="28800"/> - <penalty w="0" p="INF"/> - <glue w="10000"/> <penalty w="0" p="0"/> - <glue w="-30000"/> - <box w="0"/> - <penalty w="0" p="INF"/> - <glue w="20000"/> <box w="14400"/> <!-- skip three more lines --> - <skip>8</skip> - <skip>8</skip> - <skip>8</skip> - <skip>8</skip> - <skip>8</skip> + <skip>2</skip> + <skip>2</skip> + <skip>2</skip> + <skip>2</skip> + <skip>2</skip> - <penalty w="0" p="INF"/> - <glue w="10000"/> <penalty w="0" p="0"/> - <glue w="-30000"/> - <box w="0"/> - <penalty w="0" p="INF"/> - <glue w="20000"/> <box w="28800"/> <!-- end of table --> @@ -185,8 +167,8 @@ Two blocks, testing conditionality="discard". <!-- 1: retain --> <eval expected="20000" xpath="//pageViewport[@nr=1]/page/regionViewport/regionBody/mainReference/span/flow/block[1]/@space-before"/> - <eval expected="10000" xpath="//pageViewport[@nr=1]/page/regionViewport/regionBody/mainReference/span/flow/block[1]/@space-after"/> - <eval expected="20000" xpath="//pageViewport[@nr=2]/page/regionViewport/regionBody/mainReference/span/flow/block[1]/@space-before"/> + <true xpath="not(boolean(//pageViewport[@nr=1]/page/regionViewport/regionBody/mainReference/span/flow/block[1]/@space-after))"/> + <true xpath="not(boolean(//pageViewport[@nr=2]/page/regionViewport/regionBody/mainReference/span/flow/block[1]/@space-before))"/> <!-- the following space is eliminated/collapsed through space resolution --> <true xpath="not(boolean(//pageViewport[@nr=2]/page/regionViewport/regionBody/mainReference/span/flow/block[1]/@space-after))"/> <eval expected="10000" xpath="//pageViewport[@nr=2]/page/regionViewport/regionBody/mainReference/span/flow/block[2]/@space-before"/> diff --git a/test/layoutengine/standard-testcases/table_space-before_space-after_2.xml b/test/layoutengine/standard-testcases/table_space-before_space-after_2.xml index 2e136a5cd..5b889b538 100644 --- a/test/layoutengine/standard-testcases/table_space-before_space-after_2.xml +++ b/test/layoutengine/standard-testcases/table_space-before_space-after_2.xml @@ -18,13 +18,13 @@ <testcase> <info> <p> - This test checks space properties on table. Demonstrates that spaces are repeated on every generated area. + This test checks space properties on table. Demonstrates that spaces are only on the first (or last) generated area. </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="30pt"> + <fo:simple-page-master master-name="normal" page-width="5in" page-height="28pt"> <fo:region-body/> </fo:simple-page-master> </fo:layout-master-set> @@ -57,42 +57,23 @@ <box w="0"/> <penalty w="0" p="INF"/> <glue w="5000"/> + <box w="10000"/> <penalty w="0" p="0"/> - <glue w="-5000"/> - - <box w="0"/> - <penalty w="0" p="INF"/> - <glue w="5000"/> <box w="10000"/> <penalty w="0" p="0"/> - <glue w="-5000"/> - - <box w="0"/> - <penalty w="0" p="INF"/> - <glue w="5000"/> <box w="10000"/> <penalty w="0" p="0"/> - <glue w="-5000"/> - - <box w="0"/> - <penalty w="0" p="INF"/> - <glue w="5000"/> <box w="10000"/> <penalty w="0" p="0"/> - <glue w="-5000"/> - - <box w="0"/> - <penalty w="0" p="INF"/> - <glue w="5000"/> <box w="10000"/> <skip>3</skip> </element-list> <eval expected="3" xpath="count(//pageViewport)"/> <eval expected="5000" xpath="//pageViewport[@nr=1]/page/regionViewport/regionBody/mainReference/span/flow/block[1]/@space-before"/> - <eval expected="5000" xpath="//pageViewport[@nr=2]/page/regionViewport/regionBody/mainReference/span/flow/block[1]/@space-before"/> - <eval expected="5000" xpath="//pageViewport[@nr=3]/page/regionViewport/regionBody/mainReference/span/flow/block[1]/@space-before"/> + <true xpath="not(boolean(//pageViewport[@nr=2]/page/regionViewport/regionBody/mainReference/span/flow/block[1]/@space-before))"/> + <true xpath="not(boolean(//pageViewport[@nr=3]/page/regionViewport/regionBody/mainReference/span/flow/block[1]/@space-before))"/> <eval expected="1" xpath="count(//pageViewport[@nr=1]/page/regionViewport/regionBody/mainReference/span/flow/block)"/> <eval expected="1" xpath="count(//pageViewport[@nr=2]/page/regionViewport/regionBody/mainReference/span/flow/block)"/> <eval expected="1" xpath="count(//pageViewport[@nr=3]/page/regionViewport/regionBody/mainReference/span/flow/block)"/> |