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

Unified Diff: Source/platform/text/BidiResolver.h

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
Patch Set: Final patch for landing Created 7 years, 1 month 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
« no previous file with comments | « Source/core/rendering/RenderBlockLineLayout.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/platform/text/BidiResolver.h
diff --git a/Source/platform/text/BidiResolver.h b/Source/platform/text/BidiResolver.h
index ab2211543cb2d3cb82ddf4f8eb1736ba149e30f8..e8cf990f2208ec7d4e9efbf0bc8af06f25f52bdc 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,9 @@ protected:
Iterator m_last;
BidiStatus m_status;
WTF::Unicode::Direction m_direction;
- Iterator endOfLine;
+ // m_endOfRunAtEndOfLine is "the position last eor in the end of line"
+ Iterator m_endOfRunAtEndOfLine;
+ Iterator m_endOfLine;
bool m_reachedEndOfLine;
Iterator m_lastBeforeET; // Before a EuropeanNumberTerminator
bool m_emptyRun;
@@ -285,9 +287,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 +589,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 +601,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 +612,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 +905,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 +945,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 +962,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>
« no previous file with comments | « Source/core/rendering/RenderBlockLineLayout.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698