Skip to content

LibWeb: Propagate vertical-align to anonymous table wrapper boxes - #11064

Merged
gmta merged 1 commit into
LadybirdBrowser:masterfrom
tcl3:libweb_vertical_align_table_fix
Aug 10, 2026
Merged

LibWeb: Propagate vertical-align to anonymous table wrapper boxes#11064
gmta merged 1 commit into
LadybirdBrowser:masterfrom
tcl3:libweb_vertical_align_table_fix

Conversation

@tcl3

@tcl3 tcl3 commented Aug 9, 2026

Copy link
Copy Markdown
Member

Previously, a table's computed vertical-align value remained on the table box, where it had no effect. Inline tables were therefore always baseline aligned. The value is now moved to the anonymous table wrapper box, which participates in inline layout in place of the table box.

@coderabbitai

coderabbitai Bot commented Aug 9, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 49d3c005-3e47-4876-8d04-f30d4de0dd09

📥 Commits

Reviewing files that changed from the base of the PR and between 74fcad4 and 5676e18.

📒 Files selected for processing (1)
  • Libraries/LibWeb/Layout/Node.cpp
🚧 Files skipped from review as they are similar to previous changes (1)
  • Libraries/LibWeb/Layout/Node.cpp

📝 Walkthrough

Walkthrough

The table layout code now resets vertical-align on the table box and transfers the table’s computed value to its wrapper box. Four CSS2 XHTML tests cover border-top, border-top-color, border-bottom, and border-bottom-color on inline-table elements with nested table-row and table-cell structures.

Possibly related PRs

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description check ✅ Passed The description directly explains the vertical-align change for inline tables and matches the implementation objective.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick comments (1)
Libraries/LibWeb/Layout/Node.cpp (1)

1101-1115: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Keep the transfer-contract comment accurate.

Line 1104 says that all other non-inheritable values remain on the table box, but Line 1115 now transfers vertical-align to the wrapper. Update the comment to list vertical-align as an exception.

Suggested comment update
-    // all other values of non-inheritable properties are used on the table box and not the table wrapper box.
+    // Other non-inheritable values are used on the table box and not the table wrapper box.
+    // `vertical-align` is also transferred to the wrapper.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@Libraries/LibWeb/Layout/Node.cpp` around lines 1101 - 1115, Update the
transfer-contract comment in
NodeWithStyle::transfer_table_box_computed_values_to_wrapper_computed_values to
include vertical-align among the properties transferred to the table wrapper
box, keeping the documented behavior consistent with the existing
set_vertical_align call.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Nitpick comments:
In `@Libraries/LibWeb/Layout/Node.cpp`:
- Around line 1101-1115: Update the transfer-contract comment in
NodeWithStyle::transfer_table_box_computed_values_to_wrapper_computed_values to
include vertical-align among the properties transferred to the table wrapper
box, keeping the documented behavior consistent with the existing
set_vertical_align call.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: c648f0d3-8edb-42a5-a645-49354dd603e0

📥 Commits

Reviewing files that changed from the base of the PR and between efb6f45 and 74fcad4.

📒 Files selected for processing (5)
  • Libraries/LibWeb/Layout/Node.cpp
  • Tests/LibWeb/Ref/input/wpt-import/css/CSS2/borders/border-bottom-applies-to-014.xht
  • Tests/LibWeb/Ref/input/wpt-import/css/CSS2/borders/border-bottom-color-applies-to-014.xht
  • Tests/LibWeb/Ref/input/wpt-import/css/CSS2/borders/border-top-applies-to-014.xht
  • Tests/LibWeb/Ref/input/wpt-import/css/CSS2/borders/border-top-color-applies-to-014.xht

Previously, a table's computed `vertical-align` value remained on the
table box, where it had no effect. Inline tables were therefore always
baseline aligned. The value is now moved to the anonymous table wrapper
box, which participates in inline layout in place of the table box.
@tcl3
tcl3 force-pushed the libweb_vertical_align_table_fix branch from 74fcad4 to 5676e18 Compare August 10, 2026 00:06
@gmta
gmta merged commit 8788696 into LadybirdBrowser:master Aug 10, 2026
20 of 22 checks passed
@tcl3
tcl3 deleted the libweb_vertical_align_table_fix branch August 10, 2026 07:52
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.

2 participants