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

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

Issue 9374042: Merge 106744 (Closed) Base URL: http://svn.webkit.org/repository/webkit/branches/chromium/1025/
Patch Set: Created 8 years, 10 months 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
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 1006 matching lines...) Expand 10 before | Expand all | Expand 10 after
1017 1017
1018 // Make sure the types of the anonymous blocks match up. 1018 // Make sure the types of the anonymous blocks match up.
1019 return prev->isAnonymousColumnsBlock() == next->isAnonymousColumnsBlock() 1019 return prev->isAnonymousColumnsBlock() == next->isAnonymousColumnsBlock()
1020 && prev->isAnonymousColumnSpanBlock() == next->isAnonymousColumnSpanB lock(); 1020 && prev->isAnonymousColumnSpanBlock() == next->isAnonymousColumnSpanB lock();
1021 } 1021 }
1022 1022
1023 void RenderBlock::collapseAnonymousBoxChild(RenderBlock* parent, RenderObject* c hild) 1023 void RenderBlock::collapseAnonymousBoxChild(RenderBlock* parent, RenderObject* c hild)
1024 { 1024 {
1025 parent->setNeedsLayoutAndPrefWidthsRecalc(); 1025 parent->setNeedsLayoutAndPrefWidthsRecalc();
1026 parent->setChildrenInline(child->childrenInline()); 1026 parent->setChildrenInline(child->childrenInline());
1027 RenderObject* nextSibling = child->nextSibling();
1027 RenderBlock* anonBlock = toRenderBlock(parent->children()->removeChildNode(p arent, child, child->hasLayer())); 1028 RenderBlock* anonBlock = toRenderBlock(parent->children()->removeChildNode(p arent, child, child->hasLayer()));
1028 anonBlock->moveAllChildrenTo(parent, child->hasLayer()); 1029 anonBlock->moveAllChildrenTo(parent, nextSibling, child->hasLayer());
1029 // Delete the now-empty block's lines and nuke it. 1030 // Delete the now-empty block's lines and nuke it.
1030 if (!parent->documentBeingDestroyed()) 1031 if (!parent->documentBeingDestroyed())
1031 anonBlock->deleteLineBoxTree(); 1032 anonBlock->deleteLineBoxTree();
1032 anonBlock->destroy(); 1033 anonBlock->destroy();
1033 } 1034 }
1034 1035
1035 void RenderBlock::removeChild(RenderObject* oldChild) 1036 void RenderBlock::removeChild(RenderObject* oldChild)
1036 { 1037 {
1037 // If this child is a block, and if our previous and next siblings are 1038 // If this child is a block, and if our previous and next siblings are
1038 // both anonymous blocks with inline content, then we can go ahead and 1039 // both anonymous blocks with inline content, then we can go ahead and
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
1082 } 1083 }
1083 1084
1084 RenderBox::removeChild(oldChild); 1085 RenderBox::removeChild(oldChild);
1085 1086
1086 RenderObject* child = prev ? prev : next; 1087 RenderObject* child = prev ? prev : next;
1087 if (canMergeAnonymousBlocks && child && !child->previousSibling() && !child- >nextSibling() && !isFlexibleBoxIncludingDeprecated()) { 1088 if (canMergeAnonymousBlocks && child && !child->previousSibling() && !child- >nextSibling() && !isFlexibleBoxIncludingDeprecated()) {
1088 // The removal has knocked us down to containing only a single anonymous 1089 // The removal has knocked us down to containing only a single anonymous
1089 // box. We can go ahead and pull the content right back up into our 1090 // box. We can go ahead and pull the content right back up into our
1090 // box. 1091 // box.
1091 collapseAnonymousBoxChild(this, child); 1092 collapseAnonymousBoxChild(this, child);
1092 } else if ((prev && prev->isAnonymousBlock()) || (next && next->isAnonymousB lock())) { 1093 } else if (((prev && prev->isAnonymousBlock()) || (next && next->isAnonymous Block())) && !isFlexibleBoxIncludingDeprecated()) {
1093 // It's possible that the removal has knocked us down to a single anonym ous 1094 // It's possible that the removal has knocked us down to a single anonym ous
1094 // block with pseudo-style element siblings (e.g. first-letter). If thes e 1095 // block with pseudo-style element siblings (e.g. first-letter). If thes e
1095 // are floating, then we need to pull the content up also. 1096 // are floating, then we need to pull the content up also.
1096 RenderBlock* anonBlock = toRenderBlock((prev && prev->isAnonymousBlock() ) ? prev : next); 1097 RenderBlock* anonBlock = toRenderBlock((prev && prev->isAnonymousBlock() ) ? prev : next);
1097 if ((anonBlock->previousSibling() || anonBlock->nextSibling()) 1098 if ((anonBlock->previousSibling() || anonBlock->nextSibling())
1098 && (!anonBlock->previousSibling() || (anonBlock->previousSibling()-> style()->styleType() != NOPSEUDO && anonBlock->previousSibling()->isFloating())) 1099 && (!anonBlock->previousSibling() || (anonBlock->previousSibling()-> style()->styleType() != NOPSEUDO && anonBlock->previousSibling()->isFloating()))
1099 && (!anonBlock->nextSibling() || (anonBlock->nextSibling()->style()- >styleType() != NOPSEUDO && anonBlock->nextSibling()->isFloating()))) { 1100 && (!anonBlock->nextSibling() || (anonBlock->nextSibling()->style()- >styleType() != NOPSEUDO && anonBlock->nextSibling()->isFloating()))) {
1100 collapseAnonymousBoxChild(this, anonBlock); 1101 collapseAnonymousBoxChild(this, anonBlock);
1101 } 1102 }
1102 } 1103 }
(...skipping 5990 matching lines...) Expand 10 before | Expand all | Expand 10 after
7093 } 7094 }
7094 7095
7095 String ValueToString<RenderBlock::FloatingObject*>::string(const RenderBlock::Fl oatingObject* floatingObject) 7096 String ValueToString<RenderBlock::FloatingObject*>::string(const RenderBlock::Fl oatingObject* floatingObject)
7096 { 7097 {
7097 return String::format("%p (%dx%d %dx%d)", floatingObject, floatingObject->x( ), floatingObject->y(), floatingObject->maxX(), floatingObject->maxY()); 7098 return String::format("%p (%dx%d %dx%d)", floatingObject, floatingObject->x( ), floatingObject->y(), floatingObject->maxX(), floatingObject->maxY());
7098 } 7099 }
7099 7100
7100 #endif 7101 #endif
7101 7102
7102 } // namespace WebCore 7103 } // namespace WebCore
OLDNEW
« no previous file with comments | « LayoutTests/fast/css-generated-content/remove-div-from-flexible-box-with-floating-after-content-crash-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698