Chromium Code Reviews| Index: Source/core/rendering/RenderObject.cpp |
| diff --git a/Source/core/rendering/RenderObject.cpp b/Source/core/rendering/RenderObject.cpp |
| index c32a4a11f90ad5f44d9420c43d2b2d8785b8ee29..86ce87812ed362106e9d3bc75d6c4c7490209eea 100644 |
| --- a/Source/core/rendering/RenderObject.cpp |
| +++ b/Source/core/rendering/RenderObject.cpp |
| @@ -3303,6 +3303,38 @@ PositionWithAffinity RenderObject::createPositionWithAffinity(const Position& po |
| return createPositionWithAffinity(0, DOWNSTREAM); |
| } |
| +ETextAlign RenderObject::simplifiedTextAlign(const ETextAlign& textAlign, const RootInlineBox* rootInlineBox) const |
| +{ |
| + TextDirection direction; |
| + if (rootInlineBox && rootInlineBox->renderer()->style()->unicodeBidi() == Plaintext) |
| + direction = rootInlineBox->direction(); |
| + else |
| + direction = style()->direction(); |
| + |
| + bool isLTR = isLeftToRightDirection(direction); |
| + |
| + switch (textAlign) { |
| + case LEFT: |
| + case WEBKIT_LEFT: |
| + return LEFT; |
| + case RIGHT: |
| + case WEBKIT_RIGHT: |
| + return RIGHT; |
| + case CENTER: |
| + case WEBKIT_CENTER: |
| + return CENTER; |
| + case TASTART: |
| + return isLTR ? LEFT : RIGHT; |
| + case TAEND: |
| + return isLTR ? RIGHT : LEFT; |
| + default: |
| + break; |
| + } |
| + |
| + // Return JUSTIFY if reached. |
| + return textAlign; |
|
eae
2014/01/30 18:38:27
Why not change this to "return JUSTIFY" to clarify
mario.prada
2014/02/04 14:30:13
Ok :)
|
| +} |
| + |
| CursorDirective RenderObject::getCursor(const LayoutPoint&, Cursor&) const |
| { |
| return SetCursorBasedOnStyle; |