Bug 1278014 part.13 Rename SelectionType::SELECTION_URLSECONDARY to SelectionType::eURLSecondary r?smaug
MozReview-Commit-ID: C2IW7nqjEkD
--- a/dom/base/nsISelectionController.idl
+++ b/dom/base/nsISelectionController.idl
@@ -290,17 +290,17 @@ enum class SelectionType : RawSelectionT
eSpellCheck = nsISelectionController::SELECTION_SPELLCHECK,
eIMERawClause = nsISelectionController::SELECTION_IME_RAWINPUT,
eIMESelectedRawClause = nsISelectionController::SELECTION_IME_SELECTEDRAWTEXT,
eIMEConvertedClause = nsISelectionController::SELECTION_IME_CONVERTEDTEXT,
eIMESelectedClause =
nsISelectionController::SELECTION_IME_SELECTEDCONVERTEDTEXT,
eAccessibility = nsISelectionController::SELECTION_ACCESSIBILITY,
eFind = nsISelectionController::SELECTION_FIND,
- SELECTION_URLSECONDARY = nsISelectionController::SELECTION_URLSECONDARY,
+ eURLSecondary = nsISelectionController::SELECTION_URLSECONDARY,
SELECTION_URLSTRIKEOUT = nsISelectionController::SELECTION_URLSTRIKEOUT,
};
// Using anonymous enum to define constants because these constants may be
// used at defining fixed size array in some header files (e.g.,
// nsFrameSelection.h). So, the values needs to be defined here, but we cannot
// use static/const even with extern since it causes failing to link or
// initializes them after such headers.
--- a/layout/generic/nsFrame.cpp
+++ b/layout/generic/nsFrame.cpp
@@ -3372,17 +3372,17 @@ nsFrame::HandlePress(nsPresContext* aPre
//
// If the user clicked inside a selection, then just
// return without doing anything. We will handle placing
// the caret later on when the mouse is released. We ignore
// the spellcheck, find and url formatting selections.
//
if (curDetail->mSelectionType != SelectionType::eSpellCheck &&
curDetail->mSelectionType != SelectionType::eFind &&
- curDetail->mSelectionType != SelectionType::SELECTION_URLSECONDARY &&
+ curDetail->mSelectionType != SelectionType::eURLSecondary &&
curDetail->mSelectionType != SelectionType::SELECTION_URLSTRIKEOUT &&
curDetail->mStart <= offsets.StartOffset() &&
offsets.EndOffset() <= curDetail->mEnd)
{
inSelection = true;
}
SelectionDetails *nextDetail = curDetail->mNext;
--- a/layout/generic/nsSelection.cpp
+++ b/layout/generic/nsSelection.cpp
@@ -128,17 +128,17 @@ ToChar(SelectionType aSelectionType)
case SelectionType::eIMEConvertedClause:
return "SelectionType::eIMEConvertedClause";
case SelectionType::eIMESelectedClause:
return "SelectionType::eIMESelectedClause";
case SelectionType::eAccessibility:
return "SelectionType::eAccessibility";
case SelectionType::eFind:
return "SelectionType::eFind";
- case SelectionType::SELECTION_URLSECONDARY:
+ case SelectionType::eURLSecondary:
return "SelectionType::eURLSecondary";
case SelectionType::SELECTION_URLSTRIKEOUT:
return "SelectionType::eURLStrikeout";
default:
return "Invalid SelectionType";
}
}
@@ -150,17 +150,17 @@ IsValidSelectionType(RawSelectionType aR
case SelectionType::eNormal:
case SelectionType::eSpellCheck:
case SelectionType::eIMERawClause:
case SelectionType::eIMESelectedRawClause:
case SelectionType::eIMEConvertedClause:
case SelectionType::eIMESelectedClause:
case SelectionType::eAccessibility:
case SelectionType::eFind:
- case SelectionType::SELECTION_URLSECONDARY:
+ case SelectionType::eURLSecondary:
case SelectionType::SELECTION_URLSTRIKEOUT:
return true;
default:
return false;
}
}
SelectionType
@@ -362,17 +362,17 @@ GetIndexFromSelectionType(SelectionType
case SelectionType::eIMEConvertedClause:
return 4;
case SelectionType::eIMESelectedClause:
return 5;
case SelectionType::eAccessibility:
return 6;
case SelectionType::eFind:
return 7;
- case SelectionType::SELECTION_URLSECONDARY:
+ case SelectionType::eURLSecondary:
return 8;
case SelectionType::SELECTION_URLSTRIKEOUT:
return 9;
default:
return -1;
}
/* NOTREACHED */
}
@@ -384,17 +384,17 @@ GetSelectionTypeFromIndex(int8_t aIndex)
SelectionType::eNormal,
SelectionType::eSpellCheck,
SelectionType::eIMERawClause,
SelectionType::eIMESelectedRawClause,
SelectionType::eIMEConvertedClause,
SelectionType::eIMESelectedClause,
SelectionType::eAccessibility,
SelectionType::eFind,
- SelectionType::SELECTION_URLSECONDARY,
+ SelectionType::eURLSecondary,
SelectionType::SELECTION_URLSTRIKEOUT
};
if (NS_WARN_IF(aIndex < 0) ||
NS_WARN_IF(static_cast<size_t>(aIndex) >= ArrayLength(kSelectionTypes))) {
return SelectionType::eNormal;
}
return kSelectionTypes[aIndex];
}
--- a/layout/generic/nsTextFrame.cpp
+++ b/layout/generic/nsTextFrame.cpp
@@ -5637,17 +5637,17 @@ nsTextFrame::GetSelectionTextColors(Sele
nscolor* aBackground)
{
switch (aSelectionType) {
case SelectionType::eNormal:
return aTextPaintStyle.GetSelectionColors(aForeground, aBackground);
case SelectionType::eFind:
aTextPaintStyle.GetHighlightColors(aForeground, aBackground);
return true;
- case SelectionType::SELECTION_URLSECONDARY:
+ case SelectionType::eURLSecondary:
aTextPaintStyle.GetURLSecondaryColor(aForeground);
*aBackground = NS_RGBA(0,0,0,0);
return true;
case SelectionType::eIMERawClause:
case SelectionType::eIMESelectedRawClause:
case SelectionType::eIMEConvertedClause:
case SelectionType::eIMESelectedClause:
if (aRangeStyle.IsDefined()) {