aboutsummaryrefslogtreecommitdiffstats
path: root/test/layoutengine/standard-testcases
diff options
context:
space:
mode:
Diffstat (limited to 'test/layoutengine/standard-testcases')
-rw-r--r--test/layoutengine/standard-testcases/inline-container_alignment-adjust.xml244
-rw-r--r--test/layoutengine/standard-testcases/inline-container_alignment-baseline.xml74
-rw-r--r--test/layoutengine/standard-testcases/inline-container_alignment.xml154
-rw-r--r--test/layoutengine/standard-testcases/inline-container_basic.xml56
-rw-r--r--test/layoutengine/standard-testcases/inline-container_block_nested.xml65
-rw-r--r--test/layoutengine/standard-testcases/inline-container_bpd.xml72
-rw-r--r--test/layoutengine/standard-testcases/inline-container_dominant-baseline.xml74
-rw-r--r--test/layoutengine/standard-testcases/inline-container_ipd-auto.xml66
-rw-r--r--test/layoutengine/standard-testcases/inline-container_ipd-percent.xml61
-rw-r--r--test/layoutengine/standard-testcases/inline-container_keeps.xml49
10 files changed, 850 insertions, 65 deletions
diff --git a/test/layoutengine/standard-testcases/inline-container_alignment-adjust.xml b/test/layoutengine/standard-testcases/inline-container_alignment-adjust.xml
new file mode 100644
index 000000000..3e696a696
--- /dev/null
+++ b/test/layoutengine/standard-testcases/inline-container_alignment-adjust.xml
@@ -0,0 +1,244 @@
+<?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>
+ Checks that the alignment-adjust property on inline-container behaves properly.
+ </p>
+ </info>
+ <fo>
+ <fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format">
+ <fo:layout-master-set>
+ <fo:simple-page-master master-name="page"
+ page-height="170pt" page-width="220pt" margin="10pt">
+ <fo:region-body/>
+ </fo:simple-page-master>
+ </fo:layout-master-set>
+
+ <fo:page-sequence master-reference="page">
+ <fo:flow flow-name="xsl-region-body">
+ <fo:block space-after="10pt">alignment-adjust="before-edge":</fo:block>
+ <fo:block>The line before. The line before. Before: <fo:inline-container width="100pt"
+ alignment-adjust="before-edge">
+ <fo:block>Inside the inline-container.</fo:block>
+ </fo:inline-container> After the inline-container.</fo:block>
+ </fo:flow>
+ </fo:page-sequence>
+
+ <fo:page-sequence master-reference="page">
+ <fo:flow flow-name="xsl-region-body">
+ <fo:block space-after="10pt">alignment-adjust="text-before-edge":</fo:block>
+ <fo:block>The line before. The line before. Before: <fo:inline-container width="100pt"
+ alignment-adjust="text-before-edge">
+ <fo:block>Inside the inline-container.</fo:block>
+ </fo:inline-container> After the inline-container.</fo:block>
+ </fo:flow>
+ </fo:page-sequence>
+
+ <fo:page-sequence master-reference="page">
+ <fo:flow flow-name="xsl-region-body">
+ <fo:block space-after="10pt">alignment-adjust="after-edge":</fo:block>
+ <fo:block>The line before. The line before. Before: <fo:inline-container width="100pt"
+ alignment-adjust="after-edge">
+ <fo:block>Inside the inline-container.</fo:block>
+ </fo:inline-container> After the inline-container.</fo:block>
+ </fo:flow>
+ </fo:page-sequence>
+
+ <fo:page-sequence master-reference="page">
+ <fo:flow flow-name="xsl-region-body">
+ <fo:block space-after="10pt">alignment-adjust="text-after-edge":</fo:block>
+ <fo:block>The line before. The line before. Before: <fo:inline-container width="100pt"
+ alignment-adjust="text-after-edge">
+ <fo:block>Inside the inline-container.</fo:block>
+ </fo:inline-container> After the inline-container.</fo:block>
+ </fo:flow>
+ </fo:page-sequence>
+
+ <fo:page-sequence master-reference="page">
+ <fo:flow flow-name="xsl-region-body">
+ <fo:block space-after="10pt">alignment-adjust="middle":</fo:block>
+ <fo:block>The line before. The line before. Before: <fo:inline-container width="100pt"
+ alignment-adjust="middle">
+ <fo:block>Inside the inline-container.</fo:block>
+ </fo:inline-container> After the inline-container.</fo:block>
+ </fo:flow>
+ </fo:page-sequence>
+
+ <fo:page-sequence master-reference="page">
+ <fo:flow flow-name="xsl-region-body">
+ <fo:block space-after="10pt">alignment-adjust="central":</fo:block>
+ <fo:block>The line before. The line before. Before: <fo:inline-container width="100pt"
+ alignment-adjust="central">
+ <fo:block>Inside the inline-container.</fo:block>
+ </fo:inline-container> After the inline-container.</fo:block>
+ </fo:flow>
+ </fo:page-sequence>
+
+ <fo:page-sequence master-reference="page">
+ <fo:flow flow-name="xsl-region-body">
+ <fo:block space-after="10pt">alignment-adjust="ideographic":</fo:block>
+ <fo:block>The line before. The line before. Before: <fo:inline-container width="100pt"
+ alignment-adjust="ideographic">
+ <fo:block>Inside the inline-container.</fo:block>
+ </fo:inline-container> After the inline-container.</fo:block>
+ </fo:flow>
+ </fo:page-sequence>
+
+ <fo:page-sequence master-reference="page">
+ <fo:flow flow-name="xsl-region-body">
+ <fo:block space-after="10pt">alignment-adjust="alphabetic":</fo:block>
+ <fo:block>The line before. The line before. Before: <fo:inline-container width="100pt"
+ alignment-adjust="alphabetic">
+ <fo:block>Inside the inline-container.</fo:block>
+ </fo:inline-container> After the inline-container.</fo:block>
+ </fo:flow>
+ </fo:page-sequence>
+
+ <fo:page-sequence master-reference="page">
+ <fo:flow flow-name="xsl-region-body">
+ <fo:block space-after="10pt">alignment-adjust="hanging":</fo:block>
+ <fo:block>The line before. The line before. Before: <fo:inline-container width="100pt"
+ alignment-adjust="hanging">
+ <fo:block>Inside the inline-container.</fo:block>
+ </fo:inline-container> After the inline-container.</fo:block>
+ </fo:flow>
+ </fo:page-sequence>
+
+ <fo:page-sequence master-reference="page">
+ <fo:flow flow-name="xsl-region-body">
+ <fo:block space-after="10pt">alignment-adjust="mathematical":</fo:block>
+ <fo:block>The line before. The line before. Before: <fo:inline-container width="100pt"
+ alignment-adjust="mathematical">
+ <fo:block>Inside the inline-container.</fo:block>
+ </fo:inline-container> After the inline-container.</fo:block>
+ </fo:flow>
+ </fo:page-sequence>
+
+ <fo:page-sequence master-reference="page">
+ <fo:flow flow-name="xsl-region-body">
+ <fo:block space-after="10pt">alignment-adjust="30pt":</fo:block>
+ <fo:block>The line before. The line before. Before: <fo:inline-container width="100pt"
+ alignment-adjust="30pt">
+ <fo:block>Inside the inline-container.</fo:block>
+ </fo:inline-container> After the inline-container.</fo:block>
+ </fo:flow>
+ </fo:page-sequence>
+
+ <fo:page-sequence master-reference="page">
+ <fo:flow flow-name="xsl-region-body">
+ <fo:block space-after="10pt">alignment-adjust="10%":</fo:block>
+ <fo:block>The line before. The line before. Before: <fo:inline-container width="100pt"
+ alignment-adjust="-10%" dominant-baseline="text-before-edge">
+ <fo:block>Inside the inline-container.</fo:block>
+ </fo:inline-container> After the inline-container.</fo:block>
+ </fo:flow>
+ </fo:page-sequence>
+
+ </fo:root>
+ </fo>
+
+ <checks>
+
+ <!-- before-edge -->
+ <eval expected="37416" xpath="//pageSequence[1]//flow/block[2]/lineArea[2]/@bpd"/>
+ <eval expected="0" xpath="//pageSequence[1]//flow/block[2]/lineArea[2]/text[1]/@offset"/>
+ <eval expected="8616" xpath="//pageSequence[1]//flow/block[2]/lineArea[2]/text[1]/@baseline"/>
+ <eval expected="28800" xpath="//pageSequence[1]//flow/block[2]/lineArea[2]/viewport/@bpd"/>
+ <eval expected="8616" xpath="//pageSequence[1]//flow/block[2]/lineArea[2]/viewport/@offset"/>
+
+ <!-- text-before-edge -->
+ <eval expected="37416" xpath="//pageSequence[2]//flow/block[2]/lineArea[2]/@bpd"/>
+ <eval expected="0" xpath="//pageSequence[2]//flow/block[2]/lineArea[2]/text[1]/@offset"/>
+ <eval expected="8616" xpath="//pageSequence[2]//flow/block[2]/lineArea[2]/text[1]/@baseline"/>
+ <eval expected="28800" xpath="//pageSequence[2]//flow/block[2]/lineArea[2]/viewport/@bpd"/>
+ <eval expected="8616" xpath="//pageSequence[2]//flow/block[2]/lineArea[2]/viewport/@offset"/>
+
+ <!-- after-edge -->
+ <eval expected="31284" xpath="//pageSequence[3]//flow/block[2]/lineArea[2]/@bpd"/>
+ <eval expected="20184" xpath="//pageSequence[3]//flow/block[2]/lineArea[2]/text[1]/@offset"/>
+ <eval expected="8616" xpath="//pageSequence[3]//flow/block[2]/lineArea[2]/text[1]/@baseline"/>
+ <eval expected="28800" xpath="//pageSequence[3]//flow/block[2]/lineArea[2]/viewport/@bpd"/>
+ <eval expected="0" xpath="//pageSequence[3]//flow/block[2]/lineArea[2]/viewport/@offset"/>
+
+ <!-- text-after-edge -->
+ <eval expected="31284" xpath="//pageSequence[4]//flow/block[2]/lineArea[2]/@bpd"/>
+ <eval expected="20184" xpath="//pageSequence[4]//flow/block[2]/lineArea[2]/text[1]/@offset"/>
+ <eval expected="8616" xpath="//pageSequence[4]//flow/block[2]/lineArea[2]/text[1]/@baseline"/>
+ <eval expected="28800" xpath="//pageSequence[4]//flow/block[2]/lineArea[2]/viewport/@bpd"/>
+ <eval expected="0" xpath="//pageSequence[4]//flow/block[2]/lineArea[2]/viewport/@offset"/>
+
+ <!-- middle -->
+ <eval expected="28800" xpath="//pageSequence[5]//flow/block[2]/lineArea[2]/@bpd"/>
+ <eval expected="5784" xpath="//pageSequence[5]//flow/block[2]/lineArea[2]/text[1]/@offset"/>
+ <eval expected="8616" xpath="//pageSequence[5]//flow/block[2]/lineArea[2]/text[1]/@baseline"/>
+ <eval expected="28800" xpath="//pageSequence[5]//flow/block[2]/lineArea[2]/viewport/@bpd"/>
+ <eval expected="0" xpath="//pageSequence[5]//flow/block[2]/lineArea[2]/viewport/@offset"/>
+
+ <!-- central -->
+ <eval expected="28800" xpath="//pageSequence[6]//flow/block[2]/lineArea[2]/@bpd"/>
+ <eval expected="5784" xpath="//pageSequence[6]//flow/block[2]/lineArea[2]/text[1]/@offset"/>
+ <eval expected="8616" xpath="//pageSequence[6]//flow/block[2]/lineArea[2]/text[1]/@baseline"/>
+ <eval expected="28800" xpath="//pageSequence[6]//flow/block[2]/lineArea[2]/viewport/@bpd"/>
+ <eval expected="0" xpath="//pageSequence[6]//flow/block[2]/lineArea[2]/viewport/@offset"/>
+
+ <!-- ideographic -->
+ <eval expected="28800" xpath="//pageSequence[7]//flow/block[2]/lineArea[2]/@bpd"/>
+ <eval expected="11544" xpath="//pageSequence[7]//flow/block[2]/lineArea[2]/text[1]/@offset"/>
+ <eval expected="8616" xpath="//pageSequence[7]//flow/block[2]/lineArea[2]/text[1]/@baseline"/>
+ <eval expected="28800" xpath="//pageSequence[7]//flow/block[2]/lineArea[2]/viewport/@bpd"/>
+ <eval expected="0" xpath="//pageSequence[7]//flow/block[2]/lineArea[2]/viewport/@offset"/>
+
+ <!-- alphabetic -->
+ <eval expected="28800" xpath="//pageSequence[8]//flow/block[2]/lineArea[2]/@bpd"/>
+ <eval expected="8664" xpath="//pageSequence[8]//flow/block[2]/lineArea[2]/text[1]/@offset"/>
+ <eval expected="8616" xpath="//pageSequence[8]//flow/block[2]/lineArea[2]/text[1]/@baseline"/>
+ <eval expected="28800" xpath="//pageSequence[8]//flow/block[2]/lineArea[2]/viewport/@bpd"/>
+ <eval expected="0" xpath="//pageSequence[8]//flow/block[2]/lineArea[2]/viewport/@offset"/>
+
+ <!-- hanging -->
+ <eval expected="31656" xpath="//pageSequence[9]//flow/block[2]/lineArea[2]/@bpd"/>
+ <eval expected="0" xpath="//pageSequence[9]//flow/block[2]/lineArea[2]/text[1]/@offset"/>
+ <eval expected="8616" xpath="//pageSequence[9]//flow/block[2]/lineArea[2]/text[1]/@baseline"/>
+ <eval expected="28800" xpath="//pageSequence[9]//flow/block[2]/lineArea[2]/viewport/@bpd"/>
+ <eval expected="2856" xpath="//pageSequence[9]//flow/block[2]/lineArea[2]/viewport/@offset"/>
+
+ <!-- mathematical -->
+ <eval expected="28800" xpath="//pageSequence[10]//flow/block[2]/lineArea[2]/@bpd"/>
+ <eval expected="5784" xpath="//pageSequence[10]//flow/block[2]/lineArea[2]/text[1]/@offset"/>
+ <eval expected="8616" xpath="//pageSequence[10]//flow/block[2]/lineArea[2]/text[1]/@baseline"/>
+ <eval expected="28800" xpath="//pageSequence[10]//flow/block[2]/lineArea[2]/viewport/@bpd"/>
+ <eval expected="0" xpath="//pageSequence[10]//flow/block[2]/lineArea[2]/viewport/@offset"/>
+
+ <!-- 30pt -->
+ <eval expected="49764" xpath="//pageSequence[11]//flow/block[2]/lineArea[2]/@bpd"/>
+ <eval expected="38664" xpath="//pageSequence[11]//flow/block[2]/lineArea[2]/text[1]/@offset"/>
+ <eval expected="8616" xpath="//pageSequence[11]//flow/block[2]/lineArea[2]/text[1]/@baseline"/>
+ <eval expected="28800" xpath="//pageSequence[11]//flow/block[2]/lineArea[2]/viewport/@bpd"/>
+ <eval expected="0" xpath="//pageSequence[11]//flow/block[2]/lineArea[2]/viewport/@offset"/>
+
+ <!-- 10% -->
+ <eval expected="38856" xpath="//pageSequence[12]//flow/block[2]/lineArea[2]/@bpd"/>
+ <eval expected="0" xpath="//pageSequence[12]//flow/block[2]/lineArea[2]/text[1]/@offset"/>
+ <eval expected="8616" xpath="//pageSequence[12]//flow/block[2]/lineArea[2]/text[1]/@baseline"/>
+ <eval expected="28800" xpath="//pageSequence[12]//flow/block[2]/lineArea[2]/viewport/@bpd"/>
+ <eval expected="10056" xpath="//pageSequence[12]//flow/block[2]/lineArea[2]/viewport/@offset"/>
+
+ </checks>
+</testcase>
diff --git a/test/layoutengine/standard-testcases/inline-container_alignment-baseline.xml b/test/layoutengine/standard-testcases/inline-container_alignment-baseline.xml
new file mode 100644
index 000000000..53b9be0a9
--- /dev/null
+++ b/test/layoutengine/standard-testcases/inline-container_alignment-baseline.xml
@@ -0,0 +1,74 @@
+<?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>
+ Checks that the alignment-baseline property on inline-container behaves properly.
+ </p>
+ </info>
+ <fo>
+ <fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format">
+ <fo:layout-master-set>
+ <fo:simple-page-master master-name="page"
+ page-height="170pt" page-width="220pt" margin="10pt">
+ <fo:region-body/>
+ </fo:simple-page-master>
+ </fo:layout-master-set>
+
+ <fo:page-sequence master-reference="page">
+ <fo:flow flow-name="xsl-region-body">
+ <fo:block space-after="10pt">alignment-baseline="before-edge":</fo:block>
+ <fo:block>The line before. The line before. Before: <fo:inline-container width="100pt"
+ alignment-baseline="before-edge">
+ <fo:block>Inside the inline-container.</fo:block>
+ </fo:inline-container> After the inline-container.</fo:block>
+ </fo:flow>
+ </fo:page-sequence>
+
+ <fo:page-sequence master-reference="page">
+ <fo:flow flow-name="xsl-region-body">
+ <fo:block space-after="10pt">alignment-baseline="central":</fo:block>
+ <fo:block>The line before. The line before. Before: <fo:inline-container width="100pt"
+ alignment-baseline="central">
+ <fo:block>Inside the inline-container.</fo:block>
+ </fo:inline-container> After the inline-container.</fo:block>
+ </fo:flow>
+ </fo:page-sequence>
+
+ </fo:root>
+ </fo>
+
+ <checks>
+
+ <!-- before-edge -->
+ <eval expected="28800" xpath="//pageSequence[1]//flow/block[2]/lineArea[2]/@bpd"/>
+ <eval expected="0" xpath="//pageSequence[1]//flow/block[2]/lineArea[2]/text[1]/@offset"/>
+ <eval expected="8616" xpath="//pageSequence[1]//flow/block[2]/lineArea[2]/text[1]/@baseline"/>
+ <eval expected="28800" xpath="//pageSequence[1]//flow/block[2]/lineArea[2]/viewport/@bpd"/>
+ <eval expected="0" xpath="//pageSequence[1]//flow/block[2]/lineArea[2]/viewport/@offset"/>
+
+ <!-- central -->
+ <eval expected="28800" xpath="//pageSequence[2]//flow/block[2]/lineArea[2]/@bpd"/>
+ <eval expected="8850" xpath="//pageSequence[2]//flow/block[2]/lineArea[2]/text[1]/@offset"/>
+ <eval expected="8616" xpath="//pageSequence[2]//flow/block[2]/lineArea[2]/text[1]/@baseline"/>
+ <eval expected="28800" xpath="//pageSequence[2]//flow/block[2]/lineArea[2]/viewport/@bpd"/>
+ <eval expected="0" xpath="//pageSequence[2]//flow/block[2]/lineArea[2]/viewport/@offset"/>
+
+ </checks>
+</testcase>
diff --git a/test/layoutengine/standard-testcases/inline-container_alignment.xml b/test/layoutengine/standard-testcases/inline-container_alignment.xml
new file mode 100644
index 000000000..153d9a9c4
--- /dev/null
+++ b/test/layoutengine/standard-testcases/inline-container_alignment.xml
@@ -0,0 +1,154 @@
+<?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>
+ Checks that the inline-container is properly aligned with the parent area.
+ </p>
+ </info>
+ <fo>
+ <fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format">
+ <fo:layout-master-set>
+ <fo:simple-page-master master-name="page"
+ page-height="320pt" page-width="220pt" margin="10pt">
+ <fo:region-body/>
+ </fo:simple-page-master>
+ </fo:layout-master-set>
+ <fo:page-sequence master-reference="page">
+ <fo:flow flow-name="xsl-region-body">
+ <fo:block>By default the alignment is with the baseline of the first descendant
+ line-area.</fo:block>
+ <fo:block>The line before. The line before. Before: <fo:inline-container width="100pt">
+ <fo:block font-size="20pt">Inside the inline-container.</fo:block>
+ </fo:inline-container> After the inline-container.</fo:block>
+ </fo:flow>
+ </fo:page-sequence>
+
+ <fo:page-sequence master-reference="page">
+ <fo:flow flow-name="xsl-region-body">
+ <fo:block>The line before. The line before. Before: <fo:inline-container width="100pt">
+ <fo:block space-before="20pt" space-before.conditionality="retain">
+ <fo:block-container space-before="10pt" space-before.conditionality="retain"
+ border="4pt solid" padding="2pt" start-indent="6pt" end-indent="6pt">
+ <fo:block font-size="20pt" start-indent="0" end-indent="0">Inside the
+ inline-container.</fo:block>
+ </fo:block-container>
+ </fo:block>
+ </fo:inline-container> After the inline-container.</fo:block>
+ </fo:flow>
+ </fo:page-sequence>
+
+ <fo:page-sequence master-reference="page">
+ <fo:flow flow-name="xsl-region-body">
+ <fo:block>This inline-container has no line-area descendant. The after edge of its
+ allocation rectangle should be aligned with the baseline.</fo:block>
+ <fo:block>The line before. The line before. Before: <fo:inline-container width="100pt">
+ <fo:block border="6pt solid" padding="2pt" start-indent="8pt" end-indent="8pt"/>
+ </fo:inline-container> After the inline-container.</fo:block>
+ </fo:flow>
+ </fo:page-sequence>
+
+ <fo:page-sequence master-reference="page">
+ <fo:flow flow-name="xsl-region-body">
+ <fo:block>The first line-area descendant is in fo:list-item-body.</fo:block>
+ <fo:block>The line before. The line before. Before: <fo:inline-container width="100pt">
+ <fo:list-block provisional-distance-between-starts="10pt"
+ provisional-label-separation="5pt">
+ <fo:list-item>
+ <fo:list-item-label end-indent="label-end()">
+ <fo:block/>
+ </fo:list-item-label>
+ <fo:list-item-body start-indent="body-start()">
+ <fo:block>
+ <fo:block font-size="8pt">List item</fo:block>
+ </fo:block>
+ </fo:list-item-body>
+ </fo:list-item>
+ </fo:list-block>
+ </fo:inline-container> After the inline-container.</fo:block>
+ </fo:flow>
+ </fo:page-sequence>
+
+ <fo:page-sequence master-reference="page">
+ <fo:flow flow-name="xsl-region-body">
+ <fo:block>This inline-container contains a block that contains an inline that contains a
+ block.</fo:block>
+ <fo:block>The line before. The line before. Before: <fo:inline-container width="100pt">
+ <fo:block><fo:inline><fo:block>inline</fo:block></fo:inline></fo:block>
+ </fo:inline-container> After the inline-container.</fo:block>
+ </fo:flow>
+ </fo:page-sequence>
+ </fo:root>
+ </fo>
+
+ <checks>
+ <!-- Page sequence 1 -->
+ <eval expected="72000" xpath="//pageSequence[1]//flow/block[2]/lineArea[2]/@bpd"/>
+ <!--
+ The font used is Helvetica, ascender 718, descender −207.
+ Default font size is 12pt => baseline offset = 718 * 12 = 8616mpt
+ Default line height is 1.2 * font-size
+ => space-before = (line-height − (ascender − descender) * font-size) / 2
+ = (1.2 * 12000 − (718 + 207) * 12) / 2
+ = 1650
+ At font size 20, the distance between the before-edge of the inline-container’s child block
+ area and the first line area’s baseline is space-before + baseline-offset = 2750 + 14360 = 17110
+ So the word "Before:" must be offset by 17110 − 8616 = 8494
+ -->
+ <eval expected="Before: " xpath="//pageSequence[1]//flow/block[2]/lineArea[2]/text[1]"/>
+ <eval expected="8494" xpath="//pageSequence[1]//flow/block[2]/lineArea[2]/text[1]/@offset"/>
+ <eval expected="8616" xpath="//pageSequence[1]//flow/block[2]/lineArea[2]/text[1]/@baseline"/>
+
+ <eval expected="72000" xpath="//pageSequence[1]//flow/block[2]/lineArea[2]/viewport/@bpd"/>
+ <eval expected="0" xpath="//pageSequence[1]//flow/block[2]/lineArea[2]/viewport/@offset"/>
+
+ <eval expected=" After the" xpath="//pageSequence[1]//flow/block[2]/lineArea[2]/text[2]"/>
+ <eval expected="8494" xpath="//pageSequence[1]//flow/block[2]/lineArea[2]/text[2]/@offset"/>
+ <eval expected="8616" xpath="//pageSequence[1]//flow/block[2]/lineArea[2]/text[2]/@baseline"/>
+
+ <!-- Page sequence 2 -->
+ <eval expected="34494" xpath="//pageSequence[2]//flow/block/lineArea[2]/text[1]/@offset"/>
+ <eval expected="8616" xpath="//pageSequence[2]//flow/block/lineArea[2]/text[1]/@baseline"/>
+ <eval expected="104000" xpath="//pageSequence[2]//flow/block/lineArea[2]/viewport/@bpd"/>
+ <eval expected="0" xpath="//pageSequence[2]//flow/block/lineArea[2]/viewport/@offset"/>
+
+ <!-- Page sequence 3 -->
+ <!-- bpd = max(text ascent, ascent of inline-container) + text descent
+ = 16000 + 207 * 12 -->
+ <eval expected="18484" xpath="//pageSequence[3]//flow/block[2]/lineArea[2]/@bpd"/>
+ <eval expected="7384" xpath="//pageSequence[3]//flow/block[2]/lineArea[2]/text[1]/@offset"/>
+ <eval expected="8616" xpath="//pageSequence[3]//flow/block[2]/lineArea[2]/text[1]/@baseline"/>
+ <eval expected="16000" xpath="//pageSequence[3]//flow/block[2]/lineArea[2]/viewport/@bpd"/>
+ <eval expected="0" xpath="//pageSequence[3]//flow/block[2]/lineArea[2]/viewport/@offset"/>
+
+ <!-- Page sequence 4 -->
+ <eval expected="11372" xpath="//pageSequence[4]//flow/block[2]/lineArea[2]/@bpd"/>
+ <eval expected="0" xpath="//pageSequence[4]//flow/block[2]/lineArea[2]/text[1]/@offset"/>
+ <eval expected="8616" xpath="//pageSequence[4]//flow/block[2]/lineArea[2]/text[1]/@baseline"/>
+ <eval expected="9600" xpath="//pageSequence[4]//flow/block[2]/lineArea[2]/viewport/@bpd"/>
+ <eval expected="1772" xpath="//pageSequence[4]//flow/block[2]/lineArea[2]/viewport/@offset"/>
+
+ <!-- Page sequence 5 -->
+ <eval expected="14400" xpath="//pageSequence[5]//flow/block[2]/lineArea[2]/@bpd"/>
+ <eval expected="1650" xpath="//pageSequence[5]//flow/block[2]/lineArea[2]/text[1]/@offset"/>
+ <eval expected="8616" xpath="//pageSequence[5]//flow/block[2]/lineArea[2]/text[1]/@baseline"/>
+ <eval expected="14400" xpath="//pageSequence[5]//flow/block[2]/lineArea[2]/viewport/@bpd"/>
+ <eval expected="0" xpath="//pageSequence[5]//flow/block[2]/lineArea[2]/viewport/@offset"/>
+ </checks>
+</testcase>
diff --git a/test/layoutengine/standard-testcases/inline-container_basic.xml b/test/layoutengine/standard-testcases/inline-container_basic.xml
new file mode 100644
index 000000000..b2dfcc6e5
--- /dev/null
+++ b/test/layoutengine/standard-testcases/inline-container_basic.xml
@@ -0,0 +1,56 @@
+<?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>
+ Test for a basic implementation of fo:inline-container.
+ </p>
+ </info>
+ <fo>
+ <fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format">
+ <fo:layout-master-set>
+ <fo:simple-page-master master-name="page"
+ page-height="320pt" page-width="420pt" margin="10pt">
+ <fo:region-body/>
+ </fo:simple-page-master>
+ </fo:layout-master-set>
+ <fo:page-sequence master-reference="page">
+ <fo:flow flow-name="xsl-region-body">
+ <fo:block>Before: <fo:inline-container width="80pt" height="50pt">
+ <fo:block>Text inside inline-container.</fo:block>
+ </fo:inline-container> After.</fo:block>
+ </fo:flow>
+ </fo:page-sequence>
+ </fo:root>
+ </fo>
+
+ <checks>
+ <!-- The inline-container’s area is there, at the right place -->
+ <eval expected="viewport" xpath="local-name(//flow/block/lineArea/*[position()=2])"/>
+ <!-- It has the right properties -->
+ <eval expected="true" xpath="//viewport/@is-viewport-area"/>
+ <eval expected="80000" xpath="//viewport/@ipd"/>
+ <eval expected="50000" xpath="//viewport/@bpd"/>
+ <eval expected="1" xpath="count(//viewport/*)"/>
+ <eval expected="container" xpath="local-name(//viewport/*)"/>
+ <!-- Its content is there too -->
+ <eval expected="1" xpath="count(//container/block)"/>
+ <eval expected="80000" xpath="//container/block/@ipd"/>
+ </checks>
+</testcase>
diff --git a/test/layoutengine/standard-testcases/inline-container_block_nested.xml b/test/layoutengine/standard-testcases/inline-container_block_nested.xml
deleted file mode 100644
index cf4ebf486..000000000
--- a/test/layoutengine/standard-testcases/inline-container_block_nested.xml
+++ /dev/null
@@ -1,65 +0,0 @@
-<?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 nested blocks with inline-containers and indents.
- </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" white-space-collapse="true">
- <fo:flow flow-name="xsl-region-body">
- <fo:block margin-left="12pt">outer block
- <fo:inline-container start-indent="18pt">
- <fo:block margin-left="13pt">inner block</fo:block>
- </fo:inline-container>
- </fo:block>
- </fo:flow>
- </fo:page-sequence>
- </fo:root>
- </fo>
- <checks>
- <!-- First block, no gap -->
- <!--eval expected="(133,#0000ff,5000)" xpath="/areaTree/pageSequence/pageViewport/page[1]/regionViewport/regionBody/mainReference/span/flow/block[1]/@border-start"/>
- <eval expected="(133,#0000ff,5000)" xpath="/areaTree/pageSequence/pageViewport/page[1]/regionViewport/regionBody/mainReference/span/flow/block[1]/@border-end"/>
- <eval expected="(133,#0000ff,5000)" xpath="/areaTree/pageSequence/pageViewport/page[1]/regionViewport/regionBody/mainReference/span/flow/block[1]/@border-before"/>
- <eval expected="(133,#0000ff,5000)" xpath="/areaTree/pageSequence/pageViewport/page[1]/regionViewport/regionBody/mainReference/span/flow/block[1]/@border-after"/>
- <eval expected="5000 5000 5000 5000" xpath="/areaTree/pageSequence/pageViewport/page[1]/regionViewport/regionBody/mainReference/span/flow/block[1]/@bap"/>
- <eval expected="350000" xpath="/areaTree/pageSequence/pageViewport/page[1]/regionViewport/regionBody/mainReference/span/flow/block[1]/@ipd"/>
- <eval expected="360000" xpath="/areaTree/pageSequence/pageViewport/page[1]/regionViewport/regionBody/mainReference/span/flow/block[1]/@ipda"/>
- <eval expected="24400" xpath="/areaTree/pageSequence/pageViewport/page[1]/regionViewport/regionBody/mainReference/span/flow/block[1]/@bpd"/>
- <eval expected="34400" xpath="/areaTree/pageSequence/pageViewport/page[1]/regionViewport/regionBody/mainReference/span/flow/block[1]/@bpda"/-->
- <!-- Nested block of first block -->
- <!--eval expected="(133,#ff0000,5000)" xpath="/areaTree/pageSequence/pageViewport/page[1]/regionViewport/regionBody/mainReference/span/flow/block[1]/block[1]/@border-start"/>
- <eval expected="(133,#ff0000,5000)" xpath="/areaTree/pageSequence/pageViewport/page[1]/regionViewport/regionBody/mainReference/span/flow/block[1]/block[1]/@border-end"/>
- <eval expected="(133,#ff0000,5000)" xpath="/areaTree/pageSequence/pageViewport/page[1]/regionViewport/regionBody/mainReference/span/flow/block[1]/block[1]/@border-before"/>
- <eval expected="(133,#ff0000,5000)" xpath="/areaTree/pageSequence/pageViewport/page[1]/regionViewport/regionBody/mainReference/span/flow/block[1]/block[1]/@border-after"/>
- <eval expected="5000 5000 5000 5000" xpath="/areaTree/pageSequence/pageViewport/page[1]/regionViewport/regionBody/mainReference/span/flow/block[1]/block[1]/@bap"/>
- <eval expected="340000" xpath="/areaTree/pageSequence/pageViewport/page[1]/regionViewport/regionBody/mainReference/span/flow/block[1]/block[1]/@ipd"/>
- <eval expected="350000" xpath="/areaTree/pageSequence/pageViewport/page[1]/regionViewport/regionBody/mainReference/span/flow/block[1]/block[1]/@ipda"/>
- <eval expected="14400" xpath="/areaTree/pageSequence/pageViewport/page[1]/regionViewport/regionBody/mainReference/span/flow/block[1]/block[1]/@bpd"/>
- <eval expected="24400" xpath="/areaTree/pageSequence/pageViewport/page[1]/regionViewport/regionBody/mainReference/span/flow/block[1]/block[1]/@bpda"/-->
- </checks>
-</testcase>
diff --git a/test/layoutengine/standard-testcases/inline-container_bpd.xml b/test/layoutengine/standard-testcases/inline-container_bpd.xml
new file mode 100644
index 000000000..8f808c030
--- /dev/null
+++ b/test/layoutengine/standard-testcases/inline-container_bpd.xml
@@ -0,0 +1,72 @@
+<?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>
+ Checks that block-progression-dimension on fo:inline-container is properly handled.
+ </p>
+ </info>
+ <fo>
+ <fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format" font-size="8pt" line-height="10pt">
+ <fo:layout-master-set>
+ <fo:simple-page-master master-name="page"
+ page-height="220pt" page-width="320pt" margin="10pt">
+ <fo:region-body/>
+ </fo:simple-page-master>
+ </fo:layout-master-set>
+ <fo:page-sequence master-reference="page">
+ <fo:flow flow-name="xsl-region-body">
+ <fo:block>Before: <fo:inline-container width="60pt">
+ <fo:block>This text inside inline-container should fit on four lines.</fo:block>
+ </fo:inline-container> After.</fo:block>
+ </fo:flow>
+ </fo:page-sequence>
+ <fo:page-sequence master-reference="page">
+ <fo:flow flow-name="xsl-region-body">
+ <fo:block>Before: <fo:inline-container width="70pt" height="35pt" overflow="hidden">
+ <fo:block>This text overflows the inline-container in the
+ block-progression-direction.</fo:block>
+ </fo:inline-container> After.</fo:block>
+ </fo:flow>
+ </fo:page-sequence>
+ <fo:page-sequence master-reference="page">
+ <fo:flow flow-name="xsl-region-body">
+ <fo:block>Before: <fo:inline-container width="80pt">
+ <fo:block space-after="10pt">Block 1</fo:block>
+ <fo:block space-before="20pt" space-after="10pt"
+ space-after.conditionality="retain">Block 2</fo:block>
+ </fo:inline-container> After.</fo:block>
+ </fo:flow>
+ </fo:page-sequence>
+ </fo:root>
+ </fo>
+
+ <checks>
+ <eval expected="40000" xpath="//pageSequence[1]//viewport/@bpd"/>
+
+ <eval expected="35000" xpath="//pageSequence[2]//viewport/@bpd"/>
+ <true xpath="//pageSequence[2]//viewport/@clip"/>
+
+ <eval expected="50000" xpath="//pageSequence[3]//viewport/@bpd"/>
+ </checks>
+
+ <event-checks>
+ <event key="viewportBPDOverflow" elementName="fo:inline-container" amount="15000" clip="true"/>
+ </event-checks>
+</testcase>
diff --git a/test/layoutengine/standard-testcases/inline-container_dominant-baseline.xml b/test/layoutengine/standard-testcases/inline-container_dominant-baseline.xml
new file mode 100644
index 000000000..402eb806d
--- /dev/null
+++ b/test/layoutengine/standard-testcases/inline-container_dominant-baseline.xml
@@ -0,0 +1,74 @@
+<?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>
+ Checks that the dominant-baseline property on inline-container behaves properly.
+ </p>
+ </info>
+ <fo>
+ <fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format">
+ <fo:layout-master-set>
+ <fo:simple-page-master master-name="page"
+ page-height="170pt" page-width="220pt" margin="10pt">
+ <fo:region-body/>
+ </fo:simple-page-master>
+ </fo:layout-master-set>
+
+ <fo:page-sequence master-reference="page">
+ <fo:flow flow-name="xsl-region-body">
+ <fo:block space-after="10pt">dominant-baseline="alphabetic":</fo:block>
+ <fo:block>The line before. The line before. Before: <fo:inline-container width="100pt"
+ alignment-adjust="baseline">
+ <fo:block>Inside the inline-container.</fo:block>
+ </fo:inline-container> After the inline-container.</fo:block>
+ </fo:flow>
+ </fo:page-sequence>
+
+ <fo:page-sequence master-reference="page">
+ <fo:flow flow-name="xsl-region-body">
+ <fo:block space-after="10pt">dominant-baseline="central":</fo:block>
+ <fo:block>The line before. The line before. Before: <fo:inline-container width="100pt"
+ alignment-adjust="baseline" dominant-baseline="central">
+ <fo:block>Inside the inline-container.</fo:block>
+ </fo:inline-container> After the inline-container.</fo:block>
+ </fo:flow>
+ </fo:page-sequence>
+
+ </fo:root>
+ </fo>
+
+ <checks>
+
+ <!-- alphabetic -->
+ <eval expected="28800" xpath="//pageSequence[1]//flow/block[2]/lineArea[2]/@bpd"/>
+ <eval expected="8664" xpath="//pageSequence[1]//flow/block[2]/lineArea[2]/text[1]/@offset"/>
+ <eval expected="8616" xpath="//pageSequence[1]//flow/block[2]/lineArea[2]/text[1]/@baseline"/>
+ <eval expected="28800" xpath="//pageSequence[1]//flow/block[2]/lineArea[2]/viewport/@bpd"/>
+ <eval expected="0" xpath="//pageSequence[1]//flow/block[2]/lineArea[2]/viewport/@offset"/>
+
+ <!-- central -->
+ <eval expected="28800" xpath="//pageSequence[2]//flow/block[2]/lineArea[2]/@bpd"/>
+ <eval expected="5784" xpath="//pageSequence[2]//flow/block[2]/lineArea[2]/text[1]/@offset"/>
+ <eval expected="8616" xpath="//pageSequence[2]//flow/block[2]/lineArea[2]/text[1]/@baseline"/>
+ <eval expected="28800" xpath="//pageSequence[2]//flow/block[2]/lineArea[2]/viewport/@bpd"/>
+ <eval expected="0" xpath="//pageSequence[2]//flow/block[2]/lineArea[2]/viewport/@offset"/>
+
+ </checks>
+</testcase>
diff --git a/test/layoutengine/standard-testcases/inline-container_ipd-auto.xml b/test/layoutengine/standard-testcases/inline-container_ipd-auto.xml
new file mode 100644
index 000000000..c19544809
--- /dev/null
+++ b/test/layoutengine/standard-testcases/inline-container_ipd-auto.xml
@@ -0,0 +1,66 @@
+<?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>
+ When inline-progression-dimension has been left to auto on fo:inline-container, fall back to
+ the IPD of the nearest ancestor reference-area.
+ </p>
+ </info>
+ <fo>
+ <fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format">
+ <fo:layout-master-set>
+ <fo:simple-page-master master-name="page"
+ page-height="220pt" page-width="320pt" margin="10pt">
+ <fo:region-body/>
+ </fo:simple-page-master>
+ </fo:layout-master-set>
+ <fo:page-sequence master-reference="page">
+ <fo:flow flow-name="xsl-region-body">
+ <fo:block>Before: <fo:inline-container height="20pt">
+ <fo:block>Text inside inline-container.</fo:block>
+ </fo:inline-container> After.</fo:block>
+ </fo:flow>
+ </fo:page-sequence>
+ <fo:page-sequence master-reference="page">
+ <fo:flow flow-name="xsl-region-body">
+ <fo:block-container space-before="10pt" start-indent="100pt" width="100pt">
+ <fo:block start-indent="0">
+ Before: <fo:inline-container>
+ <fo:block>Inside the inline-container.</fo:block>
+ </fo:inline-container> After.
+ </fo:block>
+ </fo:block-container>
+ </fo:flow>
+ </fo:page-sequence>
+ </fo:root>
+ </fo>
+
+ <checks>
+ <eval expected="3" xpath="count(//pageSequence[1]//flow/block/lineArea)"/>
+ <eval expected="300000" xpath="//pageSequence[1]//flow/block/lineArea[2]/viewport/@ipd"/>
+ <eval expected="3" xpath="count(//pageSequence[2]//flow/block/block/block/lineArea)"/>
+ <eval expected="100000" xpath="//pageSequence[2]//flow/block/block/block/lineArea[2]/viewport/@ipd"/>
+ </checks>
+
+ <event-checks>
+ <event key="inlineContainerAutoIPDNotSupported" fallback="300.0"/>
+ <event key="inlineContainerAutoIPDNotSupported" fallback="100.0"/>
+ </event-checks>
+</testcase>
diff --git a/test/layoutengine/standard-testcases/inline-container_ipd-percent.xml b/test/layoutengine/standard-testcases/inline-container_ipd-percent.xml
new file mode 100644
index 000000000..aa681d134
--- /dev/null
+++ b/test/layoutengine/standard-testcases/inline-container_ipd-percent.xml
@@ -0,0 +1,61 @@
+<?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>
+ Checks that percentage values for the dimensions of an fo:inline-container are resolved
+ properly.
+ </p>
+ </info>
+ <fo>
+ <fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format" font-size="8pt" line-height="10pt">
+ <fo:layout-master-set>
+ <fo:simple-page-master master-name="page"
+ page-height="220pt" page-width="320pt" margin="10pt">
+ <fo:region-body/>
+ </fo:simple-page-master>
+ </fo:layout-master-set>
+ <fo:page-sequence master-reference="page">
+ <fo:flow flow-name="xsl-region-body">
+ <fo:block>Before: <fo:inline-container width="50%" height="50%">
+ <fo:block>Text inside inline-container.</fo:block>
+ </fo:inline-container> After.</fo:block>
+ </fo:flow>
+ </fo:page-sequence>
+ <fo:page-sequence master-reference="page">
+ <fo:flow flow-name="xsl-region-body">
+ <fo:block-container space-before="10pt" start-indent="50pt" width="200pt">
+ <fo:block start-indent="0">
+ Before: <fo:inline-container width="30%" height="30%">
+ <fo:block>Inside the inline-container.</fo:block>
+ </fo:inline-container> After.
+ </fo:block>
+ </fo:block-container>
+ </fo:flow>
+ </fo:page-sequence>
+ </fo:root>
+ </fo>
+
+ <checks>
+ <eval expected="150000" xpath="//pageSequence[1]//flow/block/lineArea/viewport/@ipd"/>
+ <eval expected="10000" xpath="//pageSequence[1]//flow/block/lineArea/viewport/@bpd"/>
+ <eval expected="60000" xpath="//pageSequence[2]//flow/block/block/block/lineArea/viewport/@ipd"/>
+ <eval expected="20000" xpath="//pageSequence[2]//flow/block/block/block/lineArea/viewport/@bpd"/>
+ </checks>
+</testcase>
diff --git a/test/layoutengine/standard-testcases/inline-container_keeps.xml b/test/layoutengine/standard-testcases/inline-container_keeps.xml
new file mode 100644
index 000000000..e946f13f3
--- /dev/null
+++ b/test/layoutengine/standard-testcases/inline-container_keeps.xml
@@ -0,0 +1,49 @@
+<?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>
+ Test for keeps on fo:inline-container.
+ </p>
+ </info>
+ <fo>
+ <fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format">
+ <fo:layout-master-set>
+ <fo:simple-page-master master-name="page"
+ page-height="220pt" page-width="320pt" margin="10pt">
+ <fo:region-body/>
+ </fo:simple-page-master>
+ </fo:layout-master-set>
+ <fo:page-sequence master-reference="page">
+ <fo:flow flow-name="xsl-region-body">
+ <fo:block>This inline-container must be kept with the word before: <fo:inline-container
+ id="inline-container" width="100pt" keep-with-previous.within-line="always"
+ background-color="#F0F0F0">
+ <fo:block>Inline-container</fo:block>
+ </fo:inline-container></fo:block>
+ </fo:flow>
+ </fo:page-sequence>
+ </fo:root>
+ </fo>
+
+ <checks>
+ <eval expected="before: " xpath="//pageSequence[1]//flow/block/lineArea[2]/text[1]"/>
+ <eval expected="inline-container" xpath="//pageSequence[1]//flow/block/lineArea[2]/viewport/@prod-id"/>
+ </checks>
+</testcase>