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

Unified Diff: third_party/WebKit/Source/core/layout/LayoutBlockFlowLine.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 side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/core/layout/LayoutBlockFlowLine.cpp
diff --git a/third_party/WebKit/Source/core/layout/LayoutBlockFlowLine.cpp b/third_party/WebKit/Source/core/layout/LayoutBlockFlowLine.cpp
index d0eb69cc11e4d3ec7faf76bbadeb589d74b514fb..220d0706be2cf38021a5d621899bdd6412b29cb3 100644
--- a/third_party/WebKit/Source/core/layout/LayoutBlockFlowLine.cpp
+++ b/third_party/WebKit/Source/core/layout/LayoutBlockFlowLine.cpp
@@ -363,20 +363,20 @@ ETextAlign LayoutBlockFlow::textAlignmentForLine(bool endsWithSoftBreak) const {
TextAlignLast alignmentLast = style()->getTextAlignLast();
switch (alignmentLast) {
case TextAlignLastStart:
- return TASTART;
+ return ETextAlign::Start;
case TextAlignLastEnd:
- return TAEND;
+ return ETextAlign::End;
case TextAlignLastLeft:
- return LEFT;
+ return ETextAlign::Left;
case TextAlignLastRight:
- return RIGHT;
+ return ETextAlign::Right;
case TextAlignLastCenter:
- return CENTER;
+ return ETextAlign::Center;
case TextAlignLastJustify:
- return JUSTIFY;
+ return ETextAlign::Justify;
case TextAlignLastAuto:
- if (alignment == JUSTIFY)
- return TASTART;
+ if (alignment == ETextAlign::Justify)
+ return ETextAlign::Start;
return alignment;
}
@@ -670,25 +670,25 @@ void LayoutBlockFlow::updateLogicalWidthForAlignment(
// position the objects horizontally. The total width of the line can be
// increased if we end up justifying text.
switch (textAlign) {
- case LEFT:
- case WEBKIT_LEFT:
+ case ETextAlign::Left:
+ case ETextAlign::WebkitLeft:
updateLogicalWidthForLeftAlignedBlock(
style()->isLeftToRightDirection(), trailingSpaceRun, logicalLeft,
totalLogicalWidth, availableLogicalWidth);
break;
- case RIGHT:
- case WEBKIT_RIGHT:
+ case ETextAlign::Right:
+ case ETextAlign::WebkitRight:
updateLogicalWidthForRightAlignedBlock(
style()->isLeftToRightDirection(), trailingSpaceRun, logicalLeft,
totalLogicalWidth, availableLogicalWidth);
break;
- case CENTER:
- case WEBKIT_CENTER:
+ case ETextAlign::Center:
+ case ETextAlign::WebkitCenter:
updateLogicalWidthForCenterAlignedBlock(
style()->isLeftToRightDirection(), trailingSpaceRun, logicalLeft,
totalLogicalWidth, availableLogicalWidth);
break;
- case JUSTIFY:
+ case ETextAlign::Justify:
adjustInlineDirectionLineBounds(expansionOpportunityCount, logicalLeft,
availableLogicalWidth);
if (expansionOpportunityCount) {
@@ -699,7 +699,7 @@ void LayoutBlockFlow::updateLogicalWidthForAlignment(
break;
}
// Fall through
- case TASTART:
+ case ETextAlign::Start:
if (direction == LTR)
updateLogicalWidthForLeftAlignedBlock(
style()->isLeftToRightDirection(), trailingSpaceRun, logicalLeft,
@@ -709,7 +709,7 @@ void LayoutBlockFlow::updateLogicalWidthForAlignment(
style()->isLeftToRightDirection(), trailingSpaceRun, logicalLeft,
totalLogicalWidth, availableLogicalWidth);
break;
- case TAEND:
+ case ETextAlign::End:
if (direction == LTR)
updateLogicalWidthForRightAlignedBlock(
style()->isLeftToRightDirection(), trailingSpaceRun, logicalLeft,
@@ -820,7 +820,7 @@ BidiRun* LayoutBlockFlow::computeInlineDirectionPositionsForSegment(
}
if (r->m_lineLayoutItem.isText()) {
LineLayoutText rt(r->m_lineLayoutItem);
- if (textAlign == JUSTIFY && r != trailingSpaceRun &&
+ if (textAlign == ETextAlign::Justify && r != trailingSpaceRun &&
textJustify != TextJustifyNone) {
if (!isAfterExpansion)
toInlineTextBox(r->m_box)->setCanHaveLeadingExpansion(true);
@@ -2470,15 +2470,15 @@ LayoutUnit LayoutBlockFlow::startAlignedOffsetForLine(
bool applyIndentText;
switch (textAlign) { // FIXME: Handle TAEND here
- case LEFT:
- case WEBKIT_LEFT:
+ case ETextAlign::Left:
+ case ETextAlign::WebkitLeft:
applyIndentText = style()->isLeftToRightDirection();
break;
- case RIGHT:
- case WEBKIT_RIGHT:
+ case ETextAlign::Right:
+ case ETextAlign::WebkitRight:
applyIndentText = !style()->isLeftToRightDirection();
break;
- case TASTART:
+ case ETextAlign::Start:
applyIndentText = true;
break;
default:
« no previous file with comments | « third_party/WebKit/Source/core/layout/LayoutBlockFlow.cpp ('k') | third_party/WebKit/Source/core/layout/LayoutBox.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698