From 299c6b1393cf9d5194929ac8c756171b2ff2ce4f Mon Sep 17 00:00:00 2001 From: Jeremias Maerki Date: Mon, 5 Sep 2005 08:09:42 +0000 Subject: Bugzilla #36487: Background images were incorrectly positioned in some absolute positioned blocks. Some additional attributes output by the XMLRenderer. Refactored the layout for e-g and i-f-o. Introduced common base classes for the corresponding flow objects as well as the e-g and i-f-o LMs. Fixed incorrectly applied margins on region-body when writing mode is not lr. Fixed application of correct percent base for margins and extents on regions when the reference orientation is 90 degrees. Fixed incorrectly positioned regions when writing mode is different between the simple-page-master setting and the setting on the region. Several updates to the layout engine test cases. Submitted by: Manuel Mall git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@278690 13f79535-47bb-0310-9956-ffa450edef68 --- test/layoutengine/disabled-testcases.txt | 4 +- ...ckground-image_background-position-relative.xml | 36 +++---- .../testcases/external-graphic_basic.xml | 2 +- .../testcases/external-graphic_border_padding.xml | 46 +++++++-- .../testcases/external-graphic_display-align.xml | 10 +- .../testcases/inline-container_border_padding.xml | 85 ++++++++++++++++ .../testcases/inline_border_padding.xml | 48 +++++++++ .../instream-foreign-object_border_padding.xml | 54 ++++++++-- .../instream-foreign-object_display-align.xml | 10 +- ...e-orientation_0_region-body_margin_relative.xml | 111 ++++++++++++++++++++ ...writing-mode_rl_region-body_margin_relative.xml | 112 ++++++++++++++++++++ ...orientation_180_region-body_margin_relative.xml | 112 ++++++++++++++++++++ ...writing-mode_rl_region-body_margin_relative.xml | 112 ++++++++++++++++++++ ...orientation_270_region-body_margin_relative.xml | 112 ++++++++++++++++++++ ...writing-mode_rl_region-body_margin_relative.xml | 112 ++++++++++++++++++++ ...-orientation_90_region-body_margin_relative.xml | 112 ++++++++++++++++++++ ...writing-mode_rl_region-body_margin_relative.xml | 112 ++++++++++++++++++++ ...writing-mode_rl_region-body_writing-mode-lr.xml | 113 +++++++++++++++++++++ .../testcases/table-cell_background-image.xml | 32 +++--- 19 files changed, 1270 insertions(+), 65 deletions(-) create mode 100644 test/layoutengine/testcases/inline-container_border_padding.xml create mode 100644 test/layoutengine/testcases/inline_border_padding.xml create mode 100644 test/layoutengine/testcases/simple-page-master_reference-orientation_0_region-body_margin_relative.xml create mode 100644 test/layoutengine/testcases/simple-page-master_reference-orientation_0_writing-mode_rl_region-body_margin_relative.xml create mode 100644 test/layoutengine/testcases/simple-page-master_reference-orientation_180_region-body_margin_relative.xml create mode 100644 test/layoutengine/testcases/simple-page-master_reference-orientation_180_writing-mode_rl_region-body_margin_relative.xml create mode 100644 test/layoutengine/testcases/simple-page-master_reference-orientation_270_region-body_margin_relative.xml create mode 100644 test/layoutengine/testcases/simple-page-master_reference-orientation_270_writing-mode_rl_region-body_margin_relative.xml create mode 100644 test/layoutengine/testcases/simple-page-master_reference-orientation_90_region-body_margin_relative.xml create mode 100644 test/layoutengine/testcases/simple-page-master_reference-orientation_90_writing-mode_rl_region-body_margin_relative.xml create mode 100644 test/layoutengine/testcases/simple-page-master_writing-mode_rl_region-body_writing-mode-lr.xml (limited to 'test') diff --git a/test/layoutengine/disabled-testcases.txt b/test/layoutengine/disabled-testcases.txt index f782b308d..0f2397b8b 100644 --- a/test/layoutengine/disabled-testcases.txt +++ b/test/layoutengine/disabled-testcases.txt @@ -4,11 +4,12 @@ block_font-stretch.xml block_space-before_space-after_2.xml block_word-spacing.xml block_word-spacing_text-align_justify.xml -external-graphic_content-height_content-width.xml external-graphic_oversized.xml inline-block_keep-together.xml inline_block_nested_3.xml +inline_border_padding.xml inline-container_block_nested.xml +inline-container_border_padding.xml inline_letter-spacing.xml inline_word-spacing.xml inline_word-spacing_text-align_justify.xml @@ -24,7 +25,6 @@ page-number-citation_complex_2.xml page-number_initial-page-number_2.xml region-body_column-count_footnote.xml region-body_column-count_#36356.xml -region-body_margin_relative_writing-mode_rl-tb.xml table-body_background-image.xml table_border-collapse_collapse_1.xml table_border-collapse_collapse_2.xml diff --git a/test/layoutengine/testcases/block-container_background-image_background-position-relative.xml b/test/layoutengine/testcases/block-container_background-image_background-position-relative.xml index 74b000f95..ea09a97d6 100644 --- a/test/layoutengine/testcases/block-container_background-image_background-position-relative.xml +++ b/test/layoutengine/testcases/block-container_background-image_background-position-relative.xml @@ -27,64 +27,64 @@ - + - image in top right corner - image in center right - image in bottom right corner - image in top center - image in center - image in bottom center - image in top left - image in center left - @@ -96,22 +96,22 @@ - + - + - + - + - + - + - + - + diff --git a/test/layoutengine/testcases/external-graphic_basic.xml b/test/layoutengine/testcases/external-graphic_basic.xml index 736ade4b7..a4ea4a45a 100644 --- a/test/layoutengine/testcases/external-graphic_basic.xml +++ b/test/layoutengine/testcases/external-graphic_basic.xml @@ -31,7 +31,7 @@ plain external-graphic - + EOG EOF diff --git a/test/layoutengine/testcases/external-graphic_border_padding.xml b/test/layoutengine/testcases/external-graphic_border_padding.xml index f8bfa4d79..43ff49649 100644 --- a/test/layoutengine/testcases/external-graphic_border_padding.xml +++ b/test/layoutengine/testcases/external-graphic_border_padding.xml @@ -31,23 +31,51 @@ - + Normal font + + + FO + + + In both blocks we have a setting of border-width="5pt 10pt 20pt 15pt" padding="15pt 20pt 10pt 5pt" on the e-g. + In the first block the e-g determines the height of the line in the 2nd block the font is bigger than the e-g. - EOF - + + + + + + - - - - - + + + + + - + + + + + + + + + + + + + + + + + + diff --git a/test/layoutengine/testcases/external-graphic_display-align.xml b/test/layoutengine/testcases/external-graphic_display-align.xml index e828e3a77..76d74b791 100644 --- a/test/layoutengine/testcases/external-graphic_display-align.xml +++ b/test/layoutengine/testcases/external-graphic_display-align.xml @@ -32,23 +32,23 @@ plain external-graphic - EOG + EOG external-graphic with display-align="auto" - EOG + EOG external-graphic with display-align="before" - EOG + EOG external-graphic with display-align="center" - EOG + EOG external-graphic with display-align="after" - EOG + EOG EOF diff --git a/test/layoutengine/testcases/inline-container_border_padding.xml b/test/layoutengine/testcases/inline-container_border_padding.xml new file mode 100644 index 000000000..10ab7b646 --- /dev/null +++ b/test/layoutengine/testcases/inline-container_border_padding.xml @@ -0,0 +1,85 @@ + + + + + +

+ This test checks the borders and the like for instream-foreign-object. +

+
+ + + + + + + + + + + Before + inside the container + after + + + BC + inside the container + AC + + + In both blocks we have a setting of border-width="5pt 10pt 20pt 15pt" padding="15pt 20pt 10pt 5pt" on the i-f-o. + In the first block the i-f-o determines the height of the line in the 2nd block the font is bigger than the i-f-o. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
diff --git a/test/layoutengine/testcases/inline_border_padding.xml b/test/layoutengine/testcases/inline_border_padding.xml new file mode 100644 index 000000000..474191416 --- /dev/null +++ b/test/layoutengine/testcases/inline_border_padding.xml @@ -0,0 +1,48 @@ + + + + + +

+ This test checks inlines with border and padding properties. +

+
+ + + + + + + + + + + Start of file + + + Normal text inline with border="solid 5pt red" padding="5pt" normal finish + + + End of file + + + + + + + +
diff --git a/test/layoutengine/testcases/instream-foreign-object_border_padding.xml b/test/layoutengine/testcases/instream-foreign-object_border_padding.xml index 3a1460ea1..51c1ffa0a 100644 --- a/test/layoutengine/testcases/instream-foreign-object_border_padding.xml +++ b/test/layoutengine/testcases/instream-foreign-object_border_padding.xml @@ -31,29 +31,65 @@ - + - + Normal font + + + + + + + + + + FOP + + + In both blocks we have a setting of border-width="5pt 10pt 20pt 15pt" padding="15pt 20pt 10pt 5pt" on the i-f-o. + In the first block the i-f-o determines the height of the line in the 2nd block the font is bigger than the i-f-o. - + + + + + + - - - - - + + + + + - + + + + + + + + + + + + + + + + + + diff --git a/test/layoutengine/testcases/instream-foreign-object_display-align.xml b/test/layoutengine/testcases/instream-foreign-object_display-align.xml index 01ecfd5b4..a113ccc54 100644 --- a/test/layoutengine/testcases/instream-foreign-object_display-align.xml +++ b/test/layoutengine/testcases/instream-foreign-object_display-align.xml @@ -32,7 +32,7 @@ plain instream-foreign-object - + @@ -43,7 +43,7 @@ instream-foreign-object with display-align="auto" - + @@ -54,7 +54,7 @@ instream-foreign-object with display-align="before" - + @@ -65,7 +65,7 @@ instream-foreign-object with display-align="center" - + @@ -76,7 +76,7 @@ instream-foreign-object with display-align="after" - + diff --git a/test/layoutengine/testcases/simple-page-master_reference-orientation_0_region-body_margin_relative.xml b/test/layoutengine/testcases/simple-page-master_reference-orientation_0_region-body_margin_relative.xml new file mode 100644 index 000000000..c68c3aa6a --- /dev/null +++ b/test/layoutengine/testcases/simple-page-master_reference-orientation_0_region-body_margin_relative.xml @@ -0,0 +1,111 @@ + + + + + +

+ This test checks relative margin on region (region-body). +

+
+ + ../../resources/images/bgimg300dpi.jpg + + + + + + + + + + + + + + + + r e g i o n b e f o r e + + + + + r e g i o n a f t e r + + + + + r e g i o n s t a r t + + + + + r e g i o n e n d + + + + + Demonstrates relative 5% margin on the page master, 10% margin on regions before + and end and 5% margin on regions start and after. Corresponding margins are set + on the region body. The page size is 5in x 3in with the page reference not rotated. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
diff --git a/test/layoutengine/testcases/simple-page-master_reference-orientation_0_writing-mode_rl_region-body_margin_relative.xml b/test/layoutengine/testcases/simple-page-master_reference-orientation_0_writing-mode_rl_region-body_margin_relative.xml new file mode 100644 index 000000000..3269fd9dd --- /dev/null +++ b/test/layoutengine/testcases/simple-page-master_reference-orientation_0_writing-mode_rl_region-body_margin_relative.xml @@ -0,0 +1,112 @@ + + + + + +

+ This test checks relative margin on region (region-body). +

+
+ + ../../resources/images/bgimg300dpi.jpg + + + + + + + + + + + + + + + + r e g i o n b e f o r e + + + + + r e g i o n a f t e r + + + + + r e g i o n s t a r t + + + + + r e g i o n e n d + + + + + Demonstrates relative 5% margin on the page master, 10% margin on regions before + and end and 5% margin on regions start and after. Corresponding margins are set + on the region body. The page size is 5in x 3in with the page reference not rotated + and a rl writing-mode. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
diff --git a/test/layoutengine/testcases/simple-page-master_reference-orientation_180_region-body_margin_relative.xml b/test/layoutengine/testcases/simple-page-master_reference-orientation_180_region-body_margin_relative.xml new file mode 100644 index 000000000..363edc6ed --- /dev/null +++ b/test/layoutengine/testcases/simple-page-master_reference-orientation_180_region-body_margin_relative.xml @@ -0,0 +1,112 @@ + + + + + +

+ This test checks relative margin on region (region-body). +

+
+ + ../../resources/images/bgimg300dpi.jpg + + + + + + + + + + + + + + + + r e g i o n b e f o r e + + + + + r e g i o n a f t e r + + + + + r e g i o n s t a r t + + + + + r e g i o n e n d + + + + + Demonstrates relative 5% margin on the page master, 10% margin on regions before + and end and 5% margin on regions start and after. Corresponding margins are set + on the region body. The page size is 5in x 3in with the page reference rotated by + 180 degrees. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
diff --git a/test/layoutengine/testcases/simple-page-master_reference-orientation_180_writing-mode_rl_region-body_margin_relative.xml b/test/layoutengine/testcases/simple-page-master_reference-orientation_180_writing-mode_rl_region-body_margin_relative.xml new file mode 100644 index 000000000..f17c83ed1 --- /dev/null +++ b/test/layoutengine/testcases/simple-page-master_reference-orientation_180_writing-mode_rl_region-body_margin_relative.xml @@ -0,0 +1,112 @@ + + + + + +

+ This test checks relative margin on region (region-body). +

+
+ + ../../resources/images/bgimg300dpi.jpg + + + + + + + + + + + + + + + + r e g i o n b e f o r e + + + + + r e g i o n a f t e r + + + + + r e g i o n s t a r t + + + + + r e g i o n e n d + + + + + Demonstrates relative 5% margin on the page master, 10% margin on regions before + and end and 5% margin on regions start and after. Corresponding margins are set + on the region body. The page size is 5in x 3in with the page reference rotated by + 180 degrees and a rl writing-mode. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
diff --git a/test/layoutengine/testcases/simple-page-master_reference-orientation_270_region-body_margin_relative.xml b/test/layoutengine/testcases/simple-page-master_reference-orientation_270_region-body_margin_relative.xml new file mode 100644 index 000000000..e6145ac6c --- /dev/null +++ b/test/layoutengine/testcases/simple-page-master_reference-orientation_270_region-body_margin_relative.xml @@ -0,0 +1,112 @@ + + + + + +

+ This test checks relative margin on region (region-body). +

+
+ + ../../resources/images/bgimg300dpi.jpg + + + + + + + + + + + + + + + + r e g i o n b e f o r e + + + + + r e g i o n a f t e r + + + + + r e g i o n s t a r t + + + + + r e g i o n e n d + + + + + Demonstrates relative 5% margin on the page master, 10% margin on regions before + and end and 5% margin on regions start and after. Corresponding margins are set + on the region body. The page size is 5in x 3in with the page reference rotated by + 270 degrees. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
diff --git a/test/layoutengine/testcases/simple-page-master_reference-orientation_270_writing-mode_rl_region-body_margin_relative.xml b/test/layoutengine/testcases/simple-page-master_reference-orientation_270_writing-mode_rl_region-body_margin_relative.xml new file mode 100644 index 000000000..b3808fd4f --- /dev/null +++ b/test/layoutengine/testcases/simple-page-master_reference-orientation_270_writing-mode_rl_region-body_margin_relative.xml @@ -0,0 +1,112 @@ + + + + + +

+ This test checks relative margin on region (region-body). +

+
+ + ../../resources/images/bgimg300dpi.jpg + + + + + + + + + + + + + + + + r e g i o n b e f o r e + + + + + r e g i o n a f t e r + + + + + r e g i o n s t a r t + + + + + r e g i o n e n d + + + + + Demonstrates relative 5% margin on the page master, 10% margin on regions before + and end and 5% margin on regions start and after. Corresponding margins are set + on the region body. The page size is 5in x 3in with the page reference rotated by + 270 degrees and a rl writing-mode. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
diff --git a/test/layoutengine/testcases/simple-page-master_reference-orientation_90_region-body_margin_relative.xml b/test/layoutengine/testcases/simple-page-master_reference-orientation_90_region-body_margin_relative.xml new file mode 100644 index 000000000..959484c4c --- /dev/null +++ b/test/layoutengine/testcases/simple-page-master_reference-orientation_90_region-body_margin_relative.xml @@ -0,0 +1,112 @@ + + + + + +

+ This test checks relative margin on region (region-body). +

+
+ + ../../resources/images/bgimg300dpi.jpg + + + + + + + + + + + + + + + + r e g i o n b e f o r e + + + + + r e g i o n a f t e r + + + + + r e g i o n s t a r t + + + + + r e g i o n e n d + + + + + Demonstrates relative 5% margin on the page master, 10% margin on regions before + and end and 5% margin on regions start and after. Corresponding margins are set + on the region body. The page size is 5in x 3in with the page reference rotated by + 90 degrees. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
diff --git a/test/layoutengine/testcases/simple-page-master_reference-orientation_90_writing-mode_rl_region-body_margin_relative.xml b/test/layoutengine/testcases/simple-page-master_reference-orientation_90_writing-mode_rl_region-body_margin_relative.xml new file mode 100644 index 000000000..ac7635645 --- /dev/null +++ b/test/layoutengine/testcases/simple-page-master_reference-orientation_90_writing-mode_rl_region-body_margin_relative.xml @@ -0,0 +1,112 @@ + + + + + +

+ This test checks relative margin on region (region-body). +

+
+ + ../../resources/images/bgimg300dpi.jpg + + + + + + + + + + + + + + + + r e g i o n b e f o r e + + + + + r e g i o n a f t e r + + + + + r e g i o n s t a r t + + + + + r e g i o n e n d + + + + + Demonstrates relative 5% margin on the page master, 10% margin on regions before + and end and 5% margin on regions start and after. Corresponding margins are set + on the region body. The page size is 5in x 3in with the page reference rotated by + 90 degrees and a rl writing-mode. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
diff --git a/test/layoutengine/testcases/simple-page-master_writing-mode_rl_region-body_writing-mode-lr.xml b/test/layoutengine/testcases/simple-page-master_writing-mode_rl_region-body_writing-mode-lr.xml new file mode 100644 index 000000000..b5383093f --- /dev/null +++ b/test/layoutengine/testcases/simple-page-master_writing-mode_rl_region-body_writing-mode-lr.xml @@ -0,0 +1,113 @@ + + + + + +

+ This test checks relative margin on region (region-body). +

+
+ + ../../resources/images/bgimg300dpi.jpg + + + + + + + + + + + + + + + + r e g i o n b e f o r e + + + + + r e g i o n a f t e r + + + + + r e g i o n s t a r t top - bottom + + + + + r e g i o n e n d top - bottom + + + + + Demonstrates relative 5% margin on the page master, 10% margin on regions before + and end and 5% margin on regions start and after. Corresponding margins are set + on the region body. The page size is 5in x 3in with the page reference not rotated + and a rl writing-mode on the page master, a normal writing mode on the region-body + and tb writing mode on start and end regions. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
diff --git a/test/layoutengine/testcases/table-cell_background-image.xml b/test/layoutengine/testcases/table-cell_background-image.xml index 9dcffe96e..dbb9cd42f 100644 --- a/test/layoutengine/testcases/table-cell_background-image.xml +++ b/test/layoutengine/testcases/table-cell_background-image.xml @@ -39,20 +39,20 @@ - image in top right corner - image in center right - - image in top center - image in center - - image in top left - image in center left - @@ -111,20 +111,20 @@ - + - + - + - + - + - + - + \ No newline at end of file -- cgit v1.2.3