Offset table row backgrounds and collapsed borders by table border/padding - #638
Open
nicoburns wants to merge 2 commits into
Open
Offset table row backgrounds and collapsed borders by table border/padding#638nicoburns wants to merge 2 commits into
nicoburns wants to merge 2 commits into
Conversation
Contributor
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
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
Fixes misaligned table painting visible on https://blitz.is/status/wpt/css/CSS2/floats: white first-column cell backgrounds didn't line up with rows and the coloured
<tr>backgrounds bled through the collapsed-border gutters.Table cells are laid out inside the table's content box (offset by the table-level border/padding that
build_table_contextsynthesizes — inborder-collapse: collapsemode the table border is set to the cell border width), butdraw_table_row_backgroundsanddraw_table_borderspainted their rects starting at the border-box origin(0, 0). Every row-background rect and inner gutter fill was therefore shifted up/left by one border width relative to the cells:Both functions now resolve
table.style.border/padding(viaResolveOrZero) and offset all rects by them. The outer borders indraw_table_bordersare also now drawn from the table's own resolved border widths spanning the full border-box (previously they used the first cell's border width and only spannedinner_width/inner_height, leaving the corners uncovered and sitting one border width too high/left on the bottom/right edges).Verified against the live page and a minimal repro: row backgrounds, cell backgrounds, and collapsed borders now align.
Link to Devin session: https://dioxus.staging.devinenterprise.com/sessions/65672de3b7ef45f88c8a46c16e1ac8b2
Requested by: @nicoburns
WPT results
3 newly passing, 0 newly failing (net +3).
Full diff (3 changed tests)
Generated by the WPT workflow.