Index: Source/core/rendering/InlineIterator.h |
diff --git a/Source/core/rendering/InlineIterator.h b/Source/core/rendering/InlineIterator.h |
index cbd866e3607257d32a8d9c61ec2ba725b8a55740..092bd703e1bc3bef451261a06c83a4e6c11c6d1f 100644 |
--- a/Source/core/rendering/InlineIterator.h |
+++ b/Source/core/rendering/InlineIterator.h |
@@ -359,12 +359,28 @@ private: |
bool m_atEndOfInline; |
}; |
+static inline bool endOfLineHasIsolatedObjectAncestor(const InlineIterator& isolatedIterator, const InlineIterator& ancestorItertor) |
+{ |
+ if (!isolatedIterator.object() || !isIsolated(isolatedIterator.object()->style()->unicodeBidi())) |
+ return false; |
+ |
+ RenderObject* innerIsolatedObject = isolatedIterator.object(); |
+ while (innerIsolatedObject && innerIsolatedObject != isolatedIterator.root()) { |
+ if (innerIsolatedObject == ancestorItertor.object()) |
+ return true; |
+ innerIsolatedObject = innerIsolatedObject->parent(); |
+ } |
+ return false; |
+} |
+ |
inline void InlineIterator::increment(InlineBidiResolver* resolver, IncrementRule rule) |
{ |
if (!m_obj) |
return; |
- if (resolver && resolver->inIsolate() && rule == FastIncrementInIsolatedRenderer) { |
+ if (rule == FastIncrementInIsolatedRenderer |
+ && resolver && resolver->inIsolate() |
+ && !endOfLineHasIsolatedObjectAncestor(resolver->endOfLine(), resolver->position())) { |
moveTo(bidiNextSkippingEmptyInlines(m_root, m_obj, resolver), 0); |
return; |
} |