Bug 1278014 part.8 Rename SelectionType::SELECTION_IME_SELECTEDRAWTEXT to SelectionType::eIMESelectedRawClause r?smaug
MozReview-Commit-ID: DgprOxg87K6
--- a/dom/base/nsISelectionController.idl
+++ b/dom/base/nsISelectionController.idl
@@ -284,18 +284,17 @@ namespace mozilla {
typedef short RawSelectionType;
enum class SelectionType : RawSelectionType
{
eInvalid = -1,
eNone = nsISelectionController::SELECTION_NONE,
eNormal = nsISelectionController::SELECTION_NORMAL,
eSpellCheck = nsISelectionController::SELECTION_SPELLCHECK,
eIMERawClause = nsISelectionController::SELECTION_IME_RAWINPUT,
- SELECTION_IME_SELECTEDRAWTEXT =
- nsISelectionController::SELECTION_IME_SELECTEDRAWTEXT,
+ eIMESelectedRawClause = nsISelectionController::SELECTION_IME_SELECTEDRAWTEXT,
SELECTION_IME_CONVERTEDTEXT =
nsISelectionController::SELECTION_IME_CONVERTEDTEXT,
SELECTION_IME_SELECTEDCONVERTEDTEXT =
nsISelectionController::SELECTION_IME_SELECTEDCONVERTEDTEXT,
SELECTION_ACCESSIBILITY =
nsISelectionController::SELECTION_ACCESSIBILITY,
SELECTION_FIND = nsISelectionController::SELECTION_FIND,
SELECTION_URLSECONDARY = nsISelectionController::SELECTION_URLSECONDARY,
--- a/editor/libeditor/nsEditor.cpp
+++ b/editor/libeditor/nsEditor.cpp
@@ -5142,17 +5142,17 @@ nsEditor::GetIMESelectionStartOffsetIn(n
nsCOMPtr<nsISelectionController> selectionController;
nsresult rv = GetSelectionController(getter_AddRefs(selectionController));
NS_ENSURE_SUCCESS(rv, -1);
NS_ENSURE_TRUE(selectionController, -1);
int32_t minOffset = INT32_MAX;
static const SelectionType kIMESelectionTypes[] = {
SelectionType::eIMERawClause,
- SelectionType::SELECTION_IME_SELECTEDRAWTEXT,
+ SelectionType::eIMESelectedRawClause,
SelectionType::SELECTION_IME_CONVERTEDTEXT,
SelectionType::SELECTION_IME_SELECTEDCONVERTEDTEXT
};
for (auto selectionType : kIMESelectionTypes) {
RefPtr<Selection> selection = GetSelection(selectionType);
if (!selection) {
continue;
}
--- a/layout/generic/nsSelection.cpp
+++ b/layout/generic/nsSelection.cpp
@@ -118,17 +118,17 @@ ToChar(SelectionType aSelectionType)
case SelectionType::eNone:
return "SelectionType::eNone";
case SelectionType::eNormal:
return "SelectionType::eNormal";
case SelectionType::eSpellCheck:
return "SelectionType::eSpellCheck";
case SelectionType::eIMERawClause:
return "SelectionType::eIMERawClause";
- case SelectionType::SELECTION_IME_SELECTEDRAWTEXT:
+ case SelectionType::eIMESelectedRawClause:
return "SelectionType::eIMESelectedRawClause";
case SelectionType::SELECTION_IME_CONVERTEDTEXT:
return "SelectionType::eIMEConvertedClause";
case SelectionType::SELECTION_IME_SELECTEDCONVERTEDTEXT:
return "SelectionType::eIMESelectedClause";
case SelectionType::SELECTION_ACCESSIBILITY:
return "SelectionType::eAccessibility";
case SelectionType::SELECTION_FIND:
@@ -145,17 +145,17 @@ ToChar(SelectionType aSelectionType)
static bool
IsValidSelectionType(RawSelectionType aRawSelectionType)
{
switch (static_cast<SelectionType>(aRawSelectionType)) {
case SelectionType::eNone:
case SelectionType::eNormal:
case SelectionType::eSpellCheck:
case SelectionType::eIMERawClause:
- case SelectionType::SELECTION_IME_SELECTEDRAWTEXT:
+ case SelectionType::eIMESelectedRawClause:
case SelectionType::SELECTION_IME_CONVERTEDTEXT:
case SelectionType::SELECTION_IME_SELECTEDCONVERTEDTEXT:
case SelectionType::SELECTION_ACCESSIBILITY:
case SelectionType::SELECTION_FIND:
case SelectionType::SELECTION_URLSECONDARY:
case SelectionType::SELECTION_URLSTRIKEOUT:
return true;
default:
@@ -352,17 +352,17 @@ GetIndexFromSelectionType(SelectionType
{
switch (aSelectionType) {
case SelectionType::eNormal:
return 0;
case SelectionType::eSpellCheck:
return 1;
case SelectionType::eIMERawClause:
return 2;
- case SelectionType::SELECTION_IME_SELECTEDRAWTEXT:
+ case SelectionType::eIMESelectedRawClause:
return 3;
case SelectionType::SELECTION_IME_CONVERTEDTEXT:
return 4;
case SelectionType::SELECTION_IME_SELECTEDCONVERTEDTEXT:
return 5;
case SelectionType::SELECTION_ACCESSIBILITY:
return 6;
case SelectionType::SELECTION_FIND:
@@ -379,17 +379,17 @@ GetIndexFromSelectionType(SelectionType
static SelectionType
GetSelectionTypeFromIndex(int8_t aIndex)
{
static const SelectionType kSelectionTypes[] = {
SelectionType::eNormal,
SelectionType::eSpellCheck,
SelectionType::eIMERawClause,
- SelectionType::SELECTION_IME_SELECTEDRAWTEXT,
+ SelectionType::eIMESelectedRawClause,
SelectionType::SELECTION_IME_CONVERTEDTEXT,
SelectionType::SELECTION_IME_SELECTEDCONVERTEDTEXT,
SelectionType::SELECTION_ACCESSIBILITY,
SelectionType::SELECTION_FIND,
SelectionType::SELECTION_URLSECONDARY,
SelectionType::SELECTION_URLSTRIKEOUT
};
if (NS_WARN_IF(aIndex < 0) ||
--- a/layout/generic/nsTextFrame.cpp
+++ b/layout/generic/nsTextFrame.cpp
@@ -341,17 +341,17 @@ public:
};
static int32_t GetUnderlineStyleIndexForSelectionType(
SelectionType aSelectionType)
{
switch (aSelectionType) {
case SelectionType::eIMERawClause:
return eIndexRawInput;
- case SelectionType::SELECTION_IME_SELECTEDRAWTEXT:
+ case SelectionType::eIMESelectedRawClause:
return eIndexSelRawText;
case SelectionType::SELECTION_IME_CONVERTEDTEXT:
return eIndexConvText;
case SelectionType::SELECTION_IME_SELECTEDCONVERTEDTEXT:
return eIndexSelConvText;
case SelectionType::eSpellCheck:
return eIndexSpellChecker;
default:
@@ -5426,17 +5426,17 @@ static const RawSelectionType kRawSelect
gfxFloat
nsTextFrame::ComputeSelectionUnderlineHeight(
nsPresContext* aPresContext,
const gfxFont::Metrics& aFontMetrics,
SelectionType aSelectionType)
{
switch (aSelectionType) {
case SelectionType::eIMERawClause:
- case SelectionType::SELECTION_IME_SELECTEDRAWTEXT:
+ case SelectionType::eIMESelectedRawClause:
case SelectionType::SELECTION_IME_CONVERTEDTEXT:
case SelectionType::SELECTION_IME_SELECTEDCONVERTEDTEXT:
return aFontMetrics.underlineSize;
case SelectionType::eSpellCheck: {
// The thickness of the spellchecker underline shouldn't honor the font
// metrics. It should be constant pixels value which is decided from the
// default font size. Note that if the actual font size is smaller than
// the default font size, we should use the actual font size because the
@@ -5537,17 +5537,17 @@ nsTextFrame::DrawSelectionDecorations(gf
nsTextPaintStyle::GetUnderlineStyleIndexForSelectionType(aSelectionType);
bool weDefineSelectionUnderline =
aTextPaintStyle.GetSelectionUnderlineForPaint(index, ¶ms.color,
&relativeSize, ¶ms.style);
switch (aSelectionType) {
case SelectionType::eIMERawClause:
- case SelectionType::SELECTION_IME_SELECTEDRAWTEXT:
+ case SelectionType::eIMESelectedRawClause:
case SelectionType::SELECTION_IME_CONVERTEDTEXT:
case SelectionType::SELECTION_IME_SELECTEDCONVERTEDTEXT: {
// IME decoration lines should not be drawn on the both ends, i.e., we
// need to cut both edges of the decoration lines. Because same style
// IME selections can adjoin, but the users need to be able to know
// where are the boundaries of the selections.
//
// X: underline
@@ -5642,17 +5642,17 @@ nsTextFrame::GetSelectionTextColors(Sele
case SelectionType::SELECTION_FIND:
aTextPaintStyle.GetHighlightColors(aForeground, aBackground);
return true;
case SelectionType::SELECTION_URLSECONDARY:
aTextPaintStyle.GetURLSecondaryColor(aForeground);
*aBackground = NS_RGBA(0,0,0,0);
return true;
case SelectionType::eIMERawClause:
- case SelectionType::SELECTION_IME_SELECTEDRAWTEXT:
+ case SelectionType::eIMESelectedRawClause:
case SelectionType::SELECTION_IME_CONVERTEDTEXT:
case SelectionType::SELECTION_IME_SELECTEDCONVERTEDTEXT:
if (aRangeStyle.IsDefined()) {
if (!aRangeStyle.IsForegroundColorDefined() &&
!aRangeStyle.IsBackgroundColorDefined()) {
*aForeground = aTextPaintStyle.GetTextColor();
*aBackground = NS_RGBA(0,0,0,0);
return false;
--- a/widget/WidgetEventImpl.cpp
+++ b/widget/WidgetEventImpl.cpp
@@ -109,17 +109,17 @@ ToChar(TextRangeType aTextRangeType)
SelectionType
ToSelectionType(TextRangeType aTextRangeType)
{
switch (aTextRangeType) {
case TextRangeType::eRawClause:
return SelectionType::eIMERawClause;
case TextRangeType::eSelectedRawClause:
- return SelectionType::SELECTION_IME_SELECTEDRAWTEXT;
+ return SelectionType::eIMESelectedRawClause;
case TextRangeType::eConvertedClause:
return SelectionType::SELECTION_IME_CONVERTEDTEXT;
case TextRangeType::eSelectedClause:
return SelectionType::SELECTION_IME_SELECTEDCONVERTEDTEXT;
default:
MOZ_CRASH("TextRangeType is invalid");
return SelectionType::eNormal;
}