]> source.dussan.org Git - xmlgraphics-fop.git/commitdiff
Following a clarification by the XSL FO SG, space traits are only set on the first...
authorJeremias Maerki <jeremias@apache.org>
Thu, 19 Jan 2006 15:10:14 +0000 (15:10 +0000)
committerJeremias Maerki <jeremias@apache.org>
Thu, 19 Jan 2006 15:10:14 +0000 (15:10 +0000)
For details, see: http://wiki.apache.org/xmlgraphics-fop/XslFoSpecificationUncertainties/SpaceTraits

Note: this change brings another issue in column balancing to light. That's the reason for disabling one of the tests. I wasn't able to find a quick fix there.

git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@370494 13f79535-47bb-0310-9956-ffa450edef68

16 files changed:
src/java/org/apache/fop/layoutmgr/BlockContainerLayoutManager.java
src/java/org/apache/fop/layoutmgr/BlockLayoutManager.java
src/java/org/apache/fop/layoutmgr/BlockStackingLayoutManager.java
src/java/org/apache/fop/layoutmgr/list/ListBlockLayoutManager.java
src/java/org/apache/fop/layoutmgr/list/ListItemLayoutManager.java
src/java/org/apache/fop/layoutmgr/table/TableLayoutManager.java
status.xml
test/layoutengine/disabled-testcases.xml
test/layoutengine/standard-testcases/block-container_space-before_space-after_1.xml
test/layoutengine/standard-testcases/block-container_space-before_space-after_2.xml
test/layoutengine/standard-testcases/block_space-before_space-after_2.xml
test/layoutengine/standard-testcases/block_space-before_space-after_4.xml
test/layoutengine/standard-testcases/block_space-before_space-after_6.xml
test/layoutengine/standard-testcases/list-block_space-before_space-after_1.xml
test/layoutengine/standard-testcases/table_space-before_space-after_1.xml
test/layoutengine/standard-testcases/table_space-before_space-after_2.xml

index 455a7d8fc7a7b0f89ae499b214a155a75e264074..658a92e0d7422d0a04dc61d51c9e832bc8cfcb57 100644 (file)
@@ -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;
index 0db92b30f2885ad5eedae7fab03251640b7e98e6..a303f18fd62c84f3fa7c489b7b13c871ea453125 100644 (file)
@@ -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;
     }
     
     /**
index c09ae8ae5719e2aa521bfed978dadda253b58a5a..eb7a2599c0ddbfa9906643446bd6815518de6a6a 100644 (file)
@@ -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) {
index dcedfdbcbce1cb1cd7a6b2ccfc9def61ab7c4a65..e23639e0d97900ba357d97829092550612b8f95d 100644 (file)
@@ -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 */
index 2dd7020a7aa87949d57790327bbdebf9f254210b..c402f37ae3b2165cc8c21ebc1df7cb05982319f0 100644 (file)
@@ -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 */
index 5bfab332e4d17d576205066609a7ca8618887dc3..9aea85080924c20372ac531b62e8dc51a20b12ff 100644 (file)
@@ -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);
index 37d891f97c48d7f8f00d263c2478a2a78db60740..612d116f6b2a2ffb25a60b5e0be793545bb87ef7 100644 (file)
 
   <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
index 684e5c4c10387e5fe360047e35926a080aa5e3a3..78ef2a7eb1d346bb8f29f92b1c3b4fba4d1d391d 100755 (executable)
     <description>Situation in a 4-column document where the column balancing doesn't work and even causes some
     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>
index 37b7b87c2ba46174fee499d2ddb0814c2e35124a..5397d516e87274d1e6d81c0ef488d8d784304eba 100644 (file)
@@ -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"/>
index d742b3e8572444ce523d067cbd970699a737aeee..8ed83492e5b04071c63a55b67b1878d25ff8e6db 100644 (file)
 <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>
       <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)"/>
index 0676277f9a7150d2357dea23ad80e18ea93fd83b..4b2d6721237f35113d20742f3c45302de48c6e28 100644 (file)
@@ -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"/>
index 3d4fb9f581c585db51259948fe17db25ac8771de..d00e18cb42987950572613adac2b61f87f58fcdd 100644 (file)
 <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>
       <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)"/>
index 7b6737252018839d7690164233c07bdadb5fc347..b21963beda34c9dc7ed7364244605c7807bc7465 100644 (file)
 
       <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>
index 82af9d20d0e636d93dfd109d6b4cef846a3c4fb8..2219cdfa1b8f031039c313e62237f3ed83b53a86 100644 (file)
@@ -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"/>
index 430d8689af822cc87eb0f8134b4983347cee9965..c151d293f61e7fee490eafed4649be09f71514ad 100644 (file)
@@ -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"/>
index 2e136a5cddb599e0bc31e84f8f4c73795b0316e0..5b889b5382563e05599b2e8ddc0e0bfc260038e2 100644 (file)
 <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>
       <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)"/>