Unreviewed, rolling out r185512.
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 12 Jun 2015 18:43:01 +0000 (18:43 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 12 Jun 2015 18:43:01 +0000 (18:43 +0000)
https://bugs.webkit.org/show_bug.cgi?id=145932

Many asserts on layout tests and on API tests (Requested by
ap_ on #webkit).

Reverted changeset:

"Use modern for-loops in WebCore/rendering - 1"
https://bugs.webkit.org/show_bug.cgi?id=145831
http://trac.webkit.org/changeset/185512

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@185517 268f45cc-cd09-0410-ab3c-d52691b4dbfc

22 files changed:
Source/WebCore/ChangeLog
Source/WebCore/rendering/AutoTableLayout.cpp
Source/WebCore/rendering/FilterEffectRenderer.cpp
Source/WebCore/rendering/FilterEffectRenderer.h
Source/WebCore/rendering/FloatingObjects.cpp
Source/WebCore/rendering/FlowThreadController.cpp
Source/WebCore/rendering/HitTestResult.cpp
Source/WebCore/rendering/ImageQualityController.cpp
Source/WebCore/rendering/InlineTextBox.cpp
Source/WebCore/rendering/RenderBlock.cpp
Source/WebCore/rendering/RenderBlockFlow.cpp
Source/WebCore/rendering/RenderBlockLineLayout.cpp
Source/WebCore/rendering/RenderCounter.cpp
Source/WebCore/rendering/RenderFlexibleBox.cpp
Source/WebCore/rendering/RenderFlowThread.cpp
Source/WebCore/rendering/RenderInline.cpp
Source/WebCore/rendering/RenderLayer.cpp
Source/WebCore/rendering/RenderLayerBacking.cpp
Source/WebCore/rendering/RenderLineBoxList.cpp
Source/WebCore/rendering/RenderListBox.cpp
Source/WebCore/rendering/RenderMenuList.cpp
Source/WebCore/rendering/RenderMultiColumnSet.cpp

index 2c03f3b..be6c902 100644 (file)
@@ -1,3 +1,17 @@
+2015-06-12  Commit Queue  <commit-queue@webkit.org>
+
+        Unreviewed, rolling out r185512.
+        https://bugs.webkit.org/show_bug.cgi?id=145932
+
+        Many asserts on layout tests and on API tests (Requested by
+        ap_ on #webkit).
+
+        Reverted changeset:
+
+        "Use modern for-loops in WebCore/rendering - 1"
+        https://bugs.webkit.org/show_bug.cgi?id=145831
+        http://trac.webkit.org/changeset/185512
+
 2015-06-12  Simon Fraser  <simon.fraser@apple.com>
 
         OpenGLESSPI.h doesn't need to include UIKit.h
index cd418eb..1aeaded 100644 (file)
@@ -226,17 +226,17 @@ void AutoTableLayout::computeIntrinsicLogicalWidths(LayoutUnit& minWidth, Layout
     const float epsilon = 1 / 128.0f;
 
     float remainingPercent = 100;
-    for (auto& layout : m_layoutStruct) {
-        minWidth += layout.effectiveMinLogicalWidth;
-        maxWidth += layout.effectiveMaxLogicalWidth;
+    for (size_t i = 0; i < m_layoutStruct.size(); ++i) {
+        minWidth += m_layoutStruct[i].effectiveMinLogicalWidth;
+        maxWidth += m_layoutStruct[i].effectiveMaxLogicalWidth;
         if (scaleColumns) {
-            if (layout.effectiveLogicalWidth.isPercent()) {
-                float percent = std::min(layout.effectiveLogicalWidth.percent(), remainingPercent);
-                float logicalWidth = static_cast<float>(layout.effectiveMaxLogicalWidth) * 100 / std::max(percent, epsilon);
+            if (m_layoutStruct[i].effectiveLogicalWidth.isPercent()) {
+                float percent = std::min(m_layoutStruct[i].effectiveLogicalWidth.percent(), remainingPercent);
+                float logicalWidth = static_cast<float>(m_layoutStruct[i].effectiveMaxLogicalWidth) * 100 / std::max(percent, epsilon);
                 maxPercent = std::max(logicalWidth,  maxPercent);
                 remainingPercent -= percent;
             } else
-                maxNonPercent += layout.effectiveMaxLogicalWidth;
+                maxNonPercent += m_layoutStruct[i].effectiveMaxLogicalWidth;
         }
     }
 
@@ -264,15 +264,17 @@ int AutoTableLayout::calcEffectiveLogicalWidth()
 {
     int maxLogicalWidth = 0;
 
+    size_t nEffCols = m_layoutStruct.size();
     int spacingInRowDirection = m_table->hBorderSpacing();
 
-    for (auto& layout : m_layoutStruct) {
-        layout.effectiveLogicalWidth = layout.logicalWidth;
-        layout.effectiveMinLogicalWidth = layout.minLogicalWidth;
-        layout.effectiveMaxLogicalWidth = layout.maxLogicalWidth;
+    for (size_t i = 0; i < nEffCols; ++i) {
+        m_layoutStruct[i].effectiveLogicalWidth = m_layoutStruct[i].logicalWidth;
+        m_layoutStruct[i].effectiveMinLogicalWidth = m_layoutStruct[i].minLogicalWidth;
+        m_layoutStruct[i].effectiveMaxLogicalWidth = m_layoutStruct[i].maxLogicalWidth;
     }
 
-    for (auto& cell : m_spanCells) {
+    for (size_t i = 0; i < m_spanCells.size(); ++i) {
+        RenderTableCell* cell = m_spanCells[i];
         if (!cell)
             break;
 
@@ -294,7 +296,7 @@ int AutoTableLayout::calcEffectiveLogicalWidth()
         bool haveAuto = false;
         bool spanHasEmptyCellsOnly = true;
         int fixedWidth = 0;
-        while (lastCol < m_layoutStruct.size() && span > 0) {
+        while (lastCol < nEffCols && span > 0) {
             Layout& columnLayout = m_layoutStruct[lastCol];
             switch (columnLayout.logicalWidth.type()) {
             case Percent:
index 2182e6f..62dac4b 100644 (file)
@@ -135,17 +135,18 @@ bool FilterEffectRenderer::build(RenderElement* renderer, const FilterOperations
     m_effects.clear();
 
     RefPtr<FilterEffect> previousEffect = m_sourceGraphic;
-    for (auto& filterOperation : operations.operations()) {
+    for (size_t i = 0; i < operations.operations().size(); ++i) {
         RefPtr<FilterEffect> effect;
-        switch (filterOperation->type()) {
+        FilterOperation& filterOperation = *operations.operations().at(i);
+        switch (filterOperation.type()) {
         case FilterOperation::REFERENCE: {
-            ReferenceFilterOperation& referenceOperation = downcast<ReferenceFilterOperation>(*filterOperation);
+            ReferenceFilterOperation& referenceOperation = downcast<ReferenceFilterOperation>(filterOperation);
             effect = buildReferenceFilter(renderer, previousEffect, &referenceOperation);
             referenceOperation.setFilterEffect(effect);
             break;
         }
         case FilterOperation::GRAYSCALE: {
-            BasicColorMatrixFilterOperation& colorMatrixOperation = downcast<BasicColorMatrixFilterOperation>(*filterOperation);
+            BasicColorMatrixFilterOperation& colorMatrixOperation = downcast<BasicColorMatrixFilterOperation>(filterOperation);
             Vector<float> inputParameters;
             double oneMinusAmount = clampTo(1 - colorMatrixOperation.amount(), 0.0, 1.0);
 
@@ -173,7 +174,7 @@ bool FilterEffectRenderer::build(RenderElement* renderer, const FilterOperations
             break;
         }
         case FilterOperation::SEPIA: {
-            BasicColorMatrixFilterOperation& colorMatrixOperation = downcast<BasicColorMatrixFilterOperation>(*filterOperation);
+            BasicColorMatrixFilterOperation& colorMatrixOperation = downcast<BasicColorMatrixFilterOperation>(filterOperation);
             Vector<float> inputParameters;
             double oneMinusAmount = clampTo(1 - colorMatrixOperation.amount(), 0.0, 1.0);
 
@@ -201,21 +202,21 @@ bool FilterEffectRenderer::build(RenderElement* renderer, const FilterOperations
             break;
         }
         case FilterOperation::SATURATE: {
-            BasicColorMatrixFilterOperation& colorMatrixOperation = downcast<BasicColorMatrixFilterOperation>(*filterOperation);
+            BasicColorMatrixFilterOperation& colorMatrixOperation = downcast<BasicColorMatrixFilterOperation>(filterOperation);
             Vector<float> inputParameters;
             inputParameters.append(narrowPrecisionToFloat(colorMatrixOperation.amount()));
             effect = FEColorMatrix::create(*this, FECOLORMATRIX_TYPE_SATURATE, inputParameters);
             break;
         }
         case FilterOperation::HUE_ROTATE: {
-            BasicColorMatrixFilterOperation& colorMatrixOperation = downcast<BasicColorMatrixFilterOperation>(*filterOperation);
+            BasicColorMatrixFilterOperation& colorMatrixOperation = downcast<BasicColorMatrixFilterOperation>(filterOperation);
             Vector<float> inputParameters;
             inputParameters.append(narrowPrecisionToFloat(colorMatrixOperation.amount()));
             effect = FEColorMatrix::create(*this, FECOLORMATRIX_TYPE_HUEROTATE, inputParameters);
             break;
         }
         case FilterOperation::INVERT: {
-            BasicComponentTransferFilterOperation& componentTransferOperation = downcast<BasicComponentTransferFilterOperation>(*filterOperation);
+            BasicComponentTransferFilterOperation& componentTransferOperation = downcast<BasicComponentTransferFilterOperation>(filterOperation);
             ComponentTransferFunction transferFunction;
             transferFunction.type = FECOMPONENTTRANSFER_TYPE_TABLE;
             Vector<float> transferParameters;
@@ -228,7 +229,7 @@ bool FilterEffectRenderer::build(RenderElement* renderer, const FilterOperations
             break;
         }
         case FilterOperation::OPACITY: {
-            BasicComponentTransferFilterOperation& componentTransferOperation = downcast<BasicComponentTransferFilterOperation>(*filterOperation);
+            BasicComponentTransferFilterOperation& componentTransferOperation = downcast<BasicComponentTransferFilterOperation>(filterOperation);
             ComponentTransferFunction transferFunction;
             transferFunction.type = FECOMPONENTTRANSFER_TYPE_TABLE;
             Vector<float> transferParameters;
@@ -241,7 +242,7 @@ bool FilterEffectRenderer::build(RenderElement* renderer, const FilterOperations
             break;
         }
         case FilterOperation::BRIGHTNESS: {
-            BasicComponentTransferFilterOperation& componentTransferOperation = downcast<BasicComponentTransferFilterOperation>(*filterOperation);
+            BasicComponentTransferFilterOperation& componentTransferOperation = downcast<BasicComponentTransferFilterOperation>(filterOperation);
             ComponentTransferFunction transferFunction;
             transferFunction.type = FECOMPONENTTRANSFER_TYPE_LINEAR;
             transferFunction.slope = narrowPrecisionToFloat(componentTransferOperation.amount());
@@ -252,7 +253,7 @@ bool FilterEffectRenderer::build(RenderElement* renderer, const FilterOperations
             break;
         }
         case FilterOperation::CONTRAST: {
-            BasicComponentTransferFilterOperation& componentTransferOperation = downcast<BasicComponentTransferFilterOperation>(*filterOperation);
+            BasicComponentTransferFilterOperation& componentTransferOperation = downcast<BasicComponentTransferFilterOperation>(filterOperation);
             ComponentTransferFunction transferFunction;
             transferFunction.type = FECOMPONENTTRANSFER_TYPE_LINEAR;
             float amount = narrowPrecisionToFloat(componentTransferOperation.amount());
@@ -264,13 +265,13 @@ bool FilterEffectRenderer::build(RenderElement* renderer, const FilterOperations
             break;
         }
         case FilterOperation::BLUR: {
-            BlurFilterOperation& blurOperation = downcast<BlurFilterOperation>(*filterOperation);
+            BlurFilterOperation& blurOperation = downcast<BlurFilterOperation>(filterOperation);
             float stdDeviation = floatValueForLength(blurOperation.stdDeviation(), 0);
             effect = FEGaussianBlur::create(*this, stdDeviation, stdDeviation, consumer == FilterProperty ? EDGEMODE_NONE : EDGEMODE_DUPLICATE);
             break;
         }
         case FilterOperation::DROP_SHADOW: {
-            DropShadowFilterOperation& dropShadowOperation = downcast<DropShadowFilterOperation>(*filterOperation);
+            DropShadowFilterOperation& dropShadowOperation = downcast<DropShadowFilterOperation>(filterOperation);
             effect = FEDropShadow::create(*this, dropShadowOperation.stdDeviation(), dropShadowOperation.stdDeviation(),
                 dropShadowOperation.x(), dropShadowOperation.y(), dropShadowOperation.color(), 1);
             break;
@@ -285,7 +286,7 @@ bool FilterEffectRenderer::build(RenderElement* renderer, const FilterOperations
             effect->setClipsToBounds(consumer == FilterFunction);
             effect->setOperatingColorSpace(ColorSpaceDeviceRGB);
             
-            if (filterOperation->type() != FilterOperation::REFERENCE) {
+            if (filterOperation.type() != FilterOperation::REFERENCE) {
                 effect->inputEffects().append(previousEffect);
                 m_effects.append(effect);
             }
@@ -330,8 +331,8 @@ void FilterEffectRenderer::allocateBackingStoreIfNeeded()
 void FilterEffectRenderer::clearIntermediateResults()
 {
     m_sourceGraphic->clearResult();
-    for (auto& effect : m_effects)
-        effect->clearResult();
+    for (size_t i = 0; i < m_effects.size(); ++i)
+        m_effects[i]->clearResult();
 }
 
 void FilterEffectRenderer::apply()
index d71553a..5ff898b 100644 (file)
@@ -120,8 +120,10 @@ public:
 private:
     void setMaxEffectRects(const FloatRect& effectRect)
     {
-        for (auto& effect : m_effects)
+        for (size_t i = 0; i < m_effects.size(); ++i) {
+            RefPtr<FilterEffect> effect = m_effects.at(i);
             effect->setMaxEffectRect(effectRect);
+        }
     }
 
     FilterEffect* lastEffect() const
index 0c06449..dbc51c7 100644 (file)
@@ -266,9 +266,9 @@ FloatingObjects::~FloatingObjects()
 void FloatingObjects::clearLineBoxTreePointers()
 {
     // Clear references to originating lines, since the lines are being deleted
-    for (auto& floatingObject : m_set) {
-        ASSERT(!floatingObject->originatingLine() || &floatingObject->originatingLine()->renderer() == &m_renderer);
-        floatingObject->setOriginatingLine(nullptr);
+    for (auto it = m_set.begin(), end = m_set.end(); it != end; ++it) {
+        ASSERT(!((*it)->originatingLine()) || &((*it)->originatingLine()->renderer()) == &m_renderer);
+        (*it)->setOriginatingLine(0);
     }
 }
 
@@ -282,12 +282,12 @@ void FloatingObjects::clear()
 
 void FloatingObjects::moveAllToFloatInfoMap(RendererToFloatInfoMap& map)
 {
-    for (auto& floatingObject : m_set) {
-        auto& renderer = floatingObject->renderer();
+    for (auto it = m_set.begin(), end = m_set.end(); it != end; ++it) {
+        auto& renderer = it->get()->renderer();
         // FIXME: The only reason it is safe to move these out of the set is that
         // we are about to clear it. Otherwise it would break the hash table invariant.
         // A clean way to do this would be to add a takeAll function to HashSet.
-        map.add(&renderer, WTF::move(floatingObject));
+        map.add(&renderer, WTF::move(*it));
     }
     clear();
 }
@@ -374,9 +374,10 @@ void FloatingObjects::computePlacedFloatsTree()
         return;
 
     m_placedFloatsTree = std::make_unique<FloatingObjectTree>();
-    for (auto& floatingObject : m_set) {
+    for (auto it = m_set.begin(), end = m_set.end(); it != end; ++it) {
+        FloatingObject* floatingObject = it->get();
         if (floatingObject->isPlaced())
-            m_placedFloatsTree->add(intervalForFloatingObject(floatingObject.get()));
+            m_placedFloatsTree->add(intervalForFloatingObject(floatingObject));
     }
 }
 
index eb6b46c..8cf14ac 100644 (file)
@@ -274,7 +274,8 @@ void FlowThreadController::collectFixedPositionedLayers(Vector<RenderLayer*>& fi
 
         RenderLayer* flowThreadLayer = flowRenderer->layer();
         if (Vector<RenderLayer*>* negZOrderList = flowThreadLayer->negZOrderList()) {
-            for (auto& currLayer : *negZOrderList) {
+            for (size_t i = 0, size = negZOrderList->size(); i < size; ++i) {
+                RenderLayer* currLayer = negZOrderList->at(i);
                 if (currLayer->renderer().style().position() != FixedPosition)
                     continue;
                 fixedPosLayers.append(currLayer);
@@ -282,7 +283,8 @@ void FlowThreadController::collectFixedPositionedLayers(Vector<RenderLayer*>& fi
         }
 
         if (Vector<RenderLayer*>* posZOrderList = flowThreadLayer->posZOrderList()) {
-            for (auto& currLayer : *posZOrderList) {
+            for (size_t i = 0, size = posZOrderList->size(); i < size; ++i) {
+                RenderLayer* currLayer = posZOrderList->at(i);
                 if (currLayer->renderer().style().position() != FixedPosition)
                     continue;
                 fixedPosLayers.append(currLayer);
index 892d163..14449b6 100644 (file)
@@ -702,8 +702,8 @@ void HitTestResult::append(const HitTestResult& other)
 
     if (other.m_rectBasedTestResult) {
         NodeSet& set = mutableRectBasedTestResult();
-        for (auto& result : *other.m_rectBasedTestResult)
-            set.add(result);
+        for (NodeSet::const_iterator it = other.m_rectBasedTestResult->begin(), last = other.m_rectBasedTestResult->end(); it != last; ++it)
+            set.add(it->get());
     }
 }
 
index 10dcf11..c4a6e43 100644 (file)
@@ -88,8 +88,8 @@ void ImageQualityController::highQualityRepaintTimerFired()
         return;
     }
 
-    for (auto& object : m_objectLayerSizeMap.keys())
-        object->repaint();
+    for (auto it = m_objectLayerSizeMap.begin(), end = m_objectLayerSizeMap.end(); it != end; ++it)
+        it->key->repaint();
 
     m_liveResizeOptimizationIsActive = false;
 }
index beeecc6..f40b750 100644 (file)
@@ -630,7 +630,12 @@ void InlineTextBox::paint(PaintInfo& paintInfo, const LayoutPoint& paintOffset,
         paintDocumentMarkers(context, boxOrigin, lineStyle, font, false);
 
         if (useCustomUnderlines) {
-            for (auto& underline : renderer().frame().editor().customCompositionUnderlines()) {
+            const Vector<CompositionUnderline>& underlines = renderer().frame().editor().customCompositionUnderlines();
+            size_t numUnderlines = underlines.size();
+
+            for (size_t index = 0; index < numUnderlines; ++index) {
+                const CompositionUnderline& underline = underlines[index];
+
                 if (underline.endOffset <= start())
                     // underline is completely before this run.  This might be an underline that sits
                     // before the first run we draw, or underlines that were within runs we skipped 
index e053095..766d1a8 100644 (file)
@@ -193,9 +193,10 @@ RenderBlock::RenderBlock(Document& document, Ref<RenderStyle>&& style, unsigned
 
 static void removeBlockFromDescendantAndContainerMaps(RenderBlock* block, TrackedDescendantsMap*& descendantMap, TrackedContainerMap*& containerMap)
 {
-    if (auto descendantSet = descendantMap->take(block)) {
-        for (auto& box : *descendantSet) {
-            auto it = containerMap->find(box);
+    if (std::unique_ptr<TrackedRendererListHashSet> descendantSet = descendantMap->take(block)) {
+        TrackedRendererListHashSet::iterator end = descendantSet->end();
+        for (TrackedRendererListHashSet::iterator descendant = descendantSet->begin(); descendant != end; ++descendant) {
+            TrackedContainerMap::iterator it = containerMap->find(*descendant);
             ASSERT(it != containerMap->end());
             if (it == containerMap->end())
                 continue;
@@ -1050,7 +1051,9 @@ void RenderBlock::addOverflowFromPositionedObjects()
     if (!positionedDescendants)
         return;
 
-    for (auto& positionedObject : *positionedDescendants) {
+    for (auto it = positionedDescendants->begin(), end = positionedDescendants->end(); it != end; ++it) {
+        RenderBox* positionedObject = *it;
+        
         // Fixed positioned elements don't contribute to layout overflow, since they don't scroll with the content.
         if (positionedObject->style().position() != FixedPosition) {
             LayoutUnit x = positionedObject->x();
@@ -1145,7 +1148,8 @@ void RenderBlock::dirtyForLayoutFromPercentageHeightDescendants()
     if (!descendants)
         return;
 
-    for (auto& box : *descendants) {
+    for (auto it = descendants->begin(), end = descendants->end(); it != end; ++it) {
+        RenderBox* box = *it;
         while (box != this) {
             if (box->normalChildNeedsLayout())
                 break;
@@ -1182,9 +1186,11 @@ void RenderBlock::simplifiedNormalFlowLayout()
 
         // FIXME: Glyph overflow will get lost in this case, but not really a big deal.
         // FIXME: Find a way to invalidate the knownToHaveNoOverflow flag on the InlineBoxes.
-        GlyphOverflowAndFallbackFontsMap textBoxDataMap;
-        for (auto& box : lineBoxes)
+        GlyphOverflowAndFallbackFontsMap textBoxDataMap;                  
+        for (auto it = lineBoxes.begin(), end = lineBoxes.end(); it != end; ++it) {
+            RootInlineBox* box = *it;
             box->computeOverflow(box->lineTop(), box->lineBottom(), textBoxDataMap);
+        }
     } else {
         for (auto box = firstChildBox(); box; box = box->nextSiblingBox()) {
             if (!box->isOutOfFlowPositioned())
@@ -1293,15 +1299,17 @@ void RenderBlock::layoutPositionedObjects(bool relayoutChildren, bool fixedPosit
     if (!positionedDescendants)
         return;
 
-    for (auto& box : *positionedDescendants) {
-        estimateRegionRangeForBoxChild(*box);
+    for (auto it = positionedDescendants->begin(), end = positionedDescendants->end(); it != end; ++it) {
+        RenderBox& r = **it;
+        
+        estimateRegionRangeForBoxChild(r);
 
         // A fixed position element with an absolute positioned ancestor has no way of knowing if the latter has changed position. So
         // if this is a fixed position element, mark it for layout if it has an abspos ancestor and needs to move with that ancestor, i.e. 
         // it has static position.
-        markFixedPositionObjectForLayoutIfNeeded(*box);
+        markFixedPositionObjectForLayoutIfNeeded(r);
         if (fixedPositionObjectsOnly) {
-            box->layoutIfNeeded();
+            r.layoutIfNeeded();
             continue;
         }
 
@@ -1309,43 +1317,43 @@ void RenderBlock::layoutPositionedObjects(bool relayoutChildren, bool fixedPosit
         // non-positioned block.  Rather than trying to detect all of these movement cases, we just always lay out positioned
         // objects that are positioned implicitly like this.  Such objects are rare, and so in typical DHTML menu usage (where everything is
         // positioned explicitly) this should not incur a performance penalty.
-        if (relayoutChildren || (box->style().hasStaticBlockPosition(isHorizontalWritingMode()) && box->parent() != this))
-            box->setChildNeedsLayout(MarkOnlyThis);
+        if (relayoutChildren || (r.style().hasStaticBlockPosition(isHorizontalWritingMode()) && r.parent() != this))
+            r.setChildNeedsLayout(MarkOnlyThis);
             
         // If relayoutChildren is set and the child has percentage padding or an embedded content box, we also need to invalidate the childs pref widths.
-        if (relayoutChildren && box->needsPreferredWidthsRecalculation())
-            box->setPreferredLogicalWidthsDirty(true, MarkOnlyThis);
+        if (relayoutChildren && r.needsPreferredWidthsRecalculation())
+            r.setPreferredLogicalWidthsDirty(true, MarkOnlyThis);
         
-        box->markForPaginationRelayoutIfNeeded();
+        r.markForPaginationRelayoutIfNeeded();
         
         // We don't have to do a full layout.  We just have to update our position. Try that first. If we have shrink-to-fit width
         // and we hit the available width constraint, the layoutIfNeeded() will catch it and do a full layout.
-        if (box->needsPositionedMovementLayoutOnly() && box->tryLayoutDoingPositionedMovementOnly())
-            box->clearNeedsLayout();
+        if (r.needsPositionedMovementLayoutOnly() && r.tryLayoutDoingPositionedMovementOnly())
+            r.clearNeedsLayout();
             
         // If we are paginated or in a line grid, compute a vertical position for our object now.
         // If it's wrong we'll lay out again.
         LayoutUnit oldLogicalTop = 0;
-        bool needsBlockDirectionLocationSetBeforeLayout = box->needsLayout() && view().layoutState()->needsBlockDirectionLocationSetBeforeLayout();
+        bool needsBlockDirectionLocationSetBeforeLayout = r.needsLayout() && view().layoutState()->needsBlockDirectionLocationSetBeforeLayout();
         if (needsBlockDirectionLocationSetBeforeLayout) {
-            if (isHorizontalWritingMode() == box->isHorizontalWritingMode())
-                box->updateLogicalHeight();
+            if (isHorizontalWritingMode() == r.isHorizontalWritingMode())
+                r.updateLogicalHeight();
             else
-                box->updateLogicalWidth();
-            oldLogicalTop = logicalTopForChild(*box);
+                r.updateLogicalWidth();
+            oldLogicalTop = logicalTopForChild(r);
         }
 
-        box->layoutIfNeeded();
+        r.layoutIfNeeded();
 
         // Lay out again if our estimate was wrong.
-        if (needsBlockDirectionLocationSetBeforeLayout && logicalTopForChild(*box) != oldLogicalTop) {
-            box->setChildNeedsLayout(MarkOnlyThis);
-            box->layoutIfNeeded();
+        if (needsBlockDirectionLocationSetBeforeLayout && logicalTopForChild(r) != oldLogicalTop) {
+            r.setChildNeedsLayout(MarkOnlyThis);
+            r.layoutIfNeeded();
         }
 
-        if (updateRegionRangeForBoxChild(*box)) {
-            box->setNeedsLayout(MarkOnlyThis);
-            box->layoutIfNeeded();
+        if (updateRegionRangeForBoxChild(r)) {
+            r.setNeedsLayout(MarkOnlyThis);
+            r.layoutIfNeeded();
         }
     }
 }
@@ -1356,8 +1364,10 @@ void RenderBlock::markPositionedObjectsForLayout()
     if (!positionedDescendants)
         return;
 
-    for (auto& box : *positionedDescendants)
-        box->setChildNeedsLayout();
+    for (auto it = positionedDescendants->begin(), end = positionedDescendants->end(); it != end; ++it) {
+        RenderBox* r = *it;
+        r->setChildNeedsLayout();
+    }
 }
 
 void RenderBlock::markForPaginationRelayoutIfNeeded()
@@ -1681,8 +1691,10 @@ void RenderBlock::paintContinuationOutlines(PaintInfo& info, const LayoutPoint&
 
     LayoutPoint accumulatedPaintOffset = paintOffset;
     // Paint each continuation outline.
-    for (auto& flow : *continuations) {
+    ListHashSet<RenderInline*>::iterator end = continuations->end();
+    for (ListHashSet<RenderInline*>::iterator it = continuations->begin(); it != end; ++it) {
         // Need to add in the coordinates of the intervening blocks.
+        RenderInline* flow = *it;
         RenderBlock* block = flow->containingBlock();
         for ( ; block && block != this; block = block->containingBlock())
             accumulatedPaintOffset.moveBy(block->location());
@@ -1776,8 +1788,11 @@ static void clipOutPositionedObjects(const PaintInfo* paintInfo, const LayoutPoi
     if (!positionedObjects)
         return;
     
-    for (auto& object : *positionedObjects)
-        paintInfo->context->clipOut(IntRect(offset.x() + object->x(), offset.y() + object->y(), object->width(), object->height()));
+    TrackedRendererListHashSet::const_iterator end = positionedObjects->end();
+    for (TrackedRendererListHashSet::const_iterator it = positionedObjects->begin(); it != end; ++it) {
+        RenderBox* r = *it;
+        paintInfo->context->clipOut(IntRect(offset.x() + r->x(), offset.y() + r->y(), r->width(), r->height()));
+    }
 }
 
 LayoutUnit blockDirectionOffset(RenderBlock& rootBlock, const LayoutSize& offsetFromRootBlock)
@@ -2108,7 +2123,9 @@ void RenderBlock::removeFromTrackedRendererMaps(RenderBox& descendant, TrackedDe
     if (!containerSet)
         return;
     
-    for (auto& container : *containerSet) {
+    for (auto it = containerSet->begin(), end = containerSet->end(); it != end; ++it) {
+        RenderBlock* container = *it;
+
         // FIXME: Disabling this assert temporarily until we fix the layout
         // bugs associated with positioned objects not properly cleared from
         // their ancestor chain before being moved. See webkit bug 93766.
@@ -2156,25 +2173,26 @@ void RenderBlock::removePositionedObjects(RenderBlock* o, ContainingBlockState c
     
     Vector<RenderBox*, 16> deadObjects;
 
-    for (auto& box : *positionedDescendants) {
-        if (!o || box->isDescendantOf(o)) {
+    for (auto it = positionedDescendants->begin(), end = positionedDescendants->end(); it != end; ++it) {
+        RenderBox* r = *it;
+        if (!o || r->isDescendantOf(o)) {
             if (containingBlockState == NewContainingBlock)
-                box->setChildNeedsLayout(MarkOnlyThis);
+                r->setChildNeedsLayout(MarkOnlyThis);
             
             // It is parent blocks job to add positioned child to positioned objects list of its containing block
             // Parent layout needs to be invalidated to ensure this happens.
-            RenderElement* p = box->parent();
+            RenderElement* p = r->parent();
             while (p && !p->isRenderBlock())
                 p = p->parent();
             if (p)
                 p->setChildNeedsLayout();
             
-            deadObjects.append(box);
+            deadObjects.append(r);
         }
     }
     
-    for (auto& object : deadObjects)
-        removePositionedObject(*object);
+    for (unsigned i = 0; i < deadObjects.size(); i++)
+        removePositionedObject(*deadObjects.at(i));
 }
 
 void RenderBlock::addPercentHeightDescendant(RenderBox& descendant)
@@ -3725,8 +3743,10 @@ void RenderBlock::checkPositionedObjectsNeedLayout()
     if (!positionedDescendantSet)
         return;
 
-    for (auto& box : *positionedDescendantSet)
-        ASSERT(!box->needsLayout());
+    for (auto it = positionedDescendantSet->begin(), end = positionedDescendantSet->end(); it != end; ++it) {
+        RenderBox* currBox = *it;
+        ASSERT(!currBox->needsLayout());
+    }
 }
 
 #endif
index deac64f..af4ca71 100644 (file)
@@ -203,7 +203,10 @@ void RenderBlockFlow::rebuildFloatingObjectSetFromIntrudingFloats()
 
     HashSet<RenderBox*> oldIntrudingFloatSet;
     if (!childrenInline() && m_floatingObjects) {
-        for (auto& floatingObject : m_floatingObjects->set()) {
+        const FloatingObjectSet& floatingObjectSet = m_floatingObjects->set();
+        auto end = floatingObjectSet.end();
+        for (auto it = floatingObjectSet.begin(); it != end; ++it) {
+            FloatingObject* floatingObject = it->get();
             if (!floatingObject->isDescendant())
                 oldIntrudingFloatSet.add(&floatingObject->renderer());
         }
@@ -261,12 +264,15 @@ void RenderBlockFlow::rebuildFloatingObjectSetFromIntrudingFloats()
         LayoutUnit changeLogicalTop = LayoutUnit::max();
         LayoutUnit changeLogicalBottom = LayoutUnit::min();
         if (m_floatingObjects) {
-            for (auto& floatingObject : m_floatingObjects->set()) {
+            const FloatingObjectSet& floatingObjectSet = m_floatingObjects->set();
+            auto end = floatingObjectSet.end();
+            for (auto it = floatingObjectSet.begin(); it != end; ++it) {
+                FloatingObject* floatingObject = it->get();
                 std::unique_ptr<FloatingObject> oldFloatingObject = floatMap.take(&floatingObject->renderer());
-                LayoutUnit logicalBottom = logicalBottomForFloat(floatingObject.get());
+                LayoutUnit logicalBottom = logicalBottomForFloat(floatingObject);
                 if (oldFloatingObject) {
                     LayoutUnit oldLogicalBottom = logicalBottomForFloat(oldFloatingObject.get());
-                    if (logicalWidthForFloat(floatingObject.get()) != logicalWidthForFloat(oldFloatingObject.get()) || logicalLeftForFloat(floatingObject.get()) != logicalLeftForFloat(oldFloatingObject.get())) {
+                    if (logicalWidthForFloat(floatingObject) != logicalWidthForFloat(oldFloatingObject.get()) || logicalLeftForFloat(floatingObject) != logicalLeftForFloat(oldFloatingObject.get())) {
                         changeLogicalTop = 0;
                         changeLogicalBottom = std::max(changeLogicalBottom, std::max(logicalBottom, oldLogicalBottom));
                     } else {
@@ -274,7 +280,7 @@ void RenderBlockFlow::rebuildFloatingObjectSetFromIntrudingFloats()
                             changeLogicalTop = std::min(changeLogicalTop, std::min(logicalBottom, oldLogicalBottom));
                             changeLogicalBottom = std::max(changeLogicalBottom, std::max(logicalBottom, oldLogicalBottom));
                         }
-                        LayoutUnit logicalTop = logicalTopForFloat(floatingObject.get());
+                        LayoutUnit logicalTop = logicalTopForFloat(floatingObject);
                         LayoutUnit oldLogicalTop = logicalTopForFloat(oldFloatingObject.get());
                         if (logicalTop != oldLogicalTop) {
                             changeLogicalTop = std::min(changeLogicalTop, std::min(logicalTop, oldLogicalTop));
@@ -293,10 +299,12 @@ void RenderBlockFlow::rebuildFloatingObjectSetFromIntrudingFloats()
             }
         }
 
-        for (auto& floatingObject : floatMap.values()) {
+        auto end = floatMap.end();
+        for (auto it = floatMap.begin(); it != end; ++it) {
+            FloatingObject* floatingObject = it->value.get();
             if (!floatingObject->isDescendant()) {
                 changeLogicalTop = 0;
-                changeLogicalBottom = std::max(changeLogicalBottom, logicalBottomForFloat(floatingObject.get()));
+                changeLogicalBottom = std::max(changeLogicalBottom, logicalBottomForFloat(floatingObject));
             }
         }
 
@@ -307,8 +315,10 @@ void RenderBlockFlow::rebuildFloatingObjectSetFromIntrudingFloats()
         if (m_floatingObjects->set().size() < oldIntrudingFloatSet.size())
             markAllDescendantsWithFloatsForLayout();
         else {
-            for (auto& floatingObject : m_floatingObjects->set())
-                oldIntrudingFloatSet.remove(&floatingObject->renderer());
+            const FloatingObjectSet& floatingObjectSet = m_floatingObjects->set();
+            auto end = floatingObjectSet.end();
+            for (auto it = floatingObjectSet.begin(); it != end && !oldIntrudingFloatSet.isEmpty(); ++it)
+                oldIntrudingFloatSet.remove(&(*it)->renderer());
             if (!oldIntrudingFloatSet.isEmpty())
                 markAllDescendantsWithFloatsForLayout();
         }
@@ -1972,8 +1982,8 @@ void RenderBlockFlow::styleDidChange(StyleDifference diff, const RenderStyle* ol
             if (ancestor.isRenderView())
                 break;
             if (ancestor.hasOverhangingFloats()) {
-                for (auto& floatingObject : floatingObjectSet) {
-                    RenderBox& renderer = floatingObject->renderer();
+                for (auto it = floatingObjectSet.begin(), end = floatingObjectSet.end(); it != end; ++it) {
+                    RenderBox& renderer = (*it)->renderer();
                     if (ancestor.hasOverhangingFloat(renderer)) {
                         parentBlock = &ancestor;
                         break;
@@ -2060,7 +2070,12 @@ void RenderBlockFlow::moveFloatsTo(RenderBlockFlow* toBlockFlow)
         if (!toBlockFlow->m_floatingObjects)
             toBlockFlow->createFloatingObjects();
 
-        for (auto& floatingObject : m_floatingObjects->set()) {
+        const FloatingObjectSet& fromFloatingObjectSet = m_floatingObjects->set();
+        auto end = fromFloatingObjectSet.end();
+
+        for (auto it = fromFloatingObjectSet.begin(); it != end; ++it) {
+            FloatingObject* floatingObject = it->get();
+
             // Don't insert the object again if it's already in the list
             if (toBlockFlow->containsFloat(floatingObject->renderer()))
                 continue;
@@ -2082,9 +2097,12 @@ void RenderBlockFlow::addOverflowFromFloats()
     if (!m_floatingObjects)
         return;
 
-    for (auto& floatingObject : m_floatingObjects->set()) {
-        if (floatingObject->isDescendant())
-            addOverflowFromChild(&floatingObject->renderer(), IntSize(xPositionForFloatIncludingMargin(floatingObject.get()), yPositionForFloatIncludingMargin(floatingObject.get())));
+    const FloatingObjectSet& floatingObjectSet = m_floatingObjects->set();
+    auto end = floatingObjectSet.end();
+    for (auto it = floatingObjectSet.begin(); it != end; ++it) {
+        FloatingObject* r = it->get();
+        if (r->isDescendant())
+            addOverflowFromChild(&r->renderer(), IntSize(xPositionForFloatIncludingMargin(r), yPositionForFloatIncludingMargin(r)));
     }
 }
 
@@ -2106,11 +2124,14 @@ void RenderBlockFlow::repaintOverhangingFloats(bool paintAllDescendants)
     // FIXME: Avoid disabling LayoutState. At the very least, don't disable it for floats originating
     // in this block. Better yet would be to push extra state for the containers of other floats.
     LayoutStateDisabler layoutStateDisabler(&view());
-    for (auto& floatingObject : m_floatingObjects->set()) {
+    const FloatingObjectSet& floatingObjectSet = m_floatingObjects->set();
+    auto end = floatingObjectSet.end();
+    for (auto it = floatingObjectSet.begin(); it != end; ++it) {
+        FloatingObject* floatingObject = it->get();
         // Only repaint the object if it is overhanging, is not in its own layer, and
         // is our responsibility to paint (m_shouldPaint is set). When paintAllDescendants is true, the latter
         // condition is replaced with being a descendant of us.
-        if (logicalBottomForFloat(floatingObject.get()) > logicalHeight()
+        if (logicalBottomForFloat(floatingObject) > logicalHeight()
             && !floatingObject->renderer().hasSelfPaintingLayer()
             && (floatingObject->shouldPaint() || (paintAllDescendants && floatingObject->renderer().isDescendantOf(this)))) {
             floatingObject->renderer().repaint();
@@ -2138,23 +2159,26 @@ void RenderBlockFlow::paintFloats(PaintInfo& paintInfo, const LayoutPoint& paint
     if (!m_floatingObjects)
         return;
 
-    for (auto& floatingObject : m_floatingObjects->set()) {
+    const FloatingObjectSet& floatingObjectSet = m_floatingObjects->set();
+    auto end = floatingObjectSet.end();
+    for (auto it = floatingObjectSet.begin(); it != end; ++it) {
+        FloatingObject* r = it->get();
         // Only paint the object if our m_shouldPaint flag is set.
-        if (floatingObject->shouldPaint() && !floatingObject->renderer().hasSelfPaintingLayer()) {
+        if (r->shouldPaint() && !r->renderer().hasSelfPaintingLayer()) {
             PaintInfo currentPaintInfo(paintInfo);
             currentPaintInfo.phase = preservePhase ? paintInfo.phase : PaintPhaseBlockBackground;
             // FIXME: LayoutPoint version of xPositionForFloatIncludingMargin would make this much cleaner.
-            LayoutPoint childPoint = flipFloatForWritingModeForChild(floatingObject.get(), LayoutPoint(paintOffset.x() + xPositionForFloatIncludingMargin(floatingObject.get()) - floatingObject->renderer().x(), paintOffset.y() + yPositionForFloatIncludingMargin(floatingObject.get()) - floatingObject->renderer().y()));
-            floatingObject->renderer().paint(currentPaintInfo, childPoint);
+            LayoutPoint childPoint = flipFloatForWritingModeForChild(r, LayoutPoint(paintOffset.x() + xPositionForFloatIncludingMargin(r) - r->renderer().x(), paintOffset.y() + yPositionForFloatIncludingMargin(r) - r->renderer().y()));
+            r->renderer().paint(currentPaintInfo, childPoint);
             if (!preservePhase) {
                 currentPaintInfo.phase = PaintPhaseChildBlockBackgrounds;
-                floatingObject->renderer().paint(currentPaintInfo, childPoint);
+                r->renderer().paint(currentPaintInfo, childPoint);
                 currentPaintInfo.phase = PaintPhaseFloat;
-                floatingObject->renderer().paint(currentPaintInfo, childPoint);
+                r->renderer().paint(currentPaintInfo, childPoint);
                 currentPaintInfo.phase = PaintPhaseForeground;
-                floatingObject->renderer().paint(currentPaintInfo, childPoint);
+                r->renderer().paint(currentPaintInfo, childPoint);
                 currentPaintInfo.phase = PaintPhaseOutline;
-                floatingObject->renderer().paint(currentPaintInfo, childPoint);
+                r->renderer().paint(currentPaintInfo, childPoint);
             }
         }
     }
@@ -2163,9 +2187,12 @@ void RenderBlockFlow::paintFloats(PaintInfo& paintInfo, const LayoutPoint& paint
 void RenderBlockFlow::clipOutFloatingObjects(RenderBlock& rootBlock, const PaintInfo* paintInfo, const LayoutPoint& rootBlockPhysicalPosition, const LayoutSize& offsetFromRootBlock)
 {
     if (m_floatingObjects) {
-        for (auto& floatingObject : m_floatingObjects->set()) {
-            LayoutRect floatBox(offsetFromRootBlock.width() + xPositionForFloatIncludingMargin(floatingObject.get()),
-                offsetFromRootBlock.height() + yPositionForFloatIncludingMargin(floatingObject.get()),
+        const FloatingObjectSet& floatingObjectSet = m_floatingObjects->set();
+        auto end = floatingObjectSet.end();
+        for (auto it = floatingObjectSet.begin(); it != end; ++it) {
+            FloatingObject* floatingObject = it->get();
+            LayoutRect floatBox(offsetFromRootBlock.width() + xPositionForFloatIncludingMargin(floatingObject),
+                offsetFromRootBlock.height() + yPositionForFloatIncludingMargin(floatingObject),
                 floatingObject->renderer().width(), floatingObject->renderer().height());
             rootBlock.flipForWritingMode(floatBox);
             floatBox.move(rootBlockPhysicalPosition.x(), rootBlockPhysicalPosition.y());
@@ -2563,9 +2590,12 @@ LayoutUnit RenderBlockFlow::lowestFloatLogicalBottom(FloatingObject::Type floatT
     if (!m_floatingObjects)
         return 0;
     LayoutUnit lowestFloatBottom = 0;
-    for (auto& floatingObject : m_floatingObjects->set()) {
+    const FloatingObjectSet& floatingObjectSet = m_floatingObjects->set();
+    auto end = floatingObjectSet.end();
+    for (auto it = floatingObjectSet.begin(); it != end; ++it) {
+        FloatingObject* floatingObject = it->get();
         if (floatingObject->isPlaced() && floatingObject->type() & floatType)
-            lowestFloatBottom = std::max(lowestFloatBottom, logicalBottomForFloat(floatingObject.get()));
+            lowestFloatBottom = std::max(lowestFloatBottom, logicalBottomForFloat(floatingObject));
     }
     return lowestFloatBottom;
 }
@@ -2575,9 +2605,12 @@ LayoutUnit RenderBlockFlow::lowestInitialLetterLogicalBottom() const
     if (!m_floatingObjects)
         return 0;
     LayoutUnit lowestFloatBottom = 0;
-    for (auto& floatingObject : m_floatingObjects->set()) {
+    const FloatingObjectSet& floatingObjectSet = m_floatingObjects->set();
+    auto end = floatingObjectSet.end();
+    for (auto it = floatingObjectSet.begin(); it != end; ++it) {
+        FloatingObject* floatingObject = it->get();
         if (floatingObject->isPlaced() && floatingObject->renderer().style().styleType() == FIRST_LETTER && floatingObject->renderer().style().initialLetterDrop() > 0)
-            lowestFloatBottom = std::max(lowestFloatBottom, logicalBottomForFloat(floatingObject.get()));
+            lowestFloatBottom = std::max(lowestFloatBottom, logicalBottomForFloat(floatingObject));
     }
     return lowestFloatBottom;
 }
@@ -2594,8 +2627,10 @@ LayoutUnit RenderBlockFlow::addOverhangingFloats(RenderBlockFlow& child, bool ma
 
     // Floats that will remain the child's responsibility to paint should factor into its
     // overflow.
-    for (auto& floatingObject : child.m_floatingObjects->set()) {
-        LayoutUnit floatLogicalBottom = std::min(logicalBottomForFloat(floatingObject.get()), LayoutUnit::max() - childLogicalTop);
+    auto childEnd = child.m_floatingObjects->set().end();
+    for (auto childIt = child.m_floatingObjects->set().begin(); childIt != childEnd; ++childIt) {
+        FloatingObject* floatingObject = childIt->get();
+        LayoutUnit floatLogicalBottom = std::min(logicalBottomForFloat(floatingObject), LayoutUnit::max() - childLogicalTop);
         LayoutUnit logicalBottom = childLogicalTop + floatLogicalBottom;
         lowestFloatLogicalBottom = std::max(lowestFloatLogicalBottom, logicalBottom);
 
@@ -2632,7 +2667,7 @@ LayoutUnit RenderBlockFlow::addOverhangingFloats(RenderBlockFlow& child, bool ma
             
             // Since the float doesn't overhang, it didn't get put into our list. We need to add its overflow in to the child now.
             if (floatingObject->isDescendant())
-                child.addOverflowFromChild(&floatingObject->renderer(), LayoutSize(xPositionForFloatIncludingMargin(floatingObject.get()), yPositionForFloatIncludingMargin(floatingObject.get())));
+                child.addOverflowFromChild(&floatingObject->renderer(), LayoutSize(xPositionForFloatIncludingMargin(floatingObject), yPositionForFloatIncludingMargin(floatingObject)));
         }
     }
     return lowestFloatLogicalBottom;
@@ -2665,8 +2700,11 @@ void RenderBlockFlow::addIntrudingFloats(RenderBlockFlow* prev, RenderBlockFlow*
 
     logicalLeftOffset += marginLogicalLeft();
 
-    for (auto& floatingObject : prev->m_floatingObjects->set()) {
-        if (logicalBottomForFloat(floatingObject.get()) > logicalTopOffset) {
+    const FloatingObjectSet& prevSet = prev->m_floatingObjects->set();
+    auto prevEnd = prevSet.end();
+    for (auto prevIt = prevSet.begin(); prevIt != prevEnd; ++prevIt) {
+        FloatingObject* floatingObject = prevIt->get();
+        if (logicalBottomForFloat(floatingObject) > logicalTopOffset) {
             if (!m_floatingObjects || !m_floatingObjects->set().contains<FloatingObject&, FloatingObjectHashTranslator>(*floatingObject)) {
                 // We create the floating object list lazily.
                 if (!m_floatingObjects)
@@ -2718,13 +2756,16 @@ void RenderBlockFlow::markSiblingsWithFloatsForLayout(RenderBox* floatToRemove)
     if (!m_floatingObjects)
         return;
 
+    const FloatingObjectSet& floatingObjectSet = m_floatingObjects->set();
+    auto end = floatingObjectSet.end();
+
     for (RenderObject* next = nextSibling(); next; next = next->nextSibling()) {
         if (!is<RenderBlockFlow>(*next) || next->isFloatingOrOutOfFlowPositioned())
             continue;
 
         RenderBlockFlow& nextBlock = downcast<RenderBlockFlow>(*next);
-        for (auto& floatingObject : m_floatingObjects->set()) {
-            RenderBox& floatingBox = floatingObject->renderer();
+        for (auto it = floatingObjectSet.begin(); it != end; ++it) {
+            RenderBox& floatingBox = (*it)->renderer();
             if (floatToRemove && &floatingBox != floatToRemove)
                 continue;
             if (nextBlock.containsFloat(floatingBox))
@@ -2887,11 +2928,14 @@ void RenderBlockFlow::adjustForBorderFit(LayoutUnit x, LayoutUnit& left, LayoutU
     }
 
     if (m_floatingObjects) {
-        for (auto& floatingObject : m_floatingObjects->set()) {
+        const FloatingObjectSet& floatingObjectSet = m_floatingObjects->set();
+        auto end = floatingObjectSet.end();
+        for (auto it = floatingObjectSet.begin(); it != end; ++it) {
+            FloatingObject* r = it->get();
             // Only examine the object if our m_shouldPaint flag is set.
-            if (floatingObject->shouldPaint()) {
-                LayoutUnit floatLeft = xPositionForFloatIncludingMargin(floatingObject.get()) - floatingObject->renderer().x();
-                LayoutUnit floatRight = floatLeft + floatingObject->renderer().width();
+            if (r->shouldPaint()) {
+                LayoutUnit floatLeft = xPositionForFloatIncludingMargin(r) - r->renderer().x();
+                LayoutUnit floatRight = floatLeft + r->renderer().width();
                 left = std::min(left, floatLeft);
                 right = std::max(right, floatRight);
             }
index c252e69..5ec0470 100644 (file)
@@ -512,8 +512,9 @@ static inline void setLogicalWidthForTextRun(RootInlineBox* lineBox, BidiRun* ru
             } else
                 measuredWidth += wordMeasurement.width;
             if (!wordMeasurement.fallbackFonts.isEmpty()) {
-                for (auto& font : wordMeasurement.fallbackFonts)
-                    fallbackFonts.add(font);
+                HashSet<const Font*>::const_iterator end = wordMeasurement.fallbackFonts.end();
+                for (HashSet<const Font*>::const_iterator it = wordMeasurement.fallbackFonts.begin(); it != end; ++it)
+                    fallbackFonts.add(*it);
             }
         }
         if (measuredWidth && lastEndOffset != run->m_stop) {
@@ -1335,8 +1336,8 @@ void RenderBlockFlow::layoutRunsAndFloatsInRange(LineLayoutState& layoutState, I
             }
         }
 
-        for (auto& positionedObject : lineBreaker.positionedObjects())
-            setStaticPositions(*this, *positionedObject);
+        for (size_t i = 0; i < lineBreaker.positionedObjects().size(); ++i)
+            setStaticPositions(*this, *lineBreaker.positionedObjects()[i]);
 
         if (!layoutState.lineInfo().isEmpty()) {
             layoutState.lineInfo().setFirstLine(false);
@@ -1453,7 +1454,8 @@ void RenderBlockFlow::linkToEndLineIfNeeded(LineLayoutState& layoutState)
                 if (layoutState.flowThread())
                     updateRegionForLine(line);
                 if (Vector<RenderBox*>* cleanLineFloats = line->floatsPtr()) {
-                    for (auto& floatingBox : *cleanLineFloats) {
+                    for (auto it = cleanLineFloats->begin(), end = cleanLineFloats->end(); it != end; ++it) {
+                        RenderBox* floatingBox = *it;
                         FloatingObject* floatingObject = insertFloatingObject(*floatingBox);
                         ASSERT(!floatingObject->originatingLine());
                         floatingObject->setOriginatingLine(line);
@@ -1510,12 +1512,13 @@ void RenderBlockFlow::linkToEndLineIfNeeded(LineLayoutState& layoutState)
 
 void RenderBlockFlow::repaintDirtyFloats(Vector<FloatWithRect>& floats)
 {
+    size_t floatCount = floats.size();
     // Floats that did not have layout did not repaint when we laid them out. They would have
     // painted by now if they had moved, but if they stayed at (0, 0), they still need to be
     // painted.
-    for (auto& floatWithRect : floats) {
-        if (!floatWithRect.everHadLayout) {
-            RenderBox& box = floatWithRect.object;
+    for (size_t i = 0; i < floatCount; ++i) {
+        if (!floats[i].everHadLayout) {
+            RenderBox& box = floats[i].object;
             if (!box.x() && !box.y() && box.checkForRepaintDuringLayout())
                 box.repaint();
         }
@@ -1603,8 +1606,8 @@ void RenderBlockFlow::layoutLineBoxes(bool relayoutChildren, LayoutUnit& repaint
             }
         }
 
-        for (auto& child : replacedChildren)
-            child->layoutIfNeeded();
+        for (size_t i = 0; i < replacedChildren.size(); i++)
+             replacedChildren[i]->layoutIfNeeded();
 
         layoutRunsAndFloats(layoutState, hasInlineChild);
     }
@@ -1642,7 +1645,8 @@ void RenderBlockFlow::checkFloatsInCleanLine(RootInlineBox* line, Vector<FloatWi
         return;
     }
 
-    for (auto& floatingBox : *cleanLineFloats) {
+    for (auto it = cleanLineFloats->begin(), end = cleanLineFloats->end(); it != end; ++it) {
+        RenderBox* floatingBox = *it;
         floatingBox->layoutIfNeeded();
         LayoutSize newSize(floatingBox->width() + floatingBox->horizontalMarginExtent(), floatingBox->height() + floatingBox->verticalMarginExtent());
         ASSERT_WITH_SECURITY_IMPLICATION(floatIndex < floats.size());
@@ -1743,7 +1747,8 @@ RootInlineBox* RenderBlockFlow::determineStartPosition(LineLayoutState& layoutSt
         RootInlineBox* line = firstRootBox();
         while (line != curr) {
             if (Vector<RenderBox*>* cleanLineFloats = line->floatsPtr()) {
-                for (auto& floatingBox : *cleanLineFloats) {
+                for (auto it = cleanLineFloats->begin(), end = cleanLineFloats->end(); it != end; ++it) {
+                    RenderBox* floatingBox = *it;
                     FloatingObject* floatingObject = insertFloatingObject(*floatingBox);
                     ASSERT(!floatingObject->originatingLine());
                     floatingObject->setOriginatingLine(line);
@@ -1850,8 +1855,11 @@ bool RenderBlockFlow::checkPaginationAndFloatsAtEndLine(LineLayoutState& layoutS
 
     LayoutUnit logicalBottom = lastLine->lineBottomWithLeading() + absoluteValue(lineDelta);
 
-    for (auto& floatingObject : m_floatingObjects->set()) {
-        if (logicalBottomForFloat(floatingObject.get()) >= logicalTop && logicalBottomForFloat(floatingObject.get()) < logicalBottom)
+    const FloatingObjectSet& floatingObjectSet = m_floatingObjects->set();
+    auto end = floatingObjectSet.end();
+    for (auto it = floatingObjectSet.begin(); it != end; ++it) {
+        FloatingObject* floatingObject = it->get();
+        if (logicalBottomForFloat(floatingObject) >= logicalTop && logicalBottomForFloat(floatingObject) < logicalBottom)
             return false;
     }
 
index 1412258..918a4f8 100644 (file)
@@ -455,8 +455,11 @@ void RenderCounter::destroyCounterNodes(RenderElement& owner)
     CounterMaps::iterator mapsIterator = maps.find(&owner);
     if (mapsIterator == maps.end())
         return;
-    for (auto& counter : *mapsIterator->value.get())
-        destroyCounterNodeWithoutMapRemoval(counter.key, counter.value.get());
+    CounterMap* map = mapsIterator->value.get();
+    CounterMap::const_iterator end = map->end();
+    for (CounterMap::const_iterator it = map->begin(); it != end; ++it) {
+        destroyCounterNodeWithoutMapRemoval(it->key, it->value.get());
+    }
     maps.remove(mapsIterator);
     owner.setHasCounterNodeMap(false);
 }
@@ -505,24 +508,25 @@ static void updateCounters(RenderElement& renderer)
     const CounterDirectiveMap* directiveMap = renderer.style().counterDirectives();
     if (!directiveMap)
         return;
+    CounterDirectiveMap::const_iterator end = directiveMap->end();
     if (!renderer.hasCounterNodeMap()) {
-        for (auto& key : directiveMap->keys())
-            makeCounterNode(renderer, key, false);
+        for (CounterDirectiveMap::const_iterator it = directiveMap->begin(); it != end; ++it)
+            makeCounterNode(renderer, it->key, false);
         return;
     }
     CounterMap* counterMap = counterMaps().get(&renderer);
     ASSERT(counterMap);
-    for (auto& key : directiveMap->keys()) {
-        RefPtr<CounterNode> node = counterMap->get(key);
+    for (CounterDirectiveMap::const_iterator it = directiveMap->begin(); it != end; ++it) {
+        RefPtr<CounterNode> node = counterMap->get(it->key);
         if (!node) {
-            makeCounterNode(renderer, key, false);
+            makeCounterNode(renderer, it->key, false);
             continue;
         }
         RefPtr<CounterNode> newParent = 0;
         RefPtr<CounterNode> newPreviousSibling = 0;
         
-        findPlaceForCounter(renderer, key, node->hasResetType(), newParent, newPreviousSibling);
-        if (node != counterMap->get(key))
+        findPlaceForCounter(renderer, it->key, node->hasResetType(), newParent, newPreviousSibling);
+        if (node != counterMap->get(it->key))
             continue;
         CounterNode* parent = node->parent();
         if (newParent == parent && newPreviousSibling == node->previousSibling())
@@ -530,7 +534,7 @@ static void updateCounters(RenderElement& renderer)
         if (parent)
             parent->removeChild(node.get());
         if (newParent)
-            newParent->insertAfter(node.get(), newPreviousSibling.get(), key);
+            newParent->insertAfter(node.get(), newPreviousSibling.get(), it->key);
     }
 }
 
@@ -560,33 +564,36 @@ void RenderCounter::rendererStyleChanged(RenderElement& renderer, const RenderSt
     const CounterDirectiveMap* oldCounterDirectives;
     if (oldStyle && (oldCounterDirectives = oldStyle->counterDirectives())) {
         if (newStyle && (newCounterDirectives = newStyle->counterDirectives())) {
-            for (auto& directive : *newCounterDirectives) {
-                auto oldMapIt = oldCounterDirectives->find(directive.key);
-                if (oldMapIt != oldCounterDirectives->end()) {
-                    if (oldMapIt->value == directive.value)
+            CounterDirectiveMap::const_iterator newMapEnd = newCounterDirectives->end();
+            CounterDirectiveMap::const_iterator oldMapEnd = oldCounterDirectives->end();
+            for (CounterDirectiveMap::const_iterator it = newCounterDirectives->begin(); it != newMapEnd; ++it) {
+                CounterDirectiveMap::const_iterator oldMapIt = oldCounterDirectives->find(it->key);
+                if (oldMapIt != oldMapEnd) {
+                    if (oldMapIt->value == it->value)
                         continue;
-                    RenderCounter::destroyCounterNode(renderer, directive.key);
+                    RenderCounter::destroyCounterNode(renderer, it->key);
                 }
                 // We must create this node here, because the changed node may be a node with no display such as
                 // as those created by the increment or reset directives and the re-layout that will happen will
                 // not catch the change if the node had no children.
-                makeCounterNode(renderer, directive.key, false);
+                makeCounterNode(renderer, it->key, false);
             }
             // Destroying old counters that do not exist in the new counterDirective map.
-            for (auto& key : oldCounterDirectives->keys()) {
-                if (!newCounterDirectives->contains(key))
-                    RenderCounter::destroyCounterNode(renderer, key);
+            for (CounterDirectiveMap::const_iterator it = oldCounterDirectives->begin(); it !=oldMapEnd; ++it) {
+                if (!newCounterDirectives->contains(it->key))
+                    RenderCounter::destroyCounterNode(renderer, it->key);
             }
         } else {
             if (renderer.hasCounterNodeMap())
                 RenderCounter::destroyCounterNodes(renderer);
         }
     } else if (newStyle && (newCounterDirectives = newStyle->counterDirectives())) {
-        for (auto& key : newCounterDirectives->keys()) {
+        CounterDirectiveMap::const_iterator newMapEnd = newCounterDirectives->end();
+        for (CounterDirectiveMap::const_iterator it = newCounterDirectives->begin(); it != newMapEnd; ++it) {
             // We must create this node here, because the added node may be a node with no display such as
             // as those created by the increment or reset directives and the re-layout that will happen will
             // not catch the change if the node had no children.
-            makeCounterNode(renderer, key, false);
+            makeCounterNode(renderer, it->key, false);
         }
     }
 }
index 5516052..0d5a036 100644 (file)
@@ -713,7 +713,8 @@ LayoutUnit RenderFlexibleBox::autoMarginOffsetInMainAxis(const OrderedFlexItemLi
 
     int numberOfAutoMargins = 0;
     bool isHorizontal = isHorizontalFlow();
-    for (auto& child : children) {
+    for (size_t i = 0; i < children.size(); ++i) {
+        RenderBox* child = children[i];
         if (child->isOutOfFlowPositioned())
             continue;
         if (isHorizontal) {
@@ -897,9 +898,9 @@ bool RenderFlexibleBox::computeNextFlexLine(OrderedFlexItemList& orderedChildren
 
 void RenderFlexibleBox::freezeViolations(const Vector<Violation>& violations, LayoutUnit& availableFreeSpace, double& totalFlexGrow, double& totalWeightedFlexShrink, InflexibleFlexItemSize& inflexibleItems, bool hasInfiniteLineLength)
 {
-    for (auto& violation : violations) {
-        RenderBox& child = violation.child;
-        LayoutUnit childSize = violation.childSize;
+    for (size_t i = 0; i < violations.size(); ++i) {
+        RenderBox& child = violations[i].child;
+        LayoutUnit childSize = violations[i].childSize;
         LayoutUnit preferredChildSize = preferredMainAxisContentExtentForChild(child, hasInfiniteLineLength);
         availableFreeSpace -= childSize - preferredChildSize;
         totalFlexGrow -= child.style().flexGrow();
@@ -916,34 +917,35 @@ bool RenderFlexibleBox::resolveFlexibleLengths(FlexSign flexSign, const OrderedF
     LayoutUnit usedFreeSpace = 0;
     Vector<Violation> minViolations;
     Vector<Violation> maxViolations;
-    for (auto& child : children) {
-        if (child->isOutOfFlowPositioned()) {
+    for (size_t i = 0; i < children.size(); ++i) {
+        RenderBox& child = *children[i];
+        if (child.isOutOfFlowPositioned()) {
             childSizes.append(0);
             continue;
         }
 
-        if (inflexibleItems.contains(child))
-            childSizes.append(inflexibleItems.get(child));
+        if (inflexibleItems.contains(&child))
+            childSizes.append(inflexibleItems.get(&child));
         else {
-            LayoutUnit preferredChildSize = preferredMainAxisContentExtentForChild(*child, hasInfiniteLineLength);
+            LayoutUnit preferredChildSize = preferredMainAxisContentExtentForChild(child, hasInfiniteLineLength);
             LayoutUnit childSize = preferredChildSize;
             double extraSpace = 0;
             if (availableFreeSpace > 0 && totalFlexGrow > 0 && flexSign == PositiveFlexibility && std::isfinite(totalFlexGrow))
-                extraSpace = availableFreeSpace * child->style().flexGrow() / totalFlexGrow;
+                extraSpace = availableFreeSpace * child.style().flexGrow() / totalFlexGrow;
             else if (availableFreeSpace < 0 && totalWeightedFlexShrink > 0 && flexSign == NegativeFlexibility && std::isfinite(totalWeightedFlexShrink))
-                extraSpace = availableFreeSpace * child->style().flexShrink() * preferredChildSize / totalWeightedFlexShrink;
+                extraSpace = availableFreeSpace * child.style().flexShrink() * preferredChildSize / totalWeightedFlexShrink;
             if (std::isfinite(extraSpace))
                 childSize += LayoutUnit::fromFloatRound(extraSpace);
 
-            LayoutUnit adjustedChildSize = adjustChildSizeForMinAndMax(*child, childSize);
+            LayoutUnit adjustedChildSize = adjustChildSizeForMinAndMax(child, childSize);
             childSizes.append(adjustedChildSize);
             usedFreeSpace += adjustedChildSize - preferredChildSize;
 
             LayoutUnit violation = adjustedChildSize - childSize;
             if (violation > 0)
-                minViolations.append(Violation(*child, adjustedChildSize));
+                minViolations.append(Violation(child, adjustedChildSize));
             else if (violation < 0)
-                maxViolations.append(Violation(*child, adjustedChildSize));
+                maxViolations.append(Violation(child, adjustedChildSize));
             totalViolation += violation;
         }
     }
@@ -1028,7 +1030,8 @@ ItemPosition RenderFlexibleBox::alignmentForChild(RenderBox& child) const
 size_t RenderFlexibleBox::numberOfInFlowPositionedChildren(const OrderedFlexItemList& children) const
 {
     size_t count = 0;
-    for (auto& child : children) {
+    for (size_t i = 0; i < children.size(); ++i) {
+        RenderBox* child = children[i];
         if (!child->isOutOfFlowPositioned())
             ++count;
     }
@@ -1152,16 +1155,17 @@ void RenderFlexibleBox::layoutColumnReverse(const OrderedFlexItemList& children,
     mainAxisOffset -= isHorizontalFlow() ? verticalScrollbarWidth() : horizontalScrollbarHeight();
 
     size_t seenInFlowPositionedChildren = 0;
-    for (auto& child : children) {
-        if (child->isOutOfFlowPositioned()) {
-            child->layer()->setStaticBlockPosition(mainAxisOffset);
+    for (size_t i = 0; i < children.size(); ++i) {
+        RenderBox& child = *children[i];
+        if (child.isOutOfFlowPositioned()) {
+            child.layer()->setStaticBlockPosition(mainAxisOffset);
             continue;
         }
-        mainAxisOffset -= mainAxisExtentForChild(*child) + flowAwareMarginEndForChild(*child);
+        mainAxisOffset -= mainAxisExtentForChild(child) + flowAwareMarginEndForChild(child);
 
-        setFlowAwareLocationForChild(*child, LayoutPoint(mainAxisOffset, crossAxisOffset + flowAwareMarginBeforeForChild(*child)));
+        setFlowAwareLocationForChild(child, LayoutPoint(mainAxisOffset, crossAxisOffset + flowAwareMarginBeforeForChild(child)));
 
-        mainAxisOffset -= flowAwareMarginStartForChild(*child);
+        mainAxisOffset -= flowAwareMarginStartForChild(child);
 
         ++seenInFlowPositionedChildren;
         if (seenInFlowPositionedChildren < numberOfChildrenForJustifyContent)
@@ -1205,18 +1209,18 @@ void RenderFlexibleBox::alignFlexLines(Vector<LineContext>& lineContexts)
         return;
 
     LayoutUnit availableCrossAxisSpace = crossAxisContentExtent();
-    for (auto& lineContext : lineContexts)
-        availableCrossAxisSpace -= lineContext.crossAxisExtent;
+    for (size_t i = 0; i < lineContexts.size(); ++i)
+        availableCrossAxisSpace -= lineContexts[i].crossAxisExtent;
 
     RenderBox* child = m_orderIterator.first();
     LayoutUnit lineOffset = initialAlignContentOffset(availableCrossAxisSpace, position, distribution, lineContexts.size());
-    for (auto& lineContext : lineContexts) {
-        lineContext.crossAxisOffset += lineOffset;
-        for (size_t childNumber = 0; childNumber < lineContext.numberOfChildren; ++childNumber, child = m_orderIterator.next())
+    for (unsigned lineNumber = 0; lineNumber < lineContexts.size(); ++lineNumber) {
+        lineContexts[lineNumber].crossAxisOffset += lineOffset;
+        for (size_t childNumber = 0; childNumber < lineContexts[lineNumber].numberOfChildren; ++childNumber, child = m_orderIterator.next())
             adjustAlignmentForChild(*child, lineOffset);
 
         if (distribution == ContentDistributionStretch && availableCrossAxisSpace > 0)
-            lineContext.crossAxisExtent += availableCrossAxisSpace / static_cast<unsigned>(lineContexts.size());
+            lineContexts[lineNumber].crossAxisExtent += availableCrossAxisSpace / static_cast<unsigned>(lineContexts.size());
 
         lineOffset += alignContentSpaceBetweenChildren(availableCrossAxisSpace, distribution, lineContexts.size());
     }
@@ -1243,12 +1247,12 @@ void RenderFlexibleBox::alignChildren(const Vector<LineContext>& lineContexts)
     Vector<LayoutUnit> minMarginAfterBaselines;
 
     RenderBox* child = m_orderIterator.first();
-    for (auto& lineContext : lineContexts) {
+    for (size_t lineNumber = 0; lineNumber < lineContexts.size(); ++lineNumber) {
         LayoutUnit minMarginAfterBaseline = LayoutUnit::max();
-        LayoutUnit lineCrossAxisExtent = lineContext.crossAxisExtent;
-        LayoutUnit maxAscent = lineContext.maxAscent;
+        LayoutUnit lineCrossAxisExtent = lineContexts[lineNumber].crossAxisExtent;
+        LayoutUnit maxAscent = lineContexts[lineNumber].maxAscent;
 
-        for (size_t childNumber = 0; childNumber < lineContext.numberOfChildren; ++childNumber, child = m_orderIterator.next()) {
+        for (size_t childNumber = 0; childNumber < lineContexts[lineNumber].numberOfChildren; ++childNumber, child = m_orderIterator.next()) {
             ASSERT(child);
             if (child->isOutOfFlowPositioned()) {
                 if (style().flexWrap() == FlexWrapReverse)
@@ -1376,11 +1380,11 @@ void RenderFlexibleBox::flipForWrapReverse(const Vector<LineContext>& lineContex
 {
     LayoutUnit contentExtent = crossAxisContentExtent();
     RenderBox* child = m_orderIterator.first();
-    for (auto& lineContext : lineContexts) {
-        for (size_t childNumber = 0; childNumber < lineContext.numberOfChildren; ++childNumber, child = m_orderIterator.next()) {
+    for (size_t lineNumber = 0; lineNumber < lineContexts.size(); ++lineNumber) {
+        for (size_t childNumber = 0; childNumber < lineContexts[lineNumber].numberOfChildren; ++childNumber, child = m_orderIterator.next()) {
             ASSERT(child);
-            LayoutUnit lineCrossAxisExtent = lineContext.crossAxisExtent;
-            LayoutUnit originalOffset = lineContext.crossAxisOffset - crossAxisStartEdge;
+            LayoutUnit lineCrossAxisExtent = lineContexts[lineNumber].crossAxisExtent;
+            LayoutUnit originalOffset = lineContexts[lineNumber].crossAxisOffset - crossAxisStartEdge;
             LayoutUnit newOffset = contentExtent - originalOffset - lineCrossAxisExtent;
             adjustAlignmentForChild(*child, newOffset - originalOffset);
         }
index decc487..c2a3d78 100644 (file)
@@ -299,8 +299,8 @@ bool RenderFlowThread::updateAllLayerToRegionMappings()
     RenderLayerList* lists[] = { layer()->negZOrderList(), layer()->normalFlowList(), layer()->posZOrderList() };
     for (size_t listIndex = 0; listIndex < sizeof(lists) / sizeof(lists[0]); ++listIndex) {
         if (RenderLayerList* list = lists[listIndex]) {
-            for (auto& layer : *list)
-                updateLayerToRegionMappings(*layer, layerToRegionMap, regionToLayerListMap, needsLayerUpdate);
+            for (size_t i = 0, listSize = list->size(); i < listSize; ++i)
+                updateLayerToRegionMappings(*list->at(i), layerToRegionMap, regionToLayerListMap, needsLayerUpdate);
         }
     }
 
index db0a690..66f2dc6 100644 (file)
@@ -1707,7 +1707,10 @@ void RenderInline::addAnnotatedRegions(Vector<AnnotatedRegionValue>& regions)
         return;
 
     const Vector<StyleDashboardRegion>& styleRegions = style().dashboardRegions();
-    for (auto& styleRegion : styleRegions) {
+    unsigned i, count = styleRegions.size();
+    for (i = 0; i < count; i++) {
+        StyleDashboardRegion styleRegion = styleRegions[i];
+
         LayoutRect linesBoundingBox = this->linesBoundingBox();
         LayoutUnit w = linesBoundingBox.width();
         LayoutUnit h = linesBoundingBox.height();
index 5175415..38f3b41 100644 (file)
@@ -729,8 +729,10 @@ void RenderLayer::updateDescendantsAreContiguousInStackingOrder()
     }
 
     if (posZOrderList) {
+        size_t listSize = posZOrderList->size();
         int stackingOrderIndex = 1;
-        for (auto& currentLayer : *posZOrderList) {
+        for (size_t i = 0; i < listSize; ++i) {
+            RenderLayer* currentLayer = posZOrderList->at(i);
             if (!currentLayer->isStackingContext())
                 continue;
             lookup.set(currentLayer, stackingOrderIndex++);
@@ -1184,8 +1186,9 @@ void RenderLayer::updateDescendantDependentFlags(HashSet<const RenderObject*>* o
                 childOutOfFlowDescendantContainingBlocks.add(child->renderer().containingBlock());
 
             if (outOfFlowDescendantContainingBlocks) {
-                for (auto& block : childOutOfFlowDescendantContainingBlocks)
-                    outOfFlowDescendantContainingBlocks->add(block);
+                HashSet<const RenderObject*>::const_iterator it = childOutOfFlowDescendantContainingBlocks.begin();
+                for (; it != childOutOfFlowDescendantContainingBlocks.end(); ++it)
+                    outOfFlowDescendantContainingBlocks->add(*it);
             }
 
             hasVisibleDescendant |= child->m_hasVisibleContent || child->m_hasVisibleDescendant;
index abb2cbb..377a083 100644 (file)
@@ -1898,7 +1898,9 @@ static bool descendantLayerPaintsIntoAncestor(RenderLayer& parent)
 #endif
 
     if (Vector<RenderLayer*>* normalFlowList = parent.normalFlowList()) {
-        for (auto& curLayer : *normalFlowList) {
+        size_t listSize = normalFlowList->size();
+        for (size_t i = 0; i < listSize; ++i) {
+            RenderLayer* curLayer = normalFlowList->at(i);
             if (!compositedWithOwnBackingStore(curLayer)
                 && (curLayer->isVisuallyNonEmpty() || descendantLayerPaintsIntoAncestor(*curLayer)))
                 return true;
@@ -1911,7 +1913,9 @@ static bool descendantLayerPaintsIntoAncestor(RenderLayer& parent)
 
         // Use the m_hasCompositingDescendant bit to optimize?
         if (Vector<RenderLayer*>* negZOrderList = parent.negZOrderList()) {
-            for (auto& curLayer : *negZOrderList) {
+            size_t listSize = negZOrderList->size();
+            for (size_t i = 0; i < listSize; ++i) {
+                RenderLayer* curLayer = negZOrderList->at(i);
                 if (!compositedWithOwnBackingStore(curLayer)
                     && (curLayer->isVisuallyNonEmpty() || descendantLayerPaintsIntoAncestor(*curLayer)))
                     return true;
@@ -1919,7 +1923,9 @@ static bool descendantLayerPaintsIntoAncestor(RenderLayer& parent)
         }
 
         if (Vector<RenderLayer*>* posZOrderList = parent.posZOrderList()) {
-            for (auto& curLayer : *posZOrderList) {
+            size_t listSize = posZOrderList->size();
+            for (size_t i = 0; i < listSize; ++i) {
+                RenderLayer* curLayer = posZOrderList->at(i);
                 if (!compositedWithOwnBackingStore(curLayer)
                     && (curLayer->isVisuallyNonEmpty() || descendantLayerPaintsIntoAncestor(*curLayer)))
                     return true;
@@ -2496,7 +2502,9 @@ bool RenderLayerBacking::startAnimation(double timeOffset, const Animation* anim
     KeyframeValueList backdropFilterVector(AnimatedPropertyWebkitBackdropFilter);
 #endif
 
-    for (auto& currentKeyframe : keyframes.keyframes()) {
+    size_t numKeyframes = keyframes.size();
+    for (size_t i = 0; i < numKeyframes; ++i) {
+        const KeyframeValue& currentKeyframe = keyframes[i];
         const RenderStyle* keyframeStyle = currentKeyframe.style();
         double key = currentKeyframe.key();
 
index c079921..e1cfca5 100644 (file)
@@ -267,8 +267,11 @@ void RenderLineBoxList::paint(RenderBoxModelObject* renderer, PaintInfo& paintIn
     }
 
     if (info.phase == PaintPhaseOutline || info.phase == PaintPhaseSelfOutline || info.phase == PaintPhaseChildOutlines) {
-        for (auto& flow : *info.outlineObjects)
+        ListHashSet<RenderInline*>::iterator end = info.outlineObjects->end();
+        for (ListHashSet<RenderInline*>::iterator it = info.outlineObjects->begin(); it != end; ++it) {
+            RenderInline* flow = *it;
             flow->paintOutline(info, paintOffset);
+        }
         info.outlineObjects->clear();
     }
 }
index 4b0cfa6..916c2de 100644 (file)
@@ -107,8 +107,12 @@ HTMLSelectElement& RenderListBox::selectElement() const
 void RenderListBox::updateFromElement()
 {
     if (m_optionsChanged) {
+        const Vector<HTMLElement*>& listItems = selectElement().listItems();
+        int size = numItems();
+        
         float width = 0;
-        for (auto& element : selectElement().listItems()) {
+        for (int i = 0; i < size; ++i) {
+            HTMLElement* element = listItems[i];
             String text;
             FontCascade itemFont = style().fontCascade();
             if (is<HTMLOptionElement>(*element))
index a29989e..ff9a2c5 100644 (file)
@@ -58,9 +58,12 @@ using namespace HTMLNames;
 #if PLATFORM(IOS)
 static size_t selectedOptionCount(const RenderMenuList& renderMenuList)
 {
+    const Vector<HTMLElement*>& listItems = renderMenuList.selectElement().listItems();
+    size_t numberOfItems = listItems.size();
+
     size_t count = 0;
-    for (auto& element : renderMenuList.selectElement().listItems()) {
-        if (is<HTMLOptionElement>(*element) && downcast<HTMLOptionElement>(*element).selected())
+    for (size_t i = 0; i < numberOfItems; ++i) {
+        if (is<HTMLOptionElement>(*listItems[i]) && downcast<HTMLOptionElement>(*listItems[i]).selected())
             ++count;
     }
     return count;
@@ -203,7 +206,11 @@ void RenderMenuList::styleDidChange(StyleDifference diff, const RenderStyle* old
 void RenderMenuList::updateOptionsWidth()
 {
     float maxOptionWidth = 0;
-    for (auto& element : selectElement().listItems()) {
+    const Vector<HTMLElement*>& listItems = selectElement().listItems();
+    int size = listItems.size();    
+
+    for (int i = 0; i < size; ++i) {
+        HTMLElement* element = listItems[i];
         if (!is<HTMLOptionElement>(*element))
             continue;
 
index 91d299a..821e4b9 100644 (file)
@@ -198,8 +198,8 @@ void RenderMultiColumnSet::distributeImplicitBreaks()
 {
 #ifndef NDEBUG
     // There should be no implicit breaks assumed at this point.
-    for (auto& forcedBreak : m_contentRuns)
-        ASSERT(!forcedBreak.assumedImplicitBreaks());
+    for (unsigned i = 0; i < forcedBreaksCount(); i++)
+        ASSERT(!m_contentRuns[i].assumedImplicitBreaks());
 #endif // NDEBUG
 
     // Insert a final content run to encompass all content. This will include overflow if this is