Bug 1278014 part.7 Rename SelectionType::SELECTION_IME_RAWINPUT to SelectionType::eIMERawClause r?smaug draft
authorMasayuki Nakano <masayuki@d-toybox.com>
Thu, 09 Jun 2016 18:51:49 +0900
changeset 377652 85aace2eb3d5cbdd0f468987a79860f7e8874a0b
parent 377651 ddf076a9c1fe6c00d7404ac6432d0d2bb9e5b1b8
child 377653 5145503b9f81398dd9206b0fcdc38b32516d94d5
push id20850
push usermasayuki@d-toybox.com
push dateSat, 11 Jun 2016 06:51:43 +0000
reviewerssmaug
bugs1278014
milestone50.0a1
Bug 1278014 part.7 Rename SelectionType::SELECTION_IME_RAWINPUT to SelectionType::eIMERawClause r?smaug MozReview-Commit-ID: BRe10Lyx5mt
dom/base/nsISelectionController.idl
editor/libeditor/nsEditor.cpp
layout/generic/nsSelection.cpp
layout/generic/nsTextFrame.cpp
widget/WidgetEventImpl.cpp
--- a/dom/base/nsISelectionController.idl
+++ b/dom/base/nsISelectionController.idl
@@ -283,17 +283,17 @@ namespace mozilla {
 
 typedef short RawSelectionType;
 enum class SelectionType : RawSelectionType
 {
   eInvalid = -1,
   eNone = nsISelectionController::SELECTION_NONE,
   eNormal = nsISelectionController::SELECTION_NORMAL,
   eSpellCheck = nsISelectionController::SELECTION_SPELLCHECK,
-  SELECTION_IME_RAWINPUT = nsISelectionController::SELECTION_IME_RAWINPUT,
+  eIMERawClause = nsISelectionController::SELECTION_IME_RAWINPUT,
   SELECTION_IME_SELECTEDRAWTEXT =
     nsISelectionController::SELECTION_IME_SELECTEDRAWTEXT,
   SELECTION_IME_CONVERTEDTEXT =
     nsISelectionController::SELECTION_IME_CONVERTEDTEXT,
   SELECTION_IME_SELECTEDCONVERTEDTEXT =
     nsISelectionController::SELECTION_IME_SELECTEDCONVERTEDTEXT,
   SELECTION_ACCESSIBILITY =
     nsISelectionController::SELECTION_ACCESSIBILITY,
--- a/editor/libeditor/nsEditor.cpp
+++ b/editor/libeditor/nsEditor.cpp
@@ -5141,17 +5141,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::SELECTION_IME_RAWINPUT,
+    SelectionType::eIMERawClause,
     SelectionType::SELECTION_IME_SELECTEDRAWTEXT,
     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
@@ -116,17 +116,17 @@ ToChar(SelectionType aSelectionType)
     case SelectionType::eInvalid:
       return "SelectionType::eInvalid";
     case SelectionType::eNone:
       return "SelectionType::eNone";
     case SelectionType::eNormal:
       return "SelectionType::eNormal";
     case SelectionType::eSpellCheck:
       return "SelectionType::eSpellCheck";
-    case SelectionType::SELECTION_IME_RAWINPUT:
+    case SelectionType::eIMERawClause:
       return "SelectionType::eIMERawClause";
     case SelectionType::SELECTION_IME_SELECTEDRAWTEXT:
       return "SelectionType::eIMESelectedRawClause";
     case SelectionType::SELECTION_IME_CONVERTEDTEXT:
       return "SelectionType::eIMEConvertedClause";
     case SelectionType::SELECTION_IME_SELECTEDCONVERTEDTEXT:
       return "SelectionType::eIMESelectedClause";
     case SelectionType::SELECTION_ACCESSIBILITY:
@@ -144,17 +144,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::SELECTION_IME_RAWINPUT:
+    case SelectionType::eIMERawClause:
     case SelectionType::SELECTION_IME_SELECTEDRAWTEXT:
     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;
@@ -350,17 +350,17 @@ nsresult NS_NewDomSelection(nsISelection
 static int8_t
 GetIndexFromSelectionType(SelectionType aSelectionType)
 {
   switch (aSelectionType) {
     case SelectionType::eNormal:
       return 0;
     case SelectionType::eSpellCheck:
       return 1;
-    case SelectionType::SELECTION_IME_RAWINPUT:
+    case SelectionType::eIMERawClause:
       return 2;
     case SelectionType::SELECTION_IME_SELECTEDRAWTEXT:
       return 3;
     case SelectionType::SELECTION_IME_CONVERTEDTEXT:
       return 4;
     case SelectionType::SELECTION_IME_SELECTEDCONVERTEDTEXT:
       return 5;
     case SelectionType::SELECTION_ACCESSIBILITY:
@@ -378,17 +378,17 @@ GetIndexFromSelectionType(SelectionType 
 }
 
 static SelectionType
 GetSelectionTypeFromIndex(int8_t aIndex)
 {
   static const SelectionType kSelectionTypes[] = {
     SelectionType::eNormal,
     SelectionType::eSpellCheck,
-    SelectionType::SELECTION_IME_RAWINPUT,
+    SelectionType::eIMERawClause,
     SelectionType::SELECTION_IME_SELECTEDRAWTEXT,
     SelectionType::SELECTION_IME_CONVERTEDTEXT,
     SelectionType::SELECTION_IME_SELECTEDCONVERTEDTEXT,
     SelectionType::SELECTION_ACCESSIBILITY,
     SelectionType::SELECTION_FIND,
     SelectionType::SELECTION_URLSECONDARY,
     SelectionType::SELECTION_URLSTRIKEOUT
   };
--- a/layout/generic/nsTextFrame.cpp
+++ b/layout/generic/nsTextFrame.cpp
@@ -339,17 +339,17 @@ public:
     eIndexSelConvText,
     eIndexSpellChecker
   };
 
   static int32_t GetUnderlineStyleIndexForSelectionType(
                    SelectionType aSelectionType)
   {
     switch (aSelectionType) {
-      case SelectionType::SELECTION_IME_RAWINPUT:
+      case SelectionType::eIMERawClause:
         return eIndexRawInput;
       case SelectionType::SELECTION_IME_SELECTEDRAWTEXT:
         return eIndexSelRawText;
       case SelectionType::SELECTION_IME_CONVERTEDTEXT:
         return eIndexConvText;
       case SelectionType::SELECTION_IME_SELECTEDCONVERTEDTEXT:
         return eIndexSelConvText;
       case SelectionType::eSpellCheck:
@@ -5425,17 +5425,17 @@ static const RawSelectionType kRawSelect
 /* static */
 gfxFloat
 nsTextFrame::ComputeSelectionUnderlineHeight(
                nsPresContext* aPresContext,
                const gfxFont::Metrics& aFontMetrics,
                SelectionType aSelectionType)
 {
   switch (aSelectionType) {
-    case SelectionType::SELECTION_IME_RAWINPUT:
+    case SelectionType::eIMERawClause:
     case SelectionType::SELECTION_IME_SELECTEDRAWTEXT:
     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
@@ -5536,17 +5536,17 @@ nsTextFrame::DrawSelectionDecorations(gf
   int32_t index =
     nsTextPaintStyle::GetUnderlineStyleIndexForSelectionType(aSelectionType);
   bool weDefineSelectionUnderline =
     aTextPaintStyle.GetSelectionUnderlineForPaint(index, &params.color,
                                                   &relativeSize, &params.style);
 
 
   switch (aSelectionType) {
-    case SelectionType::SELECTION_IME_RAWINPUT:
+    case SelectionType::eIMERawClause:
     case SelectionType::SELECTION_IME_SELECTEDRAWTEXT:
     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.
       //
@@ -5641,17 +5641,17 @@ nsTextFrame::GetSelectionTextColors(Sele
       return aTextPaintStyle.GetSelectionColors(aForeground, aBackground);
     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::SELECTION_IME_RAWINPUT:
+    case SelectionType::eIMERawClause:
     case SelectionType::SELECTION_IME_SELECTEDRAWTEXT:
     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);
--- a/widget/WidgetEventImpl.cpp
+++ b/widget/WidgetEventImpl.cpp
@@ -107,17 +107,17 @@ ToChar(TextRangeType aTextRangeType)
   }
 }
 
 SelectionType
 ToSelectionType(TextRangeType aTextRangeType)
 {
   switch (aTextRangeType) {
     case TextRangeType::eRawClause:
-      return SelectionType::SELECTION_IME_RAWINPUT;
+      return SelectionType::eIMERawClause;
     case TextRangeType::eSelectedRawClause:
       return SelectionType::SELECTION_IME_SELECTEDRAWTEXT;
     case TextRangeType::eConvertedClause:
       return SelectionType::SELECTION_IME_CONVERTEDTEXT;
     case TextRangeType::eSelectedClause:
       return SelectionType::SELECTION_IME_SELECTEDCONVERTEDTEXT;
     default:
       MOZ_CRASH("TextRangeType is invalid");