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

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

Issue 853903002: Render string sequences of more than 64k characters. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Fixed tests. Created 5 years, 11 months 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 c2d2f53047398d9439514682904c8b56c41a6c3c..127c0876b9326337cde07a6977632b33680a9f08 100644
--- a/Source/core/rendering/InlineIterator.h
+++ b/Source/core/rendering/InlineIterator.h
@@ -624,10 +624,20 @@ private:
static void inline appendRunObjectIfNecessary(RenderObject* obj, unsigned start, unsigned end, InlineBidiResolver& resolver, AppendRunBehavior behavior, IsolateTracker& tracker)
{
- if (behavior == AppendingFakeRun)
- tracker.addFakeRunIfNecessary(obj, start, end, resolver);
- else
- resolver.runs().addRun(createRun(start, end, obj, resolver));
+ bool addEmptyRun = (end == start);
eae 2015/01/15 20:07:07 The general approach seems fine, I have a hard tim
Daniel Bratell 2015/01/16 13:47:32 There is code that calls this with start == end an
+ while (end > start || addEmptyRun) {
+ const int limit = USHRT_MAX; // Use a small number in Debug to keep the code well tested?
+ unsigned limitedEnd = end;
+ if (end - start > limit)
+ limitedEnd = start + limit;
+ if (behavior == AppendingFakeRun)
+ tracker.addFakeRunIfNecessary(obj, start, limitedEnd, resolver);
+ else
+ resolver.runs().addRun(createRun(start, limitedEnd, obj, resolver));
+ if (addEmptyRun)
+ break;
+ start = limitedEnd;
+ }
}
static void adjustMidpointsAndAppendRunsForObjectIfNeeded(RenderObject* obj, unsigned start, unsigned end, InlineBidiResolver& resolver, AppendRunBehavior behavior, IsolateTracker& tracker)

Powered by Google App Engine
This is Rietveld 408576698