[Webkit-unassigned] [Bug 79128] Fieldset unexpectedly stretches to minimum intrinsic width.

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Wed Mar 21 05:23:16 PDT 2012


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





--- Comment #14 from SravanKumar S <ssandela at innominds.com>  2012-03-21 05:23:16 PST ---
Hi Julien,
After little analysis, there are quite a few points we need to consider here.

1.FF/Chrome/Safari all have same behaviour w.r.t Percentage/Calculated widths, but when Fixed width is specified Chrome/Safari obeys/follows the width given, but FF does'nt(FF has the bug in all 3 cases)Now, if what ever chrome is doing for Fixed width is intentional, then it should do the same for Percentage/Calculated cases.

Note: This deviation is already creating web-compatibility issue.

2. The reason for this deviation is because below logic is setting minPreferredLogicalWidth()(as it is higher than logicalWidth() for our test case) as logical width for Fieldset.

    // Fieldsets are currently the only objects that stretch to their minimum width.
    if (stretchesToMinIntrinsicLogicalWidth()) {
        setLogicalWidth(max(logicalWidth(), minPreferredLogicalWidth()));
        logicalWidthLength = Length(logicalWidth(), Fixed);
    }

And, m_minPreferredLogicalWidth is calculated differently for Fixed case and Calc/Percent case in void RenderBlock::computePreferredLogicalWidths()

Following is the code responsible for this behaviour.

if (!isTableCell() && styleToUse->logicalWidth().isFixed() && styleToUse->logicalWidth().value() > 0 && style()->marqueeBehavior() != MALTERNATE)
        m_minPreferredLogicalWidth = m_maxPreferredLogicalWidth = computeContentBoxLogicalWidth(styleToUse->logicalWidth().value());
    else {
        m_maxPreferredLogicalWidth = 0;

    if (childrenInline())
            computeInlinePreferredLogicalWidths();


3. With above analysis, if we have to fix it, then i see fix in either of the following two places, 

In RenderFieldset.cpp:
bool RenderFieldset::stretchesToMinIntrinsicLogicalWidth() const
{
    if(style()->width().isSpecified())
        return false;
    return true; 
}

Note: This change means completely specific to Fieldsets
or 

In void RenderBlock::computePreferredLogicalWidths()

by changing if block to use styleToUse->logicalWidth().isSpecified() for m_minPreferredLogicalWidth instead of styleToUse->logicalWidth().isFixed()

Note: As this is a general logic, i am thinking this might hurt other cases which follows the same path.


I think i lack big picture or broader view to decide as which is the right fix, or atleast if any of them is right fix.
Please let me know your comments.

-- 
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