Chromium Code Reviews| 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) |