Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 07bb7826eccd31959a9310bc51fc5922fdec558b
      
https://github.com/WebKit/WebKit/commit/07bb7826eccd31959a9310bc51fc5922fdec558b
  Author: Ahmad Saleem <[email protected]>
  Date:   2026-03-29 (Sun, 29 Mar 2026)

  Changed paths:
    M 
LayoutTests/imported/w3c/web-platform-tests/quirks/table-cell-nowrap-minimum-width-calculation-expected.txt
    M LayoutTests/platform/glib/tables/mozilla/bugs/bug57828-expected.txt
    M LayoutTests/platform/glib/tables/mozilla/bugs/bug78162-expected.txt
    M LayoutTests/platform/ios/tables/mozilla/bugs/bug57828-expected.txt
    M LayoutTests/platform/ios/tables/mozilla/bugs/bug78162-expected.txt
    M LayoutTests/platform/mac/tables/mozilla/bugs/bug57828-expected.txt
    M LayoutTests/platform/mac/tables/mozilla/bugs/bug78162-expected.txt
    M Source/WebCore/rendering/RenderTableCell.cpp

  Log Message:
  -----------
  Table cell nowrap minimum width calculation quirk should be quirks-mode only
https://bugs.webkit.org/show_bug.cgi?id=308866
rdar://171410252

Reviewed by Alan Baradlay.

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

The old guard `!element() || textWrapMode() == NoWrap || !nowrapAttr` was
broken in the common case: when only the nowrap attribute is present,
textWrapMode() is already NoWrap (the attribute maps to white-space:nowrap),
so the second sub-expression is true and we early-return — skipping the
quirk entirely. In the edge case where CSS overrides wrapping
(<td nowrap style="white-space:normal">), all three sub-expressions are
false, so the quirk fires even though CSS explicitly opted out of nowrap.

Fix by gating on document().inQuirksMode() instead of textWrapMode(), and
wrapping the resolved width in adjustBorderBoxLogicalWidthForBoxSizing()
before the comparison (the old code compared a content-box CSS width against
m_minPreferredLogicalWidth which is a border-box value).

Cases                                          | Old guard          | New guard 
         | Quirk
-----------------------------------------------+--------------------+--------------------+--------
<td nowrap>              (quirks mode)         | early return (bug) | fall 
through       | applied
<td nowrap>              (standards mode)      | early return       | early 
return       | skipped
<td>                     (any mode)            | early return       | early 
return       | skipped
<td nowrap style="white-space:normal"> (quirks)| fall through       | fall 
through       | applied
<td style="white-space:nowrap">        (quirks)| early return       | early 
return       | skipped

* Source/WebCore/rendering/RenderTableCell.cpp:
(WebCore::RenderTableCell::computePreferredLogicalWidths):
* 
LayoutTests/imported/w3c/web-platform-tests/quirks/table-cell-nowrap-minimum-width-calculation-expected.txt:
 Progression

> Rebaselines: (match other browsers)
* LayoutTests/platform/glib/tables/mozilla/bugs/bug57828-expected.txt:
* LayoutTests/platform/glib/tables/mozilla/bugs/bug78162-expected.txt:
* LayoutTests/platform/ios/tables/mozilla/bugs/bug57828-expected.txt:
* LayoutTests/platform/ios/tables/mozilla/bugs/bug78162-expected.txt:
* LayoutTests/platform/mac/tables/mozilla/bugs/bug57828-expected.txt:
* LayoutTests/platform/mac/tables/mozilla/bugs/bug78162-expected.txt:

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



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

Reply via email to