Repository navigation
feat(layout): implement HTML table rowspan - #437
Merged
Merged
Conversation
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]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Implements HTML table
rowspan.Closes #436.
Wikipedia's own chemical-element infobox template (e.g. the Carbon article) uses
rowspan13 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.cellRowSpanmirrorscellColSpan's own "invalid value default".collectRows/makeRowgained a cross-row column-occupancy map so a rowspan>1 cell's column is correctly skipped by later rows.tableRowsis 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.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), andcellRowSpan's own invalid-value-default.go build/go vet/gofmt -l/go test ./.../govulncheck ./...clean.layoutpackage coverage 100.0% (the floor).webengine_nojs webengine_nonet webengine_fontsextbuild-tag lane builds and vets clean.🤖 Generated with Claude Code