Index: third_party/WebKit/Source/core/layout/line/RootInlineBox.cpp |
diff --git a/third_party/WebKit/Source/core/layout/line/RootInlineBox.cpp b/third_party/WebKit/Source/core/layout/line/RootInlineBox.cpp |
index 1fc5957e37eeea9caf5febd61acef00a710b64b0..82295b7c1bdec731c8f12b1da8186e5838694053 100644 |
--- a/third_party/WebKit/Source/core/layout/line/RootInlineBox.cpp |
+++ b/third_party/WebKit/Source/core/layout/line/RootInlineBox.cpp |
@@ -343,21 +343,26 @@ LayoutUnit RootInlineBox::BeforeAnnotationsAdjustment() const { |
SelectionState RootInlineBox::GetSelectionState() const { |
// Walk over all of the selected boxes. |
- SelectionState state = SelectionNone; |
+ SelectionState state = SelectionState::kNone; |
for (InlineBox* box = FirstLeafChild(); box; box = box->NextLeafChild()) { |
SelectionState box_state = box->GetSelectionState(); |
- if ((box_state == SelectionStart && state == SelectionEnd) || |
- (box_state == SelectionEnd && state == SelectionStart)) { |
- state = SelectionBoth; |
- } else if (state == SelectionNone || |
- ((box_state == SelectionStart || box_state == SelectionEnd) && |
- (state == SelectionNone || state == SelectionInside))) { |
+ if ((box_state == SelectionState::kStart && |
+ state == SelectionState::kEnd) || |
+ (box_state == SelectionState::kEnd && |
+ state == SelectionState::kStart)) { |
+ state = SelectionState::kStartAndEnd; |
+ } else if (state == SelectionState::kNone || |
+ ((box_state == SelectionState::kStart || |
+ box_state == SelectionState::kEnd) && |
+ (state == SelectionState::kNone || |
+ state == SelectionState::kInside))) { |
state = box_state; |
- } else if (box_state == SelectionNone && state == SelectionStart) { |
+ } else if (box_state == SelectionState::kNone && |
+ state == SelectionState::kStart) { |
// We are past the end of the selection. |
- state = SelectionBoth; |
+ state = SelectionState::kStartAndEnd; |
} |
- if (state == SelectionBoth) |
+ if (state == SelectionState::kStartAndEnd) |
break; |
} |
@@ -366,7 +371,7 @@ SelectionState RootInlineBox::GetSelectionState() const { |
InlineBox* RootInlineBox::FirstSelectedBox() const { |
for (InlineBox* box = FirstLeafChild(); box; box = box->NextLeafChild()) { |
- if (box->GetSelectionState() != SelectionNone) |
+ if (box->GetSelectionState() != SelectionState::kNone) |
return box; |
} |
@@ -375,7 +380,7 @@ InlineBox* RootInlineBox::FirstSelectedBox() const { |
InlineBox* RootInlineBox::LastSelectedBox() const { |
for (InlineBox* box = LastLeafChild(); box; box = box->PrevLeafChild()) { |
- if (box->GetSelectionState() != SelectionNone) |
+ if (box->GetSelectionState() != SelectionState::kNone) |
return box; |
} |