Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: f21c0965f410667da8a31c0aa4237dc5ad342446
https://github.com/WebKit/WebKit/commit/f21c0965f410667da8a31c0aa4237dc5ad342446
Author: Ahmad Saleem <[email protected]>
Date: 2026-01-27 (Tue, 27 Jan 2026)
Changed paths:
M LayoutTests/TestExpectations
M Source/WebCore/rendering/RenderTableCell.cpp
M Source/WebCore/rendering/RenderTableCell.h
Log Message:
-----------
Percentage padding in table cells should resolve against column widths plus
interleaved spacing
https://bugs.webkit.org/show_bug.cgi?id=306291
rdar://168940907
Reviewed by Alan Baradlay.
This patch aligns WebKit with Gecko / Firefox and Blink / Chromium.
When a table cell has percentage padding in the inline direction, the
percentage should resolve against the sum of all column widths plus the
interleaved border spacing (spacing between columns), but excluding the
leading and trailing border spacing.
Previously, padding was resolving against the containing block width
(the table row), which gave incorrect results.
This patch overrides containingBlockLogicalWidthForContent() in
RenderTableCell to return the correct basis for percentage resolution.
The table's columnPositions() array stores cumulative column positions
including spacing. The last element gives the total width including all
columns and interleaved spacing. We subtract the leading hBorderSpacing()
to get the correct resolution basis.
* Source/WebCore/rendering/RenderTableCell.cpp:
(WebCore::RenderTableCell::containingBlockLogicalWidthForContent const):
* Source/WebCore/rendering/RenderTableCell.h:
* LayoutTests/TestExpectations: Progression
Canonical link: https://commits.webkit.org/306281@main
To unsubscribe from these emails, change your notification settings at
https://github.com/WebKit/WebKit/settings/notifications