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

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

Issue 12310023: Merge 142922 (Closed) Base URL: http://svn.webkit.org/repository/webkit/branches/chromium/1364/
Patch Set: Created 7 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
« no previous file with comments | « LayoutTests/fast/multicol/remove-child-split-flow-crash-expected.txt ('k') | no next file » | 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 100 matching lines...) Expand 10 before | Expand all | Expand 10 after
111 111
112 static TrackedContainerMap* gPositionedContainerMap = 0; 112 static TrackedContainerMap* gPositionedContainerMap = 0;
113 static TrackedContainerMap* gPercentHeightContainerMap = 0; 113 static TrackedContainerMap* gPercentHeightContainerMap = 0;
114 114
115 typedef WTF::HashMap<RenderBlock*, OwnPtr<ListHashSet<RenderInline*> > > Continu ationOutlineTableMap; 115 typedef WTF::HashMap<RenderBlock*, OwnPtr<ListHashSet<RenderInline*> > > Continu ationOutlineTableMap;
116 116
117 typedef WTF::HashSet<RenderBlock*> DelayedUpdateScrollInfoSet; 117 typedef WTF::HashSet<RenderBlock*> DelayedUpdateScrollInfoSet;
118 static int gDelayUpdateScrollInfo = 0; 118 static int gDelayUpdateScrollInfo = 0;
119 static DelayedUpdateScrollInfoSet* gDelayedUpdateScrollInfoSet = 0; 119 static DelayedUpdateScrollInfoSet* gDelayedUpdateScrollInfoSet = 0;
120 120
121 static bool gIsInColumnFlowSplit = false; 121 static bool gColumnFlowSplitEnabled = true;
122 122
123 bool RenderBlock::s_canPropagateFloatIntoSibling = false; 123 bool RenderBlock::s_canPropagateFloatIntoSibling = false;
124 124
125 // This class helps dispatching the 'overflow' event on layout change. overflow can be set on RenderBoxes, yet the existing code 125 // This class helps dispatching the 'overflow' event on layout change. overflow can be set on RenderBoxes, yet the existing code
126 // only works on RenderBlocks. If this change, this class should be shared with other RenderBoxes. 126 // only works on RenderBlocks. If this change, this class should be shared with other RenderBoxes.
127 class OverflowEventDispatcher { 127 class OverflowEventDispatcher {
128 WTF_MAKE_NONCOPYABLE(OverflowEventDispatcher); 128 WTF_MAKE_NONCOPYABLE(OverflowEventDispatcher);
129 public: 129 public:
130 OverflowEventDispatcher(const RenderBlock* block) 130 OverflowEventDispatcher(const RenderBlock* block)
131 : m_block(block) 131 : m_block(block)
(...skipping 693 matching lines...) Expand 10 before | Expand all | Expand 10 after
825 ASSERT(beforeChild->isRunIn()); 825 ASSERT(beforeChild->isRunIn());
826 beforeChild = beforeChildContainer; 826 beforeChild = beforeChildContainer;
827 } 827 }
828 } 828 }
829 829
830 // Nothing goes before the intruded run-in. 830 // Nothing goes before the intruded run-in.
831 if (beforeChild && beforeChild->isRunIn() && runInIsPlacedIntoSiblingBlock(b eforeChild)) 831 if (beforeChild && beforeChild->isRunIn() && runInIsPlacedIntoSiblingBlock(b eforeChild))
832 beforeChild = beforeChild->nextSibling(); 832 beforeChild = beforeChild->nextSibling();
833 833
834 // Check for a spanning element in columns. 834 // Check for a spanning element in columns.
835 if (!gIsInColumnFlowSplit) { 835 if (gColumnFlowSplitEnabled) {
836 RenderBlock* columnsBlockAncestor = columnsBlockForSpanningElement(newCh ild); 836 RenderBlock* columnsBlockAncestor = columnsBlockForSpanningElement(newCh ild);
837 if (columnsBlockAncestor) { 837 if (columnsBlockAncestor) {
838 TemporaryChange<bool> isInColumnFlowSplit(gIsInColumnFlowSplit, true ); 838 TemporaryChange<bool> columnFlowSplitEnabled(gColumnFlowSplitEnabled , false);
839 // We are placing a column-span element inside a block. 839 // We are placing a column-span element inside a block.
840 RenderBlock* newBox = createAnonymousColumnSpanBlock(); 840 RenderBlock* newBox = createAnonymousColumnSpanBlock();
841 841
842 if (columnsBlockAncestor != this) { 842 if (columnsBlockAncestor != this) {
843 // We are nested inside a multi-column element and are being spl it by the span. We have to break up 843 // We are nested inside a multi-column element and are being spl it by the span. We have to break up
844 // our block into continuations. 844 // our block into continuations.
845 RenderBoxModelObject* oldContinuation = continuation(); 845 RenderBoxModelObject* oldContinuation = continuation();
846 846
847 // When we split an anonymous block, there's no need to do any c ontinuation hookup, 847 // When we split an anonymous block, there's no need to do any c ontinuation hookup,
848 // since we haven't actually split a real element. 848 // since we haven't actually split a real element.
(...skipping 287 matching lines...) Expand 10 before | Expand all | Expand 10 after
1136 1136
1137 void RenderBlock::removeChild(RenderObject* oldChild) 1137 void RenderBlock::removeChild(RenderObject* oldChild)
1138 { 1138 {
1139 // No need to waste time in merging or removing empty anonymous blocks. 1139 // No need to waste time in merging or removing empty anonymous blocks.
1140 // We can just bail out if our document is getting destroyed. 1140 // We can just bail out if our document is getting destroyed.
1141 if (documentBeingDestroyed()) { 1141 if (documentBeingDestroyed()) {
1142 RenderBox::removeChild(oldChild); 1142 RenderBox::removeChild(oldChild);
1143 return; 1143 return;
1144 } 1144 }
1145 1145
1146 // This protects against column split flows when anonymous blocks are gettin g merged.
1147 TemporaryChange<bool> columnFlowSplitEnabled(gColumnFlowSplitEnabled, false) ;
1148
1146 // If this child is a block, and if our previous and next siblings are 1149 // If this child is a block, and if our previous and next siblings are
1147 // both anonymous blocks with inline content, then we can go ahead and 1150 // both anonymous blocks with inline content, then we can go ahead and
1148 // fold the inline content back together. 1151 // fold the inline content back together.
1149 RenderObject* prev = oldChild->previousSibling(); 1152 RenderObject* prev = oldChild->previousSibling();
1150 RenderObject* next = oldChild->nextSibling(); 1153 RenderObject* next = oldChild->nextSibling();
1151 bool canMergeAnonymousBlocks = canMergeContiguousAnonymousBlocks(oldChild, p rev, next); 1154 bool canMergeAnonymousBlocks = canMergeContiguousAnonymousBlocks(oldChild, p rev, next);
1152 if (canMergeAnonymousBlocks && prev && next) { 1155 if (canMergeAnonymousBlocks && prev && next) {
1153 prev->setNeedsLayoutAndPrefWidthsRecalc(); 1156 prev->setNeedsLayoutAndPrefWidthsRecalc();
1154 RenderBlock* nextBlock = toRenderBlock(next); 1157 RenderBlock* nextBlock = toRenderBlock(next);
1155 RenderBlock* prevBlock = toRenderBlock(prev); 1158 RenderBlock* prevBlock = toRenderBlock(prev);
(...skipping 6594 matching lines...) Expand 10 before | Expand all | Expand 10 after
7750 { 7753 {
7751 memoryInstrumentation->addRootObject(gColumnInfoMap, WebCoreMemoryTypes::Ren deringStructures); 7754 memoryInstrumentation->addRootObject(gColumnInfoMap, WebCoreMemoryTypes::Ren deringStructures);
7752 memoryInstrumentation->addRootObject(gPositionedDescendantsMap, WebCoreMemor yTypes::RenderingStructures); 7755 memoryInstrumentation->addRootObject(gPositionedDescendantsMap, WebCoreMemor yTypes::RenderingStructures);
7753 memoryInstrumentation->addRootObject(gPercentHeightDescendantsMap, WebCoreMe moryTypes::RenderingStructures); 7756 memoryInstrumentation->addRootObject(gPercentHeightDescendantsMap, WebCoreMe moryTypes::RenderingStructures);
7754 memoryInstrumentation->addRootObject(gPositionedContainerMap, WebCoreMemoryT ypes::RenderingStructures); 7757 memoryInstrumentation->addRootObject(gPositionedContainerMap, WebCoreMemoryT ypes::RenderingStructures);
7755 memoryInstrumentation->addRootObject(gPercentHeightContainerMap, WebCoreMemo ryTypes::RenderingStructures); 7758 memoryInstrumentation->addRootObject(gPercentHeightContainerMap, WebCoreMemo ryTypes::RenderingStructures);
7756 memoryInstrumentation->addRootObject(gDelayedUpdateScrollInfoSet, WebCoreMem oryTypes::RenderingStructures); 7759 memoryInstrumentation->addRootObject(gDelayedUpdateScrollInfoSet, WebCoreMem oryTypes::RenderingStructures);
7757 } 7760 }
7758 7761
7759 } // namespace WebCore 7762 } // namespace WebCore
OLDNEW
« no previous file with comments | « LayoutTests/fast/multicol/remove-child-split-flow-crash-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698