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

Side by Side Diff: Source/core/rendering/RenderObject.cpp

Issue 176763011: Revert "Consider text alignment and direction when computing the left offset for horizontal writing… (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 9 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 unified diff | Download patch
« no previous file with comments | « Source/core/rendering/RenderObject.h ('k') | Source/core/rendering/RenderText.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
3 * (C) 1999 Antti Koivisto (koivisto@kde.org) 3 * (C) 1999 Antti Koivisto (koivisto@kde.org)
4 * (C) 2000 Dirk Mueller (mueller@kde.org) 4 * (C) 2000 Dirk Mueller (mueller@kde.org)
5 * (C) 2004 Allan Sandfeld Jensen (kde@carewolf.com) 5 * (C) 2004 Allan Sandfeld Jensen (kde@carewolf.com)
6 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2011 Apple Inc. All rights reserv ed. 6 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2011 Apple Inc. All rights reserv ed.
7 * Copyright (C) 2009 Google Inc. All rights reserved. 7 * Copyright (C) 2009 Google Inc. All rights reserved.
8 * Copyright (C) 2009 Torch Mobile Inc. All rights reserved. (http://www.torchmo bile.com/) 8 * Copyright (C) 2009 Torch Mobile Inc. All rights reserved. (http://www.torchmo bile.com/)
9 * 9 *
10 * This library is free software; you can redistribute it and/or 10 * This library is free software; you can redistribute it and/or
(...skipping 3191 matching lines...) Expand 10 before | Expand all | Expand 10 after
3202 3202
3203 PositionWithAffinity RenderObject::createPositionWithAffinity(const Position& po sition) 3203 PositionWithAffinity RenderObject::createPositionWithAffinity(const Position& po sition)
3204 { 3204 {
3205 if (position.isNotNull()) 3205 if (position.isNotNull())
3206 return PositionWithAffinity(position); 3206 return PositionWithAffinity(position);
3207 3207
3208 ASSERT(!node()); 3208 ASSERT(!node());
3209 return createPositionWithAffinity(0, DOWNSTREAM); 3209 return createPositionWithAffinity(0, DOWNSTREAM);
3210 } 3210 }
3211 3211
3212 ETextAlign RenderObject::simplifiedTextAlign(const ETextAlign& textAlign, const RootInlineBox* rootInlineBox) const
3213 {
3214 TextDirection direction;
3215 if (rootInlineBox && rootInlineBox->renderer().style()->unicodeBidi() == Pla intext)
3216 direction = rootInlineBox->direction();
3217 else
3218 direction = style()->direction();
3219
3220 bool isLTR = isLeftToRightDirection(direction);
3221
3222 switch (textAlign) {
3223 case LEFT:
3224 case WEBKIT_LEFT:
3225 return LEFT;
3226 case RIGHT:
3227 case WEBKIT_RIGHT:
3228 return RIGHT;
3229 case CENTER:
3230 case WEBKIT_CENTER:
3231 return CENTER;
3232 case TASTART:
3233 return isLTR ? LEFT : RIGHT;
3234 case TAEND:
3235 return isLTR ? RIGHT : LEFT;
3236 default:
3237 break;
3238 }
3239
3240 // The point of this method is to return only LEFT, RIGHT, CENTER or
3241 // JUSTIFY, so we can only return JUSTIFY if this point is reached.
3242 return JUSTIFY;
3243 }
3244
3245 CursorDirective RenderObject::getCursor(const LayoutPoint&, Cursor&) const 3212 CursorDirective RenderObject::getCursor(const LayoutPoint&, Cursor&) const
3246 { 3213 {
3247 return SetCursorBasedOnStyle; 3214 return SetCursorBasedOnStyle;
3248 } 3215 }
3249 3216
3250 bool RenderObject::canUpdateSelectionOnRootLineBoxes() 3217 bool RenderObject::canUpdateSelectionOnRootLineBoxes()
3251 { 3218 {
3252 if (needsLayout()) 3219 if (needsLayout())
3253 return false; 3220 return false;
3254 3221
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after
3339 { 3306 {
3340 if (object1) { 3307 if (object1) {
3341 const WebCore::RenderObject* root = object1; 3308 const WebCore::RenderObject* root = object1;
3342 while (root->parent()) 3309 while (root->parent())
3343 root = root->parent(); 3310 root = root->parent();
3344 root->showRenderTreeAndMark(object1, "*", object2, "-", 0); 3311 root->showRenderTreeAndMark(object1, "*", object2, "-", 0);
3345 } 3312 }
3346 } 3313 }
3347 3314
3348 #endif 3315 #endif
OLDNEW
« no previous file with comments | « Source/core/rendering/RenderObject.h ('k') | Source/core/rendering/RenderText.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698