Changeset 19586 for S60/trunk/WebCore

Show
Ignore:
Timestamp:
02/12/07 15:35:48 (2 years ago)
Author:
brmorris
Message:

zalan, Reviewed by yongjun.

DESC: merging WebKit/trunk r16319 to s60/trunk PKAI-6Y2PBN
Fix fieldsets so that they properly expand to enclose overhanging floats
when the fieldset has auto height. This is a nifty undocumented behavior
of the fieldset element. See http://bugs.webkit.org/show_bug.cgi?id=3898

http://bugs.webkit.org/show_bug.cgi?id=12748

Location:
S60/trunk/WebCore
Files:
5 modified

Legend:

Unmodified
Added
Removed
  • S60/trunk/WebCore/ChangeLog

    r19532 r19586  
     1zalan, Reviewed by yongjun. 
     2        DESC: merging WebKit/trunk r16319 to s60/trunk PKAI-6Y2PBN   
     3        Fix fieldsets so that they properly expand to enclose overhanging floats 
     4        when the fieldset has auto height.  This is a nifty undocumented behavior 
     5        of the fieldset element. See http://bugs.webkit.org/show_bug.cgi?id=3898 
     6 
     7        http://bugs.webkit.org/show_bug.cgi?id=12748 
     8 
     9        WARNING: NO TEST CASES ADDED OR CHANGED 
     10 
     11        * khtml/rendering/render_block.cpp: 
     12        (khtml::RenderBlock::layoutBlock): 
     13        * khtml/rendering/render_form.h: 
     14        (khtml::RenderFieldset::expandsToEncloseOverhangingFloats): 
     15        * khtml/rendering/render_object.h: 
     16        (khtml::RenderObject::expandsToEncloseOverhangingFloats): 
     17        * khtml/rendering/render_table.h: 
     18        (khtml::RenderTableCell::expandsToEncloseOverhangingFloats): 
     19 
    120yaharon, reviewed by zalan 
    221 DESC: [S60] Browser crashes when selecting the left Soft key Options when the cursor is in textarea field (SCHY-6Y7SHD) 
  • S60/trunk/WebCore/khtml/rendering/render_block.cpp

    r16084 r19586  
    543543    } 
    544544 
    545     if (hasOverhangingFloats() && ((isFloating() && style()->height().isVariable()) || isTableCell())) { 
     545    // Some classes of objects (floats and fieldsets with no specified heights and table cells) expand to encompass 
     546    // overhanging floats. 
     547    if (hasOverhangingFloats() && expandsToEncloseOverhangingFloats()) { 
    546548        m_height = floatBottom(); 
    547549        m_height += borderBottom() + paddingBottom(); 
  • S60/trunk/WebCore/khtml/rendering/render_form.h

    r14720 r19586  
    311311 
    312312    virtual RenderObject* layoutLegend(bool relayoutChildren); 
     313    virtual bool expandsToEncloseOverhangingFloats() const { return style()->height().isVariable(); } 
    313314 
    314315    virtual void setStyle(RenderStyle* _style); 
  • S60/trunk/WebCore/khtml/rendering/render_object.h

    r14720 r19586  
    764764    virtual bool containsFloat(RenderObject* o) { return false; } 
    765765    virtual bool hasOverhangingFloats() { return false; } 
     766    virtual bool expandsToEncloseOverhangingFloats() const { return isFloating() && style()->height().isVariable(); } 
    766767    virtual QRect floatRect() const { return borderBox(); } 
    767768 
  • S60/trunk/WebCore/khtml/rendering/render_table.h

    r14549 r19586  
    111111 
    112112#ifdef NOKIA_CHANGES 
    113         virtual void getRenderersInRect(QPtrList<BoxInfo>& boxInfoList,int deltaX,int deltaY,const QRect& rect); 
     113    virtual void getRenderersInRect(QPtrList<BoxInfo>& boxInfoList,int deltaX,int deltaY,const QRect& rect); 
    114114#endif 
    115115    virtual RenderBlock* firstLineBlock() const; 
     
    124124#endif 
    125125    struct ColumnStruct { 
    126         enum { 
    127             WidthUndefined = 0xffff 
    128         }; 
    129         ColumnStruct() { 
    130             span = 1; 
    131             width = WidthUndefined; 
    132         } 
    133         ushort span; 
    134         uint width; // the calculated position of the column 
     126    enum { 
     127        WidthUndefined = 0xffff 
     128    }; 
     129    ColumnStruct() { 
     130        span = 1; 
     131        width = WidthUndefined; 
     132    } 
     133    ushort span; 
     134    uint width; // the calculated position of the column 
    135135    }; 
    136136 
     
    143143    int spanOfEffCol( int effCol ) const { return columns[effCol].span; } 
    144144    int colToEffCol( int col ) const { 
    145         int c = 0; 
    146         int i = 0; 
    147         while ( c < col && i < (int)columns.size() ) { 
    148             c += columns[i].span; 
    149             i++; 
    150         } 
    151         return i; 
     145    int c = 0; 
     146    int i = 0; 
     147    while ( c < col && i < (int)columns.size() ) { 
     148        c += columns[i].span; 
     149        i++; 
     150    } 
     151    return i; 
    152152    } 
    153153    int effColToCol( int effCol ) const { 
    154         int c = 0; 
    155         for ( int i = 0; i < effCol; i++ ) 
    156             c += columns[i].span; 
    157         return c; 
     154    int c = 0; 
     155    for ( int i = 0; i < effCol; i++ ) 
     156        c += columns[i].span; 
     157    return c; 
    158158    } 
    159159 
    160160    int bordersPaddingAndSpacing() const { 
    161         return borderLeft() + borderRight() +  
     161    return borderLeft() + borderRight() +  
    162162               (collapseBorders() ? 0 : (paddingLeft() + paddingRight() + (numEffCols()+1) * hBorderSpacing())); 
    163163    } 
     
    197197    Rules rules                 : 4; 
    198198 
    199     bool has_col_elems          : 1; 
    200     uint padding                : 22; 
    201     uint needSectionRecalc      : 1; 
     199    bool has_col_elems      : 1; 
     200    uint padding        : 22; 
     201    uint needSectionRecalc  : 1; 
    202202     
    203203    short hspacing; 
     
    246246    typedef QMemArray<CellStruct> Row; 
    247247    struct RowStruct { 
    248         Row *row; 
    249         int baseLine; 
    250         Length height; 
     248    Row *row; 
     249    int baseLine; 
     250    Length height; 
    251251    }; 
    252252 
    253253    CellStruct& cellAt(int row,  int col) { 
    254         return (*grid[row].row)[col]; 
     254    return (*grid[row].row)[col]; 
    255255    } 
    256256    const CellStruct& cellAt(int row, int col) const { 
    257         return (*grid[row].row)[col]; 
     257    return (*grid[row].row)[col]; 
    258258    } 
    259259 
     
    353353    virtual void setWidth( int width ); 
    354354    virtual void setStyle( RenderStyle *style ); 
     355    virtual bool expandsToEncloseOverhangingFloats() const { return true; } 
    355356 
    356357    int borderLeft() const;