зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1284422 part.11 Remove "IMS: " and "IMEStateManager::" from log of IMEStateManager.cpp r=m_kato
MozReview-Commit-ID: K5PwEiHTJQX --HG-- extra : rebase_source : d99bf2fb893a05c2372b4f030b80176209715c50
This commit is contained in:
Родитель
e58046fba7
Коммит
04be8e9906
|
@ -47,15 +47,15 @@ using namespace widget;
|
|||
* When a method is called, log its arguments and/or related static variables
|
||||
* with LogLevel::Info. However, if it puts too many logs like
|
||||
* OnDestroyPresContext(), should long only when the method actually does
|
||||
* something. In this case, the log should start with "ISM: <method name>".
|
||||
* something. In this case, the log should start with "<method name>".
|
||||
*
|
||||
* When a method quits due to unexpected situation, log the reason with
|
||||
* LogLevel::Error. In this case, the log should start with
|
||||
* "ISM: <method name>(), FAILED". The indent makes the log look easier.
|
||||
* "<method name>(), FAILED". The indent makes the log look easier.
|
||||
*
|
||||
* When a method does something only in some situations and it may be important
|
||||
* for debug, log the information with LogLevel::Debug. In this case, the log
|
||||
* should start with "ISM: <method name>(),".
|
||||
* should start with " <method name>(),".
|
||||
*/
|
||||
LazyLogModule sISMLog("IMEStateManager");
|
||||
|
||||
|
@ -162,8 +162,7 @@ void
|
|||
IMEStateManager::Shutdown()
|
||||
{
|
||||
MOZ_LOG(sISMLog, LogLevel::Info,
|
||||
("ISM: IMEStateManager::Shutdown(), "
|
||||
"sTextCompositions=0x%p, sTextCompositions->Length()=%u",
|
||||
("Shutdown(), sTextCompositions=0x%p, sTextCompositions->Length()=%u",
|
||||
sTextCompositions, sTextCompositions ? sTextCompositions->Length() : 0));
|
||||
|
||||
MOZ_ASSERT(!sTextCompositions || !sTextCompositions->Length());
|
||||
|
@ -179,7 +178,7 @@ IMEStateManager::OnTabParentDestroying(TabParent* aTabParent)
|
|||
return;
|
||||
}
|
||||
MOZ_LOG(sISMLog, LogLevel::Info,
|
||||
("ISM: IMEStateManager::OnTabParentDestroying(aTabParent=0x%p), "
|
||||
("OnTabParentDestroying(aTabParent=0x%p), "
|
||||
"The active TabParent is being destroyed", aTabParent));
|
||||
|
||||
// The active remote process might have crashed.
|
||||
|
@ -206,7 +205,7 @@ void
|
|||
IMEStateManager::StopIMEStateManagement()
|
||||
{
|
||||
MOZ_LOG(sISMLog, LogLevel::Info,
|
||||
("ISM: IMEStateManager::StopIMEStateManagement()"));
|
||||
("StopIMEStateManagement()"));
|
||||
|
||||
// NOTE: Don't set input context from here since this has already lost
|
||||
// the rights to change input context.
|
||||
|
@ -228,18 +227,16 @@ IMEStateManager::MaybeStartOffsetUpdatedInChild(nsIWidget* aWidget,
|
|||
{
|
||||
if (NS_WARN_IF(!sTextCompositions)) {
|
||||
MOZ_LOG(sISMLog, LogLevel::Warning,
|
||||
("ISM: IMEStateManager::MaybeStartOffsetUpdatedInChild("
|
||||
"aWidget=0x%p, aStartOffset=%u), called when there is no "
|
||||
"composition", aWidget, aStartOffset));
|
||||
("MaybeStartOffsetUpdatedInChild(aWidget=0x%p, aStartOffset=%u), "
|
||||
"called when there is no composition", aWidget, aStartOffset));
|
||||
return;
|
||||
}
|
||||
|
||||
RefPtr<TextComposition> composition = GetTextCompositionFor(aWidget);
|
||||
if (NS_WARN_IF(!composition)) {
|
||||
MOZ_LOG(sISMLog, LogLevel::Warning,
|
||||
("ISM: IMEStateManager::MaybeStartOffsetUpdatedInChild("
|
||||
"aWidget=0x%p, aStartOffset=%u), called when there is no "
|
||||
"composition", aWidget, aStartOffset));
|
||||
("MaybeStartOffsetUpdatedInChild(aWidget=0x%p, aStartOffset=%u), "
|
||||
"called when there is no composition", aWidget, aStartOffset));
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -248,8 +245,8 @@ IMEStateManager::MaybeStartOffsetUpdatedInChild(nsIWidget* aWidget,
|
|||
}
|
||||
|
||||
MOZ_LOG(sISMLog, LogLevel::Info,
|
||||
("ISM: IMEStateManager::MaybeStartOffsetUpdatedInChild("
|
||||
"aWidget=0x%p, aStartOffset=%u), old offset=%u",
|
||||
("MaybeStartOffsetUpdatedInChild(aWidget=0x%p, aStartOffset=%u), "
|
||||
"old offset=%u",
|
||||
aWidget, aStartOffset, composition->NativeOffsetOfStartComposition()));
|
||||
composition->OnStartOffsetUpdatedInChild(aStartOffset);
|
||||
}
|
||||
|
@ -266,7 +263,7 @@ IMEStateManager::OnDestroyPresContext(nsPresContext* aPresContext)
|
|||
sTextCompositions->IndexOf(aPresContext);
|
||||
if (i != TextCompositionArray::NoIndex) {
|
||||
MOZ_LOG(sISMLog, LogLevel::Debug,
|
||||
("ISM: IMEStateManager::OnDestroyPresContext(), "
|
||||
(" OnDestroyPresContext(), "
|
||||
"removing TextComposition instance from the array (index=%u)", i));
|
||||
// there should be only one composition per presContext object.
|
||||
sTextCompositions->ElementAt(i)->Destroy();
|
||||
|
@ -274,7 +271,7 @@ IMEStateManager::OnDestroyPresContext(nsPresContext* aPresContext)
|
|||
if (sTextCompositions->IndexOf(aPresContext) !=
|
||||
TextCompositionArray::NoIndex) {
|
||||
MOZ_LOG(sISMLog, LogLevel::Error,
|
||||
("ISM: IMEStateManager::OnDestroyPresContext(), FAILED to remove "
|
||||
(" OnDestroyPresContext(), FAILED to remove "
|
||||
"TextComposition instance from the array"));
|
||||
MOZ_CRASH("Failed to remove TextComposition instance from the array");
|
||||
}
|
||||
|
@ -286,7 +283,7 @@ IMEStateManager::OnDestroyPresContext(nsPresContext* aPresContext)
|
|||
}
|
||||
|
||||
MOZ_LOG(sISMLog, LogLevel::Info,
|
||||
("ISM: IMEStateManager::OnDestroyPresContext(aPresContext=0x%p), "
|
||||
("OnDestroyPresContext(aPresContext=0x%p), "
|
||||
"sPresContext=0x%p, sContent=0x%p, sTextCompositions=0x%p",
|
||||
aPresContext, sPresContext, sContent.get(), sTextCompositions));
|
||||
|
||||
|
@ -319,7 +316,7 @@ IMEStateManager::OnRemoveContent(nsPresContext* aPresContext,
|
|||
|
||||
if (compositionInContent) {
|
||||
MOZ_LOG(sISMLog, LogLevel::Debug,
|
||||
("ISM: IMEStateManager::OnRemoveContent(), "
|
||||
(" OnRemoveContent(), "
|
||||
"composition is in the content"));
|
||||
|
||||
// Try resetting the native IME state. Be aware, typically, this method
|
||||
|
@ -342,8 +339,8 @@ IMEStateManager::OnRemoveContent(nsPresContext* aPresContext,
|
|||
}
|
||||
|
||||
MOZ_LOG(sISMLog, LogLevel::Info,
|
||||
("ISM: IMEStateManager::OnRemoveContent(aPresContext=0x%p, "
|
||||
"aContent=0x%p), sPresContext=0x%p, sContent=0x%p, sTextCompositions=0x%p",
|
||||
("OnRemoveContent(aPresContext=0x%p, aContent=0x%p), "
|
||||
"sPresContext=0x%p, sContent=0x%p, sTextCompositions=0x%p",
|
||||
aPresContext, aContent, sPresContext, sContent.get(), sTextCompositions));
|
||||
|
||||
DestroyIMEContentObserver();
|
||||
|
@ -371,8 +368,7 @@ IMEStateManager::OnChangeFocus(nsPresContext* aPresContext,
|
|||
InputContextAction::Cause aCause)
|
||||
{
|
||||
MOZ_LOG(sISMLog, LogLevel::Info,
|
||||
("ISM: IMEStateManager::OnChangeFocus(aPresContext=0x%p, "
|
||||
"aContent=0x%p, aCause=%s)",
|
||||
("OnChangeFocus(aPresContext=0x%p, aContent=0x%p, aCause=%s)",
|
||||
aPresContext, aContent, GetActionCauseName(aCause)));
|
||||
|
||||
InputContextAction action(aCause);
|
||||
|
@ -388,7 +384,7 @@ IMEStateManager::OnChangeFocusInternal(nsPresContext* aPresContext,
|
|||
RefPtr<TabParent> newTabParent = TabParent::GetFrom(aContent);
|
||||
|
||||
MOZ_LOG(sISMLog, LogLevel::Info,
|
||||
("ISM: IMEStateManager::OnChangeFocusInternal(aPresContext=0x%p, "
|
||||
("OnChangeFocusInternal(aPresContext=0x%p, "
|
||||
"aContent=0x%p (TabParent=0x%p), aAction={ mCause=%s, mFocusChange=%s }), "
|
||||
"sPresContext=0x%p, sContent=0x%p, sActiveTabParent=0x%p, "
|
||||
"sActiveIMEContentObserver=0x%p, sInstalledMenuKeyboardListener=%s",
|
||||
|
@ -421,7 +417,7 @@ IMEStateManager::OnChangeFocusInternal(nsPresContext* aPresContext,
|
|||
|
||||
if (!aPresContext) {
|
||||
MOZ_LOG(sISMLog, LogLevel::Debug,
|
||||
("ISM: IMEStateManager::OnChangeFocusInternal(), "
|
||||
(" OnChangeFocusInternal(), "
|
||||
"no nsPresContext is being activated"));
|
||||
return NS_OK;
|
||||
}
|
||||
|
@ -432,7 +428,7 @@ IMEStateManager::OnChangeFocusInternal(nsPresContext* aPresContext,
|
|||
newTabParent ? newTabParent->Manager() : nullptr;
|
||||
if (sActiveTabParent && currentContentParent != newContentParent) {
|
||||
MOZ_LOG(sISMLog, LogLevel::Debug,
|
||||
("ISM: IMEStateManager::OnChangeFocusInternal(), notifying previous "
|
||||
(" OnChangeFocusInternal(), notifying previous "
|
||||
"focused child process of parent process or another child process "
|
||||
"getting focus"));
|
||||
Unused << sActiveTabParent->SendStopIMEStateManagement();
|
||||
|
@ -443,7 +439,7 @@ IMEStateManager::OnChangeFocusInternal(nsPresContext* aPresContext,
|
|||
aPresContext->GetRootWidget();
|
||||
if (NS_WARN_IF(!widget)) {
|
||||
MOZ_LOG(sISMLog, LogLevel::Error,
|
||||
("ISM: IMEStateManager::OnChangeFocusInternal(), FAILED due to "
|
||||
(" OnChangeFocusInternal(), FAILED due to "
|
||||
"no widget to manage its IME state"));
|
||||
return NS_OK;
|
||||
}
|
||||
|
@ -471,12 +467,12 @@ IMEStateManager::OnChangeFocusInternal(nsPresContext* aPresContext,
|
|||
if (context.mIMEState.mEnabled == IMEState::DISABLED) {
|
||||
setIMEState = false;
|
||||
MOZ_LOG(sISMLog, LogLevel::Debug,
|
||||
("ISM: IMEStateManager::OnChangeFocusInternal(), doesn't set IME "
|
||||
(" OnChangeFocusInternal(), doesn't set IME "
|
||||
"state because focused element (or document) is in a child process "
|
||||
"and the IME state is already disabled"));
|
||||
} else {
|
||||
MOZ_LOG(sISMLog, LogLevel::Debug,
|
||||
("ISM: IMEStateManager::OnChangeFocusInternal(), will disable IME "
|
||||
(" OnChangeFocusInternal(), will disable IME "
|
||||
"until new focused element (or document) in the child process "
|
||||
"will get focus actually"));
|
||||
}
|
||||
|
@ -487,7 +483,7 @@ IMEStateManager::OnChangeFocusInternal(nsPresContext* aPresContext,
|
|||
// making IME state disabled.
|
||||
setIMEState = false;
|
||||
MOZ_LOG(sISMLog, LogLevel::Debug,
|
||||
("ISM: IMEStateManager::OnChangeFocusInternal(), doesn't set IME "
|
||||
(" OnChangeFocusInternal(), doesn't set IME "
|
||||
"state because focused element (or document) is already in the child "
|
||||
"process"));
|
||||
}
|
||||
|
@ -500,7 +496,7 @@ IMEStateManager::OnChangeFocusInternal(nsPresContext* aPresContext,
|
|||
InputContext context = widget->GetInputContext();
|
||||
if (context.mIMEState.mEnabled == newState.mEnabled) {
|
||||
MOZ_LOG(sISMLog, LogLevel::Debug,
|
||||
("ISM: IMEStateManager::OnChangeFocusInternal(), "
|
||||
(" OnChangeFocusInternal(), "
|
||||
"neither focus nor IME state is changing"));
|
||||
return NS_OK;
|
||||
}
|
||||
|
@ -535,7 +531,7 @@ IMEStateManager::OnChangeFocusInternal(nsPresContext* aPresContext,
|
|||
CreateIMEContentObserver(nullptr);
|
||||
if (sActiveIMEContentObserver) {
|
||||
MOZ_LOG(sISMLog, LogLevel::Debug,
|
||||
("ISM: IMEStateManager::OnChangeFocusInternal(), an "
|
||||
(" OnChangeFocusInternal(), an "
|
||||
"IMEContentObserver instance is created for plugin and trying to "
|
||||
"flush its pending notifications..."));
|
||||
sActiveIMEContentObserver->TryToFlushPendingNotifications();
|
||||
|
@ -550,7 +546,7 @@ void
|
|||
IMEStateManager::OnInstalledMenuKeyboardListener(bool aInstalling)
|
||||
{
|
||||
MOZ_LOG(sISMLog, LogLevel::Info,
|
||||
("ISM: IMEStateManager::OnInstalledMenuKeyboardListener(aInstalling=%s), "
|
||||
("OnInstalledMenuKeyboardListener(aInstalling=%s), "
|
||||
"sInstalledMenuKeyboardListener=%s",
|
||||
GetBoolName(aInstalling), GetBoolName(sInstalledMenuKeyboardListener)));
|
||||
|
||||
|
@ -569,27 +565,27 @@ IMEStateManager::OnMouseButtonEventInEditor(nsPresContext* aPresContext,
|
|||
nsIDOMMouseEvent* aMouseEvent)
|
||||
{
|
||||
MOZ_LOG(sISMLog, LogLevel::Info,
|
||||
("ISM: IMEStateManager::OnMouseButtonEventInEditor(aPresContext=0x%p, "
|
||||
("OnMouseButtonEventInEditor(aPresContext=0x%p, "
|
||||
"aContent=0x%p, aMouseEvent=0x%p), sPresContext=0x%p, sContent=0x%p",
|
||||
aPresContext, aContent, aMouseEvent, sPresContext, sContent.get()));
|
||||
|
||||
if (sPresContext != aPresContext || sContent != aContent) {
|
||||
MOZ_LOG(sISMLog, LogLevel::Debug,
|
||||
("ISM: IMEStateManager::OnMouseButtonEventInEditor(), "
|
||||
(" OnMouseButtonEventInEditor(), "
|
||||
"the mouse event isn't fired on the editor managed by ISM"));
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!sActiveIMEContentObserver) {
|
||||
MOZ_LOG(sISMLog, LogLevel::Debug,
|
||||
("ISM: IMEStateManager::OnMouseButtonEventInEditor(), "
|
||||
(" OnMouseButtonEventInEditor(), "
|
||||
"there is no active IMEContentObserver"));
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!sActiveIMEContentObserver->IsManaging(aPresContext, aContent)) {
|
||||
MOZ_LOG(sISMLog, LogLevel::Debug,
|
||||
("ISM: IMEStateManager::OnMouseButtonEventInEditor(), "
|
||||
(" OnMouseButtonEventInEditor(), "
|
||||
"the active IMEContentObserver isn't managing the editor"));
|
||||
return false;
|
||||
}
|
||||
|
@ -598,7 +594,7 @@ IMEStateManager::OnMouseButtonEventInEditor(nsPresContext* aPresContext,
|
|||
aMouseEvent->AsEvent()->WidgetEventPtr()->AsMouseEvent();
|
||||
if (NS_WARN_IF(!internalEvent)) {
|
||||
MOZ_LOG(sISMLog, LogLevel::Debug,
|
||||
("ISM: IMEStateManager::OnMouseButtonEventInEditor(), "
|
||||
(" OnMouseButtonEventInEditor(), "
|
||||
"the internal event of aMouseEvent isn't WidgetMouseEvent"));
|
||||
return false;
|
||||
}
|
||||
|
@ -610,7 +606,7 @@ IMEStateManager::OnMouseButtonEventInEditor(nsPresContext* aPresContext,
|
|||
nsAutoString eventType;
|
||||
aMouseEvent->AsEvent()->GetType(eventType);
|
||||
MOZ_LOG(sISMLog, LogLevel::Info,
|
||||
("ISM: IMEStateManager::OnMouseButtonEventInEditor(), "
|
||||
(" OnMouseButtonEventInEditor(), "
|
||||
"mouse event (type=%s, button=%d) is %s",
|
||||
NS_ConvertUTF16toUTF8(eventType).get(), internalEvent->button,
|
||||
consumed ? "consumed" : "not consumed"));
|
||||
|
@ -626,13 +622,13 @@ IMEStateManager::OnClickInEditor(nsPresContext* aPresContext,
|
|||
nsIDOMMouseEvent* aMouseEvent)
|
||||
{
|
||||
MOZ_LOG(sISMLog, LogLevel::Info,
|
||||
("ISM: IMEStateManager::OnClickInEditor(aPresContext=0x%p, aContent=0x%p, "
|
||||
"aMouseEvent=0x%p), sPresContext=0x%p, sContent=0x%p",
|
||||
("OnClickInEditor(aPresContext=0x%p, aContent=0x%p, aMouseEvent=0x%p), "
|
||||
"sPresContext=0x%p, sContent=0x%p",
|
||||
aPresContext, aContent, aMouseEvent, sPresContext, sContent.get()));
|
||||
|
||||
if (sPresContext != aPresContext || sContent != aContent) {
|
||||
MOZ_LOG(sISMLog, LogLevel::Debug,
|
||||
("ISM: IMEStateManager::OnClickInEditor(), "
|
||||
(" OnClickInEditor(), "
|
||||
"the mouse event isn't fired on the editor managed by ISM"));
|
||||
return;
|
||||
}
|
||||
|
@ -645,7 +641,7 @@ IMEStateManager::OnClickInEditor(nsPresContext* aPresContext,
|
|||
NS_ENSURE_SUCCESS_VOID(rv);
|
||||
if (!isTrusted) {
|
||||
MOZ_LOG(sISMLog, LogLevel::Debug,
|
||||
("ISM: IMEStateManager::OnClickInEditor(), "
|
||||
(" OnClickInEditor(), "
|
||||
"the mouse event isn't a trusted event"));
|
||||
return; // ignore untrusted event.
|
||||
}
|
||||
|
@ -655,7 +651,7 @@ IMEStateManager::OnClickInEditor(nsPresContext* aPresContext,
|
|||
NS_ENSURE_SUCCESS_VOID(rv);
|
||||
if (button != 0) {
|
||||
MOZ_LOG(sISMLog, LogLevel::Debug,
|
||||
("ISM: IMEStateManager::OnClickInEditor(), "
|
||||
(" OnClickInEditor(), "
|
||||
"the mouse event isn't a left mouse button event"));
|
||||
return; // not a left click event.
|
||||
}
|
||||
|
@ -665,7 +661,7 @@ IMEStateManager::OnClickInEditor(nsPresContext* aPresContext,
|
|||
NS_ENSURE_SUCCESS_VOID(rv);
|
||||
if (clickCount != 1) {
|
||||
MOZ_LOG(sISMLog, LogLevel::Debug,
|
||||
("ISM: IMEStateManager::OnClickInEditor(), "
|
||||
(" OnClickInEditor(), "
|
||||
"the mouse event isn't a single click event"));
|
||||
return; // should notify only first click event.
|
||||
}
|
||||
|
@ -688,15 +684,14 @@ IMEStateManager::OnFocusInEditor(nsPresContext* aPresContext,
|
|||
nsIEditor* aEditor)
|
||||
{
|
||||
MOZ_LOG(sISMLog, LogLevel::Info,
|
||||
("ISM: IMEStateManager::OnFocusInEditor(aPresContext=0x%p, aContent=0x%p, "
|
||||
"aEditor=0x%p), sPresContext=0x%p, sContent=0x%p, "
|
||||
"sActiveIMEContentObserver=0x%p",
|
||||
("OnFocusInEditor(aPresContext=0x%p, aContent=0x%p, aEditor=0x%p), "
|
||||
"sPresContext=0x%p, sContent=0x%p, sActiveIMEContentObserver=0x%p",
|
||||
aPresContext, aContent, aEditor, sPresContext, sContent.get(),
|
||||
sActiveIMEContentObserver.get()));
|
||||
|
||||
if (sPresContext != aPresContext || sContent != aContent) {
|
||||
MOZ_LOG(sISMLog, LogLevel::Debug,
|
||||
("ISM: IMEStateManager::OnFocusInEditor(), "
|
||||
(" OnFocusInEditor(), "
|
||||
"an editor not managed by ISM gets focus"));
|
||||
return;
|
||||
}
|
||||
|
@ -706,7 +701,7 @@ IMEStateManager::OnFocusInEditor(nsPresContext* aPresContext,
|
|||
if (sActiveIMEContentObserver) {
|
||||
if (sActiveIMEContentObserver->IsManaging(aPresContext, aContent)) {
|
||||
MOZ_LOG(sISMLog, LogLevel::Debug,
|
||||
("ISM: IMEStateManager::OnFocusInEditor(), "
|
||||
(" OnFocusInEditor(), "
|
||||
"the editor is already being managed by sActiveIMEContentObserver"));
|
||||
return;
|
||||
}
|
||||
|
@ -718,7 +713,7 @@ IMEStateManager::OnFocusInEditor(nsPresContext* aPresContext,
|
|||
// Let's flush the focus notification now.
|
||||
if (sActiveIMEContentObserver) {
|
||||
MOZ_LOG(sISMLog, LogLevel::Debug,
|
||||
("ISM: IMEStateManager::OnFocusInEditor(), new IMEContentObserver is "
|
||||
(" OnFocusInEditor(), new IMEContentObserver is "
|
||||
"created, trying to flush pending notifications..."));
|
||||
sActiveIMEContentObserver->TryToFlushPendingNotifications();
|
||||
}
|
||||
|
@ -734,7 +729,7 @@ IMEStateManager::OnEditorInitialized(nsIEditor* aEditor)
|
|||
}
|
||||
|
||||
MOZ_LOG(sISMLog, LogLevel::Info,
|
||||
("ISM: IMEStateManager::OnEditorInitialized(aEditor=0x%p)",
|
||||
("OnEditorInitialized(aEditor=0x%p)",
|
||||
aEditor));
|
||||
|
||||
sActiveIMEContentObserver->UnsuppressNotifyingIME();
|
||||
|
@ -750,7 +745,7 @@ IMEStateManager::OnEditorDestroying(nsIEditor* aEditor)
|
|||
}
|
||||
|
||||
MOZ_LOG(sISMLog, LogLevel::Info,
|
||||
("ISM: IMEStateManager::OnEditorDestroying(aEditor=0x%p)",
|
||||
("OnEditorDestroying(aEditor=0x%p)",
|
||||
aEditor));
|
||||
|
||||
// The IMEContentObserver shouldn't notify IME of anything until reframing
|
||||
|
@ -765,7 +760,7 @@ IMEStateManager::UpdateIMEState(const IMEState& aNewIMEState,
|
|||
nsIEditor* aEditor)
|
||||
{
|
||||
MOZ_LOG(sISMLog, LogLevel::Info,
|
||||
("ISM: IMEStateManager::UpdateIMEState(aNewIMEState={ mEnabled=%s, "
|
||||
("UpdateIMEState(aNewIMEState={ mEnabled=%s, "
|
||||
"mOpen=%s }, aContent=0x%p, aEditor=0x%p), "
|
||||
"sPresContext=0x%p, sContent=0x%p, sActiveIMEContentObserver=0x%p, "
|
||||
"sIsGettingNewIMEState=%s",
|
||||
|
@ -776,21 +771,21 @@ IMEStateManager::UpdateIMEState(const IMEState& aNewIMEState,
|
|||
|
||||
if (sIsGettingNewIMEState) {
|
||||
MOZ_LOG(sISMLog, LogLevel::Debug,
|
||||
("ISM: IMEStateManager::UpdateIMEState(), "
|
||||
(" UpdateIMEState(), "
|
||||
"does nothing because of called while getting new IME state"));
|
||||
return;
|
||||
}
|
||||
|
||||
if (NS_WARN_IF(!sPresContext)) {
|
||||
MOZ_LOG(sISMLog, LogLevel::Error,
|
||||
("ISM: IMEStateManager::UpdateIMEState(), FAILED due to "
|
||||
(" UpdateIMEState(), FAILED due to "
|
||||
"no managing nsPresContext"));
|
||||
return;
|
||||
}
|
||||
nsCOMPtr<nsIWidget> widget = sPresContext->GetRootWidget();
|
||||
if (NS_WARN_IF(!widget)) {
|
||||
MOZ_LOG(sISMLog, LogLevel::Error,
|
||||
("ISM: IMEStateManager::UpdateIMEState(), FAILED due to "
|
||||
(" UpdateIMEState(), FAILED due to "
|
||||
"no widget for the managing nsPresContext"));
|
||||
return;
|
||||
}
|
||||
|
@ -800,12 +795,12 @@ IMEStateManager::UpdateIMEState(const IMEState& aNewIMEState,
|
|||
// We should try to reinitialize the IMEContentObserver.
|
||||
if (sActiveIMEContentObserver && IsIMEObserverNeeded(aNewIMEState)) {
|
||||
MOZ_LOG(sISMLog, LogLevel::Debug,
|
||||
("ISM: IMEStateManager::UpdateIMEState(), try to reinitialize the "
|
||||
(" UpdateIMEState(), try to reinitialize the "
|
||||
"active IMEContentObserver"));
|
||||
if (!sActiveIMEContentObserver->MaybeReinitialize(widget, sPresContext,
|
||||
aContent, aEditor)) {
|
||||
MOZ_LOG(sISMLog, LogLevel::Error,
|
||||
("ISM: IMEStateManager::UpdateIMEState(), failed to reinitialize the "
|
||||
(" UpdateIMEState(), failed to reinitialize the "
|
||||
"active IMEContentObserver"));
|
||||
}
|
||||
}
|
||||
|
@ -848,7 +843,7 @@ IMEStateManager::GetNewIMEState(nsPresContext* aPresContext,
|
|||
nsIContent* aContent)
|
||||
{
|
||||
MOZ_LOG(sISMLog, LogLevel::Info,
|
||||
("ISM: IMEStateManager::GetNewIMEState(aPresContext=0x%p, aContent=0x%p), "
|
||||
("GetNewIMEState(aPresContext=0x%p, aContent=0x%p), "
|
||||
"sInstalledMenuKeyboardListener=%s",
|
||||
aPresContext, aContent, GetBoolName(sInstalledMenuKeyboardListener)));
|
||||
|
||||
|
@ -856,14 +851,14 @@ IMEStateManager::GetNewIMEState(nsPresContext* aPresContext,
|
|||
if (aPresContext->Type() == nsPresContext::eContext_PrintPreview ||
|
||||
aPresContext->Type() == nsPresContext::eContext_Print) {
|
||||
MOZ_LOG(sISMLog, LogLevel::Debug,
|
||||
("ISM: IMEStateManager::GetNewIMEState() returns DISABLED because "
|
||||
(" GetNewIMEState() returns DISABLED because "
|
||||
"the nsPresContext is for print or print preview"));
|
||||
return IMEState(IMEState::DISABLED);
|
||||
}
|
||||
|
||||
if (sInstalledMenuKeyboardListener) {
|
||||
MOZ_LOG(sISMLog, LogLevel::Debug,
|
||||
("ISM: IMEStateManager::GetNewIMEState() returns DISABLED because "
|
||||
(" GetNewIMEState() returns DISABLED because "
|
||||
"menu keyboard listener was installed"));
|
||||
return IMEState(IMEState::DISABLED);
|
||||
}
|
||||
|
@ -874,12 +869,12 @@ IMEStateManager::GetNewIMEState(nsPresContext* aPresContext,
|
|||
nsIDocument* doc = aPresContext->Document();
|
||||
if (doc && doc->HasFlag(NODE_IS_EDITABLE)) {
|
||||
MOZ_LOG(sISMLog, LogLevel::Debug,
|
||||
("ISM: IMEStateManager::GetNewIMEState() returns ENABLED because "
|
||||
(" GetNewIMEState() returns ENABLED because "
|
||||
"design mode editor has focus"));
|
||||
return IMEState(IMEState::ENABLED);
|
||||
}
|
||||
MOZ_LOG(sISMLog, LogLevel::Debug,
|
||||
("ISM: IMEStateManager::GetNewIMEState() returns DISABLED because "
|
||||
(" GetNewIMEState() returns DISABLED because "
|
||||
"no content has focus"));
|
||||
return IMEState(IMEState::DISABLED);
|
||||
}
|
||||
|
@ -893,7 +888,7 @@ IMEStateManager::GetNewIMEState(nsPresContext* aPresContext,
|
|||
|
||||
IMEState newIMEState = aContent->GetDesiredIMEState();
|
||||
MOZ_LOG(sISMLog, LogLevel::Debug,
|
||||
("ISM: IMEStateManager::GetNewIMEState() returns { mEnabled=%s, "
|
||||
(" GetNewIMEState() returns { mEnabled=%s, "
|
||||
"mOpen=%s }",
|
||||
GetIMEStateEnabledName(newIMEState.mEnabled),
|
||||
GetIMEStateSetOpenName(newIMEState.mOpen)));
|
||||
|
@ -927,7 +922,7 @@ IMEStateManager::SetInputContextForChildProcess(
|
|||
const InputContextAction& aAction)
|
||||
{
|
||||
MOZ_LOG(sISMLog, LogLevel::Info,
|
||||
("ISM: IMEStateManager::SetInputContextForChildProcess(aTabParent=0x%p, "
|
||||
("SetInputContextForChildProcess(aTabParent=0x%p, "
|
||||
"aInputContext={ mIMEState={ mEnabled=%s, mOpen=%s }, "
|
||||
"mHTMLInputType=\"%s\", mHTMLInputInputmode=\"%s\", mActionHint=\"%s\" }, "
|
||||
"aAction={ mCause=%s, mAction=%s }, aTabParent=0x%p), sPresContext=0x%p, "
|
||||
|
@ -943,14 +938,14 @@ IMEStateManager::SetInputContextForChildProcess(
|
|||
|
||||
if (aTabParent != sActiveTabParent) {
|
||||
MOZ_LOG(sISMLog, LogLevel::Error,
|
||||
("ISM: IMEStateManager::SetInputContextForChildProcess(), FAILED, "
|
||||
(" SetInputContextForChildProcess(), FAILED, "
|
||||
"because non-focused tab parent tries to set input context"));
|
||||
return;
|
||||
}
|
||||
|
||||
if (NS_WARN_IF(!sPresContext)) {
|
||||
MOZ_LOG(sISMLog, LogLevel::Error,
|
||||
("ISM: IMEStateManager::SetInputContextForChildProcess(), FAILED, "
|
||||
(" SetInputContextForChildProcess(), FAILED, "
|
||||
"due to no focused presContext"));
|
||||
return;
|
||||
}
|
||||
|
@ -958,7 +953,7 @@ IMEStateManager::SetInputContextForChildProcess(
|
|||
nsCOMPtr<nsIWidget> widget = sPresContext->GetRootWidget();
|
||||
if (NS_WARN_IF(!widget)) {
|
||||
MOZ_LOG(sISMLog, LogLevel::Error,
|
||||
("ISM: IMEStateManager::SetInputContextForChildProcess(), FAILED, "
|
||||
(" SetInputContextForChildProcess(), FAILED, "
|
||||
"due to no widget in the focused presContext"));
|
||||
return;
|
||||
}
|
||||
|
@ -976,7 +971,7 @@ IMEStateManager::SetIMEState(const IMEState& aState,
|
|||
InputContextAction aAction)
|
||||
{
|
||||
MOZ_LOG(sISMLog, LogLevel::Info,
|
||||
("ISM: IMEStateManager::SetIMEState(aState={ mEnabled=%s, mOpen=%s }, "
|
||||
("SetIMEState(aState={ mEnabled=%s, mOpen=%s }, "
|
||||
"aContent=0x%p (TabParent=0x%p), aWidget=0x%p, aAction={ mCause=%s, "
|
||||
"mFocusChange=%s })",
|
||||
GetIMEStateEnabledName(aState.mEnabled),
|
||||
|
@ -1074,7 +1069,7 @@ IMEStateManager::SetInputContext(nsIWidget* aWidget,
|
|||
const InputContextAction& aAction)
|
||||
{
|
||||
MOZ_LOG(sISMLog, LogLevel::Info,
|
||||
("ISM: IMEStateManager::SetInputContext(aWidget=0x%p, aInputContext={ "
|
||||
("SetInputContext(aWidget=0x%p, aInputContext={ "
|
||||
"mIMEState={ mEnabled=%s, mOpen=%s }, mHTMLInputType=\"%s\", "
|
||||
"mHTMLInputInputmode=\"%s\", mActionHint=\"%s\" }, "
|
||||
"aAction={ mCause=%s, mAction=%s }), sActiveTabParent=0x%p",
|
||||
|
@ -1119,7 +1114,7 @@ IMEStateManager::DispatchCompositionEvent(
|
|||
TabParent::GetFrom(aEventTargetNode->AsContent()) : nullptr;
|
||||
|
||||
MOZ_LOG(sISMLog, LogLevel::Info,
|
||||
("ISM: IMEStateManager::DispatchCompositionEvent(aNode=0x%p, "
|
||||
("DispatchCompositionEvent(aNode=0x%p, "
|
||||
"aPresContext=0x%p, aCompositionEvent={ mMessage=%s, "
|
||||
"mNativeIMEContext={ mRawNativeIMEContext=0x%X, "
|
||||
"mOriginProcessID=0x%X }, mWidget(0x%p)={ "
|
||||
|
@ -1158,7 +1153,7 @@ IMEStateManager::DispatchCompositionEvent(
|
|||
return;
|
||||
}
|
||||
MOZ_LOG(sISMLog, LogLevel::Debug,
|
||||
("ISM: IMEStateManager::DispatchCompositionEvent(), "
|
||||
(" DispatchCompositionEvent(), "
|
||||
"adding new TextComposition to the array"));
|
||||
MOZ_ASSERT(aCompositionEvent->mMessage == eCompositionStart);
|
||||
composition =
|
||||
|
@ -1195,7 +1190,7 @@ IMEStateManager::DispatchCompositionEvent(
|
|||
sTextCompositions->IndexOf(aCompositionEvent->mWidget);
|
||||
if (i != TextCompositionArray::NoIndex) {
|
||||
MOZ_LOG(sISMLog, LogLevel::Debug,
|
||||
("ISM: IMEStateManager::DispatchCompositionEvent(), "
|
||||
(" DispatchCompositionEvent(), "
|
||||
"removing TextComposition from the array since NS_COMPOSTION_END "
|
||||
"was dispatched"));
|
||||
sTextCompositions->ElementAt(i)->Destroy();
|
||||
|
@ -1235,7 +1230,7 @@ IMEStateManager::HandleSelectionEvent(nsPresContext* aPresContext,
|
|||
eventTargetContent ? TabParent::GetFrom(eventTargetContent) : nullptr;
|
||||
|
||||
MOZ_LOG(sISMLog, LogLevel::Info,
|
||||
("ISM: IMEStateManager::HandleSelectionEvent(aPresContext=0x%p, "
|
||||
("HandleSelectionEvent(aPresContext=0x%p, "
|
||||
"aEventTargetContent=0x%p, aSelectionEvent={ mMessage=%s, "
|
||||
"mFlags={ mIsTrusted=%s } }), tabParent=%p",
|
||||
aPresContext, aEventTargetContent,
|
||||
|
@ -1270,7 +1265,7 @@ IMEStateManager::OnCompositionEventDiscarded(
|
|||
// commit or cancel composition.
|
||||
|
||||
MOZ_LOG(sISMLog, LogLevel::Info,
|
||||
("ISM: IMEStateManager::OnCompositionEventDiscarded(aCompositionEvent={ "
|
||||
("OnCompositionEventDiscarded(aCompositionEvent={ "
|
||||
"mMessage=%s, mNativeIMEContext={ mRawNativeIMEContext=0x%X, "
|
||||
"mOriginProcessID=0x%X }, mWidget(0x%p)={ "
|
||||
"GetNativeIMEContext()={ mRawNativeIMEContext=0x%X, "
|
||||
|
@ -1303,7 +1298,7 @@ IMEStateManager::OnCompositionEventDiscarded(
|
|||
// the array and destroyed in OnDestroyPresContext(). Therefore, we may
|
||||
// fail to retrieve a TextComposition instance here.
|
||||
MOZ_LOG(sISMLog, LogLevel::Info,
|
||||
("ISM: IMEStateManager::OnCompositionEventDiscarded(), "
|
||||
(" OnCompositionEventDiscarded(), "
|
||||
"TextComposition instance for the widget has already gone"));
|
||||
return;
|
||||
}
|
||||
|
@ -1327,7 +1322,7 @@ IMEStateManager::NotifyIME(const IMENotification& aNotification,
|
|||
bool aOriginIsRemote)
|
||||
{
|
||||
MOZ_LOG(sISMLog, LogLevel::Info,
|
||||
("ISM: IMEStateManager::NotifyIME(aNotification={ mMessage=%s }, "
|
||||
("NotifyIME(aNotification={ mMessage=%s }, "
|
||||
"aWidget=0x%p, aOriginIsRemote=%s), sFocusedIMEWidget=0x%p, "
|
||||
"sRemoteHasFocus=%s",
|
||||
ToChar(aNotification.mMessage), aWidget,
|
||||
|
@ -1336,7 +1331,7 @@ IMEStateManager::NotifyIME(const IMENotification& aNotification,
|
|||
|
||||
if (NS_WARN_IF(!aWidget)) {
|
||||
MOZ_LOG(sISMLog, LogLevel::Error,
|
||||
("ISM: IMEStateManager::NotifyIME(), FAILED due to no widget"));
|
||||
(" NotifyIME(), FAILED due to no widget"));
|
||||
return NS_ERROR_INVALID_ARG;
|
||||
}
|
||||
|
||||
|
@ -1345,11 +1340,11 @@ IMEStateManager::NotifyIME(const IMENotification& aNotification,
|
|||
if (sFocusedIMEWidget) {
|
||||
if (NS_WARN_IF(!sRemoteHasFocus && !aOriginIsRemote)) {
|
||||
MOZ_LOG(sISMLog, LogLevel::Error,
|
||||
("ISM: IMEStateManager::NotifyIME(), although, this process is "
|
||||
(" NotifyIME(), although, this process is "
|
||||
"getting IME focus but there was focused IME widget"));
|
||||
} else {
|
||||
MOZ_LOG(sISMLog, LogLevel::Info,
|
||||
("ISM: IMEStateManager::NotifyIME(), tries to notify IME of "
|
||||
(" NotifyIME(), tries to notify IME of "
|
||||
"blur first because remote process's blur notification hasn't "
|
||||
"been received yet..."));
|
||||
}
|
||||
|
@ -1364,31 +1359,31 @@ IMEStateManager::NotifyIME(const IMENotification& aNotification,
|
|||
case NOTIFY_IME_OF_BLUR: {
|
||||
if (!sRemoteHasFocus && aOriginIsRemote) {
|
||||
MOZ_LOG(sISMLog, LogLevel::Info,
|
||||
("ISM: IMEStateManager::NotifyIME(), received blur notification "
|
||||
(" NotifyIME(), received blur notification "
|
||||
"after another one has focus, nothing to do..."));
|
||||
return NS_OK;
|
||||
}
|
||||
if (NS_WARN_IF(sRemoteHasFocus && !aOriginIsRemote)) {
|
||||
MOZ_LOG(sISMLog, LogLevel::Error,
|
||||
("ISM: IMEStateManager::NotifyIME(), FAILED, received blur "
|
||||
(" NotifyIME(), FAILED, received blur "
|
||||
"notification from this process but the remote has focus"));
|
||||
return NS_OK;
|
||||
}
|
||||
if (!sFocusedIMEWidget && aOriginIsRemote) {
|
||||
MOZ_LOG(sISMLog, LogLevel::Info,
|
||||
("ISM: IMEStateManager::NotifyIME(), received blur notification "
|
||||
(" NotifyIME(), received blur notification "
|
||||
"but the remote has already lost focus"));
|
||||
return NS_OK;
|
||||
}
|
||||
if (NS_WARN_IF(!sFocusedIMEWidget)) {
|
||||
MOZ_LOG(sISMLog, LogLevel::Error,
|
||||
("ISM: IMEStateManager::NotifyIME(), FAILED, received blur "
|
||||
(" NotifyIME(), FAILED, received blur "
|
||||
"notification but there is no focused IME widget"));
|
||||
return NS_OK;
|
||||
}
|
||||
if (NS_WARN_IF(sFocusedIMEWidget != aWidget)) {
|
||||
MOZ_LOG(sISMLog, LogLevel::Error,
|
||||
("ISM: IMEStateManager::NotifyIME(), FAILED, received blur "
|
||||
(" NotifyIME(), FAILED, received blur "
|
||||
"notification but there is no focused IME widget"));
|
||||
return NS_OK;
|
||||
}
|
||||
|
@ -1403,26 +1398,26 @@ IMEStateManager::NotifyIME(const IMENotification& aNotification,
|
|||
case NOTIFY_IME_OF_MOUSE_BUTTON_EVENT:
|
||||
if (!sRemoteHasFocus && aOriginIsRemote) {
|
||||
MOZ_LOG(sISMLog, LogLevel::Info,
|
||||
("ISM: IMEStateManager::NotifyIME(), received content change "
|
||||
(" NotifyIME(), received content change "
|
||||
"notification from the remote but it's already lost focus"));
|
||||
return NS_OK;
|
||||
}
|
||||
if (NS_WARN_IF(sRemoteHasFocus && !aOriginIsRemote)) {
|
||||
MOZ_LOG(sISMLog, LogLevel::Error,
|
||||
("ISM: IMEStateManager::NotifyIME(), FAILED, received content "
|
||||
(" NotifyIME(), FAILED, received content "
|
||||
"change notification from this process but the remote has already "
|
||||
"gotten focus"));
|
||||
return NS_OK;
|
||||
}
|
||||
if (!sFocusedIMEWidget) {
|
||||
MOZ_LOG(sISMLog, LogLevel::Info,
|
||||
("ISM: IMEStateManager::NotifyIME(), received content change "
|
||||
(" NotifyIME(), received content change "
|
||||
"notification but there is no focused IME widget"));
|
||||
return NS_OK;
|
||||
}
|
||||
if (NS_WARN_IF(sFocusedIMEWidget != aWidget)) {
|
||||
MOZ_LOG(sISMLog, LogLevel::Error,
|
||||
("ISM: IMEStateManager::NotifyIME(), FAILED, received content "
|
||||
(" NotifyIME(), FAILED, received content "
|
||||
"change notification for IME which has already lost focus, so, "
|
||||
"nothing to do..."));
|
||||
return NS_OK;
|
||||
|
@ -1443,7 +1438,7 @@ IMEStateManager::NotifyIME(const IMENotification& aNotification,
|
|||
composition && composition->IsSynthesizedForTests();
|
||||
|
||||
MOZ_LOG(sISMLog, LogLevel::Info,
|
||||
("ISM: IMEStateManager::NotifyIME(), composition=0x%p, "
|
||||
(" NotifyIME(), composition=0x%p, "
|
||||
"composition->IsSynthesizedForTests()=%s",
|
||||
composition.get(), GetBoolName(isSynthesizedForTests)));
|
||||
|
||||
|
@ -1457,13 +1452,13 @@ IMEStateManager::NotifyIME(const IMENotification& aNotification,
|
|||
case NOTIFY_IME_OF_COMPOSITION_EVENT_HANDLED:
|
||||
if (!aOriginIsRemote && (!composition || isSynthesizedForTests)) {
|
||||
MOZ_LOG(sISMLog, LogLevel::Info,
|
||||
("ISM: IMEStateManager::NotifyIME(), FAILED, received content "
|
||||
(" NotifyIME(), FAILED, received content "
|
||||
"change notification from this process but there is no compostion"));
|
||||
return NS_OK;
|
||||
}
|
||||
if (!sRemoteHasFocus && aOriginIsRemote) {
|
||||
MOZ_LOG(sISMLog, LogLevel::Info,
|
||||
("ISM: IMEStateManager::NotifyIME(), received content change "
|
||||
(" NotifyIME(), received content change "
|
||||
"notification from the remote but it's already lost focus"));
|
||||
return NS_OK;
|
||||
}
|
||||
|
@ -1483,8 +1478,7 @@ IMEStateManager::NotifyIME(IMEMessage aMessage,
|
|||
bool aOriginIsRemote)
|
||||
{
|
||||
MOZ_LOG(sISMLog, LogLevel::Info,
|
||||
("ISM: IMEStateManager::NotifyIME(aMessage=%s, aPresContext=0x%p, "
|
||||
"aOriginIsRemote=%s)",
|
||||
("NotifyIME(aMessage=%s, aPresContext=0x%p, aOriginIsRemote=%s)",
|
||||
ToChar(aMessage), aPresContext, GetBoolName(aOriginIsRemote)));
|
||||
|
||||
NS_ENSURE_TRUE(aPresContext, NS_ERROR_INVALID_ARG);
|
||||
|
@ -1492,7 +1486,7 @@ IMEStateManager::NotifyIME(IMEMessage aMessage,
|
|||
nsIWidget* widget = aPresContext->GetRootWidget();
|
||||
if (NS_WARN_IF(!widget)) {
|
||||
MOZ_LOG(sISMLog, LogLevel::Error,
|
||||
("ISM: IMEStateManager::NotifyIME(), FAILED due to no widget for the "
|
||||
(" NotifyIME(), FAILED due to no widget for the "
|
||||
"nsPresContext"));
|
||||
return NS_ERROR_NOT_AVAILABLE;
|
||||
}
|
||||
|
@ -1559,18 +1553,17 @@ void
|
|||
IMEStateManager::DestroyIMEContentObserver()
|
||||
{
|
||||
MOZ_LOG(sISMLog, LogLevel::Info,
|
||||
("ISM: IMEStateManager::DestroyIMEContentObserver(), "
|
||||
"sActiveIMEContentObserver=0x%p",
|
||||
("DestroyIMEContentObserver(), sActiveIMEContentObserver=0x%p",
|
||||
sActiveIMEContentObserver.get()));
|
||||
|
||||
if (!sActiveIMEContentObserver) {
|
||||
MOZ_LOG(sISMLog, LogLevel::Debug,
|
||||
("ISM: IMEStateManager::DestroyIMEContentObserver() does nothing"));
|
||||
(" DestroyIMEContentObserver() does nothing"));
|
||||
return;
|
||||
}
|
||||
|
||||
MOZ_LOG(sISMLog, LogLevel::Debug,
|
||||
("ISM: IMEStateManager::DestroyIMEContentObserver(), destroying "
|
||||
(" DestroyIMEContentObserver(), destroying "
|
||||
"the active IMEContentObserver..."));
|
||||
RefPtr<IMEContentObserver> tsm = sActiveIMEContentObserver.get();
|
||||
sActiveIMEContentObserver = nullptr;
|
||||
|
@ -1582,7 +1575,7 @@ void
|
|||
IMEStateManager::CreateIMEContentObserver(nsIEditor* aEditor)
|
||||
{
|
||||
MOZ_LOG(sISMLog, LogLevel::Info,
|
||||
("ISM: IMEStateManager::CreateIMEContentObserver(aEditor=0x%p), "
|
||||
("CreateIMEContentObserver(aEditor=0x%p), "
|
||||
"sPresContext=0x%p, sContent=0x%p, sActiveIMEContentObserver=0x%p, "
|
||||
"sActiveIMEContentObserver->IsManaging(sPresContext, sContent)=%s",
|
||||
aEditor, sPresContext, sContent.get(), sActiveIMEContentObserver.get(),
|
||||
|
@ -1591,7 +1584,7 @@ IMEStateManager::CreateIMEContentObserver(nsIEditor* aEditor)
|
|||
|
||||
if (NS_WARN_IF(sActiveIMEContentObserver)) {
|
||||
MOZ_LOG(sISMLog, LogLevel::Error,
|
||||
("ISM: IMEStateManager::CreateIMEContentObserver(), FAILED due to "
|
||||
(" CreateIMEContentObserver(), FAILED due to "
|
||||
"there is already an active IMEContentObserver"));
|
||||
MOZ_ASSERT(sActiveIMEContentObserver->IsManaging(sPresContext, sContent));
|
||||
return;
|
||||
|
@ -1600,7 +1593,7 @@ IMEStateManager::CreateIMEContentObserver(nsIEditor* aEditor)
|
|||
nsCOMPtr<nsIWidget> widget = sPresContext->GetRootWidget();
|
||||
if (!widget) {
|
||||
MOZ_LOG(sISMLog, LogLevel::Error,
|
||||
("ISM: IMEStateManager::CreateIMEContentObserver(), FAILED due to "
|
||||
(" CreateIMEContentObserver(), FAILED due to "
|
||||
"there is a root widget for the nsPresContext"));
|
||||
return; // Sometimes, there are no widgets.
|
||||
}
|
||||
|
@ -1608,13 +1601,13 @@ IMEStateManager::CreateIMEContentObserver(nsIEditor* aEditor)
|
|||
// If it's not text editable, we don't need to create IMEContentObserver.
|
||||
if (!IsIMEObserverNeeded(widget->GetInputContext().mIMEState)) {
|
||||
MOZ_LOG(sISMLog, LogLevel::Debug,
|
||||
("ISM: IMEStateManager::CreateIMEContentObserver() doesn't create "
|
||||
(" CreateIMEContentObserver() doesn't create "
|
||||
"IMEContentObserver because of non-editable IME state"));
|
||||
return;
|
||||
}
|
||||
|
||||
MOZ_LOG(sISMLog, LogLevel::Debug,
|
||||
("ISM: IMEStateManager::CreateIMEContentObserver() is creating an "
|
||||
(" CreateIMEContentObserver() is creating an "
|
||||
"IMEContentObserver instance..."));
|
||||
sActiveIMEContentObserver = new IMEContentObserver();
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче