Bug 142483 - top-right cell of table loses border in XHTML export
Summary: top-right cell of table loses border in XHTML export
Status: VERIFIED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
7.2.0.0 alpha1+
Hardware: x86-64 (AMD64) Linux (All)
: medium normal
Assignee: Not Assigned
URL:
Whiteboard: target:7.2.0
Keywords: bibisected, bisected, regression
Depends on:
Blocks: (X)HTML-Export
  Show dependency treegraph
 
Reported: 2021-05-25 13:31 UTC by Stéphane Guillou (stragu)
Modified: 2021-06-07 11:40 UTC (History)
3 users (show)

See Also:
Crash report or crash signature:


Attachments
example ODT file with table (8.80 KB, application/vnd.oasis.opendocument.text)
2021-05-25 13:32 UTC, Stéphane Guillou (stragu)
Details
XHTML exported with LO 7.2 alpha1 (3.90 KB, text/html)
2021-05-25 13:35 UTC, Stéphane Guillou (stragu)
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Stéphane Guillou (stragu) 2021-05-25 13:31:32 UTC
Description:
The top-right cell of a table in a Writer document loses its borders when exporting to XHTML.

Steps to Reproduce:
1. Create a table in writer (or open example ODT attachment)
2. Export to XHTML (File > Export as... > XHTML)
3. Open exported file in a web browser

Actual Results:
The top-right cell has no borders.

Expected Results:
The top-right cell has the same border as the rest of the table.


Reproducible: Always


User Profile Reset: No



Additional Info:
Version: 7.2.0.0.alpha1+ / LibreOffice Community
Build ID: 4a9eef7849a75ba91806886ea9c96d114c8d56f9
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-22_06:45:25
Calc: threaded
Comment 1 Stéphane Guillou (stragu) 2021-05-25 13:32:40 UTC
Created attachment 172328 [details]
example ODT file with table

This bug can be tested with this ODT file: open and export as XHTML.
Comment 2 Stéphane Guillou (stragu) 2021-05-25 13:35:17 UTC
Created attachment 172329 [details]
XHTML exported with LO 7.2 alpha1

Result of XHTML export.

The top-right cell has all border widths set to "NaNcm":

.Table1_B1 { border-top-width:NaNcm; border-top-style:; border-top-color:; border-left-width:NaNcm; border-left-style:; border-left-color:; border-bottom-width:NaNcm; border-bottom-style:; border-bottom-color:; border-right-width:NaNcm; border-right-style:; border-right-color:; padding:0.097cm; }
Comment 3 Stéphane Guillou (stragu) 2021-05-25 13:46:11 UTC
7.0.4 and 7.1.3 do not have this issue: border-width is set to "thin" in the the stylesheet.

(Interestingly, in these versions, B1 is the only cell that has a general border-width wetting, whereas the three other cells have separate values for specific sides.)

Marking as a regression.

Wondering if it has anything to do with Bug 95662 (as it is about invalid values for widths in exported XHTML code).
Comment 4 Xisco Faulí 2021-05-31 16:04:50 UTC
Regression introduced by:

https://git.libreoffice.org/core/+/9d3b39cf9fed9a305ac23d1ecaaafc8f7caaeeb0%5E%21/

commit 9d3b39cf9fed9a305ac23d1ecaaafc8f7caaeeb0	[log]
author	Svante Schubert <svante.schubert@gmail.com>	Wed Aug 26 13:44:57 2020 +0200
committer	Michael Stahl <michael.stahl@allotropia.de>	Tue Mar 02 13:23:17 2021 +0100
tree 5a0242ed7b29b4359467b9de404a1a068741fcc8
parent 3b7f5202cc7f799a692e6dd09e71926336727c25 [diff]

HTML XSLT: Missing paragraph BORDER of stand-alone border paragraph (@style:join-border problem)

Bisected with: bibisect-linux64-7.2

Adding Cc: to Svante Schubert
Comment 5 Xisco Faulí 2021-06-01 09:01:57 UTC
After the mentioned commit, there is this problem:

measure_conversion.xsl: Find no conversion for  to 'cm'!
measure_conversion.xsl: Find no conversion for  to 'cm'!
measure_conversion.xsl: Find no conversion for  to 'cm'!
measure_conversion.xsl: Find no conversion for  to 'cm'!

and the output looks like

    .Table1_B1 { border-top-width:NaNcm; border-top-style:; border-top-color:; border-left-width:NaNcm; border-left-style:; border-left-color:; border-bottom-width:NaNcm; border-bottom-style:; border-bottom-color:; border-right-width:NaNcm; border-right-style:; border-right-color:; padding:0.0382in; }

while without the code, it looks like

    .Table1_B1 { padding:0.0382in; border-width:thin; border-style:solid; border-color:#000000; }
Comment 6 Xisco Faulí 2021-06-01 09:15:49 UTC
The issue is fixed if this change

-            <xsl:for-each select="*/@*[name() != 'style:font-size-rel']">
+            <xsl:for-each select="*/@*[name() != 'style:font-size-rel'][name() != 'fo:border']">

is removed
Comment 7 Commit Notification 2021-06-04 18:05:20 UTC
Michael Stahl committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/452bf1359dab3cfab9fd6007d68592e9c96382b3

tdf#142483 filter: xhtml: fix substitution of fo:border attribute

It will be available in 7.2.0.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 8 Stéphane Guillou (stragu) 2021-06-05 08:14:35 UTC
Thank you for your work, Xisco and Michael!
Confirmed as fixed with the test document in:

Version: 7.2.0.0.alpha1+ / LibreOffice Community
Build ID: 452bf1359dab3cfab9fd6007d68592e9c96382b3
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-06-04_18:12:48
Calc: threaded
Comment 9 Xisco Faulí 2021-06-07 08:50:36 UTC
Verified in

Version: 7.2.0.0.alpha1+ / LibreOffice Community
Build ID: ec629c5ee22d02f99d66a5cf975ce239876b7f4d
CPU threads: 4; OS: Linux 5.7; UI render: default; VCL: gtk3
Locale: en-US (en_US.UTF-8); UI: en-US
Calc: threaded

@Michael Stahl, thanks for fixing this issue!!
Comment 10 Commit Notification 2021-06-07 11:40:10 UTC
Xisco Fauli committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/d161c4de0b145b975bc90ce4b0a1ff7c234b676e

tdf#142483: sw_xhtmlexport: Add unittest

It will be available in 7.2.0.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.