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

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

Issue 12284016: Merge 142922 (Closed) Base URL: http://svn.webkit.org/repository/webkit/branches/chromium/1410/
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 697 matching lines...) Expand 10 before | Expand all | Expand 10 after
829 ASSERT(beforeChild->isRunIn()); 829 ASSERT(beforeChild->isRunIn());
830 beforeChild = beforeChildContainer; 830 beforeChild = beforeChildContainer;
831 } 831 }
832 } 832 }
833 833
834 // Nothing goes before the intruded run-in. 834 // Nothing goes before the intruded run-in.
835 if (beforeChild && beforeChild->isRunIn() && runInIsPlacedIntoSiblingBlock(b eforeChild)) 835 if (beforeChild && beforeChild->isRunIn() && runInIsPlacedIntoSiblingBlock(b eforeChild))
836 beforeChild = beforeChild->nextSibling(); 836 beforeChild = beforeChild->nextSibling();
837 837
838 // Check for a spanning element in columns. 838 // Check for a spanning element in columns.
839 if (!gIsInColumnFlowSplit) { 839 if (gColumnFlowSplitEnabled) {
840 RenderBlock* columnsBlockAncestor = columnsBlockForSpanningElement(newCh ild); 840 RenderBlock* columnsBlockAncestor = columnsBlockForSpanningElement(newCh ild);
841 if (columnsBlockAncestor) { 841 if (columnsBlockAncestor) {
842 TemporaryChange<bool> isInColumnFlowSplit(gIsInColumnFlowSplit, true ); 842 TemporaryChange<bool> columnFlowSplitEnabled(gColumnFlowSplitEnabled , false);
843 // We are placing a column-span element inside a block. 843 // We are placing a column-span element inside a block.
844 RenderBlock* newBox = createAnonymousColumnSpanBlock(); 844 RenderBlock* newBox = createAnonymousColumnSpanBlock();
845 845
846 if (columnsBlockAncestor != this) { 846 if (columnsBlockAncestor != this) {
847 // We are nested inside a multi-column element and are being spl it by the span. We have to break up 847 // We are nested inside a multi-column element and are being spl it by the span. We have to break up
848 // our block into continuations. 848 // our block into continuations.
849 RenderBoxModelObject* oldContinuation = continuation(); 849 RenderBoxModelObject* oldContinuation = continuation();
850 850
851 // When we split an anonymous block, there's no need to do any c ontinuation hookup, 851 // When we split an anonymous block, there's no need to do any c ontinuation hookup,
852 // since we haven't actually split a real element. 852 // since we haven't actually split a real element.
(...skipping 292 matching lines...) Expand 10 before | Expand all | Expand 10 after
1145 1145
1146 void RenderBlock::removeChild(RenderObject* oldChild) 1146 void RenderBlock::removeChild(RenderObject* oldChild)
1147 { 1147 {
1148 // No need to waste time in merging or removing empty anonymous blocks. 1148 // No need to waste time in merging or removing empty anonymous blocks.
1149 // We can just bail out if our document is getting destroyed. 1149 // We can just bail out if our document is getting destroyed.
1150 if (documentBeingDestroyed()) { 1150 if (documentBeingDestroyed()) {
1151 RenderBox::removeChild(oldChild); 1151 RenderBox::removeChild(oldChild);
1152 return; 1152 return;
1153 } 1153 }
1154 1154
1155 // This protects against column split flows when anonymous blocks are gettin g merged.
1156 TemporaryChange<bool> columnFlowSplitEnabled(gColumnFlowSplitEnabled, false) ;
1157
1155 // If this child is a block, and if our previous and next siblings are 1158 // If this child is a block, and if our previous and next siblings are
1156 // both anonymous blocks with inline content, then we can go ahead and 1159 // both anonymous blocks with inline content, then we can go ahead and
1157 // fold the inline content back together. 1160 // fold the inline content back together.
1158 RenderObject* prev = oldChild->previousSibling(); 1161 RenderObject* prev = oldChild->previousSibling();
1159 RenderObject* next = oldChild->nextSibling(); 1162 RenderObject* next = oldChild->nextSibling();
1160 bool canMergeAnonymousBlocks = canMergeContiguousAnonymousBlocks(oldChild, p rev, next); 1163 bool canMergeAnonymousBlocks = canMergeContiguousAnonymousBlocks(oldChild, p rev, next);
1161 if (canMergeAnonymousBlocks && prev && next) { 1164 if (canMergeAnonymousBlocks && prev && next) {
1162 prev->setNeedsLayoutAndPrefWidthsRecalc(); 1165 prev->setNeedsLayoutAndPrefWidthsRecalc();
1163 RenderBlock* nextBlock = toRenderBlock(next); 1166 RenderBlock* nextBlock = toRenderBlock(next);
1164 RenderBlock* prevBlock = toRenderBlock(prev); 1167 RenderBlock* prevBlock = toRenderBlock(prev);
(...skipping 6683 matching lines...) Expand 10 before | Expand all | Expand 10 after
7848 { 7851 {
7849 memoryInstrumentation->addRootObject(gColumnInfoMap, WebCoreMemoryTypes::Ren deringStructures); 7852 memoryInstrumentation->addRootObject(gColumnInfoMap, WebCoreMemoryTypes::Ren deringStructures);
7850 memoryInstrumentation->addRootObject(gPositionedDescendantsMap, WebCoreMemor yTypes::RenderingStructures); 7853 memoryInstrumentation->addRootObject(gPositionedDescendantsMap, WebCoreMemor yTypes::RenderingStructures);
7851 memoryInstrumentation->addRootObject(gPercentHeightDescendantsMap, WebCoreMe moryTypes::RenderingStructures); 7854 memoryInstrumentation->addRootObject(gPercentHeightDescendantsMap, WebCoreMe moryTypes::RenderingStructures);
7852 memoryInstrumentation->addRootObject(gPositionedContainerMap, WebCoreMemoryT ypes::RenderingStructures); 7855 memoryInstrumentation->addRootObject(gPositionedContainerMap, WebCoreMemoryT ypes::RenderingStructures);
7853 memoryInstrumentation->addRootObject(gPercentHeightContainerMap, WebCoreMemo ryTypes::RenderingStructures); 7856 memoryInstrumentation->addRootObject(gPercentHeightContainerMap, WebCoreMemo ryTypes::RenderingStructures);
7854 memoryInstrumentation->addRootObject(gDelayedUpdateScrollInfoSet, WebCoreMem oryTypes::RenderingStructures); 7857 memoryInstrumentation->addRootObject(gDelayedUpdateScrollInfoSet, WebCoreMem oryTypes::RenderingStructures);
7855 } 7858 }
7856 7859
7857 } // namespace WebCore 7860 } // 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