Bug 137174 - HTML conversion: fields always shaded
Summary: HTML conversion: fields always shaded
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
6.4.6.2 release
Hardware: All All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords: filter:html
Depends on:
Blocks: (X)HTML-Export
  Show dependency treegraph
 
Reported: 2020-10-01 07:51 UTC by ajlittoz
Modified: 2023-05-11 15:00 UTC (History)
2 users (show)

See Also:
Crash report or crash signature:


Attachments
Document with page number field (8.48 KB, application/vnd.oasis.opendocument.text)
2020-10-01 07:51 UTC, ajlittoz
Details
HTML version of test document (910 bytes, text/html)
2020-10-01 07:52 UTC, ajlittoz
Details

Note You need to log in before you can comment on or make changes to this bug.
Description ajlittoz 2020-10-01 07:51:20 UTC
Created attachment 165989 [details]
Document with page number field

When a Writer document is converted to HTML (with File>Save AS requesting HTML output), all fields get a background colour with <span style=background: #c0c0c0"> -- here the field item -- </span> even when no formatting has been applied.

Print preview or print show the intended formatting (no background).

View>Field Shadings has no effect as expected because it is only a screen visual clue.

The shading color is not controlled by Tools>Options>LibreOffice>Application Colors because these settings only apply to the UI.

A converter should not add formatting of any kind on its own, all the more when this addition cannot be customised by user.

The attached file, when converted to HTML, exhibits the wrong behaviour. It contains a single line with a field for the page number. The HTML shading occurs with any field.

The bug report is a follow-on for https://ask.libreoffice.org/en/question/268617/how-do-i-get-rid-of-field-shadings-in-mail-merged-file-thats-been-converted-to-html/
Comment 1 ajlittoz 2020-10-01 07:52:28 UTC
Created attachment 165990 [details]
HTML version of test document
Comment 2 Dieter 2020-11-09 20:46:38 UTC
(In reply to ajlittoz from comment #0)
> View>Field Shadings has no effect as expected because it is only a screen
> visual clue.

I can't confirm this observation. If I disable field shadings, html-file doesn't contain a shading. So I suppose that this is the expected behaviour.

Could you please try to reproduce it with the latest version of LibreOffice from https://www.libreoffice.org/download/libreoffice-fresh/ ? I have set the bug's status to 'NEEDINFO'.
Comment 3 ajlittoz 2020-11-10 09:11:50 UTC
(In reply to Dieter from comment #2)
> Could you please try to reproduce it with the latest version of LibreOffice
> from https://www.libreoffice.org/download/libreoffice-fresh/ ? I have set
> the bug's status to 'NEEDINFO'.

I checked with my installed 7.0.3.1.

Compared to previous 6.4.6.2, View>Field Shadings determines if generated HTML will have a background for fields.

I am not sure this is intended behaviour because fields are routinely used to insert "dynamic" content in continuity with text. Nothing should distract reader's attention.

The case is different in a form where it should be made clear where the entry "boxes" are located. But in forms, entry "boxes" are not always fields.

Field shadings is a convenient tool for a writer during document design (like Formatting Marks) but is disturbing for a reader of the final document. So it should be explicitly asserted if View>Field Shadings has an editing effect and be consistent with Print Preview where Field Shadings does nothing.

I believe Print Preview (and Print for sure) are closer to expected behaviour than saving as HTML.
Comment 4 QA Administrators 2020-11-11 04:19:29 UTC Comment hidden (obsolete)
Comment 5 Dieter 2020-11-22 06:09:07 UTC
(In reply to ajlittoz from comment #3)
> (In reply to Dieter from comment #2)
> > Could you please try to reproduce it with the latest version of LibreOffice
> > from https://www.libreoffice.org/download/libreoffice-fresh/ ? I have set
> > the bug's status to 'NEEDINFO'.
> 
> I checked with my installed 7.0.3.1.
> 
> Compared to previous 6.4.6.2, View>Field Shadings determines if generated
> HTML will have a background for fields.
> 
> I am not sure this is intended behaviour because fields are routinely used
> to insert "dynamic" content in continuity with text. Nothing should distract
> reader's attention.

Let's as design-team, if this is intended behaviour or not
cc: Design-Team
Comment 6 Heiko Tietze 2020-11-23 12:10:46 UTC
In both, 6.4 and 7.2 the field remains shaded after export to HTML but the file itself is clean. And I wouldn't expect that any export operation affects the current status. It's similar to a vector graphic that doesn't becomes rasterized when saving as PNG.

Version: 6.4.7.2
Build ID: 6.4.7-2
CPU threads: 8; OS: Linux 5.9; UI render: default; VCL: kf5; 
Locale: de-DE (en_US.UTF-8); UI-Language: en-US
Calc: threaded

Version: 7.2.0.0.alpha0+
Build ID: 23255d4e09292bc7f4d40993f9fa9156834f160c
CPU threads: 8; OS: Linux 5.9; UI render: default; VCL: kf5
Locale: en-US (en_US.UTF-8); UI: en-US
Calc: threaded
Comment 7 Heiko Tietze 2020-12-04 13:35:13 UTC
We discussed the topic in the design meeting

* fields don't have a background color but are highlighted per code
* there is no good reason to show the internal highlighting when 
  opening the exported html in a browser (Heiko)
* exporting to a file shouldn't affect the actual document; same happens in MSO
* export doesn't take the highlighting in LibreOffice too but SaveAs does

=> this is a clearly bug
Comment 8 QA Administrators 2022-12-05 03:33:04 UTC Comment hidden (obsolete)
Comment 9 ajlittoz 2022-12-05 10:45:31 UTC
Bug still present with
Version: 7.4.3.2
Build ID: 40(Build:2)
CPU threads: 4; OS: Linux 6.0; UI render: default; VCL: kf5 (cairo+xcb)
Locale: fr-FR (fr_FR.UTF-8); UI: en-US
Calc: threaded