Changeset 21602 in webkit


Ignore:
Timestamp:
May 19, 2007 4:09:17 PM (17 years ago)
Author:
bdash
Message:

2007-05-19 Mitz Pettel <mitz@webkit.org>

Reviewed by Darin.

Test: fast/table/stale-grid-crash.html

  • rendering/RenderTable.cpp: (WebCore::RenderTable::recalcSections): Made const and replaced setNeedsLayout(true) with an assertion that the table is already marked for layout. (WebCore::RenderTable::sectionAbove): Added call to recalcSectionsIfNeeded(). (WebCore::RenderTable::sectionBelow): Ditto. (WebCore::RenderTable::cellAbove): Ditto. (WebCore::RenderTable::cellBelow): Ditto. (WebCore::RenderTable::cellBefore): Ditto. (WebCore::RenderTable::cellAfter): Ditto.
  • rendering/RenderTable.h: Made some private member variables which are used in section recalc mutable. (WebCore::RenderTable::setNeedsSectionRecalc): Moved the call to setNeedsLayout() from recalcSections() into here, because I made recalcSections() const. (WebCore::RenderTable::recalcSectionsIfNeeded): Made const.

2007-05-19 Mitz Pettel <mitz@webkit.org>

Reviewed by Darin.

  • fast/table/stale-grid-crash-expected.checksum: Added.
  • fast/table/stale-grid-crash-expected.png: Added.
  • fast/table/stale-grid-crash-expected.txt: Added.
  • fast/table/stale-grid-crash.html: Added.
Location:
trunk
Files:
4 added
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r21601 r21602  
     12007-05-19  Mitz Pettel  <mitz@webkit.org>
     2
     3        Reviewed by Darin.
     4
     5        - test for http://bugs.webkit.org/show_bug.cgi?id=13774
     6          REGRESSION: Crash emailing blog entry using Google Reader
     7
     8        * fast/table/stale-grid-crash-expected.checksum: Added.
     9        * fast/table/stale-grid-crash-expected.png: Added.
     10        * fast/table/stale-grid-crash-expected.txt: Added.
     11        * fast/table/stale-grid-crash.html: Added.
     12
    1132007-05-19  Mitz Pettel  <mitz@webkit.org>
    214
  • trunk/WebCore/ChangeLog

    r21601 r21602  
     12007-05-19  Mitz Pettel  <mitz@webkit.org>
     2
     3        Reviewed by Darin.
     4
     5        - fix http://bugs.webkit.org/show_bug.cgi?id=13774
     6          REGRESSION: Crash emailing blog entry using Google Reader
     7
     8        Test: fast/table/stale-grid-crash.html
     9
     10        * rendering/RenderTable.cpp:
     11        (WebCore::RenderTable::recalcSections): Made const and replaced
     12        setNeedsLayout(true) with an assertion that the table is already
     13        marked for layout.
     14        (WebCore::RenderTable::sectionAbove): Added call to recalcSectionsIfNeeded().
     15        (WebCore::RenderTable::sectionBelow): Ditto.
     16        (WebCore::RenderTable::cellAbove): Ditto.
     17        (WebCore::RenderTable::cellBelow): Ditto.
     18        (WebCore::RenderTable::cellBefore): Ditto.
     19        (WebCore::RenderTable::cellAfter): Ditto.
     20        * rendering/RenderTable.h:
     21        Made some private member variables which are used in section recalc mutable.
     22        (WebCore::RenderTable::setNeedsSectionRecalc): Moved the call to
     23        setNeedsLayout() from recalcSections() into here, because I made
     24        recalcSections() const.
     25        (WebCore::RenderTable::recalcSectionsIfNeeded): Made const.
     26
    1272007-05-19  Mitz Pettel  <mitz@webkit.org>
    228
  • trunk/WebCore/rendering/RenderTable.cpp

    r21520 r21602  
    603603}
    604604
    605 void RenderTable::recalcSections()
     605void RenderTable::recalcSections() const
    606606{
    607607    m_caption = 0;
     
    670670    m_columns.resize(maxCols);
    671671    m_columnPos.resize(maxCols + 1);
    672    
     672
     673    ASSERT(selfNeedsLayout());
     674
    673675    m_needsSectionRecalc = false;
    674     setNeedsLayout(true);
    675676}
    676677
     
    935936RenderTableSection* RenderTable::sectionAbove(const RenderTableSection* section, bool skipEmptySections) const
    936937{
     938    recalcSectionsIfNeeded();
     939
    937940    if (section == m_head)
    938941        return 0;
     942
    939943    RenderObject* prevSection = section == m_foot ? lastChild() : section->previousSibling();
    940944    while (prevSection) {
     
    950954RenderTableSection* RenderTable::sectionBelow(const RenderTableSection* section, bool skipEmptySections) const
    951955{
     956    recalcSectionsIfNeeded();
     957
    952958    if (section == m_foot)
    953959        return 0;
     960
    954961    RenderObject* nextSection = section == m_head ? firstChild() : section->nextSibling();
    955962    while (nextSection) {
     
    965972RenderTableCell* RenderTable::cellAbove(const RenderTableCell* cell) const
    966973{
     974    recalcSectionsIfNeeded();
     975
    967976    // Find the section and row to look in
    968977    int r = cell->row();
     
    9951004RenderTableCell* RenderTable::cellBelow(const RenderTableCell* cell) const
    9961005{
     1006    recalcSectionsIfNeeded();
     1007
    9971008    // Find the section and row to look in
    9981009    int r = cell->row() + cell->rowSpan() - 1;
     
    10251036RenderTableCell* RenderTable::cellBefore(const RenderTableCell* cell) const
    10261037{
     1038    recalcSectionsIfNeeded();
     1039
    10271040    RenderTableSection* section = cell->section();
    10281041    int effCol = colToEffCol(cell->col());
     
    10411054RenderTableCell* RenderTable::cellAfter(const RenderTableCell* cell) const
    10421055{
     1056    recalcSectionsIfNeeded();
     1057
    10431058    int effCol = colToEffCol(cell->col() + cell->colSpan());
    10441059    if (effCol >= numEffCols())
  • trunk/WebCore/rendering/RenderTable.h

    r21093 r21602  
    164164
    165165    bool needsSectionRecalc() const { return m_needsSectionRecalc; }
    166     void setNeedsSectionRecalc() { m_needsSectionRecalc = true; }
     166    void setNeedsSectionRecalc()
     167    {
     168        if (documentBeingDestroyed())
     169            return;
     170        m_needsSectionRecalc = true;
     171        setNeedsLayout(true);
     172    }
    167173
    168174    virtual RenderObject* removeChildNode(RenderObject*, bool fullRemove = true);
     
    182188    virtual IntRect getOverflowClipRect(int tx, int ty);
    183189
    184     void recalcSectionsIfNeeded()
     190    void recalcSectionsIfNeeded() const
    185191    {
    186192        if (m_needsSectionRecalc)
     
    193199
    194200private:
    195     void recalcSections();
    196 
    197     Vector<int> m_columnPos;
    198     Vector<ColumnStruct> m_columns;
    199 
    200     RenderBlock* m_caption;
    201     RenderTableSection* m_head;
    202     RenderTableSection* m_foot;
    203     RenderTableSection* m_firstBody;
     201    void recalcSections() const;
     202
     203    mutable Vector<int> m_columnPos;
     204    mutable Vector<ColumnStruct> m_columns;
     205
     206    mutable RenderBlock* m_caption;
     207    mutable RenderTableSection* m_head;
     208    mutable RenderTableSection* m_foot;
     209    mutable RenderTableSection* m_firstBody;
    204210
    205211    TableLayout* m_tableLayout;
     
    210216    unsigned m_rules : 4; // Rules
    211217
    212     bool m_hasColElements : 1;
     218    mutable bool m_hasColElements : 1;
    213219    unsigned m_padding : 22;
    214     bool m_needsSectionRecalc : 1;
     220    mutable bool m_needsSectionRecalc : 1;
    215221   
    216222    short m_hSpacing;
Note: See TracChangeset for help on using the changeset viewer.