Changeset 40303 in webkit


Ignore:
Timestamp:
Jan 27, 2009 3:05:57 PM (15 years ago)
Author:
Simon Fraser
Message:

2009-01-27 Simon Fraser <Simon Fraser>

Reviewed by Dave Hyatt

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

Use the new container-relative repaint methods to compute
post-layout repaints, and repaints using RenderLayer's
cached repaintRect() relative to that container, rather than
using absolute coords.

Replaced lots of boilerplate old/new rect code in various
layout methods with a stack-based LayoutRepainter class, and
fixed a bug in RenderTable which set didFullRepaint to
'true' every time.

Location:
trunk/WebCore
Files:
17 edited

Legend:

Unmodified
Added
Removed
  • trunk/WebCore/ChangeLog

    r40302 r40303  
     12009-01-27  Simon Fraser  <simon.fraser@apple.com>
     2
     3        Reviewed by Dave Hyatt
     4
     5        https://bugs.webkit.org/show_bug.cgi?id=23360
     6       
     7        Use the new container-relative repaint methods to compute
     8        post-layout repaints, and repaints using RenderLayer's
     9        cached repaintRect() relative to that container, rather than
     10        using absolute coords.
     11
     12        Replaced lots of boilerplate old/new rect code in various
     13        layout methods with a stack-based LayoutRepainter class, and
     14        fixed a bug in RenderTable which set didFullRepaint to
     15        'true' every time.
     16
     17        * rendering/RenderBlock.cpp:
     18        (WebCore::RenderBlock::layoutBlock):
     19        * rendering/RenderFlexibleBox.cpp:
     20        (WebCore::RenderFlexibleBox::layoutBlock):
     21        * rendering/RenderForeignObject.cpp:
     22        (WebCore::RenderForeignObject::layout):
     23        * rendering/RenderLayer.cpp:
     24        (WebCore::RenderLayer::updateLayerPositions):
     25        (WebCore::RenderLayer::setHasVisibleContent):
     26        * rendering/RenderLayer.h:
     27        * rendering/RenderObject.cpp:
     28        (WebCore::RenderObject::repaintUsingContainer):
     29        (WebCore::RenderObject::repaint):
     30        (WebCore::RenderObject::repaintRectangle):
     31        (WebCore::RenderObject::repaintAfterLayoutIfNeeded):
     32        * rendering/RenderObject.h:
     33        (WebCore::RenderObject::LayoutRepainter::LayoutRepainter):
     34        (WebCore::RenderObject::LayoutRepainter::repaintAfterLayout):
     35        (WebCore::RenderObject::LayoutRepainter::checkForRepaint):
     36        * rendering/RenderPath.cpp:
     37        (WebCore::RenderPath::layout):
     38        * rendering/RenderReplaced.cpp:
     39        (WebCore::RenderReplaced::layout):
     40        * rendering/RenderSVGContainer.cpp:
     41        (WebCore::RenderSVGContainer::layout):
     42        * rendering/RenderSVGImage.cpp:
     43        (WebCore::RenderSVGImage::layout):
     44        * rendering/RenderSVGRoot.cpp:
     45        (WebCore::RenderSVGRoot::layout):
     46        * rendering/RenderSVGText.cpp:
     47        (WebCore::RenderSVGText::layout):
     48        * rendering/RenderSVGViewportContainer.cpp:
     49        (WebCore::RenderSVGViewportContainer::layout):
     50        * rendering/RenderTable.cpp:
     51        (WebCore::RenderTable::layout):
     52        * rendering/bidi.cpp:
     53        (WebCore::RenderBlock::layoutInlineChildren):
     54
    1552009-01-27  Brady Eidson  <beidson@apple.com>
    256
  • trunk/WebCore/rendering/RenderBlock.cpp

    r40270 r40303  
    612612        return;
    613613
    614     IntRect oldBounds;
    615     IntRect oldOutlineBox;
    616     bool checkForRepaint = m_everHadLayout && checkForRepaintDuringLayout();
    617     if (checkForRepaint) {
    618         oldBounds = absoluteClippedOverflowRect();
    619         oldOutlineBox = absoluteOutlineBounds();
    620     }
    621 
     614    LayoutRepainter repainter(*this, m_everHadLayout && checkForRepaintDuringLayout());
    622615    LayoutStateMaintainer statePusher(view(), this, IntSize(x(), y()), m_hasColumns || hasTransform() || hasReflection());
    623616
     
    750743
    751744    // Repaint with our new bounds if they are different from our old bounds.
    752     bool didFullRepaint = false;
    753     if (checkForRepaint)
    754         didFullRepaint = repaintAfterLayoutIfNeeded(oldBounds, oldOutlineBox);
     745    bool didFullRepaint = repainter.repaintAfterLayout();
    755746    if (!didFullRepaint && repaintTop != repaintBottom && (style()->visibility() == VISIBLE || enclosingLayer()->hasVisibleContent())) {
    756747        IntRect repaintRect(m_overflowLeft, repaintTop, m_overflowWidth - m_overflowLeft, repaintBottom - repaintTop);
  • trunk/WebCore/rendering/RenderFlexibleBox.cpp

    r40143 r40303  
    201201        return;
    202202
    203     IntRect oldBounds;
    204     IntRect oldOutlineBox;
    205     bool checkForRepaint = checkForRepaintDuringLayout();
    206     if (checkForRepaint) {
    207         oldBounds = absoluteClippedOverflowRect();
    208         oldOutlineBox = absoluteOutlineBounds();
    209     }
    210 
     203    LayoutRepainter repainter(*this, checkForRepaintDuringLayout());
    211204    LayoutStateMaintainer statePusher(view(), this, IntSize(x(), y()), hasTransform() || hasReflection());
    212205
     
    303296
    304297    // Repaint with our new bounds if they are different from our old bounds.
    305     if (checkForRepaint)
    306         repaintAfterLayoutIfNeeded(oldBounds, oldOutlineBox);
     298    repainter.repaintAfterLayout();
    307299   
    308300    setNeedsLayout(false);
  • trunk/WebCore/rendering/RenderForeignObject.cpp

    r40300 r40303  
    9393    view()->disableLayoutState();
    9494
    95     IntRect oldBounds;
    96     IntRect oldOutlineBox;
    97     bool checkForRepaint = checkForRepaintDuringLayout();
    98     if (checkForRepaint) {
    99         oldBounds = m_absoluteBounds;
    100         oldOutlineBox = absoluteOutlineBounds();
    101     }
     95    // FIXME: using m_absoluteBounds breaks if containerForRepaint() is not the root
     96    LayoutRepainter repainter(*this, checkForRepaintDuringLayout(), &m_absoluteBounds);
    10297   
    10398    calculateLocalTransform();
     
    107102    m_absoluteBounds = absoluteClippedOverflowRect();
    108103
    109     if (checkForRepaint)
    110         repaintAfterLayoutIfNeeded(oldBounds, oldOutlineBox);
     104    repainter.repaintAfterLayout();
    111105
    112106    view()->enableLayoutState();
  • trunk/WebCore/rendering/RenderLayer.cpp

    r40287 r40303  
    232232        ASSERT(!view->layoutStateEnabled());
    233233
    234         IntRect newRect = renderer()->absoluteClippedOverflowRect();
    235         IntRect newOutlineBox = renderer()->absoluteOutlineBounds();
     234        RenderBox* repaintContainer = renderer()->containerForRepaint();
     235        IntRect newRect = renderer()->clippedOverflowRectForRepaint(repaintContainer);
     236        IntRect newOutlineBox = renderer()->outlineBoundsForRepaint(repaintContainer);
    236237        if (checkForRepaint) {
    237238            if (view && !view->printing()) {
    238239                if (m_needsFullRepaint) {
    239                     view->repaintViewRectangle(m_repaintRect);
     240                    renderer()->repaintUsingContainer(repaintContainer, m_repaintRect);
    240241                    if (newRect != m_repaintRect)
    241                         view->repaintViewRectangle(newRect);
     242                        renderer()->repaintUsingContainer(repaintContainer, newRect);
    242243                } else
    243                     renderer()->repaintAfterLayoutIfNeeded(m_repaintRect, m_outlineBox);
     244                    renderer()->repaintAfterLayoutIfNeeded(repaintContainer, m_repaintRect, m_outlineBox);
    244245            }
    245246        }
     
    289290    m_hasVisibleContent = b;
    290291    if (m_hasVisibleContent) {
    291         m_repaintRect = renderer()->absoluteClippedOverflowRect();
    292         m_outlineBox = renderer()->absoluteOutlineBounds();
     292        RenderBox* repaintContainer = renderer()->containerForRepaint();
     293        m_repaintRect = renderer()->clippedOverflowRectForRepaint(repaintContainer);
     294        m_outlineBox = renderer()->outlineBoundsForRepaint(repaintContainer);
    293295        if (!isOverflowOnly())
    294296            dirtyStackingContextZOrderLists();
  • trunk/WebCore/rendering/RenderLayer.h

    r40078 r40303  
    359359    void updateHoverActiveState(const HitTestRequest&, HitTestResult&);
    360360
     361    // Return a cached repaint rect, computed relative to the layer renderer's containerForRepaint.
    361362    IntRect repaintRect() const { return m_repaintRect; }
    362363    void setNeedsFullRepaint(bool f = true) { m_needsFullRepaint = f; }
  • trunk/WebCore/rendering/RenderObject.cpp

    r40300 r40303  
    16511651}
    16521652
     1653void RenderObject::repaintUsingContainer(RenderBox* repaintContainer, const IntRect& r, bool immediate)
     1654{
     1655    if (!repaintContainer || repaintContainer->isRenderView()) {
     1656        RenderView* v = repaintContainer ? static_cast<RenderView*>(repaintContainer) : view();
     1657        v->repaintViewRectangle(r, immediate);
     1658    } else {
     1659        // Handle container-relative repaints eventually.
     1660        ASSERT_NOT_REACHED();
     1661    }
     1662}
     1663
    16531664void RenderObject::repaint(bool immediate)
    16541665{
     
    16641675        return; // Don't repaint if we're printing.
    16651676
    1666     view->repaintViewRectangle(absoluteClippedOverflowRect(), immediate);
     1677    RenderBox* repaintContainer = containerForRepaint();
     1678    repaintUsingContainer(repaintContainer ? repaintContainer : view, clippedOverflowRectForRepaint(repaintContainer), immediate);
    16671679}
    16681680
     
    16801692        return; // Don't repaint if we're printing.
    16811693
    1682     IntRect absRect(r);
     1694    IntRect dirtyRect(r);
    16831695
    16841696    // FIXME: layoutDelta needs to be applied in parts before/after transforms and
    16851697    // repaint containers. https://bugs.webkit.org/show_bug.cgi?id=23308
    1686     absRect.move(view->layoutDelta());
    1687 
    1688     computeAbsoluteRepaintRect(absRect);
    1689     view->repaintViewRectangle(absRect, immediate);
    1690 }
    1691 
    1692 bool RenderObject::repaintAfterLayoutIfNeeded(const IntRect& oldBounds, const IntRect& oldOutlineBox)
     1698    dirtyRect.move(view->layoutDelta());
     1699
     1700    RenderBox* repaintContainer = containerForRepaint();
     1701    computeRectForRepaint(repaintContainer, dirtyRect);
     1702    repaintUsingContainer(repaintContainer ? repaintContainer : view, dirtyRect, immediate);
     1703}
     1704
     1705bool RenderObject::repaintAfterLayoutIfNeeded(RenderBox* repaintContainer, const IntRect& oldBounds, const IntRect& oldOutlineBox)
    16931706{
    16941707    RenderView* v = view();
     
    16961709        return false; // Don't repaint if we're printing.
    16971710
    1698     IntRect newBounds = absoluteClippedOverflowRect();
     1711    IntRect newBounds = clippedOverflowRectForRepaint(repaintContainer);
    16991712    IntRect newOutlineBox;
    17001713
     
    17041717        fullRepaint = true;
    17051718    if (!fullRepaint) {
    1706         newOutlineBox = absoluteOutlineBounds();
     1719        newOutlineBox = outlineBoundsForRepaint(repaintContainer);
    17071720        if (newOutlineBox.location() != oldOutlineBox.location() || (mustRepaintBackgroundOrBorder() && (newBounds != oldBounds || newOutlineBox != oldOutlineBox)))
    17081721            fullRepaint = true;
    17091722    }
     1723
     1724    if (!repaintContainer)
     1725        repaintContainer = v;
     1726
    17101727    if (fullRepaint) {
    1711         v->repaintViewRectangle(oldBounds);
     1728        repaintUsingContainer(repaintContainer, oldBounds);
    17121729        if (newBounds != oldBounds)
    1713             v->repaintViewRectangle(newBounds);
     1730            repaintUsingContainer(repaintContainer, newBounds);
    17141731        return true;
    17151732    }
     
    17201737    int deltaLeft = newBounds.x() - oldBounds.x();
    17211738    if (deltaLeft > 0)
    1722         v->repaintViewRectangle(IntRect(oldBounds.x(), oldBounds.y(), deltaLeft, oldBounds.height()));
     1739        repaintUsingContainer(repaintContainer, IntRect(oldBounds.x(), oldBounds.y(), deltaLeft, oldBounds.height()));
    17231740    else if (deltaLeft < 0)
    1724         v->repaintViewRectangle(IntRect(newBounds.x(), newBounds.y(), -deltaLeft, newBounds.height()));
     1741        repaintUsingContainer(repaintContainer, IntRect(newBounds.x(), newBounds.y(), -deltaLeft, newBounds.height()));
    17251742
    17261743    int deltaRight = newBounds.right() - oldBounds.right();
    17271744    if (deltaRight > 0)
    1728         v->repaintViewRectangle(IntRect(oldBounds.right(), newBounds.y(), deltaRight, newBounds.height()));
     1745        repaintUsingContainer(repaintContainer, IntRect(oldBounds.right(), newBounds.y(), deltaRight, newBounds.height()));
    17291746    else if (deltaRight < 0)
    1730         v->repaintViewRectangle(IntRect(newBounds.right(), oldBounds.y(), -deltaRight, oldBounds.height()));
     1747        repaintUsingContainer(repaintContainer, IntRect(newBounds.right(), oldBounds.y(), -deltaRight, oldBounds.height()));
    17311748
    17321749    int deltaTop = newBounds.y() - oldBounds.y();
    17331750    if (deltaTop > 0)
    1734         v->repaintViewRectangle(IntRect(oldBounds.x(), oldBounds.y(), oldBounds.width(), deltaTop));
     1751        repaintUsingContainer(repaintContainer, IntRect(oldBounds.x(), oldBounds.y(), oldBounds.width(), deltaTop));
    17351752    else if (deltaTop < 0)
    1736         v->repaintViewRectangle(IntRect(newBounds.x(), newBounds.y(), newBounds.width(), -deltaTop));
     1753        repaintUsingContainer(repaintContainer, IntRect(newBounds.x(), newBounds.y(), newBounds.width(), -deltaTop));
    17371754
    17381755    int deltaBottom = newBounds.bottom() - oldBounds.bottom();
    17391756    if (deltaBottom > 0)
    1740         v->repaintViewRectangle(IntRect(newBounds.x(), oldBounds.bottom(), newBounds.width(), deltaBottom));
     1757        repaintUsingContainer(repaintContainer, IntRect(newBounds.x(), oldBounds.bottom(), newBounds.width(), deltaBottom));
    17411758    else if (deltaBottom < 0)
    1742         v->repaintViewRectangle(IntRect(oldBounds.x(), newBounds.bottom(), oldBounds.width(), -deltaBottom));
     1759        repaintUsingContainer(repaintContainer, IntRect(oldBounds.x(), newBounds.bottom(), oldBounds.width(), -deltaBottom));
    17431760
    17441761    if (newOutlineBox == oldOutlineBox)
     
    17661783        if (rightRect.x() < right) {
    17671784            rightRect.setWidth(min(rightRect.width(), right - rightRect.x()));
    1768             v->repaintViewRectangle(rightRect);
     1785            repaintUsingContainer(repaintContainer, rightRect);
    17691786        }
    17701787    }
     
    17841801        if (bottomRect.y() < bottom) {
    17851802            bottomRect.setHeight(min(bottomRect.height(), bottom - bottomRect.y()));
    1786             v->repaintViewRectangle(bottomRect);
     1803            repaintUsingContainer(repaintContainer, bottomRect);
    17871804        }
    17881805    }
  • trunk/WebCore/rendering/RenderObject.h

    r40300 r40303  
    574574    // methods.
    575575    RenderBox* containerForRepaint() const;
     576    // Actually do the repaint of rect r for this object which has been computed in the coordinate space
     577    // of repaintContainer. If repaintContainer is 0, repaint via the view.
     578    void repaintUsingContainer(RenderBox* repaintContainer, const IntRect& r, bool immediate = false);
    576579   
    577580    // Repaint the entire object.  Called when, e.g., the color of a border changes, or when a border
     
    583586
    584587    // Repaint only if our old bounds and new bounds are different.
    585     bool repaintAfterLayoutIfNeeded(const IntRect& oldBounds, const IntRect& oldOutlineBox);
     588    bool repaintAfterLayoutIfNeeded(RenderBox* repaintContainer, const IntRect& oldBounds, const IntRect& oldOutlineBox);
    586589
    587590    // Repaint only if the object moved.
     
    785788    virtual IntRect outlineBoundsForRepaint(RenderBox* /*repaintContainer*/) const { return IntRect(); }
    786789
     790    class LayoutRepainter {
     791    public:
     792        LayoutRepainter(RenderObject& object, bool checkForRepaint, const IntRect* oldBounds = 0)
     793            : m_object(object)
     794            , m_repaintContainer(0)
     795            , m_checkForRepaint(checkForRepaint)
     796        {
     797            if (m_checkForRepaint) {
     798                m_oldBounds = oldBounds ? *oldBounds : m_object.absoluteClippedOverflowRect();
     799                m_oldOutlineBox = m_object.absoluteOutlineBounds();
     800                m_repaintContainer = m_object.containerForRepaint();
     801            }
     802        }
     803       
     804        // Return true if it repainted.
     805        bool repaintAfterLayout()
     806        {
     807            return m_checkForRepaint ? m_object.repaintAfterLayoutIfNeeded(m_repaintContainer, m_oldBounds, m_oldOutlineBox) : false;
     808        }
     809       
     810        bool checkForRepaint() const { return m_checkForRepaint; }
     811       
     812    private:
     813        RenderObject& m_object;
     814        RenderBox* m_repaintContainer;
     815        IntRect m_oldBounds;
     816        IntRect m_oldOutlineBox;
     817        bool m_checkForRepaint;
     818    };
     819   
    787820private:
    788821    RefPtr<RenderStyle> m_style;
  • trunk/WebCore/rendering/RenderPath.cpp

    r40288 r40303  
    157157void RenderPath::layout()
    158158{
    159     IntRect oldBounds;
    160     IntRect oldOutlineBox;
    161     bool checkForRepaint = checkForRepaintDuringLayout() && selfNeedsLayout();
    162     if (checkForRepaint) {
    163         oldBounds = m_absoluteBounds;
    164         oldOutlineBox = absoluteOutlineBounds();
    165     }
    166        
     159    // FIXME: using m_absoluteBounds breaks if containerForRepaint() is not the root
     160    LayoutRepainter repainter(*this, checkForRepaintDuringLayout() && selfNeedsLayout(), &m_absoluteBounds);
     161   
    167162    calculateLocalTransform();
    168163
     
    171166    m_absoluteBounds = absoluteClippedOverflowRect();
    172167
    173     if (checkForRepaint)
    174         repaintAfterLayoutIfNeeded(oldBounds, oldOutlineBox);
     168    repainter.repaintAfterLayout();
    175169
    176170    setNeedsLayout(false);
  • trunk/WebCore/rendering/RenderReplaced.cpp

    r40300 r40303  
    7878    ASSERT(needsLayout());
    7979   
    80     IntRect oldBounds;
    81     IntRect oldOutlineBox;
    82     bool checkForRepaint = checkForRepaintDuringLayout();
    83     if (checkForRepaint) {
    84         oldBounds = absoluteClippedOverflowRect();
    85         oldOutlineBox = absoluteOutlineBounds();
    86     }
     80    LayoutRepainter repainter(*this, checkForRepaintDuringLayout());
    8781   
    8882    setHeight(minimumReplacedHeight());
     
    9286    adjustOverflowForBoxShadow();
    9387   
    94     if (checkForRepaint)
    95         repaintAfterLayoutIfNeeded(oldBounds, oldOutlineBox);
    96    
     88    repainter.repaintAfterLayout();   
     89
    9790    setNeedsLayout(false);
    9891}
  • trunk/WebCore/rendering/RenderSVGContainer.cpp

    r40288 r40303  
    227227    view()->disableLayoutState();
    228228
    229     IntRect oldBounds;
    230     IntRect oldOutlineBox;
    231     bool checkForRepaint = checkForRepaintDuringLayout() && selfWillPaint();
    232     if (checkForRepaint) {
    233         oldBounds = m_absoluteBounds;
    234         oldOutlineBox = absoluteOutlineBounds();
    235     }
     229    // FIXME: using m_absoluteBounds breaks if containerForRepaint() is not the root
     230    LayoutRepainter repainter(*this, checkForRepaintDuringLayout() && selfWillPaint(), &m_absoluteBounds);
    236231   
    237232    calculateLocalTransform();
     
    251246    calcBounds();
    252247
    253     if (checkForRepaint)
    254         repaintAfterLayoutIfNeeded(oldBounds, oldOutlineBox);
     248    repainter.repaintAfterLayout();
    255249
    256250    view()->enableLayoutState();
  • trunk/WebCore/rendering/RenderSVGImage.cpp

    r40298 r40303  
    138138    ASSERT(needsLayout());
    139139   
    140     IntRect oldBounds;
    141     IntRect oldOutlineBox;
    142     bool checkForRepaint = checkForRepaintDuringLayout();
    143     if (checkForRepaint) {
    144         oldBounds = absoluteClippedOverflowRect();
    145         oldOutlineBox = absoluteOutlineBounds();
    146     }
     140    LayoutRepainter repainter(*this, checkForRepaintDuringLayout());
    147141   
    148142    calculateLocalTransform();
     
    159153    calculateAbsoluteBounds();
    160154
    161     if (checkForRepaint)
    162         repaintAfterLayoutIfNeeded(oldBounds, oldOutlineBox);
    163 
     155    repainter.repaintAfterLayout();
     156   
    164157    setNeedsLayout(false);
    165158}
  • trunk/WebCore/rendering/RenderSVGRoot.cpp

    r40288 r40303  
    9292    view()->disableLayoutState();
    9393
    94     IntRect oldBounds = m_absoluteBounds;
    95     IntRect oldOutlineBox;
    96     bool checkForRepaint = checkForRepaintDuringLayout() && selfNeedsLayout();
    97     if (checkForRepaint)
    98         oldOutlineBox = absoluteOutlineBounds();
     94    // FIXME: using m_absoluteBounds breaks if containerForRepaint() is not the root
     95    LayoutRepainter repainter(*this, checkForRepaintDuringLayout() && selfNeedsLayout(), &m_absoluteBounds);
    9996
    10097    calcWidth();
     
    114111    }
    115112
    116     if (checkForRepaint)
    117         repaintAfterLayoutIfNeeded(oldBounds, oldOutlineBox);
     113    repainter.repaintAfterLayout();
    118114
    119115    view()->enableLayoutState();
  • trunk/WebCore/rendering/RenderSVGText.cpp

    r40288 r40303  
    8282    setNeedsLayout(true);
    8383
    84     IntRect oldBounds;
    85     IntRect oldOutlineBox;
    86     bool checkForRepaint = checkForRepaintDuringLayout();
    87     if (checkForRepaint) {
    88         oldBounds = m_absoluteBounds;
    89         oldOutlineBox = absoluteOutlineBounds();
    90     }
     84    // FIXME: using m_absoluteBounds breaks if containerForRepaint() is not the root
     85    LayoutRepainter repainter(*this, checkForRepaintDuringLayout(), &m_absoluteBounds);
    9186
    9287    // Best guess for a relative starting point
     
    10297    m_absoluteBounds = absoluteClippedOverflowRect();
    10398
    104     bool repainted = false;
    105     if (checkForRepaint)
    106         repainted = repaintAfterLayoutIfNeeded(oldBounds, oldOutlineBox);
    107    
     99    repainter.repaintAfterLayout();
     100       
    108101    setNeedsLayout(false);
    109102}
  • trunk/WebCore/rendering/RenderSVGViewportContainer.cpp

    r40107 r40303  
    5353    view()->disableLayoutState();
    5454   
    55     IntRect oldBounds = m_absoluteBounds;
    56     IntRect oldOutlineBox;
    57     bool checkForRepaint = checkForRepaintDuringLayout() && selfNeedsLayout();
    58     if (checkForRepaint)
    59         oldOutlineBox = absoluteOutlineBounds();
    60 
     55    // FIXME: using m_absoluteBounds breaks if containerForRepaint() is not the root
     56    LayoutRepainter repainter(*this, checkForRepaintDuringLayout() && selfNeedsLayout(), &m_absoluteBounds);
     57   
    6158    calcBounds();   
    6259   
     
    6966    }
    7067   
    71     if (checkForRepaint)
    72         repaintAfterLayoutIfNeeded(oldBounds, oldOutlineBox);
     68    repainter.repaintAfterLayout();
    7369   
    7470    view()->enableLayoutState();
  • trunk/WebCore/rendering/RenderTable.cpp

    r40238 r40303  
    258258    recalcSectionsIfNeeded();
    259259       
    260     IntRect oldBounds;
    261     IntRect oldOutlineBox;
    262     bool checkForRepaint = checkForRepaintDuringLayout();
    263     if (checkForRepaint) {
    264         oldBounds = absoluteClippedOverflowRect();
    265         oldOutlineBox = absoluteOutlineBounds();
    266     }
    267    
     260    LayoutRepainter repainter(*this, checkForRepaintDuringLayout());
    268261    LayoutStateMaintainer statePusher(view(), this, IntSize(x(), y()));
    269262
     
    428421    statePusher.pop();
    429422
    430     bool didFullRepaint = true;
     423    bool didFullRepaint = repainter.repaintAfterLayout();
    431424    // Repaint with our new bounds if they are different from our old bounds.
    432     if (checkForRepaint)
    433         didFullRepaint = repaintAfterLayoutIfNeeded(oldBounds, oldOutlineBox);
    434425    if (!didFullRepaint && sectionMoved)
    435426        repaintRectangle(IntRect(m_overflowLeft, movedSectionTop, m_overflowWidth - m_overflowLeft, m_overflowHeight - movedSectionTop));
  • trunk/WebCore/rendering/bidi.cpp

    r40264 r40303  
    846846                // before layout started.  Luckily the layer has cached the repaint rect for its original
    847847                // position and size, and so we can use that to make a repaint happen now.
    848                 v->repaintViewRectangle(m_layer->repaintRect());
     848                repaintUsingContainer(containerForRepaint(), m_layer->repaintRect());
    849849            }
    850850        }
Note: See TracChangeset for help on using the changeset viewer.