Bug 920377 part.18 Get rid of nsTextRangeStyle r=roc
authorMasayuki Nakano <masayuki@d-toybox.com>
Tue, 01 Oct 2013 16:22:59 +0900
changeset 163242 f94d70152968eafb220ca09cd6196458e36a94a1
parent 163241 d2f6e4dd2f91616436be308f81309a9f69eff073
child 163243 3cef286bd24f4fb8895c27284c207d44a9e9d3fe
push id3066
push userakeybl@mozilla.com
push dateMon, 09 Dec 2013 19:58:46 +0000
treeherdermozilla-beta@a31a0dce83aa [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersroc
bugs920377
milestone27.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 920377 part.18 Get rid of nsTextRangeStyle r=roc
content/base/public/nsISelectionPrivate.idl
content/events/public/nsIPrivateTextRange.h
content/events/src/nsPrivateTextRange.cpp
content/events/src/nsPrivateTextRange.h
editor/libeditor/base/IMETextTxn.cpp
layout/generic/Selection.h
layout/generic/nsFrameSelection.h
layout/generic/nsSelection.cpp
layout/generic/nsTextFrame.cpp
widget/EventForwards.h
widget/TextEvents.h
widget/nsGUIEventIPC.h
widget/windows/nsTextStore.cpp
--- a/content/base/public/nsISelectionPrivate.idl
+++ b/content/base/public/nsISelectionPrivate.idl
@@ -18,17 +18,17 @@ struct ScrollAxis;
 template<class T> class nsTArray;
 #include "nsDirection.h"
 #include "nsIPresShell.h" // TODO: Remove this include
 #include "mozilla/EventForwards.h"
 %}
 
 [ptr] native nsIFrame(nsIFrame);
 [ptr] native RangeArray(nsTArray<nsRange*>);
-[ref] native constTextRangeStyleRef(const nsTextRangeStyle);
+[ref] native constTextRangeStyleRef(const mozilla::TextRangeStyle);
 [ref] native nsPointRef(nsPoint);
 native nsDirection(nsDirection);
 native ScrollAxis(nsIPresShell::ScrollAxis);
 
 [scriptable, builtinclass, uuid(3ede44eb-2df8-41de-ab79-6f3dbd10090b)]
 interface nsISelectionPrivate : nsISelection
  {
     const short ENDOFPRECEDINGLINE=0;
--- a/content/events/public/nsIPrivateTextRange.h
+++ b/content/events/public/nsIPrivateTextRange.h
@@ -27,17 +27,17 @@ public:
     TEXTRANGE_SELECTEDRAWTEXT = 3,
     TEXTRANGE_CONVERTEDTEXT = 4,
     TEXTRANGE_SELECTEDCONVERTEDTEXT = 5
   };
 
   NS_IMETHOD    GetRangeStart(uint16_t* aRangeStart)=0;
   NS_IMETHOD    GetRangeEnd(uint16_t* aRangeEnd)=0;
   NS_IMETHOD    GetRangeType(uint16_t* aRangeType)=0;
-  NS_IMETHOD    GetRangeStyle(nsTextRangeStyle* aTextRangeStyle)=0;
+  NS_IMETHOD    GetRangeStyle(mozilla::TextRangeStyle* aTextRangeStyle)=0;
 };
 
 NS_DEFINE_STATIC_IID_ACCESSOR(nsIPrivateTextRange, NS_IPRIVATETEXTRANGE_IID)
 
 #define NS_IPRIVATETEXTRANGELIST_IID \
 {0xb5a04b19, 0xed33, 0x4cd0, \
 {0x82, 0xa8, 0xb7, 0x00, 0x83, 0xef, 0xc4, 0x91}}
 
--- a/content/events/src/nsPrivateTextRange.cpp
+++ b/content/events/src/nsPrivateTextRange.cpp
@@ -1,16 +1,18 @@
 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "nsPrivateTextRange.h"
 #include "mozilla/TextEvents.h"
 
+using namespace mozilla;
+
 nsPrivateTextRange::nsPrivateTextRange(const nsTextRange &aTextRange)
   : mRangeStart(uint16_t(aTextRange.mStartOffset)),
     mRangeEnd(uint16_t(aTextRange.mEndOffset)),
     mRangeType(uint16_t(aTextRange.mRangeType)),
     mRangeStyle(aTextRange.mRangeStyle)
 {
 }
 
@@ -33,17 +35,17 @@ NS_METHOD nsPrivateTextRange::GetRangeEn
 }
 
 NS_METHOD nsPrivateTextRange::GetRangeType(uint16_t* aRangeType)
 {
 	*aRangeType = mRangeType;
 	return NS_OK;
 }
 
-NS_METHOD nsPrivateTextRange::GetRangeStyle(nsTextRangeStyle* aTextRangeStyle)
+NS_METHOD nsPrivateTextRange::GetRangeStyle(TextRangeStyle* aTextRangeStyle)
 {
 	NS_ENSURE_ARG_POINTER(aTextRangeStyle);
 	*aTextRangeStyle = mRangeStyle;
 	return NS_OK;
 }
 
 NS_IMPL_ISUPPORTS1(nsPrivateTextRangeList, nsIPrivateTextRangeList)
 
--- a/content/events/src/nsPrivateTextRange.h
+++ b/content/events/src/nsPrivateTextRange.h
@@ -15,27 +15,27 @@
 class nsPrivateTextRange MOZ_FINAL : public nsIPrivateTextRange
 {
 	NS_DECL_ISUPPORTS
 public:
 
 	nsPrivateTextRange(const nsTextRange &aTextRange);
 	virtual ~nsPrivateTextRange(void);
 
-	NS_IMETHOD    GetRangeStart(uint16_t* aRangeStart) MOZ_OVERRIDE;
-	NS_IMETHOD    GetRangeEnd(uint16_t* aRangeEnd) MOZ_OVERRIDE;
-	NS_IMETHOD    GetRangeType(uint16_t* aRangeType) MOZ_OVERRIDE;
-	NS_IMETHOD    GetRangeStyle(nsTextRangeStyle* aRangeStyle) MOZ_OVERRIDE;
+	NS_IMETHOD GetRangeStart(uint16_t* aRangeStart) MOZ_OVERRIDE;
+	NS_IMETHOD GetRangeEnd(uint16_t* aRangeEnd) MOZ_OVERRIDE;
+	NS_IMETHOD GetRangeType(uint16_t* aRangeType) MOZ_OVERRIDE;
+	NS_IMETHOD GetRangeStyle(mozilla::TextRangeStyle* aRangeStyle) MOZ_OVERRIDE;
 
 protected:
 
 	uint16_t	mRangeStart;
 	uint16_t	mRangeEnd;
 	uint16_t	mRangeType;
-	nsTextRangeStyle mRangeStyle;
+	mozilla::TextRangeStyle mRangeStyle;
 };
 
 class nsPrivateTextRangeList MOZ_FINAL : public nsIPrivateTextRangeList
 {
 	NS_DECL_ISUPPORTS
 public:
 	nsPrivateTextRangeList(uint16_t aLength) : mList(aLength) {}
 
--- a/editor/libeditor/base/IMETextTxn.cpp
+++ b/editor/libeditor/base/IMETextTxn.cpp
@@ -1,16 +1,16 @@
 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "IMETextTxn.h"
 #include "mozilla/mozalloc.h"           // for operator new
-#include "mozilla/TextEvents.h"      // for nsTextRangeStyle
+#include "mozilla/TextEvents.h"         // for TextRangeStyle
 #include "nsAString.h"                  // for nsAString_internal::Length, etc
 #include "nsAutoPtr.h"                  // for nsRefPtr
 #include "nsDebug.h"                    // for NS_ASSERTION, etc
 #include "nsError.h"                    // for NS_SUCCEEDED, NS_FAILED, etc
 #include "nsIDOMCharacterData.h"        // for nsIDOMCharacterData
 #include "nsIDOMRange.h"                // for nsRange::SetEnd, etc
 #include "nsIContent.h"                 // for nsIContent
 #include "nsIEditor.h"                  // for nsIEditor
@@ -20,16 +20,18 @@
 #include "nsISelectionController.h"     // for nsISelectionController, etc
 #include "nsISelectionPrivate.h"        // for nsISelectionPrivate
 #include "nsISupportsImpl.h"            // for nsRange::AddRef, etc
 #include "nsISupportsUtils.h"           // for NS_ADDREF_THIS, NS_RELEASE
 #include "nsITransaction.h"             // for nsITransaction
 #include "nsRange.h"                    // for nsRange
 #include "nsString.h"                   // for nsString
 
+using namespace mozilla;
+
 // #define DEBUG_IMETXN
 
 IMETextTxn::IMETextTxn()
   : EditTxn()
 {
 }
 
 NS_IMPL_CYCLE_COLLECTION_INHERITED_1(IMETextTxn, EditTxn,
@@ -328,17 +330,17 @@ NS_IMETHODIMP IMETextTxn::CollapseTextSe
              result = imeSel->AddRange(newRange);
              NS_ASSERTION(NS_SUCCEEDED(result), "Cannot AddRange");
              if(NS_FAILED(result))
                 break;
 
              nsCOMPtr<nsISelectionPrivate> imeSelPriv(
                                              do_QueryInterface(imeSel));
              if (imeSelPriv) {
-               nsTextRangeStyle textRangeStyle;
+               TextRangeStyle textRangeStyle;
                result = textRange->GetRangeStyle(&textRangeStyle);
                NS_ASSERTION(NS_SUCCEEDED(result),
                             "nsIPrivateTextRange::GetRangeStyle failed");
                if (NS_FAILED(result))
                  break;
                result = imeSelPriv->SetTextRangeStyle(newRange, textRangeStyle);
                NS_ASSERTION(NS_SUCCEEDED(result),
                  "nsISelectionPrivate::SetTextRangeStyle failed");
--- a/layout/generic/Selection.h
+++ b/layout/generic/Selection.h
@@ -25,17 +25,17 @@ struct SelectionDetails;
 
 struct RangeData
 {
   RangeData(nsRange* aRange)
     : mRange(aRange)
   {}
 
   nsRefPtr<nsRange> mRange;
-  nsTextRangeStyle mTextRangeStyle;
+  mozilla::TextRangeStyle mTextRangeStyle;
 };
 
 // Note, the ownership of mozilla::Selection depends on which way the object is
 // created. When nsFrameSelection has created Selection, addreffing/releasing
 // the Selection object is aggregated to nsFrameSelection. Otherwise normal
 // addref/release is used.  This ensures that nsFrameSelection is never deleted
 // before its Selections.
 namespace mozilla {
--- a/layout/generic/nsFrameSelection.h
+++ b/layout/generic/nsFrameSelection.h
@@ -40,17 +40,17 @@ struct SelectionDetails
   }
   ~SelectionDetails() {
     MOZ_COUNT_DTOR(SelectionDetails);
   }
 #endif
   int32_t mStart;
   int32_t mEnd;
   SelectionType mType;
-  nsTextRangeStyle mTextRangeStyle;
+  mozilla::TextRangeStyle mTextRangeStyle;
   SelectionDetails *mNext;
 };
 
 class nsIPresShell;
 class nsIScrollableFrame;
 
 enum EWordMovementType { eStartWord, eEndWord, eDefaultBehavior };
 
--- a/layout/generic/nsSelection.cpp
+++ b/layout/generic/nsSelection.cpp
@@ -4120,17 +4120,17 @@ Selection::FindRangeData(nsIDOMRange* aR
     if (mRanges[i].mRange == aRange)
       return &mRanges[i];
   }
   return nullptr;
 }
 
 NS_IMETHODIMP
 Selection::SetTextRangeStyle(nsIDOMRange* aRange,
-                             const nsTextRangeStyle& aTextRangeStyle)
+                             const TextRangeStyle& aTextRangeStyle)
 {
   NS_ENSURE_ARG_POINTER(aRange);
   RangeData *rd = FindRangeData(aRange);
   if (rd) {
     rd->mTextRangeStyle = aTextRangeStyle;
   }
   return NS_OK;
 }
--- a/layout/generic/nsTextFrame.cpp
+++ b/layout/generic/nsTextFrame.cpp
@@ -5015,17 +5015,17 @@ PaintDecorationLine(nsIFrame* aFrame,
  * This, plus SelectionTypesWithDecorations, encapsulates all knowledge about
  * drawing text decoration for selections.
  */
 static void DrawSelectionDecorations(gfxContext* aContext,
     const gfxRect& aDirtyRect,
     SelectionType aType,
     nsTextFrame* aFrame,
     nsTextPaintStyle& aTextPaintStyle,
-    const nsTextRangeStyle &aRangeStyle,
+    const TextRangeStyle &aRangeStyle,
     const gfxPoint& aPt, gfxFloat aXInFrame, gfxFloat aWidth,
     gfxFloat aAscent, const gfxFont::Metrics& aFontMetrics,
     nsTextFrame::DrawPathCallbacks* aCallbacks)
 {
   gfxPoint pt(aPt);
   gfxSize size(aWidth,
                ComputeSelectionUnderlineHeight(aTextPaintStyle.PresContext(),
                                                aFontMetrics, aType));
@@ -5060,17 +5060,17 @@ static void DrawSelectionDecorations(gfx
       //  +---------------------+----------------------+--------------------
       //   ^                   ^ ^                    ^ ^
       //  gap                  gap                    gap
       pt.x += 1.0;
       size.width -= 2.0;
       if (aRangeStyle.IsDefined()) {
         // If IME defines the style, that should override our definition.
         if (aRangeStyle.IsLineStyleDefined()) {
-          if (aRangeStyle.mLineStyle == nsTextRangeStyle::LINESTYLE_NONE) {
+          if (aRangeStyle.mLineStyle == TextRangeStyle::LINESTYLE_NONE) {
             return;
           }
           style = aRangeStyle.mLineStyle;
           relativeSize = aRangeStyle.mIsBoldLine ? 2.0f : 1.0f;
         } else if (!weDefineSelectionUnderline) {
           // There is no underline style definition.
           return;
         }
@@ -5110,17 +5110,17 @@ static void DrawSelectionDecorations(gfx
  * and background colors.
  * @return true if the selection affects colors, false otherwise
  * @param aForeground the foreground color to use
  * @param aBackground the background color to use, or RGBA(0,0,0,0) if no
  * background should be painted
  */
 static bool GetSelectionTextColors(SelectionType aType,
                                      nsTextPaintStyle& aTextPaintStyle,
-                                     const nsTextRangeStyle &aRangeStyle,
+                                     const TextRangeStyle &aRangeStyle,
                                      nscolor* aForeground, nscolor* aBackground)
 {
   switch (aType) {
     case nsISelectionController::SELECTION_NORMAL:
       return aTextPaintStyle.GetSelectionColors(aForeground, aBackground);
     case nsISelectionController::SELECTION_FIND:
       aTextPaintStyle.GetHighlightColors(aForeground, aBackground);
       return true;
@@ -5211,17 +5211,17 @@ public:
    * @param aHyphenWidth if a hyphen is to be rendered after the text, the
    * width of the hyphen, otherwise zero
    * @param aType the selection type for this segment
    * @param aStyle the selection style for this segment
    * @return false if there are no more segments
    */
   bool GetNextSegment(gfxFloat* aXOffset, uint32_t* aOffset, uint32_t* aLength,
                         gfxFloat* aHyphenWidth, SelectionType* aType,
-                        nsTextRangeStyle* aStyle);
+                        TextRangeStyle* aStyle);
   void UpdateWithAdvance(gfxFloat aAdvance) {
     mXOffset += aAdvance*mTextRun->GetDirection();
   }
 
 private:
   SelectionDetails**      mSelectionDetails;
   PropertyProvider&       mProvider;
   gfxTextRun*             mTextRun;
@@ -5239,29 +5239,29 @@ SelectionIterator::SelectionIterator(Sel
     mOriginalStart(aStart), mOriginalEnd(aStart + aLength),
     mXOffset(aXOffset)
 {
   mIterator.SetOriginalOffset(aStart);
 }
 
 bool SelectionIterator::GetNextSegment(gfxFloat* aXOffset,
     uint32_t* aOffset, uint32_t* aLength, gfxFloat* aHyphenWidth,
-    SelectionType* aType, nsTextRangeStyle* aStyle)
+    SelectionType* aType, TextRangeStyle* aStyle)
 {
   if (mIterator.GetOriginalOffset() >= mOriginalEnd)
     return false;
   
   // save offset into transformed string now
   uint32_t runOffset = mIterator.GetSkippedOffset();
   
   int32_t index = mIterator.GetOriginalOffset() - mOriginalStart;
   SelectionDetails* sdptr = mSelectionDetails[index];
   SelectionType type =
     sdptr ? sdptr->mType : nsISelectionController::SELECTION_NONE;
-  nsTextRangeStyle style;
+  TextRangeStyle style;
   if (sdptr) {
     style = sdptr->mTextRangeStyle;
   }
   for (++index; mOriginalStart + index < mOriginalEnd; ++index) {
     if (sdptr != mSelectionDetails[index])
       break;
   }
   mIterator.SetOriginalOffset(index + mOriginalStart);
@@ -5425,17 +5425,17 @@ nsTextFrame::PaintTextWithSelectionColor
     // Nothing is selected in the given text range. XXX can this still occur?
     return false;
   }
 
   const gfxFloat startXOffset = aTextBaselinePt.x - aFramePt.x;
   gfxFloat xOffset, hyphenWidth;
   uint32_t offset, length; // in transformed string
   SelectionType type;
-  nsTextRangeStyle rangeStyle;
+  TextRangeStyle rangeStyle;
   // Draw background colors
   if (anyBackgrounds) {
     SelectionIterator iterator(prevailingSelections, aContentOffset, aContentLength,
                                aProvider, mTextRun, startXOffset);
     while (iterator.GetNextSegment(&xOffset, &offset, &length, &hyphenWidth,
                                    &type, &rangeStyle)) {
       nscolor foreground, background;
       GetSelectionTextColors(type, aTextPaintStyle, rangeStyle,
@@ -5557,17 +5557,17 @@ nsTextFrame::PaintTextSelectionDecoratio
   gfxFloat xOffset, hyphenWidth;
   uint32_t offset, length;
   int32_t app = aTextPaintStyle.PresContext()->AppUnitsPerDevPixel();
   // XXX aTextBaselinePt is in AppUnits, shouldn't it be nsFloatPoint?
   gfxPoint pt(0.0, (aTextBaselinePt.y - mAscent) / app);
   gfxRect dirtyRect(aDirtyRect.x / app, aDirtyRect.y / app,
                     aDirtyRect.width / app, aDirtyRect.height / app);
   SelectionType type;
-  nsTextRangeStyle selectedStyle;
+  TextRangeStyle selectedStyle;
   while (iterator.GetNextSegment(&xOffset, &offset, &length, &hyphenWidth,
                                  &type, &selectedStyle)) {
     gfxFloat advance = hyphenWidth +
       mTextRun->GetAdvanceWidth(offset, length, &aProvider);
     if (type == aSelectionType) {
       pt.x = (aFramePt.x + xOffset -
              (mTextRun->IsRightToLeft() ? advance : 0)) / app;
       gfxFloat width = Abs(advance) / app;
@@ -6245,20 +6245,20 @@ nsTextFrame::CombineSelectionUnderlineRe
       nsTextPaintStyle::GetUnderlineStyleIndexForSelectionType(sd->mType);
     if (sd->mType == nsISelectionController::SELECTION_SPELLCHECK) {
       if (!nsTextPaintStyle::GetSelectionUnderline(aPresContext, index, nullptr,
                                                    &relativeSize, &style)) {
         continue;
       }
     } else {
       // IME selections
-      nsTextRangeStyle& rangeStyle = sd->mTextRangeStyle;
+      TextRangeStyle& rangeStyle = sd->mTextRangeStyle;
       if (rangeStyle.IsDefined()) {
         if (!rangeStyle.IsLineStyleDefined() ||
-            rangeStyle.mLineStyle == nsTextRangeStyle::LINESTYLE_NONE) {
+            rangeStyle.mLineStyle == TextRangeStyle::LINESTYLE_NONE) {
           continue;
         }
         style = rangeStyle.mLineStyle;
         relativeSize = rangeStyle.mIsBoldLine ? 2.0f : 1.0f;
       } else if (!nsTextPaintStyle::GetSelectionUnderline(aPresContext, index,
                                                           nullptr, &relativeSize,
                                                           &style)) {
         continue;
--- a/widget/EventForwards.h
+++ b/widget/EventForwards.h
@@ -102,17 +102,16 @@ class WidgetPluginEvent;
 class InternalMutationEvent;
 } // namespace mozilla
 
 // TODO: Remove following typedefs
 typedef mozilla::WidgetEvent               nsEvent;
 typedef mozilla::WidgetGUIEvent            nsGUIEvent;
 typedef mozilla::WidgetInputEvent          nsInputEvent;
 typedef mozilla::InternalUIEvent           nsUIEvent;
-typedef mozilla::TextRangeStyle            nsTextRangeStyle;
 typedef mozilla::TextRange                 nsTextRange;
 typedef mozilla::TextRangeArray            nsTextRangeArray;
 typedef mozilla::WidgetTextEvent           nsTextEvent;
 typedef mozilla::WidgetCompositionEvent    nsCompositionEvent;
 typedef mozilla::WidgetQueryContentEvent   nsQueryContentEvent;
 typedef mozilla::WidgetSelectionEvent      nsSelectionEvent;
 typedef mozilla::WidgetMouseEventBase      nsMouseEvent_base;
 typedef mozilla::WidgetMouseEvent          nsMouseEvent;
--- a/widget/TextEvents.h
+++ b/widget/TextEvents.h
@@ -208,17 +208,17 @@ struct TextRangeStyle
   }
 
   bool IsNoChangeStyle() const
   {
     return !IsForegroundColorDefined() && !IsBackgroundColorDefined() &&
            IsLineStyleDefined() && mLineStyle == LINESTYLE_NONE;
   }
 
-  bool Equals(const nsTextRangeStyle& aOther)
+  bool Equals(const TextRangeStyle& aOther)
   {
     if (mDefinedStyles != aOther.mDefinedStyles)
       return false;
     if (IsLineStyleDefined() && (mLineStyle != aOther.mLineStyle ||
                                  !mIsBoldLine != !aOther.mIsBoldLine))
       return false;
     if (IsForegroundColorDefined() &&
         (mForegroundColor != aOther.mForegroundColor))
@@ -529,17 +529,16 @@ public:
   bool mExpandToClusterBoundary;
   // true if setting selection succeeded.
   bool mSucceeded;
 };
 
 } // namespace mozilla
 
 // TODO: Remove following typedefs
-typedef mozilla::TextRangeStyle          nsTextRangeStyle;
 typedef mozilla::TextRange               nsTextRange;
 typedef mozilla::TextRangeArray          nsTextRangeArray;
 typedef mozilla::WidgetTextEvent         nsTextEvent;
 typedef mozilla::WidgetCompositionEvent  nsCompositionEvent;
 typedef mozilla::WidgetQueryContentEvent nsQueryContentEvent;
 typedef mozilla::WidgetSelectionEvent    nsSelectionEvent;
 
 #endif // mozilla_TextEvents_h__
--- a/widget/nsGUIEventIPC.h
+++ b/widget/nsGUIEventIPC.h
@@ -284,19 +284,19 @@ struct ParamTraits<mozilla::WidgetKeyboa
       aResult->mNativeKeyEvent = NULL;
       return true;
     }
     return false;
   }
 };
 
 template<>
-struct ParamTraits<nsTextRangeStyle>
+struct ParamTraits<mozilla::TextRangeStyle>
 {
-  typedef nsTextRangeStyle paramType;
+  typedef mozilla::TextRangeStyle paramType;
 
   static void Write(Message* aMsg, const paramType& aParam)
   {
     WriteParam(aMsg, aParam.mDefinedStyles);
     WriteParam(aMsg, aParam.mLineStyle);
     WriteParam(aMsg, aParam.mIsBoldLine);
     WriteParam(aMsg, aParam.mForegroundColor);
     WriteParam(aMsg, aParam.mBackgroundColor);
--- a/widget/windows/nsTextStore.cpp
+++ b/widget/windows/nsTextStore.cpp
@@ -1421,29 +1421,29 @@ GetColor(const TF_DA_COLOR &aTSFColor, n
   }
 }
 
 static bool
 GetLineStyle(TF_DA_LINESTYLE aTSFLineStyle, uint8_t &aTextRangeLineStyle)
 {
   switch (aTSFLineStyle) {
     case TF_LS_NONE:
-      aTextRangeLineStyle = nsTextRangeStyle::LINESTYLE_NONE;
+      aTextRangeLineStyle = TextRangeStyle::LINESTYLE_NONE;
       return true;
     case TF_LS_SOLID:
-      aTextRangeLineStyle = nsTextRangeStyle::LINESTYLE_SOLID;
+      aTextRangeLineStyle = TextRangeStyle::LINESTYLE_SOLID;
       return true;
     case TF_LS_DOT:
-      aTextRangeLineStyle = nsTextRangeStyle::LINESTYLE_DOTTED;
+      aTextRangeLineStyle = TextRangeStyle::LINESTYLE_DOTTED;
       return true;
     case TF_LS_DASH:
-      aTextRangeLineStyle = nsTextRangeStyle::LINESTYLE_DASHED;
+      aTextRangeLineStyle = TextRangeStyle::LINESTYLE_DASHED;
       return true;
     case TF_LS_SQUIGGLE:
-      aTextRangeLineStyle = nsTextRangeStyle::LINESTYLE_WAVY;
+      aTextRangeLineStyle = TextRangeStyle::LINESTYLE_WAVY;
       return true;
     default:
       return false;
   }
 }
 
 HRESULT
 nsTextStore::RecordCompositionUpdateAction()
@@ -1539,29 +1539,29 @@ nsTextStore::RecordCompositionUpdateActi
     TF_DISPLAYATTRIBUTE attr;
     hr = GetDisplayAttribute(attrPropetry, range, &attr);
     if (FAILED(hr)) {
       newRange.mRangeType = NS_TEXTRANGE_RAWINPUT;
     } else {
       newRange.mRangeType = GetGeckoSelectionValue(attr);
       if (GetColor(attr.crText, newRange.mRangeStyle.mForegroundColor)) {
         newRange.mRangeStyle.mDefinedStyles |=
-                               nsTextRangeStyle::DEFINED_FOREGROUND_COLOR;
+                               TextRangeStyle::DEFINED_FOREGROUND_COLOR;
       }
       if (GetColor(attr.crBk, newRange.mRangeStyle.mBackgroundColor)) {
         newRange.mRangeStyle.mDefinedStyles |=
-                               nsTextRangeStyle::DEFINED_BACKGROUND_COLOR;
+                               TextRangeStyle::DEFINED_BACKGROUND_COLOR;
       }
       if (GetColor(attr.crLine, newRange.mRangeStyle.mUnderlineColor)) {
         newRange.mRangeStyle.mDefinedStyles |=
-                               nsTextRangeStyle::DEFINED_UNDERLINE_COLOR;
+                               TextRangeStyle::DEFINED_UNDERLINE_COLOR;
       }
       if (GetLineStyle(attr.lsStyle, newRange.mRangeStyle.mLineStyle)) {
         newRange.mRangeStyle.mDefinedStyles |=
-                               nsTextRangeStyle::DEFINED_LINESTYLE;
+                               TextRangeStyle::DEFINED_LINESTYLE;
         newRange.mRangeStyle.mIsBoldLine = attr.fBoldLine != 0;
       }
     }
 
     nsTextRange& lastRange = textRanges[textRanges.Length() - 1];
     if (lastRange.mStartOffset == newRange.mStartOffset) {
       // Replace range if last range is the same as this one
       // So that ranges don't overlap and confuse the editor