Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 292b717d89788fcfb8e6192d556a0a6ed7fd9e9f
      
https://github.com/WebKit/WebKit/commit/292b717d89788fcfb8e6192d556a0a6ed7fd9e9f
  Author: Ahmad Saleem <[email protected]>
  Date:   2026-01-05 (Mon, 05 Jan 2026)

  Changed paths:
    A 
LayoutTests/imported/w3c/web-platform-tests/css/css-tables/table-colspan-percent-auto-expected.html
    A 
LayoutTests/imported/w3c/web-platform-tests/css/css-tables/table-colspan-percent-auto-ref.html
    A 
LayoutTests/imported/w3c/web-platform-tests/css/css-tables/table-colspan-percent-auto.html
    M LayoutTests/platform/gtk/fast/table/003-expected.txt
    M LayoutTests/platform/mac-sequoia-wk1/fast/table/003-expected.txt
    M LayoutTests/platform/mac-sequoia-wk2/fast/table/003-expected.txt
    M LayoutTests/platform/mac-sonoma-wk1/fast/table/003-expected.txt
    M LayoutTests/platform/mac-wk1/fast/table/003-expected.txt
    M LayoutTests/platform/mac-wk2/fast/table/003-expected.txt
    M LayoutTests/platform/mac/fast/table/003-expected.txt
    M LayoutTests/platform/wpe/fast/table/003-expected.txt
    M Source/WebCore/rendering/AutoTableLayout.cpp

  Log Message:
  -----------
  Fix table column width distribution for colspan with mixed percent and auto 
columns
https://bugs.webkit.org/show_bug.cgi?id=303263
rdar://165561401

Reviewed by Alan Baradlay.

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

When a table has a row with mixed percentage and auto width columns, and
another row with a colspan spanning those columns, the auto column's width
was incorrectly negating the percentage constraint. This caused the width
distribution to be based solely on content width rather than respecting the
percentage values.

The issue occurred in AutoTableLayout::calcEffectiveLogicalWidth() when
distributing the colspan cell's min/max widths. The code had separate paths
for all-fixed columns and all-percent columns, but no proper handling for
mixed percent+auto columns.
The fix adds a new branch that detects when we have mixed percentage and
auto columns. By this point in the code, the earlier percentage distribution
logic has already converted auto columns to effective percentage widths. The
new code calculates the total effective percentage and distributes the
colspan's min/max widths proportionally based on these percentages, similar
to the existing all-percent case.

This ensures that a 90% column and an auto column (converted to ~10%)
receive width in a 90:10 ratio from the spanning cell, properly respecting
the percentage constraint.

Tests: 
imported/w3c/web-platform-tests/css/css-tables/table-colspan-percent-auto-ref.html
       
imported/w3c/web-platform-tests/css/css-tables/table-colspan-percent-auto.html
* 
LayoutTests/imported/w3c/web-platform-tests/css/css-tables/table-colspan-percent-auto-expected.html:
 Added.
* 
LayoutTests/imported/w3c/web-platform-tests/css/css-tables/table-colspan-percent-auto-ref.html:
 Added.
* 
LayoutTests/imported/w3c/web-platform-tests/css/css-tables/table-colspan-percent-auto.html:
 Added.
* Source/WebCore/rendering/AutoTableLayout.cpp:
(WebCore::AutoTableLayout::calcEffectiveLogicalWidth):

> Rebaselines:
* LayoutTests/platform/gtk/fast/table/003-expected.txt:
* LayoutTests/platform/mac-sequoia-wk1/fast/table/003-expected.txt:
* LayoutTests/platform/mac-sequoia-wk2/fast/table/003-expected.txt:
* LayoutTests/platform/mac-sonoma-wk1/fast/table/003-expected.txt:
* LayoutTests/platform/mac-wk1/fast/table/003-expected.txt:
* LayoutTests/platform/mac-wk2/fast/table/003-expected.txt:
* LayoutTests/platform/mac/fast/table/003-expected.txt:
* LayoutTests/platform/wpe/fast/table/003-expected.txt:

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



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

Reply via email to