Skip to content

feat(layout): implement HTML table rowspan - #437

Merged
tannevaled merged 1 commit into
mainfrom
rowspan-support
Nov 15, 2026
Merged

tannevaled merged 1 commit into
mainfrom
rowspan-support

Conversation

@tannevaled

Copy link
Copy Markdown
Contributor

Summary

Implements HTML table rowspan.

Closes #436.

Wikipedia's own chemical-element infobox template (e.g. the Carbon article) uses rowspan 13 times for its multi-row property groupings; without support, every cell below a spanning one shifted one column left of where a real browser puts it, visibly misaligning the whole infobox. A prior survey (FIDELITY.md round 147) had concluded no confirmed trigger existed for this gap, but had only checked pages that don't happen to use the attribute.

  • cellRowSpan mirrors cellColSpan's own "invalid value default".
  • collectRows/makeRow gained a cross-row column-occupancy map so a rowspan>1 cell's column is correctly skipped by later rows.
  • tableRows is restructured into two passes: row heights are computed first from ordinary cells, then a rowspan cell's own deficit (natural height beyond what its spanned rows already provide) is added to the LAST spanned row — a disclosed simplification versus a real browser's own proportional distribution (CSS 2.1 doesn't define the split). A rowspan cell's own box height is the sum of its spanned rows, mirroring how a colspan cell's box width already sums its spanned columns.
  • FIDELITY.md updated (new round entry, corrected the stale "no confirmed trigger" Known-gaps bullet).

Test plan

  • layout/table_rowspan_test.go: column alignment past a rowspan>1 cell, the summed-row-height box size with a deficit on the last spanned row, a rowspan="3" case exercising the occupancy map's decrement-without-clearing branch, a rowspan reaching past the table's last row (the clamp), and cellRowSpan's own invalid-value-default.
  • Git-stash-confirmed: every new test fails with the predicted symptom against the pre-fix code.
  • go build/go vet/gofmt -l/go test ./.../govulncheck ./... clean.
  • layout package coverage 100.0% (the floor).
  • The combined webengine_nojs webengine_nonet webengine_fontsext build-tag lane builds and vets clean.

🤖 Generated with Claude Code

Wikipedia's chemical-element infobox template (e.g. the Carbon article)
rowspans property-group cells 13 times; without support every cell
below a spanning one shifted one column left of a real browser's
layout. Adds cross-row column-occupancy tracking in collectRows/
makeRow and restructures tableRows into two passes so a rowspan
cell's own box height sums its spanned rows, mirroring how colspan
already sums spanned columns.

Co-Authored-By: Claude Sonnet 5 <[email protected]>
@tannevaled
tannevaled merged commit 386493a into main Nov 15, 2026
13 checks passed
@tannevaled
tannevaled deleted the rowspan-support branch November 15, 2026 14:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

layout: HTML table rowspan is not implemented

1 participant