Index: Source/WebCore/rendering/RenderBlock.cpp |
=================================================================== |
--- Source/WebCore/rendering/RenderBlock.cpp (revision 138968) |
+++ Source/WebCore/rendering/RenderBlock.cpp (working copy) |
@@ -1334,8 +1334,8 @@ |
void RenderBlock::startDelayUpdateScrollInfo() |
{ |
- if (!gDelayedUpdateScrollInfoSet) { |
- ASSERT(!gDelayUpdateScrollInfo); |
+ if (gDelayUpdateScrollInfo == 0) { |
+ ASSERT(!gDelayedUpdateScrollInfoSet); |
gDelayedUpdateScrollInfoSet = new DelayedUpdateScrollInfoSet; |
} |
ASSERT(gDelayedUpdateScrollInfoSet); |
@@ -1349,22 +1349,15 @@ |
if (gDelayUpdateScrollInfo == 0) { |
ASSERT(gDelayedUpdateScrollInfoSet); |
- Vector<RenderBlock*> infoSet; |
- while (gDelayedUpdateScrollInfoSet && gDelayedUpdateScrollInfoSet->size()) { |
- copyToVector(*gDelayedUpdateScrollInfoSet, infoSet); |
- for (Vector<RenderBlock*>::iterator it = infoSet.begin(); it != infoSet.end(); ++it) { |
- RenderBlock* block = *it; |
- // |block| may have been destroyed at this point, but then it will have been removed from gDelayedUpdateScrollInfoSet. |
- if (gDelayedUpdateScrollInfoSet && gDelayedUpdateScrollInfoSet->contains(block)) { |
- gDelayedUpdateScrollInfoSet->remove(block); |
- if (block->hasOverflowClip()) |
- block->layer()->updateScrollInfoAfterLayout(); |
- } |
+ OwnPtr<DelayedUpdateScrollInfoSet> infoSet(adoptPtr(gDelayedUpdateScrollInfoSet)); |
+ gDelayedUpdateScrollInfoSet = 0; |
+ |
+ for (DelayedUpdateScrollInfoSet::iterator it = infoSet->begin(); it != infoSet->end(); ++it) { |
+ RenderBlock* block = *it; |
+ if (block->hasOverflowClip()) { |
+ block->layer()->updateScrollInfoAfterLayout(); |
} |
} |
- delete gDelayedUpdateScrollInfoSet; |
- gDelayedUpdateScrollInfoSet = 0; |
- ASSERT(!gDelayUpdateScrollInfo); |
} |
} |