[Webkit-unassigned] [Bug 12396] max-width do not work on tables

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Fri Feb 21 20:53:50 PST 2025


https://bugs.webkit.org/show_bug.cgi?id=12396

--- Comment #12 from Ahmad Saleem <ahmad.saleem792 at gmail.com> ---
Blink Merge: https://chromium.googlesource.com/chromium/src.git/+/364480a952dc2eb710b26f82543e08bd4bac825b

void AutoTableLayout::applyPreferredLogicalWidthQuirks(LayoutUnit& minWidth, LayoutUnit& maxWidth) const
{
    if (auto& tableLogicalWidth = m_table->style().logicalWidth(); tableLogicalWidth.isFixed() && tableLogicalWidth.isPositive()) {
        // 'minWidth' is the result of measuring the intrinsic content's size. Keep it to
        // make sure we are *never* smaller than the actual content.
        LayoutUnit minContentWidth = minWidth;
        // FIXME: This line looks REALLY suspicious as it could allow the minimum
        // preferred logical width to be smaller than the table content. This has
        // to be cross-checked against other browsers.
        minWidth = maxWidth = std::max<int>(minWidth, LayoutUnit { tableLogicalWidth.value() });
        const auto& styleMaxLogicalWidth = m_table->style().logicalMaxWidth();
        if (styleMaxLogicalWidth.isFixed() && !styleMaxLogicalWidth.isNegative()) {
            minWidth = std::min<int>(minWidth, LayoutUnit { styleMaxLogicalWidth.value() });
            minWidth = std::max(minWidth, minContentWidth);
            maxWidth = minWidth;
        }
    }
}

^ Fixes this test case.

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-unassigned/attachments/20250222/745a33b1/attachment.htm>


More information about the webkit-unassigned mailing list