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

Unified Diff: Source/core/rendering/RenderBlockFlow.cpp

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/core/rendering/RenderBlockFlow.h ('k') | Source/core/rendering/RenderBlockLineLayout.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/rendering/RenderBlockFlow.cpp
diff --git a/Source/core/rendering/RenderBlockFlow.cpp b/Source/core/rendering/RenderBlockFlow.cpp
index ab16dc0da4ba84bbe084dcf8f28a8ee0865c927f..d485a94340f34c0a5911fc7131ca389a2308b684 100644
--- a/Source/core/rendering/RenderBlockFlow.cpp
+++ b/Source/core/rendering/RenderBlockFlow.cpp
@@ -2659,9 +2659,15 @@ LayoutUnit RenderBlockFlow::logicalRightSelectionOffset(RenderBlock* rootBlock,
template <typename CharacterType>
static inline TextRun constructTextRunInternal(RenderObject* context, const Font& font, const CharacterType* characters, int length, RenderStyle* style, TextRun::ExpansionBehavior expansion)
{
+ return constructTextRunInternal(context, font, characters, length, style, LTR, expansion);
+}
+
+template <typename CharacterType>
+static inline TextRun constructTextRunInternal(RenderObject* context, const Font& font, const CharacterType* characters, int length, RenderStyle* style, TextDirection direction, TextRun::ExpansionBehavior expansion)
+{
ASSERT(style);
- TextDirection textDirection = LTR;
+ TextDirection textDirection = direction;
bool directionalOverride = style->rtlOrdering() == VisualOrder;
TextRun run(characters, length, 0, 0, expansion, textDirection, directionalOverride);
@@ -2709,12 +2715,12 @@ TextRun RenderBlockFlow::constructTextRun(RenderObject* context, const Font& fon
return constructTextRunInternal(context, font, text->characters16(), text->textLength(), style, expansion);
}
-TextRun RenderBlockFlow::constructTextRun(RenderObject* context, const Font& font, const RenderText* text, unsigned offset, unsigned length, RenderStyle* style, TextRun::ExpansionBehavior expansion)
+TextRun RenderBlockFlow::constructTextRun(RenderObject* context, const Font& font, const RenderText* text, unsigned offset, unsigned length, RenderStyle* style, TextDirection direction, TextRun::ExpansionBehavior expansion)
{
ASSERT(offset + length <= text->textLength());
if (text->is8Bit())
- return constructTextRunInternal(context, font, text->characters8() + offset, length, style, expansion);
- return constructTextRunInternal(context, font, text->characters16() + offset, length, style, expansion);
+ return constructTextRunInternal(context, font, text->characters8() + offset, length, style, direction, expansion);
+ return constructTextRunInternal(context, font, text->characters16() + offset, length, style, direction, expansion);
}
TextRun RenderBlockFlow::constructTextRun(RenderObject* context, const Font& font, const String& string, RenderStyle* style, TextRun::ExpansionBehavior expansion, TextRunFlags flags)
« no previous file with comments | « Source/core/rendering/RenderBlockFlow.h ('k') | Source/core/rendering/RenderBlockLineLayout.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698