| Index: Source/core/rendering/InlineIterator.h | 
| diff --git a/Source/core/rendering/InlineIterator.h b/Source/core/rendering/InlineIterator.h | 
| index 0bc1128112afca67cc84d3e0d8fcb2d40f040d59..290fdc5d97cd5f1797d3a952440fbc2e52a0a4bc 100644 | 
| --- a/Source/core/rendering/InlineIterator.h | 
| +++ b/Source/core/rendering/InlineIterator.h | 
| @@ -421,15 +421,15 @@ inline void InlineBidiResolver::increment() | 
| } | 
|  | 
| template <> | 
| -inline bool InlineBidiResolver::isEndOfParagraph(const InlineIterator& end) | 
| +inline bool InlineBidiResolver::isEndOfLine(const InlineIterator& end) | 
| { | 
| -    bool inEndOfParagraph = m_current == end || m_current.atEnd() || (inIsolate() && m_current.m_obj == end.m_obj); | 
| -    if (inIsolate() && inEndOfParagraph) { | 
| +    bool inEndOfLine = m_current == end || m_current.atEnd() || (inIsolate() && m_current.m_obj == end.m_obj); | 
| +    if (inIsolate() && inEndOfLine) { | 
| m_current.moveTo(m_current.m_obj, end.m_pos, m_current.m_nextBreakablePosition); | 
| m_last = m_current; | 
| updateStatusLastFromCurrentDirection(WTF::Unicode::OtherNeutral); | 
| } | 
| -    return inEndOfParagraph; | 
| +    return inEndOfLine; | 
| } | 
|  | 
| static inline bool isIsolatedInline(RenderObject* object) | 
| @@ -589,7 +589,7 @@ inline void InlineBidiResolver::appendRun() | 
| IsolateTracker isolateTracker(numberOfIsolateAncestors(m_sor)); | 
| int start = m_sor.m_pos; | 
| RenderObject* obj = m_sor.m_obj; | 
| -        while (obj && obj != m_eor.m_obj && obj != endOfLine.m_obj) { | 
| +        while (obj && obj != m_eor.m_obj && obj != m_endOfRunAtEndOfLine.m_obj) { | 
| if (isolateTracker.inIsolate()) | 
| isolateTracker.addFakeRunIfNecessary(obj, start, obj->length(), *this); | 
| else | 
| @@ -598,11 +598,12 @@ inline void InlineBidiResolver::appendRun() | 
| start = 0; | 
| obj = bidiNextSkippingEmptyInlines(m_sor.root(), obj, &isolateTracker); | 
| } | 
| -        if (obj) { | 
| +        bool isEndOfLine = obj == m_endOfLine.m_obj && !m_endOfLine.m_pos; | 
| +        if (obj && !isEndOfLine) { | 
| unsigned pos = obj == m_eor.m_obj ? m_eor.m_pos : INT_MAX; | 
| -            if (obj == endOfLine.m_obj && endOfLine.m_pos <= pos) { | 
| +            if (obj == m_endOfRunAtEndOfLine.m_obj && m_endOfRunAtEndOfLine.m_pos <= pos) { | 
| m_reachedEndOfLine = true; | 
| -                pos = endOfLine.m_pos; | 
| +                pos = m_endOfRunAtEndOfLine.m_pos; | 
| } | 
| // It's OK to add runs for zero-length RenderObjects, just don't make the run larger than it should be | 
| int end = obj->length() ? pos + 1 : 0; | 
|  |