Skip to content

fix(painter): render double table borders as two rules (SD-3308)#3654

Closed
tupizz wants to merge 1 commit into
mainfrom
tadeu/sd-3308-double-border-width
Closed

fix(painter): render double table borders as two rules (SD-3308)#3654
tupizz wants to merge 1 commit into
mainfrom
tadeu/sd-3308-double-border-width

Conversation

@tupizz
Copy link
Copy Markdown
Contributor

@tupizz tupizz commented Jun 5, 2026

Summary

Word renders w:val="double" table borders as two parallel rules. SuperDoc emitted the authored width verbatim, and CSS double collapses to a single solid-looking line below 3px (1px rule + 1px gap + 1px rule), so a typical sz12 double border (~2px) rendered as one thin line.

The fix clamps the rendered width up to 3px when the resolved CSS style is double, without shrinking authored widths that are already 3px or wider. All border paint paths (cell borders, outer table edges, continuation rows) funnel through applyBorder, so the one change covers them all.

Linear: SD-3308

Verification

  • Mutation fixture double_or_dotted_borders.docx: the double table now shows two rules on every outer and interior edge; dotted and dashed tables render unchanged (2px dotted/dashed before and after).
  • The prior unit test asserted the collapsed 2px double output and locked in the bug; the expectation flip to 3px is deliberate and documented in the test.
  • painter-dom suite: 1243 passed.

Notes

One step of the SD-3308 plan. Border precedence, nil/none suppression, inside gridlines, and cell-spacing borders were verified at Word parity against the SD-3308 fixture set and are untouched here.

CSS `double` only renders two distinct rules when the border is at least
3px wide (1px rule + 1px gap + 1px rule). The painter emitted the authored
width verbatim, so a typical w:val="double" w:sz="12" border (~2px) was
collapsed by the browser into a single solid-looking line, while Word
always renders two parallel rules for double borders.

Clamp the rendered width up to 3px when the resolved CSS style is double,
keeping authored widths that are already 3px or wider. Every border paint
path funnels through applyBorder, so cell borders, outer table edges, and
continuation rows are all covered by the one change.

The prior unit test asserted the collapsed 2px output; the expectation flip
to 3px is deliberate. Verified against the SD-3308 mutation fixture
(double_or_dotted_borders.docx): the double table now shows two rules on
every outer and interior edge, dotted and dashed render unchanged.
@linear-code
Copy link
Copy Markdown

linear-code Bot commented Jun 5, 2026

SD-3308

@codecov-commenter
Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@tupizz
Copy link
Copy Markdown
Contributor Author

tupizz commented Jun 5, 2026

Superseded by #3658, which carries this commit unchanged alongside the SD-3035 style shading fix.

@tupizz tupizz closed this Jun 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants