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 vh...@apache.org on 2006/11/13 10:39:22 UTC
svn commit: r474218 [5/5] - in /xmlgraphics/fop/branches/Temp_Floats: ./
src/documentation/content/xdocs/trunk/ src/foschema/
src/java-1.4/org/apache/fop/image/ src/java/org/apache/fop/fo/
src/java/org/apache/fop/fo/expr/ src/java/org/apache/fop/fo/flo...
Modified: xmlgraphics/fop/branches/Temp_Floats/src/java/org/apache/fop/render/pdf/PDFSVGHandler.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_Floats/src/java/org/apache/fop/render/pdf/PDFSVGHandler.java?view=diff&rev=474218&r1=474217&r2=474218
==============================================================================
--- xmlgraphics/fop/branches/Temp_Floats/src/java/org/apache/fop/render/pdf/PDFSVGHandler.java (original)
+++ xmlgraphics/fop/branches/Temp_Floats/src/java/org/apache/fop/render/pdf/PDFSVGHandler.java Mon Nov 13 01:39:19 2006
@@ -26,6 +26,7 @@
import java.awt.geom.AffineTransform;
import org.w3c.dom.Document;
+import org.w3c.dom.svg.SVGAElement;
import org.w3c.dom.svg.SVGDocument;
import org.w3c.dom.svg.SVGSVGElement;
@@ -39,6 +40,7 @@
import org.apache.fop.pdf.PDFState;
import org.apache.fop.pdf.PDFStream;
import org.apache.fop.pdf.PDFResourceContext;
+import org.apache.fop.svg.PDFAElementBridge;
import org.apache.fop.svg.PDFBridgeContext;
import org.apache.fop.svg.PDFGraphics2D;
import org.apache.fop.svg.SVGUserAgent;
@@ -55,7 +57,9 @@
import org.apache.batik.bridge.GVTBuilder;
import org.apache.batik.bridge.BridgeContext;
import org.apache.batik.bridge.ViewBox;
+import org.apache.batik.dom.svg.SVGDOMImplementation;
import org.apache.batik.gvt.GraphicsNode;
+import org.apache.batik.util.SVGConstants;
/**
* PDF XML handler for SVG (uses Apache Batik).
@@ -142,6 +146,7 @@
*/
protected void renderSVGDocument(RendererContext context,
Document doc) {
+ PDFRenderer renderer = (PDFRenderer)context.getRenderer();
PDFInfo pdfInfo = getPDFInfo(context);
if (pdfInfo.paintAsBitmap) {
try {
@@ -163,12 +168,18 @@
final float uaResolution = context.getUserAgent().getSourceResolution();
SVGUserAgent ua = new SVGUserAgent(25.4f / uaResolution, new AffineTransform());
- GVTBuilder builder = new GVTBuilder();
+ //Scale for higher resolution on-the-fly images from Batik
+ double s = uaResolution / deviceResolution;
+ AffineTransform resolutionScaling = new AffineTransform();
+ resolutionScaling.scale(s, s);
- //TODO This AffineTransform here has to be fixed!!!
- AffineTransform linkTransform = pdfInfo.pdfState.getTransform();
- linkTransform.translate(xOffset / 1000f, yOffset / 1000f);
+ //Transformation matrix that establishes the local coordinate system for the SVG graphic
+ //in relation to PDF's initial coordinate system.
+ AffineTransform baseTransform = (AffineTransform)renderer.currentBasicTransform.clone();
+ baseTransform.concatenate(pdfInfo.pdfState.getTransform());
+ GVTBuilder builder = new GVTBuilder();
+
//Controls whether text painted by Batik is generated using text or path operations
boolean strokeText = false;
Configuration cfg = pdfInfo.cfg;
@@ -178,11 +189,12 @@
BridgeContext ctx = new PDFBridgeContext(ua,
(strokeText ? null : pdfInfo.fi),
- linkTransform);
+ new AffineTransform());
GraphicsNode root;
try {
root = builder.build(ctx, doc);
+ builder = null;
} catch (Exception e) {
log.error("svg graphic could not be built: "
+ e.getMessage(), e);
@@ -195,35 +207,36 @@
float sx = pdfInfo.width / (float)w;
float sy = pdfInfo.height / (float)h;
- ctx = null;
- builder = null;
+ //Scaling and translation for the bounding box of the image
+ AffineTransform scaling = new AffineTransform(
+ sx, 0, 0, sy, xOffset / 1000f, yOffset / 1000f);
+
+ //Finish the baseTransform, now that we know everything
+ baseTransform.concatenate(scaling);
+ baseTransform.concatenate(resolutionScaling);
+
+ //Now that we have the full baseTransform, we can update the transformation matrix for
+ //the AElementBridge.
+ PDFAElementBridge aBridge = (PDFAElementBridge)ctx.getBridge(
+ SVGDOMImplementation.SVG_NAMESPACE_URI, SVGConstants.SVG_A_TAG);
+ aBridge.getCurrentTransform().setTransform(baseTransform);
/*
* Clip to the svg area.
* Note: To have the svg overlay (under) a text area then use
* an fo:block-container
*/
- PDFRenderer renderer = (PDFRenderer)context.getRenderer();
+ pdfInfo.currentStream.add("%SVG setup\n");
renderer.saveGraphicsState();
renderer.setColor(Color.black, false, null);
renderer.setColor(Color.black, true, null);
- // transform so that the coordinates (0,0) is from the top left
- // and positive is down and to the right. (0,0) is where the
- // viewBox puts it.
- pdfInfo.currentStream.add(sx + " 0 0 " + sy + " " + xOffset / 1000f + " "
- + yOffset / 1000f + " cm\n");
+
+ if (!scaling.isIdentity()) {
+ pdfInfo.currentStream.add("%viewbox\n");
+ pdfInfo.currentStream.add(CTMHelper.toPDFString(scaling, false) + " cm\n");
+ }
SVGSVGElement svg = ((SVGDocument)doc).getRootElement();
- //AffineTransform at = ViewBox.getPreserveAspectRatioTransform(
- // svg, w / 1000f, h / 1000f);
- AffineTransform at = ViewBox.getPreserveAspectRatioTransform(svg,
- pdfInfo.width / 1000f, pdfInfo.height / 1000f);
- /*
- if (!at.isIdentity()) {
- double[] vals = new double[6];
- at.getMatrix(vals);
- pdfInfo.currentStream.add(CTMHelper.toPDFString(at, false) + " cm\n");
- }*/
if (pdfInfo.pdfContext == null) {
pdfInfo.pdfContext = pdfInfo.pdfPage;
@@ -233,21 +246,18 @@
pdfInfo.pdfContext, pdfInfo.pdfPage.referencePDF(),
pdfInfo.currentFontName, pdfInfo.currentFontSize);
graphics.setGraphicContext(new org.apache.xmlgraphics.java2d.GraphicContext());
- pdfInfo.pdfState.push();
- AffineTransform transform = new AffineTransform();
- // scale to viewbox
- transform.translate(xOffset / 1000f, yOffset / 1000f);
-
- if (deviceResolution != uaResolution) {
- //Scale for higher resolution on-the-fly images from Batik
- double s = uaResolution / deviceResolution;
- at.scale(s, s);
- pdfInfo.currentStream.add("" + PDFNumber.doubleOut(s) + " 0 0 "
- + PDFNumber.doubleOut(s) + " 0 0 cm\n");
+
+ if (!resolutionScaling.isIdentity()) {
+ pdfInfo.currentStream.add("%resolution scaling for " + uaResolution + " -> " + deviceResolution + "\n");
+ pdfInfo.currentStream.add(
+ CTMHelper.toPDFString(resolutionScaling, false) + " cm\n");
graphics.scale(1 / s, 1 / s);
}
+
+ pdfInfo.currentStream.add("%SVG start\n");
- pdfInfo.pdfState.setTransform(transform);
+ pdfInfo.pdfState.push();
+ pdfInfo.pdfState.setTransform(baseTransform);
graphics.setPDFState(pdfInfo.pdfState);
graphics.setOutputStream(pdfInfo.outputStream);
try {
@@ -257,9 +267,9 @@
log.error("svg graphic could not be rendered: "
+ e.getMessage(), e);
}
-
- renderer.restoreGraphicsState();
pdfInfo.pdfState.pop();
+ renderer.restoreGraphicsState();
+ pdfInfo.currentStream.add("%SVG end\n");
}
/** @see org.apache.fop.render.XMLHandler#supportsRenderer(org.apache.fop.render.Renderer) */
Modified: xmlgraphics/fop/branches/Temp_Floats/src/java/org/apache/fop/svg/PDFAElementBridge.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_Floats/src/java/org/apache/fop/svg/PDFAElementBridge.java?view=diff&rev=474218&r1=474217&r2=474218
==============================================================================
--- xmlgraphics/fop/branches/Temp_Floats/src/java/org/apache/fop/svg/PDFAElementBridge.java (original)
+++ xmlgraphics/fop/branches/Temp_Floats/src/java/org/apache/fop/svg/PDFAElementBridge.java Mon Nov 13 01:39:19 2006
@@ -51,6 +51,11 @@
transform = tf;
}
+ /** @return the transformation matrix for links */
+ public AffineTransform getCurrentTransform() {
+ return this.transform;
+ }
+
/**
* Returns 'a'.
* @return the name of this node
Modified: xmlgraphics/fop/branches/Temp_Floats/src/java/org/apache/fop/svg/PDFDocumentGraphics2D.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_Floats/src/java/org/apache/fop/svg/PDFDocumentGraphics2D.java?view=diff&rev=474218&r1=474217&r2=474218
==============================================================================
--- xmlgraphics/fop/branches/Temp_Floats/src/java/org/apache/fop/svg/PDFDocumentGraphics2D.java (original)
+++ xmlgraphics/fop/branches/Temp_Floats/src/java/org/apache/fop/svg/PDFDocumentGraphics2D.java Mon Nov 13 01:39:19 2006
@@ -165,7 +165,7 @@
* @see org.apache.avalon.framework.activity.Initializable#initialize()
*/
public void initialize() throws Exception {
- if (this.fontInfo == null) {
+ if (this.fontInfo == null || this.cfg != null) {
fontInfo = new FontInfo();
FontSetup.setup(fontInfo, this.pdfContext.getFontList(), null);
//FontState fontState = new FontState("Helvetica", "normal",
Modified: xmlgraphics/fop/branches/Temp_Floats/src/java/org/apache/fop/svg/PDFGraphics2D.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_Floats/src/java/org/apache/fop/svg/PDFGraphics2D.java?view=diff&rev=474218&r1=474217&r2=474218
==============================================================================
--- xmlgraphics/fop/branches/Temp_Floats/src/java/org/apache/fop/svg/PDFGraphics2D.java (original)
+++ xmlgraphics/fop/branches/Temp_Floats/src/java/org/apache/fop/svg/PDFGraphics2D.java Mon Nov 13 01:39:19 2006
@@ -342,6 +342,16 @@
+ PDFNumber.doubleOut(matrix[4], DEC) + " "
+ PDFNumber.doubleOut(matrix[5], DEC) + " cm\n");
}
+
+ /**
+ * This is mainly used for shading patterns which use the document-global coordinate system
+ * instead of the local one.
+ * @return the transformation matrix that established the basic user space for this document
+ */
+ protected AffineTransform getBaseTransform() {
+ AffineTransform at = new AffineTransform(graphicsState.getTransform());
+ return at;
+ }
/**
* This is a pdf specific method used to add a link to the
@@ -897,7 +907,7 @@
// Build proper transform from gradient space to page space
// ('Patterns' don't get userspace transform).
AffineTransform transform;
- transform = new AffineTransform(graphicsState.getTransform());
+ transform = new AffineTransform(getBaseTransform());
transform.concatenate(getTransform());
transform.concatenate(gp.getTransform());
@@ -973,7 +983,7 @@
}
AffineTransform transform;
- transform = new AffineTransform(graphicsState.getTransform());
+ transform = new AffineTransform(getBaseTransform());
transform.concatenate(getTransform());
transform.concatenate(rgp.getTransform());
@@ -1103,7 +1113,7 @@
bbox.add(new Double(rect.getY()));
AffineTransform transform;
- transform = new AffineTransform(graphicsState.getTransform());
+ transform = new AffineTransform(getBaseTransform());
transform.concatenate(getTransform());
transform.concatenate(pp.getPatternTransform());
Modified: xmlgraphics/fop/branches/Temp_Floats/status.xml
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_Floats/status.xml?view=diff&rev=474218&r1=474217&r2=474218
==============================================================================
--- xmlgraphics/fop/branches/Temp_Floats/status.xml (original)
+++ xmlgraphics/fop/branches/Temp_Floats/status.xml Mon Nov 13 01:39:19 2006
@@ -28,6 +28,29 @@
<changes>
<release version="FOP Trunk">
+ <action context="Code" dev="AD" type="update" fixes-bug="40270" due-to="Gary Reed">
+ Added relaxed validation for empty list-item-*, as suggested by Gary Reed.
+ </action>
+ <action context="Code" dev="AD" type="update">
+ Modified proportional-column-width() function to log an error if used
+ with table-layout=auto
+ </action>
+ <action context="Code" dev="AD" type="fix">
+ Deferred property resolution for markers until they are actually retrieved,
+ which leads to percentages and relative font-sizes now getting the correct
+ values. Also deferred white-space-handling for markers.
+ </action>
+ <action context="Code" dev="JM" type="update">
+ Changed the way overflowing pages are handled. The overflow property on region-body
+ is now used to define the behaviour.
+ </action>
+ <action context="Code" dev="JM" type="fix">
+ Fixed a memory-leak: The FO tree part of a page-sequence was not released when a
+ page-sequence was finished.
+ </action>
+ <action context="Code" dev="JM" type="fix">
+ Bugfix: Table headers and footers were swallowed when a table was nested in a list-block.
+ </action>
<action context="Code" dev="JM" type="fix">
Fixed a bug with indent handling when margins are used on a surrounding block and
not start/end-indent.
@@ -168,6 +191,11 @@
<action context="Code" dev="JM" type="add" fixes-bug="39118" due-to="Pierre-Henri Kraus">
Initial support for page-number-citation-last (XSL 1.1). Works without problems
only for page-sequence so far.
+ </action>
+ <action context="Code" dev="VH" type="update" fixes-bug="39777">
+ Improved support of before-floats: allow float-only pages, take into
+ account floats' shrinkability/stretchability, handle the splitting of
+ big floats.
</action>
</release>
<release version="0.92beta" date="18 Apr 2006">
Modified: xmlgraphics/fop/branches/Temp_Floats/test/layoutengine/disabled-testcases.xml
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_Floats/test/layoutengine/disabled-testcases.xml?view=diff&rev=474218&r1=474217&r2=474218
==============================================================================
--- xmlgraphics/fop/branches/Temp_Floats/test/layoutengine/disabled-testcases.xml (original)
+++ xmlgraphics/fop/branches/Temp_Floats/test/layoutengine/disabled-testcases.xml Mon Nov 13 01:39:19 2006
@@ -195,20 +195,6 @@
lists, yet.</description>
</testcase>
<testcase>
- <name>Whitespace around markers is not handled correctly</name>
- <file>marker_white-space-collapse.xml</file>
- <description>Whitespace within markers is handled according to the value of
- the white-space-collapse property in the context of the fo:marker and not according to
- the value of the property in the fo:retrieve-marker context.</description>
- </testcase>
- <testcase>
- <name>Relative font sizes within markers are not handled correctly</name>
- <file>marker_font-size.xml</file>
- <description>Relative font sizes within markers are evaluated according to the
- font size in the fo:marker context and not the font size in the fo:retrieve-marker
- context.</description>
- </testcase>
- <testcase>
<name>Page breaking doesn't deal with IPD changes</name>
<file>page-breaking_4.xml</file>
<description>Page breaking currently doesn't support changing available IPD
@@ -334,7 +320,8 @@
<testcase>
<name>table-cell empty area with marker.xml</name>
<file>table-cell_empty_area_with_marker.xml</file>
- <description>A table-cell producing an empty area does currently not add any markers to a page. See TODO entry in AreaAdditionUtil.</description>
+ <description>A table-cell producing an empty area does currently not add any markers to a page.
+ See TODO entry in AreaAdditionUtil.</description>
</testcase>
<testcase>
<name>Border conditionality on table</name>
@@ -369,5 +356,19 @@
<description>Instead of deferring a before-float on the following page, an
underfull page is created so that the citation be on the same page as the
float.</description>
+ </testcase>
+ <testcase>
+ <name>Before-floats plus footnotes on last page</name>
+ <file>before-float_footnote_last-page.xml</file>
+ <description>When an additional page must be created at the end
+ of a flow for placing both a remaining before-float and a footnote, an
+ IndexOutOfBoundException occurs.</description>
+ </testcase>
+ <testcase>
+ <name>Before-float too large to fit on a page alone</name>
+ <file>before-float_large.xml</file>
+ <description>When a before-float is too large to even fit on a page alone,
+ it should be split on several pages. Currently, there is an OutOfMemory
+ error.</description>
</testcase>
</disabled-testcases>
Added: xmlgraphics/fop/branches/Temp_Floats/test/layoutengine/standard-testcases/before-float_footnote_last-page.xml
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_Floats/test/layoutengine/standard-testcases/before-float_footnote_last-page.xml?view=auto&rev=474218
==============================================================================
--- xmlgraphics/fop/branches/Temp_Floats/test/layoutengine/standard-testcases/before-float_footnote_last-page.xml (added)
+++ xmlgraphics/fop/branches/Temp_Floats/test/layoutengine/standard-testcases/before-float_footnote_last-page.xml Mon Nov 13 01:39:19 2006
@@ -0,0 +1,109 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+<!-- $Id$ -->
+<testcase>
+ <info>
+ <p>
+ This test checks that a when an additional page must be created at the end
+ of a flow for remaining out-of-line objects, then both the remaining
+ before-floats and footnotes are placed on this page.
+ </p>
+ <p>
+ Currently disabled as this is a non-working feature (footnote is deferred
+ instead of being split).
+ </p>
+ </info>
+ <fo>
+ <fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format">
+ <fo:layout-master-set>
+ <fo:simple-page-master master-name="normal"
+ page-width="12cm" page-height="5.25cm">
+ <fo:region-body/>
+ </fo:simple-page-master>
+ </fo:layout-master-set>
+ <fo:page-sequence master-reference="normal" white-space-collapse="true">
+ <fo:flow flow-name="xsl-region-body"
+ space-after.minimum="2pt"
+ space-after.optimum="6pt"
+ space-after.maximum="14pt"
+ widows="1" orphans="1">
+ <fo:block space-after="inherit">
+ This is a block without a float. This is a block without a float.
+ This is a block without a float. This is a block without a float.
+ </fo:block>
+ <fo:block space-after="inherit">
+ This is a block without a float. This is a block without a float.
+ This is a block without a float. This is a block without a float.
+ </fo:block>
+ <fo:block space-after="inherit">
+ This is a block with a float and a footnote.
+ This is a block with a float and a footnote.
+ This is a block with a float and a footnote.
+ The footnote citation is here<fo:footnote>
+ <fo:inline color="blue">1</fo:inline>
+ <fo:footnote-body color="blue">
+ <fo:block>
+ Footnote body. Footnote body. Footnote body. Footnote body.
+ Footnote body. Footnote body. Footnote body. Footnote body.
+ Footnote body. Footnote body. Footnote body. Footnote body.
+ Footnote body. Footnote body. Footnote body. Footnote body.
+ </fo:block>
+ </fo:footnote-body>
+ </fo:footnote>. The float anchor is <fo:inline color="red">here</fo:inline><fo:float float="before" color="red">
+ <fo:block>
+ This is the float content. This is the float content.
+ This is the float content. This is the float content.
+ This is the float content. This is the float content.
+ This is the float content. This is the float content.
+ </fo:block>
+ </fo:float>.
+ </fo:block>
+ </fo:flow>
+ </fo:page-sequence>
+ </fo:root>
+ </fo>
+ <checks>
+ <eval expected="2" xpath="count(//pageViewport)"/>
+ <!-- first page -->
+ <!-- no before-float -->
+ <eval expected="0"
+ xpath="count(//pageViewport[1]/page/regionViewport/regionBody/beforeFloat/block)"/>
+ <!-- two lines of footnotes -->
+ <eval expected="1"
+ xpath="count(//pageViewport[1]/page/regionViewport/regionBody/footnote/block)"/>
+ <eval expected="2"
+ xpath="count(//pageViewport[1]/page/regionViewport/regionBody/footnote/block/lineArea)"/>
+
+ <!-- second page -->
+ <!-- before-float block -->
+ <eval expected="1"
+ xpath="count(//pageViewport[2]/page/regionViewport/regionBody/beforeFloat/block)"/>
+ <eval expected="This is the float content. This is the float content. This is the"
+ xpath="//pageViewport[2]/page/regionViewport/regionBody/beforeFloat/block/lineArea/text[1]"/>
+ <eval expected="57600"
+ xpath="//pageViewport[2]/page/regionViewport/regionBody/beforeFloat/block/@bpd"/>
+ <!-- two remaining lines of footnotes -->
+ <eval expected="1"
+ xpath="count(//pageViewport[2]/page/regionViewport/regionBody/footnote/block)"/>
+ <eval expected="2"
+ xpath="count(//pageViewport[2]/page/regionViewport/regionBody/footnote/block/lineArea)"/>
+ <!-- nothing in the main area -->
+ <eval expected="0"
+ xpath="count(//pageViewport[2]/page/regionViewport/regionBody/mainReference/span/flow/block)"/>
+ </checks>
+</testcase>
Added: xmlgraphics/fop/branches/Temp_Floats/test/layoutengine/standard-testcases/before-float_large.xml
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_Floats/test/layoutengine/standard-testcases/before-float_large.xml?view=auto&rev=474218
==============================================================================
--- xmlgraphics/fop/branches/Temp_Floats/test/layoutengine/standard-testcases/before-float_large.xml (added)
+++ xmlgraphics/fop/branches/Temp_Floats/test/layoutengine/standard-testcases/before-float_large.xml Mon Nov 13 01:39:19 2006
@@ -0,0 +1,103 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+<!-- $Id$ -->
+<testcase>
+ <info>
+ <p>
+ This test checks that a before-float too large to fit on a page alone is
+ split on several pages.
+ </p>
+ <p>
+ Currently disabled as this feature still needs some debugging.
+ </p>
+ </info>
+ <fo>
+ <fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format">
+ <fo:layout-master-set>
+ <fo:simple-page-master master-name="normal"
+ page-width="12cm" page-height="5.25cm">
+ <fo:region-body/>
+ </fo:simple-page-master>
+ </fo:layout-master-set>
+ <fo:page-sequence master-reference="normal" white-space-collapse="true">
+ <fo:flow flow-name="xsl-region-body"
+ space-after.minimum="2pt"
+ space-after.optimum="6pt"
+ space-after.maximum="14pt"
+ widows="1" orphans="1">
+ <fo:block space-after="inherit">
+ This is a block without a float. This is a block without a float.
+ This is a block without a float. This is a block without a float.
+ </fo:block>
+ <fo:block space-after="inherit">
+ This is a block without a float. This is a block without a float.
+ This is a block without a float. This is a block without a float.
+ </fo:block>
+ <fo:block space-after="inherit">
+ This is a block with a float. This is a block with a float.
+ This is a block with a float. This is a block with a float.
+ This is a block with a float. This is a block with a float.
+ The float anchor is <fo:inline color="red">here</fo:inline><fo:float
+ float="before" color="red"
+ space-after.minimum="3pt"
+ space-after.optimum="6pt"
+ space-after.maximum="9">
+ <fo:block space-after="inherit">
+ This is the float content. This is the float content.
+ This is the float content. This is the float content.
+ </fo:block>
+ <fo:block space-after="inherit">
+ This is the float content. This is the float content.
+ This is the float content. This is the float content.
+ </fo:block>
+ <fo:block space-after="inherit">
+ This is the float content. This is the float content.
+ This is the float content. This is the float content.
+ </fo:block>
+ <fo:block space-after="inherit">
+ This is the float content. This is the float content.
+ This is the float content. This is the float content.
+ </fo:block>
+ <fo:block space-after="inherit">
+ This is the float content. This is the float content.
+ This is the float content. This is the float content.
+ </fo:block>
+ </fo:float>.
+ This is a block with a float. This is a block with a float.
+ This is a block with a float. This is a block with a float.
+ </fo:block>
+ <fo:block space-after="inherit">
+ This is a block without a float. This is a block without a float.
+ This is a block without a float. This is a block without a float.
+ </fo:block>
+ <fo:block space-after="inherit">
+ This is a block without a float. This is a block without a float.
+ This is a block without a float. This is a block without a float.
+ </fo:block>
+ </fo:flow>
+ </fo:page-sequence>
+ </fo:root>
+ </fo>
+ <checks>
+ <!--
+ Well, the result is highly dependent on the implemented algorithm. Tests
+ will have to be added when it is implemented. Currently the float
+ overflows the page instead of being split.
+ -->
+ </checks>
+</testcase>
Modified: xmlgraphics/fop/branches/Temp_Floats/test/layoutengine/standard-testcases/before-float_not-deferred_stretch.xml
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_Floats/test/layoutengine/standard-testcases/before-float_not-deferred_stretch.xml?view=diff&rev=474218&r1=474217&r2=474218
==============================================================================
--- xmlgraphics/fop/branches/Temp_Floats/test/layoutengine/standard-testcases/before-float_not-deferred_stretch.xml (original)
+++ xmlgraphics/fop/branches/Temp_Floats/test/layoutengine/standard-testcases/before-float_not-deferred_stretch.xml Mon Nov 13 01:39:19 2006
@@ -91,7 +91,7 @@
<eval expected="3"
xpath="count(//pageViewport[1]/page/regionViewport/regionBody/mainReference/span/flow/block/block)"/>
<!-- only two lines in the last block -->
- <eval expected="2"
+ <eval expected="3"
xpath="count(//pageViewport[1]/page/regionViewport/regionBody/mainReference/span/flow/block/block[3]/lineArea)"/>
<!-- second page -->
<eval expected="0"
Modified: xmlgraphics/fop/branches/Temp_Floats/test/layoutengine/standard-testcases/marker_font-size.xml
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_Floats/test/layoutengine/standard-testcases/marker_font-size.xml?view=diff&rev=474218&r1=474217&r2=474218
==============================================================================
--- xmlgraphics/fop/branches/Temp_Floats/test/layoutengine/standard-testcases/marker_font-size.xml (original)
+++ xmlgraphics/fop/branches/Temp_Floats/test/layoutengine/standard-testcases/marker_font-size.xml Mon Nov 13 01:39:19 2006
@@ -37,7 +37,9 @@
<fo:page-sequence master-reference="normal">
<fo:static-content flow-name="xsl-region-before">
<fo:block background-color="yellow" font-size="16pt">
- 1. Marker <fo:retrieve-marker retrieve-class-name="m1" />
+ 1. Marker <fo:retrieve-marker retrieve-class-name="m1"
+ retrieve-boundary="page"
+ retrieve-position="first-starting-within-page" />
</fo:block>
</fo:static-content>
<fo:static-content flow-name="xsl-region-after">
@@ -46,7 +48,7 @@
</fo:block>
</fo:static-content>
<fo:flow flow-name="xsl-region-body">
- <fo:block background-color="red" white-space-collapse="false">
+ <fo:block background-color="red">
<fo:marker marker-class-name="m1">
<fo:block font-size=".5em">
First marker with small font
@@ -65,8 +67,9 @@
</fo:root>
</fo>
<checks>
+ <!-- font-size relative to the retrieve-marker context? -->
<eval expected="8000" xpath="//regionBefore/block[1]/block/lineArea/text/@font-size"/>
-
- <eval expected="20000" xpath="//regionBefore/block[1]/block/lineArea/text/@font-size"/>
+ <eval expected="20000" xpath="//regionAfter/block[1]/block/lineArea/text/@font-size"/>
+
</checks>
</testcase>
Modified: xmlgraphics/fop/branches/Temp_Floats/test/layoutengine/standard-testcases/marker_white-space-collapse.xml
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_Floats/test/layoutengine/standard-testcases/marker_white-space-collapse.xml?view=diff&rev=474218&r1=474217&r2=474218
==============================================================================
--- xmlgraphics/fop/branches/Temp_Floats/test/layoutengine/standard-testcases/marker_white-space-collapse.xml (original)
+++ xmlgraphics/fop/branches/Temp_Floats/test/layoutengine/standard-testcases/marker_white-space-collapse.xml Mon Nov 13 01:39:19 2006
@@ -52,7 +52,7 @@
</fo:block>
</fo:static-content>
<fo:flow flow-name="xsl-region-body">
- <fo:block background-color="red" white-space-collapse="false">
+ <fo:block background-color="red">
<fo:marker marker-class-name="m1">
<fo:block>
First marker with whitespace around
@@ -71,11 +71,12 @@
</fo:root>
</fo>
<checks>
- <!-- These checks do not have the correct values -->
- <eval expected="1" xpath="count(//regionBefore/block[1]/block/lineArea/text/space)"/>
- <eval expected="4" xpath="count(//regionBefore/block[2]/block/lineArea/text/space)"/>
+ <!-- preserve inter-word whitespace in the first block,
+ collapse them in the second -->
+ <eval expected="9" xpath="count(//regionBefore/block[1]/block[1]/lineArea[1]/text/space)"/>
+ <eval expected="4" xpath="count(//regionBefore/block[2]/block[1]/lineArea[1]/text/space)"/>
- <eval expected="1" xpath="count(//regionAfter/block[1]/block/lineArea/text/space)"/>
- <eval expected="4" xpath="count(//regionAfter/block[2]/block/lineArea/text/space)"/>
+ <eval expected="8" xpath="count(//regionAfter/block[1]/block[1]/lineArea[1]/text/space)"/>
+ <eval expected="4" xpath="count(//regionAfter/block[2]/block[1]/lineArea[1]/text/space)"/>
</checks>
</testcase>
Modified: xmlgraphics/fop/branches/Temp_Floats/test/layoutengine/standard-testcases/markers_7.xml
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_Floats/test/layoutengine/standard-testcases/markers_7.xml?view=diff&rev=474218&r1=474217&r2=474218
==============================================================================
--- xmlgraphics/fop/branches/Temp_Floats/test/layoutengine/standard-testcases/markers_7.xml (original)
+++ xmlgraphics/fop/branches/Temp_Floats/test/layoutengine/standard-testcases/markers_7.xml Mon Nov 13 01:39:19 2006
@@ -96,7 +96,7 @@
</fo:block>
</fo:static-content>
<fo:flow flow-name="xsl-region-body">
- <fo:table>
+ <fo:table table-layout="fixed">
<fo:marker marker-class-name="test">fo:table</fo:marker>
<fo:table-body>
<fo:table-cell>
@@ -118,7 +118,7 @@
</fo:block>
</fo:static-content>
<fo:flow flow-name="xsl-region-body">
- <fo:table>
+ <fo:table table-layout="fixed">
<fo:table-body>
<fo:marker marker-class-name="test">fo:table-body</fo:marker>
<fo:table-cell>
@@ -140,7 +140,7 @@
</fo:block>
</fo:static-content>
<fo:flow flow-name="xsl-region-body">
- <fo:table>
+ <fo:table table-layout="fixed">
<fo:table-header>
<fo:marker marker-class-name="test">fo:table-header</fo:marker>
<fo:table-cell>
@@ -167,7 +167,7 @@
</fo:block>
</fo:static-content>
<fo:flow flow-name="xsl-region-body">
- <fo:table>
+ <fo:table table-layout="fixed">
<fo:table-footer>
<fo:marker marker-class-name="test">fo:table-footer</fo:marker>
<fo:table-cell>
@@ -194,7 +194,7 @@
</fo:block>
</fo:static-content>
<fo:flow flow-name="xsl-region-body">
- <fo:table>
+ <fo:table table-layout="fixed">
<fo:table-body>
<fo:table-cell>
<fo:marker marker-class-name="test">fo:table-cell</fo:marker>
Modified: xmlgraphics/fop/branches/Temp_Floats/test/layoutengine/standard-testcases/markers_8.xml
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_Floats/test/layoutengine/standard-testcases/markers_8.xml?view=diff&rev=474218&r1=474217&r2=474218
==============================================================================
--- xmlgraphics/fop/branches/Temp_Floats/test/layoutengine/standard-testcases/markers_8.xml (original)
+++ xmlgraphics/fop/branches/Temp_Floats/test/layoutengine/standard-testcases/markers_8.xml Mon Nov 13 01:39:19 2006
@@ -49,7 +49,7 @@
</fo:block>
</fo:static-content>
<fo:flow flow-name="xsl-region-body">
- <fo:table color="black">
+ <fo:table color="black" table-layout="fixed">
<fo:marker marker-class-name="test">table1</fo:marker>
<fo:table-column number-columns-repeated="2"/>
<fo:table-body>
@@ -77,7 +77,7 @@
</fo:table-row>
</fo:table-body>
</fo:table>
- <fo:table color="red">
+ <fo:table color="red" table-layout="fixed">
<fo:marker marker-class-name="test">table2</fo:marker>
<fo:table-column number-columns-repeated="2"/>
<fo:table-body>
@@ -99,7 +99,7 @@
</fo:table-row>
</fo:table-body>
</fo:table>
- <fo:table color="blue">
+ <fo:table color="blue" table-layout="fixed">
<fo:marker marker-class-name="test">table3</fo:marker>
<fo:table-column number-columns-repeated="2"/>
<fo:table-body>
Modified: xmlgraphics/fop/branches/Temp_Floats/test/layoutengine/standard-testcases/markers_9.xml
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_Floats/test/layoutengine/standard-testcases/markers_9.xml?view=diff&rev=474218&r1=474217&r2=474218
==============================================================================
--- xmlgraphics/fop/branches/Temp_Floats/test/layoutengine/standard-testcases/markers_9.xml (original)
+++ xmlgraphics/fop/branches/Temp_Floats/test/layoutengine/standard-testcases/markers_9.xml Mon Nov 13 01:39:19 2006
@@ -49,7 +49,7 @@
</fo:block>
</fo:static-content>
<fo:flow flow-name="xsl-region-body">
- <fo:table color="black">
+ <fo:table color="black" table-layout="fixed">
<fo:table-column number-columns-repeated="2"/>
<fo:table-body>
<fo:marker marker-class-name="test">body1</fo:marker>
@@ -77,7 +77,7 @@
</fo:table-row>
</fo:table-body>
</fo:table>
- <fo:table color="red">
+ <fo:table color="red" table-layout="fixed">
<fo:table-column number-columns-repeated="2"/>
<fo:table-body>
<fo:marker marker-class-name="test">body2</fo:marker>
@@ -99,7 +99,7 @@
</fo:table-row>
</fo:table-body>
</fo:table>
- <fo:table color="blue">
+ <fo:table color="blue" table-layout="fixed">
<fo:table-column number-columns-repeated="2"/>
<fo:table-body>
<fo:marker marker-class-name="test">body3</fo:marker>
@@ -130,7 +130,7 @@
</fo:table-row>
</fo:table-body>
</fo:table>
- <fo:table>
+ <fo:table table-layout="fixed">
<fo:table-column number-columns-repeated="2"/>
<fo:table-body color="black">
<fo:marker marker-class-name="test">body5</fo:marker>
Modified: xmlgraphics/fop/branches/Temp_Floats/test/layoutengine/standard-testcases/table-body_basic_1.xml
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_Floats/test/layoutengine/standard-testcases/table-body_basic_1.xml?view=diff&rev=474218&r1=474217&r2=474218
==============================================================================
--- xmlgraphics/fop/branches/Temp_Floats/test/layoutengine/standard-testcases/table-body_basic_1.xml (original)
+++ xmlgraphics/fop/branches/Temp_Floats/test/layoutengine/standard-testcases/table-body_basic_1.xml Mon Nov 13 01:39:19 2006
@@ -31,7 +31,7 @@
</fo:layout-master-set>
<fo:page-sequence master-reference="normal" white-space-collapse="true">
<fo:flow flow-name="xsl-region-body">
- <fo:table color="black">
+ <fo:table color="black" table-layout="fixed">
<fo:table-column number-columns-repeated="2"/>
<fo:table-body>
<fo:table-row>
Modified: xmlgraphics/fop/branches/Temp_Floats/test/layoutengine/standard-testcases/table-cell_background-image.xml
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_Floats/test/layoutengine/standard-testcases/table-cell_background-image.xml?view=diff&rev=474218&r1=474217&r2=474218
==============================================================================
--- xmlgraphics/fop/branches/Temp_Floats/test/layoutengine/standard-testcases/table-cell_background-image.xml (original)
+++ xmlgraphics/fop/branches/Temp_Floats/test/layoutengine/standard-testcases/table-cell_background-image.xml Mon Nov 13 01:39:19 2006
@@ -34,7 +34,7 @@
</fo:layout-master-set>
<fo:page-sequence master-reference="normal" white-space-collapse="true">
<fo:flow flow-name="xsl-region-body">
- <fo:table border-collapse="separate">
+ <fo:table border-collapse="separate" table-layout="fixed">
<fo:table-column />
<fo:table-column />
<fo:table-column />
Modified: xmlgraphics/fop/branches/Temp_Floats/test/layoutengine/standard-testcases/table-cell_padding_percentages.xml
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_Floats/test/layoutengine/standard-testcases/table-cell_padding_percentages.xml?view=diff&rev=474218&r1=474217&r2=474218
==============================================================================
--- xmlgraphics/fop/branches/Temp_Floats/test/layoutengine/standard-testcases/table-cell_padding_percentages.xml (original)
+++ xmlgraphics/fop/branches/Temp_Floats/test/layoutengine/standard-testcases/table-cell_padding_percentages.xml Mon Nov 13 01:39:19 2006
@@ -31,7 +31,7 @@
</fo:layout-master-set>
<fo:page-sequence master-reference="normal" white-space-collapse="true">
<fo:flow flow-name="xsl-region-body">
- <fo:table>
+ <fo:table table-layout="fixed">
<fo:table-column column-number="1" />
<fo:table-column column-number="2" />
<fo:table-column column-number="3" />
Modified: xmlgraphics/fop/branches/Temp_Floats/test/layoutengine/standard-testcases/table-row_background-image.xml
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_Floats/test/layoutengine/standard-testcases/table-row_background-image.xml?view=diff&rev=474218&r1=474217&r2=474218
==============================================================================
--- xmlgraphics/fop/branches/Temp_Floats/test/layoutengine/standard-testcases/table-row_background-image.xml (original)
+++ xmlgraphics/fop/branches/Temp_Floats/test/layoutengine/standard-testcases/table-row_background-image.xml Mon Nov 13 01:39:19 2006
@@ -34,7 +34,7 @@
</fo:layout-master-set>
<fo:page-sequence master-reference="normal" white-space-collapse="true">
<fo:flow flow-name="xsl-region-body">
- <fo:table>
+ <fo:table table-layout="fixed">
<fo:table-column column-number="1" />
<fo:table-column column-number="2" />
<fo:table-column column-number="3" />
Modified: xmlgraphics/fop/branches/Temp_Floats/test/layoutengine/standard-testcases/table_background-image.xml
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_Floats/test/layoutengine/standard-testcases/table_background-image.xml?view=diff&rev=474218&r1=474217&r2=474218
==============================================================================
--- xmlgraphics/fop/branches/Temp_Floats/test/layoutengine/standard-testcases/table_background-image.xml (original)
+++ xmlgraphics/fop/branches/Temp_Floats/test/layoutengine/standard-testcases/table_background-image.xml Mon Nov 13 01:39:19 2006
@@ -34,7 +34,11 @@
</fo:layout-master-set>
<fo:page-sequence master-reference="normal" white-space-collapse="true">
<fo:flow flow-name="xsl-region-body">
- <fo:table background-color="yellow" background-repeat="no-repeat" background-position-horizontal="center" background-position-vertical="center" background-image="##img">
+ <fo:table table-layout="fixed" background-color="yellow"
+ background-repeat="no-repeat"
+ background-position-horizontal="center"
+ background-position-vertical="center"
+ background-image="##img">
<fo:table-column column-number="1" />
<fo:table-column column-number="2" />
<fo:table-column column-number="3" />
Modified: xmlgraphics/fop/branches/Temp_Floats/test/layoutengine/standard-testcases/table_padding_percentages.xml
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_Floats/test/layoutengine/standard-testcases/table_padding_percentages.xml?view=diff&rev=474218&r1=474217&r2=474218
==============================================================================
--- xmlgraphics/fop/branches/Temp_Floats/test/layoutengine/standard-testcases/table_padding_percentages.xml (original)
+++ xmlgraphics/fop/branches/Temp_Floats/test/layoutengine/standard-testcases/table_padding_percentages.xml Mon Nov 13 01:39:19 2006
@@ -31,7 +31,8 @@
</fo:layout-master-set>
<fo:page-sequence master-reference="normal" white-space-collapse="true">
<fo:flow flow-name="xsl-region-body">
- <fo:table margin="0pt" padding="5%" background-color="yellow" border-collapse="separate">
+ <fo:table table-layout="fixed" margin="0pt" padding="5%"
+ background-color="yellow" border-collapse="separate">
<fo:table-column column-number="1" />
<fo:table-column column-number="2" />
<fo:table-column column-number="3" />
---------------------------------------------------------------------
To unsubscribe, e-mail: fop-commits-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-commits-help@xmlgraphics.apache.org