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

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

Issue 11876028: Merge 138988 (Closed) Base URL: http://svn.webkit.org/repository/webkit/branches/chromium/1364/
Patch Set: Created 7 years, 11 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/recursive-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 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
63 #include "TransformState.h" 63 #include "TransformState.h"
64 #include "WebCoreMemoryInstrumentation.h" 64 #include "WebCoreMemoryInstrumentation.h"
65 #include <wtf/StdLibExtras.h> 65 #include <wtf/StdLibExtras.h>
66 #if ENABLE(CSS_EXCLUSIONS) 66 #if ENABLE(CSS_EXCLUSIONS)
67 #include "ExclusionShapeInsideInfo.h" 67 #include "ExclusionShapeInsideInfo.h"
68 #include "ExclusionShapeOutsideInfo.h" 68 #include "ExclusionShapeOutsideInfo.h"
69 #endif 69 #endif
70 #include <wtf/MemoryInstrumentationHashMap.h> 70 #include <wtf/MemoryInstrumentationHashMap.h>
71 #include <wtf/MemoryInstrumentationHashSet.h> 71 #include <wtf/MemoryInstrumentationHashSet.h>
72 #include <wtf/MemoryInstrumentationListHashSet.h> 72 #include <wtf/MemoryInstrumentationListHashSet.h>
73 #include <wtf/TemporaryChange.h>
73 74
74 using namespace std; 75 using namespace std;
75 using namespace WTF; 76 using namespace WTF;
76 using namespace Unicode; 77 using namespace Unicode;
77 78
78 namespace WebCore { 79 namespace WebCore {
79 80
80 using namespace HTMLNames; 81 using namespace HTMLNames;
81 82
82 struct SameSizeAsRenderBlock : public RenderBox { 83 struct SameSizeAsRenderBlock : public RenderBox {
(...skipping 27 matching lines...) Expand all
110 111
111 static TrackedContainerMap* gPositionedContainerMap = 0; 112 static TrackedContainerMap* gPositionedContainerMap = 0;
112 static TrackedContainerMap* gPercentHeightContainerMap = 0; 113 static TrackedContainerMap* gPercentHeightContainerMap = 0;
113 114
114 typedef WTF::HashMap<RenderBlock*, OwnPtr<ListHashSet<RenderInline*> > > Continu ationOutlineTableMap; 115 typedef WTF::HashMap<RenderBlock*, OwnPtr<ListHashSet<RenderInline*> > > Continu ationOutlineTableMap;
115 116
116 typedef WTF::HashSet<RenderBlock*> DelayedUpdateScrollInfoSet; 117 typedef WTF::HashSet<RenderBlock*> DelayedUpdateScrollInfoSet;
117 static int gDelayUpdateScrollInfo = 0; 118 static int gDelayUpdateScrollInfo = 0;
118 static DelayedUpdateScrollInfoSet* gDelayedUpdateScrollInfoSet = 0; 119 static DelayedUpdateScrollInfoSet* gDelayedUpdateScrollInfoSet = 0;
119 120
121 static bool gIsInColumnFlowSplit = false;
122
120 bool RenderBlock::s_canPropagateFloatIntoSibling = false; 123 bool RenderBlock::s_canPropagateFloatIntoSibling = false;
121 124
122 // 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
123 // 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.
124 class OverflowEventDispatcher { 127 class OverflowEventDispatcher {
125 WTF_MAKE_NONCOPYABLE(OverflowEventDispatcher); 128 WTF_MAKE_NONCOPYABLE(OverflowEventDispatcher);
126 public: 129 public:
127 OverflowEventDispatcher(const RenderBlock* block) 130 OverflowEventDispatcher(const RenderBlock* block)
128 : m_block(block) 131 : m_block(block)
129 , m_hadHorizontalLayoutOverflow(false) 132 , m_hadHorizontalLayoutOverflow(false)
(...skipping 692 matching lines...) Expand 10 before | Expand all | Expand 10 after
822 ASSERT(beforeChild->isRunIn()); 825 ASSERT(beforeChild->isRunIn());
823 beforeChild = beforeChildContainer; 826 beforeChild = beforeChildContainer;
824 } 827 }
825 } 828 }
826 829
827 // Nothing goes before the intruded run-in. 830 // Nothing goes before the intruded run-in.
828 if (beforeChild && beforeChild->isRunIn() && runInIsPlacedIntoSiblingBlock(b eforeChild)) 831 if (beforeChild && beforeChild->isRunIn() && runInIsPlacedIntoSiblingBlock(b eforeChild))
829 beforeChild = beforeChild->nextSibling(); 832 beforeChild = beforeChild->nextSibling();
830 833
831 // Check for a spanning element in columns. 834 // Check for a spanning element in columns.
832 RenderBlock* columnsBlockAncestor = columnsBlockForSpanningElement(newChild) ; 835 if (!gIsInColumnFlowSplit) {
833 if (columnsBlockAncestor) { 836 RenderBlock* columnsBlockAncestor = columnsBlockForSpanningElement(newCh ild);
834 // We are placing a column-span element inside a block. 837 if (columnsBlockAncestor) {
835 RenderBlock* newBox = createAnonymousColumnSpanBlock(); 838 TemporaryChange<bool> isInColumnFlowSplit(gIsInColumnFlowSplit, true );
839 // We are placing a column-span element inside a block.
840 RenderBlock* newBox = createAnonymousColumnSpanBlock();
836 841
837 if (columnsBlockAncestor != this) { 842 if (columnsBlockAncestor != this) {
838 // We are nested inside a multi-column element and are being split b y 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
839 // our block into continuations. 844 // our block into continuations.
840 RenderBoxModelObject* oldContinuation = continuation(); 845 RenderBoxModelObject* oldContinuation = continuation();
841 846
842 // When we split an anonymous block, there's no need to do any conti nuation hookup, 847 // When we split an anonymous block, there's no need to do any c ontinuation hookup,
843 // since we haven't actually split a real element. 848 // since we haven't actually split a real element.
844 if (!isAnonymousBlock()) 849 if (!isAnonymousBlock())
845 setContinuation(newBox); 850 setContinuation(newBox);
846 851
847 splitFlow(beforeChild, newBox, newChild, oldContinuation); 852 splitFlow(beforeChild, newBox, newChild, oldContinuation);
853 return;
854 }
855
856 // We have to perform a split of this block's children. This involve s creating an anonymous block box to hold
857 // the column-spanning |newChild|. We take all of the children from before |newChild| and put them into
858 // one anonymous columns block, and all of the children after |newCh ild| go into another anonymous block.
859 makeChildrenAnonymousColumnBlocks(beforeChild, newBox, newChild);
848 return; 860 return;
849 } 861 }
850
851 // We have to perform a split of this block's children. This involves c reating an anonymous block box to hold
852 // the column-spanning |newChild|. We take all of the children from bef ore |newChild| and put them into
853 // one anonymous columns block, and all of the children after |newChild| go into another anonymous block.
854 makeChildrenAnonymousColumnBlocks(beforeChild, newBox, newChild);
855 return;
856 } 862 }
857 863
858 bool madeBoxesNonInline = false; 864 bool madeBoxesNonInline = false;
859 865
860 // A block has to either have all of its children inline, or all of its chil dren as blocks. 866 // A block has to either have all of its children inline, or all of its chil dren as blocks.
861 // So, if our children are currently inline and a block child has to be inse rted, we move all our 867 // So, if our children are currently inline and a block child has to be inse rted, we move all our
862 // inline children into anonymous block boxes. 868 // inline children into anonymous block boxes.
863 if (childrenInline() && !newChild->isInline() && !newChild->isFloatingOrOutO fFlowPositioned()) { 869 if (childrenInline() && !newChild->isInline() && !newChild->isFloatingOrOutO fFlowPositioned()) {
864 // This is a block with inline content. Wrap the inline content in anony mous blocks. 870 // This is a block with inline content. Wrap the inline content in anony mous blocks.
865 makeChildrenNonInline(beforeChild); 871 makeChildrenNonInline(beforeChild);
(...skipping 6878 matching lines...) Expand 10 before | Expand all | Expand 10 after
7744 { 7750 {
7745 memoryInstrumentation->addRootObject(gColumnInfoMap, WebCoreMemoryTypes::Ren deringStructures); 7751 memoryInstrumentation->addRootObject(gColumnInfoMap, WebCoreMemoryTypes::Ren deringStructures);
7746 memoryInstrumentation->addRootObject(gPositionedDescendantsMap, WebCoreMemor yTypes::RenderingStructures); 7752 memoryInstrumentation->addRootObject(gPositionedDescendantsMap, WebCoreMemor yTypes::RenderingStructures);
7747 memoryInstrumentation->addRootObject(gPercentHeightDescendantsMap, WebCoreMe moryTypes::RenderingStructures); 7753 memoryInstrumentation->addRootObject(gPercentHeightDescendantsMap, WebCoreMe moryTypes::RenderingStructures);
7748 memoryInstrumentation->addRootObject(gPositionedContainerMap, WebCoreMemoryT ypes::RenderingStructures); 7754 memoryInstrumentation->addRootObject(gPositionedContainerMap, WebCoreMemoryT ypes::RenderingStructures);
7749 memoryInstrumentation->addRootObject(gPercentHeightContainerMap, WebCoreMemo ryTypes::RenderingStructures); 7755 memoryInstrumentation->addRootObject(gPercentHeightContainerMap, WebCoreMemo ryTypes::RenderingStructures);
7750 memoryInstrumentation->addRootObject(gDelayedUpdateScrollInfoSet, WebCoreMem oryTypes::RenderingStructures); 7756 memoryInstrumentation->addRootObject(gDelayedUpdateScrollInfoSet, WebCoreMem oryTypes::RenderingStructures);
7751 } 7757 }
7752 7758
7753 } // namespace WebCore 7759 } // namespace WebCore
OLDNEW
« no previous file with comments | « LayoutTests/fast/multicol/recursive-split-flow-crash-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698