⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 107333 in webkit


Ignore:
Timestamp:
Feb 9, 2012, 5:57:26 PM (15 years ago)
Author:
cevans@google.com
Message:

Merge 106150
BUG=104317
Review URL: https://chromiumcodereview.appspot.com/9371039

Location:
branches/chromium/963
Files:
2 edited
6 copied

Legend:

Unmodified
Added
Removed
  • branches/chromium/963/Source/WebCore/rendering/RenderBlock.cpp

    r105818 r107333  
    10181018    return prev->isAnonymousColumnsBlock() == next->isAnonymousColumnsBlock()
    10191019           && prev->isAnonymousColumnSpanBlock() == next->isAnonymousColumnSpanBlock();
     1020}
     1021
     1022void RenderBlock::collapseAnonymousBoxChild(RenderBlock* parent, RenderObject* child)
     1023{
     1024    parent->setNeedsLayoutAndPrefWidthsRecalc();
     1025    parent->setChildrenInline(child->childrenInline());
     1026    RenderBlock* anonBlock = toRenderBlock(parent->children()->removeChildNode(parent, child, child->hasLayer()));
     1027    anonBlock->moveAllChildrenTo(parent, child->hasLayer());
     1028    // Delete the now-empty block's lines and nuke it.
     1029    if (!parent->documentBeingDestroyed())
     1030        anonBlock->deleteLineBoxTree();
     1031    anonBlock->destroy();
    10201032}
    10211033
     
    10761088        // box.  We can go ahead and pull the content right back up into our
    10771089        // box.
    1078         setNeedsLayoutAndPrefWidthsRecalc();
    1079         setChildrenInline(child->childrenInline());
    1080         RenderBlock* anonBlock = toRenderBlock(children()->removeChildNode(this, child, child->hasLayer()));
    1081         anonBlock->moveAllChildrenTo(this, child->hasLayer());
    1082         // Delete the now-empty block's lines and nuke it.
    1083         anonBlock->deleteLineBoxTree();
    1084         anonBlock->destroy();
     1090        collapseAnonymousBoxChild(this, child);
     1091    } else if ((prev && prev->isAnonymousBlock()) || (next && next->isAnonymousBlock())) {
     1092        // It's possible that the removal has knocked us down to a single anonymous
     1093        // block with pseudo-style element siblings (e.g. first-letter). If these
     1094        // are floating, then we need to pull the content up also.
     1095        RenderBlock* anonBlock = toRenderBlock((prev && prev->isAnonymousBlock()) ? prev : next);
     1096        if ((anonBlock->previousSibling() || anonBlock->nextSibling())
     1097            && (!anonBlock->previousSibling() || (anonBlock->previousSibling()->style()->styleType() != NOPSEUDO && anonBlock->previousSibling()->isFloating()))
     1098            && (!anonBlock->nextSibling() || (anonBlock->nextSibling()->style()->styleType() != NOPSEUDO && anonBlock->nextSibling()->isFloating()))) {
     1099            collapseAnonymousBoxChild(this, anonBlock);
     1100        }
    10851101    }
    10861102
  • branches/chromium/963/Source/WebCore/rendering/RenderBlock.h

    r105346 r107333  
    450450    virtual void removeLeftoverAnonymousBlock(RenderBlock* child);
    451451
     452    static void collapseAnonymousBoxChild(RenderBlock* parent, RenderObject* child);
     453
    452454    virtual void dirtyLinesFromChangedChild(RenderObject* child) { m_lineBoxes.dirtyLinesFromChangedChild(this, child); }
    453455
Note: See TracChangeset for help on using the changeset viewer.