You are viewing a plain text version of this content. The canonical link for it is here.
Posted to fop-commits@xmlgraphics.apache.org by ma...@apache.org on 2006/04/08 09:18:03 UTC

svn commit: r392488 - in /xmlgraphics/fop/trunk: ./ src/java/org/apache/fop/fo/ src/java/org/apache/fop/layoutmgr/inline/ test/fotree/testcases/ test/layoutengine/ test/layoutengine/standard-testcases/

Author: manuel
Date: Sat Apr  8 00:17:59 2006
New Revision: 392488

URL: http://svn.apache.org/viewcvs?rev=392488&view=rev
Log:
Fixed various white space (non)removal issues during line building. white-space-treatment is now supported properly especially for the "preserve" case.

Added:
    xmlgraphics/fop/trunk/test/layoutengine/standard-testcases/block_text-align_3.xml   (with props)
    xmlgraphics/fop/trunk/test/layoutengine/standard-testcases/block_white-space.xml   (with props)
Modified:
    xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/FOPropertyMapping.java
    xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/FOText.java
    xmlgraphics/fop/trunk/src/java/org/apache/fop/layoutmgr/inline/LineLayoutManager.java
    xmlgraphics/fop/trunk/src/java/org/apache/fop/layoutmgr/inline/TextLayoutManager.java
    xmlgraphics/fop/trunk/status.xml
    xmlgraphics/fop/trunk/test/fotree/testcases/white-space_shorthand-expansion.fo
    xmlgraphics/fop/trunk/test/layoutengine/disabled-testcases.xml
    xmlgraphics/fop/trunk/test/layoutengine/standard-testcases/block_white-space-collapse_2.xml
    xmlgraphics/fop/trunk/test/layoutengine/standard-testcases/block_white-space-treatment_1.xml
    xmlgraphics/fop/trunk/test/layoutengine/standard-testcases/block_white-space-treatment_2.xml

Modified: xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/FOPropertyMapping.java
URL: http://svn.apache.org/viewcvs/xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/FOPropertyMapping.java?rev=392488&r1=392487&r2=392488&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/FOPropertyMapping.java (original)
+++ xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/FOPropertyMapping.java Sat Apr  8 00:17:59 2006
@@ -2823,7 +2823,7 @@
         m.setInherited(true);
         m.addEnum("normal", getEnumProperty(EN_NORMAL, "NORMAL"));
         m.addEnum("pre", getEnumProperty(EN_PRE, "PRE"));
-        m.addEnum("no-wrap", getEnumProperty(EN_NO_WRAP, "NO_WRAP"));
+        m.addEnum("nowrap", getEnumProperty(EN_NO_WRAP, "NO_WRAP"));
         m.setDefault("normal");
         m.setDatatypeParser(new WhiteSpaceShorthandParser());
         addPropertyMaker("white-space", m);

Modified: xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/FOText.java
URL: http://svn.apache.org/viewcvs/xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/FOText.java?rev=392488&r1=392487&r2=392488&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/FOText.java (original)
+++ xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/FOText.java Sat Apr  8 00:17:59 2006
@@ -1,5 +1,5 @@
 /*
- * Copyright 1999-2005 The Apache Software Foundation.
+ * Copyright 1999-2006 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.
@@ -80,6 +80,7 @@
     private ColorType color;
     private Property letterSpacing;
     private SpaceProperty lineHeight;
+    private int whiteSpaceTreatment;
     private int whiteSpaceCollapse;
     private int textTransform;
     private Property wordSpacing;
@@ -159,6 +160,7 @@
         lineHeight = pList.get(Constants.PR_LINE_HEIGHT).getSpace();
         letterSpacing = pList.get(Constants.PR_LETTER_SPACING);
         whiteSpaceCollapse = pList.get(Constants.PR_WHITE_SPACE_COLLAPSE).getEnum();
+        whiteSpaceTreatment = pList.get(Constants.PR_WHITE_SPACE_TREATMENT).getEnum();
         textTransform = pList.get(Constants.PR_TEXT_TRANSFORM).getEnum();
         wordSpacing = pList.get(Constants.PR_WORD_SPACING);
         wrapOption = pList.get(Constants.PR_WRAP_OPTION).getEnum();
@@ -575,6 +577,13 @@
      */
     public SpaceProperty getLineHeight() {
         return lineHeight;
+    }
+    
+    /**
+     * @return the "white-space-treatment" property
+     */
+    public int getWhitespaceTreatment() {
+        return whiteSpaceTreatment;
     }
     
     /**

Modified: xmlgraphics/fop/trunk/src/java/org/apache/fop/layoutmgr/inline/LineLayoutManager.java
URL: http://svn.apache.org/viewcvs/xmlgraphics/fop/trunk/src/java/org/apache/fop/layoutmgr/inline/LineLayoutManager.java?rev=392488&r1=392487&r2=392488&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/src/java/org/apache/fop/layoutmgr/inline/LineLayoutManager.java (original)
+++ xmlgraphics/fop/trunk/src/java/org/apache/fop/layoutmgr/inline/LineLayoutManager.java Sat Apr  8 00:17:59 2006
@@ -85,6 +85,7 @@
         hyphenationProperties = fobj.getCommonHyphenation();
         hyphenationLadderCount = fobj.getHyphenationLadderCount();
         wrapOption = fobj.getWrapOption();
+        whiteSpaceTreament = fobj.getWhitespaceTreatment();
         //
         effectiveAlignment = getEffectiveAlignment(textAlignment, textAlignmentLast);
         isFirstInBlock = (this == getParent().getChildLMs().get(0));
@@ -149,6 +150,7 @@
     private CommonHyphenation hyphenationProperties;
     private Numeric hyphenationLadderCount;
     private int wrapOption = EN_WRAP;
+    private int whiteSpaceTreament;
     //private LayoutProps layoutProps;
 
     private Length lineHeight;
@@ -1639,32 +1641,41 @@
                 }
             }
             
-            // ignore the last element in the line if it is a KnuthGlue object
-            seqIterator = seq.listIterator(iEndElement);
-            tempElement = (KnuthElement) seqIterator.next();
-            if (tempElement.isGlue()) {
-                iEndElement--;
-                // this returns the same KnuthElement
-                seqIterator.previous();
-                if (seqIterator.hasPrevious()) {
-                    tempElement = (KnuthElement) seqIterator.previous();
-                } else {
-                    tempElement = null;
+            // Remove trailing spaces if allowed so
+            if (whiteSpaceTreament == EN_IGNORE_IF_SURROUNDING_LINEFEED
+                || whiteSpaceTreament == EN_IGNORE 
+                || whiteSpaceTreament == EN_IGNORE_IF_BEFORE_LINEFEED) {
+                // ignore the last element in the line if it is a KnuthGlue object
+                seqIterator = seq.listIterator(iEndElement);
+                tempElement = (KnuthElement) seqIterator.next();
+                if (tempElement.isGlue()) {
+                    iEndElement--;
+                    // this returns the same KnuthElement
+                    seqIterator.previous();
+                    if (seqIterator.hasPrevious()) {
+                        tempElement = (KnuthElement) seqIterator.previous();
+                    } else {
+                        tempElement = null;
+                    }
+                }
+                if (tempElement != null) {
+                    lastLM = tempElement.getLayoutManager();
                 }
-            }
-            if (tempElement != null) {
-                lastLM = tempElement.getLayoutManager();
             }
             
-            // ignore KnuthGlue and KnuthPenalty objects
-            // at the beginning of the line
-            seqIterator = seq.listIterator(iStartElement);
-            tempElement = (KnuthElement) seqIterator.next();
-            while (!tempElement.isBox() && seqIterator.hasNext()) {
+            // Remove leading spaces if allowed so
+            if (whiteSpaceTreament == EN_IGNORE_IF_SURROUNDING_LINEFEED
+                || whiteSpaceTreament == EN_IGNORE 
+                || whiteSpaceTreament == EN_IGNORE_IF_AFTER_LINEFEED) {
+                // ignore KnuthGlue and KnuthPenalty objects
+                // at the beginning of the line
+                seqIterator = seq.listIterator(iStartElement);
                 tempElement = (KnuthElement) seqIterator.next();
-                iStartElement++;
+                while (!tempElement.isBox() && seqIterator.hasNext()) {
+                    tempElement = (KnuthElement) seqIterator.next();
+                    iStartElement++;
+                }
             }
-            
             // Add the inline areas to lineArea
             PositionIterator inlinePosIter
               = new KnuthPossPosIter(seq, iStartElement, iEndElement + 1);

Modified: xmlgraphics/fop/trunk/src/java/org/apache/fop/layoutmgr/inline/TextLayoutManager.java
URL: http://svn.apache.org/viewcvs/xmlgraphics/fop/trunk/src/java/org/apache/fop/layoutmgr/inline/TextLayoutManager.java?rev=392488&r1=392487&r2=392488&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/src/java/org/apache/fop/layoutmgr/inline/TextLayoutManager.java (original)
+++ xmlgraphics/fop/trunk/src/java/org/apache/fop/layoutmgr/inline/TextLayoutManager.java Sat Apr  8 00:17:59 2006
@@ -25,6 +25,7 @@
 
 import org.apache.fop.area.Trait;
 import org.apache.fop.area.inline.TextArea;
+import org.apache.fop.fo.Constants;
 import org.apache.fop.fo.FOText;
 import org.apache.fop.fo.flow.Inline;
 import org.apache.fop.fonts.Font;
@@ -438,11 +439,13 @@
         for (int i = firstIndex; i <= lastIndex; i++) {
             areaInfo = (AreaInfo) vecAreaInfo.get(i);
             if (areaInfo.isSpace) {
-                // areaInfo stores information about a space
-                // add a space to the TextArea
-                char spaceChar = textArray[areaInfo.iStartIndex];
-                textArea.addSpace(spaceChar, 0, 
-                        CharUtilities.isAdjustableSpace(spaceChar));
+                // areaInfo stores information about spaces
+                // add the spaces to the TextArea
+                for (int j = areaInfo.iStartIndex; j < areaInfo.iBreakIndex; j++) {
+                    char spaceChar = textArray[j];
+                    textArea.addSpace(spaceChar, 0, 
+                            CharUtilities.isAdjustableSpace(spaceChar));
+                }
             } else {
                 // areaInfo stores information about a word fragment
                 if (wordStartIndex == -1) {
@@ -529,9 +532,29 @@
 
         while (iNextStart < textArray.length) {
             char ch = textArray[iNextStart]; 
-            if (ch == CharUtilities.SPACE
-                || ch == CharUtilities.NBSPACE) {
-                // normal space or non-breaking space:
+            if (ch == CharUtilities.SPACE 
+                && foText.getWhitespaceTreatment() != Constants.EN_PRESERVE) {
+                // normal non preserved space - collect them all
+                // advance to the next character
+                iThisStart = iNextStart;
+                iNextStart++;
+                while (iNextStart < textArray.length 
+                    && textArray[iNextStart] == CharUtilities.SPACE) {
+                    iNextStart++;
+                }
+                // create the AreaInfo object
+                ai = new AreaInfo(iThisStart, (short) (iNextStart),
+                        (short) (iNextStart - iThisStart), (short) 0,
+                        MinOptMax.multiply(wordSpaceIPD, iNextStart - iThisStart),
+                        false, true); 
+                vecAreaInfo.add(ai);
+
+                // create the elements
+                sequence.addAll
+                    (createElementsForASpace(alignment, ai, vecAreaInfo.size() - 1));
+
+            } else if (ch == CharUtilities.SPACE || ch == CharUtilities.NBSPACE) {
+                // preserved space or non-breaking space:
                 // create the AreaInfo object
                 ai = new AreaInfo(iNextStart, (short) (iNextStart + 1),
                         (short) 1, (short) 0,
@@ -867,8 +890,9 @@
                 spaceElements.add(new KnuthInlineBox(ai.ipdArea.opt, null,
                         mainPosition, true));
             }
-        } else {
-            // a breaking space
+        } else if (textArray[ai.iStartIndex] == CharUtilities.SPACE
+                    && foText.getWhitespaceTreatment() == Constants.EN_PRESERVE) {
+            // a breaking space that needs to be preserved
             switch (alignment) {
             case EN_CENTER:
                 // centered text:
@@ -885,6 +909,97 @@
                                         ? KnuthElement.INFINITE
                                         : 0), false,
                                 new LeafPosition(this, -1), false));
+                spaceElements.add(new KnuthGlue(
+                        - (lineStartBAP + lineEndBAP), -6
+                        * LineLayoutManager.DEFAULT_SPACE_WIDTH, 0,
+                        new LeafPosition(this, -1), false));
+                spaceElements.add(new KnuthInlineBox(0, null,
+                        notifyPos(new LeafPosition(this, -1)), false));
+                spaceElements.add(new KnuthPenalty(0, KnuthElement.INFINITE,
+                        false, new LeafPosition(this, -1), false));
+                spaceElements.add(new KnuthGlue(ai.ipdArea.opt + lineStartBAP,
+                        3 * LineLayoutManager.DEFAULT_SPACE_WIDTH, 0,
+                        mainPosition, false));
+                break;
+
+            case EN_START: // fall through
+            case EN_END:
+                // left- or right-aligned text:
+                // if the second element is chosen as a line break these elements 
+                // add a constant amount of stretch at the end of a line, otherwise
+                // they don't add any stretch
+                spaceElements.add(new KnuthGlue(lineEndBAP,
+                        3 * LineLayoutManager.DEFAULT_SPACE_WIDTH, 0,
+                        new LeafPosition(this, -1), false));
+                spaceElements.add(new KnuthPenalty(0, 0, false,
+                        new LeafPosition(this, -1), false));
+                spaceElements.add(new KnuthGlue(
+                        - (lineStartBAP + lineEndBAP), -3
+                        * LineLayoutManager.DEFAULT_SPACE_WIDTH, 0,
+                        new LeafPosition(this, -1), false));
+                spaceElements.add(new KnuthInlineBox(0, null,
+                        notifyPos(new LeafPosition(this, -1)), false));
+                spaceElements.add(new KnuthPenalty(0,
+                        KnuthElement.INFINITE, false, new LeafPosition(
+                                this, -1), false));
+                spaceElements.add(new KnuthGlue(ai.ipdArea.opt + lineStartBAP, 0, 0,
+                        mainPosition, false));
+                break;
+
+            case EN_JUSTIFY:
+                // justified text:
+                // the stretch and shrink depends on the space width
+                spaceElements.add(new KnuthGlue(lineEndBAP, 0, 0,
+                        new LeafPosition(this, -1), false));
+                spaceElements.add(new KnuthPenalty(0, 0, false,
+                        new LeafPosition(this, -1), false));
+                spaceElements.add(new KnuthGlue(
+                        - (lineStartBAP + lineEndBAP), ai.ipdArea.max
+                        - ai.ipdArea.opt, ai.ipdArea.opt - ai.ipdArea.min,
+                        new LeafPosition(this, -1), false));
+                spaceElements.add(new KnuthInlineBox(0, null,
+                        notifyPos(new LeafPosition(this, -1)), false));
+                spaceElements.add(new KnuthPenalty(0,
+                        KnuthElement.INFINITE, false, new LeafPosition(
+                                this, -1), false));
+                spaceElements.add(new KnuthGlue(lineStartBAP + ai.ipdArea.opt, 0, 0,
+                        mainPosition, false));
+                break;
+
+            default:
+                // last line justified, the other lines unjustified:
+                // use only the space stretch
+                spaceElements.add(new KnuthGlue(lineEndBAP, 0, 0,
+                        new LeafPosition(this, -1), false));
+                spaceElements.add(new KnuthPenalty(0, 0, false,
+                        new LeafPosition(this, -1), false));
+                spaceElements.add(new KnuthGlue(
+                        - (lineStartBAP + lineEndBAP), ai.ipdArea.max
+                        - ai.ipdArea.opt, 0,
+                        new LeafPosition(this, -1), false));
+                spaceElements.add(new KnuthInlineBox(0, null,
+                        notifyPos(new LeafPosition(this, -1)), false));
+                spaceElements.add(new KnuthPenalty(0,
+                        KnuthElement.INFINITE, false, new LeafPosition(
+                                this, -1), false));
+                spaceElements.add(new KnuthGlue(lineStartBAP + ai.ipdArea.opt, 0, 0,
+                        mainPosition, false));
+            }
+        } else {
+            // a (possible block) of breaking spaces
+            switch (alignment) {
+            case EN_CENTER:
+                // centered text:
+                // if the second element is chosen as a line break these elements 
+                // add a constant amount of stretch at the end of a line and at the
+                // beginning of the next one, otherwise they don't add any stretch
+                spaceElements.add(new KnuthGlue(lineEndBAP,
+                        3 * LineLayoutManager.DEFAULT_SPACE_WIDTH, 0,
+                        new LeafPosition(this, -1), false));
+                spaceElements
+                        .add(new KnuthPenalty(
+                                0, 0, false,
+                                new LeafPosition(this, -1), false));
                 spaceElements.add(new KnuthGlue(ai.ipdArea.opt
                         - (lineStartBAP + lineEndBAP), -6
                         * LineLayoutManager.DEFAULT_SPACE_WIDTH, 0,
@@ -941,9 +1056,10 @@
                             new LeafPosition(this, -1), false));
                     spaceElements.add(new KnuthPenalty(0, 0, false,
                             new LeafPosition(this, -1), false));
-                    spaceElements.add(new KnuthGlue(ai.ipdArea.opt
-                            - (lineStartBAP + lineEndBAP), ai.ipdArea.max
-                            - ai.ipdArea.opt, ai.ipdArea.opt - ai.ipdArea.min,
+                    spaceElements.add(new KnuthGlue(
+                            ai.ipdArea.opt - (lineStartBAP + lineEndBAP),
+                            ai.ipdArea.max - ai.ipdArea.opt,
+                            ai.ipdArea.opt - ai.ipdArea.min,
                             mainPosition, false));
                     spaceElements.add(new KnuthInlineBox(0, null,
                             notifyPos(new LeafPosition(this, -1)), false));
@@ -954,8 +1070,9 @@
                             new LeafPosition(this, -1), false));
                 } else {
                     spaceElements.add(new KnuthGlue(ai.ipdArea.opt,
-                            ai.ipdArea.max - ai.ipdArea.opt, ai.ipdArea.opt
-                                    - ai.ipdArea.min, mainPosition, false));
+                            ai.ipdArea.max - ai.ipdArea.opt,
+                            ai.ipdArea.opt - ai.ipdArea.min,
+                            mainPosition, false));
                 }
                 break;
 
@@ -967,9 +1084,10 @@
                             new LeafPosition(this, -1), false));
                     spaceElements.add(new KnuthPenalty(0, 0, false,
                             new LeafPosition(this, -1), false));
-                    spaceElements.add(new KnuthGlue(ai.ipdArea.opt
-                            - (lineStartBAP + lineEndBAP), ai.ipdArea.max
-                            - ai.ipdArea.opt, 0, mainPosition, false));
+                    spaceElements.add(new KnuthGlue(
+                            ai.ipdArea.opt - (lineStartBAP + lineEndBAP),
+                            ai.ipdArea.max - ai.ipdArea.opt,
+                            0, mainPosition, false));
                     spaceElements.add(new KnuthInlineBox(0, null,
                             notifyPos(new LeafPosition(this, -1)), false));
                     spaceElements.add(new KnuthPenalty(0,
@@ -979,8 +1097,8 @@
                             new LeafPosition(this, -1), false));
                 } else {
                     spaceElements.add(new KnuthGlue(ai.ipdArea.opt,
-                            ai.ipdArea.max - ai.ipdArea.opt, 0, mainPosition,
-                            false));
+                            ai.ipdArea.max - ai.ipdArea.opt, 0,
+                            mainPosition, false));
                 }
             }
         }

Modified: xmlgraphics/fop/trunk/status.xml
URL: http://svn.apache.org/viewcvs/xmlgraphics/fop/trunk/status.xml?rev=392488&r1=392487&r2=392488&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/status.xml (original)
+++ xmlgraphics/fop/trunk/status.xml Sat Apr  8 00:17:59 2006
@@ -27,6 +27,14 @@
 
   <changes>
     <release version="FOP Trunk">
+      <action context="Code" dev="MM" type="fix">
+        Bugfix: Corrected enumerated property value for white-space property
+        from "no-wrap" to "nowrap".
+      </action>
+      <action context="Code" dev="MM" type="fix" fixes-bug="38547">
+        Bugfix: Added support for white-space-treatment="preserve" in particular to
+        support the white-space="pre" short hand property.
+      </action>
       <action context="Code" dev="JM" type="fix">
         Corrected expectation and behaviour for the text-indent property to only apply
         to the first line area generated by a block.

Modified: xmlgraphics/fop/trunk/test/fotree/testcases/white-space_shorthand-expansion.fo
URL: http://svn.apache.org/viewcvs/xmlgraphics/fop/trunk/test/fotree/testcases/white-space_shorthand-expansion.fo?rev=392488&r1=392487&r2=392488&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/test/fotree/testcases/white-space_shorthand-expansion.fo (original)
+++ xmlgraphics/fop/trunk/test/fotree/testcases/white-space_shorthand-expansion.fo Sat Apr  8 00:17:59 2006
@@ -37,7 +37,7 @@
           <test:assert property="wrap-option" expected="NO_WRAP" />
           Block 2: testing white-space="pre"
         </fo:block>
-        <fo:block white-space="no-wrap">
+        <fo:block white-space="nowrap">
           <test:assert property="linefeed-treatment" expected="TREAT_AS_SPACE" />
           <test:assert property="white-space-treatment" expected="IGNORE_IF_SURROUNDING_LINEFEED" />
           <test:assert property="white-space-collapse" expected="TRUE" />

Modified: xmlgraphics/fop/trunk/test/layoutengine/disabled-testcases.xml
URL: http://svn.apache.org/viewcvs/xmlgraphics/fop/trunk/test/layoutengine/disabled-testcases.xml?rev=392488&r1=392487&r2=392488&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/test/layoutengine/disabled-testcases.xml (original)
+++ xmlgraphics/fop/trunk/test/layoutengine/disabled-testcases.xml Sat Apr  8 00:17:59 2006
@@ -64,18 +64,6 @@
     in case of text-align="justify".</description>
   </testcase>
   <testcase>
-    <name>block white-space-treatment 1</name>
-    <file>block_white-space-treatment_1.xml</file>
-    <description>White space around formatter generated linebreaks is
-    not removed correctly.</description>
-  </testcase>
-  <testcase>
-    <name>block white-space-treatment 2</name>
-    <file>block_white-space-treatment_2.xml</file>
-    <description>White space around formatter generated linebreaks is
-    not removed correctly.</description>
-  </testcase>
-  <testcase>
     <name>block word-spacing</name>
     <file>block_word-spacing.xml</file>
     <description>Word-spacing may not work as expected.</description>

Added: xmlgraphics/fop/trunk/test/layoutengine/standard-testcases/block_text-align_3.xml
URL: http://svn.apache.org/viewcvs/xmlgraphics/fop/trunk/test/layoutengine/standard-testcases/block_text-align_3.xml?rev=392488&view=auto
==============================================================================
--- xmlgraphics/fop/trunk/test/layoutengine/standard-testcases/block_text-align_3.xml (added)
+++ xmlgraphics/fop/trunk/test/layoutengine/standard-testcases/block_text-align_3.xml Sat Apr  8 00:17:59 2006
@@ -0,0 +1,144 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  Copyright 2006 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 text-align and text-align-last with 
+      white-space-collapse="false".
+    </p>
+  </info>
+  <fo>
+    <fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format">
+      <fo:layout-master-set>
+        <fo:simple-page-master master-name="simple" page-height="10in" page-width="5in">
+          <fo:region-body/>
+        </fo:simple-page-master>
+      </fo:layout-master-set>
+      <fo:page-sequence master-reference="simple" white-space-collapse="false">
+        <fo:flow flow-name="xsl-region-body">
+          <fo:block> Lorem  ipsum   dolor    sit     amet,      consectetuer       adipiscing        elit.         Morbi           suscipit,          risus         ac        congue       suscipit,      tortor     nibh    cursus   mauris,  quis feugiat  nunc   ante    sit     amet      ante.       </fo:block>
+          <fo:block text-align="start" background-color="yellow"> Lorem  ipsum   dolor    sit     amet,      consectetuer       adipiscing        elit.         Morbi           suscipit,          risus         ac        congue       suscipit,      tortor     nibh    cursus   mauris,  quis feugiat  nunc   ante    sit     amet      ante.       </fo:block>
+          <fo:block text-align="justify"> Lorem  ipsum   dolor    sit     amet,      consectetuer       adipiscing        elit.         Morbi           suscipit,          risus         ac        congue       suscipit,      tortor     nibh    cursus   mauris,  quis feugiat  nunc   ante    sit     amet      ante.       </fo:block>
+          <fo:block text-align="center" background-color="yellow"> Lorem  ipsum   dolor    sit     amet,      consectetuer       adipiscing        elit.         Morbi           suscipit,          risus         ac        congue       suscipit,      tortor     nibh    cursus   mauris,  quis feugiat  nunc   ante    sit     amet      ante.       </fo:block>
+          <fo:block text-align="end"> Lorem  ipsum   dolor    sit     amet,      consectetuer       adipiscing        elit.         Morbi           suscipit,          risus         ac        congue       suscipit,      tortor     nibh    cursus   mauris,  quis feugiat  nunc   ante    sit     amet      ante.       </fo:block>
+          <fo:block text-align="justify" text-align-last="center" background-color="yellow"> Lorem  ipsum   dolor    sit     amet,      consectetuer       adipiscing        elit.         Morbi           suscipit,          risus         ac        congue       suscipit,      tortor     nibh    cursus   mauris,  quis feugiat  nunc   ante    sit     amet      ante.       </fo:block>
+          <fo:block text-align="justify" text-align-last="end"> Lorem  ipsum   dolor    sit     amet,      consectetuer       adipiscing        elit.         Morbi           suscipit,          risus         ac        congue       suscipit,      tortor     nibh    cursus   mauris,  quis feugiat  nunc   ante    sit     amet      ante.       </fo:block>
+        </fo:flow>
+      </fo:page-sequence>
+    </fo:root>
+  </fo>
+  <checks>
+    <!-- default settings for text-align -->
+    <true xpath="not(boolean(//flow/block[1]/lineArea[1]/@start-indent))"/>
+    <true xpath="not(boolean(//flow/block[1]/lineArea[2]/@start-indent))"/>
+    <true xpath="not(boolean(//flow/block[1]/lineArea[3]/@start-indent))"/>
+    <true xpath="not(boolean(//flow/block[1]/lineArea[4]/@start-indent))"/>
+    <true xpath="//flow/block[1]/lineArea[1]/text/@ipd != //flow/block[1]/lineArea[2]/text/@ipd"/>
+    <true xpath="//flow/block[1]/lineArea[2]/text/@ipd != //flow/block[1]/lineArea[3]/text/@ipd"/>
+    <true xpath="//flow/block[1]/lineArea[3]/text/@ipd != //flow/block[1]/lineArea[4]/text/@ipd"/>
+
+    <!-- text-align="start" -->
+    <true xpath="not(boolean(//flow/block[2]/lineArea[1]/@start-indent))"/>
+    <true xpath="not(boolean(//flow/block[2]/lineArea[2]/@start-indent))"/>
+    <true xpath="not(boolean(//flow/block[2]/lineArea[3]/@start-indent))"/>
+    <true xpath="not(boolean(//flow/block[2]/lineArea[4]/@start-indent))"/>
+    <true xpath="//flow/block[2]/lineArea[1]/text/@ipd != //flow/block[2]/lineArea[2]/text/@ipd"/>
+    <true xpath="//flow/block[2]/lineArea[2]/text/@ipd != //flow/block[2]/lineArea[3]/text/@ipd"/>
+    <true xpath="//flow/block[2]/lineArea[3]/text/@ipd != //flow/block[2]/lineArea[4]/text/@ipd"/>
+    
+    <!-- block 1 and 2 must have the same result -->
+    <true xpath="//flow/block[1]/lineArea[1]/text/@ipd = //flow/block[2]/lineArea[1]/text/@ipd"/>
+    <true xpath="//flow/block[1]/lineArea[2]/text/@ipd = //flow/block[2]/lineArea[2]/text/@ipd"/>
+    <true xpath="//flow/block[1]/lineArea[3]/text/@ipd = //flow/block[2]/lineArea[3]/text/@ipd"/>
+    <true xpath="//flow/block[1]/lineArea[4]/text/@ipd = //flow/block[2]/lineArea[4]/text/@ipd"/>
+
+    <!-- text-align="justify" -->
+    <true xpath="not(boolean(//flow/block[3]/lineArea[1]/@start-indent))"/>
+    <true xpath="not(boolean(//flow/block[3]/lineArea[2]/@start-indent))"/>
+    <true xpath="not(boolean(//flow/block[3]/lineArea[3]/@start-indent))"/>
+    <true xpath="not(boolean(//flow/block[3]/lineArea[4]/@start-indent))"/>
+    <!-- Some tolerance seems to be necessary here. Why is that exactly? -->
+    <true xpath="(360000 - //flow/block[3]/lineArea[1]/text/@ipd) &lt; 3000"/>
+    <true xpath="(360000 - //flow/block[3]/lineArea[1]/text/@ipd) &gt; -3000"/>
+    <true xpath="(360000 - //flow/block[3]/lineArea[2]/text/@ipd) &lt; 3000"/>
+    <true xpath="(360000 - //flow/block[3]/lineArea[2]/text/@ipd) &gt; -3000"/>
+    <true xpath="(360000 - //flow/block[3]/lineArea[3]/text/@ipd) &lt; 3000"/>
+    <true xpath="(360000 - //flow/block[3]/lineArea[3]/text/@ipd) &gt; -3000"/>
+    <true xpath="//flow/block[4]/lineArea[3]/text/@ipd &lt; 350000"/>
+
+    <!-- text-align="center" -->
+    <true xpath="//flow/block[4]/lineArea[1]/@start-indent &gt; 10000"/>
+    <true xpath="//flow/block[4]/lineArea[2]/@start-indent &gt; 10000"/>
+    <true xpath="//flow/block[4]/lineArea[3]/@start-indent &gt; 10000"/>
+    <true xpath="//flow/block[4]/lineArea[4]/@start-indent &gt; 10000"/>
+    <!-- Some tolerance seems to be necessary here. Why is that exactly? -->
+    <true xpath="(360000 - //flow/block[4]/lineArea[1]/text/@ipd - (2 * //flow/block[4]/lineArea[1]/@start-indent)) &lt; 4000"/>
+    <true xpath="(360000 - //flow/block[4]/lineArea[1]/text/@ipd - (2 * //flow/block[4]/lineArea[1]/@start-indent)) &gt; -4000"/>
+    <true xpath="(360000 - //flow/block[4]/lineArea[2]/text/@ipd - (2 * //flow/block[4]/lineArea[2]/@start-indent)) &lt; 4000"/>
+    <true xpath="(360000 - //flow/block[4]/lineArea[2]/text/@ipd - (2 * //flow/block[4]/lineArea[2]/@start-indent)) &gt; -4000"/>
+    <true xpath="(360000 - //flow/block[4]/lineArea[3]/text/@ipd - (2 * //flow/block[4]/lineArea[3]/@start-indent)) &lt; 4000"/>
+    <true xpath="(360000 - //flow/block[4]/lineArea[3]/text/@ipd - (2 * //flow/block[4]/lineArea[3]/@start-indent)) &gt; -4000"/>
+    <true xpath="(360000 - //flow/block[4]/lineArea[4]/text/@ipd - (2 * //flow/block[4]/lineArea[4]/@start-indent)) &lt; 4000"/>
+    <true xpath="(360000 - //flow/block[4]/lineArea[4]/text/@ipd - (2 * //flow/block[4]/lineArea[4]/@start-indent)) &gt; -4000"/>
+
+    <!-- text-align="end" -->
+    <true xpath="//flow/block[5]/lineArea[1]/@start-indent &gt; 10000"/>
+    <true xpath="//flow/block[5]/lineArea[2]/@start-indent &gt; 10000"/>
+    <true xpath="//flow/block[5]/lineArea[3]/@start-indent &gt; 10000"/>
+    <true xpath="//flow/block[5]/lineArea[4]/@start-indent &gt; 10000"/>
+    <!-- Some tolerance seems to be necessary here. Why is that exactly? -->
+    <true xpath="(360000 - //flow/block[5]/lineArea[1]/text/@ipd - //flow/block[5]/lineArea[1]/@start-indent) &lt; 4000"/>
+    <true xpath="(360000 - //flow/block[5]/lineArea[1]/text/@ipd - //flow/block[5]/lineArea[1]/@start-indent) &gt; -4000"/>
+    <true xpath="(360000 - //flow/block[5]/lineArea[2]/text/@ipd - //flow/block[5]/lineArea[2]/@start-indent) &lt; 4000"/>
+    <true xpath="(360000 - //flow/block[5]/lineArea[2]/text/@ipd - //flow/block[5]/lineArea[2]/@start-indent) &gt; -4000"/>
+    <true xpath="(360000 - //flow/block[5]/lineArea[3]/text/@ipd - //flow/block[5]/lineArea[3]/@start-indent) &lt; 4000"/>
+    <true xpath="(360000 - //flow/block[5]/lineArea[3]/text/@ipd - //flow/block[5]/lineArea[3]/@start-indent) &gt; -4000"/>
+    <true xpath="(360000 - //flow/block[5]/lineArea[4]/text/@ipd - //flow/block[5]/lineArea[4]/@start-indent) &lt; 4000"/>
+    <true xpath="(360000 - //flow/block[5]/lineArea[4]/text/@ipd - //flow/block[5]/lineArea[4]/@start-indent) &gt; -4000"/>
+
+    <!-- text-align="justify" text-align-last="center" -->
+    <true xpath="not(boolean(//flow/block[6]/lineArea[1]/@start-indent))"/>
+    <true xpath="not(boolean(//flow/block[6]/lineArea[2]/@start-indent))"/>
+    <true xpath="not(boolean(//flow/block[6]/lineArea[3]/@start-indent))"/>
+    <true xpath="//flow/block[6]/lineArea[4]/@start-indent &gt; 10000"/>
+    <true xpath="(360000 - //flow/block[6]/lineArea[1]/text/@ipd) &lt; 3000"/>
+    <true xpath="(360000 - //flow/block[6]/lineArea[1]/text/@ipd) &gt; -3000"/>
+    <true xpath="(360000 - //flow/block[6]/lineArea[2]/text/@ipd) &lt; 3000"/>
+    <true xpath="(360000 - //flow/block[6]/lineArea[2]/text/@ipd) &gt; -3000"/>
+    <true xpath="(360000 - //flow/block[6]/lineArea[3]/text/@ipd) &lt; 3000"/>
+    <true xpath="(360000 - //flow/block[6]/lineArea[3]/text/@ipd) &gt; -3000"/>
+    <true xpath="(360000 - //flow/block[6]/lineArea[4]/text/@ipd - (2 * //flow/block[6]/lineArea[4]/@start-indent)) &lt; 4000"/>
+    <true xpath="(360000 - //flow/block[6]/lineArea[4]/text/@ipd - (2 * //flow/block[6]/lineArea[4]/@start-indent)) &gt; -4000"/>
+
+    <!-- text-align="justify" text-align-last="end" -->
+    <true xpath="not(boolean(//flow/block[7]/lineArea[1]/@start-indent))"/>
+    <true xpath="not(boolean(//flow/block[7]/lineArea[2]/@start-indent))"/>
+    <true xpath="not(boolean(//flow/block[7]/lineArea[3]/@start-indent))"/>
+    <true xpath="//flow/block[7]/lineArea[4]/@start-indent &gt; 10000"/>
+    <true xpath="(360000 - //flow/block[7]/lineArea[1]/text/@ipd) &lt; 3000"/>
+    <true xpath="(360000 - //flow/block[7]/lineArea[1]/text/@ipd) &gt; -3000"/>
+    <true xpath="(360000 - //flow/block[7]/lineArea[2]/text/@ipd) &lt; 3000"/>
+    <true xpath="(360000 - //flow/block[7]/lineArea[2]/text/@ipd) &gt; -3000"/>
+    <true xpath="(360000 - //flow/block[7]/lineArea[3]/text/@ipd) &lt; 3000"/>
+    <true xpath="(360000 - //flow/block[7]/lineArea[3]/text/@ipd) &gt; -3000"/>
+    <true xpath="(360000 - //flow/block[7]/lineArea[4]/text/@ipd - //flow/block[7]/lineArea[4]/@start-indent) &lt; 4000"/>
+    <true xpath="(360000 - //flow/block[7]/lineArea[4]/text/@ipd - //flow/block[7]/lineArea[4]/@start-indent) &gt; -4000"/>
+
+    <!-- TODO Check element list -->
+  </checks>
+</testcase>

Propchange: xmlgraphics/fop/trunk/test/layoutengine/standard-testcases/block_text-align_3.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: xmlgraphics/fop/trunk/test/layoutengine/standard-testcases/block_text-align_3.xml
------------------------------------------------------------------------------
    svn:executable = *

Propchange: xmlgraphics/fop/trunk/test/layoutengine/standard-testcases/block_text-align_3.xml
------------------------------------------------------------------------------
    svn:keywords = Id

Modified: xmlgraphics/fop/trunk/test/layoutengine/standard-testcases/block_white-space-collapse_2.xml
URL: http://svn.apache.org/viewcvs/xmlgraphics/fop/trunk/test/layoutengine/standard-testcases/block_white-space-collapse_2.xml?rev=392488&r1=392487&r2=392488&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/test/layoutengine/standard-testcases/block_white-space-collapse_2.xml (original)
+++ xmlgraphics/fop/trunk/test/layoutengine/standard-testcases/block_white-space-collapse_2.xml Sat Apr  8 00:17:59 2006
@@ -1,6 +1,6 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <!--
-  Copyright 2005 The Apache Software Foundation
+  Copyright 2005-2006 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.
@@ -19,8 +19,6 @@
   <info>
     <p>
       This test checks basic white space handling for white-space-collapse="false".
-      The test currently fails because white space around formatter generated
-      linebreaks is not removed correctly.
     </p>
   </info>
   <fo>
@@ -101,7 +99,43 @@
     </fo:root>
   </fo>
   <checks>
-    <!-- The tests are currently incomplete but enough to fail -->
-    <eval expected="60" xpath="count(//flow/block[1]/lineArea[1]/text/space)"/>
+    <eval expected="5" xpath="count(//flow/block[1]/lineArea[1]/text[1]/word)"/>
+    <eval expected="60" xpath="count(//flow/block[1]/lineArea[1]/text[1]/space)"/>
+    <eval expected="1" xpath="count(//flow/block[1]/lineArea[2]/text[1]/word)"/>
+    <eval expected="2" xpath="count(//flow/block[1]/lineArea[2]/text[1]/space)"/>
+    
+    <eval expected="3" xpath="count(//flow/block[2]/block[1]/lineArea[1]/text/word)"/>
+    <eval expected="2" xpath="count(//flow/block[2]/block[1]/lineArea[1]/text/space)"/>
+    <eval expected="3" xpath="count(//flow/block[2]/block[2]/lineArea[1]/text/word)"/>
+    <eval expected="2" xpath="count(//flow/block[2]/block[2]/lineArea[1]/text/space)"/>
+    
+    <eval expected="2" xpath="count(//flow/block[3]/lineArea[1]/inlineparent[1]/text/word)"/>
+    <eval expected="16" xpath="count(//flow/block[3]/lineArea[1]/inlineparent[1]/text/space)"/>
+    <eval expected="13" xpath="count(//flow/block[3]/lineArea[1]/text[1]/space)"/>
+    <eval expected="2" xpath="count(//flow/block[3]/lineArea[1]/inlineparent[2]/text/word)"/>
+    <eval expected="16" xpath="count(//flow/block[3]/lineArea[1]/inlineparent[2]/text/space)"/>
+    
+    <eval expected="2" xpath="count(//flow/block[4]/lineArea[1]/text[1]/word)"/>
+    <eval expected="16" xpath="count(//flow/block[4]/lineArea[1]/text[1]/space)"/>
+    <eval expected="2" xpath="count(//flow/block[4]/lineArea[1]/inlineparent[1]/text/word)"/>
+    <eval expected="31" xpath="count(//flow/block[4]/lineArea[1]/inlineparent[1]/text/space)"/>
+    <eval expected="1" xpath="count(//flow/block[4]/lineArea[1]/text[2]/word)"/>
+    <eval expected="13" xpath="count(//flow/block[4]/lineArea[1]/text[2]/space)"/>
+    
+    <eval expected="2" xpath="count(//flow/block[5]/lineArea[1]/inlineparent[1]/text/word)"/>
+    <eval expected="18" xpath="count(//flow/block[5]/lineArea[1]/inlineparent[1]/text/space)"/>
+    <eval expected="3" xpath="count(//flow/block[5]/lineArea[1]/inlineparent[1]/inlineparent[1]/text/word)"/>
+    <eval expected="17" xpath="count(//flow/block[5]/lineArea[1]/inlineparent[1]/inlineparent[1]/text/space)"/>
+
+    <eval expected="3" xpath="count(//flow/block[6]/lineArea[1]/inlineparent[1]/inlineparent[1]/text/word)"/>
+    <eval expected="19" xpath="count(//flow/block[6]/lineArea[1]/inlineparent[1]/inlineparent[1]/text/space)"/>
+    <eval expected="2" xpath="count(//flow/block[6]/lineArea[1]/inlineparent[1]/text/word)"/>
+    <eval expected="16" xpath="count(//flow/block[6]/lineArea[1]/inlineparent[1]/text/space)"/>
+
+    <eval expected="2" xpath="count(//flow/block[7]/lineArea[1]/text[1]/word)"/>
+    <eval expected="14" xpath="count(//flow/block[7]/lineArea[1]/text[1]/space)"/>
+    <eval expected="15" xpath="count(//flow/block[7]/lineArea[1]/inlineparent[1]/text[1]/space)"/>
+    <eval expected="3" xpath="count(//flow/block[7]/lineArea[1]/inlineparent[1]/inlineparent[1]/text/word)"/>
+    <eval expected="36" xpath="count(//flow/block[7]/lineArea[1]/inlineparent[1]/inlineparent[1]/text/space)"/>
   </checks>
 </testcase>

Modified: xmlgraphics/fop/trunk/test/layoutengine/standard-testcases/block_white-space-treatment_1.xml
URL: http://svn.apache.org/viewcvs/xmlgraphics/fop/trunk/test/layoutengine/standard-testcases/block_white-space-treatment_1.xml?rev=392488&r1=392487&r2=392488&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/test/layoutengine/standard-testcases/block_white-space-treatment_1.xml (original)
+++ xmlgraphics/fop/trunk/test/layoutengine/standard-testcases/block_white-space-treatment_1.xml Sat Apr  8 00:17:59 2006
@@ -1,6 +1,6 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <!--
-  Copyright 2005 The Apache Software Foundation
+  Copyright 2005-2006 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.
@@ -20,8 +20,6 @@
     <p>
       This test checks white space handling for white-space-treatment
       with white-space-collapse="true".
-      The test currently fails because white space around formatter generated
-      linebreaks is not removed correctly.
     </p>
   </info>
   <fo>
@@ -63,23 +61,20 @@
     </fo:root>
   </fo>
   <checks>
-    <!-- The tests are currently incomplete but enough to fail -->
     <eval expected="3" xpath="count(//flow/block[1]/lineArea[1]/text/word)"/>
     <eval expected="2" xpath="count(//flow/block[1]/lineArea[1]/text/space)"/>
 
     <eval expected="1" xpath="count(//flow/block[2]/lineArea[1]/text/word)"/>
     <eval expected="0" xpath="count(//flow/block[2]/lineArea[1]/text/space)"/>
     
-    <eval expected="0" xpath="count(//flow/block[3]/lineArea[1]/text)"/>
-    <eval expected="1" xpath="count(//flow/block[3]/lineArea[2]/text/word)"/>
-    <eval expected="0" xpath="count(//flow/block[3]/lineArea[2]/text/space)"/>
-    <eval expected="1" xpath="count(//flow/block[3]/lineArea[3]/text/word)"/>
-    <eval expected="0" xpath="count(//flow/block[3]/lineArea[3]/text/space)"/>
-    <eval expected="1" xpath="count(//flow/block[3]/lineArea[4]/text/word)"/>
-    <eval expected="0" xpath="count(//flow/block[3]/lineArea[4]/text/space)"/>
+    <eval expected="3" xpath="count(//flow/block[3]/lineArea[1]/text/word)"/>
+    <eval expected="4" xpath="count(//flow/block[3]/lineArea[1]/text/space)"/>
     
-    <eval expected="1" xpath="count(//flow/block[4]/lineArea[1]/text/word)"/>
-    <eval expected="0" xpath="count(//flow/block[4]/lineArea[1]/text/space)"/>
+    <eval expected="3" xpath="count(//flow/block[4]/lineArea[1]/text/word)"/>
+    <eval expected="3" xpath="count(//flow/block[4]/lineArea[1]/text/space)"/>
+    
+    <eval expected="3" xpath="count(//flow/block[5]/lineArea[1]/text/word)"/>
+    <eval expected="3" xpath="count(//flow/block[5]/lineArea[1]/text/space)"/>
     
   </checks>
 </testcase>

Modified: xmlgraphics/fop/trunk/test/layoutengine/standard-testcases/block_white-space-treatment_2.xml
URL: http://svn.apache.org/viewcvs/xmlgraphics/fop/trunk/test/layoutengine/standard-testcases/block_white-space-treatment_2.xml?rev=392488&r1=392487&r2=392488&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/test/layoutengine/standard-testcases/block_white-space-treatment_2.xml (original)
+++ xmlgraphics/fop/trunk/test/layoutengine/standard-testcases/block_white-space-treatment_2.xml Sat Apr  8 00:17:59 2006
@@ -1,6 +1,6 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <!--
-  Copyright 2005 The Apache Software Foundation
+  Copyright 2005-2006 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.
@@ -18,10 +18,8 @@
 <testcase>
   <info>
     <p>
-      This test checks white space handling for white-space-treatment.
-      with white-spcae-collapse="false".
-      The test currently fails because white space around formatter generated
-      linebreaks is not removed correctly.
+      This test checks white space handling for white-space-treatment
+      with white-space-collapse="false".
     </p>
   </info>
   <fo>
@@ -34,52 +32,64 @@
       <fo:page-sequence master-reference="normal" white-space-collapse="false">
         <fo:flow flow-name="xsl-region-body">
           <fo:block white-space-treatment="ignore-if-surrounding-linefeed" background-color="silver" margin="1pt 0pt 1pt 0pt">
-  ignore-if-surrounding-linefeed                                                                    
-  all                                                                                              
-  spaces                                                                                           
+  ignore-if-surrounding-linefeed                                               
+  all                                                                          
+  spaces                                                                       
 </fo:block>
           <fo:block white-space-treatment="ignore" background-color="silver" margin="1pt 0pt 1pt 0pt">
-  ignore  
-  all  
-  spaces  
+  ignore                                                                       
+  all                                                                          
+  spaces                                                                       
 </fo:block>
           <fo:block white-space-treatment="preserve" background-color="silver" margin="1pt 0pt 1pt 0pt">
-  preserve                                                                                         
-  all                                                                                              
-  spaces                                                                                           
+  preserve                                                                     
+  all                                                                          
+  spaces                                                                       
 </fo:block>
           <fo:block white-space-treatment="ignore-if-before-linefeed" background-color="silver" margin="1pt 0pt 1pt 0pt">
-  ignore-if-before-linefeed  
-  all  
-  spaces  
+  ignore-if-before-linefeed                                                    
+  all                                                                          
+  spaces                                                                       
 </fo:block>
           <fo:block white-space-treatment="ignore-if-after-linefeed" background-color="silver" margin="1pt 0pt 1pt 0pt">
-  ignore-if-after-linefeed  
-  all  
-  spaces  
+  ignore-if-after-linefeed                                                     
+  all                                                                          
+  spaces                                                                       
 </fo:block>
         </fo:flow>
       </fo:page-sequence>
     </fo:root>
   </fo>
   <checks>
-    <!-- The tests are currently incomplete but enough to fail -->
-    <eval expected="3" xpath="count(//flow/block[1]/lineArea[1]/text/word)"/>
-    <eval expected="2" xpath="count(//flow/block[1]/lineArea[1]/text/space)"/>
+    <eval expected="2" xpath="count(//flow/block[1]/lineArea)"/>
+    <eval expected="2" xpath="count(//flow/block[1]/lineArea[1]/text/word)"/>
+    <eval expected="50" xpath="count(//flow/block[1]/lineArea[1]/text/space)"/>
+    <eval expected="1" xpath="count(//flow/block[1]/lineArea[2]/text/word)"/>
+    <eval expected="0" xpath="count(//flow/block[1]/lineArea[2]/text/space)"/>
 
+    <eval expected="1" xpath="count(//flow/block[2]/lineArea)"/>
     <eval expected="1" xpath="count(//flow/block[2]/lineArea[1]/text/word)"/>
     <eval expected="0" xpath="count(//flow/block[2]/lineArea[1]/text/space)"/>
     
-    <eval expected="0" xpath="count(//flow/block[3]/lineArea[1]/text)"/>
+    <eval expected="3" xpath="count(//flow/block[3]/lineArea)"/>
+    <eval expected="2" xpath="count(//flow/block[3]/lineArea[1]/text/word)"/>
+    <eval expected="90" xpath="count(//flow/block[3]/lineArea[1]/text/space)"/>
     <eval expected="1" xpath="count(//flow/block[3]/lineArea[2]/text/word)"/>
-    <eval expected="0" xpath="count(//flow/block[3]/lineArea[2]/text/space)"/>
-    <eval expected="1" xpath="count(//flow/block[3]/lineArea[3]/text/word)"/>
-    <eval expected="0" xpath="count(//flow/block[3]/lineArea[3]/text/space)"/>
-    <eval expected="1" xpath="count(//flow/block[3]/lineArea[4]/text/word)"/>
-    <eval expected="0" xpath="count(//flow/block[3]/lineArea[4]/text/space)"/>
+    <eval expected="96" xpath="count(//flow/block[3]/lineArea[2]/text/space)"/>
+    <eval expected="0" xpath="count(//flow/block[3]/lineArea[3]/text/word)"/>
+    <eval expected="38" xpath="count(//flow/block[3]/lineArea[3]/text/space)"/>
     
-    <eval expected="1" xpath="count(//flow/block[4]/lineArea[1]/text/word)"/>
-    <eval expected="0" xpath="count(//flow/block[4]/lineArea[1]/text/space)"/>
+    <eval expected="2" xpath="count(//flow/block[4]/lineArea)"/>
+    <eval expected="2" xpath="count(//flow/block[4]/lineArea[1]/text/word)"/>
+    <eval expected="58" xpath="count(//flow/block[4]/lineArea[1]/text/space)"/>
+    <eval expected="1" xpath="count(//flow/block[4]/lineArea[2]/text/word)"/>
+    <eval expected="77" xpath="count(//flow/block[4]/lineArea[2]/text/space)"/>
+    
+    <eval expected="2" xpath="count(//flow/block[5]/lineArea)"/>
+    <eval expected="2" xpath="count(//flow/block[5]/lineArea[1]/text/word)"/>
+    <eval expected="56" xpath="count(//flow/block[5]/lineArea[1]/text/space)"/>
+    <eval expected="1" xpath="count(//flow/block[5]/lineArea[2]/text/word)"/>
+    <eval expected="72" xpath="count(//flow/block[5]/lineArea[2]/text/space)"/>
     
   </checks>
 </testcase>

Added: xmlgraphics/fop/trunk/test/layoutengine/standard-testcases/block_white-space.xml
URL: http://svn.apache.org/viewcvs/xmlgraphics/fop/trunk/test/layoutengine/standard-testcases/block_white-space.xml?rev=392488&view=auto
==============================================================================
--- xmlgraphics/fop/trunk/test/layoutengine/standard-testcases/block_white-space.xml (added)
+++ xmlgraphics/fop/trunk/test/layoutengine/standard-testcases/block_white-space.xml Sat Apr  8 00:17:59 2006
@@ -0,0 +1,75 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  Copyright 2006 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 white space handling for white-space shorthand property.
+    </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">
+        <fo:flow flow-name="xsl-region-body">
+          <fo:block white-space="normal" background-color="silver" margin="1pt 0pt 1pt 0pt" text-decoration="underline">
+  normal                                                                                           
+  whitespace                                                                                       
+  handling                                                                                         
+</fo:block>
+          <fo:block white-space="pre" background-color="silver" margin="1pt 0pt 1pt 0pt" text-decoration="underline">
+  preserve                                                                                         
+  whitespace                                                                                       
+  handling                                                                                         
+</fo:block>
+          <fo:block white-space="nowrap" background-color="silver" margin="1pt 0pt 1pt 0pt" text-decoration="underline">
+  nowrap                                                                                           
+  whitespace                                                                                       
+  handling                                                                                         
+  nowrap                                                                                           
+  whitespace                                                                                       
+  handling                                                                                         
+  nowrap                                                                                           
+  whitespace                                                                                       
+  handling                                                                                         
+</fo:block>
+        </fo:flow>
+      </fo:page-sequence>
+    </fo:root>
+  </fo>
+  <checks>
+    <eval expected="3" xpath="count(//flow/block[1]/lineArea[1]/text/word)"/>
+    <eval expected="2" xpath="count(//flow/block[1]/lineArea[1]/text/space)"/>
+
+    <eval expected="0" xpath="count(//flow/block[2]/lineArea[1]/text/word)"/>
+    <eval expected="0" xpath="count(//flow/block[2]/lineArea[1]/text/space)"/>
+    <eval expected="1" xpath="count(//flow/block[2]/lineArea[2]/text/word)"/>
+    <eval expected="91" xpath="count(//flow/block[2]/lineArea[2]/text/space)"/>
+    <eval expected="1" xpath="count(//flow/block[2]/lineArea[3]/text/word)"/>
+    <eval expected="89" xpath="count(//flow/block[2]/lineArea[3]/text/space)"/>
+    <eval expected="1" xpath="count(//flow/block[2]/lineArea[4]/text/word)"/>
+    <eval expected="91" xpath="count(//flow/block[2]/lineArea[4]/text/space)"/>
+    
+    <eval expected="9" xpath="count(//flow/block[3]/lineArea[1]/text/word)"/>
+    <eval expected="8" xpath="count(//flow/block[3]/lineArea[1]/text/space)"/>
+    
+  </checks>
+</testcase>

Propchange: xmlgraphics/fop/trunk/test/layoutengine/standard-testcases/block_white-space.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: xmlgraphics/fop/trunk/test/layoutengine/standard-testcases/block_white-space.xml
------------------------------------------------------------------------------
    svn:executable = *

Propchange: xmlgraphics/fop/trunk/test/layoutengine/standard-testcases/block_white-space.xml
------------------------------------------------------------------------------
    svn:keywords = Id



---------------------------------------------------------------------
To unsubscribe, e-mail: fop-commits-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-commits-help@xmlgraphics.apache.org