diff options
author | Jeremias Maerki <jeremias@apache.org> | 2006-01-17 11:07:10 +0000 |
---|---|---|
committer | Jeremias Maerki <jeremias@apache.org> | 2006-01-17 11:07:10 +0000 |
commit | c7d04323247a0d75f773c6fbe00cc1d68844a2e5 (patch) | |
tree | 7f1a575839a1e3fa35417ee97652350e0ff3bd4e /test | |
parent | f56c315df5921953702f6ab9c2a331ff7c0caa0f (diff) | |
download | xmlgraphics-fop-c7d04323247a0d75f773c6fbe00cc1d68844a2e5.tar.gz xmlgraphics-fop-c7d04323247a0d75f773c6fbe00cc1d68844a2e5.zip |
New feature: "Intermediate format" (IF). The IF is basically the XML dialect written by the area tree renderer (XMLRenderer). A new parser for this format allows reparsing a serialized and possibly modified area tree and rendering it to the final target format. More details on the Wiki at http://wiki.apache.org/xmlgraphics-fop/AreaTreeIntermediateXml. No advanced features have been implemented, yet, only the basic functionality. The whole change should be fully backwards-compatible WRT the outer FOP API except maybe for FOTreeBuilder.addElementMapping(), and the area tree XML which got small changes.
The area tree has been cleaned up. The serializability has been restored. The CachedRenderPagesModel works again and can, in certain situations, decrease the maximum amount of memory held at one point in time. Some adjustments were necessary in the area tree to help the work of the AreaTreeParser.
The AreaTreeParser is new and is responsible for parsing area tree XML files and adding pages to a RenderPagesModel instance. It is SAX-based and should be pretty efficient.
XMLUnit (http://xmlunit.sourceforge.net, BSD license) is a new dependency for the test code. It is used to verify the correctness of the intermediate format code. It doesn't have to be installed for the build to run through, though.
ElementMapping got a new method getDOMImplementation() which provides the DOMImplementation used to handle a subdocument of a particular namespace. For example, SVG uses Batik's SVG DOM. The AreaTreeParser needs that to properly recreate foreign objects because it can't use the mechanism of the FO tree. The default implementation returns null.
The ElementMapping instances are no longer maintained by the FOTreeBuilder, but by the newly created ElementMappingRegistry class. It is expected that the instance of this class is moved from the FOTreeBuilder and the AreaTreeParser's Handler class to the "environment class" once it is created to cut down on the startup time for each processed document.
The XMLRenderer has been slightly modified to improve the serialization/deserialization qualities of the area tree XML format.
The XMLRenderer can now mimic another renderer (see mimicRenderer(Renderer)) in order to use its font setup. That way it is made certain that the reparsed area tree will render to the final target format exactly as expected.
Fixed a bug in the XMLHandlerRegistry which did not always return the right XMLHandler for every situation.
Added a DefaultErrorListener to the util package. I've had problems with Xalan-J swallowing exceptions with its default ErrorListener, so I added a simple one for convenience and use in AreaTreeParser.
Example code for working with the AreaTreeParser can be found in examples/embedding. Documentation will follow.
git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@369753 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'test')
11 files changed, 478 insertions, 33 deletions
diff --git a/test/java/org/apache/fop/UtilityCodeTestSuite.java b/test/java/org/apache/fop/UtilityCodeTestSuite.java index 719ffa655..86b086c53 100644 --- a/test/java/org/apache/fop/UtilityCodeTestSuite.java +++ b/test/java/org/apache/fop/UtilityCodeTestSuite.java @@ -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. @@ -18,6 +18,8 @@ package org.apache.fop; +import org.apache.fop.traits.BorderPropsTestCase; +import org.apache.fop.traits.TraitColorTestCase; import org.apache.fop.util.ASCII85InputStreamTestCase; import org.apache.fop.util.ASCII85OutputStreamTestCase; import org.apache.fop.util.PDFNumberTestCase; @@ -41,6 +43,8 @@ public class UtilityCodeTestSuite { suite.addTest(new TestSuite(ASCII85OutputStreamTestCase.class)); suite.addTest(new TestSuite(ASCII85InputStreamTestCase.class)); suite.addTest(new TestSuite(PDFNumberTestCase.class)); + suite.addTest(new TestSuite(TraitColorTestCase.class)); + suite.addTest(new TestSuite(BorderPropsTestCase.class)); //$JUnit-END$ return suite; } diff --git a/test/java/org/apache/fop/intermediate/AreaTreeParserTestCase.java b/test/java/org/apache/fop/intermediate/AreaTreeParserTestCase.java new file mode 100644 index 000000000..637966580 --- /dev/null +++ b/test/java/org/apache/fop/intermediate/AreaTreeParserTestCase.java @@ -0,0 +1,241 @@ +/* + * 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$ */ + +package org.apache.fop.intermediate; + +import java.io.BufferedOutputStream; +import java.io.File; +import java.io.FileOutputStream; +import java.io.OutputStream; +import java.net.MalformedURLException; + +import javax.xml.transform.Result; +import javax.xml.transform.Source; +import javax.xml.transform.Templates; +import javax.xml.transform.Transformer; +import javax.xml.transform.TransformerConfigurationException; +import javax.xml.transform.dom.DOMResult; +import javax.xml.transform.dom.DOMSource; +import javax.xml.transform.sax.SAXResult; +import javax.xml.transform.sax.SAXTransformerFactory; +import javax.xml.transform.sax.TransformerHandler; +import javax.xml.transform.stream.StreamResult; +import javax.xml.transform.stream.StreamSource; + +import org.apache.commons.io.IOUtils; +import org.apache.commons.io.output.ByteArrayOutputStream; +import org.apache.fop.apps.FOUserAgent; +import org.apache.fop.apps.Fop; +import org.apache.fop.apps.MimeConstants; +import org.apache.fop.area.AreaTreeModel; +import org.apache.fop.area.AreaTreeParser; +import org.apache.fop.area.RenderPagesModel; +import org.apache.fop.fonts.FontInfo; +import org.apache.fop.render.Renderer; +import org.apache.fop.render.xml.XMLRenderer; + +//XML Unit 1.0: See http://xmlunit.sourceforge.net (BSD-style License) +import org.custommonkey.xmlunit.XMLTestCase; +import org.w3c.dom.Document; + +/** + * Tests the area tree parser. + */ +public class AreaTreeParserTestCase extends XMLTestCase { + + private static SAXTransformerFactory tFactory + = (SAXTransformerFactory)SAXTransformerFactory.newInstance(); + private static Templates stylesheet = null; + + private File mainDir = new File("test/layoutengine"); + private File testDir = new File(mainDir, "standard-testcases"); + + private String name; + private File testFile; + + private File outputDir; + private Document intermediate; + + /** @see junit.framework.TestCase#TestCase(String) */ + public AreaTreeParserTestCase(String name) { + super(name); + } + + /** + * Constructor for the test suite that is used for each test file. + * @param testFile the test file to run + */ + public AreaTreeParserTestCase(File testFile) { + super(testFile.getName()); + this.testFile = testFile; + } + + private Templates getStylesheet() throws TransformerConfigurationException { + if (stylesheet == null) { + File xsltFile = new File(mainDir, "testcase2fo.xsl"); + stylesheet = tFactory.newTemplates(new StreamSource(xsltFile)); + } + return stylesheet; + } + + /** @see junit.framework.TestCase#setUp() */ + protected void setUp() throws Exception { + super.setUp(); + String s = System.getProperty("fop.intermediate.outdir"); + if (s != null && s.length() > 0) { + outputDir = new File(s); + outputDir.mkdirs(); + } + File srcFile; + if (testFile != null) { + srcFile = testFile; + } else { + srcFile = new File(testDir, "block_font-style.xml"); + } + this.name = srcFile.getName(); + intermediate = buildAreaTreeXML(new StreamSource(srcFile), getStylesheet()); + if (outputDir != null) { + saveDOM(intermediate, new File(outputDir, name + ".at1.xml")); + } + } + + + /** + * Tests the area tree parser by running the parsed area tree again through the area tree + * renderer. The source and result documents are compared to each other. + * @throws Exception if the test fails + */ + public void testParserToAT() throws Exception { + + Source src = new DOMSource(intermediate); + Document doc = parseAndRenderToAreaTree(src); + if (outputDir != null) { + File tgtFile = new File(outputDir, name + ".at2.xml"); + saveDOM(doc, tgtFile); + } + + assertXMLEqual(intermediate, doc); + } + + private void saveDOM(Document doc, File tgtFile) throws Exception { + Transformer transformer = tFactory.newTransformer(); + Source src = new DOMSource(doc); + Result res = new StreamResult(tgtFile); + transformer.transform(src, res); + } + + /** + * Tests the area tree parser by sending the parsed area tree to the PDF Renderer. Some + * errors might be caught by the PDFRenderer. + * @throws Exception if the test fails + */ + public void testParserToPDF() throws Exception { + OutputStream out; + if (outputDir != null) { + File tgtFile = new File(outputDir, name + ".pdf"); + out = new FileOutputStream(tgtFile); + out = new BufferedOutputStream(out); + } else { + out = new ByteArrayOutputStream(); + } + try { + Source src = new DOMSource(intermediate); + parseAndRender(src, out, MimeConstants.MIME_PDF); + } finally { + IOUtils.closeQuietly(out); + } + } + + private FOUserAgent createUserAgent() { + FOUserAgent userAgent = new FOUserAgent(); + try { + userAgent.setBaseURL(testDir.toURL().toExternalForm()); + } catch (MalformedURLException e) { + //ignore, won't happen + } + return userAgent; + } + + private Document buildAreaTreeXML(Source src, Templates stylesheet) throws Exception { + Transformer transformer; + if (stylesheet != null) { + transformer = stylesheet.newTransformer(); + } else { + transformer = tFactory.newTransformer(); + } + + //Set up XMLRenderer to render to a DOM + TransformerHandler handler = tFactory.newTransformerHandler(); + DOMResult domResult = new DOMResult(); + handler.setResult(domResult); + + FOUserAgent userAgent = createUserAgent(); + + //Create an instance of the target renderer so the XMLRenderer can use its font setup + Renderer targetRenderer = userAgent.getRendererFactory().createRenderer( + userAgent, MimeConstants.MIME_PDF); + + XMLRenderer renderer = new XMLRenderer(); + renderer.mimicRenderer(targetRenderer); + renderer.setTransformerHandler(handler); + renderer.setUserAgent(userAgent); + + userAgent.setRendererOverride(renderer); + + Fop fop = new Fop(MimeConstants.MIME_FOP_AREA_TREE, userAgent); + Result res = new SAXResult(fop.getDefaultHandler()); + transformer.transform(src, res); + + return (Document)domResult.getNode(); + } + + private void parseAndRender(Source src, OutputStream out, String mime) throws Exception { + AreaTreeParser parser = new AreaTreeParser(); + + FOUserAgent userAgent = createUserAgent(); + FontInfo fontInfo = new FontInfo(); + AreaTreeModel treeModel = new RenderPagesModel(userAgent, + mime, fontInfo, out); + parser.parse(src, treeModel, userAgent); + treeModel.endDocument(); + } + + private Document parseAndRenderToAreaTree(Source src) throws Exception { + AreaTreeParser parser = new AreaTreeParser(); + + //Set up XMLRenderer to render to a DOM + TransformerHandler handler = tFactory.newTransformerHandler(); + DOMResult domResult = new DOMResult(); + handler.setResult(domResult); + XMLRenderer renderer = new XMLRenderer(); + renderer.setTransformerHandler(handler); + + FOUserAgent userAgent = createUserAgent(); + userAgent.setRendererOverride(renderer); + renderer.setUserAgent(userAgent); + + FontInfo fontInfo = new FontInfo(); + AreaTreeModel treeModel = new RenderPagesModel(userAgent, + MimeConstants.MIME_FOP_AREA_TREE, fontInfo, null); + parser.parse(src, treeModel, userAgent); + treeModel.endDocument(); + + return (Document)domResult.getNode(); + } + +} diff --git a/test/java/org/apache/fop/intermediate/IntermediateFormatTestSuite.java b/test/java/org/apache/fop/intermediate/IntermediateFormatTestSuite.java new file mode 100644 index 000000000..77ade702c --- /dev/null +++ b/test/java/org/apache/fop/intermediate/IntermediateFormatTestSuite.java @@ -0,0 +1,66 @@ +/* + * 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$ */ + +package org.apache.fop.intermediate; + +import java.io.File; +import java.io.IOException; +import java.util.Collection; +import java.util.Iterator; + +import junit.framework.Test; +import junit.framework.TestSuite; + +import org.apache.fop.layoutengine.LayoutEngineTestSuite; + +/** + * JUnit test suite for the intermediate format + */ +public class IntermediateFormatTestSuite { + + /** + * @return the test suite with all the tests (one for each XML file) + * @throws IOException in case of an I/O problem + */ + public static Test suite() throws IOException { + TestSuite suite = new TestSuite(); + + Collection files = LayoutEngineTestSuite.getTestFiles(); + + Iterator i = files.iterator(); + while (i.hasNext()) { + File f = (File)i.next(); + addTestCase(suite, f); + } + + return suite; + } + + private static void addTestCase(TestSuite suite, + final File f) { + suite.addTest(new AreaTreeParserTestCase(f) { + public void runTest() throws Exception { + org.apache.commons.logging.LogFactory.getLog( + this.getClass()).info("Starting " + f.getName()); + testParserToAT(); + testParserToPDF(); + } + }); + } + +} diff --git a/test/java/org/apache/fop/layoutengine/LayoutEngineTestSuite.java b/test/java/org/apache/fop/layoutengine/LayoutEngineTestSuite.java index f90d9f8e7..12e6834f8 100644 --- a/test/java/org/apache/fop/layoutengine/LayoutEngineTestSuite.java +++ b/test/java/org/apache/fop/layoutengine/LayoutEngineTestSuite.java @@ -1,5 +1,5 @@ /* - * Copyright 2005 The Apache Software Foundation. + * 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. @@ -18,11 +18,8 @@ package org.apache.fop.layoutengine; -import java.io.BufferedReader; import java.io.File; -import java.io.FileReader; import java.io.IOException; -import java.io.Reader; import java.util.Collection; import java.util.Iterator; import java.util.List; @@ -129,18 +126,11 @@ public class LayoutEngineTestSuite { } /** - * @return the test suite with all the tests (one for each XML file) - * @throws IOException in case of an I/O problem + * @return a Collection of File instances containing all the test cases set up for processing. + * @throws IOException if there's a problem gathering the list of test files */ - public static Test suite() throws IOException { - TestSuite suite = new TestSuite(); - + public static Collection getTestFiles() throws IOException { File mainDir = new File("test/layoutengine"); - File backupDir = new File("build/test-results/layoutengine"); - backupDir.mkdirs(); - - final LayoutEngineTester tester = new LayoutEngineTester(backupDir); - IOFileFilter filter; String single = System.getProperty("fop.layoutengine.single"); String startsWith = System.getProperty("fop.layoutengine.starts-with"); @@ -166,6 +156,22 @@ public class LayoutEngineTestSuite { filter, TrueFileFilter.INSTANCE); files.addAll(privateFiles); } + return files; + } + + /** + * @return the test suite with all the tests (one for each XML file) + * @throws IOException in case of an I/O problem + */ + public static Test suite() throws IOException { + TestSuite suite = new TestSuite(); + + File backupDir = new File("build/test-results/layoutengine"); + backupDir.mkdirs(); + + Collection files = getTestFiles(); + + final LayoutEngineTester tester = new LayoutEngineTester(backupDir); Iterator i = files.iterator(); while (i.hasNext()) { File f = (File)i.next(); diff --git a/test/java/org/apache/fop/traits/BorderPropsTestCase.java b/test/java/org/apache/fop/traits/BorderPropsTestCase.java new file mode 100644 index 000000000..17cbcb22e --- /dev/null +++ b/test/java/org/apache/fop/traits/BorderPropsTestCase.java @@ -0,0 +1,53 @@ +/* + * 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$ */ + +package org.apache.fop.traits; + +import org.apache.fop.area.Trait; +import org.apache.fop.fo.Constants; + +import junit.framework.TestCase; + +/** + * Tests the BorderProps class. + */ +public class BorderPropsTestCase extends TestCase { + + /** + * Test serialization and deserialization to/from String. + * @throws Exception if an error occurs + */ + public void testSerialization() throws Exception { + Trait.Color col = new Trait.Color(1.0f, 1.0f, 0.5f, 1.0f); + //Normalize: Avoid false alarms due to color conversion (rounding) + col = Trait.Color.valueOf(col.toString()); + + BorderProps b1 = new BorderProps(Constants.EN_DOUBLE, 1250, + col, BorderProps.COLLAPSE_OUTER); + String ser = b1.toString(); + BorderProps b2 = BorderProps.valueOf(ser); + assertEquals(b1, b2); + + b1 = new BorderProps(Constants.EN_INSET, 9999, + col, BorderProps.SEPARATE); + ser = b1.toString(); + b2 = BorderProps.valueOf(ser); + assertEquals(b1, b2); + } + +} diff --git a/test/java/org/apache/fop/traits/TraitColorTestCase.java b/test/java/org/apache/fop/traits/TraitColorTestCase.java new file mode 100644 index 000000000..4df691f8d --- /dev/null +++ b/test/java/org/apache/fop/traits/TraitColorTestCase.java @@ -0,0 +1,75 @@ +/* + * 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$ */ + +package org.apache.fop.traits; + +import org.apache.fop.area.Trait; + +import junit.framework.TestCase; + +/** + * Tests the Trait.Color class. + */ +public class TraitColorTestCase extends TestCase { + + /** + * Test serialization to String. + * @throws Exception if an error occurs + */ + public void testSerialization() throws Exception { + Trait.Color col = new Trait.Color(1.0f, 1.0f, 0.5f, 1.0f); + String s = col.toString(); + assertEquals("#ffff7f", s); + + col = new Trait.Color(1.0f, 0.0f, 0.0f, 0.8f); + s = col.toString(); + assertEquals("#ff0000cc", s); + } + + /** + * Test deserialization from String. + * @throws Exception if an error occurs + */ + public void testDeserialization() throws Exception { + float tolerance = 0.5f / 255; //due to color value conversion + + Trait.Color col = Trait.Color.valueOf("#ffff7f"); + assertEquals(1.0f, col.getRed(), 0.0f); + assertEquals(1.0f, col.getGreen(), 0.0f); + assertEquals(0.5f, col.getBlue(), tolerance); + assertEquals(1.0f, col.getAlpha(), 0.0f); + + col = Trait.Color.valueOf("#ff0000cc"); + assertEquals(1.0f, col.getRed(), 0.0f); + assertEquals(0.0f, col.getGreen(), 0.0f); + assertEquals(0.0f, col.getBlue(), 0.0f); + assertEquals(0.8f, col.getAlpha(), tolerance); + } + + /** + * Test equals(). + * @throws Exception if an error occurs + */ + public void testEquals() throws Exception { + Trait.Color col1 = Trait.Color.valueOf("#ff0000cc"); + Trait.Color col2 = Trait.Color.valueOf("#ff0000cc"); + assertTrue(col1 != col2); + assertEquals(col1, col2); + } + +} diff --git a/test/layoutengine/standard-testcases/external-graphic_border_padding.xml b/test/layoutengine/standard-testcases/external-graphic_border_padding.xml index a05c367b9..a91722b74 100644 --- a/test/layoutengine/standard-testcases/external-graphic_border_padding.xml +++ b/test/layoutengine/standard-testcases/external-graphic_border_padding.xml @@ -60,7 +60,7 @@ <eval expected="10000" xpath="//flow/block[1]/lineArea/viewport/@padding-after"/> <eval expected="5000" xpath="//flow/block[1]/lineArea/viewport/@padding-start"/> <eval expected="20000" xpath="//flow/block[1]/lineArea/viewport/@padding-end"/> - <eval expected="20000 20000 46080 46080" xpath="//flow/block[1]/lineArea/viewport/image/@pos"/> + <eval expected="20000 20000 46080 46080" xpath="//flow/block[1]/lineArea/viewport/@pos"/> <!-- second e-g --> <eval expected="46080" xpath="//flow/block[2]/lineArea/viewport/@ipd"/> <eval expected="46080" xpath="//flow/block[2]/lineArea/viewport/@bpd"/> @@ -76,6 +76,6 @@ <eval expected="10000" xpath="//flow/block[2]/lineArea/viewport/@padding-after"/> <eval expected="5000" xpath="//flow/block[2]/lineArea/viewport/@padding-start"/> <eval expected="20000" xpath="//flow/block[2]/lineArea/viewport/@padding-end"/> - <eval expected="20000 20000 46080 46080" xpath="//flow/block[2]/lineArea/viewport/image/@pos"/> + <eval expected="20000 20000 46080 46080" xpath="//flow/block[2]/lineArea/viewport/@pos"/> </checks> </testcase> diff --git a/test/layoutengine/standard-testcases/external-graphic_display-align.xml b/test/layoutengine/standard-testcases/external-graphic_display-align.xml index 76d74b791..4a8d7eb9c 100644 --- a/test/layoutengine/standard-testcases/external-graphic_display-align.xml +++ b/test/layoutengine/standard-testcases/external-graphic_display-align.xml @@ -60,26 +60,26 @@ <eval expected="46080" xpath="//flow/block[2]/lineArea/viewport/@ipda"/> <eval expected="60000" xpath="//flow/block[2]/lineArea/viewport/@bpd"/> <eval expected="60000" xpath="//flow/block[2]/lineArea/viewport/@bpda"/> - <eval expected="0 0 46080 46080" xpath="//flow/block[2]/lineArea/viewport/image/@pos"/> + <eval expected="0 0 46080 46080" xpath="//flow/block[2]/lineArea/viewport/@pos"/> <eval expected="46080" xpath="//flow/block[4]/lineArea/viewport/@ipd"/> <eval expected="46080" xpath="//flow/block[4]/lineArea/viewport/@ipda"/> <eval expected="60000" xpath="//flow/block[4]/lineArea/viewport/@bpd"/> <eval expected="60000" xpath="//flow/block[4]/lineArea/viewport/@bpda"/> - <eval expected="0 0 46080 46080" xpath="//flow/block[4]/lineArea/viewport/image/@pos"/> + <eval expected="0 0 46080 46080" xpath="//flow/block[4]/lineArea/viewport/@pos"/> <eval expected="46080" xpath="//flow/block[6]/lineArea/viewport/@ipd"/> <eval expected="46080" xpath="//flow/block[6]/lineArea/viewport/@ipda"/> <eval expected="60000" xpath="//flow/block[6]/lineArea/viewport/@bpd"/> <eval expected="60000" xpath="//flow/block[6]/lineArea/viewport/@bpda"/> - <eval expected="0 0 46080 46080" xpath="//flow/block[6]/lineArea/viewport/image/@pos"/> + <eval expected="0 0 46080 46080" xpath="//flow/block[6]/lineArea/viewport/@pos"/> <eval expected="46080" xpath="//flow/block[8]/lineArea/viewport/@ipd"/> <eval expected="46080" xpath="//flow/block[8]/lineArea/viewport/@ipda"/> <eval expected="60000" xpath="//flow/block[8]/lineArea/viewport/@bpd"/> <eval expected="60000" xpath="//flow/block[8]/lineArea/viewport/@bpda"/> - <eval expected="0 6960 46080 46080" xpath="//flow/block[8]/lineArea/viewport/image/@pos"/> + <eval expected="0 6960 46080 46080" xpath="//flow/block[8]/lineArea/viewport/@pos"/> <eval expected="46080" xpath="//flow/block[10]/lineArea/viewport/@ipd"/> <eval expected="46080" xpath="//flow/block[10]/lineArea/viewport/@ipda"/> <eval expected="60000" xpath="//flow/block[10]/lineArea/viewport/@bpd"/> <eval expected="60000" xpath="//flow/block[10]/lineArea/viewport/@bpda"/> - <eval expected="0 13920 46080 46080" xpath="//flow/block[10]/lineArea/viewport/image/@pos"/> + <eval expected="0 13920 46080 46080" xpath="//flow/block[10]/lineArea/viewport/@pos"/> </checks> </testcase> diff --git a/test/layoutengine/standard-testcases/external-graphic_svg.xml b/test/layoutengine/standard-testcases/external-graphic_svg.xml index 5f13dc313..6c60296b1 100644 --- a/test/layoutengine/standard-testcases/external-graphic_svg.xml +++ b/test/layoutengine/standard-testcases/external-graphic_svg.xml @@ -56,19 +56,19 @@ <eval expected="144000" xpath="//flow/block[2]/lineArea/viewport/@ipda"/>
<eval expected="144000" xpath="//flow/block[2]/lineArea/viewport/@bpd"/>
<eval expected="144000" xpath="//flow/block[2]/lineArea/viewport/@bpda"/>
- <eval expected="0 0 144000 144000" xpath="//flow/block[2]/lineArea/viewport/image/@pos"/>
+ <eval expected="0 0 144000 144000" xpath="//flow/block[2]/lineArea/viewport/@pos"/>
<eval expected="288000" xpath="//flow/block[4]/lineArea/viewport/@ipd"/>
<eval expected="288000" xpath="//flow/block[4]/lineArea/viewport/@ipda"/>
<eval expected="288000" xpath="//flow/block[4]/lineArea/viewport/@bpd"/>
<eval expected="288000" xpath="//flow/block[4]/lineArea/viewport/@bpda"/>
- <eval expected="0 0 288000 288000" xpath="//flow/block[4]/lineArea/viewport/image/@pos"/>
+ <eval expected="0 0 288000 288000" xpath="//flow/block[4]/lineArea/viewport/@pos"/>
<eval expected="432000" xpath="//flow/block[6]/lineArea/viewport/@ipd"/>
<eval expected="432000" xpath="//flow/block[6]/lineArea/viewport/@ipda"/>
<eval expected="288000" xpath="//flow/block[6]/lineArea/viewport/@bpd"/>
<eval expected="288000" xpath="//flow/block[6]/lineArea/viewport/@bpda"/>
- <eval expected="0 0 432000 288000" xpath="//flow/block[6]/lineArea/viewport/image/@pos"/>
+ <eval expected="0 0 432000 288000" xpath="//flow/block[6]/lineArea/viewport/@pos"/>
<!-- TODO: This evaluates nicely to 16000mpt with 72dpi in the FOUserAgent but will result
in 16080 for 300dpi which is caused by rounding errors because pixels are used internally. -->
@@ -76,6 +76,6 @@ <eval expected="16000" xpath="//flow/block[8]/lineArea/viewport/@ipda"/>
<eval expected="16000" xpath="//flow/block[8]/lineArea/viewport/@bpd"/>
<eval expected="16000" xpath="//flow/block[8]/lineArea/viewport/@bpda"/>
- <eval expected="0 0 16000 16000" xpath="//flow/block[8]/lineArea/viewport/image/@pos"/>
+ <eval expected="0 0 16000 16000" xpath="//flow/block[8]/lineArea/viewport/@pos"/>
</checks>
</testcase>
diff --git a/test/layoutengine/standard-testcases/instream-foreign-object_border_padding.xml b/test/layoutengine/standard-testcases/instream-foreign-object_border_padding.xml index 16d89eb22..aadcb4bf9 100644 --- a/test/layoutengine/standard-testcases/instream-foreign-object_border_padding.xml +++ b/test/layoutengine/standard-testcases/instream-foreign-object_border_padding.xml @@ -74,7 +74,7 @@ <eval expected="10000" xpath="//flow/block[1]/lineArea/viewport/@padding-after"/> <eval expected="5000" xpath="//flow/block[1]/lineArea/viewport/@padding-start"/> <eval expected="20000" xpath="//flow/block[1]/lineArea/viewport/@padding-end"/> - <eval expected="20000 20000 20000 20000" xpath="//flow/block[1]/lineArea/viewport/foreignObject/@pos"/> + <eval expected="20000 20000 20000 20000" xpath="//flow/block[1]/lineArea/viewport/@pos"/> <!-- second i-f-o --> <eval expected="20000" xpath="//flow/block[2]/lineArea/viewport/@ipd"/> <eval expected="20000" xpath="//flow/block[2]/lineArea/viewport/@bpd"/> @@ -90,6 +90,6 @@ <eval expected="10000" xpath="//flow/block[2]/lineArea/viewport/@padding-after"/> <eval expected="5000" xpath="//flow/block[2]/lineArea/viewport/@padding-start"/> <eval expected="20000" xpath="//flow/block[2]/lineArea/viewport/@padding-end"/> - <eval expected="20000 20000 20000 20000" xpath="//flow/block[2]/lineArea/viewport/foreignObject/@pos"/> + <eval expected="20000 20000 20000 20000" xpath="//flow/block[2]/lineArea/viewport/@pos"/> </checks> </testcase> diff --git a/test/layoutengine/standard-testcases/instream-foreign-object_display-align.xml b/test/layoutengine/standard-testcases/instream-foreign-object_display-align.xml index a113ccc54..758c0f676 100644 --- a/test/layoutengine/standard-testcases/instream-foreign-object_display-align.xml +++ b/test/layoutengine/standard-testcases/instream-foreign-object_display-align.xml @@ -95,26 +95,26 @@ <eval expected="20000" xpath="//flow/block[2]/lineArea/viewport/@ipda"/> <eval expected="30000" xpath="//flow/block[2]/lineArea/viewport/@bpd"/> <eval expected="30000" xpath="//flow/block[2]/lineArea/viewport/@bpda"/> - <eval expected="0 0 20000 20000" xpath="//flow/block[2]/lineArea/viewport/foreignObject/@pos"/> + <eval expected="0 0 20000 20000" xpath="//flow/block[2]/lineArea/viewport/@pos"/> <eval expected="20000" xpath="//flow/block[4]/lineArea/viewport/@ipd"/> <eval expected="20000" xpath="//flow/block[4]/lineArea/viewport/@ipda"/> <eval expected="30000" xpath="//flow/block[4]/lineArea/viewport/@bpd"/> <eval expected="30000" xpath="//flow/block[4]/lineArea/viewport/@bpda"/> - <eval expected="0 0 20000 20000" xpath="//flow/block[4]/lineArea/viewport/foreignObject/@pos"/> + <eval expected="0 0 20000 20000" xpath="//flow/block[4]/lineArea/viewport/@pos"/> <eval expected="20000" xpath="//flow/block[6]/lineArea/viewport/@ipd"/> <eval expected="20000" xpath="//flow/block[6]/lineArea/viewport/@ipda"/> <eval expected="30000" xpath="//flow/block[6]/lineArea/viewport/@bpd"/> <eval expected="30000" xpath="//flow/block[6]/lineArea/viewport/@bpda"/> - <eval expected="0 0 20000 20000" xpath="//flow/block[6]/lineArea/viewport/foreignObject/@pos"/> + <eval expected="0 0 20000 20000" xpath="//flow/block[6]/lineArea/viewport/@pos"/> <eval expected="20000" xpath="//flow/block[8]/lineArea/viewport/@ipd"/> <eval expected="20000" xpath="//flow/block[8]/lineArea/viewport/@ipda"/> <eval expected="30000" xpath="//flow/block[8]/lineArea/viewport/@bpd"/> <eval expected="30000" xpath="//flow/block[8]/lineArea/viewport/@bpda"/> - <eval expected="0 5000 20000 20000" xpath="//flow/block[8]/lineArea/viewport/foreignObject/@pos"/> + <eval expected="0 5000 20000 20000" xpath="//flow/block[8]/lineArea/viewport/@pos"/> <eval expected="20000" xpath="//flow/block[10]/lineArea/viewport/@ipd"/> <eval expected="20000" xpath="//flow/block[10]/lineArea/viewport/@ipda"/> <eval expected="30000" xpath="//flow/block[10]/lineArea/viewport/@bpd"/> <eval expected="30000" xpath="//flow/block[10]/lineArea/viewport/@bpda"/> - <eval expected="0 10000 20000 20000" xpath="//flow/block[10]/lineArea/viewport/foreignObject/@pos"/> + <eval expected="0 10000 20000 20000" xpath="//flow/block[10]/lineArea/viewport/@pos"/> </checks> </testcase> |