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

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

Issue 104813005: Explicitly set text direction for TextRuns (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Patch for landing Created 6 years, 11 months 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/platform/fonts/harfbuzz/HarfBuzzShaper.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 68aeec1027e7aaab2495df8329bc239e00806de1..a33a30d102b5b57df54be9e7578398323738fbf3 100644
--- a/Source/platform/text/BidiResolver.h
+++ b/Source/platform/text/BidiResolver.h
@@ -140,8 +140,9 @@ struct BidiCharacterRun {
int start() const { return m_start; }
int stop() const { return m_stop; }
unsigned char level() const { return m_level; }
- bool reversed(bool visuallyOrdered) { return m_level % 2 && !visuallyOrdered; }
+ bool reversed(bool visuallyOrdered) const { return m_level % 2 && !visuallyOrdered; }
bool dirOverride(bool visuallyOrdered) { return m_override || visuallyOrdered; }
+ TextDirection direction() const { return reversed(false) ? RTL : LTR; }
BidiCharacterRun* next() const { return m_next; }
void setNext(BidiCharacterRun* next) { m_next = next; }
@@ -219,7 +220,7 @@ public:
void embed(WTF::Unicode::Direction, BidiEmbeddingSource);
bool commitExplicitEmbedding();
- void createBidiRunsForLine(const Iterator& end, VisualDirectionOverride = NoVisualOverride, bool hardLineBreak = false);
+ void createBidiRunsForLine(const Iterator& end, VisualDirectionOverride = NoVisualOverride, bool hardLineBreak = false, bool reorderRuns = true);
BidiRunList<Run>& runs() { return m_runs; }
@@ -635,7 +636,7 @@ TextDirection BidiResolver<Iterator, Run>::determineParagraphDirectionality(bool
}
template <class Iterator, class Run>
-void BidiResolver<Iterator, Run>::createBidiRunsForLine(const Iterator& end, VisualDirectionOverride override, bool hardLineBreak)
+void BidiResolver<Iterator, Run>::createBidiRunsForLine(const Iterator& end, VisualDirectionOverride override, bool hardLineBreak, bool reorderRuns)
{
using namespace WTF::Unicode;
@@ -1034,7 +1035,8 @@ void BidiResolver<Iterator, Run>::createBidiRunsForLine(const Iterator& end, Vis
}
m_runs.setLogicallyLastRun(m_runs.lastRun());
- reorderRunsFromLevels();
+ if (reorderRuns)
+ reorderRunsFromLevels();
m_endOfRunAtEndOfLine = Iterator();
m_endOfLine = Iterator();
« no previous file with comments | « Source/platform/fonts/harfbuzz/HarfBuzzShaper.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698