Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1140)

Unified Diff: Source/core/rendering/InlineIterator.h

Issue 103823005: Isolated elements at end of line are not being correctly treated (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 7 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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;
}
« no previous file with comments | « LayoutTests/fast/text/output-isolate-at-end-of-line-crash-expected.txt ('k') | Source/platform/text/BidiResolver.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698