Bug 122613 - HTML Filter does not resolve CSS for divs
Summary: HTML Filter does not resolve CSS for divs
Status: RESOLVED DUPLICATE of bug 95861
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
6.1.3.2 release
Hardware: x86-64 (AMD64) macOS (All)
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-01-09 20:51 UTC by Jens Troeger
Modified: 2019-01-10 13:19 UTC (History)
2 users (show)

See Also:
Crash report or crash signature:


Attachments
Example HTML with simple nested elements. (2.53 KB, text/html)
2019-01-09 20:52 UTC, Jens Troeger
Details
Example CSS for the example HTML. (1.19 KB, text/css)
2019-01-09 20:53 UTC, Jens Troeger
Details
Screenshot of failed HTML rendering because CSS wasn’t computed for nested elements. (186.63 KB, image/jpeg)
2019-01-09 20:54 UTC, Jens Troeger
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Jens Troeger 2019-01-09 20:51:47 UTC
Hello,

See also this thread and the dev mailing list: http://document-foundation-mail-archive.969070.n3.nabble.com/HTML-import-filter-very-too-basic-td4255790.html

I think that the attached image says it all (LibreOffice 6.1.3.2). It looks like the HTML import is really very simple, and does not apply CSS to the content of div or span elements. In the example/test file there are a few paragraphs nested inside of a div and inherit the color of the div while overriding the font. Also, the initial paragraph starts with a span to italicize text.

HTML & CSS are really quite simple, but I didn’t attach the font file because I’m not sure regarding copyright. Reproduce as follows:

 – Create test folder;
 – Copy attached HTML & CSS files;
 — Copy three random font files, ideally ones that are _not_ in the system path;
 — Modify the CSS to use the local fonts;
 — `cd` into the folder and open LO.

There’s one more aspect for which I ought to file a separate bug: LO doesn’t seem to load a font from a local path relative to the CSS file? To reproduce:

 – As above, but `cd` someplace else;
 – Open HTML in LO by passing a path to the HTML file.

Cheers,
Jens
Comment 1 Jens Troeger 2019-01-09 20:52:49 UTC
Created attachment 148181 [details]
Example HTML with simple nested elements.
Comment 2 Jens Troeger 2019-01-09 20:53:42 UTC
Created attachment 148182 [details]
Example CSS for the example HTML.
Comment 3 Jens Troeger 2019-01-09 20:54:23 UTC
Created attachment 148183 [details]
Screenshot of failed HTML rendering because CSS wasn’t computed for nested elements.
Comment 4 Xisco Faulí 2019-01-10 12:19:45 UTC
Hello Jens,
Thanks for reporting this issue.
I guess this is covered by bug 95861

*** This bug has been marked as a duplicate of bug 95861 ***
Comment 5 Jens Troeger 2019-01-10 12:35:53 UTC
> Hello Jens,
> Thanks for reporting this issue.
> I guess this is covered by bug 95861

Hmm… is it? Bug 95861 seems to be more of a discussion of principles, of sense & nonsense of having HTML im/export in LO in the first place.

This bug 122613 is about a rather incomplete HTML/CSS import, whose fix I guess can be debated equally to 95861. However, there is a good reason to at least import HTML/CSS and that’s what I’m interested in.

What worries me is that the other bug has been stagnant for well over a year now. Is anybody actually working on fixing these issues?
Comment 6 Buovjaga 2019-01-10 13:19:11 UTC
(In reply to Jens Troeger from comment #5)
> Bug 95861 seems to be more of a discussion of principles, of
> sense & nonsense of having HTML im/export in LO in the first place.

The discussion was mainly about the WYSIWYG capability. Like David Tardon said: "I suggest we strip the whole Web module out. The HTML import/export should stay."

Tor's view of wanting to remove even the export capability is rather extremist.