Bug 895274 part.154 Rename NS_QUERY_CARET_RECT to eQueryCaretRect r=smaug
authorMasayuki Nakano <masayuki@d-toybox.com>
Thu, 10 Sep 2015 10:40:06 +0900
changeset 294300 1a346d89cc2358675297e2014aa1e56146e71ae0
parent 294299 25399075c9efe898cb2b2f137e4affeace30cd47
child 294301 a5c0e8cbf6073fe223f50ce2d8056678f69c88d5
push id5245
push userraliiev@mozilla.com
push dateThu, 29 Oct 2015 11:30:51 +0000
treeherdermozilla-beta@dac831dc1bd0 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssmaug
bugs895274
milestone43.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 895274 part.154 Rename NS_QUERY_CARET_RECT to eQueryCaretRect r=smaug
dom/base/nsDOMWindowUtils.cpp
dom/base/nsQueryContentEventResult.cpp
dom/events/ContentEventHandler.cpp
dom/events/ContentEventHandler.h
dom/events/EventStateManager.cpp
dom/events/IMEContentObserver.cpp
dom/ipc/TabParent.cpp
widget/ContentCache.cpp
widget/ContentCache.h
widget/EventMessageList.h
widget/TextEvents.h
widget/cocoa/TextInputHandler.mm
widget/gtk/IMContextWrapper.cpp
widget/windows/IMMHandler.cpp
widget/windows/TSFTextStore.cpp
--- a/dom/base/nsDOMWindowUtils.cpp
+++ b/dom/base/nsDOMWindowUtils.cpp
@@ -1928,17 +1928,17 @@ nsDOMWindowUtils::SendQueryContentEvent(
   switch (aType) {
     case QUERY_SELECTED_TEXT:
       message = eQuerySelectedText;
       break;
     case QUERY_TEXT_CONTENT:
       message = eQueryTextContent;
       break;
     case QUERY_CARET_RECT:
-      message = NS_QUERY_CARET_RECT;
+      message = eQueryCaretRect;
       break;
     case QUERY_TEXT_RECT:
       message = NS_QUERY_TEXT_RECT;
       break;
     case QUERY_EDITOR_RECT:
       message = NS_QUERY_EDITOR_RECT;
       break;
     case QUERY_CHARACTER_AT_POINT:
@@ -1983,17 +1983,17 @@ nsDOMWindowUtils::SendQueryContentEvent(
 
   WidgetQueryContentEvent queryEvent(true, message, targetWidget);
   InitEvent(queryEvent, &pt);
 
   switch (message) {
     case eQueryTextContent:
       queryEvent.InitForQueryTextContent(aOffset, aLength, useNativeLineBreak);
       break;
-    case NS_QUERY_CARET_RECT:
+    case eQueryCaretRect:
       queryEvent.InitForQueryCaretRect(aOffset, useNativeLineBreak);
       break;
     case NS_QUERY_TEXT_RECT:
       queryEvent.InitForQueryTextRect(aOffset, aLength, useNativeLineBreak);
       break;
     default:
       queryEvent.mUseNativeLineBreak = useNativeLineBreak;
       break;
--- a/dom/base/nsQueryContentEventResult.cpp
+++ b/dom/base/nsQueryContentEventResult.cpp
@@ -52,17 +52,17 @@ nsQueryContentEventResult::GetTentativeC
     return NS_ERROR_NOT_AVAILABLE;
   }
   *aOffset = mTentativeCaretOffset;
   return NS_OK;
 }
 
 static bool IsRectEnabled(EventMessage aEventMessage)
 {
-  return aEventMessage == NS_QUERY_CARET_RECT ||
+  return aEventMessage == eQueryCaretRect ||
          aEventMessage == NS_QUERY_TEXT_RECT ||
          aEventMessage == NS_QUERY_EDITOR_RECT ||
          aEventMessage == NS_QUERY_CHARACTER_AT_POINT;
 }
 
 NS_IMETHODIMP
 nsQueryContentEventResult::GetReversed(bool *aReversed)
 {
--- a/dom/events/ContentEventHandler.cpp
+++ b/dom/events/ContentEventHandler.cpp
@@ -795,17 +795,17 @@ ContentEventHandler::GetLineBreakType(bo
 nsresult
 ContentEventHandler::HandleQueryContentEvent(WidgetQueryContentEvent* aEvent)
 {
   switch (aEvent->mMessage) {
     case eQuerySelectedText:
       return OnQuerySelectedText(aEvent);
     case eQueryTextContent:
       return OnQueryTextContent(aEvent);
-    case NS_QUERY_CARET_RECT:
+    case eQueryCaretRect:
       return OnQueryCaretRect(aEvent);
     case NS_QUERY_TEXT_RECT:
       return OnQueryTextRect(aEvent);
     case NS_QUERY_EDITOR_RECT:
       return OnQueryEditorRect(aEvent);
     case NS_QUERY_CONTENT_STATE:
       return OnQueryContentState(aEvent);
     case eQuerySelectionAsTransferable:
--- a/dom/events/ContentEventHandler.h
+++ b/dom/events/ContentEventHandler.h
@@ -41,17 +41,17 @@ public:
 
   // Handle aEvent in the current process.
   nsresult HandleQueryContentEvent(WidgetQueryContentEvent* aEvent);
 
   // eQuerySelectedText event handler
   nsresult OnQuerySelectedText(WidgetQueryContentEvent* aEvent);
   // eQueryTextContent event handler
   nsresult OnQueryTextContent(WidgetQueryContentEvent* aEvent);
-  // NS_QUERY_CARET_RECT event handler
+  // eQueryCaretRect event handler
   nsresult OnQueryCaretRect(WidgetQueryContentEvent* aEvent);
   // NS_QUERY_TEXT_RECT event handler
   nsresult OnQueryTextRect(WidgetQueryContentEvent* aEvent);
   // NS_QUERY_EDITOR_RECT event handler
   nsresult OnQueryEditorRect(WidgetQueryContentEvent* aEvent);
   // NS_QUERY_CONTENT_STATE event handler
   nsresult OnQueryContentState(WidgetQueryContentEvent* aEvent);
   // eQuerySelectionAsTransferable event handler
--- a/dom/events/EventStateManager.cpp
+++ b/dom/events/EventStateManager.cpp
@@ -782,17 +782,17 @@ EventStateManager::PreHandleEvent(nsPres
 }
 
 void
 EventStateManager::HandleQueryContentEvent(WidgetQueryContentEvent* aEvent)
 {
   switch (aEvent->mMessage) {
     case eQuerySelectedText:
     case eQueryTextContent:
-    case NS_QUERY_CARET_RECT:
+    case eQueryCaretRect:
     case NS_QUERY_TEXT_RECT:
     case NS_QUERY_EDITOR_RECT:
       if (!IsTargetCrossProcess(aEvent)) {
         break;
       }
       // Will not be handled locally, remote the event
       GetCrossProcessTarget()->HandleQueryContentEvent(*aEvent);
       return;
--- a/dom/events/IMEContentObserver.cpp
+++ b/dom/events/IMEContentObserver.cpp
@@ -50,18 +50,18 @@ ToChar(bool aBool)
 static const char*
 ToChar(EventMessage aEventMessage)
 {
   switch (aEventMessage) {
     case eQuerySelectedText:
       return "eQuerySelectedText";
     case eQueryTextContent:
       return "eQueryTextContent";
-    case NS_QUERY_CARET_RECT:
-      return "NS_QUERY_CARET_RECT";
+    case eQueryCaretRect:
+      return "eQueryCaretRect";
     case NS_QUERY_TEXT_RECT:
       return "NS_QUERY_TEXT_RECT";
     case NS_QUERY_EDITOR_RECT:
       return "NS_QUERY_EDITOR_RECT";
     case NS_QUERY_CONTENT_STATE:
       return "NS_QUERY_CONTENT_STATE";
     case eQuerySelectionAsTransferable:
       return "eQuerySelectionAsTransferable";
--- a/dom/ipc/TabParent.cpp
+++ b/dom/ipc/TabParent.cpp
@@ -2365,17 +2365,17 @@ TabParent::HandleQueryContentEvent(Widge
     return true;
   }
   if (NS_WARN_IF(!mContentCache.HandleQueryContentEvent(aEvent, widget)) ||
       NS_WARN_IF(!aEvent.mSucceeded)) {
     return true;
   }
   switch (aEvent.mMessage) {
     case NS_QUERY_TEXT_RECT:
-    case NS_QUERY_CARET_RECT:
+    case eQueryCaretRect:
     case NS_QUERY_EDITOR_RECT:
       aEvent.mReply.mRect -= GetChildProcessOffset();
       break;
     default:
       break;
   }
   return true;
 }
--- a/widget/ContentCache.cpp
+++ b/widget/ContentCache.cpp
@@ -214,17 +214,17 @@ ContentCacheInChild::CacheCaret(nsIWidge
   if (NS_WARN_IF(!mSelection.IsValid())) {
     return false;
   }
 
   // XXX Should be mSelection.mFocus?
   mCaret.mOffset = mSelection.StartOffset();
 
   nsEventStatus status = nsEventStatus_eIgnore;
-  WidgetQueryContentEvent caretRect(true, NS_QUERY_CARET_RECT, aWidget);
+  WidgetQueryContentEvent caretRect(true, eQueryCaretRect, aWidget);
   caretRect.InitForQueryCaretRect(mCaret.mOffset);
   aWidget->DispatchEvent(&caretRect, status);
   if (NS_WARN_IF(!caretRect.mSucceeded)) {
     MOZ_LOG(sContentCacheLog, LogLevel::Error,
       ("ContentCacheInChild: 0x%p CacheCaret(), FAILED, "
        "couldn't retrieve the caret rect at offset=%u",
        this, mCaret.mOffset));
     mCaret.Clear();
@@ -633,20 +633,20 @@ ContentCacheInParent::HandleQueryContent
         ("ContentCacheInParent: 0x%p HandleQueryContentEvent(), "
          "Succeeded, aEvent={ mReply={ mOffset=%u, mString=\"%s\", "
          "mWritingMode=%s, mRect=%s } }",
          this, aEvent.mReply.mOffset,
          NS_ConvertUTF16toUTF8(aEvent.mReply.mString).get(),
          GetWritingModeName(aEvent.mReply.mWritingMode).get(),
          GetRectText(aEvent.mReply.mRect).get()));
       break;
-    case NS_QUERY_CARET_RECT:
+    case eQueryCaretRect:
       MOZ_LOG(sContentCacheLog, LogLevel::Info,
         ("ContentCacheInParent: 0x%p HandleQueryContentEvent("
-         "aEvent={ mMessage=NS_QUERY_CARET_RECT, mInput={ mOffset=%u } }, "
+         "aEvent={ mMessage=eQueryCaretRect, mInput={ mOffset=%u } }, "
          "aWidget=0x%p), mText.Length()=%u",
          this, aEvent.mInput.mOffset, aWidget, mText.Length()));
       if (NS_WARN_IF(!IsSelectionValid())) {
         // If content cache hasn't been initialized properly, make the query
         // failed.
         MOZ_LOG(sContentCacheLog, LogLevel::Error,
           ("ContentCacheInParent: 0x%p HandleQueryContentEvent(), "
            "FAILED because mSelection is not valid", this));
--- a/widget/ContentCache.h
+++ b/widget/ContentCache.h
@@ -291,17 +291,17 @@ public:
    *  this behavior because a normal eQueryTextContent event is allowed to
    *  have out-of-bounds offsets, so that widget can request content without
    *  knowing the exact length of text. It's up to widget to handle cases when
    *  the returned offset/length are different from the queried offset/length.
    *
    * For NS_QUERY_TEXT_RECT, fail if cached offset/length aren't equals to input.
    *   Cocoa widget always queries selected offset, so it works on it.
    *
-   * For NS_QUERY_CARET_RECT, fail if cached offset isn't equals to input
+   * For eQueryCaretRect, fail if cached offset isn't equals to input
    *
    * For NS_QUERY_EDITOR_RECT, always success
    */
   bool HandleQueryContentEvent(WidgetQueryContentEvent& aEvent,
                                nsIWidget* aWidget) const;
 
   /**
    * OnCompositionEvent() should be called before sending composition string.
--- a/widget/EventMessageList.h
+++ b/widget/EventMessageList.h
@@ -217,17 +217,17 @@ NS_EVENT_MESSAGE(eQueryContentEventFirst
 // selection length and selected text.
 NS_EVENT_MESSAGE(eQuerySelectedText,            eQueryContentEventFirst)
 // Query for the text content of specified range, it returns actual lengh (if
 // the specified range is too long) and the text of the specified range.
 // Returns the entire text if requested length > actual length.
 NS_EVENT_MESSAGE(eQueryTextContent,             eQueryContentEventFirst + 1)
 // Query for the caret rect of nth insertion point. The offset of the result is
 // relative position from the top level widget.
-NS_EVENT_MESSAGE(NS_QUERY_CARET_RECT,           eQueryContentEventFirst + 3)
+NS_EVENT_MESSAGE(eQueryCaretRect,               eQueryContentEventFirst + 3)
 // Query for the bounding rect of a range of characters. This works on any
 // valid character range given offset and length. Result is relative to top
 // level widget coordinates
 NS_EVENT_MESSAGE(NS_QUERY_TEXT_RECT,            eQueryContentEventFirst + 4)
 // Query for the bounding rect of the current focused frame. Result is relative
 // to top level widget coordinates
 NS_EVENT_MESSAGE(NS_QUERY_EDITOR_RECT,          eQueryContentEventFirst + 5)
 // Query for the current state of the content. The particular members of
--- a/widget/TextEvents.h
+++ b/widget/TextEvents.h
@@ -500,17 +500,17 @@ public:
     mInput.mOffset = aOffset;
     mInput.mLength = aLength;
     mUseNativeLineBreak = aUseNativeLineBreak;
   }
 
   void InitForQueryCaretRect(uint32_t aOffset,
                              bool aUseNativeLineBreak = true)
   {
-    NS_ASSERTION(mMessage == NS_QUERY_CARET_RECT,
+    NS_ASSERTION(mMessage == eQueryCaretRect,
                  "wrong initializer is called");
     mInput.mOffset = aOffset;
     mUseNativeLineBreak = aUseNativeLineBreak;
   }
 
   void InitForQueryTextRect(uint32_t aOffset, uint32_t aLength,
                             bool aUseNativeLineBreak = true)
   {
@@ -547,17 +547,17 @@ public:
     NS_ASSERTION(mMessage == eQuerySelectedText,
                  "not querying selection");
     return mReply.mOffset + (mReply.mReversed ? 0 : mReply.mString.Length());
   }
 
   mozilla::WritingMode GetWritingMode(void) const
   {
     NS_ASSERTION(mMessage == eQuerySelectedText ||
-                 mMessage == NS_QUERY_CARET_RECT ||
+                 mMessage == eQueryCaretRect ||
                  mMessage == NS_QUERY_TEXT_RECT,
                  "not querying selection or text rect");
     return mReply.mWritingMode;
   }
 
   bool mSucceeded;
   bool mUseNativeLineBreak;
   bool mWithFontRanges;
--- a/widget/cocoa/TextInputHandler.mm
+++ b/widget/cocoa/TextInputHandler.mm
@@ -3197,17 +3197,17 @@ IMEInputHandler::FirstRectForCharacterRa
       mWritingMode = charRect.GetWritingMode();
       mRangeForWritingMode = actualRange;
     } else {
       useCaretRect = true;
     }
   }
 
   if (useCaretRect) {
-    WidgetQueryContentEvent caretRect(true, NS_QUERY_CARET_RECT, mWidget);
+    WidgetQueryContentEvent caretRect(true, eQueryCaretRect, mWidget);
     caretRect.InitForQueryCaretRect(aRange.location);
     DispatchEvent(caretRect);
     if (!caretRect.mSucceeded) {
       return rect;
     }
     r = caretRect.mReply.mRect;
     r.width = 0;
     actualRange.location = caretRect.mReply.mOffset;
--- a/widget/gtk/IMContextWrapper.cpp
+++ b/widget/gtk/IMContextWrapper.cpp
@@ -1805,17 +1805,17 @@ IMContextWrapper::SetCursorPosition(GtkI
     if (MOZ_UNLIKELY(!aContext)) {
         MOZ_LOG(gGtkIMLog, LogLevel::Error,
             ("GTKIM: %p   SetCursorPosition(), FAILED, due to no context",
              this));
         return;
     }
 
     WidgetQueryContentEvent charRect(true,
-                                     useCaret ? NS_QUERY_CARET_RECT :
+                                     useCaret ? eQueryCaretRect :
                                                 NS_QUERY_TEXT_RECT,
                                      mLastFocusedWindow);
     if (useCaret) {
         charRect.InitForQueryCaretRect(mSelection.mOffset);
     } else {
         if (mSelection.mWritingMode.IsVertical()) {
             // For preventing the candidate window to overlap the target
             // clause, we should set fake (typically, very tall) caret rect.
@@ -1828,17 +1828,17 @@ IMContextWrapper::SetCursorPosition(GtkI
         }
     }
     InitEvent(charRect);
     nsEventStatus status;
     mLastFocusedWindow->DispatchEvent(&charRect, status);
     if (!charRect.mSucceeded) {
         MOZ_LOG(gGtkIMLog, LogLevel::Error,
             ("GTKIM: %p   SetCursorPosition(), FAILED, %s was failed",
-             this, useCaret ? "NS_QUERY_CARET_RECT" : "NS_QUERY_TEXT_RECT"));
+             this, useCaret ? "eQueryCaretRect" : "NS_QUERY_TEXT_RECT"));
         return;
     }
 
     nsWindow* rootWindow =
         static_cast<nsWindow*>(mLastFocusedWindow->GetTopLevelWidget());
 
     // Get the position of the rootWindow in screen.
     LayoutDeviceIntPoint root = rootWindow->WidgetToScreenOffset();
--- a/widget/windows/IMMHandler.cpp
+++ b/widget/windows/IMMHandler.cpp
@@ -2197,23 +2197,23 @@ IMMHandler::GetCaretRect(nsWindow* aWind
   Selection& selection = GetSelection();
   if (!selection.EnsureValidSelection(aWindow)) {
     MOZ_LOG(gIMMLog, LogLevel::Error,
       ("IMM: GetCaretRect, FAILED, due to "
        "Selection::EnsureValidSelection() failure"));
     return false;
   }
 
-  WidgetQueryContentEvent caretRect(true, NS_QUERY_CARET_RECT, aWindow);
+  WidgetQueryContentEvent caretRect(true, eQueryCaretRect, aWindow);
   caretRect.InitForQueryCaretRect(selection.mOffset);
   aWindow->InitEvent(caretRect, &point);
   aWindow->DispatchWindowEvent(&caretRect);
   if (!caretRect.mSucceeded) {
     MOZ_LOG(gIMMLog, LogLevel::Info,
-      ("IMM: GetCaretRect, FAILED, due to NS_QUERY_CARET_RECT failure"));
+      ("IMM: GetCaretRect, FAILED, due to eQueryCaretRect failure"));
     return false;
   }
   aCaretRect = LayoutDevicePixel::ToUntyped(caretRect.mReply.mRect);
   if (aWritingMode) {
     *aWritingMode = caretRect.GetWritingMode();
   }
   MOZ_LOG(gIMMLog, LogLevel::Info,
     ("IMM: GetCaretRect, SUCCEEDED, "
--- a/widget/windows/TSFTextStore.cpp
+++ b/widget/windows/TSFTextStore.cpp
@@ -4823,24 +4823,24 @@ TSFTextStore::CreateNativeCaret()
             "CurrentSelection() failure", this));
     return;
   }
 
   // XXX If this is called without composition and the selection isn't
   //     collapsed, is it OK?
   uint32_t caretOffset = currentSel.MaxOffset();
 
-  WidgetQueryContentEvent queryCaretRect(true, NS_QUERY_CARET_RECT, mWidget);
+  WidgetQueryContentEvent queryCaretRect(true, eQueryCaretRect, mWidget);
   queryCaretRect.InitForQueryCaretRect(caretOffset);
   mWidget->InitEvent(queryCaretRect);
   DispatchEvent(queryCaretRect);
   if (!queryCaretRect.mSucceeded) {
     MOZ_LOG(sTextStoreLog, LogLevel::Error,
            ("TSF: 0x%p   TSFTextStore::CreateNativeCaret() FAILED due to "
-            "NS_QUERY_CARET_RECT failure (offset=%d)", this, caretOffset));
+            "eQueryCaretRect failure (offset=%d)", this, caretOffset));
     return;
   }
 
   LayoutDeviceIntRect& caretRect = queryCaretRect.mReply.mRect;
   mNativeCaretIsCreated = ::CreateCaret(mWidget->GetWindowHandle(), nullptr,
                                         caretRect.width, caretRect.height);
   if (!mNativeCaretIsCreated) {
     MOZ_LOG(sTextStoreLog, LogLevel::Error,