Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 46e34443b1ae64a65ea99957cd01ecf467700d32
      
https://github.com/WebKit/WebKit/commit/46e34443b1ae64a65ea99957cd01ecf467700d32
  Author: Ahmad Saleem <[email protected]>
  Date:   2025-12-15 (Mon, 15 Dec 2025)

  Changed paths:
    M LayoutTests/TestExpectations
    M 
LayoutTests/fast/table/table-insert-before-non-anonymous-block-expected.txt
    M LayoutTests/platform/glib/fast/css/acid2-expected.txt
    M LayoutTests/platform/glib/fast/css/acid2-pixel-expected.txt
    M 
LayoutTests/platform/glib/fast/dynamic/insert-before-table-part-in-continuation-expected.txt
    M LayoutTests/platform/glib/http/tests/misc/acid2-expected.txt
    M LayoutTests/platform/glib/http/tests/misc/acid2-pixel-expected.txt
    M LayoutTests/platform/ios/fast/css/acid2-expected.txt
    M LayoutTests/platform/ios/fast/css/acid2-pixel-expected.txt
    M 
LayoutTests/platform/ios/fast/dynamic/insert-before-table-part-in-continuation-expected.txt
    M LayoutTests/platform/ios/http/tests/misc/acid2-expected.txt
    M LayoutTests/platform/ios/http/tests/misc/acid2-pixel-expected.txt
    M LayoutTests/platform/mac/fast/css/acid2-expected.txt
    M LayoutTests/platform/mac/fast/css/acid2-pixel-expected.txt
    M 
LayoutTests/platform/mac/fast/dynamic/insert-before-table-part-in-continuation-expected.txt
    M LayoutTests/platform/mac/http/tests/misc/acid2-expected.txt
    M LayoutTests/platform/mac/http/tests/misc/acid2-pixel-expected.txt
    M Source/WebCore/rendering/RenderTableCell.cpp

  Log Message:
  -----------
  [Tables] Fix baseline handling by skipping adjustments when cell has no 
inflow children
https://bugs.webkit.org/show_bug.cgi?id=298659
rdar://problem/160774504

Reviewed by Alan Baradlay.

This patch aligns WebKit with Gecko / Firefox and Blink / Chromium.

Inspired by: 
https://chromium.googlesource.com/chromium/src/+/ca5380c68d5805f2e7ae6914620723fed797685c

According to Web Specification [1], the baseline of a table cell is the
baseline of the first in-flow line box or table-row, whichever comes first.
If none exist, the baseline falls back to the bottom content edge of the
cell box.

WebKit previously always attempted to adjust intrinsic padding during baseline
alignment, even for cells containing only out-of-flow (OOF) children. However,
the specification distinguishes between:

- Baseline determination (always produced, falling back to content edge if 
needed)
- Baseline alignment adjustments (only applied when in-flow children exist)

This patch adds an in-flow child check in `applyStandard` to ensure that
intrinsic padding adjustments are skipped for cells with only OOF children.
In such cases, the baseline defaults to the content edge without applying
any padding shift. The check uses `firstInFlowChild()` for efficiency, and
the baseline computation is deferred until after this check to avoid
unnecessary calculations when early-returning.

This patch fixes WebKit's behavior and makes it consistent with other browsers
and closer to the web specification.

[1] https://www.w3.org/TR/CSS21/tables.html#height-layout

* Source/WebCore/rendering/RenderTableCell.cpp:
(WebCore::RenderTableCell::computeIntrinsicPadding):

> Progression:
* LayoutTests/TestExpectations:

> Rebaselines:
* LayoutTests/fast/table/table-insert-before-non-anonymous-block-expected.txt:
* LayoutTests/platform/glib/fast/css/acid2-expected.txt:
* LayoutTests/platform/glib/fast/css/acid2-pixel-expected.txt:
* 
LayoutTests/platform/glib/fast/dynamic/insert-before-table-part-in-continuation-expected.txt:
* LayoutTests/platform/glib/http/tests/misc/acid2-expected.txt:
* LayoutTests/platform/glib/http/tests/misc/acid2-pixel-expected.txt:
* LayoutTests/platform/ios/fast/css/acid2-expected.txt:
* LayoutTests/platform/ios/fast/css/acid2-pixel-expected.txt:
* 
LayoutTests/platform/ios/fast/dynamic/insert-before-table-part-in-continuation-expected.txt:
* LayoutTests/platform/ios/http/tests/misc/acid2-expected.txt:
* LayoutTests/platform/ios/http/tests/misc/acid2-pixel-expected.txt:
* LayoutTests/platform/mac/fast/css/acid2-expected.txt:
* LayoutTests/platform/mac/fast/css/acid2-pixel-expected.txt:
* 
LayoutTests/platform/mac/fast/dynamic/insert-before-table-part-in-continuation-expected.txt:
* LayoutTests/platform/mac/http/tests/misc/acid2-expected.txt:
* LayoutTests/platform/mac/http/tests/misc/acid2-pixel-expected.txt:

Canonical link: https://commits.webkit.org/304477@main



To unsubscribe from these emails, change your notification settings at 
https://github.com/WebKit/WebKit/settings/notifications

Reply via email to