Show
Ignore:
Timestamp:
03/15/07 17:04:39 (22 months ago)
Author:
bdakin
Message:

Reviewed by Hyatt.

Fix for <rdar://problem/5065396> REGRESSION: leaks in
RenderBlock::layoutInlineChildren seen on buildbot

This leak appeared after http://trac.webkit.org/projects/webkit/
changeset/20188. This change shifted line boxes around in
removeChild(). But since removeChild() calls
setNeedsLayoutAndMinMaxRecalc(), all of the line boxes will be
removed once we actually lay out anyway. So this patch fixes the
leak by deleting the line boxes instead of shifting them around.

  • editing/IndentOutdentCommand.cpp: (WebCore::IndentOutdentCommand::outdentParagraph): Call into updateLayout(). This fixes an assertion I got in editing/ execCommand/4976800.html This is very similar to the line box fix I made recently (http://trac.webkit.org/projects/webkit/changeset/ 20177). We need to update layout before relying on VisiblePositions after removing a node.
  • rendering/RenderBlock.cpp: (WebCore::RenderBlock::deleteLinesForBlock): New helper function since this functionality is needed in three places now. (WebCore::RenderBlock::makeChildrenNonInline): Call into new deleteLinesForBlock(). (WebCore::RenderBlock::removeChild): Same.
  • rendering/RenderBlock.h:
Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/WebCore/rendering/RenderBlock.h

    r19862 r20220  
    5858    virtual void setChildrenInline(bool b) { m_childrenInline = b; } 
    5959    void makeChildrenNonInline(RenderObject* insertionPoint = 0); 
     60    void deleteLineBoxTree(); 
    6061 
    6162    // The height (and width) of a block when you include overflow spillage out of the bottom