 Chromium Code Reviews
 Chromium Code Reviews Issue 46393003:
  BidiResolver should not append an isolated run if it is in a other line.  (Closed) 
  Base URL: https://chromium.googlesource.com/chromium/blink.git@master
    
  
    Issue 46393003:
  BidiResolver should not append an isolated run if it is in a other line.  (Closed) 
  Base URL: https://chromium.googlesource.com/chromium/blink.git@master| Index: Source/platform/text/BidiResolver.h | 
| diff --git a/Source/platform/text/BidiResolver.h b/Source/platform/text/BidiResolver.h | 
| index cc5eb275720c30ebb5ea1db50dd117418916e6d0..2ca7bafe7499a25f2d297ffaae075c73d278d5b7 100644 | 
| --- a/Source/platform/text/BidiResolver.h | 
| +++ b/Source/platform/text/BidiResolver.h | 
| @@ -222,7 +222,7 @@ public: | 
| Vector<Run*>& isolatedRuns() { return m_isolatedRuns; } | 
| - bool isEndOfParagraph(const Iterator& end) { return m_current == end || m_current.atEnd(); } | 
| + bool isEndOfLine(const Iterator& end) { return m_current == end || m_current.atEnd(); } | 
| TextDirection determineParagraphDirectionality(bool* hasStrongDirectionality = 0); | 
| @@ -243,7 +243,8 @@ protected: | 
| Iterator m_last; | 
| BidiStatus m_status; | 
| WTF::Unicode::Direction m_direction; | 
| - Iterator endOfLine; | 
| + Iterator m_endOfRunAtEndOfLine; | 
| + Iterator m_endOfLine; | 
| 
leviw_travelin_and_unemployed
2013/11/01 20:46:02
It may be good to put a comment explaining what th
 | 
| bool m_reachedEndOfLine; | 
| Iterator m_lastBeforeET; // Before a EuropeanNumberTerminator | 
| bool m_emptyRun; | 
| @@ -285,9 +286,9 @@ void BidiResolver<Iterator, Run>::appendRun() | 
| unsigned startOffset = m_sor.offset(); | 
| unsigned endOffset = m_eor.offset(); | 
| - if (!endOfLine.atEnd() && endOffset >= endOfLine.offset()) { | 
| + if (!m_endOfRunAtEndOfLine.atEnd() && endOffset >= m_endOfRunAtEndOfLine.offset()) { | 
| m_reachedEndOfLine = true; | 
| - endOffset = endOfLine.offset(); | 
| + endOffset = m_endOfRunAtEndOfLine.offset(); | 
| } | 
| if (endOffset >= startOffset) | 
| @@ -587,9 +588,10 @@ void BidiResolver<Iterator, Run>::createBidiRunsForLine(const Iterator& end, Vis | 
| m_emptyRun = true; | 
| m_eor = Iterator(); | 
| + m_endOfLine = end; | 
| m_last = m_current; | 
| - bool lastParagraphEnded = false; | 
| + bool lastLineEnded = false; | 
| BidiResolver<Iterator, Run> stateAtEnd; | 
| while (true) { | 
| @@ -598,7 +600,7 @@ void BidiResolver<Iterator, Run>::createBidiRunsForLine(const Iterator& end, Vis | 
| m_emptyRun = false; | 
| } | 
| - if (!lastParagraphEnded && isEndOfParagraph(end)) { | 
| + if (!lastLineEnded && isEndOfLine(end)) { | 
| if (m_emptyRun) | 
| break; | 
| @@ -609,11 +611,11 @@ void BidiResolver<Iterator, Run>::createBidiRunsForLine(const Iterator& end, Vis | 
| stateAtEnd.m_reachedEndOfLine = m_reachedEndOfLine; | 
| stateAtEnd.m_lastBeforeET = m_lastBeforeET; | 
| stateAtEnd.m_emptyRun = m_emptyRun; | 
| - endOfLine = m_last; | 
| - lastParagraphEnded = true; | 
| + m_endOfRunAtEndOfLine = m_last; | 
| + lastLineEnded = true; | 
| } | 
| Direction dirCurrent; | 
| - if (lastParagraphEnded && (hardLineBreak || m_current.atEnd())) { | 
| + if (lastLineEnded && (hardLineBreak || m_current.atEnd())) { | 
| BidiContext* c = context(); | 
| if (hardLineBreak) { | 
| // A deviation from the Unicode Bidi Algorithm in order to match | 
| @@ -902,9 +904,9 @@ void BidiResolver<Iterator, Run>::createBidiRunsForLine(const Iterator& end, Vis | 
| break; | 
| } | 
| - if (lastParagraphEnded && m_eor == m_current) { | 
| + if (lastLineEnded && m_eor == m_current) { | 
| if (!m_reachedEndOfLine) { | 
| - m_eor = endOfLine; | 
| + m_eor = m_endOfRunAtEndOfLine; | 
| switch (m_status.eor) { | 
| case LeftToRight: | 
| case RightToLeft: | 
| @@ -942,7 +944,7 @@ void BidiResolver<Iterator, Run>::createBidiRunsForLine(const Iterator& end, Vis | 
| increment(); | 
| if (!m_currentExplicitEmbeddingSequence.isEmpty()) { | 
| bool committed = commitExplicitEmbedding(); | 
| - if (committed && lastParagraphEnded) { | 
| + if (committed && lastLineEnded) { | 
| m_current = end; | 
| m_status = stateAtEnd.m_status; | 
| m_sor = stateAtEnd.m_sor; | 
| @@ -959,7 +961,8 @@ void BidiResolver<Iterator, Run>::createBidiRunsForLine(const Iterator& end, Vis | 
| m_runs.setLogicallyLastRun(m_runs.lastRun()); | 
| reorderRunsFromLevels(); | 
| - endOfLine = Iterator(); | 
| + m_endOfRunAtEndOfLine = Iterator(); | 
| + m_endOfLine = Iterator(); | 
| } | 
| template <class Iterator, class Run> |