Anonymous table box construction fixups (CSS 2.2 §17.2.1) - #783
Open
nicoburns wants to merge 2 commits into
Open
Anonymous table box construction fixups (CSS 2.2 §17.2.1)#783nicoburns 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:
|
staging-devin-ai-integration
Bot
force-pushed
the
devin/1787608304-table-anon-fixups
branch
from
August 24, 2026 22:41
0334ee0 to
0b593f0
Compare
staging-devin-ai-integration
Bot
force-pushed
the
devin/1787608304-table-anon-fixups
branch
from
August 24, 2026 22:54
0b593f0 to
897320b
Compare
- Generalize anonymous box creation to AnonKind (block/table/row/cell) styled via stylo's precomputed ServoAnonymous* pseudo-elements, with UA rules in default.css. - Run-based fixups inside tables: consecutive misplaced children share a single anonymous cell; cells outside a row share an anonymous row. - Missing-parent fixups: runs of table-internal boxes outside a table are wrapped in an anonymous table box, routed through normal table construction. Whitespace between table-internal boxes is discarded.
…ements as ordinary table content, rebuild tables on table-property style changes
staging-devin-ai-integration
Bot
force-pushed
the
devin/1787608304-table-anon-fixups
branch
from
August 24, 2026 23:00
897320b to
640f18d
Compare
staging-devin-ai-integration
Bot
changed the base branch from
devin/1787604682-table-anonymous-cells
to
devin/1787612328-anon-node-generalization
August 24, 2026 23:04
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
Follow-up to #781 (based on its branch) implementing the anonymous table box fixups of CSS 2.2 §17.2.1 with real anonymous nodes instead of #781's one-pseudo-cell-per-child simplification.
Generalized anonymous box creation (
construct.rs):create_anonymous_blockis now a thin wrapper overwhich styles the node via stylo's precomputed
ServoAnonymousBox/Table/TableRow/TableCellpseudo-elements. Since precomputed pseudos take their declarations from UA rules,default.cssgains::-servo-anonymous-table { display: table }(etc.), so the anonymous boxes carry honest computed displays.Fixups inside tables (
table.rs):collect_table_cellsis rewritten as aTableBuilderwalker withopen_anon_row/open_anon_cellrun state:display: contentsstays transparent to runs.build_table_contextreturns the generated node ids, which are registered inLayoutChildren::anonymous_blocksso the existing reconstruction/deallocation lifecycle applies unchanged. Real-cell-only behavior (colspan/rowspanattrs,first_cell_border) is preserved.Missing-parent fixups (
construct.rs): flow/flex/grid child collection now wraps consecutive runs of table-internal children (display: table-cell/table-row/row-group/...) in an anonymousdisplay: tablebox (LayoutChildren::anonymous_table_id), which then flows through normal table construction. Whitespace between table-internal boxes is discarded rather than closing the run, per spec.Testing
New
tests/blitz-tests/tests/table_box_fixups.rscovers: run-sharing of misplaced children, real cells closing runs, anonymous rows around bare cells, bare text under tables, stray cells/rows in block containers, incremental mutation geometry updates, and anonymous-node leak checks across 20 reconstructions.cargo fmt/clippy --workspace/test --workspaceall pass.Regression triage (vs
mainbaseline)Fixed in this PR (follow-up commit):
s-11-1-1b-001/008/009,caption-margin-002/005,contain-size-056,contain-size-table-caption-001,content-visibility-094/095,table-as-item-flex-cross-size,table-as-item-stretch-cross-size{,-2}):TableBuilderwas pushingdisplay: table-captionchildren into anonymous cells; they are now excluded from the grid (matching pre-PR behavior — full caption layout needs the table wrapper box and remains future work).outline-applies-to-016/017): CSS 2.2 table box generation applies to non-replaced elements only, so internal-table display on e.g.<img>no longer triggers the missing-parent anonymous-table wrapping.border-spacing/border-collapseetc. now mark box-tree rebuild damage, since these are baked intoTableContextat construction time.Not regressions (fail identically on
mainin a local run; likely CI environment/flakiness):css/WOFF2/*.Remaining, out of scope for this PR:
bidi-008b,inline-table-002a: previously the misplaced table content wasn't rendered at all, so test and ref trivially matched; the anon boxes now render it and expose pre-existing bidi/letter-spacing and inline-table baseline issues.table-anonymous-border-spacing: requires script support (mutatesstyle.borderSpacingfrom JS); the static rendering is now more correct.transform-transformable-table-{row,row-group,header-group,footer-group}: transforms on stray table-internal boxes wrapped in an anonymous table; needs transform support on internal table boxes.break-before-second-row: fragmentation.WPT results
61 newly passing, 8 newly failing (net +53).
Full diff (69 changed tests)
Generated by the WPT workflow.
Link to Devin session: https://dioxus.staging.devinenterprise.com/sessions/e0b69caedcd34e829ff73fb7ff216a75
Open in Devin Desktop: https://dioxus.staging.devinenterprise.com/desktop/session/e0b69caedcd34e829ff73fb7ff216a75?variant=devin-insiders
Requested by: @nicoburns