Changeset 19492 in webkit


Ignore:
Timestamp:
Feb 7, 2007 9:10:34 PM (17 years ago)
Author:
bdash
Message:

2007-02-07 Mitz Pettel <mitz@webkit.org>

Reviewed by Dave Hyatt.

Test: fast/repaint/intermediate-layout-position.html

  • rendering/RenderBlock.cpp: (WebCore::RenderBlock::layoutBlock): Adjust the old bounds by the layout delta, to get the block's absolute bounds as they were before its ancestors moved it during layout. (WebCore::RenderBlock::collapseMargins): Update the layout delta for the child when moving it. (WebCore::RenderBlock::clearFloatsIfNeeded): Ditto. (WebCore::RenderBlock::determineHorizontalPosition): Ditto. (WebCore::RenderBlock::layoutBlockChildren): Ditto.
  • rendering/RenderFlexibleBox.cpp: (WebCore::RenderFlexibleBox::layoutBlock): Adjust the old bounds by the current layout delta.
  • rendering/RenderHTMLCanvas.cpp: (WebCore::RenderHTMLCanvas::layout): Ditto.
  • rendering/RenderImage.cpp: (WebCore::RenderImage::layout): Ditto.
  • rendering/RenderTable.cpp: (WebCore::RenderTable::layout): Ditto.
  • rendering/RenderView.h: (WebCore::RenderView::layoutDelta): Added. Keeps track of the offset between the position of the object currently being laid out and its position at the end of the last layout. (WebCore::RenderView::addLayoutDelta): Added.

2007-02-07 Mitz Pettel <mitz@webkit.org>

Reviewed by Dave Hyatt.

  • fast/repaint/intermediate-layout-position-expected.checksum: Added.
  • fast/repaint/intermediate-layout-position-expected.png: Added.
  • fast/repaint/intermediate-layout-position-expected.txt: Added.
  • fast/repaint/intermediate-layout-position.html: Added.
Location:
trunk
Files:
4 added
8 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r19490 r19492  
     12007-02-07  Mitz Pettel  <mitz@webkit.org>
     2
     3        Reviewed by Dave Hyatt.
     4
     5        - repaint test for http://bugs.webkit.org/show_bug.cgi?id=10522
     6          REGRESSION: Incomplete repaint after table relayout that decreases height
     7
     8        * fast/repaint/intermediate-layout-position-expected.checksum: Added.
     9        * fast/repaint/intermediate-layout-position-expected.png: Added.
     10        * fast/repaint/intermediate-layout-position-expected.txt: Added.
     11        * fast/repaint/intermediate-layout-position.html: Added.
     12
    1132007-02-07  Mitz Pettel  <mitz@webkit.org>
    214
  • trunk/WebCore/ChangeLog

    r19491 r19492  
     12007-02-07  Mitz Pettel  <mitz@webkit.org>
     2
     3        Reviewed by Dave Hyatt.
     4
     5        - fix http://bugs.webkit.org/show_bug.cgi?id=10522
     6          REGRESSION: Incomplete repaint after table relayout that decreases height
     7
     8        Test: fast/repaint/intermediate-layout-position.html
     9
     10        * rendering/RenderBlock.cpp:
     11        (WebCore::RenderBlock::layoutBlock): Adjust the old bounds by the layout delta,
     12        to get the block's absolute bounds as they were before its ancestors moved it
     13        during layout.
     14        (WebCore::RenderBlock::collapseMargins): Update the layout delta for the child
     15        when moving it.
     16        (WebCore::RenderBlock::clearFloatsIfNeeded): Ditto.
     17        (WebCore::RenderBlock::determineHorizontalPosition): Ditto.
     18        (WebCore::RenderBlock::layoutBlockChildren): Ditto.
     19        * rendering/RenderFlexibleBox.cpp:
     20        (WebCore::RenderFlexibleBox::layoutBlock): Adjust the old bounds by the current
     21        layout delta.
     22        * rendering/RenderHTMLCanvas.cpp:
     23        (WebCore::RenderHTMLCanvas::layout): Ditto.
     24        * rendering/RenderImage.cpp:
     25        (WebCore::RenderImage::layout): Ditto.
     26        * rendering/RenderTable.cpp:
     27        (WebCore::RenderTable::layout): Ditto.
     28        * rendering/RenderView.h:
     29        (WebCore::RenderView::layoutDelta): Added. Keeps track of the offset between
     30        the position of the object currently being laid out and its position at the
     31        end of the last layout.
     32        (WebCore::RenderView::addLayoutDelta): Added.
     33
    1342007-02-07  Christopher Brichford  <chrisb@adobe.com>
    235
  • trunk/WebCore/rendering/RenderBlock.cpp

    r19413 r19492  
    469469    IntRect oldBounds, oldFullBounds;
    470470    bool checkForRepaint = checkForRepaintDuringLayout();
    471     if (checkForRepaint)
     471    if (checkForRepaint) {
    472472        getAbsoluteRepaintRectIncludingFloats(oldBounds, oldFullBounds);
     473        oldBounds.move(view()->layoutDelta());
     474        oldFullBounds.move(view()->layoutDelta());
     475    }
    473476
    474477    int oldWidth = m_width;
     
    880883    }
    881884
     885    view()->addLayoutDelta(IntSize(0, yPosEstimate - ypos));
    882886    child->setPos(child->xPos(), ypos);
    883887    if (ypos != yPosEstimate) {
     
    902906    if (heightIncrease) {
    903907        // The child needs to be lowered.  Move the child so that it just clears the float.
     908        view()->addLayoutDelta(IntSize(0, -heightIncrease));
    904909        child->setPos(child->xPos(), child->yPos() + heightIncrease);
    905910
     
    987992            }
    988993        }
     994        view()->addLayoutDelta(IntSize(child->xPos() - chPos, 0));
    989995        child->setPos(chPos, child->yPos());
    990996    } else {
     
    10071013            }
    10081014        }
     1015        view()->addLayoutDelta(IntSize(child->xPos() - chPos, 0));
    10091016        child->setPos(chPos, child->yPos());
    10101017    }
     
    11261133         
    11271134        // Go ahead and position the child as though it didn't collapse with the top.
     1135        view()->addLayoutDelta(IntSize(0, child->yPos() - yPosEstimate));
    11281136        child->setPos(child->xPos(), yPosEstimate);
    11291137        if (yPosEstimate != oldRect.y() && !child->avoidsFloats() && child->containsFloats())
     
    11701178        // Insert our compact into the block margin if we have one.
    11711179        insertCompactIfNeeded(child, compactInfo);
     1180
     1181        view()->addLayoutDelta(IntSize(child->xPos() - oldRect.x(), child->yPos() - oldRect.y()));
    11721182
    11731183        // If the child moved, we have to repaint it as well as any floating/positioned
     
    11801190                child->repaintDuringLayoutIfMoved(oldRect);
    11811191            else if (finalChildY != yPosEstimate || finalChildY != postCollapseChildY) {
    1182                 // The child's repaints during layout were done before it reached its final position,
    1183                 // so they were wrong.
     1192                // The child invalidated itself during layout at an intermediate position,
     1193                // but not at its final position. Take care of it now.
    11841194                child->repaint();
    11851195                child->repaintOverhangingFloats();
  • trunk/WebCore/rendering/RenderFlexibleBox.cpp

    r18819 r19492  
    254254    IntRect oldBounds;
    255255    bool checkForRepaint = checkForRepaintDuringLayout();
    256     if (checkForRepaint)
     256    if (checkForRepaint) {
    257257        oldBounds = getAbsoluteRepaintRect();
    258    
     258        oldBounds.move(view()->layoutDelta());
     259    }
     260
    259261    int previousWidth = m_width;
    260262    int previousHeight = m_height;
  • trunk/WebCore/rendering/RenderHTMLCanvas.cpp

    r18654 r19492  
    3131#include "HTMLCanvasElement.h"
    3232#include "HTMLNames.h"
     33#include "RenderView.h"
    3334
    3435namespace WebCore {
     
    8384    IntRect oldBounds;
    8485    bool checkForRepaint = checkForRepaintDuringLayout();
    85     if (checkForRepaint)
     86    if (checkForRepaint) {
    8687        oldBounds = getAbsoluteRepaintRect();
     88        oldBounds.move(view()->layoutDelta());
     89    }
    8790    calcWidth();
    8891    calcHeight();
  • trunk/WebCore/rendering/RenderImage.cpp

    r18755 r19492  
    305305    IntRect oldBounds;
    306306    bool checkForRepaint = checkForRepaintDuringLayout();
    307     if (checkForRepaint)
     307    if (checkForRepaint) {
    308308        oldBounds = getAbsoluteRepaintRect();
     309        oldBounds.move(view()->layoutDelta());
     310    }
    309311
    310312    // minimum height
  • trunk/WebCore/rendering/RenderTable.cpp

    r19100 r19492  
    279279    IntRect oldFullBounds;
    280280    bool checkForRepaint = checkForRepaintDuringLayout();
    281     if (checkForRepaint)
     281    if (checkForRepaint) {
    282282        getAbsoluteRepaintRectIncludingFloats(oldBounds, oldFullBounds);
     283        oldBounds.move(view()->layoutDelta());
     284        oldFullBounds.move(view()->layoutDelta());
     285    }
    283286   
    284287    m_height = 0;
  • trunk/WebCore/rendering/RenderView.h

    r18918 r19492  
    9494    RenderObject* flexBoxInFirstLayout() { return m_flexBoxInFirstLayout; }
    9595
     96    const IntSize& layoutDelta() const { return m_layoutDelta; }
     97    void addLayoutDelta(const IntSize& delta) { m_layoutDelta += delta; }
     98
    9699protected:
    97100    FrameView* m_frameView;
     
    119122    int m_truncatorWidth;
    120123    bool m_forcedPageBreak;
     124    IntSize m_layoutDelta;
    121125};
    122126
Note: See TracChangeset for help on using the changeset viewer.