Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(78)

Side by Side Diff: Source/WebCore/rendering/RenderBlock.cpp

Issue 11416300: Merge 136060 (Closed) Base URL: http://svn.webkit.org/repository/webkit/branches/chromium/1312/
Patch Set: Created 8 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « Source/WebCore/rendering/RenderBlock.h ('k') | Source/WebCore/rendering/RenderInline.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
3 * (C) 1999 Antti Koivisto (koivisto@kde.org) 3 * (C) 1999 Antti Koivisto (koivisto@kde.org)
4 * (C) 2007 David Smith (catfish.man@gmail.com) 4 * (C) 2007 David Smith (catfish.man@gmail.com)
5 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All rights reserved. 5 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All rights reserved.
6 * Copyright (C) Research In Motion Limited 2010. All rights reserved. 6 * Copyright (C) Research In Motion Limited 2010. All rights reserved.
7 * 7 *
8 * This library is free software; you can redistribute it and/or 8 * This library is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU Library General Public 9 * modify it under the terms of the GNU Library General Public
10 * License as published by the Free Software Foundation; either 10 * License as published by the Free Software Foundation; either
(...skipping 657 matching lines...) Expand 10 before | Expand all | Expand 10 after
668 RenderBlock* block = containingColumnsBlock(); 668 RenderBlock* block = containingColumnsBlock();
669 669
670 // Delete our line boxes before we do the inline split into continuations. 670 // Delete our line boxes before we do the inline split into continuations.
671 block->deleteLineBoxTree(); 671 block->deleteLineBoxTree();
672 672
673 bool madeNewBeforeBlock = false; 673 bool madeNewBeforeBlock = false;
674 if (block->isAnonymousColumnsBlock()) { 674 if (block->isAnonymousColumnsBlock()) {
675 // We can reuse this block and make it the preBlock of the next continua tion. 675 // We can reuse this block and make it the preBlock of the next continua tion.
676 pre = block; 676 pre = block;
677 pre->removePositionedObjects(0); 677 pre->removePositionedObjects(0);
678 pre->removeFloatingObjects();
678 block = toRenderBlock(block->parent()); 679 block = toRenderBlock(block->parent());
679 } else { 680 } else {
680 // No anonymous block available for use. Make one. 681 // No anonymous block available for use. Make one.
681 pre = block->createAnonymousColumnsBlock(); 682 pre = block->createAnonymousColumnsBlock();
682 pre->setChildrenInline(false); 683 pre->setChildrenInline(false);
683 madeNewBeforeBlock = true; 684 madeNewBeforeBlock = true;
684 } 685 }
685 686
686 RenderBlock* post = block->createAnonymousColumnsBlock(); 687 RenderBlock* post = block->createAnonymousColumnsBlock();
687 post->setChildrenInline(false); 688 post->setChildrenInline(false);
(...skipping 3066 matching lines...) Expand 10 before | Expand all | Expand 10 after
3754 p->setChildNeedsLayout(true); 3755 p->setChildNeedsLayout(true);
3755 3756
3756 deadObjects.append(r); 3757 deadObjects.append(r);
3757 } 3758 }
3758 } 3759 }
3759 3760
3760 for (unsigned i = 0; i < deadObjects.size(); i++) 3761 for (unsigned i = 0; i < deadObjects.size(); i++)
3761 removePositionedObject(deadObjects.at(i)); 3762 removePositionedObject(deadObjects.at(i));
3762 } 3763 }
3763 3764
3765 void RenderBlock::removeFloatingObjects()
3766 {
3767 if (!m_floatingObjects)
3768 return;
3769
3770 deleteAllValues(m_floatingObjects->set());
3771 m_floatingObjects->clear();
3772 }
3773
3764 RenderBlock::FloatingObject* RenderBlock::insertFloatingObject(RenderBox* o) 3774 RenderBlock::FloatingObject* RenderBlock::insertFloatingObject(RenderBox* o)
3765 { 3775 {
3766 ASSERT(o->isFloating()); 3776 ASSERT(o->isFloating());
3767 3777
3768 // Create the list of special objects if we don't aleady have one 3778 // Create the list of special objects if we don't aleady have one
3769 if (!m_floatingObjects) 3779 if (!m_floatingObjects)
3770 m_floatingObjects = adoptPtr(new FloatingObjects(this, isHorizontalWriti ngMode())); 3780 m_floatingObjects = adoptPtr(new FloatingObjects(this, isHorizontalWriti ngMode()));
3771 else { 3781 else {
3772 // Don't insert the object again if it's already in the list 3782 // Don't insert the object again if it's already in the list
3773 const FloatingObjectSet& floatingObjectSet = m_floatingObjects->set(); 3783 const FloatingObjectSet& floatingObjectSet = m_floatingObjects->set();
(...skipping 3934 matching lines...) Expand 10 before | Expand all | Expand 10 after
7708 } 7718 }
7709 7719
7710 String ValueToString<RenderBlock::FloatingObject*>::string(const RenderBlock::Fl oatingObject* floatingObject) 7720 String ValueToString<RenderBlock::FloatingObject*>::string(const RenderBlock::Fl oatingObject* floatingObject)
7711 { 7721 {
7712 return String::format("%p (%dx%d %dx%d)", floatingObject, floatingObject->fr ameRect().pixelSnappedX(), floatingObject->frameRect().pixelSnappedY(), floating Object->frameRect().pixelSnappedMaxX(), floatingObject->frameRect().pixelSnapped MaxY()); 7722 return String::format("%p (%dx%d %dx%d)", floatingObject, floatingObject->fr ameRect().pixelSnappedX(), floatingObject->frameRect().pixelSnappedY(), floating Object->frameRect().pixelSnappedMaxX(), floatingObject->frameRect().pixelSnapped MaxY());
7713 } 7723 }
7714 7724
7715 #endif 7725 #endif
7716 7726
7717 } // namespace WebCore 7727 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/WebCore/rendering/RenderBlock.h ('k') | Source/WebCore/rendering/RenderInline.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698