Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Text in table with style="direction: rtl;" overlaps collapsed border #2055

Open
kygoh opened this issue Feb 3, 2024 · 2 comments · May be fixed by #2058
Open

Text in table with style="direction: rtl;" overlaps collapsed border #2055

kygoh opened this issue Feb 3, 2024 · 2 comments · May be fixed by #2058
Labels
bug Existing features not working as expected

Comments

@kygoh
Copy link
Contributor

kygoh commented Feb 3, 2024

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:

Screenshot 2024-02-03 at 11 33 26 PM

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?

liZe added a commit that referenced this issue Feb 7, 2024
@liZe liZe added the bug Existing features not working as expected label Feb 7, 2024
@liZe liZe linked a pull request Feb 7, 2024 that will close this issue
@liZe
Copy link
Member

liZe commented Feb 7, 2024

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.

@kygoh
Copy link
Contributor Author

kygoh commented Feb 11, 2024

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:

  • TableBox
  • TableCellBox

but not when called by BlockBox in PR #2059.

The test cases haven't cover direction: rtl; for these boxes:

  • PageBox
  • InlineBox
  • InlineBlockBox
  • BlockReplacedBox
  • InlineReplacedBox
  • FlexBox
  • TableCaptionBox
  • TableRowGroupBox
  • FootnoteAreaBox
  • MarginBox

Are there more test cases to be created?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Existing features not working as expected
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants