Text in table with style="direction: rtl;" overlaps collapsed border
The leftmost and rightmost 'XX' for the table (with style="direction: rtl") at the bottom of the following screenshot overlap the left and right border:
Html adapted from http://test.weasyprint.org/suite-css21/chapter17/section18/test4/:
<style>
table {
border-collapse:collapse;
margin-bottom: 1em;
}
tr {
border-left: 5px solid fuchsia;
border-right: 5px solid purple;
}
td.right {
background-color: yellow;
border-bottom: 5px solid orange;
}
td.left {
background-color: aqua;
border-bottom: 5px solid teal;
}
</style>
<table style="direction: ltr;">
<tr>
<td class="left">XX</td>
<td class="right">XX XX XX</td>
</tr>
</table>
<table style="direction: rtl;">
<tr>
<td class="right">XX XX XX</td>
<td class="left">XX</td>
</tr>
</table>
Any pointers on where to troubleshoot?
Hi!
Thanks for the report. Two (!) pull requests have been opened, but I don’t know if we’ll manage to get an easy and clean fix.
Code and test cases until commit d29ba8c in PR #2056 seems to imply content_box_x function has to take into account direction: rtl; when called by:
TableBoxTableCellBox
but not when called by BlockBox in PR #2059.
The test cases haven't cover direction: rtl; for these boxes:
PageBoxInlineBoxInlineBlockBoxBlockReplacedBoxInlineReplacedBoxFlexBoxTableCaptionBoxTableRowGroupBoxFootnoteAreaBoxMarginBox
Are there more test cases to be created?