aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorManuel Mall <manuel@apache.org>2005-11-03 16:20:50 +0000
committerManuel Mall <manuel@apache.org>2005-11-03 16:20:50 +0000
commit1ce45b1a097d8ef2de85a97c45069221b7cdc822 (patch)
tree27ca7b802788af418c861da16039350e6e74428c /test
parenteb14decc6d5b6cfd911ac8e2660763602cf19d65 (diff)
downloadxmlgraphics-fop-1ce45b1a097d8ef2de85a97c45069221b7cdc822.tar.gz
xmlgraphics-fop-1ce45b1a097d8ef2de85a97c45069221b7cdc822.zip
Fixed white space handling during refinement, added test cases, corrected error in graphics handling
git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@330576 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'test')
-rw-r--r--test/layoutengine/disabled-testcases.txt4
-rwxr-xr-xtest/layoutengine/testcases/block_linefeed-treatment.xml80
-rwxr-xr-xtest/layoutengine/testcases/block_white-space-collapse_1.xml151
-rwxr-xr-xtest/layoutengine/testcases/block_white-space-collapse_2.xml111
-rwxr-xr-xtest/layoutengine/testcases/block_white-space-treatment_1.xml85
-rwxr-xr-xtest/layoutengine/testcases/block_white-space-treatment_2.xml85
-rw-r--r--test/layoutengine/testcases/block_white-space_1.xml (renamed from test/layoutengine/testcases/block_white-space-collapse.xml)0
7 files changed, 516 insertions, 0 deletions
diff --git a/test/layoutengine/disabled-testcases.txt b/test/layoutengine/disabled-testcases.txt
index c8e4e31bc..156f1da7d 100644
--- a/test/layoutengine/disabled-testcases.txt
+++ b/test/layoutengine/disabled-testcases.txt
@@ -1,8 +1,12 @@
block-container_reference-orientation_bug36391.xml
block-container_space-before_space-after_3.xml
block_font-stretch.xml
+block_linefeed-treatment.xml
block_padding_2.xml
block_space-before_space-after_8.xml
+block_white-space-collapse_2.xml
+block_white-space-treatment_1.xml
+block_white-space-treatment_2.xml
block_word-spacing.xml
block_word-spacing_text-align_justify.xml
external-graphic_oversized.xml
diff --git a/test/layoutengine/testcases/block_linefeed-treatment.xml b/test/layoutengine/testcases/block_linefeed-treatment.xml
new file mode 100755
index 000000000..3dc540562
--- /dev/null
+++ b/test/layoutengine/testcases/block_linefeed-treatment.xml
@@ -0,0 +1,80 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Copyright 2005 The Apache Software Foundation
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+<!-- $Id$ -->
+<testcase>
+ <info>
+ <p>
+ This test checks white space handling for linefeed-treatment.
+ This currently fails because
+ a) Preserved linefeeds in fo:character are not handled correctly
+ b) ZWSP are not handled correctly
+ </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 linefeed-treatment="treat-as-space" background-color="silver" margin="1pt 0pt 1pt 0pt">
+treat-as-space
+all<fo:character character="&#xa;"/>linefeeds
+</fo:block>
+ <fo:block linefeed-treatment="ignore" background-color="silver" margin="1pt 0pt 1pt 0pt">
+ignore
+all<fo:character character="&#xa;"/>linefeeds
+</fo:block>
+ <fo:block linefeed-treatment="preserve" background-color="silver" margin="1pt 0pt 1pt 0pt">
+preserve
+all<fo:character character="&#xa;"/>linefeeds
+</fo:block>
+ <fo:block linefeed-treatment="treat-as-zero-width-space" background-color="silver" margin="1pt 0pt 1pt 0pt">
+treat-as-zero-width-space
+all<fo:character character="&#xa;"/>linefeeds
+</fo:block>
+ </fo:flow>
+ </fo:page-sequence>
+ </fo:root>
+ </fo>
+ <checks>
+ <eval expected="2" xpath="count(//flow/block[1]/lineArea[1]/text[1]/word)"/>
+ <eval expected="1" xpath="count(//flow/block[1]/lineArea[1]/text[1]/space)"/>
+ <eval expected="1" xpath="count(//flow/block[1]/lineArea[1]/char)"/>
+ <eval expected="1" xpath="count(//flow/block[1]/lineArea[1]/text[2]/word)"/>
+ <eval expected="0" xpath="count(//flow/block[1]/lineArea[1]/text[2]/space)"/>
+
+ <eval expected="1" xpath="count(//flow/block[2]/lineArea[1]/text[1]/word)"/>
+ <eval expected="0" xpath="count(//flow/block[2]/lineArea[1]/text[1]/space)"/>
+ <eval expected="1" xpath="count(//flow/block[2]/lineArea[1]/text[2]/word)"/>
+ <eval expected="0" xpath="count(//flow/block[2]/lineArea[1]/text[2]/space)"/>
+
+ <eval expected="0" xpath="count(//flow/block[3]/lineArea[1]/text)"/>
+ <eval expected="1" xpath="count(//flow/block[3]/lineArea[2]/text/word)"/>
+ <eval expected="0" xpath="count(//flow/block[3]/lineArea[2]/text/space)"/>
+ <eval expected="1" xpath="count(//flow/block[3]/lineArea[3]/text/word)"/>
+ <eval expected="0" xpath="count(//flow/block[3]/lineArea[3]/text/space)"/>
+ <eval expected="1" xpath="count(//flow/block[3]/lineArea[4]/text/word)"/>
+ <eval expected="0" xpath="count(//flow/block[3]/lineArea[4]/text/space)"/>
+
+ <eval expected="1" xpath="count(//flow/block[4]/lineArea[1]/text/word)"/>
+ <eval expected="0" xpath="count(//flow/block[4]/lineArea[1]/text/space)"/>
+
+ </checks>
+</testcase>
diff --git a/test/layoutengine/testcases/block_white-space-collapse_1.xml b/test/layoutengine/testcases/block_white-space-collapse_1.xml
new file mode 100755
index 000000000..a935401ad
--- /dev/null
+++ b/test/layoutengine/testcases/block_white-space-collapse_1.xml
@@ -0,0 +1,151 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Copyright 2005 The Apache Software Foundation
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+<!-- $Id$ -->
+<testcase>
+ <info>
+ <p>
+ This test checks basic white space handling for white-space-collapse="true".
+ </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 background-color="silver" margin="1pt 0pt 1pt 0pt">
+ spaces
+ before
+ and
+ after
+ each
+ word <fo:character character="&#xa;" />
+<fo:character character=" " /><fo:character character=" " /> and
+ linefeeds<fo:character character=" " /><fo:character character=" " />
+ everywhere <fo:character character=" " />
+ </fo:block>
+ <fo:block background-color="silver" margin="1pt 0pt 1pt 0pt">
+ <fo:block background-color="orange">
+ nested block level
+ </fo:block>
+ <fo:block background-color="red">
+ nested block level
+ </fo:block>
+ </fo:block>
+ <fo:block background-color="silver" margin="1pt 0pt 1pt 0pt">
+ <fo:inline background-color="orange">
+ inline level
+ </fo:inline>
+ <fo:inline background-color="red">
+ inline level
+ </fo:inline>
+ </fo:block>
+ <fo:block background-color="silver" margin="1pt 0pt 1pt 0pt">
+ block level
+ <fo:inline background-color="orange">
+ inline level
+ </fo:inline>
+ block
+ <fo:inline background-color="red">
+ inline level
+ </fo:inline>
+ block level
+ </fo:block>
+ <fo:block background-color="silver" margin="1pt 0pt 1pt 0pt">
+ <fo:inline background-color="orange">
+ inline level
+ <fo:inline background-color="red">
+ nested inline level
+ </fo:inline>
+ </fo:inline>
+ </fo:block>
+ <fo:block background-color="silver" margin="1pt 0pt 1pt 0pt">
+ <fo:inline background-color="orange">
+ <fo:inline background-color="red">
+ nested inline level
+ </fo:inline>
+ inline level
+ </fo:inline>
+ </fo:block>
+ <fo:block background-color="silver" margin="1pt 0pt 1pt 0pt">
+ block level
+ <fo:inline background-color="orange">
+ <fo:inline background-color="red">
+ nested inline level
+ </fo:inline>
+ inline level
+ </fo:inline>
+ block level
+ </fo:block>
+ </fo:flow>
+ </fo:page-sequence>
+ </fo:root>
+ </fo>
+ <checks>
+ <eval expected="6" xpath="count(//flow/block[1]/lineArea[1]/text[1]/word)"/>
+ <eval expected="6" xpath="count(//flow/block[1]/lineArea[1]/text[1]/space)"/>
+ <eval expected="2" xpath="count(//flow/block[1]/lineArea[1]/text[2]/word)"/>
+ <eval expected="1" xpath="count(//flow/block[1]/lineArea[1]/text[2]/space)"/>
+ <eval expected="1" xpath="count(//flow/block[1]/lineArea[1]/text[3]/word)"/>
+ <eval expected="1" xpath="count(//flow/block[1]/lineArea[1]/char)"/>
+
+ <eval expected="3" xpath="count(//flow/block[2]/block[1]/lineArea[1]/text/word)"/>
+ <eval expected="2" xpath="count(//flow/block[2]/block[1]/lineArea[1]/text/space)"/>
+ <eval expected="3" xpath="count(//flow/block[2]/block[2]/lineArea[1]/text/word)"/>
+ <eval expected="2" xpath="count(//flow/block[2]/block[2]/lineArea[1]/text/space)"/>
+
+ <eval expected="2" xpath="count(//flow/block[3]/lineArea[1]/inlineparent[1]/text/word)"/>
+ <eval expected="2" xpath="count(//flow/block[3]/lineArea[1]/inlineparent[1]/text/space)"/>
+ <eval expected="1" xpath="count(//flow/block[3]/lineArea[1]/text[1]/space)"/>
+ <eval expected="2" xpath="count(//flow/block[3]/lineArea[1]/inlineparent[2]/text/word)"/>
+ <eval expected="2" xpath="count(//flow/block[3]/lineArea[1]/inlineparent[2]/text/space)"/>
+
+ <eval expected="2" xpath="count(//flow/block[4]/lineArea[1]/text[1]/word)"/>
+ <eval expected="2" xpath="count(//flow/block[4]/lineArea[1]/text[1]/space)"/>
+ <eval expected="2" xpath="count(//flow/block[4]/lineArea[1]/inlineparent[1]/text/word)"/>
+ <eval expected="3" xpath="count(//flow/block[4]/lineArea[1]/inlineparent[1]/text/space)"/>
+ <eval expected="1" xpath="count(//flow/block[4]/lineArea[1]/text[2]/word)"/>
+ <eval expected="2" xpath="count(//flow/block[4]/lineArea[1]/text[2]/space)"/>
+ <eval expected="2" xpath="count(//flow/block[4]/lineArea[1]/inlineparent[2]/text/word)"/>
+ <eval expected="3" xpath="count(//flow/block[4]/lineArea[1]/inlineparent[2]/text/space)"/>
+ <eval expected="2" xpath="count(//flow/block[4]/lineArea[1]/text[3]/word)"/>
+ <eval expected="2" xpath="count(//flow/block[4]/lineArea[1]/text[3]/space)"/>
+
+ <eval expected="2" xpath="count(//flow/block[5]/lineArea[1]/inlineparent[1]/text/word)"/>
+ <eval expected="2" xpath="count(//flow/block[5]/lineArea[1]/inlineparent[1]/text/space)"/>
+ <eval expected="3" xpath="count(//flow/block[5]/lineArea[1]/inlineparent[1]/inlineparent[1]/text/word)"/>
+ <eval expected="3" xpath="count(//flow/block[5]/lineArea[1]/inlineparent[1]/inlineparent[1]/text/space)"/>
+
+ <eval expected="3" xpath="count(//flow/block[6]/lineArea[1]/inlineparent[1]/inlineparent[1]/text/word)"/>
+ <eval expected="3" xpath="count(//flow/block[6]/lineArea[1]/inlineparent[1]/inlineparent[1]/text/space)"/>
+ <eval expected="2" xpath="count(//flow/block[6]/lineArea[1]/inlineparent[1]/text/word)"/>
+ <eval expected="2" xpath="count(//flow/block[6]/lineArea[1]/inlineparent[1]/text/space)"/>
+
+ <eval expected="2" xpath="count(//flow/block[7]/lineArea[1]/text[1]/word)"/>
+ <eval expected="2" xpath="count(//flow/block[7]/lineArea[1]/text[1]/space)"/>
+ <eval expected="1" xpath="count(//flow/block[7]/lineArea[1]/inlineparent[1]/text[1]/space)"/>
+ <eval expected="3" xpath="count(//flow/block[7]/lineArea[1]/inlineparent[1]/inlineparent[1]/text/word)"/>
+ <eval expected="4" xpath="count(//flow/block[7]/lineArea[1]/inlineparent[1]/inlineparent[1]/text/space)"/>
+ <eval expected="2" xpath="count(//flow/block[7]/lineArea[1]/inlineparent[1]/text[2]/word)"/>
+ <eval expected="3" xpath="count(//flow/block[7]/lineArea[1]/inlineparent[1]/text[2]/space)"/>
+ <eval expected="2" xpath="count(//flow/block[7]/lineArea[1]/text[2]/word)"/>
+ <eval expected="2" xpath="count(//flow/block[7]/lineArea[1]/text[2]/space)"/>
+ </checks>
+</testcase>
diff --git a/test/layoutengine/testcases/block_white-space-collapse_2.xml b/test/layoutengine/testcases/block_white-space-collapse_2.xml
new file mode 100755
index 000000000..4f72ba7b9
--- /dev/null
+++ b/test/layoutengine/testcases/block_white-space-collapse_2.xml
@@ -0,0 +1,111 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Copyright 2005 The Apache Software Foundation
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+<!-- $Id$ -->
+<testcase>
+ <info>
+ <p>
+ This test checks basic white space handling for white-space-collapse="false".
+ The test currently fails because white space around formatter generated
+ linebreaks is not removed correctly.
+ </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="false">
+ <fo:flow flow-name="xsl-region-body">
+ <fo:block background-color="silver" margin="1pt 0pt 1pt 0pt">
+ spaces
+ before
+ and
+ after
+ each
+ word <fo:character character="&#xa;" />
+<fo:character character=" " /><fo:character character=" " /> and
+ linefeeds<fo:character character=" " /><fo:character character=" " />
+ everywhere<fo:character character=" " />
+ </fo:block>
+ <fo:block background-color="silver" margin="1pt 0pt 1pt 0pt">
+ <fo:block background-color="orange">
+ nested block level
+ </fo:block>
+ <fo:block background-color="red">
+ nested block level
+ </fo:block>
+ </fo:block>
+ <fo:block background-color="silver" margin="1pt 0pt 1pt 0pt">
+ <fo:inline background-color="orange">
+ inline level
+ </fo:inline>
+ <fo:inline background-color="red">
+ inline level
+ </fo:inline>
+ </fo:block>
+ <fo:block background-color="silver" margin="1pt 0pt 1pt 0pt">
+ block level
+ <fo:inline background-color="orange">
+ inline level
+ </fo:inline>
+ block
+ <fo:inline background-color="red">
+ inline level
+ </fo:inline>
+ block level
+ </fo:block>
+ <fo:block background-color="silver" margin="1pt 0pt 1pt 0pt">
+ <fo:inline background-color="orange">
+ inline level
+ <fo:inline background-color="red">
+ nested inline level
+ </fo:inline>
+ </fo:inline>
+ </fo:block>
+ <fo:block background-color="silver" margin="1pt 0pt 1pt 0pt">
+ <fo:inline background-color="orange">
+ <fo:inline background-color="red">
+ nested inline level
+ </fo:inline>
+ inline level
+ </fo:inline>
+ </fo:block>
+ <fo:block background-color="silver" margin="1pt 0pt 1pt 0pt">
+ block level
+ <fo:inline background-color="orange">
+ <fo:inline background-color="red">
+ nested inline level
+ </fo:inline>
+ inline level
+ </fo:inline>
+ block level
+ </fo:block>
+ </fo:flow>
+ </fo:page-sequence>
+ </fo:root>
+ </fo>
+ <checks>
+ <!-- The tests are currently incomplete but enough to fail -->
+ <eval expected="8" xpath="count(//flow/block[1]/lineArea[1]/text/word)"/>
+ <eval expected="35" xpath="count(//flow/block[1]/lineArea[1]/text/space)"/>
+ <eval expected="1" xpath="count(//flow/block[1]/lineArea[2]/text/word)"/>
+ <eval expected="0" xpath="count(//flow/block[1]/lineArea[2]/text/space)"/>
+
+ </checks>
+</testcase>
diff --git a/test/layoutengine/testcases/block_white-space-treatment_1.xml b/test/layoutengine/testcases/block_white-space-treatment_1.xml
new file mode 100755
index 000000000..a8d48107f
--- /dev/null
+++ b/test/layoutengine/testcases/block_white-space-treatment_1.xml
@@ -0,0 +1,85 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Copyright 2005 The Apache Software Foundation
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+<!-- $Id$ -->
+<testcase>
+ <info>
+ <p>
+ This test checks white space handling for white-space-treatment
+ with white-spcae-collapse="true".
+ The test currently fails because white space around formatter generated
+ linebreaks is not removed correctly.
+ </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 white-space-treatment="ignore-if-surrounding-linefeed" background-color="silver" margin="1pt 0pt 1pt 0pt">
+ ignore-if-surrounding-linefeed
+ all
+ spaces
+</fo:block>
+ <fo:block white-space-treatment="ignore" background-color="silver" margin="1pt 0pt 1pt 0pt">
+ ignore
+ all
+ spaces
+</fo:block>
+ <fo:block white-space-treatment="preserve" background-color="silver" margin="1pt 0pt 1pt 0pt">
+ preserve
+ all
+ spaces
+</fo:block>
+ <fo:block white-space-treatment="ignore-if-before-linefeed" background-color="silver" margin="1pt 0pt 1pt 0pt">
+ ignore-if-before-linefeed
+ all
+ spaces
+</fo:block>
+ <fo:block white-space-treatment="ignore-if-after-linefeed" background-color="silver" margin="1pt 0pt 1pt 0pt">
+ ignore-if-after-linefeed
+ all
+ spaces
+</fo:block>
+ </fo:flow>
+ </fo:page-sequence>
+ </fo:root>
+ </fo>
+ <checks>
+ <!-- The tests are currently incomplete but enough to fail -->
+ <eval expected="3" xpath="count(//flow/block[1]/lineArea[1]/text/word)"/>
+ <eval expected="2" xpath="count(//flow/block[1]/lineArea[1]/text/space)"/>
+
+ <eval expected="1" xpath="count(//flow/block[2]/lineArea[1]/text/word)"/>
+ <eval expected="0" xpath="count(//flow/block[2]/lineArea[1]/text/space)"/>
+
+ <eval expected="0" xpath="count(//flow/block[3]/lineArea[1]/text)"/>
+ <eval expected="1" xpath="count(//flow/block[3]/lineArea[2]/text/word)"/>
+ <eval expected="0" xpath="count(//flow/block[3]/lineArea[2]/text/space)"/>
+ <eval expected="1" xpath="count(//flow/block[3]/lineArea[3]/text/word)"/>
+ <eval expected="0" xpath="count(//flow/block[3]/lineArea[3]/text/space)"/>
+ <eval expected="1" xpath="count(//flow/block[3]/lineArea[4]/text/word)"/>
+ <eval expected="0" xpath="count(//flow/block[3]/lineArea[4]/text/space)"/>
+
+ <eval expected="1" xpath="count(//flow/block[4]/lineArea[1]/text/word)"/>
+ <eval expected="0" xpath="count(//flow/block[4]/lineArea[1]/text/space)"/>
+
+ </checks>
+</testcase>
diff --git a/test/layoutengine/testcases/block_white-space-treatment_2.xml b/test/layoutengine/testcases/block_white-space-treatment_2.xml
new file mode 100755
index 000000000..fbd993d5b
--- /dev/null
+++ b/test/layoutengine/testcases/block_white-space-treatment_2.xml
@@ -0,0 +1,85 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Copyright 2005 The Apache Software Foundation
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+<!-- $Id$ -->
+<testcase>
+ <info>
+ <p>
+ This test checks white space handling for white-space-treatment.
+ with white-spcae-collapse="false".
+ The test currently fails because white space around formatter generated
+ linebreaks is not removed correctly.
+ </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="false">
+ <fo:flow flow-name="xsl-region-body">
+ <fo:block white-space-treatment="ignore-if-surrounding-linefeed" background-color="silver" margin="1pt 0pt 1pt 0pt">
+ ignore-if-surrounding-linefeed
+ all
+ spaces
+</fo:block>
+ <fo:block white-space-treatment="ignore" background-color="silver" margin="1pt 0pt 1pt 0pt">
+ ignore
+ all
+ spaces
+</fo:block>
+ <fo:block white-space-treatment="preserve" background-color="silver" margin="1pt 0pt 1pt 0pt">
+ preserve
+ all
+ spaces
+</fo:block>
+ <fo:block white-space-treatment="ignore-if-before-linefeed" background-color="silver" margin="1pt 0pt 1pt 0pt">
+ ignore-if-before-linefeed
+ all
+ spaces
+</fo:block>
+ <fo:block white-space-treatment="ignore-if-after-linefeed" background-color="silver" margin="1pt 0pt 1pt 0pt">
+ ignore-if-after-linefeed
+ all
+ spaces
+</fo:block>
+ </fo:flow>
+ </fo:page-sequence>
+ </fo:root>
+ </fo>
+ <checks>
+ <!-- The tests are currently incomplete but enough to fail -->
+ <eval expected="3" xpath="count(//flow/block[1]/lineArea[1]/text/word)"/>
+ <eval expected="2" xpath="count(//flow/block[1]/lineArea[1]/text/space)"/>
+
+ <eval expected="1" xpath="count(//flow/block[2]/lineArea[1]/text/word)"/>
+ <eval expected="0" xpath="count(//flow/block[2]/lineArea[1]/text/space)"/>
+
+ <eval expected="0" xpath="count(//flow/block[3]/lineArea[1]/text)"/>
+ <eval expected="1" xpath="count(//flow/block[3]/lineArea[2]/text/word)"/>
+ <eval expected="0" xpath="count(//flow/block[3]/lineArea[2]/text/space)"/>
+ <eval expected="1" xpath="count(//flow/block[3]/lineArea[3]/text/word)"/>
+ <eval expected="0" xpath="count(//flow/block[3]/lineArea[3]/text/space)"/>
+ <eval expected="1" xpath="count(//flow/block[3]/lineArea[4]/text/word)"/>
+ <eval expected="0" xpath="count(//flow/block[3]/lineArea[4]/text/space)"/>
+
+ <eval expected="1" xpath="count(//flow/block[4]/lineArea[1]/text/word)"/>
+ <eval expected="0" xpath="count(//flow/block[4]/lineArea[1]/text/space)"/>
+
+ </checks>
+</testcase>
diff --git a/test/layoutengine/testcases/block_white-space-collapse.xml b/test/layoutengine/testcases/block_white-space_1.xml
index c249bcea3..c249bcea3 100644
--- a/test/layoutengine/testcases/block_white-space-collapse.xml
+++ b/test/layoutengine/testcases/block_white-space_1.xml