Changeset 21120 in webkit


Ignore:
Timestamp:
Apr 26, 2007 12:51:11 PM (17 years ago)
Author:
hyatt
Message:

Reviewed by hyatt

No tests added since there is no change to functionality. Several
tests in fast/repaint test repainting of objects that move during layout.

  • page/FrameView.cpp: (WebCore::FrameView::layout):
  • rendering/RenderBlock.cpp: (WebCore::RenderBlock::layoutBlockChildren): Removed an early setNeedsLayout(false). Resetting the bit here prevents the full repaint that we rely on when we decide not to repaint children that move.
  • rendering/RenderBlock.h:
  • rendering/RenderObject.cpp:
  • rendering/RenderObject.h:
  • rendering/RenderTableSection.cpp: (WebCore::RenderTableSection::setCellWidths): Replaced the call to repaintObjectsBeforeLayout() if the cell didn't need layout with an unconditional repaint(). We don't bother with repainting only the delta between the old and new widths, since by marking the cell for layout results in a full repaint with the new width anyway.
Location:
trunk/WebCore
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • trunk/WebCore/ChangeLog

    r21119 r21120  
     12007-04-26  Mitz Pettel  <mitz@webkit.org>
     2
     3        Reviewed by hyatt
     4
     5        - http://bugs.webkit.org/show_bug.cgi?id=13496
     6          Eliminate repaintObjectsBeforeLayout
     7
     8        No tests added since there is no change to functionality. Several
     9        tests in fast/repaint test repainting of objects that move during layout.
     10
     11        * page/FrameView.cpp:
     12        (WebCore::FrameView::layout):
     13        * rendering/RenderBlock.cpp:
     14        (WebCore::RenderBlock::layoutBlockChildren): Removed an early
     15        setNeedsLayout(false). Resetting the bit here prevents the full repaint
     16        that we rely on when we decide not to repaint children that move.
     17        * rendering/RenderBlock.h:
     18        * rendering/RenderObject.cpp:
     19        * rendering/RenderObject.h:
     20        * rendering/RenderTableSection.cpp:
     21        (WebCore::RenderTableSection::setCellWidths): Replaced the call to
     22        repaintObjectsBeforeLayout() if the cell didn't need layout with
     23        an unconditional repaint(). We don't bother with repainting only the
     24        delta between the old and new widths, since by marking the cell for
     25        layout results in a full repaint with the new width anyway.
     26
    1272007-04-26  David Hyatt  <hyatt@apple.com>
    228
  • trunk/WebCore/page/FrameView.cpp

    r21093 r21120  
    406406    RenderLayer* layer = root->enclosingLayer();
    407407     
    408     if (!d->doFullRepaint) {
     408    if (!d->doFullRepaint)
    409409        layer->checkForRepaintOnResize();
    410         root->repaintObjectsBeforeLayout();
    411     }
    412410
    413411    pauseScheduledEvents();
  • trunk/WebCore/rendering/RenderBlock.cpp

    r21116 r21120  
    12371237    // determining the correct collapsed bottom margin information.
    12381238    handleBottomOfBlock(top, bottom, marginInfo);
    1239 
    1240     // Finished. Clear the dirty layout bits.
    1241     setNeedsLayout(false);
    12421239}
    12431240
     
    12951292            }
    12961293        }
    1297     }
    1298 }
    1299 
    1300 void RenderBlock::repaintObjectsBeforeLayout()
    1301 {
    1302     RenderFlow::repaintObjectsBeforeLayout();
    1303     if (!needsLayout())
    1304         return;
    1305 
    1306     // Walk our positioned objects.
    1307     if (m_positionedObjects) {
    1308         RenderObject* r;
    1309         DeprecatedPtrListIterator<RenderObject> it(*m_positionedObjects);
    1310         for ( ; (r = it.current()); ++it )
    1311             r->repaintObjectsBeforeLayout();
    13121294    }
    13131295}
  • trunk/WebCore/rendering/RenderBlock.h

    r21079 r21120  
    100100    virtual void removeChild(RenderObject*);
    101101
    102     virtual void repaintObjectsBeforeLayout();
    103102    virtual void repaintOverhangingFloats(bool paintAllDescendants);
    104103
  • trunk/WebCore/rendering/RenderObject.cpp

    r21116 r21120  
    18661866}
    18671867
    1868 void RenderObject::repaintObjectsBeforeLayout()
    1869 {
    1870     if (!needsLayout() || isText())
    1871         return;
    1872 
    1873     bool blockWithInlineChildren = (isRenderBlock() && !isTable() && normalChildNeedsLayout() && childrenInline());
    1874     if (selfNeedsLayout()) {
    1875         repaint();
    1876         if (blockWithInlineChildren)
    1877             return;
    1878     }
    1879 
    1880     for (RenderObject* current = firstChild(); current; current = current->nextSibling()) {
    1881         if (!current->isPositioned()) // RenderBlock subclass method handles walking the positioned objects.
    1882             current->repaintObjectsBeforeLayout();
    1883     }
    1884 }
    1885 
    18861868IntRect RenderObject::getAbsoluteRepaintRectWithOutline(int ow)
    18871869{
  • trunk/WebCore/rendering/RenderObject.h

    r21116 r21120  
    700700    virtual void repaintOverhangingFloats(bool paintAllDescendants = false);
    701701
    702     // Called before layout to repaint all dirty children (with selfNeedsLayout() set).
    703     virtual void repaintObjectsBeforeLayout();
    704 
    705702    bool checkForRepaintDuringLayout() const;
    706703
  • trunk/WebCore/rendering/RenderTableSection.cpp

    r21093 r21120  
    283283            int oldWidth = cell->width();
    284284            if (w != oldWidth) {
    285                 bool neededLayout = cell->selfNeedsLayout();
    286285                cell->setNeedsLayout(true);
    287                 if (!neededLayout && !selfNeedsLayout() && cell->checkForRepaintDuringLayout())
    288                     cell->repaintObjectsBeforeLayout();
     286                if (!table()->selfNeedsLayout() && cell->checkForRepaintDuringLayout())
     287                    cell->repaint();
    289288                cell->setWidth(w);
    290289            }
Note: See TracChangeset for help on using the changeset viewer.