feat(painter-dom): implement w:bidiVisual RTL table rendering (SD-2278)#2556
Conversation
…76 §17.4.1) Detect `tableProperties.rightToLeft` from `w:bidiVisual` and render tables with visually reversed column order: - Set `dir="rtl"` + `direction: rtl` on table fragment container - Mirror cell X positions so first logical column appears on the right - Swap resolved border left↔right in CSS output for correct visual edges - Swap cell padding left↔right per Part 4 §14.3.3–14.3.8 - Handle cell spacing and colspan in mirrored layout - Mirror ghost cell positions for cross-page rowspan continuations Fixes SD-2278
…mirroring - border-utils: tests for swapTableBordersLR and swapCellBordersLR - renderTableRow: tests for RTL x-position mirroring with asymmetric widths, isRtl passthrough to renderTableCell, and border left↔right swap
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 18ae3b9102
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
- Remove dir="rtl" from table container — w:bidiVisual only affects cell layout order, not paragraph text direction. Cell reversal is handled by X mirroring already. Setting dir on the container would flip bidi behavior for LTR/neutral content inside cells. - Fix ghost cell spacing mismatch — ghostX was computed without cell spacing but totalWidth included it, causing misaligned continuation cells in RTL tables with non-zero cellSpacing.
…tables For tables with borderCollapse=separate and cellSpacing, the container paints outer table borders directly. Swap left↔right for RTL tables so the container border matches the mirrored cell layout.
- renderTableCell: RTL padding swap with asymmetric left/right values - renderTableRow: RTL mirroring with non-zero cellSpacing + colspan - renderTableFragment: ghost cell RTL x-position mirroring for rowspan continuations, isRtl propagation to body rows
|
🎉 This PR is included in vscode-ext v1.1.0-next.6 |
|
🎉 This PR is included in superdoc v1.24.0-next.7 The release is available on GitHub release |
|
🎉 This PR is included in superdoc-cli v0.5.0-next.7 The release is available on GitHub release |
|
🎉 This PR is included in superdoc-sdk v1.3.0-next.7 |
|
🎉 This PR is included in esign v2.2.0-next.3 The release is available on GitHub release |
|
🎉 This PR is included in template-builder v1.3.0-next.2 The release is available on GitHub release |
|
🎉 This PR is included in superdoc v1.24.0 The release is available on GitHub release |
|
🎉 This PR is included in superdoc-cli v0.5.0 The release is available on GitHub release |
|
🎉 This PR is included in superdoc-sdk v1.3.0 |
|
🎉 This PR is included in vscode-ext v2.2.0 |
Detect
tableProperties.rightToLeftfromw:bidiVisualand render tables with visually reversed column order:dir="rtl"+direction: rtlon table fragment containerFixes SD-2278