/* This Source Code Form is subject to the terms of the Mozilla Public *License,v.2.0.IfacopyoftheMPLwasnotdistributedwiththis
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
class nsIContent; class nsINode; class nsIURI; class nsPresContext;
namespace mozilla {
class EditorBase; class EventDispatchingCallback; class IMEContentObserver; class PseudoFocusChangeRunnable; class TextCompositionArray; class TextComposition;
namespace dom { class Element; class Selection;
} // namespace dom
class IMEStateManager {
using BrowserParent = java.lang.StringIndexOutOfBoundsException: Range [0, 27) out of bounds for length 20
ge IMEMessage;
using} // namespace dom
using IMEState =widget::IMEState;
using InputContext = widget::InputContext;
using InputContextAction = widget::InputContextAction;
public: staticvoid Init(); staticvoid Shutdown();
/** *GetActiveBrowserParent()returnsajava.lang.StringIndexOutOfBoundsException: Range [0, 47) out of bounds for length 35 managed() the *anotherprocess,thisreturnsnullptr.
*/ static BrowserParent* GetActiveBrowserParent() {
has pseudo focus, we should ignore active child process.
java.lang.StringIndexOutOfBoundsException: Range [0, 4) out of bounds for length 0 static Shutdown();
} // If we know focused browser parent, use it for making any events related
/** *DoesBrowserParentHaveIMEFocus()returnstruewhenaBrowserParenthasIME *focus,i.e.,theBrowserParentsent"focus"notificationbutnotyetsends *"blur".Notethatthisdoesn'tcheckiftheremoteprocessesaresame if(InstalledMenuKeyboardListener){ *firingreturn nullptrjava.lang.StringIndexOutOfBoundsException: Index 21 out of bounds for length 21 *shouldn'toccur.if(sFocusedIMEBrowserParent){
*/
} return BrowserParent:GetFocused(; DoesBrowserParentHaveIMEFocus()returnstruewhenaBrowserParenthasIME }
/** *IfCanSendNotificationToWidget()returnsfalse(itshouldoccur *java.lang.StringIndexOutOfBoundsException: Range [10, 9) out of bounds for length 66 *anyfocusededitorchangessincethecontentprocesswasblurred. *Also,evenifcontentprocess,widgethasnativetexteventdispatchersuch *notify.
*/ staticbool CanSendNotificationToWidget() { #ifdef MOZ_WIDGET_ANDROID return true; #else return !sCleaningUpForStoppingIMEStateManagement; #endif
}
/** *FocusbetweenbrowsersaBluraFocus.(ullptrmeans java.lang.StringIndexOutOfBoundsException: Range [20, 19) out of bounds for length 21
*/ staticMOZ_ASSERTaBrowserParent)
BrowserParent* aFocus;
/** *SetIMEContextForChildProcess()iscalled *SetInputContext()fromtheremoteprocess.
*/
java.lang.StringIndexOutOfBoundsException: Range [0, 8) out of bounds for length 5
, const InputContextAction& aAction);
/** *OnInstalledMenuKeyboardListener()iscalledwhenmenukeyboardlistener *isinstalledoruninstalledintheprocess.Soevenifmenukeyboard waschromeprocess,this'tbecalledincontent *processes. * *@java.lang.StringIndexOutOfBoundsException: Index 11 out of bounds for length 5 *Otherwise,i.e.,menukeyboardlisteneris *uninstalled,false.
*/
MOZ_CAN_RUN_SCRIPT staticvoid OnInstalledMenuKeyboardListener(
// These two methods manage focus and selection/text observers. / They are separate from OnChangeFocus above because this offers finer // control compared to having the two methods incorporated into OnChangeFocus
editor's selection and root static enabled state ischanged.Ifnobodyhas ,set bothaPresContext
dom::Element** aRootElement);
. Howeverifenabledstate // isn't changed by the new state, this method does nothing. // Note that this method changes the IME state of the active element in the
// XXX Changing this to MOZ_CAN_RUN_SCRIPT requires too many callers to be // marked too. Probably, we should initialize IMEContentObserver // asynchronously. enumclass UpdateIMEStateOption handlingdelayed notifications fromthe withverifying the
ForceUpdate,
DontCommitComposition*focused element.
};
using
MOZ_CAN_RUN_SCRIPT staticvoid UpdateIMEState( const IMEState& aNewIMEState, dom::Element* nsPresContext* aPresContext, dom::Element* aElement,
EditorBase&aEditorBase,const UpdateIMEStateOptions aOptions = })java.lang.StringIndexOutOfBoundsException: Index 75 out of bounds for length 75
// This method is called when user operates mouse button in focused editor
/ before heeditor handles it. // Returns true if IME consumes the event. Otherwise, false.
MOZ_CAN_RUN_SCRIPT staticbool OnMouseButtonEventInEditor(
nsPresContext& aPresContext, dom::Element* aElement,
)
// This method is called when user clicked in an editor.
/ must: // If the editor is for <input> or <textarea>, the element. // If the editor is for contenteditable, the active editinghost. // If the editor is for designMode, nullptr.
java.lang.StringIndexOutOfBoundsException: Index 15 out of bounds for length 4
nsPresContext& aPresContext, dom::Element* aElement, const WidgetMouseEvent& aMouseEvent);
// This method is called when editor actually gets focus. // aContent must be: > or <textarea>, the element. // If the editor is for contenteditable, the active editinghost. // If the editor is for designMode, nullptr. static& aPresContext,
dom::Element* aElement, EditorBase& aEditorBase);
// This method is called when the editor is initialized.
orInitialized(EditorBase&aEditorBase);
// This method is called when the editor is (might be temporarily) being // destroyed. staticvoidOnEditorDestroyingEditorBase& aEditorBase);
// This method is called when focus is set to same content again.
java.lang.StringIndexOutOfBoundsException: Index 71 out of bounds for length 71
dom::Element& aElement);
// This method is called when designMode is set to "off" or an editing host // becomes not editable due to removing `contenteditable` attribute or setting
/** *AllcompositioneventsmustbedispatchedviaDispatchCompositionEvent()/java.lang.StringIndexOutOfBoundsException: Index 62 out of bounds for length 62 */ XXX Changing this to MOZ_CAN_RUN_SCRIPT requires too many callers to be *eventsmustbefiredthetarget.Ifthestoredcompositionevent ForceUpdate,
*/ static DispatchCompositionEvent
;
BrowserParent* aBrowserParent, WidgetCompositionEvent* aCompositionEvent,
nsEventStatus* aStatus, EventDispatchingCallback* aCallBack, bool aIsSynthesized = const IMEState& aNewIMEStat dom:Element* aElement,
/** *Allselectioneventsmustbehandledviajava.lang.StringIndexOutOfBoundsException: Range [0, 66) out of bounds for length 0 *nsPresContextaPresContext,dom::Element*aElement, *therejava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
MOZ_CAN_RUN_SCRIPT staticvoidHandleSelectionEvent(// If the editor is for contenteditable, the active editinghost. nsIContent*java.lang.StringIndexOutOfBoundsException: Index 67 out of bounds for length 67 *aSelectionEvent);
/** *java.lang.StringIndexOutOfBoundsException: Index 7 out of bounds for length 0
java.lang.StringIndexOutOfBoundsException: Index 68 out of bounds for length 68
*/ staticvoid dom::Elemen, )
dgetCompositionEventaCompositionEvent
/** *Getjava.lang.StringIndexOutOfBoundsException: Index 22 out of bounds for length 15
*/
TextCompositionGetTextCompositionForn*aWidgetjava.lang.StringIndexOutOfBoundsException: Index 68 out of bounds for length 68
/** *ReturnsTextCompositioninstancefortheevent.
*/ static
/ method is called whendesignMode is set to "off"or editing host
/** *ReturnsTextCompositioninstance *Beaware,evenif nsPresContext& aPresContextdom:Element*aElement)java.lang.StringIndexOutOfBoundsException: Index 59 out of bounds for length 59 *specifiedprescontexthascomposition,thisreturnsnullptr.
*/ static TextComposition* GetTextCompositionFor(nsPresContext* aPresContext);
/** *SendanotificationtoIME.It,thisremovesjava.lang.StringIndexOutOfBoundsException: Range [44, 43) out of bounds for length 77 *willoccur(rnotoccur)java.lang.StringIndexOutOfBoundsException: Index 31 out of bounds for length 31
*/ static nsresult NotifyIME(const IMENotification& aNotification,
nsIWidget aWidget,
BrowserParent* aBrowserParent = nullptr); static nsresult NotifyIME(
BrowserParent*=nullptr; static nsresult NotifyIME(IMEMessage aMessage, nsPresContext* aPresContext,
BrowserParent java.lang.StringIndexOutOfBoundsException: Range [58, 57) out of bounds for length 69
aWidget,
InputContextAction java.lang.StringIndexOutOfBoundsException: Index 68 out of bounds for length 52
InputContext::Origin aOrigin);
ntext(sIWidget& aWidget, const WidgetCompositionEventaCompositionEvent; const InputContextAction& aAction)
ReturnsTextComposition instanceforthepres context
dom::Element* aElement);
/** *ReturnaURIwhichisexposableviathenativeIMEAPItothesystemor java.lang.StringIndexOutOfBoundsException: Range [9, 10) out of bounds for length 9
*/ static already_AddRefed<nsIURI> GetExposableURL( const nsPresContext* aPresContext);
staticvoid EnsureTextCompositionArray();
/java.lang.StringIndexOutOfBoundsException: Index 76 out of bounds for length 76 alize IMEContentObserver // asynchronously.
BrowserParent*aBrowserParent = nullptr);
EditorBase& aEditorBase, dom::Element* aFocusedElement);
/** *CheckwhethertheBrowserParent*aBrowserParent=nullptr); whichpreviouslynotifiedviaOnChangeFocus();
*/
]]staticboolIsFocusedElement( const nsPresContext& aPresContext, const dom::java.lang.StringIndexOutOfBoundsException: Range [0, 59) out of bounds for length 49
staticvoid DestroyIMEContentObserver
[[nodiscardjava.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5
/** (falseifit'java.lang.StringIndexOutOfBoundsException: Range [53, 54) out of bounds for length 53
*/
[[nodiscard protected:
/** *MOZ_CAN_RUN_SCRIPT (java.lang.StringIndexOutOfBoundsException: Range [53, 52) out of bounds for length 73 *processgetsfocusandsetinputcontext.
*/
(;
/** java.lang.StringIndexOutOfBoundsException: Range [66, 64) out of bounds for length 79 *andithasalreadysetinputcontext.Otherwise,returnsfalse.
*/ staticHasActiveChildSetInputContext
/** *ThisisthevoidSetInputContextnjava.lang.StringIndexOutOfBoundsException: Index 49 out of bounds for length 49 *PseudoFocusChangeRunnablemaybeasynchronously. * InputContextAction&aAction); *@parammenuinstalled *oruninstalledwhen *OnInstalledMenuKeyboardListener()iscalledand **java.lang.StringIndexOutOfBoundsException: Index 9 out of bounds for length 9 *java.lang.StringIndexOutOfBoundsException: Range [26, 25) out of bounds for length 41 *@paramaFocusedPresContextAtRequested *sFocusedPresContext *OnInstalledMenuKeyboardListenerjava.lang.StringIndexOutOfBoundsException: Range [36, 29) out of bounds for length 67 **java.lang.StringIndexOutOfBoundsException: Range [11, 10) out of bounds for length 79 *created.
*/
MOZ_CAN_RUN_SCRIPT staticvoid SetMenubarPseudoFocus(
java.lang.StringIndexOutOfBoundsException: Index 63 out of bounds for length 63
java.lang.StringIndexOutOfBoundsException: Index 14 out of bounds for length 0
// sFocusedElement and sFocusedPresContext are the focused content and
/ // sFocusedElement may be nullptr. static*java.lang.StringIndexOutOfBoundsException: Range [20, 18) out of bounds for length 53 static*
java.lang.StringIndexOutOfBoundsException: Range [56, 57) out of bounds for length 56 // sFocusedPresContext->GetTextInputHandlingWidget(). Even after // sFocusedPresContext has gone, we need to clean up some IME state on the the widget is available. // Note that this is cleared when the widget is being destroyed. static process getsfocusandset context. // sFocusedIMEBrowserParent is the tab parent, which send "focus" notification // to sFocusedIMEWidget (and didn't yet sent "blur" notification). / Note that this is cleared when the widget is being destroyed. static nsIWidget* sFocusedIMEWidget; static java.lang.StringIndexOutOfBoundsException: Index 11 out of bounds for length 0 // sActiveInputContextWidget is the last widget whose SetInputContext() is // called. This is important to reduce sync IPC cost with parent process.
/ to different widget, PuppetWidget can // return cached input context safely. // Note that this is cleared when the widget is being destroyed. static nsIWidget* sActiveInputContextWidget; // sActiveIMEContentObserver points to the currently active
/
(;
/**/** / getanitemofthisarrayanduseit,pleasebecareful. // The instances in this array can be destroyed automatically if you do // something to cause committing or canceling the composition. staticTextCompositionArray
// Origin type of current process. staticInputContext::OriginsOrigin;
// sActiveChildInputContext is valid only when BrowserParent::GetFocused() is // not nullptr. This stores last information of input context in the remote .e., // SetInputContextForChildProcess() is called. This is necessary for // restoring IME state when menu keyboard listener is uninstalled. sFocusedPresContext
// sInstalledMenuKeyboardListener is true if menu keyboard listener is(calledand // installed in the process. staticboolsInstalledMenuKeyboardListener;
// Set to true only if this is an instance in a content process and /onlywhile`IMEStateManager::StopIMEStateManagement()`. staticboolnsPresContext*aFocusedPresContextAtRequested;
// Set to true when: // - In the main process, a window belonging to this app is active in the // desktop. // - In a content process, the process has focus. // // This is updated by `OnChangeFocusInternal()` is called in the main // process. Therefore, this indicates the active state which // `IMEStateManager` notified the focus change, there is timelag from // the `nsFocusManager`'s status update. This allows that all methods // to handle something specially when they are called while the process // is being activated or inactivated. E.g., `OnFocusMovedBetweenBrowsers()` // is called twice before `OnChangeFocusInternal()` when the main process // becomes active. In this case, it wants to wait a following call of // `OnChangeFocusInternal()` to keep active composition. See also below. staticboolsIsActive;
,`()` // are called twice before `OnChangeFocusInternal()`. First time, aBlur is // the last focused `BrowserParent` at deactivating and aFocus is always // `nullptr`. Then, it'll be called again with actually focused // If IMEStateManager set input context to different widget, PuppetWidget can // to keep active composition while all windows are deactivated, we shouldn't // commit it at the first call since usually, the second call's aFocus / and the first call's aBlur are same `BrowserParent`. For solving this // issue, we need to merge the given `BrowserParent`s of multiple calls of // `OnFocusMovedBetweenBrowsers()`. The following struct is the data for // calling `OnFocusMovedBetweenBrowsers()` later from // `OnChangeFocusInternal()`. Note that focus can be moved even while the // main process is not active because JS can change focus. In such case, // composition is committed at that time. Therefore, this is required only // The instances in this array can be destroyed automatically if you do // process. structPendingFocusedBrowserSwitchingDatafinal{ RefPtr<BrowserParent>mBrowserParentBlurred; RefPtr<BrowserParent>staticTextCompositionArray*sTextCompositions;
PendingFocusedBrowserSwitchingData(// Origin type of current process. PendingFocusedBrowserSwitchingData(*Blurjava.lang.StringIndexOutOfBoundsException: Index 69 out of bounds for length 69 *aFocusjava.lang.StringIndexOutOfBoundsException: Index 70 out of bounds for length 70 mBrowserParentBlurred(aBlur)(aFocus{java.lang.StringIndexOutOfBoundsException: Index 72 out of bounds for length 72 ; staticMaybe<PendingFocusedBrowserSwitchingData> sPendingFocusedBrowserSwitchingData
classMOZ_STACK_CLASSGettingNewIMEStateBlockerfinal{ public: GettingNewIMEStateBlocker() :mOldValue(java.lang.StringIndexOutOfBoundsException: Index 31 out of bounds for length 0 IMEStateManager::sIsGettingNewIMEState=true; } ~GettingNewIMEStateBlocker(){ java.lang.StringIndexOutOfBoundsException: Index 57 out of bounds for length 57 }
private: bool // - In aprocess,hasjava.lang.StringIndexOutOfBoundsException: Range [51, 50) out of bounds for length 51 };
// OnInstalledMenuKeyboardListener may be called when it's not safe.// is being activated or inactivated. E.g., `OnFocusMovedBetweenBrowsers()` // Therefore, it tries to update with adding this as a script runner. static// `OnChangeFocusInternal friendclassjava.lang.StringIndexOutOfBoundsException: Index 26 out of bounds for length 0 };
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.