[Webkit-unassigned] [Bug 76948] min-width is not implemented on <table> for table-layout: fixed

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Mon Feb 6 11:48:49 PST 2012


--- Comment #5 from Max Vujovic <mvujovic at adobe.com>  2012-02-06 11:48:47 PST ---
(In reply to comment #4)
> I had a look at you patch for issue 76553, and the below code in "RenderTable.cpp" seems to have fixed it:-
> Method :- "RenderTable::computeLogicalWidth"
> // Ensure we aren't smaller than our min-width style.
> Length styleMinLogicalWidth = style()->logicalMinWidth();
> if (styleMinLogicalWidth.isSpecified() && styleMinLogicalWidth.isPositive())
>     setLogicalWidth(max(logicalWidth(), ConvertStyleLogicalWidthToComputedWidth(styleMinLogicalWidth, availableLogicalWidth)));
> I think this piece of code takes the css min-width into consideration and sets width it accordingly.

It does seem to work in most cases, but I think some cases would fail for fixed table layout without additional code in FixedTableLayout::computePreferredLogicalWidths. I'm not exactly sure what these cases are. This is related to your observation below.

> Another Point I Observed:-
> I think the above code will also be working for "table-layout: auto" case (issue 76553). I tried by removing the modified code from "AutoTableLayout::computePreferredLogicalWidths" and found that min-width for "table-layout: auto" is also working.
> Code that I removed:-
> Method :- AutoTableLayout::computePreferredLogicalWidths
> Length tableLogicalMinWidth = m_table->style()->logicalMinWidth();
> if (tableLogicalMinWidth.isFixed() && tableLogicalMinWidth.isPositive()) {
>     minWidth = max<int>(minWidth, tableLogicalMinWidth.value());
>     maxWidth = max<int>(minWidth, maxWidth);
> }
> I think either of the code could have fixed the issue for "table-layout: auto". So is there any specific reason for both the code changes?

If you look just above that code in AutoTableLayout::computePreferredLogicalWidths, you will see similar code that adjusts the min and max logical widths if a fixed width style is defined:

    if (tableLogicalWidth.isFixed() && tableLogicalWidth.isPositive()) {
        minWidth = max<int>(minWidth, tableLogicalWidth.value());
        maxWidth = minWidth;
    } else if (!remainingPercent && maxNonPercent) {

Based on your observation, I would think that this code is also unnecessary because RenderTable::computeLogicalWidth covers fixed and percent width styles. However, if you comment out that code in AutoTableLayout::computePreferredLogicalWidths like this:

    if (tableLogicalWidth.isFixed() && tableLogicalWidth.isPositive()) {
        //minWidth = max<int>(minWidth, tableLogicalWidth.value());
        //maxWidth = minWidth;
    } else if (!remainingPercent && maxNonPercent) {

You will see that these tests fail:


This suggests that some table layout code is depending on RenderTable's m_minPreferredLogicalWidth and m_maxPreferredLogicalWidth being set with fixed width styles. I haven't tracked it down though, but if you do, that would fantastic.

If you find out why, it would be nice to take out the code you want to remove for min-width *and* its related code for width, or at least to understand exactly what depends on that code to write some additional tests.

I'm working on some SVG bugs currently, so thanks for looking at this bug :).

Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

More information about the webkit-unassigned mailing list