| Index: Source/platform/text/BidiResolver.h
|
| diff --git a/Source/platform/text/BidiResolver.h b/Source/platform/text/BidiResolver.h
|
| index 78563478a28176d2c08bb8d8ec823d286c2dc439..356f89488517ce6c997c074e375deb1df0867f32 100644
|
| --- a/Source/platform/text/BidiResolver.h
|
| +++ b/Source/platform/text/BidiResolver.h
|
| @@ -244,11 +244,9 @@ public:
|
| void embed(WTF::Unicode::Direction, BidiEmbeddingSource);
|
| bool commitExplicitEmbedding(BidiRunList<Run>&);
|
|
|
| - void createBidiRunsForLine(const Iterator& end,
|
| - BidiRunList<Run>&,
|
| - VisualDirectionOverride = NoVisualOverride,
|
| - bool hardLineBreak = false,
|
| - bool reorderRuns = true);
|
| + void createBidiRunsForLine(const Iterator& end, VisualDirectionOverride = NoVisualOverride, bool hardLineBreak = false, bool reorderRuns = true);
|
| +
|
| + BidiRunList<Run>& runs() { return m_runs; }
|
|
|
| // FIXME: This used to be part of deleteRuns() but was a layering violation.
|
| // It's unclear if this is still needed.
|
| @@ -289,6 +287,10 @@ protected:
|
| Iterator m_lastBeforeET; // Before a EuropeanNumberTerminator
|
| bool m_emptyRun;
|
|
|
| + // FIXME: This should not belong to the resolver, but rather be passed
|
| + // into createBidiRunsForLine by the caller.
|
| + BidiRunList<Run> m_runs;
|
| +
|
| MidpointState<Iterator> m_midpointState;
|
|
|
| unsigned m_nestedIsolateCount;
|
| @@ -658,11 +660,7 @@ TextDirection BidiResolver<Iterator, Run>::determineParagraphDirectionality(bool
|
| }
|
|
|
| template <class Iterator, class Run>
|
| -void BidiResolver<Iterator, Run>::createBidiRunsForLine(const Iterator& end,
|
| - BidiRunList<Run>& runs,
|
| - VisualDirectionOverride override,
|
| - bool hardLineBreak,
|
| - bool reorderRuns)
|
| +void BidiResolver<Iterator, Run>::createBidiRunsForLine(const Iterator& end, VisualDirectionOverride override, bool hardLineBreak, bool reorderRuns)
|
| {
|
| using namespace WTF::Unicode;
|
|
|
| @@ -680,10 +678,10 @@ void BidiResolver<Iterator, Run>::createBidiRunsForLine(const Iterator& end,
|
| increment();
|
| }
|
| m_direction = override == VisualLeftToRightOverride ? LeftToRight : RightToLeft;
|
| - appendRun(runs);
|
| - runs.setLogicallyLastRun(runs.lastRun());
|
| - if (override == VisualRightToLeftOverride && runs.runCount())
|
| - runs.reverseRuns(0, runs.runCount() - 1);
|
| + appendRun(m_runs);
|
| + m_runs.setLogicallyLastRun(m_runs.lastRun());
|
| + if (override == VisualRightToLeftOverride && m_runs.runCount())
|
| + m_runs.reverseRuns(0, m_runs.runCount() - 1);
|
| return;
|
| }
|
|
|
| @@ -762,7 +760,7 @@ void BidiResolver<Iterator, Run>::createBidiRunsForLine(const Iterator& end,
|
| case LeftToRightOverride:
|
| case PopDirectionalFormat:
|
| embed(dirCurrent, FromUnicode);
|
| - commitExplicitEmbedding(runs);
|
| + commitExplicitEmbedding(m_runs);
|
| break;
|
|
|
| // strong types
|
| @@ -773,7 +771,7 @@ void BidiResolver<Iterator, Run>::createBidiRunsForLine(const Iterator& end,
|
| case EuropeanNumber:
|
| case ArabicNumber:
|
| if (m_status.last != EuropeanNumber || m_status.lastStrong != LeftToRight)
|
| - appendRun(runs);
|
| + appendRun(m_runs);
|
| break;
|
| case LeftToRight:
|
| break;
|
| @@ -789,23 +787,23 @@ void BidiResolver<Iterator, Run>::createBidiRunsForLine(const Iterator& end,
|
| if (m_status.lastStrong != LeftToRight) {
|
| // the numbers need to be on a higher embedding level, so let's close that run
|
| m_direction = EuropeanNumber;
|
| - appendRun(runs);
|
| + appendRun(m_runs);
|
| if (context()->dir() != LeftToRight) {
|
| // the neutrals take the embedding direction, which is R
|
| m_eor = m_last;
|
| m_direction = RightToLeft;
|
| - appendRun(runs);
|
| + appendRun(m_runs);
|
| }
|
| }
|
| } else if (m_status.eor == ArabicNumber) {
|
| // Arabic numbers are always on a higher embedding level, so let's close that run
|
| m_direction = ArabicNumber;
|
| - appendRun(runs);
|
| + appendRun(m_runs);
|
| if (context()->dir() != LeftToRight) {
|
| // the neutrals take the embedding direction, which is R
|
| m_eor = m_last;
|
| m_direction = RightToLeft;
|
| - appendRun(runs);
|
| + appendRun(m_runs);
|
| }
|
| } else if (m_status.lastStrong != LeftToRight) {
|
| // last stuff takes embedding dir
|
| @@ -813,7 +811,7 @@ void BidiResolver<Iterator, Run>::createBidiRunsForLine(const Iterator& end,
|
| m_eor = m_last;
|
| m_direction = RightToLeft;
|
| }
|
| - appendRun(runs);
|
| + appendRun(m_runs);
|
| }
|
| default:
|
| break;
|
| @@ -829,7 +827,7 @@ void BidiResolver<Iterator, Run>::createBidiRunsForLine(const Iterator& end,
|
| case LeftToRight:
|
| case EuropeanNumber:
|
| case ArabicNumber:
|
| - appendRun(runs);
|
| + appendRun(m_runs);
|
| case RightToLeft:
|
| case RightToLeftArabic:
|
| break;
|
| @@ -844,13 +842,13 @@ void BidiResolver<Iterator, Run>::createBidiRunsForLine(const Iterator& end,
|
| if (m_status.eor == EuropeanNumber) {
|
| if (m_status.lastStrong == LeftToRight && context()->dir() == LeftToRight)
|
| m_eor = m_last;
|
| - appendRun(runs);
|
| + appendRun(m_runs);
|
| } else if (m_status.eor == ArabicNumber) {
|
| - appendRun(runs);
|
| + appendRun(m_runs);
|
| } else if (m_status.lastStrong == LeftToRight) {
|
| if (context()->dir() == LeftToRight)
|
| m_eor = m_last;
|
| - appendRun(runs);
|
| + appendRun(m_runs);
|
| }
|
| default:
|
| break;
|
| @@ -874,7 +872,7 @@ void BidiResolver<Iterator, Run>::createBidiRunsForLine(const Iterator& end,
|
| case RightToLeftArabic:
|
| case ArabicNumber:
|
| m_eor = m_last;
|
| - appendRun(runs);
|
| + appendRun(m_runs);
|
| m_direction = EuropeanNumber;
|
| break;
|
| case EuropeanNumberSeparator:
|
| @@ -891,22 +889,22 @@ void BidiResolver<Iterator, Run>::createBidiRunsForLine(const Iterator& end,
|
| if (m_status.lastStrong == RightToLeft) {
|
| // ENs on both sides behave like Rs, so the neutrals should be R.
|
| // Terminate the EN run.
|
| - appendRun(runs);
|
| + appendRun(m_runs);
|
| // Make an R run.
|
| m_eor = m_status.last == EuropeanNumberTerminator ? m_lastBeforeET : m_last;
|
| m_direction = RightToLeft;
|
| - appendRun(runs);
|
| + appendRun(m_runs);
|
| // Begin a new EN run.
|
| m_direction = EuropeanNumber;
|
| }
|
| } else if (m_status.eor == ArabicNumber) {
|
| // Terminate the AN run.
|
| - appendRun(runs);
|
| + appendRun(m_runs);
|
| if (m_status.lastStrong == RightToLeft || context()->dir() == RightToLeft) {
|
| // Make an R run.
|
| m_eor = m_status.last == EuropeanNumberTerminator ? m_lastBeforeET : m_last;
|
| m_direction = RightToLeft;
|
| - appendRun(runs);
|
| + appendRun(m_runs);
|
| // Begin a new EN run.
|
| m_direction = EuropeanNumber;
|
| }
|
| @@ -914,7 +912,7 @@ void BidiResolver<Iterator, Run>::createBidiRunsForLine(const Iterator& end,
|
| // Extend the R run to include the neutrals.
|
| m_eor = m_status.last == EuropeanNumberTerminator ? m_lastBeforeET : m_last;
|
| m_direction = RightToLeft;
|
| - appendRun(runs);
|
| + appendRun(m_runs);
|
| // Begin a new EN run.
|
| m_direction = EuropeanNumber;
|
| }
|
| @@ -932,7 +930,7 @@ void BidiResolver<Iterator, Run>::createBidiRunsForLine(const Iterator& end,
|
| switch (m_status.last) {
|
| case LeftToRight:
|
| if (context()->dir() == LeftToRight)
|
| - appendRun(runs);
|
| + appendRun(m_runs);
|
| break;
|
| case ArabicNumber:
|
| break;
|
| @@ -940,7 +938,7 @@ void BidiResolver<Iterator, Run>::createBidiRunsForLine(const Iterator& end,
|
| case RightToLeftArabic:
|
| case EuropeanNumber:
|
| m_eor = m_last;
|
| - appendRun(runs);
|
| + appendRun(m_runs);
|
| break;
|
| case CommonNumberSeparator:
|
| if (m_status.eor == ArabicNumber)
|
| @@ -956,14 +954,14 @@ void BidiResolver<Iterator, Run>::createBidiRunsForLine(const Iterator& end,
|
| || (m_status.eor == EuropeanNumber && (m_status.lastStrong == RightToLeft || context()->dir() == RightToLeft))
|
| || (m_status.eor != EuropeanNumber && m_status.lastStrong == LeftToRight && context()->dir() == RightToLeft)) {
|
| // Terminate the run before the neutrals.
|
| - appendRun(runs);
|
| + appendRun(m_runs);
|
| // Begin an R run for the neutrals.
|
| m_direction = RightToLeft;
|
| } else if (m_direction == OtherNeutral) {
|
| m_direction = m_status.lastStrong == LeftToRight ? LeftToRight : RightToLeft;
|
| }
|
| m_eor = m_last;
|
| - appendRun(runs);
|
| + appendRun(m_runs);
|
| default:
|
| break;
|
| }
|
| @@ -1020,7 +1018,7 @@ void BidiResolver<Iterator, Run>::createBidiRunsForLine(const Iterator& end,
|
| default:
|
| ASSERT_NOT_REACHED();
|
| }
|
| - appendRun(runs);
|
| + appendRun(m_runs);
|
| }
|
| m_current = end;
|
| m_status = stateAtEnd.m_status;
|
| @@ -1044,7 +1042,7 @@ void BidiResolver<Iterator, Run>::createBidiRunsForLine(const Iterator& end,
|
|
|
| increment();
|
| if (!m_currentExplicitEmbeddingSequence.isEmpty()) {
|
| - bool committed = commitExplicitEmbedding(runs);
|
| + bool committed = commitExplicitEmbedding(m_runs);
|
| if (committed && lastLineEnded) {
|
| m_current = end;
|
| m_status = stateAtEnd.m_status;
|
| @@ -1060,14 +1058,14 @@ void BidiResolver<Iterator, Run>::createBidiRunsForLine(const Iterator& end,
|
| }
|
| }
|
|
|
| - runs.setLogicallyLastRun(runs.lastRun());
|
| + m_runs.setLogicallyLastRun(m_runs.lastRun());
|
| if (reorderRuns)
|
| - reorderRunsFromLevels(runs);
|
| + reorderRunsFromLevels(m_runs);
|
| m_endOfRunAtEndOfLine = Iterator();
|
| m_endOfLine = Iterator();
|
|
|
| - if (!hardLineBreak && runs.runCount())
|
| - applyL1Rule(runs);
|
| + if (!hardLineBreak && m_runs.runCount())
|
| + applyL1Rule(m_runs);
|
| }
|
|
|
| template <class Iterator, class Run>
|
|
|