[CSSRegions] Use auto keyword to clean-up for loops
authormihnea@adobe.com <mihnea@adobe.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 4 Nov 2013 08:28:03 +0000 (08:28 +0000)
committermihnea@adobe.com <mihnea@adobe.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 4 Nov 2013 08:28:03 +0000 (08:28 +0000)
https://bugs.webkit.org/show_bug.cgi?id=123699

Reviewed by Anders Carlsson.

Start using auto keyword for loops.
Also, since region breaks (forced breaks) can be added only on boxes,
i changed RenderFlowThread::addForcedRegionBreak to use a RenderBox* instead of RenderObject*.

No change in functionality, no new tests.

* dom/WebKitNamedFlow.cpp:
(WebCore::WebKitNamedFlow::firstEmptyRegionIndex):
* rendering/FlowThreadController.cpp:
(WebCore::FlowThreadController::ensureRenderFlowThreadWithName):
(WebCore::FlowThreadController::styleDidChange):
(WebCore::FlowThreadController::layoutRenderNamedFlowThreads):
(WebCore::FlowThreadController::updateFlowThreadsChainIfNecessary):
(WebCore::FlowThreadController::updateFlowThreadsNeedingLayout):
(WebCore::FlowThreadController::updateFlowThreadsNeedingTwoStepLayout):
(WebCore::FlowThreadController::resetFlowThreadsWithAutoHeightRegions):
(WebCore::FlowThreadController::updateFlowThreadsIntoConstrainedPhase):
(WebCore::FlowThreadController::updateFlowThreadsIntoOverflowPhase):
(WebCore::FlowThreadController::updateFlowThreadsIntoMeasureContentPhase):
(WebCore::FlowThreadController::updateFlowThreadsIntoFinalPhase):
(WebCore::FlowThreadController::updateRenderFlowThreadLayersIfNeeded):
(WebCore::FlowThreadController::collectFixedPositionedLayers):
(WebCore::FlowThreadController::isAutoLogicalHeightRegionsCountConsistent):
* rendering/RenderFlowThread.cpp:
(WebCore::RenderFlowThread::validateRegions):
(WebCore::RenderFlowThread::hasCompositingRegionDescendant):
(WebCore::RenderFlowThread::getLayerListForRegion):
(WebCore::RenderFlowThread::updateLayerToRegionMappings):
(WebCore::RenderFlowThread::updateLogicalWidth):
(WebCore::RenderFlowThread::computeLogicalHeight):
(WebCore::RenderFlowThread::repaintRectangleInRegions):
(WebCore::RenderFlowThread::removeRenderBoxRegionInfo):
(WebCore::RenderFlowThread::logicalWidthChangedInRegionsForBlock):
(WebCore::RenderFlowThread::clearRenderObjectCustomStyle):
(WebCore::RenderFlowThread::clearRenderBoxRegionInfoAndCustomStyle):
(WebCore::RenderFlowThread::setRegionRangeForBox):
(WebCore::RenderFlowThread::getRegionRangeForBox):
(WebCore::RenderFlowThread::regionInRange):
(WebCore::RenderFlowThread::checkRegionsWithStyling):
(WebCore::RenderFlowThread::objectInFlowRegion):
(WebCore::RenderFlowThread::isAutoLogicalHeightRegionsCountConsistent):
(WebCore::RenderFlowThread::initializeRegionsComputedAutoHeight):
(WebCore::RenderFlowThread::markAutoLogicalHeightRegionsForLayout):
(WebCore::RenderFlowThread::markRegionsForOverflowLayoutIfNeeded):
(WebCore::RenderFlowThread::updateRegionsFlowThreadPortionRect):
(WebCore::RenderFlowThread::addForcedRegionBreak):
(WebCore::RenderFlowThread::collectLayerFragments):
(WebCore::RenderFlowThread::fragmentsBoundingBox):
(WebCore::RenderFlowThread::addRegionsVisualEffectOverflow):
(WebCore::RenderFlowThread::addRegionsVisualOverflowFromTheme):
(WebCore::RenderFlowThread::addRegionsOverflowFromChild):
(WebCore::RenderFlowThread::addRegionsLayoutOverflow):
(WebCore::RenderFlowThread::clearRegionsOverflow):
* rendering/RenderFlowThread.h:
* rendering/RenderNamedFlowThread.cpp:
(WebCore::RenderNamedFlowThread::nextRendererForNode):
(WebCore::RenderNamedFlowThread::previousRendererForNode):
(WebCore::RenderNamedFlowThread::dependsOn):
(WebCore::addRegionToList):
(WebCore::RenderNamedFlowThread::computeOversetStateForRegions):
(WebCore::RenderNamedFlowThread::checkInvalidRegions):
(WebCore::RenderNamedFlowThread::pushDependencies):
* rendering/RenderRegion.cpp:
(WebCore::RenderRegion::setRegionObjectsRegionStyle):
(WebCore::RenderRegion::restoreRegionObjectsOriginalStyle):
(WebCore::RenderRegion::computeChildrenStyleInRegion):

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

Source/WebCore/ChangeLog
Source/WebCore/dom/WebKitNamedFlow.cpp
Source/WebCore/rendering/FlowThreadController.cpp
Source/WebCore/rendering/RenderFlowThread.cpp
Source/WebCore/rendering/RenderFlowThread.h
Source/WebCore/rendering/RenderNamedFlowThread.cpp
Source/WebCore/rendering/RenderRegion.cpp

index bc3d6e8..0ac0c6b 100644 (file)
@@ -1,3 +1,77 @@
+2013-11-04  Mihnea Ovidenie  <mihnea@adobe.com>
+
+        [CSSRegions] Use auto keyword to clean-up for loops
+        https://bugs.webkit.org/show_bug.cgi?id=123699
+
+        Reviewed by Anders Carlsson.
+
+        Start using auto keyword for loops.
+        Also, since region breaks (forced breaks) can be added only on boxes,
+        i changed RenderFlowThread::addForcedRegionBreak to use a RenderBox* instead of RenderObject*.
+
+        No change in functionality, no new tests.
+
+        * dom/WebKitNamedFlow.cpp:
+        (WebCore::WebKitNamedFlow::firstEmptyRegionIndex):
+        * rendering/FlowThreadController.cpp:
+        (WebCore::FlowThreadController::ensureRenderFlowThreadWithName):
+        (WebCore::FlowThreadController::styleDidChange):
+        (WebCore::FlowThreadController::layoutRenderNamedFlowThreads):
+        (WebCore::FlowThreadController::updateFlowThreadsChainIfNecessary):
+        (WebCore::FlowThreadController::updateFlowThreadsNeedingLayout):
+        (WebCore::FlowThreadController::updateFlowThreadsNeedingTwoStepLayout):
+        (WebCore::FlowThreadController::resetFlowThreadsWithAutoHeightRegions):
+        (WebCore::FlowThreadController::updateFlowThreadsIntoConstrainedPhase):
+        (WebCore::FlowThreadController::updateFlowThreadsIntoOverflowPhase):
+        (WebCore::FlowThreadController::updateFlowThreadsIntoMeasureContentPhase):
+        (WebCore::FlowThreadController::updateFlowThreadsIntoFinalPhase):
+        (WebCore::FlowThreadController::updateRenderFlowThreadLayersIfNeeded):
+        (WebCore::FlowThreadController::collectFixedPositionedLayers):
+        (WebCore::FlowThreadController::isAutoLogicalHeightRegionsCountConsistent):
+        * rendering/RenderFlowThread.cpp:
+        (WebCore::RenderFlowThread::validateRegions):
+        (WebCore::RenderFlowThread::hasCompositingRegionDescendant):
+        (WebCore::RenderFlowThread::getLayerListForRegion):
+        (WebCore::RenderFlowThread::updateLayerToRegionMappings):
+        (WebCore::RenderFlowThread::updateLogicalWidth):
+        (WebCore::RenderFlowThread::computeLogicalHeight):
+        (WebCore::RenderFlowThread::repaintRectangleInRegions):
+        (WebCore::RenderFlowThread::removeRenderBoxRegionInfo):
+        (WebCore::RenderFlowThread::logicalWidthChangedInRegionsForBlock):
+        (WebCore::RenderFlowThread::clearRenderObjectCustomStyle):
+        (WebCore::RenderFlowThread::clearRenderBoxRegionInfoAndCustomStyle):
+        (WebCore::RenderFlowThread::setRegionRangeForBox):
+        (WebCore::RenderFlowThread::getRegionRangeForBox):
+        (WebCore::RenderFlowThread::regionInRange):
+        (WebCore::RenderFlowThread::checkRegionsWithStyling):
+        (WebCore::RenderFlowThread::objectInFlowRegion):
+        (WebCore::RenderFlowThread::isAutoLogicalHeightRegionsCountConsistent):
+        (WebCore::RenderFlowThread::initializeRegionsComputedAutoHeight):
+        (WebCore::RenderFlowThread::markAutoLogicalHeightRegionsForLayout):
+        (WebCore::RenderFlowThread::markRegionsForOverflowLayoutIfNeeded):
+        (WebCore::RenderFlowThread::updateRegionsFlowThreadPortionRect):
+        (WebCore::RenderFlowThread::addForcedRegionBreak):
+        (WebCore::RenderFlowThread::collectLayerFragments):
+        (WebCore::RenderFlowThread::fragmentsBoundingBox):
+        (WebCore::RenderFlowThread::addRegionsVisualEffectOverflow):
+        (WebCore::RenderFlowThread::addRegionsVisualOverflowFromTheme):
+        (WebCore::RenderFlowThread::addRegionsOverflowFromChild):
+        (WebCore::RenderFlowThread::addRegionsLayoutOverflow):
+        (WebCore::RenderFlowThread::clearRegionsOverflow):
+        * rendering/RenderFlowThread.h:
+        * rendering/RenderNamedFlowThread.cpp:
+        (WebCore::RenderNamedFlowThread::nextRendererForNode):
+        (WebCore::RenderNamedFlowThread::previousRendererForNode):
+        (WebCore::RenderNamedFlowThread::dependsOn):
+        (WebCore::addRegionToList):
+        (WebCore::RenderNamedFlowThread::computeOversetStateForRegions):
+        (WebCore::RenderNamedFlowThread::checkInvalidRegions):
+        (WebCore::RenderNamedFlowThread::pushDependencies):
+        * rendering/RenderRegion.cpp:
+        (WebCore::RenderRegion::setRegionObjectsRegionStyle):
+        (WebCore::RenderRegion::restoreRegionObjectsOriginalStyle):
+        (WebCore::RenderRegion::computeChildrenStyleInRegion):
+
 2013-11-03  Zan Dobersek  <zdobersek@igalia.com>
 
         PingLoader objects unnecessarily pass through OwnPtr
index 29e8ae6..141d6f0 100644 (file)
@@ -101,7 +101,7 @@ int WebKitNamedFlow::firstEmptyRegionIndex() const
         return -1;
 
     int countNonPseudoRegions = -1;
-    RenderRegionList::const_iterator iter = regionList.begin();
+    auto iter = regionList.begin();
     for (int index = 0; iter != regionList.end(); ++index, ++iter) {
         // FIXME: Pseudo-elements are not included in the list.
         // They will be included when we will properly support the Region interface
index e8101ae..758ec2d 100644 (file)
@@ -63,7 +63,7 @@ RenderNamedFlowThread& FlowThreadController::ensureRenderFlowThreadWithName(cons
     if (!m_renderNamedFlowThreadList)
         m_renderNamedFlowThreadList = adoptPtr(new RenderNamedFlowThreadList());
     else {
-        for (RenderNamedFlowThreadList::iterator iter = m_renderNamedFlowThreadList->begin(); iter != m_renderNamedFlowThreadList->end(); ++iter) {
+        for (auto iter = m_renderNamedFlowThreadList->begin(), end = m_renderNamedFlowThreadList->end(); iter != end; ++iter) {
             RenderNamedFlowThread* flowRenderer = *iter;
             if (flowRenderer->flowThreadName() == name)
                 return *flowRenderer;
@@ -90,7 +90,7 @@ RenderNamedFlowThread& FlowThreadController::ensureRenderFlowThreadWithName(cons
 void FlowThreadController::styleDidChange()
 {
     RenderStyle& viewStyle = m_view->style();
-    for (RenderNamedFlowThreadList::iterator iter = m_renderNamedFlowThreadList->begin(); iter != m_renderNamedFlowThreadList->end(); ++iter) {
+    for (auto iter = m_renderNamedFlowThreadList->begin(), end = m_renderNamedFlowThreadList->end(); iter != end; ++iter) {
         RenderNamedFlowThread* flowRenderer = *iter;
         flowRenderer->setStyle(RenderFlowThread::createFlowThreadStyle(&viewStyle));
     }
@@ -100,7 +100,7 @@ void FlowThreadController::layoutRenderNamedFlowThreads()
 {
     updateFlowThreadsChainIfNecessary();
 
-    for (RenderNamedFlowThreadList::iterator iter = m_renderNamedFlowThreadList->begin(); iter != m_renderNamedFlowThreadList->end(); ++iter) {
+    for (auto iter = m_renderNamedFlowThreadList->begin(), end = m_renderNamedFlowThreadList->end(); iter != end; ++iter) {
         RenderNamedFlowThread* flowRenderer = *iter;
         flowRenderer->layoutIfNeeded();
     }
@@ -131,7 +131,7 @@ void FlowThreadController::updateFlowThreadsChainIfNecessary()
 
     // Remove the left-over flow threads.
     RenderNamedFlowThreadList toRemoveList;
-    for (RenderNamedFlowThreadList::iterator iter = m_renderNamedFlowThreadList->begin(); iter != m_renderNamedFlowThreadList->end(); ++iter) {
+    for (auto iter = m_renderNamedFlowThreadList->begin(), end = m_renderNamedFlowThreadList->end(); iter != end; ++iter) {
         RenderNamedFlowThread* flowRenderer = *iter;
         if (flowRenderer->isMarkedForDestruction())
             toRemoveList.add(flowRenderer);
@@ -140,7 +140,7 @@ void FlowThreadController::updateFlowThreadsChainIfNecessary()
     if (toRemoveList.size() > 0)
         setIsRenderNamedFlowThreadOrderDirty(true);
 
-    for (RenderNamedFlowThreadList::iterator iter = toRemoveList.begin(); iter != toRemoveList.end(); ++iter) {
+    for (auto iter = toRemoveList.begin(), end = toRemoveList.end(); iter != end; ++iter) {
         RenderNamedFlowThread* flowRenderer = *iter;
         m_renderNamedFlowThreadList->remove(flowRenderer);
         flowRenderer->destroy();
@@ -149,7 +149,7 @@ void FlowThreadController::updateFlowThreadsChainIfNecessary()
     if (isRenderNamedFlowThreadOrderDirty()) {
         // Arrange the thread list according to dependencies.
         RenderNamedFlowThreadList sortedList;
-        for (RenderNamedFlowThreadList::iterator iter = m_renderNamedFlowThreadList->begin(); iter != m_renderNamedFlowThreadList->end(); ++iter) {
+        for (auto iter = m_renderNamedFlowThreadList->begin(), end = m_renderNamedFlowThreadList->end(); iter != end; ++iter) {
             RenderNamedFlowThread* flowRenderer = *iter;
             if (sortedList.contains(flowRenderer))
                 continue;
@@ -165,7 +165,7 @@ bool FlowThreadController::updateFlowThreadsNeedingLayout()
 {
     bool needsTwoPassLayout = false;
 
-    for (RenderNamedFlowThreadList::iterator iter = m_renderNamedFlowThreadList->begin(); iter != m_renderNamedFlowThreadList->end(); ++iter) {
+    for (auto iter = m_renderNamedFlowThreadList->begin(), end = m_renderNamedFlowThreadList->end(); iter != end; ++iter) {
         RenderNamedFlowThread* flowRenderer = *iter;
         ASSERT(!flowRenderer->needsTwoPhasesLayout());
         ASSERT(flowRenderer->inMeasureContentLayoutPhase());
@@ -183,7 +183,7 @@ bool FlowThreadController::updateFlowThreadsNeedingTwoStepLayout()
 {
     bool needsTwoPassLayout = false;
 
-    for (RenderNamedFlowThreadList::iterator iter = m_renderNamedFlowThreadList->begin(); iter != m_renderNamedFlowThreadList->end(); ++iter) {
+    for (auto iter = m_renderNamedFlowThreadList->begin(), end = m_renderNamedFlowThreadList->end(); iter != end; ++iter) {
         RenderNamedFlowThread* flowRenderer = *iter;
         if (flowRenderer->needsTwoPhasesLayout()) {
             needsTwoPassLayout = true;
@@ -199,7 +199,7 @@ bool FlowThreadController::updateFlowThreadsNeedingTwoStepLayout()
 
 void FlowThreadController::resetFlowThreadsWithAutoHeightRegions()
 {
-    for (RenderNamedFlowThreadList::iterator iter = m_renderNamedFlowThreadList->begin(); iter != m_renderNamedFlowThreadList->end(); ++iter) {
+    for (auto iter = m_renderNamedFlowThreadList->begin(), end = m_renderNamedFlowThreadList->end(); iter != end; ++iter) {
         RenderNamedFlowThread* flowRenderer = *iter;
         if (flowRenderer->hasAutoLogicalHeightRegions()) {
             flowRenderer->markAutoLogicalHeightRegionsForLayout();
@@ -212,7 +212,7 @@ void FlowThreadController::updateFlowThreadsIntoConstrainedPhase()
 {
     // Walk the flow chain in reverse order to update the auto-height regions and compute correct sizes for the containing regions. Only after this we can
     // set the flow in the constrained layout phase.
-    for (RenderNamedFlowThreadList::reverse_iterator iter = m_renderNamedFlowThreadList->rbegin(); iter != m_renderNamedFlowThreadList->rend(); ++iter) {
+    for (auto iter = m_renderNamedFlowThreadList->rbegin(), end = m_renderNamedFlowThreadList->rend(); iter != end; ++iter) {
         RenderNamedFlowThread* flowRenderer = *iter;
         ASSERT(!flowRenderer->hasRegions() || flowRenderer->hasValidRegionInfo());
         flowRenderer->layoutIfNeeded();
@@ -227,7 +227,7 @@ void FlowThreadController::updateFlowThreadsIntoConstrainedPhase()
 
 void FlowThreadController::updateFlowThreadsIntoOverflowPhase()
 {
-    for (RenderNamedFlowThreadList::reverse_iterator iter = m_renderNamedFlowThreadList->rbegin(); iter != m_renderNamedFlowThreadList->rend(); ++iter) {
+    for (auto iter = m_renderNamedFlowThreadList->rbegin(), end = m_renderNamedFlowThreadList->rend(); iter != end; ++iter) {
         RenderNamedFlowThread* flowRenderer = *iter;
         ASSERT(!flowRenderer->hasRegions() || flowRenderer->hasValidRegionInfo());
         ASSERT(!flowRenderer->needsTwoPhasesLayout());
@@ -243,7 +243,7 @@ void FlowThreadController::updateFlowThreadsIntoOverflowPhase()
 
 void FlowThreadController::updateFlowThreadsIntoMeasureContentPhase()
 {
-    for (RenderNamedFlowThreadList::iterator iter = m_renderNamedFlowThreadList->begin(); iter != m_renderNamedFlowThreadList->end(); ++iter) {
+    for (auto iter = m_renderNamedFlowThreadList->begin(), end = m_renderNamedFlowThreadList->end(); iter != end; ++iter) {
         RenderNamedFlowThread* flowRenderer = *iter;
         ASSERT(flowRenderer->inFinalLayoutPhase());
 
@@ -253,7 +253,7 @@ void FlowThreadController::updateFlowThreadsIntoMeasureContentPhase()
 
 void FlowThreadController::updateFlowThreadsIntoFinalPhase()
 {
-    for (RenderNamedFlowThreadList::reverse_iterator iter = m_renderNamedFlowThreadList->rbegin(); iter != m_renderNamedFlowThreadList->rend(); ++iter) {
+    for (auto iter = m_renderNamedFlowThreadList->rbegin(), end = m_renderNamedFlowThreadList->rend(); iter != end; ++iter) {
         RenderNamedFlowThread* flowRenderer = *iter;
         flowRenderer->layoutIfNeeded();
         if (flowRenderer->needsTwoPhasesLayout()) {
@@ -268,7 +268,7 @@ void FlowThreadController::updateFlowThreadsIntoFinalPhase()
 void FlowThreadController::updateRenderFlowThreadLayersIfNeeded()
 {
     // Walk the flow chain in reverse order because RenderRegions might become RenderLayers for the following flow threads.
-    for (RenderNamedFlowThreadList::reverse_iterator iter = m_renderNamedFlowThreadList->rbegin(); iter != m_renderNamedFlowThreadList->rend(); ++iter) {
+    for (auto iter = m_renderNamedFlowThreadList->rbegin(), end = m_renderNamedFlowThreadList->rend(); iter != end; ++iter) {
         RenderNamedFlowThread* flowRenderer = *iter;
         flowRenderer->updateAllLayerToRegionMappingsIfNeeded();
     }
@@ -284,7 +284,7 @@ bool FlowThreadController::isContentElementRegisteredWithAnyNamedFlow(const Elem
 // These layers are painted and hit-tested starting from RenderView not from regions.
 void FlowThreadController::collectFixedPositionedLayers(Vector<RenderLayer*>& fixedPosLayers) const
 {
-    for (RenderNamedFlowThreadList::const_iterator iter = m_renderNamedFlowThreadList->begin(); iter != m_renderNamedFlowThreadList->end(); ++iter) {
+    for (auto iter = m_renderNamedFlowThreadList->begin(), end = m_renderNamedFlowThreadList->end(); iter != end; ++iter) {
         RenderNamedFlowThread* flowRenderer = *iter;
 
         // If the named flow does not have any regions attached, a fixed element should not be
@@ -295,8 +295,7 @@ void FlowThreadController::collectFixedPositionedLayers(Vector<RenderLayer*>& fi
         // Iterate over the fixed positioned elements in the flow thread
         TrackedRendererListHashSet* positionedDescendants = flowRenderer->positionedObjects();
         if (positionedDescendants) {
-            TrackedRendererListHashSet::iterator end = positionedDescendants->end();
-            for (TrackedRendererListHashSet::iterator it = positionedDescendants->begin(); it != end; ++it) {
+            for (auto it = positionedDescendants->begin(), end = positionedDescendants->end(); it != end; ++it) {
                 RenderBox* box = *it;
                 if (!box->fixedPositionedWithNamedFlowContainingBlock())
                     continue;
@@ -312,7 +311,7 @@ bool FlowThreadController::isAutoLogicalHeightRegionsCountConsistent() const
     if (!hasRenderNamedFlowThreads())
         return !hasFlowThreadsWithAutoLogicalHeightRegions();
 
-    for (RenderNamedFlowThreadList::iterator iter = m_renderNamedFlowThreadList->begin(); iter != m_renderNamedFlowThreadList->end(); ++iter) {
+    for (auto iter = m_renderNamedFlowThreadList->begin(), end = m_renderNamedFlowThreadList->end(); iter != end; ++iter) {
         if (!(*iter)->isAutoLogicalHeightRegionsCountConsistent())
             return false;
     }
index e057e64..cbb8f16 100644 (file)
@@ -164,7 +164,7 @@ void RenderFlowThread::validateRegions()
             LayoutUnit previousRegionLogicalHeight = 0;
             bool firstRegionVisited = false;
             
-            for (RenderRegionList::iterator iter = m_regionList.begin(); iter != m_regionList.end(); ++iter) {
+            for (auto iter = m_regionList.begin(), end = m_regionList.end(); iter != end; ++iter) {
                 RenderRegion* region = *iter;
                 ASSERT(!region->needsLayout() || region->isRenderRegionSet());
 
@@ -253,7 +253,7 @@ void RenderFlowThread::layout()
 #if USE(ACCELERATED_COMPOSITING)
 bool RenderFlowThread::hasCompositingRegionDescendant() const
 {
-    for (RenderRegionList::const_iterator iter = m_regionList.begin(); iter != m_regionList.end(); ++iter)
+    for (auto iter = m_regionList.begin(), end = m_regionList.end(); iter != end; ++iter)
         if (RenderLayerModelObject* layerOwner = toRenderNamedFlowFragment(*iter)->layerOwner())
             if (layerOwner->hasLayer() && layerOwner->layer()->hasCompositingDescendant())
                 return true;
@@ -266,7 +266,7 @@ const RenderLayerList* RenderFlowThread::getLayerListForRegion(RenderNamedFlowFr
     if (!m_regionToLayerListMap)
         return 0;
     updateAllLayerToRegionMappingsIfNeeded();
-    RegionToLayerListMap::const_iterator iterator = m_regionToLayerListMap->find(region);
+    auto iterator = m_regionToLayerListMap->find(region);
     return iterator == m_regionToLayerListMap->end() ? 0 : &iterator->value;
 }
 
@@ -309,7 +309,7 @@ void RenderFlowThread::updateLayerToRegionMappings(RenderLayer& layer, LayerToRe
 
     layerToRegionMap.set(&layer, region);
 
-    RegionToLayerListMap::iterator iterator = regionToLayerListMap.find(region);
+    auto iterator = regionToLayerListMap.find(region);
     RenderLayerList& list = iterator == regionToLayerListMap.end() ? regionToLayerListMap.set(region, RenderLayerList()).iterator->value : iterator->value;
     ASSERT(!list.contains(&layer));
     list.append(&layer);
@@ -365,7 +365,7 @@ bool RenderFlowThread::collectsGraphicsLayersUnderRegions() const
 void RenderFlowThread::updateLogicalWidth()
 {
     LayoutUnit logicalWidth = initialLogicalWidth();
-    for (RenderRegionList::iterator iter = m_regionList.begin(); iter != m_regionList.end(); ++iter) {
+    for (auto iter = m_regionList.begin(), end = m_regionList.end(); iter != end; ++iter) {
         RenderRegion* region = *iter;
         ASSERT(!region->needsLayout() || region->isRenderRegionSet());
         logicalWidth = std::max(region->pageLogicalWidth(), logicalWidth);
@@ -373,7 +373,7 @@ void RenderFlowThread::updateLogicalWidth()
     setLogicalWidth(logicalWidth);
 
     // If the regions have non-uniform logical widths, then insert inset information for the RenderFlowThread.
-    for (RenderRegionList::iterator iter = m_regionList.begin(); iter != m_regionList.end(); ++iter) {
+    for (auto iter = m_regionList.begin(), end = m_regionList.end(); iter != end; ++iter) {
         RenderRegion* region = *iter;
         LayoutUnit regionLogicalWidth = region->pageLogicalWidth();
         LayoutUnit logicalLeft = style().direction() == LTR ? LayoutUnit() : logicalWidth - regionLogicalWidth;
@@ -387,7 +387,7 @@ void RenderFlowThread::computeLogicalHeight(LayoutUnit, LayoutUnit logicalTop, L
     computedValues.m_extent = 0;
 
     const LayoutUnit maxFlowSize = RenderFlowThread::maxLogicalHeight();
-    for (RenderRegionList::const_iterator iter = m_regionList.begin(); iter != m_regionList.end(); ++iter) {
+    for (auto iter = m_regionList.begin(), end = m_regionList.end(); iter != end; ++iter) {
         RenderRegion* region = *iter;
         ASSERT(!region->needsLayout() || region->isRenderRegionSet());
 
@@ -514,7 +514,7 @@ void RenderFlowThread::repaintRectangleInRegions(const LayoutRect& repaintRect,
     // Let each region figure out the proper enclosing flow thread.
     CurrentRenderFlowThreadDisabler disabler(&view());
     
-    for (RenderRegionList::const_iterator iter = m_regionList.begin(); iter != m_regionList.end(); ++iter) {
+    for (auto iter = m_regionList.begin(), end = m_regionList.end(); iter != end; ++iter) {
         RenderRegion* region = *iter;
 
         region->repaintFlowThreadContent(repaintRect, immediate);
@@ -709,7 +709,7 @@ void RenderFlowThread::removeRenderBoxRegionInfo(RenderBox* box)
     RenderRegion* endRegion;
     getRegionRangeForBox(box, startRegion, endRegion);
 
-    for (RenderRegionList::iterator iter = m_regionList.find(startRegion); iter != m_regionList.end(); ++iter) {
+    for (auto iter = m_regionList.find(startRegion), end = m_regionList.end(); iter != end; ++iter) {
         RenderRegion* region = *iter;
         region->removeRenderBoxRegionInfo(box);
         if (region == endRegion)
@@ -718,7 +718,7 @@ void RenderFlowThread::removeRenderBoxRegionInfo(RenderBox* box)
 
 #ifndef NDEBUG
     // We have to make sure we did not leave any RenderBoxRegionInfo attached.
-    for (RenderRegionList::iterator iter = m_regionList.begin(); iter != m_regionList.end(); ++iter) {
+    for (auto iter = m_regionList.begin(), end = m_regionList.end(); iter != end; ++iter) {
         RenderRegion* region = *iter;
         ASSERT(!region->renderBoxRegionInfo(box));
     }
@@ -732,7 +732,7 @@ void RenderFlowThread::logicalWidthChangedInRegionsForBlock(const RenderBlock* b
     if (!hasValidRegionInfo())
         return;
 
-    RenderRegionRangeMap::iterator it = m_regionRangeMap.find(block);
+    auto it = m_regionRangeMap.find(block);
     if (it == m_regionRangeMap.end())
         return;
 
@@ -756,7 +756,7 @@ void RenderFlowThread::logicalWidthChangedInRegionsForBlock(const RenderBlock* b
         return;
     }
 
-    for (RenderRegionList::iterator iter = m_regionList.find(startRegion); iter != m_regionList.end(); ++iter) {
+    for (auto iter = m_regionList.find(startRegion), end = m_regionList.end(); iter != end; ++iter) {
         RenderRegion* region = *iter;
         ASSERT(!region->needsLayout() || region->isRenderRegionSet());
 
@@ -821,7 +821,7 @@ void RenderFlowThread::clearRenderObjectCustomStyle(const RenderObject* object)
 {
     // Clear the styles for the object in the regions.
     // FIXME: Region styling is not computed only for the region range of the object so this is why we need to walk the whole chain.
-    for (RenderRegionList::iterator iter = m_regionList.begin(); iter != m_regionList.end(); ++iter) {
+    for (auto iter = m_regionList.begin(), end = m_regionList.end(); iter != end; ++iter) {
         RenderRegion* region = *iter;
         region->clearObjectStyleInRegion(object);
     }
@@ -835,7 +835,7 @@ void RenderFlowThread::clearRenderBoxRegionInfoAndCustomStyle(const RenderBox* b
 
     bool insideOldRegionRange = false;
     bool insideNewRegionRange = false;
-    for (RenderRegionList::iterator iter = m_regionList.begin(); iter != m_regionList.end(); ++iter) {
+    for (auto iter = m_regionList.begin(), end = m_regionList.end(); iter != end; ++iter) {
         RenderRegion* region = *iter;
 
         if (oldStartRegion == region)
@@ -861,7 +861,7 @@ void RenderFlowThread::setRegionRangeForBox(const RenderBox* box, RenderRegion*
     ASSERT(hasRegions());
     ASSERT(startRegion && endRegion);
 
-    RenderRegionRangeMap::iterator it = m_regionRangeMap.find(box);
+    auto it = m_regionRangeMap.find(box);
     if (it == m_regionRangeMap.end()) {
         m_regionRangeMap.set(box, RenderRegionRange(startRegion, endRegion));
         return;
@@ -880,7 +880,7 @@ void RenderFlowThread::getRegionRangeForBox(const RenderBox* box, RenderRegion*&
 {
     startRegion = 0;
     endRegion = 0;
-    RenderRegionRangeMap::const_iterator it = m_regionRangeMap.find(box);
+    auto it = m_regionRangeMap.find(box);
     if (it == m_regionRangeMap.end())
         return;
 
@@ -901,7 +901,7 @@ bool RenderFlowThread::regionInRange(const RenderRegion* targetRegion, const Ren
 {
     ASSERT(targetRegion);
 
-    for (RenderRegionList::const_iterator it = m_regionList.find(const_cast<RenderRegion*>(startRegion)); it != m_regionList.end(); ++it) {
+    for (auto it = m_regionList.find(const_cast<RenderRegion*>(startRegion)), end = m_regionList.end(); it != end; ++it) {
         const RenderRegion* currRegion = *it;
         if (targetRegion == currRegion)
             return true;
@@ -916,7 +916,7 @@ bool RenderFlowThread::regionInRange(const RenderRegion* targetRegion, const Ren
 void RenderFlowThread::checkRegionsWithStyling()
 {
     bool hasRegionsWithStyling = false;
-    for (RenderRegionList::iterator iter = m_regionList.begin(); iter != m_regionList.end(); ++iter) {
+    for (auto iter = m_regionList.begin(), end = m_regionList.end(); iter != end; ++iter) {
         RenderRegion* region = *iter;
         if (region->hasCustomRegionStyle()) {
             hasRegionsWithStyling = true;
@@ -958,7 +958,7 @@ bool RenderFlowThread::objectInFlowRegion(const RenderObject* object, const Rend
     if (region == lastRegion()) {
         // If the object does not intersect any of the enclosing box regions
         // then the object is in last region.
-        for (RenderRegionList::const_iterator it = m_regionList.find(enclosingBoxStartRegion); it != m_regionList.end(); ++it) {
+        for (auto it = m_regionList.find(enclosingBoxStartRegion), end = m_regionList.end(); it != end; ++it) {
             const RenderRegion* currRegion = *it;
             if (currRegion == region)
                 break;
@@ -975,7 +975,7 @@ bool RenderFlowThread::objectInFlowRegion(const RenderObject* object, const Rend
 bool RenderFlowThread::isAutoLogicalHeightRegionsCountConsistent() const
 {
     unsigned autoLogicalHeightRegions = 0;
-    for (RenderRegionList::const_iterator iter = m_regionList.begin(); iter != m_regionList.end(); ++iter) {
+    for (auto iter = m_regionList.begin(), end = m_regionList.end(); iter != end; ++iter) {
         const RenderRegion* region = *iter;
         if (region->hasAutoLogicalHeight())
             autoLogicalHeightRegions++;
@@ -994,8 +994,8 @@ void RenderFlowThread::initializeRegionsComputedAutoHeight(RenderRegion* startRe
     if (!hasAutoLogicalHeightRegions())
         return;
 
-    RenderRegionList::iterator regionIter = startRegion ? m_regionList.find(startRegion) : m_regionList.begin();
-    for (; regionIter != m_regionList.end(); ++regionIter) {
+    for (auto regionIter = startRegion ? m_regionList.find(startRegion) : m_regionList.begin(),
+        end = m_regionList.end(); regionIter != end; ++regionIter) {
         RenderRegion* region = *regionIter;
         if (region->hasAutoLogicalHeight())
             region->setComputedAutoHeight(region->maxPageLogicalHeight());
@@ -1006,7 +1006,7 @@ void RenderFlowThread::markAutoLogicalHeightRegionsForLayout()
 {
     ASSERT(hasAutoLogicalHeightRegions());
 
-    for (RenderRegionList::iterator iter = m_regionList.begin(); iter != m_regionList.end(); ++iter) {
+    for (auto iter = m_regionList.begin(), end = m_regionList.end(); iter != end; ++iter) {
         RenderRegion* region = *iter;
         if (!region->hasAutoLogicalHeight())
             continue;
@@ -1022,7 +1022,7 @@ void RenderFlowThread::markRegionsForOverflowLayoutIfNeeded()
     if (!hasRegions())
         return;
 
-    for (RenderRegionList::iterator iter = m_regionList.begin(); iter != m_regionList.end(); ++iter) {
+    for (auto iter = m_regionList.begin(), end = m_regionList.end(); iter != end; ++iter) {
         RenderRegion* region = *iter;
         region->setNeedsSimplifiedNormalFlowLayout();
     }
@@ -1036,7 +1036,7 @@ void RenderFlowThread::updateRegionsFlowThreadPortionRect(const RenderRegion* la
     // FIXME: Optimize not to clear the interval all the time. This implies manually managing the tree nodes lifecycle.
     m_regionIntervalTree.clear();
     m_regionIntervalTree.initIfNeeded();
-    for (RenderRegionList::iterator iter = m_regionList.begin(); iter != m_regionList.end(); ++iter) {
+    for (auto iter = m_regionList.begin(), end = m_regionList.end(); iter != end; ++iter) {
         RenderRegion* region = *iter;
 
         // If we find an empty auto-height region, clear the computedAutoHeight value.
@@ -1065,7 +1065,7 @@ void RenderFlowThread::updateRegionsFlowThreadPortionRect(const RenderRegion* la
 // Even if we require the break to occur at offsetBreakInFlowThread, because regions may have min/max-height values,
 // it is possible that the break will occur at a different offset than the original one required.
 // offsetBreakAdjustment measures the different between the requested break offset and the current break offset.
-bool RenderFlowThread::addForcedRegionBreak(const RenderBlock* block, LayoutUnit offsetBreakInFlowThread, RenderObject* breakChild, bool isBefore, LayoutUnit* offsetBreakAdjustment)
+bool RenderFlowThread::addForcedRegionBreak(const RenderBlock* block, LayoutUnit offsetBreakInFlowThread, RenderBox* breakChild, bool isBefore, LayoutUnit* offsetBreakAdjustment)
 {
     // We take breaks into account for height computation for auto logical height regions
     // only in the layout phase in which we lay out the flows threads unconstrained
@@ -1077,10 +1077,10 @@ bool RenderFlowThread::addForcedRegionBreak(const RenderBlock* block, LayoutUnit
     // Breaks can come before or after some objects. We need to track these objects, so that if we get
     // multiple breaks for the same object (for example because of multiple layouts on the same object),
     // we need to invalidate every other region after the old one and start computing from fresh.
-    RenderObjectToRegionMap& mapToUse = isBefore ? m_breakBeforeToRegionMap : m_breakAfterToRegionMap;
-    RenderObjectToRegionMap::iterator iter = mapToUse.find(breakChild);
+    RenderBoxToRegionMap& mapToUse = isBefore ? m_breakBeforeToRegionMap : m_breakAfterToRegionMap;
+    auto iter = mapToUse.find(breakChild);
     if (iter != mapToUse.end()) {
-        RenderRegionList::iterator regionIter = m_regionList.find(iter->value);
+        auto regionIter = m_regionList.find(iter->value);
         ASSERT(regionIter != m_regionList.end());
         ASSERT((*regionIter)->hasAutoLogicalHeight());
         initializeRegionsComputedAutoHeight(*regionIter);
@@ -1156,7 +1156,7 @@ void RenderFlowThread::collectLayerFragments(LayerFragments& layerFragments, con
 {
     ASSERT(!m_regionsInvalidated);
     
-    for (RenderRegionList::const_iterator iter = m_regionList.begin(); iter != m_regionList.end(); ++iter) {
+    for (auto iter = m_regionList.begin(), end = m_regionList.end(); iter != end; ++iter) {
         RenderRegion* region = *iter;
         region->collectLayerFragments(layerFragments, layerBoundingBox, dirtyRect);
     }
@@ -1167,7 +1167,7 @@ LayoutRect RenderFlowThread::fragmentsBoundingBox(const LayoutRect& layerBoundin
     ASSERT(!m_regionsInvalidated);
     
     LayoutRect result;
-    for (RenderRegionList::const_iterator iter = m_regionList.begin(); iter != m_regionList.end(); ++iter) {
+    for (auto iter = m_regionList.begin(), end = m_regionList.end(); iter != end; ++iter) {
         RenderRegion* region = *iter;
         LayerFragments fragments;
         region->collectLayerFragments(fragments, layerBoundingBox, PaintInfo::infiniteRect());
@@ -1363,7 +1363,7 @@ void RenderFlowThread::addRegionsVisualEffectOverflow(const RenderBox* box)
     RenderRegion* endRegion = 0;
     getRegionRangeForBox(box, startRegion, endRegion);
 
-    for (RenderRegionList::iterator iter = m_regionList.find(startRegion); iter != m_regionList.end(); ++iter) {
+    for (auto iter = m_regionList.find(startRegion), end = m_regionList.end(); iter != end; ++iter) {
         RenderRegion* region = *iter;
 
         LayoutRect borderBox = box->borderBoxRectInRegion(region);
@@ -1382,7 +1382,7 @@ void RenderFlowThread::addRegionsVisualOverflowFromTheme(const RenderBlock* bloc
     RenderRegion* endRegion = 0;
     getRegionRangeForBox(block, startRegion, endRegion);
 
-    for (RenderRegionList::iterator iter = m_regionList.find(startRegion); iter != m_regionList.end(); ++iter) {
+    for (auto iter = m_regionList.find(startRegion), end = m_regionList.end(); iter != end; ++iter) {
         RenderRegion* region = *iter;
 
         LayoutRect borderBox = block->borderBoxRectInRegion(region);
@@ -1407,7 +1407,7 @@ void RenderFlowThread::addRegionsOverflowFromChild(const RenderBox* box, const R
     RenderRegion* containerEndRegion = 0;
     getRegionRangeForBox(box, containerStartRegion, containerEndRegion);
 
-    for (RenderRegionList::iterator iter = m_regionList.find(startRegion); iter != m_regionList.end(); ++iter) {
+    for (auto iter = m_regionList.find(startRegion), end = m_regionList.end(); iter != end; ++iter) {
         RenderRegion* region = *iter;
         if (!regionInRange(region, containerStartRegion, containerEndRegion))
             continue;
@@ -1433,7 +1433,7 @@ void RenderFlowThread::addRegionsLayoutOverflow(const RenderBox* box, const Layo
     RenderRegion* endRegion = 0;
     getRegionRangeForBox(box, startRegion, endRegion);
 
-    for (RenderRegionList::iterator iter = m_regionList.find(startRegion); iter != m_regionList.end(); ++iter) {
+    for (auto iter = m_regionList.find(startRegion), end = m_regionList.end(); iter != end; ++iter) {
         RenderRegion* region = *iter;
         LayoutRect layoutOverflowInRegion = region->rectFlowPortionForBox(box, layoutOverflow);
 
@@ -1450,7 +1450,7 @@ void RenderFlowThread::clearRegionsOverflow(const RenderBox* box)
     RenderRegion* endRegion = 0;
     getRegionRangeForBox(box, startRegion, endRegion);
 
-    for (RenderRegionList::iterator iter = m_regionList.find(startRegion); iter != m_regionList.end(); ++iter) {
+    for (auto iter = m_regionList.find(startRegion), end = m_regionList.end(); iter != end; ++iter) {
         RenderRegion* region = *iter;
         RenderBoxRegionInfo* boxInfo = region->renderBoxRegionInfo(box);
         if (boxInfo && boxInfo->overflow())
index 43b7974..21b4fae 100644 (file)
@@ -149,7 +149,7 @@ public:
     void markAutoLogicalHeightRegionsForLayout();
     void markRegionsForOverflowLayoutIfNeeded();
 
-    bool addForcedRegionBreak(const RenderBlock*, LayoutUnit, RenderObject* breakChild, bool isBefore, LayoutUnit* offsetBreakAdjustment = 0);
+    bool addForcedRegionBreak(const RenderBlock*, LayoutUnit, RenderBox* breakChild, bool isBefore, LayoutUnit* offsetBreakAdjustment = 0);
     void applyBreakAfterContent(LayoutUnit);
 
     bool pageLogicalSizeChanged() const { return m_pageLogicalSizeChanged; }
@@ -326,16 +326,18 @@ protected:
     OwnPtr<RegionToLayerListMap> m_regionToLayerListMap;
 #endif
 
-    // A maps from RenderBox
+    // Map a box to the list of regions in which the box is rendered.
     typedef HashMap<const RenderBox*, RenderRegionRange> RenderRegionRangeMap;
     RenderRegionRangeMap m_regionRangeMap;
 
-    typedef HashMap<RenderObject*, RenderRegion*> RenderObjectToRegionMap;
-    RenderObjectToRegionMap m_breakBeforeToRegionMap;
-    RenderObjectToRegionMap m_breakAfterToRegionMap;
+    // Map a box with a region break to the auto height region affected by that break. 
+    typedef HashMap<RenderBox*, RenderRegion*> RenderBoxToRegionMap;
+    RenderBoxToRegionMap m_breakBeforeToRegionMap;
+    RenderBoxToRegionMap m_breakAfterToRegionMap;
 
     typedef ListHashSet<const RenderObject*> RenderObjectStack;
     RenderObjectStack m_activeObjectsStack;
+
     typedef HashMap<const RenderBox*, LayoutUnit> RenderBoxToOffsetMap;
     RenderBoxToOffsetMap m_boxesToOffsetMap;
 
index 0cd9285..1dacbf6 100644 (file)
@@ -100,10 +100,7 @@ void RenderNamedFlowThread::updateWritingMode()
 
 RenderObject* RenderNamedFlowThread::nextRendererForNode(Node* node) const
 {
-    FlowThreadChildList::const_iterator it = m_flowThreadChildList->begin();
-    FlowThreadChildList::const_iterator end = m_flowThreadChildList->end();
-
-    for (; it != end; ++it) {
+    for (auto it = m_flowThreadChildList->begin(), end = m_flowThreadChildList->end(); it != end; ++it) {
         RenderObject* child = *it;
         ASSERT(child->node());
         unsigned short position = node->compareDocumentPosition(child->node());
@@ -119,9 +116,9 @@ RenderObject* RenderNamedFlowThread::previousRendererForNode(Node* node) const
     if (m_flowThreadChildList->isEmpty())
         return 0;
 
-    FlowThreadChildList::const_iterator begin = m_flowThreadChildList->begin();
-    FlowThreadChildList::const_iterator end = m_flowThreadChildList->end();
-    FlowThreadChildList::const_iterator it = end;
+    auto begin = m_flowThreadChildList->begin();
+    auto end = m_flowThreadChildList->end();
+    auto it = end;
 
     do {
         --it;
@@ -166,9 +163,7 @@ bool RenderNamedFlowThread::dependsOn(RenderNamedFlowThread* otherRenderFlowThre
         return true;
 
     // Recursively traverse the m_layoutBeforeThreadsSet.
-    RenderNamedFlowThreadCountedSet::const_iterator iterator = m_layoutBeforeThreadsSet.begin();
-    RenderNamedFlowThreadCountedSet::const_iterator end = m_layoutBeforeThreadsSet.end();
-    for (; iterator != end; ++iterator) {
+    for (auto iterator = m_layoutBeforeThreadsSet.begin(), end = m_layoutBeforeThreadsSet.end(); iterator != end; ++iterator) {
         const RenderNamedFlowThread* beforeFlowThread = (*iterator).key;
         if (beforeFlowThread->dependsOn(otherRenderFlowThread))
             return true;
@@ -235,7 +230,7 @@ static void addRegionToList(RenderRegionList& regionList, RenderRegion* renderRe
         regionList.add(renderRegion);
     else {
         // Find the first region "greater" than renderRegion.
-        RenderRegionList::iterator it = regionList.begin();
+        auto it = regionList.begin();
         while (it != regionList.end() && !compareRenderRegions(renderRegion, *it))
             ++it;
         regionList.insertBefore(it, renderRegion);
@@ -329,7 +324,7 @@ void RenderNamedFlowThread::computeOversetStateForRegions(LayoutUnit oldClientAf
         height = isHorizontalWritingMode() ? visualOverflowRect().maxY() : visualOverflowRect().maxX();
 
     RenderRegion* lastReg = lastRegion();
-    for (RenderRegionList::iterator iter = m_regionList.begin(); iter != m_regionList.end(); ++iter) {
+    for (auto iter = m_regionList.begin(), end = m_regionList.end(); iter != end; ++iter) {
         RenderRegion* region = *iter;
         LayoutUnit flowMin = height - (isHorizontalWritingMode() ? region->flowThreadPortionRect().y() : region->flowThreadPortionRect().x());
         LayoutUnit flowMax = height - (isHorizontalWritingMode() ? region->flowThreadPortionRect().maxY() : region->flowThreadPortionRect().maxX());
@@ -366,7 +361,7 @@ void RenderNamedFlowThread::computeOversetStateForRegions(LayoutUnit oldClientAf
 void RenderNamedFlowThread::checkInvalidRegions()
 {
     Vector<RenderRegion*> newValidRegions;
-    for (RenderRegionList::iterator iter = m_invalidRegionList.begin(); iter != m_invalidRegionList.end(); ++iter) {
+    for (auto iter = m_invalidRegionList.begin(), end = m_invalidRegionList.end(); iter != end; ++iter) {
         RenderRegion* region = *iter;
         // The only reason a region would be invalid is because it has a parent flow thread.
         ASSERT(!region->isValid() && region->parentNamedFlowThread());
@@ -376,7 +371,7 @@ void RenderNamedFlowThread::checkInvalidRegions()
         newValidRegions.append(region);
     }
 
-    for (Vector<RenderRegion*>::iterator iter = newValidRegions.begin(); iter != newValidRegions.end(); ++iter) {
+    for (auto iter = newValidRegions.begin(), end = newValidRegions.end(); iter != end; ++iter) {
         RenderRegion* region = *iter;
         m_invalidRegionList.remove(region);
         region->parentNamedFlowThread()->m_observerThreadsSet.remove(this);
@@ -421,7 +416,7 @@ void RenderNamedFlowThread::removeDependencyOnFlowThread(RenderNamedFlowThread*
 
 void RenderNamedFlowThread::pushDependencies(RenderNamedFlowThreadList& list)
 {
-    for (RenderNamedFlowThreadCountedSet::iterator iter = m_layoutBeforeThreadsSet.begin(); iter != m_layoutBeforeThreadsSet.end(); ++iter) {
+    for (auto iter = m_layoutBeforeThreadsSet.begin(), end = m_layoutBeforeThreadsSet.end(); iter != end; ++iter) {
         RenderNamedFlowThread* flowThread = (*iter).key;
         if (list.contains(flowThread))
             continue;
index f26aeef..b97f253 100644 (file)
@@ -513,7 +513,7 @@ void RenderRegion::setRegionObjectsRegionStyle()
             continue;
 
         // If the object has style in region, use that instead of computing a new one.
-        RenderObjectRegionStyleMap::iterator it = m_renderObjectRegionStyle.find(object);
+        auto it = m_renderObjectRegionStyle.find(object);
         RefPtr<RenderStyle> objectStyleInRegion;
         bool objectRegionStyleCached = false;
         if (it != m_renderObjectRegionStyle.end()) {
@@ -535,7 +535,7 @@ void RenderRegion::restoreRegionObjectsOriginalStyle()
         return;
 
     RenderObjectRegionStyleMap temp;
-    for (RenderObjectRegionStyleMap::iterator iter = m_renderObjectRegionStyle.begin(), end = m_renderObjectRegionStyle.end(); iter != end; ++iter) {
+    for (auto iter = m_renderObjectRegionStyle.begin(), end = m_renderObjectRegionStyle.end(); iter != end; ++iter) {
         RenderObject* object = const_cast<RenderObject*>(iter->key);
         RefPtr<RenderStyle> objectRegionStyle = &object->style();
         RefPtr<RenderStyle> objectOriginalStyle = iter->value.style;
@@ -592,7 +592,7 @@ void RenderRegion::computeChildrenStyleInRegion(const RenderElement* object)
 {
     for (RenderObject* child = object->firstChild(); child; child = child->nextSibling()) {
 
-        RenderObjectRegionStyleMap::iterator it = m_renderObjectRegionStyle.find(child);
+        auto it = m_renderObjectRegionStyle.find(child);
 
         RefPtr<RenderStyle> childStyleInRegion;
         bool objectRegionStyleCached = false;