Bug Hunting Session
Bug 106021 - FORMATTING: Writer does not accept CSS box model for paragraphs
Summary: FORMATTING: Writer does not accept CSS box model for paragraphs
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
Inherited From OOo
Hardware: All All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
: 37653 (view as bug list)
Depends on:
Blocks: ODF-import
  Show dependency treegraph
 
Reported: 2017-02-15 12:57 UTC by Thomas Lendo
Modified: 2019-10-15 20:22 UTC (History)
3 users (show)

See Also:
Crash report or crash signature:


Attachments
Example with margins, borders and padding (21.98 KB, application/vnd.oasis.opendocument.text)
2017-02-15 13:01 UTC, Thomas Lendo
Details
Example with different and with same paragraph style (12.90 KB, application/vnd.oasis.opendocument.text)
2017-05-28 20:36 UTC, Regina Henschel
Details
screenshot ONLYOFFICE (72.04 KB, image/png)
2017-05-28 20:41 UTC, Regina Henschel
Details
Screenshot TextMaker (56.54 KB, image/png)
2017-05-28 20:42 UTC, Regina Henschel
Details
screenshot Webodf (53.50 KB, image/png)
2017-05-28 20:43 UTC, Regina Henschel
Details
Wrong handling of negative first line indent (64.01 KB, application/vnd.oasis.opendocument.text)
2017-06-29 19:30 UTC, Regina Henschel
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Thomas Lendo 2017-02-15 12:57:55 UTC
In 2008 I entered a bug in OpenOffice.org: https://bz.apache.org/ooo/show_bug.cgi?id=97151 (Space between paragraphs filled with paragraph background color).

Regina Henschel consolidated that bug with some others to a new bug: https://bz.apache.org/ooo/show_bug.cgi?id=125316 (Writer does not accept CSS box model for paragraphs)

I will copy her bug issue text from AOO because it still exists in both programs AOO and LO (Regina, I hope you have no problem with that):

In ODF1.2 the spacing around paragraphs is done with the properties
fo:margin, fo:border and fo:padding. [chapter 20.198, 20.176, 20.210] They have no own definitions, but take the definitions from $7 in XSL http://www.w3.org/TR/2001/REC-xsl-20011015/. And XSL uses directly the definitions from CSS2. And there we find the "Box model" http://www.w3.org/TR/CSS2/box.html. So in turn AOO should render paragraphs as defined in this "Box model".

1.
The margin area is transparent. In chapter 8.2 in CSS2 "Margin backgrounds are always transparent."
Error: Writer extends the paragraph background into the top-margin, see first page of attached document.

2.
The properties margin, border and padding are independent usable.
Error: Writer removes padding, when no border exists, see second page of attached document. The last text there should have a padding.

I [Regina] have found several issues with descriptions from a user point of view. I [Regina] will set them as duplicate to this [AOO issue 125316]. But the problems described there should be considered when working on this issue.
Comment 1 Thomas Lendo 2017-02-15 13:01:47 UTC
Created attachment 131246 [details]
Example with margins, borders and padding

Attached a test file created with LO 5.3.0.3, based on Regina Henschel's example file for AOO.

This problem still occurs in LibreOffice Version: 5.3.0.3
Build ID: 7074905676c47b82bbcfbea1aeefc84afe1c50e1
CPU Threads: 8; OS Version: Windows 6.2; UI Render: default; Layout Engine: new; Calc: CL
Comment 2 Regina Henschel 2017-05-28 20:36:48 UTC
Created attachment 133674 [details]
Example with different and with same paragraph style

The problem is a rendering problem. LibreOffice and all older versions down to OpenOffice.org 1.1.5 render the background of the padding rectangle in to bottom margin, if the following paragraph has the same style.

Because the users, who have created documents with this versions and have used that feature would complain, if the rendering is now different, I think, that we need a different solution. Perhaps we can add an attribute in ODF 1.3, that allows to fill the area between the paragraph with the background of the padding rectangle. Values might be "equal" to cover LibreOffice way of handling it, and "always" to cover Microsoft way, and "CSS" to conform to CSS, which would result in always transparent margin.

I will attach some screenshots, how other applications render the attached file.
Comment 3 Regina Henschel 2017-05-28 20:41:10 UTC
Created attachment 133675 [details]
screenshot ONLYOFFICE

Word 2010 (after "repair" the document) and GoogleDocs show similar rendering (and some errors like missing borders). The background color of the padding area is extended to the next paragraph.
Comment 4 Regina Henschel 2017-05-28 20:42:06 UTC
Created attachment 133676 [details]
Screenshot TextMaker

TextMaker shows a rendering similar to LibreOffice.
Comment 5 Regina Henschel 2017-05-28 20:43:37 UTC
Created attachment 133677 [details]
screenshot Webodf

Webodf renders the file correctly with transparent margins.
Comment 6 Regina Henschel 2017-05-30 14:31:22 UTC
After asking on the dev mailing list, I get the response, that this LO can solve this by a compatibility flag and no changes in the ODF specification are needed. https://lists.freedesktop.org/archives/libreoffice/2017-May/077789.html
Comment 7 Regina Henschel 2017-06-29 19:30:01 UTC
Created attachment 134394 [details]
Wrong handling of negative first line indent

And here another problem of "does not accept CSS box model". The negative first-line indent extends the box, but it should float out of the box.
Comment 8 Thomas Lendo 2017-10-21 23:30:16 UTC
*** Bug 37653 has been marked as a duplicate of this bug. ***
Comment 9 QA Administrators 2018-10-22 02:50:11 UTC Comment hidden (obsolete)
Comment 10 Regina Henschel 2018-10-22 10:35:28 UTC
The padding color is still painted into the margin area, if two adjacent paragraphs have the same style. To be clear: The option "Merge with next paragraph" is disabled.

Error seen in Version: 6.2.0.0.alpha0+ (x64)
Build ID: 6baca63b44bf7f75a522b1adc4b4bbce502aec3b
CPU threads: 8; OS: Windows 10.0; UI render: GL; VCL: win; 
TinderBox: Win-x86_64@42, Branch:master, Time: 2018-10-20_01:35:41
Locale: de-DE (en_US); Calc: CL