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

Side by Side Diff: third_party/WebKit/Source/core/layout/LayoutBoxModelObject.cpp

Issue 2507383002: Changed ETextAlign to an enum class and renamed its members to keywords (Closed)
Patch Set: Created 4 years, 1 month 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
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) 2005 Allan Sandfeld Jensen (kde@carewolf.com) 4 * (C) 2005 Allan Sandfeld Jensen (kde@carewolf.com)
5 * (C) 2005, 2006 Samuel Weinig (sam.weinig@gmail.com) 5 * (C) 2005, 2006 Samuel Weinig (sam.weinig@gmail.com)
6 * Copyright (C) 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. 6 * Copyright (C) 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved.
7 * Copyright (C) 2010 Google Inc. All rights reserved. 7 * Copyright (C) 2010 Google Inc. All rights reserved.
8 * 8 *
9 * This library is free software; you can redistribute it and/or 9 * This library is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU Library General Public 10 * modify it under the terms of the GNU Library General Public
(...skipping 1104 matching lines...) Expand 10 before | Expand all | Expand 10 after
1115 // However, as soon as some content is entered, the line boxes will be 1115 // However, as soon as some content is entered, the line boxes will be
1116 // constructed and this kludge is not called any more. So only the caret size 1116 // constructed and this kludge is not called any more. So only the caret size
1117 // of an empty :first-line'd block is wrong. I think we can live with that. 1117 // of an empty :first-line'd block is wrong. I think we can live with that.
1118 const ComputedStyle& currentStyle = firstLineStyleRef(); 1118 const ComputedStyle& currentStyle = firstLineStyleRef();
1119 1119
1120 enum CaretAlignment { AlignLeft, AlignRight, AlignCenter }; 1120 enum CaretAlignment { AlignLeft, AlignRight, AlignCenter };
1121 1121
1122 CaretAlignment alignment = AlignLeft; 1122 CaretAlignment alignment = AlignLeft;
1123 1123
1124 switch (currentStyle.textAlign()) { 1124 switch (currentStyle.textAlign()) {
1125 case LEFT: 1125 case ETextAlign::Left:
1126 case WEBKIT_LEFT: 1126 case ETextAlign::WebkitLeft:
1127 break; 1127 break;
1128 case CENTER: 1128 case ETextAlign::Center:
1129 case WEBKIT_CENTER: 1129 case ETextAlign::WebkitCenter:
1130 alignment = AlignCenter; 1130 alignment = AlignCenter;
1131 break; 1131 break;
1132 case RIGHT: 1132 case ETextAlign::Right:
1133 case WEBKIT_RIGHT: 1133 case ETextAlign::WebkitRight:
1134 alignment = AlignRight; 1134 alignment = AlignRight;
1135 break; 1135 break;
1136 case JUSTIFY: 1136 case ETextAlign::Justify:
1137 case TASTART: 1137 case ETextAlign::Start:
1138 if (!currentStyle.isLeftToRightDirection()) 1138 if (!currentStyle.isLeftToRightDirection())
1139 alignment = AlignRight; 1139 alignment = AlignRight;
1140 break; 1140 break;
1141 case TAEND: 1141 case ETextAlign::End:
1142 if (currentStyle.isLeftToRightDirection()) 1142 if (currentStyle.isLeftToRightDirection())
1143 alignment = AlignRight; 1143 alignment = AlignRight;
1144 break; 1144 break;
1145 } 1145 }
1146 1146
1147 LayoutUnit x = borderLeft() + paddingLeft(); 1147 LayoutUnit x = borderLeft() + paddingLeft();
1148 LayoutUnit maxX = width - borderRight() - paddingRight(); 1148 LayoutUnit maxX = width - borderRight() - paddingRight();
1149 1149
1150 switch (alignment) { 1150 switch (alignment) {
1151 case AlignLeft: 1151 case AlignLeft:
(...skipping 177 matching lines...) Expand 10 before | Expand all | Expand 10 after
1329 if (rootElementStyle->hasBackground()) 1329 if (rootElementStyle->hasBackground())
1330 return false; 1330 return false;
1331 1331
1332 if (node() != document().firstBodyElement()) 1332 if (node() != document().firstBodyElement())
1333 return false; 1333 return false;
1334 1334
1335 return true; 1335 return true;
1336 } 1336 }
1337 1337
1338 } // namespace blink 1338 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/layout/LayoutBox.cpp ('k') | third_party/WebKit/Source/core/layout/LayoutFieldset.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698