aboutsummaryrefslogtreecommitdiffstats
path: root/test/layoutengine
diff options
context:
space:
mode:
authorJeremias Maerki <jeremias@apache.org>2008-02-06 14:07:03 +0000
committerJeremias Maerki <jeremias@apache.org>2008-02-06 14:07:03 +0000
commit448befc115b005dc2a07391182179c686a91d25f (patch)
treeb658d79ef2bbd433580a089758d5ecb945c52166 /test/layoutengine
parent36c62fb27612261f81eb8de02f1754a3d662cea4 (diff)
downloadxmlgraphics-fop-448befc115b005dc2a07391182179c686a91d25f.tar.gz
xmlgraphics-fop-448befc115b005dc2a07391182179c686a91d25f.zip
Bugzilla #36391:
Fixed problem with positioning of content when reference-orientation="180" is used. CTM is now correct. It is updated after the height of the content is known. Instead of somehow inverting the element list, I've simply declared this case non-breakable, i.e. I generate one box. Fixed a few other problems mostly occurring when rotating block-container content by 90 or 270 degrees plus a few remaining auto-height handling problems. This involved switching off some sometimes unwanted side-effects from auto-updating the BPD in some area classes. git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@618992 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'test/layoutengine')
-rw-r--r--test/layoutengine/disabled-testcases.xml7
-rw-r--r--test/layoutengine/standard-testcases/block-container_absolute-position_display-align.xml2
-rw-r--r--test/layoutengine/standard-testcases/block-container_absolute-position_no-height_2.xml84
-rw-r--r--test/layoutengine/standard-testcases/block-container_reference-orientation_2.xml91
-rw-r--r--test/layoutengine/standard-testcases/block-container_reference-orientation_bug36391.xml7
5 files changed, 179 insertions, 12 deletions
diff --git a/test/layoutengine/disabled-testcases.xml b/test/layoutengine/disabled-testcases.xml
index 5f5672ae7..15ac8aa48 100644
--- a/test/layoutengine/disabled-testcases.xml
+++ b/test/layoutengine/disabled-testcases.xml
@@ -27,13 +27,6 @@
nominal line.</description>
</testcase>
<testcase>
- <name>Bugzilla #36391: reference-orientation</name>
- <file>block-container_reference-orientation_bug36391.xml</file>
- <description>There's a problem involving nested block-containers
- and reference-orientation 180/-180.</description>
- <reference>http://issues.apache.org/bugzilla/show_bug.cgi?id=36391</reference>
- </testcase>
- <testcase>
<name>Auto-height block-containers produce fences</name>
<file>block-container_space-before_space-after_3.xml</file>
<description>Block-containers with no height currently don't
diff --git a/test/layoutengine/standard-testcases/block-container_absolute-position_display-align.xml b/test/layoutengine/standard-testcases/block-container_absolute-position_display-align.xml
index 667d2a37c..42aaee529 100644
--- a/test/layoutengine/standard-testcases/block-container_absolute-position_display-align.xml
+++ b/test/layoutengine/standard-testcases/block-container_absolute-position_display-align.xml
@@ -56,6 +56,8 @@
</fo:root>
</fo>
<checks>
+ <eval expected="0" xpath="//flow/@bpd"/> <!-- all blocks are absolutely positioned -->
+
<!-- first block-container -->
<true xpath="/areaTree/pageSequence/pageViewport/page[1]/regionViewport/regionBody/mainReference/span/flow/block[1]/@is-viewport-area"/>
<eval expected="[1.0 0.0 0.0 1.0 0.0 0.0]" xpath="/areaTree/pageSequence/pageViewport/page[1]/regionViewport/regionBody/mainReference/span/flow/block[1]/@ctm"/>
diff --git a/test/layoutengine/standard-testcases/block-container_absolute-position_no-height_2.xml b/test/layoutengine/standard-testcases/block-container_absolute-position_no-height_2.xml
new file mode 100644
index 000000000..3c987fec8
--- /dev/null
+++ b/test/layoutengine/standard-testcases/block-container_absolute-position_no-height_2.xml
@@ -0,0 +1,84 @@
+<?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 absolutely positioned block-containers where the content-bpd isn't specified.
+ </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="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-container id="bc0" width="80pt" absolute-position="absolute" left="10pt" top="10pt" overflow="visible"
+ reference-orientation="0" background-color="lightgray">
+ <fo:block>ABC</fo:block>
+ <fo:block font-size="200%">ABC</fo:block>
+ </fo:block-container>
+ <fo:block-container id="bc90" width="80pt" absolute-position="absolute" left="10pt" top="120pt" overflow="visible"
+ reference-orientation="90" background-color="lightgray">
+ <fo:block>ABC</fo:block>
+ <fo:block font-size="200%">ABC</fo:block>
+ </fo:block-container>
+ <fo:block-container id="bc180" width="80pt" absolute-position="absolute" left="120pt" top="10pt" overflow="visible"
+ reference-orientation="180" background-color="lightgray">
+ <fo:block>ABC</fo:block>
+ <fo:block font-size="200%">ABC</fo:block>
+ </fo:block-container>
+ <fo:block-container id="bc270" width="80pt" absolute-position="absolute" left="120pt" top="240pt" overflow="visible"
+ reference-orientation="270" background-color="lightgray">
+ <fo:block>ABC</fo:block>
+ <fo:block font-size="200%">ABC</fo:block>
+ </fo:block-container>
+ </fo:flow>
+ </fo:page-sequence>
+ </fo:root>
+ </fo>
+ <checks>
+ <!-- 0 -->
+ <eval expected="80000" xpath="//block[@prod-id='bc0' and boolean(@is-viewport-area)]/@ipd"/>
+ <eval expected="43200" xpath="//block[@prod-id='bc0' and boolean(@is-viewport-area)]/@bpd"/>
+ <eval expected="80000" xpath="//block[@prod-id='bc0' and boolean(@is-reference-area)]/@ipd"/>
+ <eval expected="43200" xpath="//block[@prod-id='bc0' and boolean(@is-reference-area)]/@bpd"/>
+ <eval expected="[1.0 0.0 0.0 1.0 0.0 0.0]" xpath="//block[@prod-id='bc0' and boolean(@is-viewport-area)]/@ctm"/>
+ <!-- 90 -->
+ <eval expected="43200" xpath="//block[@prod-id='bc90' and boolean(@is-viewport-area)]/@ipd"/>
+ <eval expected="80000" xpath="//block[@prod-id='bc90' and boolean(@is-viewport-area)]/@bpd"/>
+ <eval expected="80000" xpath="//block[@prod-id='bc90' and boolean(@is-reference-area)]/@ipd"/>
+ <eval expected="43200" xpath="//block[@prod-id='bc90' and boolean(@is-reference-area)]/@bpd"/>
+ <eval expected="[0.0 -1.0 1.0 0.0 0.0 80000.0]" xpath="//block[@prod-id='bc90' and boolean(@is-viewport-area)]/@ctm"/>
+ <!-- 180 -->
+ <eval expected="80000" xpath="//block[@prod-id='bc180' and boolean(@is-viewport-area)]/@ipd"/>
+ <eval expected="43200" xpath="//block[@prod-id='bc180' and boolean(@is-viewport-area)]/@bpd"/>
+ <eval expected="80000" xpath="//block[@prod-id='bc180' and boolean(@is-reference-area)]/@ipd"/>
+ <eval expected="43200" xpath="//block[@prod-id='bc180' and boolean(@is-reference-area)]/@bpd"/>
+ <eval expected="[-1.0 -0.0 0.0 -1.0 80000.0 43200.0]" xpath="//block[@prod-id='bc180' and boolean(@is-viewport-area)]/@ctm"/>
+ <!-- 270 -->
+ <eval expected="43200" xpath="//block[@prod-id='bc270' and boolean(@is-viewport-area)]/@ipd"/>
+ <eval expected="80000" xpath="//block[@prod-id='bc270' and boolean(@is-viewport-area)]/@bpd"/>
+ <eval expected="80000" xpath="//block[@prod-id='bc270' and boolean(@is-reference-area)]/@ipd"/>
+ <eval expected="43200" xpath="//block[@prod-id='bc270' and boolean(@is-reference-area)]/@bpd"/>
+ <eval expected="[0.0 1.0 -1.0 0.0 43200.0 0.0]" xpath="//block[@prod-id='bc270' and boolean(@is-viewport-area)]/@ctm"/>
+ </checks>
+</testcase>
diff --git a/test/layoutengine/standard-testcases/block-container_reference-orientation_2.xml b/test/layoutengine/standard-testcases/block-container_reference-orientation_2.xml
new file mode 100644
index 000000000..60400410d
--- /dev/null
+++ b/test/layoutengine/standard-testcases/block-container_reference-orientation_2.xml
@@ -0,0 +1,91 @@
+<?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 the element lists of in-flow block-containers with reference orientation.
+ </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="5in" page-height="5in">
+ <fo:region-body/>
+ </fo:simple-page-master>
+ </fo:layout-master-set>
+ <fo:page-sequence id="bc0" master-reference="normal">
+ <fo:flow flow-name="xsl-region-body">
+ <fo:block-container width="60pt" reference-orientation="0">
+ <fo:block>ABC</fo:block>
+ <fo:block font-size="200%">ABC</fo:block>
+ </fo:block-container>
+ <fo:block>EOPS</fo:block>
+ </fo:flow>
+ </fo:page-sequence>
+ <fo:page-sequence id="bc90" master-reference="normal">
+ <fo:flow flow-name="xsl-region-body">
+ <fo:block-container width="60pt" reference-orientation="90">
+ <fo:block>ABC</fo:block>
+ <fo:block font-size="200%">ABC</fo:block>
+ </fo:block-container>
+ <fo:block>EOPS</fo:block>
+ </fo:flow>
+ </fo:page-sequence>
+ <fo:page-sequence id="bc180" master-reference="normal">
+ <fo:flow flow-name="xsl-region-body">
+ <fo:block-container width="60pt" reference-orientation="180" background-color="yellow">
+ <fo:block>ABC</fo:block>
+ <fo:block font-size="200%">ABC</fo:block>
+ </fo:block-container>
+ <fo:block>EOPS</fo:block>
+ </fo:flow>
+ </fo:page-sequence>
+ </fo:root>
+ </fo>
+ <checks>
+ <element-list category="breaker" id="bc0">
+ <!-- content is inlined -->
+ <box w="14400"/>
+ <penalty w="0" p="0"/>
+ <box w="28800"/>
+ <penalty w="0" p="0"/>
+ <box w="14400"/>
+
+ <skip>3</skip>
+ </element-list>
+ <element-list category="breaker" id="bc90">
+ <!-- one box with the length of the rotated content-width -->
+ <box w="60000"/>
+ <penalty w="0" p="0"/>
+ <box w="14400"/>
+
+ <skip>3</skip>
+ </element-list>
+ <element-list category="breaker" id="bc180">
+ <!-- one box with the length of the effective content-height (auto-heigth) -->
+ <!-- Maybe the element list could be reversed somehow so the b-c can still be broken
+ correctly, even if ref-or="180". But we leave that be for the time being. -->
+ <box w="43200"/>
+ <penalty w="0" p="0"/>
+ <box w="14400"/>
+
+ <skip>3</skip>
+ </element-list>
+ </checks>
+</testcase>
diff --git a/test/layoutengine/standard-testcases/block-container_reference-orientation_bug36391.xml b/test/layoutengine/standard-testcases/block-container_reference-orientation_bug36391.xml
index 615fb28e1..7b1bfc793 100644
--- a/test/layoutengine/standard-testcases/block-container_reference-orientation_bug36391.xml
+++ b/test/layoutengine/standard-testcases/block-container_reference-orientation_bug36391.xml
@@ -90,13 +90,10 @@
<eval expected="[0.0 -1.0 1.0 0.0 0.0 31000.0]" xpath="//mainReference/span/flow[1]/block[6]/block[1]/block[1]/@ctm"/>
<!-- 180 -->
<eval expected="[1.0 0.0 0.0 1.0 0.0 1000.0]" xpath="//mainReference/span/flow[2]/block[2]/@ctm"/>
- <!-- The following currently fails since the BCLM doesn't check the effective content BPD.
- Another problem could probably arise if a BC with this ref-orientation is broken at the page end.
- I'm pretty sure the element list is wrong in this case. It would need to be reversed I think. -->
- <eval expected="[-1.0 -0.0 0.0 -1.0 30000.0 14400.0]" xpath="//mainReference/span/flow[2]/block[2]/block[1]/block[1]/@ctm"/>
+ <eval expected="[-1.0 -0.0 0.0 -1.0 30000.0 15400.0]" xpath="//mainReference/span/flow[2]/block[2]/block[1]/block[1]/@ctm"/>
<!-- -180 -->
<eval expected="[1.0 0.0 0.0 1.0 0.0 1000.0]" xpath="//mainReference/span/flow[2]/block[4]/@ctm"/>
- <eval expected="[-1.0 -0.0 0.0 -1.0 30000.0 14400.0]" xpath="//mainReference/span/flow[2]/block[4]/block[1]/block[1]/@ctm"/>
+ <eval expected="[-1.0 -0.0 0.0 -1.0 30000.0 15400.0]" xpath="//mainReference/span/flow[2]/block[4]/block[1]/block[1]/@ctm"/>
<!-- 270 -->
<eval expected="[1.0 0.0 0.0 1.0 0.0 1000.0]" xpath="//mainReference/span/flow[2]/block[6]/@ctm"/>
<eval expected="[0.0 1.0 -1.0 0.0 90000.0 1000.0]" xpath="//mainReference/span/flow[2]/block[6]/block[1]/block[1]/@ctm"/>