Index: Source/core/rendering/InlineIterator.h |
diff --git a/Source/core/rendering/InlineIterator.h b/Source/core/rendering/InlineIterator.h |
index eae2dca791056ad703309473d0d774795fd61628..d88205ae92425e121e171ac28d5876fa629ad7e0 100644 |
--- a/Source/core/rendering/InlineIterator.h |
+++ b/Source/core/rendering/InlineIterator.h |
@@ -417,12 +417,17 @@ static inline bool isIsolatedInline(RenderObject* object) |
static inline RenderObject* containingIsolate(RenderObject* object, RenderObject* root) |
{ |
ASSERT(object); |
+ RenderObject* containingIsolateObj = 0; |
while (object && object != root) { |
+ if (containingIsolateObj && !isIsolatedInline(object)) |
+ break; |
+ |
if (isIsolatedInline(object)) |
- return object; |
+ containingIsolateObj = object; |
+ |
object = object->parent(); |
} |
- return 0; |
+ return containingIsolateObj; |
} |
static inline unsigned numberOfIsolateAncestors(const InlineIterator& iter) |