aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/java/org/apache/fop/fo/FObj.java16
-rw-r--r--src/java/org/apache/fop/fo/flow/Block.java2
-rw-r--r--src/java/org/apache/fop/fo/flow/BlockContainer.java2
3 files changed, 20 insertions, 0 deletions
diff --git a/src/java/org/apache/fop/fo/FObj.java b/src/java/org/apache/fop/fo/FObj.java
index b2b79eceb..f9a0ca73d 100644
--- a/src/java/org/apache/fop/fo/FObj.java
+++ b/src/java/org/apache/fop/fo/FObj.java
@@ -27,6 +27,7 @@ import java.util.Set;
import org.apache.fop.apps.FOPException;
import org.apache.fop.datatypes.PercentBase;
import org.apache.fop.fo.flow.Marker;
+import org.apache.fop.fo.pagination.Flow;
import org.apache.fop.fo.properties.PropertyMaker;
import org.xml.sax.Attributes;
import org.xml.sax.Locator;
@@ -146,6 +147,21 @@ public abstract class FObj extends FONode implements Constants {
}
}
+ /**
+ * Checks the block-level FO for correct use of the span attribute.
+ * Used by fo:block and fo:block-container.
+ * @param pList the property list to determine if the span is explicit
+ */
+ protected void checkSpanProperty(PropertyList pList) {
+ if (pList.getExplicit(PR_SPAN) != null) {
+ if (!(getParent() instanceof Flow)) {
+ attributeWarning("Ignoring span attribute on " + getName()
+ + " as it's not a direct child of an fo:flow."
+ + " (see XSL 1.0, 7.20.4)");
+ }
+ }
+ }
+
/**
* Returns Out Of Line FO Descendant indicator.
* @return true if Out of Line FO or Out Of Line descendant, false otherwise
diff --git a/src/java/org/apache/fop/fo/flow/Block.java b/src/java/org/apache/fop/fo/flow/Block.java
index a1c03be5a..5c9fcc23d 100644
--- a/src/java/org/apache/fop/fo/flow/Block.java
+++ b/src/java/org/apache/fop/fo/flow/Block.java
@@ -160,6 +160,8 @@ public class Block extends FObjMixed {
whiteSpaceCollapse = pList.get(PR_WHITE_SPACE_COLLAPSE).getEnum();
widows = pList.get(PR_WIDOWS).getNumeric();
wrapOption = pList.get(PR_WRAP_OPTION).getEnum();
+
+ checkSpanProperty(pList);
}
/**
diff --git a/src/java/org/apache/fop/fo/flow/BlockContainer.java b/src/java/org/apache/fop/fo/flow/BlockContainer.java
index c7d1acd5d..4afa50272 100644
--- a/src/java/org/apache/fop/fo/flow/BlockContainer.java
+++ b/src/java/org/apache/fop/fo/flow/BlockContainer.java
@@ -96,6 +96,8 @@ public class BlockContainer extends FObj {
width = pList.get(PR_WIDTH).getLength();
writingMode = pList.get(PR_WRITING_MODE).getEnum();
zIndex = pList.get(PR_Z_INDEX).getNumeric();
+
+ checkSpanProperty(pList);
}
/**