diff --git a/dom/base/nsDOMWindowUtils.cpp b/dom/base/nsDOMWindowUtils.cpp index 53d98a817dd7..7219042c216d 100644 --- a/dom/base/nsDOMWindowUtils.cpp +++ b/dom/base/nsDOMWindowUtils.cpp @@ -1936,7 +1936,7 @@ nsDOMWindowUtils::SendQueryContentEvent(uint32_t aType, message = eQueryCaretRect; break; case QUERY_TEXT_RECT: - message = NS_QUERY_TEXT_RECT; + message = eQueryTextRect; break; case QUERY_EDITOR_RECT: message = eQueryEditorRect; @@ -1991,7 +1991,7 @@ nsDOMWindowUtils::SendQueryContentEvent(uint32_t aType, case eQueryCaretRect: queryEvent.InitForQueryCaretRect(aOffset, useNativeLineBreak); break; - case NS_QUERY_TEXT_RECT: + case eQueryTextRect: queryEvent.InitForQueryTextRect(aOffset, aLength, useNativeLineBreak); break; default: diff --git a/dom/base/nsQueryContentEventResult.cpp b/dom/base/nsQueryContentEventResult.cpp index 6f3a8306520d..7ffd2ead03c6 100644 --- a/dom/base/nsQueryContentEventResult.cpp +++ b/dom/base/nsQueryContentEventResult.cpp @@ -58,7 +58,7 @@ nsQueryContentEventResult::GetTentativeCaretOffset(uint32_t* aOffset) static bool IsRectEnabled(EventMessage aEventMessage) { return aEventMessage == eQueryCaretRect || - aEventMessage == NS_QUERY_TEXT_RECT || + aEventMessage == eQueryTextRect || aEventMessage == eQueryEditorRect || aEventMessage == eQueryCharacterAtPoint; } diff --git a/dom/events/ContentEventHandler.cpp b/dom/events/ContentEventHandler.cpp index 73dd49e2dc13..084743070a3c 100644 --- a/dom/events/ContentEventHandler.cpp +++ b/dom/events/ContentEventHandler.cpp @@ -802,7 +802,7 @@ ContentEventHandler::HandleQueryContentEvent(WidgetQueryContentEvent* aEvent) return OnQueryTextContent(aEvent); case eQueryCaretRect: return OnQueryCaretRect(aEvent); - case NS_QUERY_TEXT_RECT: + case eQueryTextRect: return OnQueryTextRect(aEvent); case eQueryEditorRect: return OnQueryEditorRect(aEvent); @@ -1330,7 +1330,7 @@ ContentEventHandler::OnQueryCharacterAtPoint(WidgetQueryContentEvent* aEvent) GetLineBreakType(aEvent)); NS_ENSURE_SUCCESS(rv, rv); - WidgetQueryContentEvent textRect(true, NS_QUERY_TEXT_RECT, aEvent->widget); + WidgetQueryContentEvent textRect(true, eQueryTextRect, aEvent->widget); textRect.InitForQueryTextRect(offset, 1, aEvent->mUseNativeLineBreak); rv = OnQueryTextRect(&textRect); NS_ENSURE_SUCCESS(rv, rv); diff --git a/dom/events/ContentEventHandler.h b/dom/events/ContentEventHandler.h index a2b1043a6337..2707789e4a9b 100644 --- a/dom/events/ContentEventHandler.h +++ b/dom/events/ContentEventHandler.h @@ -48,7 +48,7 @@ public: nsresult OnQueryTextContent(WidgetQueryContentEvent* aEvent); // eQueryCaretRect event handler nsresult OnQueryCaretRect(WidgetQueryContentEvent* aEvent); - // NS_QUERY_TEXT_RECT event handler + // eQueryTextRect event handler nsresult OnQueryTextRect(WidgetQueryContentEvent* aEvent); // eQueryEditorRect event handler nsresult OnQueryEditorRect(WidgetQueryContentEvent* aEvent); diff --git a/dom/events/EventStateManager.cpp b/dom/events/EventStateManager.cpp index 2e711da4079b..6f2ed8102431 100644 --- a/dom/events/EventStateManager.cpp +++ b/dom/events/EventStateManager.cpp @@ -784,7 +784,7 @@ EventStateManager::HandleQueryContentEvent(WidgetQueryContentEvent* aEvent) case eQuerySelectedText: case eQueryTextContent: case eQueryCaretRect: - case NS_QUERY_TEXT_RECT: + case eQueryTextRect: case eQueryEditorRect: if (!IsTargetCrossProcess(aEvent)) { break; diff --git a/dom/events/IMEContentObserver.cpp b/dom/events/IMEContentObserver.cpp index 019d5d6c6eb2..4f1fcd847512 100644 --- a/dom/events/IMEContentObserver.cpp +++ b/dom/events/IMEContentObserver.cpp @@ -57,8 +57,8 @@ ToChar(EventMessage aEventMessage) return "eQueryTextContent"; case eQueryCaretRect: return "eQueryCaretRect"; - case NS_QUERY_TEXT_RECT: - return "NS_QUERY_TEXT_RECT"; + case eQueryTextRect: + return "eQueryTextRect"; case eQueryEditorRect: return "eQueryEditorRect"; case eQueryContentState: diff --git a/dom/ipc/TabParent.cpp b/dom/ipc/TabParent.cpp index 4685acc5e91b..908b65ddbd03 100644 --- a/dom/ipc/TabParent.cpp +++ b/dom/ipc/TabParent.cpp @@ -2369,7 +2369,7 @@ TabParent::HandleQueryContentEvent(WidgetQueryContentEvent& aEvent) return true; } switch (aEvent.mMessage) { - case NS_QUERY_TEXT_RECT: + case eQueryTextRect: case eQueryCaretRect: case eQueryEditorRect: aEvent.mReply.mRect -= GetChildProcessOffset(); diff --git a/widget/ContentCache.cpp b/widget/ContentCache.cpp index 8979bd06fa98..ed79f6a90ac5 100644 --- a/widget/ContentCache.cpp +++ b/widget/ContentCache.cpp @@ -302,7 +302,7 @@ ContentCacheInChild::QueryCharRect(nsIWidget* aWidget, aCharRect.SetEmpty(); nsEventStatus status = nsEventStatus_eIgnore; - WidgetQueryContentEvent textRect(true, NS_QUERY_TEXT_RECT, aWidget); + WidgetQueryContentEvent textRect(true, eQueryTextRect, aWidget); textRect.InitForQueryTextRect(aOffset, 1); aWidget->DispatchEvent(&textRect, status); if (NS_WARN_IF(!textRect.mSucceeded)) { @@ -394,7 +394,7 @@ ContentCacheInChild::CacheTextRects(nsIWidget* aWidget, if (!mSelection.Collapsed()) { nsEventStatus status = nsEventStatus_eIgnore; - WidgetQueryContentEvent textRect(true, NS_QUERY_TEXT_RECT, aWidget); + WidgetQueryContentEvent textRect(true, eQueryTextRect, aWidget); textRect.InitForQueryTextRect(mSelection.StartOffset(), mSelection.Length()); aWidget->DispatchEvent(&textRect, status); @@ -583,10 +583,10 @@ ContentCacheInParent::HandleQueryContentEvent(WidgetQueryContentEvent& aEvent, this, aEvent.mReply.mOffset, aEvent.mReply.mString.Length())); break; } - case NS_QUERY_TEXT_RECT: + case eQueryTextRect: MOZ_LOG(sContentCacheLog, LogLevel::Info, ("ContentCacheInParent: 0x%p HandleQueryContentEvent(" - "aEvent={ mMessage=NS_QUERY_TEXT_RECT, mInput={ mOffset=%u, " + "aEvent={ mMessage=eQueryTextRect, mInput={ mOffset=%u, " "mLength=%u } }, aWidget=0x%p), mText.Length()=%u", this, aEvent.mInput.mOffset, aEvent.mInput.mLength, aWidget, mText.Length())); diff --git a/widget/ContentCache.h b/widget/ContentCache.h index 29070708c123..96bc3f64e934 100644 --- a/widget/ContentCache.h +++ b/widget/ContentCache.h @@ -293,7 +293,7 @@ public: * 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. + * For eQueryTextRect, fail if cached offset/length aren't equals to input. * Cocoa widget always queries selected offset, so it works on it. * * For eQueryCaretRect, fail if cached offset isn't equals to input diff --git a/widget/EventMessageList.h b/widget/EventMessageList.h index 187919d4e8be..b20ca99a3f87 100644 --- a/widget/EventMessageList.h +++ b/widget/EventMessageList.h @@ -226,7 +226,7 @@ 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) +NS_EVENT_MESSAGE(eQueryTextRect, eQueryContentEventFirst + 4) // Query for the bounding rect of the current focused frame. Result is relative // to top level widget coordinates NS_EVENT_MESSAGE(eQueryEditorRect, eQueryContentEventFirst + 5) diff --git a/widget/TextEvents.h b/widget/TextEvents.h index de057227994a..a1486b5a43c8 100644 --- a/widget/TextEvents.h +++ b/widget/TextEvents.h @@ -514,7 +514,7 @@ public: void InitForQueryTextRect(uint32_t aOffset, uint32_t aLength, bool aUseNativeLineBreak = true) { - NS_ASSERTION(mMessage == NS_QUERY_TEXT_RECT, + NS_ASSERTION(mMessage == eQueryTextRect, "wrong initializer is called"); mInput.mOffset = aOffset; mInput.mLength = aLength; @@ -553,7 +553,7 @@ public: { NS_ASSERTION(mMessage == eQuerySelectedText || mMessage == eQueryCaretRect || - mMessage == NS_QUERY_TEXT_RECT, + mMessage == eQueryTextRect, "not querying selection or text rect"); return mReply.mWritingMode; } diff --git a/widget/cocoa/TextInputHandler.mm b/widget/cocoa/TextInputHandler.mm index 68a9b2e997d1..2bfcd7535e21 100644 --- a/widget/cocoa/TextInputHandler.mm +++ b/widget/cocoa/TextInputHandler.mm @@ -3186,7 +3186,7 @@ IMEInputHandler::FirstRectForCharacterRange(NSRange& aRange, LayoutDeviceIntRect r; bool useCaretRect = (aRange.length == 0); if (!useCaretRect) { - WidgetQueryContentEvent charRect(true, NS_QUERY_TEXT_RECT, mWidget); + WidgetQueryContentEvent charRect(true, eQueryTextRect, mWidget); charRect.InitForQueryTextRect(aRange.location, 1); DispatchEvent(charRect); if (charRect.mSucceeded) { diff --git a/widget/gtk/IMContextWrapper.cpp b/widget/gtk/IMContextWrapper.cpp index 23f6606f0cab..234a95699c0a 100644 --- a/widget/gtk/IMContextWrapper.cpp +++ b/widget/gtk/IMContextWrapper.cpp @@ -1811,7 +1811,7 @@ IMContextWrapper::SetCursorPosition(GtkIMContext* aContext) WidgetQueryContentEvent charRect(true, useCaret ? eQueryCaretRect : - NS_QUERY_TEXT_RECT, + eQueryTextRect, mLastFocusedWindow); if (useCaret) { charRect.InitForQueryCaretRect(mSelection.mOffset); @@ -1833,7 +1833,7 @@ IMContextWrapper::SetCursorPosition(GtkIMContext* aContext) if (!charRect.mSucceeded) { MOZ_LOG(gGtkIMLog, LogLevel::Error, ("GTKIM: %p SetCursorPosition(), FAILED, %s was failed", - this, useCaret ? "eQueryCaretRect" : "NS_QUERY_TEXT_RECT")); + this, useCaret ? "eQueryCaretRect" : "eQueryTextRect")); return; } diff --git a/widget/windows/IMMHandler.cpp b/widget/windows/IMMHandler.cpp index b823e2c0ec29..ff007559f82d 100644 --- a/widget/windows/IMMHandler.cpp +++ b/widget/windows/IMMHandler.cpp @@ -2165,7 +2165,7 @@ IMMHandler::GetCharacterRectOfSelectedTextAt(nsWindow* aWindow, // If there is a caret and retrieving offset is same as the caret offset, // we should use the caret rect. if (offset != caretOffset) { - WidgetQueryContentEvent charRect(true, NS_QUERY_TEXT_RECT, aWindow); + WidgetQueryContentEvent charRect(true, eQueryTextRect, aWindow); charRect.InitForQueryTextRect(offset, 1); aWindow->InitEvent(charRect, &point); aWindow->DispatchWindowEvent(&charRect); diff --git a/widget/windows/TSFTextStore.cpp b/widget/windows/TSFTextStore.cpp index 37d3f6de79cf..36aa0a872a65 100644 --- a/widget/windows/TSFTextStore.cpp +++ b/widget/windows/TSFTextStore.cpp @@ -3424,7 +3424,7 @@ TSFTextStore::GetACPFromPoint(TsViewCookie vcView, // offset since there is no inexpensive API to check it strictly. // XXX If we retrieve 2 bounding boxes, one is before the offset and // the other is after the offset, we could resolve the offset. - // However, dispatching 2 NS_QUERY_TEXT_RECT may be expensive. + // However, dispatching 2 eQueryTextRect may be expensive. // So, use tentative offset for now. offset = charAtPt.mReply.mTentativeCaretOffset; @@ -3583,15 +3583,15 @@ TSFTextStore::GetTextExt(TsViewCookie vcView, return TS_E_NOLAYOUT; } - // use NS_QUERY_TEXT_RECT to get rect in system, screen coordinates - WidgetQueryContentEvent event(true, NS_QUERY_TEXT_RECT, mWidget); + // use eQueryTextRect to get rect in system, screen coordinates + WidgetQueryContentEvent event(true, eQueryTextRect, mWidget); mWidget->InitEvent(event); event.InitForQueryTextRect(acpStart, acpEnd - acpStart); DispatchEvent(event); if (!event.mSucceeded) { MOZ_LOG(sTextStoreLog, LogLevel::Error, ("TSF: 0x%p TSFTextStore::GetTextExt() FAILED due to " - "NS_QUERY_TEXT_RECT failure", this)); + "eQueryTextRect failure", this)); return TS_E_INVALIDPOS; // but unexpected failure, maybe. } // IMEs don't like empty rects, fix here