diff options
author | Vincent Hennebert <vhennebert@apache.org> | 2009-08-26 18:50:10 +0000 |
---|---|---|
committer | Vincent Hennebert <vhennebert@apache.org> | 2009-08-26 18:50:10 +0000 |
commit | bcfda76c15640c34c91f2d8e29d85b9326ab8d25 (patch) | |
tree | 8ebab128378a36a84ddd450063a402ff2b6841e5 /test/layoutengine | |
parent | 9520407736edcb4389c1418b70e0f7f376d7bd85 (diff) | |
download | xmlgraphics-fop-bcfda76c15640c34c91f2d8e29d85b9326ab8d25.tar.gz xmlgraphics-fop-bcfda76c15640c34c91f2d8e29d85b9326ab8d25.zip |
Merged back ChangingIPDHack branch into Trunk
git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@808157 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'test/layoutengine')
6 files changed, 607 insertions, 0 deletions
diff --git a/test/layoutengine/standard-testcases/flow_changing-ipd_1.xml b/test/layoutengine/standard-testcases/flow_changing-ipd_1.xml new file mode 100644 index 000000000..d4db6e696 --- /dev/null +++ b/test/layoutengine/standard-testcases/flow_changing-ipd_1.xml @@ -0,0 +1,97 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + Licensed to the Apache Software Foundation (ASF) under one or more + contributor license agreements. See the NOTICE file distributed with + this work for additional information regarding copyright ownership. + The ASF licenses this file to You under the Apache License, Version 2.0 + (the "License"); you may not use this file except in compliance with + the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +--> +<!-- $Id$ --> +<testcase> + <info> + <p> + This test checks that blocks of texts are re-laid out after a change of the flow ipd. + </p> + </info> + <fo> + <fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format"> + <fo:layout-master-set> + <fo:simple-page-master master-name="narrow" + page-height="300pt" page-width="400pt" margin="50pt"> + <fo:region-body background-color="#F0F0F0"/> + </fo:simple-page-master> + <fo:simple-page-master master-name="wide" + page-height="300pt" page-width="600pt" margin="50pt"> + <fo:region-body background-color="#F0F0F0"/> + </fo:simple-page-master> + <fo:page-sequence-master master-name="pages"> + <fo:single-page-master-reference master-reference="narrow"/> + <fo:repeatable-page-master-reference master-reference="wide"/> + </fo:page-sequence-master> + </fo:layout-master-set> + <fo:page-sequence master-reference="pages"> + <fo:flow flow-name="xsl-region-body" language="en" hyphenate="true"> + <fo:block text-align="justify" id="surrounding" + space-before.minimum="10pt" + space-before.optimum="12pt" + space-before.maximum="50pt"> + <fo:block space-before="inherit" id="b1">In olden times when wishing still helped one, + there lived a king whose daughters were all beautiful, but the youngest was so + beautiful that the sun itself, which has seen so much, was astonished whenever it + shone in her face.</fo:block> + <fo:block space-before="inherit" id="b2">In olden times when wishing still helped one, + there lived a king whose daughters were all beautiful, but the youngest was so + beautiful that the sun itself, which has seen so much, was astonished whenever it + shone in her face.</fo:block> + <fo:block space-before="inherit" id="b3" border-top="1pt solid black" + border-before-width.conditionality="retain">In olden times when wishing still helped + one, there lived a king whose daughters were all beautiful, but the youngest was so + beautiful that the sun itself, which has seen so much, was astonished whenever it + shone in her face. In olden times when wishing still helped one, there lived a king + whose daughters were all beautiful, but the youngest was so beautiful that the sun + itself, which has seen so much, was astonished whenever it shone in her + face.</fo:block> + <fo:block space-before="inherit" id="b4" border-top="1pt solid black">In olden times + when wishing still helped one, there lived a king whose daughters were all beautiful, + but the youngest was so beautiful that the sun itself, which has seen so much, was + astonished whenever it shone in her face.</fo:block> + <fo:block space-before="inherit" id="b5">In olden times when wishing still helped one, + there lived a king whose daughters were all beautiful, but the youngest was so + beautiful that the sun itself, which has seen so much, was astonished whenever it + shone in her face.</fo:block> + </fo:block> + </fo:flow> + </fo:page-sequence> + </fo:root> + </fo> + <checks> + <eval expected="13100" xpath="//pageViewport[1]//flow/block/block[2]/@space-before"/> + <eval expected="13100" xpath="//pageViewport[1]//flow/block/block[3]/@space-before"/> + <eval expected="(solid,#000000,1000)" + xpath="//pageViewport[1]//flow/block/block[3]/@border-before"/> + <eval expected="In" xpath="//pageViewport[1]//flow/block/block[3]/lineArea[4]/text/word[position()=last()]"/> + <eval expected="500000" xpath="//pageViewport[2]//flow/block/@ipd"/> + <eval expected="(solid,#000000,1000)" + xpath="//pageViewport[2]//flow/block/block[1]/@border-before"/> + <eval expected="500000" xpath="//pageViewport[2]//flow/block/block[1]/@ipd"/> + <eval expected="500000" xpath="//pageViewport[2]//flow/block/block[1]/lineArea[1]/@ipd"/> + <eval expected="olden" xpath="//pageViewport[2]//flow/block/block[1]/lineArea[1]/text/word[1]"/> + <eval expected="500000" xpath="//pageViewport[2]//flow/block/block[2]/@ipd"/> + <eval expected="12000" xpath="//pageViewport[2]//flow/block/block[2]/@space-before"/> + <eval expected="(solid,#000000,1000)" + xpath="//pageViewport[2]//flow/block/block[2]/@border-before"/> + <eval expected="500000" xpath="//pageViewport[2]//flow/block/block[2]/lineArea[1]/@ipd"/> + <eval expected="500000" xpath="//pageViewport[2]//flow/block/block[3]/@ipd"/> + <eval expected="12000" xpath="//pageViewport[2]//flow/block/block[3]/@space-before"/> + <eval expected="500000" xpath="//pageViewport[2]//flow/block/block[3]/lineArea[1]/@ipd"/> + </checks> +</testcase> diff --git a/test/layoutengine/standard-testcases/flow_changing-ipd_2.xml b/test/layoutengine/standard-testcases/flow_changing-ipd_2.xml new file mode 100644 index 000000000..dbe002e43 --- /dev/null +++ b/test/layoutengine/standard-testcases/flow_changing-ipd_2.xml @@ -0,0 +1,75 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + Licensed to the Apache Software Foundation (ASF) under one or more + contributor license agreements. See the NOTICE file distributed with + this work for additional information regarding copyright ownership. + The ASF licenses this file to You under the Apache License, Version 2.0 + (the "License"); you may not use this file except in compliance with + the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +--> +<!-- $Id$ --> +<testcase> + <info> + <p> + This test checks that blocks of texts are re-laid out after a change of the flow ipd. + </p> + </info> + <fo> + <fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format"> + <fo:layout-master-set> + <fo:simple-page-master master-name="narrow" + page-height="300pt" page-width="400pt" margin="50pt"> + <fo:region-body background-color="#F0F0F0"/> + </fo:simple-page-master> + <fo:simple-page-master master-name="wide" + page-height="300pt" page-width="600pt" margin="50pt"> + <fo:region-body background-color="#F0F0F0"/> + </fo:simple-page-master> + <fo:page-sequence-master master-name="pages"> + <fo:single-page-master-reference master-reference="narrow"/> + <fo:repeatable-page-master-reference master-reference="wide"/> + </fo:page-sequence-master> + </fo:layout-master-set> + <fo:page-sequence master-reference="pages"> + <fo:flow flow-name="xsl-region-body"> + <fo:block id="b1">In olden times when wishing still helped one, there lived a king whose + daughters were all beautiful, but the youngest was so beautiful that the sun itself, + which has seen so much, was astonished whenever it shone in her face.</fo:block> + <fo:block id="b2">In olden times when wishing still helped one, there lived a king whose + daughters were all beautiful, but the youngest was so beautiful that the sun itself, + which has seen so much, was astonished whenever it shone in her face.</fo:block> + <fo:block id="b3">In olden times when wishing still helped one, there lived a king whose + daughters were all beautiful, but the youngest was so beautiful that the sun itself, + which has seen so much, was astonished whenever it shone in her face. In olden times + when wishing still helped one, there lived a king whose daughters were all beautiful, + but the youngest was so beautiful that the sun itself, which has seen so much, was + astonished whenever it shone in her face.</fo:block> + <fo:block id="b4">In olden times when wishing still helped one, there lived a king whose + daughters were all beautiful, but the youngest was so beautiful that the sun itself, + which has seen so much, was astonished whenever it shone in her face.</fo:block> + <fo:block id="b5">In olden times when wishing still helped one, there lived a king whose + daughters were all beautiful, but the youngest was so beautiful that the sun itself, + which has seen so much, was astonished whenever it shone in her face.</fo:block> + </fo:flow> + </fo:page-sequence> + </fo:root> + </fo> + <checks> + <eval expected="has" xpath="//pageViewport[1]//flow/block[3]/lineArea[3]/text/word[position()=last()]"/> + <eval expected="500000" xpath="//pageViewport[2]//flow/block[1]/@ipd"/> + <eval expected="500000" xpath="//pageViewport[2]//flow/block[1]/lineArea[1]/@ipd"/> + <eval expected="seen" xpath="//pageViewport[2]//flow/block[1]/lineArea[1]/text/word[1]"/> + <eval expected="500000" xpath="//pageViewport[2]//flow/block[2]/@ipd"/> + <eval expected="500000" xpath="//pageViewport[2]//flow/block[2]/lineArea[1]/@ipd"/> + <eval expected="500000" xpath="//pageViewport[2]//flow/block[3]/@ipd"/> + <eval expected="500000" xpath="//pageViewport[2]//flow/block[3]/lineArea[1]/@ipd"/> + </checks> +</testcase> diff --git a/test/layoutengine/standard-testcases/flow_changing-ipd_3.xml b/test/layoutengine/standard-testcases/flow_changing-ipd_3.xml new file mode 100644 index 000000000..2badfe71e --- /dev/null +++ b/test/layoutengine/standard-testcases/flow_changing-ipd_3.xml @@ -0,0 +1,86 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + Licensed to the Apache Software Foundation (ASF) under one or more + contributor license agreements. See the NOTICE file distributed with + this work for additional information regarding copyright ownership. + The ASF licenses this file to You under the Apache License, Version 2.0 + (the "License"); you may not use this file except in compliance with + the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +--> +<!-- $Id$ --> +<testcase> + <info> + <p> + This test checks that a change of IPD between two blocks is correctly handled. + </p> + </info> + <fo> + <fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format"> + <fo:layout-master-set> + <fo:simple-page-master master-name="narrow" + page-height="300pt" page-width="400pt" margin="50pt"> + <fo:region-body background-color="#F0F0F0"/> + </fo:simple-page-master> + <fo:simple-page-master master-name="wide" + page-height="300pt" page-width="600pt" margin="50pt"> + <fo:region-body background-color="#F0F0F0"/> + </fo:simple-page-master> + <fo:page-sequence-master master-name="pages"> + <fo:single-page-master-reference master-reference="narrow"/> + <fo:repeatable-page-master-reference master-reference="wide"/> + </fo:page-sequence-master> + </fo:layout-master-set> + <fo:page-sequence master-reference="pages"> + <fo:flow flow-name="xsl-region-body"> + <fo:block text-align="justify" id="surrounding" + space-before.minimum="10pt" + space-before.optimum="12pt" + space-before.maximum="50pt"> + <fo:block space-before="inherit" id="b1">In olden times when wishing still helped one, + there lived a king whose daughters were all beautiful, but the youngest was so + beautiful that the sun itself, which has seen so much, was astonished whenever it + shone in her face.</fo:block> + <fo:block space-before="inherit" id="b2">In olden times when wishing still helped one, + there lived a king whose daughters were all beautiful, but the youngest was so + beautiful that the sun itself, which has seen so much, was astonished whenever it + shone in her face.</fo:block> + <fo:block space-before="inherit" id="b3">In olden times when wishing still helped one, + there lived a king whose daughters were all beautiful, but the youngest was so + beautiful that the sun itself, which has seen so much, was astonished whenever it + shone in her face.</fo:block> + <fo:block border-top="1pt solid black" space-before.minimum="10pt" + space-before.optimum="12pt" space-before.maximum="50pt" + space-before.conditionality="retain" id="b4">In olden times when wishing still helped + one, there lived a king whose daughters were all beautiful, but the youngest was so + beautiful that the sun itself, which has seen so much, was astonished whenever it + shone in her face.</fo:block> + <fo:block space-before="inherit" id="b5">In olden times when wishing still helped one, + there lived a king whose daughters were all beautiful, but the youngest was so + beautiful that the sun itself, which has seen so much, was astonished whenever it + shone in her face.</fo:block> + </fo:block> + </fo:flow> + </fo:page-sequence> + </fo:root> + </fo> + <checks> + <eval expected="face." xpath="//pageViewport[1]//flow/block/block[3]/lineArea[4]/text/word[position()=last()]"/> + <eval expected="12000" xpath="//pageViewport[2]//flow/block/block[1]/@space-before"/> + <eval expected="500000" xpath="//pageViewport[2]//flow/block/block[1]/@ipd"/> + <eval expected="500000" xpath="//pageViewport[2]//flow/block/block[1]/lineArea[1]/@ipd"/> + <eval expected="(solid,#000000,1000)" + xpath="//pageViewport[2]//flow/block/block[1]/@border-before"/> + <eval expected="In" xpath="//pageViewport[2]//flow/block/block[1]/lineArea[1]/text/word[1]"/> + <eval expected="olden" xpath="//pageViewport[2]//flow/block/block[1]/lineArea[1]/text/word[2]"/> + <eval expected="500000" xpath="//pageViewport[2]//flow/block/block[2]/@ipd"/> + <eval expected="500000" xpath="//pageViewport[2]//flow/block/block[2]/lineArea[1]/@ipd"/> + </checks> +</testcase> diff --git a/test/layoutengine/standard-testcases/flow_changing-ipd_4.xml b/test/layoutengine/standard-testcases/flow_changing-ipd_4.xml new file mode 100644 index 000000000..fe166d05c --- /dev/null +++ b/test/layoutengine/standard-testcases/flow_changing-ipd_4.xml @@ -0,0 +1,159 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + Licensed to the Apache Software Foundation (ASF) under one or more + contributor license agreements. See the NOTICE file distributed with + this work for additional information regarding copyright ownership. + The ASF licenses this file to You under the Apache License, Version 2.0 + (the "License"); you may not use this file except in compliance with + the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +--> +<!-- $Id$ --> +<testcase> + <info> + <p> + This test checks that non-restartable elements still show up at IPD change, even if not + re-laid out. + </p> + </info> + <fo> + <fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format"> + <fo:layout-master-set> + <fo:simple-page-master master-name="narrow" + page-height="300pt" page-width="400pt" margin="50pt"> + <fo:region-body background-color="#F0F0F0"/> + </fo:simple-page-master> + <fo:simple-page-master master-name="wide" + page-height="300pt" page-width="600pt" margin="50pt"> + <fo:region-body background-color="#F0F0F0"/> + </fo:simple-page-master> + <fo:page-sequence-master master-name="pages"> + <fo:single-page-master-reference master-reference="narrow"/> + <fo:repeatable-page-master-reference master-reference="wide"/> + </fo:page-sequence-master> + </fo:layout-master-set> + <fo:page-sequence master-reference="pages"> + <fo:flow flow-name="xsl-region-body" text-align="justify"> + <fo:block space-before="10pt" id="b1_1">In olden times when wishing still helped one, there + lived a king whose daughters were all beautiful, but the youngest was so beautiful that + the sun itself, which has seen so much, was astonished whenever it shone in her + face.</fo:block> + <fo:block space-before="10pt" id="b1_2">In olden times when wishing still helped one, there + lived a king whose daughters were all beautiful, but the youngest was so beautiful that + the sun itself, which has seen so much, was astonished whenever it shone in her + face.</fo:block> + <fo:table table-layout="fixed" width="100%" border="1pt solid black" space-before="10pt" + padding="2pt" border-collapse="separate"> + <fo:table-body> + <fo:table-row> + <fo:table-cell> + <fo:block space-before="10pt" id="b1_3">In olden times when wishing still helped + one, there lived a king whose daughters were all beautiful, but the youngest was + so beautiful that the sun itself, which has seen so much, was astonished + whenever it shone in her face.</fo:block> + <fo:block space-before="10pt" id="b1_4">In olden times when wishing still helped + one, there lived a king whose daughters were all beautiful, but the youngest was + so beautiful that the sun itself, which has seen so much, was astonished + whenever it shone in her face.</fo:block> + </fo:table-cell> + </fo:table-row> + </fo:table-body> + </fo:table> + <fo:block space-before="10pt" id="b1_5" border-top="1pt solid red">In olden times when + wishing still helped one, there lived a king whose daughters were all beautiful, but the + youngest was so beautiful that the sun itself, which has seen so much, was astonished + whenever it shone in her face.</fo:block> + <fo:block space-before="10pt" id="b1_6">In olden times when wishing still helped one, there + lived a king whose daughters were all beautiful, but the youngest was so beautiful that + the sun itself, which has seen so much, was astonished whenever it shone in her + face.</fo:block> + </fo:flow> + </fo:page-sequence> + <fo:page-sequence master-reference="pages"> + <fo:flow flow-name="xsl-region-body" text-align="justify"> + <fo:block space-before="10pt" id="b2_1">In olden times when wishing still helped one, there + lived a king whose daughters were all beautiful, but the youngest was so beautiful that + the sun itself, which has seen so much, was astonished whenever it shone in her + face.</fo:block> + <fo:block space-before="10pt" id="b2_2">In olden times when wishing still helped one, there + lived a king whose daughters were all beautiful, but the youngest was so beautiful that + the sun itself, which has seen so much, was astonished whenever it shone in her + face.</fo:block> + <fo:list-block space-before="10pt" provisional-distance-between-starts="0.5cm"> + <fo:list-item> + <fo:list-item-label end-indent="label-end()"> + <fo:block start-indent="2pt">•</fo:block> + </fo:list-item-label> + <fo:list-item-body start-indent="body-start()"> + <fo:block space-before="10pt" id="b2_3">In olden times when wishing still helped + one, there lived a king whose daughters were all beautiful, but the youngest was + so beautiful that the sun itself, which has seen so much, was + astonished…</fo:block> + </fo:list-item-body> + </fo:list-item> + <fo:list-item> + <fo:list-item-label end-indent="label-end()"> + <fo:block start-indent="2pt">•</fo:block> + </fo:list-item-label> + <fo:list-item-body start-indent="body-start()"> + <fo:block id="b2_4">In olden times when wishing still helped one, there lived a king + whose daughters were all beautiful, but the youngest was so beautiful that the sun + itself, which has seen so much, was astonished…</fo:block> + </fo:list-item-body> + </fo:list-item> + </fo:list-block> + <fo:block space-before="10pt" space-before.conditionality="retain" border-top="1pt solid + red" id="b2_5">In olden times when wishing still helped one, there lived a king whose + daughters were all beautiful, but the youngest was so beautiful that the sun itself, + which has seen so much, was astonished whenever it shone in her face.</fo:block> + <fo:block space-before="10pt" id="b2_6">In olden times when wishing still helped one, there + lived a king whose daughters were all beautiful, but the youngest was so beautiful that + the sun itself, which has seen so much, was astonished whenever it shone in her + face.</fo:block> + </fo:flow> + </fo:page-sequence> + </fo:root> + </fo> + <checks> + <!-- First page sequence – table --> + <eval expected="(solid,#000000,1000)" + xpath="//pageSequence[1]/pageViewport[2]//flow/block[1]/@border-after"/> + <eval expected="300000" xpath="//pageSequence[1]/pageViewport[2]//flow/block[1]//lineArea[1]/@ipd"/> + <eval expected="b1_4" xpath="//pageSequence[1]/pageViewport[2]//flow/block[1]/block/block/@prod-id"/> + <eval expected="In" xpath="//pageSequence[1]/pageViewport[2]//flow/block[1]//lineArea[1]/text/word[1]"/> + <eval expected="olden" xpath="//pageSequence[1]/pageViewport[2]//flow/block[1]//lineArea[1]/text/word[2]"/> + <eval expected="her" xpath="//pageSequence[1]/pageViewport[2]//flow/block[1]//lineArea[4]/text/word[position()=last()-1]"/> + <eval expected="face." xpath="//pageSequence[1]/pageViewport[2]//flow/block[1]//lineArea[4]/text/word[position()=last()]"/> + + <eval expected="b1_5" xpath="//pageSequence[1]/pageViewport[2]//flow/block[2]/@prod-id"/> + <eval expected="500000" xpath="//pageSequence[1]/pageViewport[2]//flow/block[2]/@ipd"/> + <eval expected="(solid,#ff0000,1000)" + xpath="//pageSequence[1]/pageViewport[2]//flow/block[2]/@border-before"/> + <eval expected="In" xpath="//pageSequence[1]/pageViewport[2]//flow/block[2]//lineArea[1]/text/word[1]"/> + <eval expected="olden" xpath="//pageSequence[1]/pageViewport[2]//flow/block[2]//lineArea[1]/text/word[2]"/> + + <!-- Second page sequence – list --> + <eval expected="300000" xpath="//pageSequence[2]/pageViewport[2]//flow/block[1]/@ipd"/> + <eval expected="b2_4" xpath="//pageSequence[2]/pageViewport[2]//flow/block[1]/block/block[2]/block/@prod-id"/> + <eval expected="In" xpath="//pageSequence[2]/pageViewport[2]//flow/block[1]/block/block[2]/block/lineArea[1]/text/word[1]"/> + <eval expected="olden" xpath="//pageSequence[2]/pageViewport[2]//flow/block[1]/block/block[2]/block/lineArea[1]/text/word[2]"/> + <eval expected="was" xpath="//pageSequence[2]/pageViewport[2]//flow/block[1]/block/block[2]/block/lineArea[4]/text/word[position()=last()-1]"/> + <eval expected="astonished…" + xpath="//pageSequence[2]/pageViewport[2]//flow/block[1]/block/block[2]/block/lineArea[4]/text/word[position()=last()]"/> + + <eval expected="b2_5" xpath="//pageSequence[2]/pageViewport[2]//flow/block[2]/@prod-id"/> + <eval expected="500000" xpath="//pageSequence[2]/pageViewport[2]//flow/block[2]/@ipd"/> + <eval expected="10000" xpath="//pageSequence[2]/pageViewport[2]//flow/block[2]/@space-before"/> + <eval expected="(solid,#ff0000,1000)" + xpath="//pageSequence[2]/pageViewport[2]//flow/block[2]/@border-before"/> + <eval expected="In" xpath="//pageSequence[2]/pageViewport[2]//flow/block[2]//lineArea[1]/text/word[1]"/> + <eval expected="olden" xpath="//pageSequence[2]/pageViewport[2]//flow/block[2]//lineArea[1]/text/word[2]"/> + </checks> +</testcase> diff --git a/test/layoutengine/standard-testcases/flow_changing-ipd_block-container_1.xml b/test/layoutengine/standard-testcases/flow_changing-ipd_block-container_1.xml new file mode 100644 index 000000000..82b757d46 --- /dev/null +++ b/test/layoutengine/standard-testcases/flow_changing-ipd_block-container_1.xml @@ -0,0 +1,101 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + Licensed to the Apache Software Foundation (ASF) under one or more + contributor license agreements. See the NOTICE file distributed with + this work for additional information regarding copyright ownership. + The ASF licenses this file to You under the Apache License, Version 2.0 + (the "License"); you may not use this file except in compliance with + the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +--> +<!-- $Id$ --> +<testcase> + <info> + <p> + This test checks that block-container elements correctly support an IPD change. + </p> + <!-- NOTE: This test case is a copy of flow_changing-ipd_1.xml, modified to simply surround + block 3 with a block-container. --> + </info> + <fo> + <fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format"> + <fo:layout-master-set> + <fo:simple-page-master master-name="narrow" + page-height="300pt" page-width="400pt" margin="50pt"> + <fo:region-body background-color="#F0F0F0"/> + </fo:simple-page-master> + <fo:simple-page-master master-name="wide" + page-height="300pt" page-width="600pt" margin="50pt"> + <fo:region-body background-color="#F0F0F0"/> + </fo:simple-page-master> + <fo:page-sequence-master master-name="pages"> + <fo:single-page-master-reference master-reference="narrow"/> + <fo:repeatable-page-master-reference master-reference="wide"/> + </fo:page-sequence-master> + </fo:layout-master-set> + <fo:page-sequence master-reference="pages"> + <fo:flow flow-name="xsl-region-body"> + <fo:block text-align="justify" id="surrounding" + space-before.minimum="10pt" + space-before.optimum="12pt" + space-before.maximum="50pt"> + <fo:block space-before="inherit" id="b1">In olden times when wishing still helped one, + there lived a king whose daughters were all beautiful, but the youngest was so + beautiful that the sun itself, which has seen so much, was astonished whenever it + shone in her face.</fo:block> + <fo:block space-before="inherit" id="b2">In olden times when wishing still helped one, + there lived a king whose daughters were all beautiful, but the youngest was so + beautiful that the sun itself, which has seen so much, was astonished whenever it + shone in her face.</fo:block> + <fo:block-container space-before="inherit"> + <fo:block id="b3" border-top="1pt solid black" + border-before-width.conditionality="retain">In olden times when wishing still helped + one, there lived a king whose daughters were all beautiful, but the youngest was so + beautiful that the sun itself, which has seen so much, was astonished whenever it + shone in her face. In olden times when wishing still helped one, there lived a king + whose daughters were all beautiful, but the youngest was so beautiful that the sun + itself, which has seen so much, was astonished whenever it shone in her + face.</fo:block> + </fo:block-container> + <fo:block space-before="inherit" id="b4" border-top="1pt solid black">In olden times + when wishing still helped one, there lived a king whose daughters were all beautiful, + but the youngest was so beautiful that the sun itself, which has seen so much, was + astonished whenever it shone in her face.</fo:block> + <fo:block space-before="inherit" id="b5">In olden times when wishing still helped one, + there lived a king whose daughters were all beautiful, but the youngest was so + beautiful that the sun itself, which has seen so much, was astonished whenever it + shone in her face.</fo:block> + </fo:block> + </fo:flow> + </fo:page-sequence> + </fo:root> + </fo> + <checks> + <eval expected="13100" xpath="//pageViewport[1]//flow/block/block[2]/@space-before"/> + <eval expected="13100" xpath="//pageViewport[1]//flow/block/block[3]/@space-before"/> + <eval expected="(solid,#000000,1000)" + xpath="//pageViewport[1]//flow/block/block[3]/block/block/@border-before"/> + <eval expected="In" xpath="//pageViewport[1]//flow/block/block[3]/block/block/lineArea[4]/text/word[position()=last()]"/> + <eval expected="500000" xpath="//pageViewport[2]//flow/block/@ipd"/> + <eval expected="(solid,#000000,1000)" + xpath="//pageViewport[2]//flow/block/block[1]/block/block/@border-before"/> + <eval expected="500000" xpath="//pageViewport[2]//flow/block/block[1]/block/block/@ipd"/> + <eval expected="500000" xpath="//pageViewport[2]//flow/block/block[1]/block/block/lineArea[1]/@ipd"/> + <eval expected="olden" xpath="//pageViewport[2]//flow/block/block[1]/block/block/lineArea[1]/text/word[1]"/> + <eval expected="500000" xpath="//pageViewport[2]//flow/block/block[2]/@ipd"/> + <eval expected="12000" xpath="//pageViewport[2]//flow/block/block[2]/@space-before"/> + <eval expected="(solid,#000000,1000)" + xpath="//pageViewport[2]//flow/block/block[2]/@border-before"/> + <eval expected="500000" xpath="//pageViewport[2]//flow/block/block[2]/lineArea[1]/@ipd"/> + <eval expected="500000" xpath="//pageViewport[2]//flow/block/block[3]/@ipd"/> + <eval expected="12000" xpath="//pageViewport[2]//flow/block/block[3]/@space-before"/> + <eval expected="500000" xpath="//pageViewport[2]//flow/block/block[3]/lineArea[1]/@ipd"/> + </checks> +</testcase> diff --git a/test/layoutengine/standard-testcases/flow_changing-ipd_block-container_2.xml b/test/layoutengine/standard-testcases/flow_changing-ipd_block-container_2.xml new file mode 100644 index 000000000..7a2bb9b19 --- /dev/null +++ b/test/layoutengine/standard-testcases/flow_changing-ipd_block-container_2.xml @@ -0,0 +1,89 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + Licensed to the Apache Software Foundation (ASF) under one or more + contributor license agreements. See the NOTICE file distributed with + this work for additional information regarding copyright ownership. + The ASF licenses this file to You under the Apache License, Version 2.0 + (the "License"); you may not use this file except in compliance with + the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +--> +<!-- $Id$ --> +<testcase> + <info> + <p> + This test checks that a change of IPD between two blocks surrounded by a block-container is + correctly handled. + </p> + <!-- NOTE: This test case is a copy of flow_changing-ipd_3.xml, with the surrounding block + replaced with a block-container. --> + </info> + <fo> + <fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format"> + <fo:layout-master-set> + <fo:simple-page-master master-name="narrow" + page-height="300pt" page-width="400pt" margin="50pt"> + <fo:region-body background-color="#F0F0F0"/> + </fo:simple-page-master> + <fo:simple-page-master master-name="wide" + page-height="300pt" page-width="600pt" margin="50pt"> + <fo:region-body background-color="#F0F0F0"/> + </fo:simple-page-master> + <fo:page-sequence-master master-name="pages"> + <fo:single-page-master-reference master-reference="narrow"/> + <fo:repeatable-page-master-reference master-reference="wide"/> + </fo:page-sequence-master> + </fo:layout-master-set> + <fo:page-sequence master-reference="pages"> + <fo:flow flow-name="xsl-region-body"> + <fo:block-container text-align="justify" id="surrounding" + space-before.minimum="10pt" + space-before.optimum="12pt" + space-before.maximum="50pt"> + <fo:block space-before="inherit" id="b1">In olden times when wishing still helped one, + there lived a king whose daughters were all beautiful, but the youngest was so + beautiful that the sun itself, which has seen so much, was astonished whenever it + shone in her face.</fo:block> + <fo:block space-before="inherit" id="b2">In olden times when wishing still helped one, + there lived a king whose daughters were all beautiful, but the youngest was so + beautiful that the sun itself, which has seen so much, was astonished whenever it + shone in her face.</fo:block> + <fo:block space-before="inherit" id="b3">In olden times when wishing still helped one, + there lived a king whose daughters were all beautiful, but the youngest was so + beautiful that the sun itself, which has seen so much, was astonished whenever it + shone in her face.</fo:block> + <fo:block border-top="1pt solid black" space-before.minimum="10pt" + space-before.optimum="12pt" space-before.maximum="50pt" + space-before.conditionality="retain" id="b4">In olden times when wishing still helped + one, there lived a king whose daughters were all beautiful, but the youngest was so + beautiful that the sun itself, which has seen so much, was astonished whenever it + shone in her face.</fo:block> + <fo:block space-before="inherit" id="b5">In olden times when wishing still helped one, + there lived a king whose daughters were all beautiful, but the youngest was so + beautiful that the sun itself, which has seen so much, was astonished whenever it + shone in her face.</fo:block> + </fo:block-container> + </fo:flow> + </fo:page-sequence> + </fo:root> + </fo> + <checks> + <eval expected="face." xpath="//pageViewport[1]//flow/block/block/block[3]/lineArea[4]/text/word[position()=last()]"/> + <eval expected="12000" xpath="//pageViewport[2]//flow/block/block/block[1]/@space-before"/> + <eval expected="500000" xpath="//pageViewport[2]//flow/block/block/block[1]/@ipd"/> + <eval expected="500000" xpath="//pageViewport[2]//flow/block/block/block[1]/lineArea[1]/@ipd"/> + <eval expected="(solid,#000000,1000)" + xpath="//pageViewport[2]//flow/block/block/block[1]/@border-before"/> + <eval expected="In" xpath="//pageViewport[2]//flow/block/block/block[1]/lineArea[1]/text/word[1]"/> + <eval expected="olden" xpath="//pageViewport[2]//flow/block/block/block[1]/lineArea[1]/text/word[2]"/> + <eval expected="500000" xpath="//pageViewport[2]//flow/block/block/block[2]/@ipd"/> + <eval expected="500000" xpath="//pageViewport[2]//flow/block/block/block[2]/lineArea[1]/@ipd"/> + </checks> +</testcase> |