diff options
author | wolfbeast <mcwerewolf@wolfbeast.com> | 2020-01-11 14:15:49 +0100 |
---|---|---|
committer | wolfbeast <mcwerewolf@wolfbeast.com> | 2020-01-11 14:15:49 +0100 |
commit | 823b9a4120813274849e68443ec43249b97add3e (patch) | |
tree | 0845f6a6ce06db041530948c5cbd4c347ba12866 /dom/events/IMEStateManager.cpp | |
parent | 319d485e234dff3f59ac2e98ccf4c32a1aa43642 (diff) | |
parent | cffb44547ae7997e5eaf71c644bd626eeb3bba00 (diff) | |
download | UXP-823b9a4120813274849e68443ec43249b97add3e.tar UXP-823b9a4120813274849e68443ec43249b97add3e.tar.gz UXP-823b9a4120813274849e68443ec43249b97add3e.tar.lz UXP-823b9a4120813274849e68443ec43249b97add3e.tar.xz UXP-823b9a4120813274849e68443ec43249b97add3e.zip |
Merge branch 'release' into Pale_Moon-release
Diffstat (limited to 'dom/events/IMEStateManager.cpp')
-rw-r--r-- | dom/events/IMEStateManager.cpp | 24 |
1 files changed, 16 insertions, 8 deletions
diff --git a/dom/events/IMEStateManager.cpp b/dom/events/IMEStateManager.cpp index 1c8ed63f0..80abad3cc 100644 --- a/dom/events/IMEStateManager.cpp +++ b/dom/events/IMEStateManager.cpp @@ -297,7 +297,7 @@ IMEStateManager::OnDestroyPresContext(nsPresContext* aPresContext) IMEState newState = GetNewIMEState(sPresContext, nullptr); InputContextAction action(InputContextAction::CAUSE_UNKNOWN, InputContextAction::LOST_FOCUS); - SetIMEState(newState, nullptr, sWidget, action); + SetIMEState(newState, nullptr, nullptr, sWidget, action); } sWidget = nullptr; sContent = nullptr; @@ -352,7 +352,7 @@ IMEStateManager::OnRemoveContent(nsPresContext* aPresContext, IMEState newState = GetNewIMEState(sPresContext, nullptr); InputContextAction action(InputContextAction::CAUSE_UNKNOWN, InputContextAction::LOST_FOCUS); - SetIMEState(newState, nullptr, sWidget, action); + SetIMEState(newState, aPresContext, nullptr, sWidget, action); } sWidget = nullptr; @@ -542,7 +542,7 @@ IMEStateManager::OnChangeFocusInternal(nsPresContext* aPresContext, } // Update IME state for new focus widget - SetIMEState(newState, aContent, newWidget, aAction); + SetIMEState(newState, aPresContext, aContent, newWidget, aAction); } sActiveTabParent = newTabParent; @@ -704,7 +704,7 @@ IMEStateManager::OnClickInEditor(nsPresContext* aPresContext, InputContextAction action(cause, InputContextAction::FOCUS_NOT_CHANGED); IMEState newState = GetNewIMEState(aPresContext, aContent); - SetIMEState(newState, aContent, widget, action); + SetIMEState(newState, aPresContext, aContent, widget, action); } // static @@ -912,7 +912,7 @@ IMEStateManager::UpdateIMEState(const IMEState& aNewIMEState, if (updateIMEState) { InputContextAction action(InputContextAction::CAUSE_UNKNOWN, InputContextAction::FOCUS_NOT_CHANGED); - SetIMEState(aNewIMEState, aContent, widget, action); + SetIMEState(aNewIMEState, sPresContext, aContent, widget, action); if (NS_WARN_IF(widget->Destroyed())) { MOZ_LOG(sISMLog, LogLevel::Error, (" UpdateIMEState(), widget has gone during setting input context")); @@ -1022,8 +1022,8 @@ IMEStateManager::SetInputContextForChildProcess( MOZ_LOG(sISMLog, LogLevel::Info, ("SetInputContextForChildProcess(aTabParent=0x%p, " "aInputContext={ mIMEState={ mEnabled=%s, mOpen=%s }, " - "mHTMLInputType=\"%s\", mHTMLInputInputmode=\"%s\", mActionHint=\"%s\" }, " - "aAction={ mCause=%s, mAction=%s }), " + "mHTMLInputType=\"%s\", mHTMLInputInputmode=\"%s\", mActionHint=\"%s\", " + "mInPrivateBrowsing=%s }, aAction={ mCause=%s, mAction=%s }), " "sPresContext=0x%p (available: %s), sWidget=0x%p (available: %s), " "sActiveTabParent=0x%p", aTabParent, GetIMEStateEnabledName(aInputContext.mIMEState.mEnabled), @@ -1031,6 +1031,7 @@ IMEStateManager::SetInputContextForChildProcess( NS_ConvertUTF16toUTF8(aInputContext.mHTMLInputType).get(), NS_ConvertUTF16toUTF8(aInputContext.mHTMLInputInputmode).get(), NS_ConvertUTF16toUTF8(aInputContext.mActionHint).get(), + GetBoolName(aInputContext.mInPrivateBrowsing), GetActionCauseName(aAction.mCause), GetActionFocusChangeName(aAction.mFocusChange), sPresContext.get(), GetBoolName(CanHandleWith(sPresContext)), @@ -1070,6 +1071,7 @@ IMEStateManager::SetInputContextForChildProcess( // static void IMEStateManager::SetIMEState(const IMEState& aState, + nsPresContext* aPresContext, nsIContent* aContent, nsIWidget* aWidget, InputContextAction aAction) @@ -1090,6 +1092,10 @@ IMEStateManager::SetIMEState(const IMEState& aState, context.mIMEState = aState; context.mMayBeIMEUnaware = context.mIMEState.IsEditable() && sCheckForIMEUnawareWebApps && MayBeIMEUnawareWebApp(aContent); + + context.mInPrivateBrowsing = + aPresContext && + nsContentUtils::IsInPrivateBrowsing(aPresContext->Document()); if (aContent && aContent->IsAnyOfHTMLElements(nsGkAtoms::input, nsGkAtoms::textarea)) { @@ -1175,7 +1181,8 @@ IMEStateManager::SetInputContext(nsIWidget* aWidget, MOZ_LOG(sISMLog, LogLevel::Info, ("SetInputContext(aWidget=0x%p, aInputContext={ " "mIMEState={ mEnabled=%s, mOpen=%s }, mHTMLInputType=\"%s\", " - "mHTMLInputInputmode=\"%s\", mActionHint=\"%s\" }, " + "mHTMLInputInputmode=\"%s\", mActionHint=\"%s\", " + "mInPrivateBrowsing=%s }, " "aAction={ mCause=%s, mAction=%s }), sActiveTabParent=0x%p", aWidget, GetIMEStateEnabledName(aInputContext.mIMEState.mEnabled), @@ -1183,6 +1190,7 @@ IMEStateManager::SetInputContext(nsIWidget* aWidget, NS_ConvertUTF16toUTF8(aInputContext.mHTMLInputType).get(), NS_ConvertUTF16toUTF8(aInputContext.mHTMLInputInputmode).get(), NS_ConvertUTF16toUTF8(aInputContext.mActionHint).get(), + GetBoolName(aInputContext.mInPrivateBrowsing), GetActionCauseName(aAction.mCause), GetActionFocusChangeName(aAction.mFocusChange), sActiveTabParent.get())); |