[webkit-help] stretchesToMinIntrinsicLogicalWidth

Julien Chaffraix julien.chaffraix at gmail.com
Sat Mar 17 11:41:06 PDT 2012


> I was trying to understand why only for Fieldsets following logic is
> applied? (RenderBox.cpp)
>
>     // Fieldsets are currently the only objects that stretch to their
> minimum width.
>     if (stretchesToMinIntrinsicLogicalWidth()) {
>
> and why this function(RenderFieldset.h) is returning true with out checking
> for width being set by css.
>
>    virtual bool stretchesToMinIntrinsicLogicalWidth() const { return true;
> }.

There is a comment on RenderBox.h [1]:

// Whether or not the element shrinks to its intrinsic width (rather
than filling the width
// of a containing block).  HTML4 buttons, <select>s, <input>s,
legends, and floating/compact elements do this.

I guess that explains why we don't check CSS width for RenderFieldset
(intrinsic sizes are never impacted by CSS). If you told us why you
think this is wrong, we may be able to give a better answer.

Thanks,
Julien

[1] http://trac.webkit.org/browser/trunk/Source/WebCore/rendering/RenderBox.h#L335


More information about the webkit-help mailing list