Bug 132914 - In HTML document, "font-style" does not apply to some tags
Summary: In HTML document, "font-style" does not apply to some tags
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
4.1 all versions
Hardware: All All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords: filter:html
Depends on:
Blocks: (X)HTML-Export
  Show dependency treegraph
 
Reported: 2020-05-10 12:50 UTC by Konstantin Kharlamov
Modified: 2025-01-08 17:17 UTC (History)
3 users (show)

See Also:
Crash report or crash signature:


Attachments
sample file (265 bytes, text/html)
2020-05-11 10:03 UTC, Xisco Faulí
Details
Comparison Firefox and LibreOffice 7.0 master (31.68 KB, image/png)
2020-05-11 10:04 UTC, Xisco Faulí
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Konstantin Kharlamov 2020-05-10 12:50:59 UTC
"font-style" CSS applies to <ins>, but does not apply to <b> nor <u>.

# Steps to reproduce

1. Create file `test.html` with the following content:

    <!DOCTYPE html>
    <html lang="en">
    <head>
      <meta charset="utf-8" />
      <title>test2</title>
      <style>
        u {
            font-style: italic
        }
      </style>
    </head>
    <body>
    <p>  <u>Test</u> </p>
    </body>
    </html>

2. Open it in libreoffice

## Expected

Word "test" is both underlined and italic (as you would see if opened the same file in a browser)

## Actual

Word "test" has no "italic" style
Comment 1 Xisco Faulí 2020-05-11 10:03:13 UTC
Created attachment 160652 [details]
sample file
Comment 2 Xisco Faulí 2020-05-11 10:04:03 UTC
Created attachment 160653 [details]
Comparison Firefox and LibreOffice 7.0 master
Comment 3 Xisco Faulí 2020-05-11 10:04:14 UTC
Reproduced in

Version: 7.0.0.0.alpha1+
Build ID: 86bc13248c1d9f63b10aac304bdf0361d1dcc47f
CPU threads: 4; OS: Linux 4.19; UI render: default; VCL: gtk3; 
Locale: en-US (en_US.UTF-8); UI: en-US
Calc: threaded
Comment 4 Xisco Faulí 2020-05-11 10:05:23 UTC
Also reproduced in

Version: 5.2.0.0.alpha1+
Build ID: 5b168b3fa568e48e795234dc5fa454bf24c9805e
CPU Threads: 4; OS Version: Linux 4.8; UI Render: default; 
Locale: ca-ES (ca_ES.UTF-8)

Version 4.1.0.0.alpha0+ (Build ID: efca6f15609322f62a35619619a6d5fe5c9bd5a)
Comment 5 Stéphane Guillou (stragu) 2021-05-19 13:40:48 UTC
Reproduced in:

Version: 7.2.0.0.alpha1+ / LibreOffice Community
Build ID: b1c0734ffe0f395757b6e0cea7830d820231afeb
CPU threads: 8; OS: Linux 4.15; UI render: default; VCL: gtk3
Locale: en-AU (en_AU.UTF-8); UI: en-US
TinderBox: Linux-rpm_deb-x86_64@86-TDF, Branch:master, Time: 2021-05-18_03:16:20
Calc: threaded
Comment 6 QA Administrators 2023-07-29 03:17:49 UTC Comment hidden (obsolete)
Comment 7 Andreas Heinisch 2025-01-08 17:17:12 UTC
Problem lies around in static void SetCharFormatAttrs [1]. None of the settings (font-size, background, posture, etc.) will be actually parsed when opening a file. Copy & paste however works because the style are applied anywhere else.

[1] https://opengrok.libreoffice.org/xref/core/sw/source/filter/html/htmlcss1.cxx?r=7e4f4a0ccd3c56093dec44c7dcdd14c8b34623c3#180