2015-05-03 22:32:37 +03:00
|
|
|
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
|
|
|
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
|
2014-03-08 05:20:07 +04:00
|
|
|
/* This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
|
|
|
|
|
|
|
#ifndef mozilla_IMEContentObserver_h_
|
|
|
|
#define mozilla_IMEContentObserver_h_
|
|
|
|
|
|
|
|
#include "mozilla/Attributes.h"
|
2017-06-20 13:23:44 +03:00
|
|
|
#include "mozilla/EditorBase.h"
|
2017-10-12 12:11:09 +03:00
|
|
|
#include "mozilla/dom/Selection.h"
|
2014-03-08 05:20:07 +04:00
|
|
|
#include "nsCOMPtr.h"
|
2014-04-24 04:36:14 +04:00
|
|
|
#include "nsCycleCollectionParticipant.h"
|
2014-03-08 05:20:07 +04:00
|
|
|
#include "nsIDocShell.h" // XXX Why does only this need to be included here?
|
2014-07-31 08:37:59 +04:00
|
|
|
#include "nsIEditorObserver.h"
|
2014-03-08 05:20:07 +04:00
|
|
|
#include "nsIReflowObserver.h"
|
|
|
|
#include "nsISelectionListener.h"
|
|
|
|
#include "nsIScrollObserver.h"
|
2017-04-11 15:24:55 +03:00
|
|
|
#include "nsIWidget.h"
|
2017-06-08 05:21:28 +03:00
|
|
|
#include "nsStubDocumentObserver.h"
|
2014-03-08 05:20:07 +04:00
|
|
|
#include "nsStubMutationObserver.h"
|
2015-06-17 04:03:57 +03:00
|
|
|
#include "nsThreadUtils.h"
|
2014-03-08 05:20:07 +04:00
|
|
|
#include "nsWeakReference.h"
|
|
|
|
|
|
|
|
class nsIContent;
|
|
|
|
class nsINode;
|
|
|
|
class nsISelection;
|
|
|
|
class nsPresContext;
|
|
|
|
|
|
|
|
namespace mozilla {
|
|
|
|
|
2014-04-24 04:36:15 +04:00
|
|
|
class EventStateManager;
|
Bug 1275906 part.2 TextComposition should use IMEContentObserver for sending NOTIFY_IME_OF_COMPOSITION_EVENT_HANDLED if the editor which has the composition is in the active IMEContentObserver r=smaug
For sending NOTIFY_IME_OF_COMPOSITION_EVENT_HANDLED after the other change notifications which was caused by the user input, we need to use IMEContentObserver::IMENotificationSender because it sends the notifications when it's safe to do it.
This patch makes TextComposition use IMEContentObserver to send the notification. However, if there is no active IMEContentObserver, e.g., composition events are fired on unfocused window, TextComposition sends it by itself (same as current implementation).
If IMEContentObserver stops observing when it has pending NOTIFY_IME_OF_COMPOSITION_EVENT_HANDLED, it cannot send the notification (i.e., it is discarded completely in such case). However, in such case, IMEContentObserver sends NOTIFY_IME_OF_BLUR. So, anyway, native IME handler should treat the blur notification as it including NOTIFY_IME_OF_COMPOSITION_EVENT_HANDLED.
On the other hand, we're buggy if composition events are fired in non-active window. Even in such case, IMEContentObserver should be created for active editor in each document and it notifies IME of the changes. But this is out of the scope of this bug.
MozReview-Commit-ID: 7Q0ZsJTh4hX
--HG--
extra : rebase_source : 6417f991fa8c0fbe3f25b27bacf4257e5485aecc
2016-06-01 16:14:41 +03:00
|
|
|
class TextComposition;
|
2014-04-24 04:36:15 +04:00
|
|
|
|
2014-03-08 05:20:07 +04:00
|
|
|
// IMEContentObserver notifies widget of any text and selection changes
|
|
|
|
// in the currently focused editor
|
2015-03-21 19:28:04 +03:00
|
|
|
class IMEContentObserver final : public nsISelectionListener
|
2015-03-27 21:52:19 +03:00
|
|
|
, public nsStubMutationObserver
|
|
|
|
, public nsIReflowObserver
|
|
|
|
, public nsIScrollObserver
|
|
|
|
, public nsSupportsWeakReference
|
|
|
|
, public nsIEditorObserver
|
2014-03-08 05:20:07 +04:00
|
|
|
{
|
|
|
|
public:
|
2015-12-02 07:20:00 +03:00
|
|
|
typedef ContentEventHandler::NodePosition NodePosition;
|
2015-12-02 07:20:00 +03:00
|
|
|
typedef ContentEventHandler::NodePositionBefore NodePositionBefore;
|
2015-08-21 19:43:41 +03:00
|
|
|
typedef widget::IMENotification::SelectionChangeData SelectionChangeData;
|
2015-07-11 04:53:56 +03:00
|
|
|
typedef widget::IMENotification::TextChangeData TextChangeData;
|
|
|
|
typedef widget::IMENotification::TextChangeDataBase TextChangeDataBase;
|
2017-04-11 15:24:55 +03:00
|
|
|
typedef widget::IMENotificationRequests IMENotificationRequests;
|
2015-09-16 11:48:24 +03:00
|
|
|
typedef widget::IMEMessage IMEMessage;
|
2015-07-11 04:53:56 +03:00
|
|
|
|
2014-03-08 05:20:07 +04:00
|
|
|
IMEContentObserver();
|
|
|
|
|
2014-04-24 04:36:14 +04:00
|
|
|
NS_DECL_CYCLE_COLLECTING_ISUPPORTS
|
|
|
|
NS_DECL_CYCLE_COLLECTION_CLASS_AMBIGUOUS(IMEContentObserver,
|
|
|
|
nsISelectionListener)
|
2014-07-31 08:37:59 +04:00
|
|
|
NS_DECL_NSIEDITOROBSERVER
|
2014-03-08 05:20:07 +04:00
|
|
|
NS_DECL_NSISELECTIONLISTENER
|
2014-07-31 08:38:01 +04:00
|
|
|
NS_DECL_NSIMUTATIONOBSERVER_CHARACTERDATAWILLCHANGE
|
2014-03-08 05:20:07 +04:00
|
|
|
NS_DECL_NSIMUTATIONOBSERVER_CHARACTERDATACHANGED
|
|
|
|
NS_DECL_NSIMUTATIONOBSERVER_CONTENTAPPENDED
|
|
|
|
NS_DECL_NSIMUTATIONOBSERVER_CONTENTINSERTED
|
|
|
|
NS_DECL_NSIMUTATIONOBSERVER_CONTENTREMOVED
|
|
|
|
NS_DECL_NSIMUTATIONOBSERVER_ATTRIBUTEWILLCHANGE
|
|
|
|
NS_DECL_NSIMUTATIONOBSERVER_ATTRIBUTECHANGED
|
|
|
|
NS_DECL_NSIREFLOWOBSERVER
|
|
|
|
|
|
|
|
// nsIScrollObserver
|
2015-03-21 19:28:04 +03:00
|
|
|
virtual void ScrollPositionChanged() override;
|
2014-03-08 05:20:07 +04:00
|
|
|
|
2014-08-29 14:08:43 +04:00
|
|
|
bool OnMouseButtonEvent(nsPresContext* aPresContext,
|
|
|
|
WidgetMouseEvent* aMouseEvent);
|
|
|
|
|
2015-09-08 06:54:14 +03:00
|
|
|
nsresult HandleQueryContentEvent(WidgetQueryContentEvent* aEvent);
|
|
|
|
|
2017-06-08 05:21:28 +03:00
|
|
|
/**
|
|
|
|
* Init() initializes the instance, i.e., retrieving necessary objects and
|
|
|
|
* starts to observe something.
|
|
|
|
* Be aware, callers of this method need to guarantee that the instance
|
|
|
|
* won't be released during calling this.
|
|
|
|
*
|
|
|
|
* @param aWidget The widget which can access native IME.
|
|
|
|
* @param aPresContext The PresContext which has aContent.
|
|
|
|
* @param aContent An editable element or a plugin host element which
|
|
|
|
* user may use IME in.
|
|
|
|
* Or nullptr if this will observe design mode
|
|
|
|
* document.
|
2017-06-20 13:23:44 +03:00
|
|
|
* @param aEditorBase When aContent is an editable element or nullptr,
|
2017-06-08 05:21:28 +03:00
|
|
|
* non-nullptr referring an editor instance which
|
|
|
|
* manages aContent.
|
|
|
|
* Otherwise, i.e., this will observe a plugin content,
|
|
|
|
* should be nullptr.
|
|
|
|
*/
|
2014-03-08 05:20:07 +04:00
|
|
|
void Init(nsIWidget* aWidget, nsPresContext* aPresContext,
|
2017-06-20 13:23:44 +03:00
|
|
|
nsIContent* aContent, EditorBase* aEditorBase);
|
2017-06-08 05:21:28 +03:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Destroy() finalizes the instance, i.e., stops observing contents and
|
|
|
|
* clearing the members.
|
|
|
|
* Be aware, callers of this method need to guarantee that the instance
|
|
|
|
* won't be released during calling this.
|
|
|
|
*/
|
2014-03-08 05:20:07 +04:00
|
|
|
void Destroy();
|
2017-06-08 05:21:28 +03:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Returns false if the instance refers some objects and observing them.
|
|
|
|
* Otherwise, true.
|
|
|
|
*/
|
2017-04-28 14:09:55 +03:00
|
|
|
bool Destroyed() const;
|
|
|
|
|
2014-04-24 04:36:15 +04:00
|
|
|
/**
|
|
|
|
* IMEContentObserver is stored by EventStateManager during observing.
|
|
|
|
* DisconnectFromEventStateManager() is called when EventStateManager stops
|
|
|
|
* storing the instance.
|
|
|
|
*/
|
|
|
|
void DisconnectFromEventStateManager();
|
2017-06-08 05:21:28 +03:00
|
|
|
|
2015-05-26 10:45:26 +03:00
|
|
|
/**
|
|
|
|
* MaybeReinitialize() tries to restart to observe the editor's root node.
|
|
|
|
* This is useful when the editor is reframed and all children are replaced
|
|
|
|
* with new node instances.
|
2017-06-08 05:21:28 +03:00
|
|
|
* Be aware, callers of this method need to guarantee that the instance
|
|
|
|
* won't be released during calling this.
|
|
|
|
*
|
2015-05-26 10:45:26 +03:00
|
|
|
* @return Returns true if the instance is managing the content.
|
|
|
|
* Otherwise, false.
|
|
|
|
*/
|
|
|
|
bool MaybeReinitialize(nsIWidget* aWidget,
|
|
|
|
nsPresContext* aPresContext,
|
|
|
|
nsIContent* aContent,
|
2017-06-20 13:23:44 +03:00
|
|
|
EditorBase* aEditorBase);
|
2017-06-08 05:21:28 +03:00
|
|
|
|
Bug 1275906 part.2 TextComposition should use IMEContentObserver for sending NOTIFY_IME_OF_COMPOSITION_EVENT_HANDLED if the editor which has the composition is in the active IMEContentObserver r=smaug
For sending NOTIFY_IME_OF_COMPOSITION_EVENT_HANDLED after the other change notifications which was caused by the user input, we need to use IMEContentObserver::IMENotificationSender because it sends the notifications when it's safe to do it.
This patch makes TextComposition use IMEContentObserver to send the notification. However, if there is no active IMEContentObserver, e.g., composition events are fired on unfocused window, TextComposition sends it by itself (same as current implementation).
If IMEContentObserver stops observing when it has pending NOTIFY_IME_OF_COMPOSITION_EVENT_HANDLED, it cannot send the notification (i.e., it is discarded completely in such case). However, in such case, IMEContentObserver sends NOTIFY_IME_OF_BLUR. So, anyway, native IME handler should treat the blur notification as it including NOTIFY_IME_OF_COMPOSITION_EVENT_HANDLED.
On the other hand, we're buggy if composition events are fired in non-active window. Even in such case, IMEContentObserver should be created for active editor in each document and it notifies IME of the changes. But this is out of the scope of this bug.
MozReview-Commit-ID: 7Q0ZsJTh4hX
--HG--
extra : rebase_source : 6417f991fa8c0fbe3f25b27bacf4257e5485aecc
2016-06-01 16:14:41 +03:00
|
|
|
bool IsManaging(nsPresContext* aPresContext, nsIContent* aContent) const;
|
|
|
|
bool IsManaging(const TextComposition* aTextComposition) const;
|
2016-06-28 09:23:12 +03:00
|
|
|
bool WasInitializedWithPlugin() const;
|
2017-06-20 13:23:44 +03:00
|
|
|
bool WasInitializedWith(const EditorBase& aEditorBase) const
|
|
|
|
{
|
|
|
|
return mEditorBase == &aEditorBase;
|
|
|
|
}
|
2014-03-08 05:20:07 +04:00
|
|
|
bool IsEditorHandlingEventForComposition() const;
|
|
|
|
bool KeepAliveDuringDeactive() const
|
2014-03-08 05:20:07 +04:00
|
|
|
{
|
2017-04-13 08:32:12 +03:00
|
|
|
return mIMENotificationRequests &&
|
|
|
|
mIMENotificationRequests->WantDuringDeactive();
|
2014-03-08 05:20:07 +04:00
|
|
|
}
|
2014-03-08 05:20:07 +04:00
|
|
|
nsIWidget* GetWidget() const { return mWidget; }
|
2015-09-08 06:54:14 +03:00
|
|
|
void SuppressNotifyingIME();
|
|
|
|
void UnsuppressNotifyingIME();
|
2015-05-15 04:18:08 +03:00
|
|
|
nsPresContext* GetPresContext() const;
|
2014-03-08 05:20:07 +04:00
|
|
|
nsresult GetSelectionAndRoot(nsISelection** aSelection,
|
|
|
|
nsIContent** aRoot) const;
|
2014-03-08 05:20:07 +04:00
|
|
|
|
2015-11-10 05:49:05 +03:00
|
|
|
/**
|
|
|
|
* TryToFlushPendingNotifications() should be called when pending events
|
|
|
|
* should be flushed. This tries to run the queued IMENotificationSender.
|
2017-06-29 14:46:11 +03:00
|
|
|
* Doesn't do anything in child processes where flushing happens
|
2017-08-03 19:36:58 +03:00
|
|
|
* asynchronously unless aAllowAsync is false.
|
2015-11-10 05:49:05 +03:00
|
|
|
*/
|
2017-08-03 19:36:58 +03:00
|
|
|
void TryToFlushPendingNotifications(bool aAllowAsync);
|
2015-11-10 05:49:05 +03:00
|
|
|
|
Bug 1275906 part.2 TextComposition should use IMEContentObserver for sending NOTIFY_IME_OF_COMPOSITION_EVENT_HANDLED if the editor which has the composition is in the active IMEContentObserver r=smaug
For sending NOTIFY_IME_OF_COMPOSITION_EVENT_HANDLED after the other change notifications which was caused by the user input, we need to use IMEContentObserver::IMENotificationSender because it sends the notifications when it's safe to do it.
This patch makes TextComposition use IMEContentObserver to send the notification. However, if there is no active IMEContentObserver, e.g., composition events are fired on unfocused window, TextComposition sends it by itself (same as current implementation).
If IMEContentObserver stops observing when it has pending NOTIFY_IME_OF_COMPOSITION_EVENT_HANDLED, it cannot send the notification (i.e., it is discarded completely in such case). However, in such case, IMEContentObserver sends NOTIFY_IME_OF_BLUR. So, anyway, native IME handler should treat the blur notification as it including NOTIFY_IME_OF_COMPOSITION_EVENT_HANDLED.
On the other hand, we're buggy if composition events are fired in non-active window. Even in such case, IMEContentObserver should be created for active editor in each document and it notifies IME of the changes. But this is out of the scope of this bug.
MozReview-Commit-ID: 7Q0ZsJTh4hX
--HG--
extra : rebase_source : 6417f991fa8c0fbe3f25b27bacf4257e5485aecc
2016-06-01 16:14:41 +03:00
|
|
|
/**
|
|
|
|
* MaybeNotifyCompositionEventHandled() posts composition event handled
|
|
|
|
* notification into the pseudo queue.
|
|
|
|
*/
|
|
|
|
void MaybeNotifyCompositionEventHandled();
|
|
|
|
|
2014-03-08 05:20:07 +04:00
|
|
|
private:
|
2014-06-23 23:56:07 +04:00
|
|
|
~IMEContentObserver() {}
|
|
|
|
|
2015-05-26 10:45:26 +03:00
|
|
|
enum State {
|
|
|
|
eState_NotObserving,
|
2015-05-26 10:45:26 +03:00
|
|
|
eState_Initializing,
|
2015-05-26 10:45:26 +03:00
|
|
|
eState_StoppedObserving,
|
|
|
|
eState_Observing
|
|
|
|
};
|
|
|
|
State GetState() const;
|
2015-10-10 04:21:01 +03:00
|
|
|
bool InitWithEditor(nsPresContext* aPresContext, nsIContent* aContent,
|
2017-06-20 13:23:44 +03:00
|
|
|
EditorBase* aEditorBase);
|
2015-10-10 04:21:01 +03:00
|
|
|
bool InitWithPlugin(nsPresContext* aPresContext, nsIContent* aContent);
|
2017-06-20 13:23:44 +03:00
|
|
|
bool IsInitializedWithPlugin() const { return !mEditorBase; }
|
2015-11-10 05:49:04 +03:00
|
|
|
void OnIMEReceivedFocus();
|
2015-10-10 04:21:01 +03:00
|
|
|
void Clear();
|
2015-05-26 10:45:26 +03:00
|
|
|
bool IsObservingContent(nsPresContext* aPresContext,
|
|
|
|
nsIContent* aContent) const;
|
2015-06-17 04:03:57 +03:00
|
|
|
bool IsReflowLocked() const;
|
|
|
|
bool IsSafeToNotifyIME() const;
|
2015-10-27 01:21:37 +03:00
|
|
|
bool IsEditorComposing() const;
|
2015-06-17 04:03:57 +03:00
|
|
|
|
2017-06-08 05:24:58 +03:00
|
|
|
/**
|
|
|
|
* nsINode::GetChildAt() is slow. So, this avoids to use it if it's
|
|
|
|
* first child or last child of aParent.
|
|
|
|
*/
|
|
|
|
static nsIContent* GetChildNode(nsINode* aParent, int32_t aOffset);
|
|
|
|
|
2017-06-08 05:21:28 +03:00
|
|
|
// Following methods are called by DocumentObserver when
|
|
|
|
// beginning to update the contents and ending updating the contents.
|
|
|
|
void BeginDocumentUpdate();
|
|
|
|
void EndDocumentUpdate();
|
|
|
|
|
2017-06-08 05:24:58 +03:00
|
|
|
// Following methods manages added nodes during a document change.
|
|
|
|
|
|
|
|
/**
|
|
|
|
* MaybeNotifyIMEOfAddedTextDuringDocumentChange() may send text change
|
2017-09-06 20:47:09 +03:00
|
|
|
* notification caused by the nodes added between mFirstAddedContent in
|
|
|
|
* mFirstAddedContainer and mLastAddedContent in
|
|
|
|
* mLastAddedContainer and forgets the range.
|
2017-06-08 05:24:58 +03:00
|
|
|
*/
|
|
|
|
void MaybeNotifyIMEOfAddedTextDuringDocumentChange();
|
|
|
|
|
|
|
|
/**
|
|
|
|
* IsInDocumentChange() returns true while the DOM tree is being modified
|
|
|
|
* with mozAutoDocUpdate. E.g., it's being modified by setting innerHTML or
|
|
|
|
* insertAdjacentHTML(). This returns false when user types something in
|
|
|
|
* the focused editor editor.
|
|
|
|
*/
|
|
|
|
bool IsInDocumentChange() const
|
|
|
|
{
|
|
|
|
return mDocumentObserver && mDocumentObserver->IsUpdating();
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Forget the range of added nodes during a document change.
|
|
|
|
*/
|
|
|
|
void ClearAddedNodesDuringDocumentChange();
|
|
|
|
|
|
|
|
/**
|
|
|
|
* HasAddedNodesDuringDocumentChange() returns true when this stores range
|
|
|
|
* of nodes which were added into the DOM tree during a document change but
|
|
|
|
* have not been sent to IME. Note that this should always return false when
|
|
|
|
* IsInDocumentChange() returns false.
|
|
|
|
*/
|
|
|
|
bool HasAddedNodesDuringDocumentChange() const
|
|
|
|
{
|
2017-09-06 20:47:09 +03:00
|
|
|
return mFirstAddedContainer && mLastAddedContainer;
|
2017-06-08 05:24:58 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
2017-09-06 20:47:09 +03:00
|
|
|
* Returns true if the passed-in node in aParent is the next node of
|
|
|
|
* mLastAddedContent in pre-order tree traversal of the DOM.
|
2017-06-08 05:24:58 +03:00
|
|
|
*/
|
2017-09-06 20:47:09 +03:00
|
|
|
bool IsNextNodeOfLastAddedNode(nsINode* aParent, nsIContent* aChild) const;
|
2017-06-08 05:24:58 +03:00
|
|
|
|
2015-06-17 04:03:57 +03:00
|
|
|
void PostFocusSetNotification();
|
2015-09-08 06:54:14 +03:00
|
|
|
void MaybeNotifyIMEOfFocusSet();
|
2015-09-16 11:48:23 +03:00
|
|
|
void PostTextChangeNotification();
|
2015-09-08 06:54:14 +03:00
|
|
|
void MaybeNotifyIMEOfTextChange(const TextChangeDataBase& aTextChangeData);
|
2017-04-13 08:32:12 +03:00
|
|
|
void CancelNotifyingIMEOfTextChange();
|
2015-09-14 17:28:43 +03:00
|
|
|
void PostSelectionChangeNotification();
|
2015-07-17 05:25:00 +03:00
|
|
|
void MaybeNotifyIMEOfSelectionChange(bool aCausedByComposition,
|
2015-10-27 01:21:37 +03:00
|
|
|
bool aCausedBySelectionEvent,
|
|
|
|
bool aOccurredDuringComposition);
|
2015-06-17 04:03:57 +03:00
|
|
|
void PostPositionChangeNotification();
|
2015-09-08 06:54:14 +03:00
|
|
|
void MaybeNotifyIMEOfPositionChange();
|
2017-04-13 08:32:12 +03:00
|
|
|
void CancelNotifyingIMEOfPositionChange();
|
Bug 1275906 part.2 TextComposition should use IMEContentObserver for sending NOTIFY_IME_OF_COMPOSITION_EVENT_HANDLED if the editor which has the composition is in the active IMEContentObserver r=smaug
For sending NOTIFY_IME_OF_COMPOSITION_EVENT_HANDLED after the other change notifications which was caused by the user input, we need to use IMEContentObserver::IMENotificationSender because it sends the notifications when it's safe to do it.
This patch makes TextComposition use IMEContentObserver to send the notification. However, if there is no active IMEContentObserver, e.g., composition events are fired on unfocused window, TextComposition sends it by itself (same as current implementation).
If IMEContentObserver stops observing when it has pending NOTIFY_IME_OF_COMPOSITION_EVENT_HANDLED, it cannot send the notification (i.e., it is discarded completely in such case). However, in such case, IMEContentObserver sends NOTIFY_IME_OF_BLUR. So, anyway, native IME handler should treat the blur notification as it including NOTIFY_IME_OF_COMPOSITION_EVENT_HANDLED.
On the other hand, we're buggy if composition events are fired in non-active window. Even in such case, IMEContentObserver should be created for active editor in each document and it notifies IME of the changes. But this is out of the scope of this bug.
MozReview-Commit-ID: 7Q0ZsJTh4hX
--HG--
extra : rebase_source : 6417f991fa8c0fbe3f25b27bacf4257e5485aecc
2016-06-01 16:14:41 +03:00
|
|
|
void PostCompositionEventHandledNotification();
|
2014-07-31 08:38:00 +04:00
|
|
|
|
2017-09-06 20:47:09 +03:00
|
|
|
void NotifyContentAdded(nsINode* aContainer,
|
|
|
|
nsIContent* aFirstContent,
|
|
|
|
nsIContent* aLastContent);
|
2014-03-08 05:20:07 +04:00
|
|
|
void ObserveEditableNode();
|
2014-07-31 08:37:59 +04:00
|
|
|
/**
|
2015-05-26 10:45:26 +03:00
|
|
|
* NotifyIMEOfBlur() notifies IME of blur.
|
2015-05-24 04:11:37 +03:00
|
|
|
*/
|
2015-05-26 10:45:26 +03:00
|
|
|
void NotifyIMEOfBlur();
|
2015-05-26 10:45:26 +03:00
|
|
|
/**
|
|
|
|
* UnregisterObservers() unregisters all listeners and observers.
|
|
|
|
*/
|
|
|
|
void UnregisterObservers();
|
2014-07-31 08:37:59 +04:00
|
|
|
void FlushMergeableNotifications();
|
2017-04-13 08:32:12 +03:00
|
|
|
bool NeedsTextChangeNotification() const
|
|
|
|
{
|
|
|
|
return mIMENotificationRequests &&
|
|
|
|
mIMENotificationRequests->WantTextChange();
|
|
|
|
}
|
|
|
|
bool NeedsPositionChangeNotification() const
|
|
|
|
{
|
|
|
|
return mIMENotificationRequests &&
|
|
|
|
mIMENotificationRequests->WantPositionChanged();
|
|
|
|
}
|
2015-06-17 04:03:57 +03:00
|
|
|
void ClearPendingNotifications()
|
|
|
|
{
|
2015-09-16 11:48:24 +03:00
|
|
|
mNeedsToNotifyIMEOfFocusSet = false;
|
|
|
|
mNeedsToNotifyIMEOfTextChange = false;
|
|
|
|
mNeedsToNotifyIMEOfSelectionChange = false;
|
|
|
|
mNeedsToNotifyIMEOfPositionChange = false;
|
Bug 1275906 part.2 TextComposition should use IMEContentObserver for sending NOTIFY_IME_OF_COMPOSITION_EVENT_HANDLED if the editor which has the composition is in the active IMEContentObserver r=smaug
For sending NOTIFY_IME_OF_COMPOSITION_EVENT_HANDLED after the other change notifications which was caused by the user input, we need to use IMEContentObserver::IMENotificationSender because it sends the notifications when it's safe to do it.
This patch makes TextComposition use IMEContentObserver to send the notification. However, if there is no active IMEContentObserver, e.g., composition events are fired on unfocused window, TextComposition sends it by itself (same as current implementation).
If IMEContentObserver stops observing when it has pending NOTIFY_IME_OF_COMPOSITION_EVENT_HANDLED, it cannot send the notification (i.e., it is discarded completely in such case). However, in such case, IMEContentObserver sends NOTIFY_IME_OF_BLUR. So, anyway, native IME handler should treat the blur notification as it including NOTIFY_IME_OF_COMPOSITION_EVENT_HANDLED.
On the other hand, we're buggy if composition events are fired in non-active window. Even in such case, IMEContentObserver should be created for active editor in each document and it notifies IME of the changes. But this is out of the scope of this bug.
MozReview-Commit-ID: 7Q0ZsJTh4hX
--HG--
extra : rebase_source : 6417f991fa8c0fbe3f25b27bacf4257e5485aecc
2016-06-01 16:14:41 +03:00
|
|
|
mNeedsToNotifyIMEOfCompositionEventHandled = false;
|
2015-07-11 04:53:56 +03:00
|
|
|
mTextChangeData.Clear();
|
2015-06-17 04:03:57 +03:00
|
|
|
}
|
2015-09-16 11:48:24 +03:00
|
|
|
bool NeedsToNotifyIMEOfSomething() const
|
|
|
|
{
|
2015-09-16 11:48:24 +03:00
|
|
|
return mNeedsToNotifyIMEOfFocusSet ||
|
|
|
|
mNeedsToNotifyIMEOfTextChange ||
|
|
|
|
mNeedsToNotifyIMEOfSelectionChange ||
|
Bug 1275906 part.2 TextComposition should use IMEContentObserver for sending NOTIFY_IME_OF_COMPOSITION_EVENT_HANDLED if the editor which has the composition is in the active IMEContentObserver r=smaug
For sending NOTIFY_IME_OF_COMPOSITION_EVENT_HANDLED after the other change notifications which was caused by the user input, we need to use IMEContentObserver::IMENotificationSender because it sends the notifications when it's safe to do it.
This patch makes TextComposition use IMEContentObserver to send the notification. However, if there is no active IMEContentObserver, e.g., composition events are fired on unfocused window, TextComposition sends it by itself (same as current implementation).
If IMEContentObserver stops observing when it has pending NOTIFY_IME_OF_COMPOSITION_EVENT_HANDLED, it cannot send the notification (i.e., it is discarded completely in such case). However, in such case, IMEContentObserver sends NOTIFY_IME_OF_BLUR. So, anyway, native IME handler should treat the blur notification as it including NOTIFY_IME_OF_COMPOSITION_EVENT_HANDLED.
On the other hand, we're buggy if composition events are fired in non-active window. Even in such case, IMEContentObserver should be created for active editor in each document and it notifies IME of the changes. But this is out of the scope of this bug.
MozReview-Commit-ID: 7Q0ZsJTh4hX
--HG--
extra : rebase_source : 6417f991fa8c0fbe3f25b27bacf4257e5485aecc
2016-06-01 16:14:41 +03:00
|
|
|
mNeedsToNotifyIMEOfPositionChange ||
|
|
|
|
mNeedsToNotifyIMEOfCompositionEventHandled;
|
2015-09-16 11:48:24 +03:00
|
|
|
}
|
2014-07-31 08:37:59 +04:00
|
|
|
|
2015-08-21 19:43:41 +03:00
|
|
|
/**
|
|
|
|
* UpdateSelectionCache() updates mSelectionData with the latest selection.
|
|
|
|
* This should be called only when IsSafeToNotifyIME() returns true.
|
|
|
|
*
|
2016-06-28 09:23:12 +03:00
|
|
|
* Note that this does nothing if WasInitializedWithPlugin() returns true.
|
2015-08-21 19:43:41 +03:00
|
|
|
*/
|
|
|
|
bool UpdateSelectionCache();
|
|
|
|
|
2014-03-08 05:20:07 +04:00
|
|
|
nsCOMPtr<nsIWidget> mWidget;
|
2015-09-08 06:54:14 +03:00
|
|
|
// mFocusedWidget has the editor observed by the instance. E.g., if the
|
|
|
|
// focused editor is in XUL panel, this should be the widget of the panel.
|
|
|
|
// On the other hand, mWidget is its parent which handles IME.
|
|
|
|
nsCOMPtr<nsIWidget> mFocusedWidget;
|
2017-10-12 12:11:09 +03:00
|
|
|
RefPtr<dom::Selection> mSelection;
|
2014-03-08 05:20:07 +04:00
|
|
|
nsCOMPtr<nsIContent> mRootContent;
|
|
|
|
nsCOMPtr<nsINode> mEditableNode;
|
|
|
|
nsCOMPtr<nsIDocShell> mDocShell;
|
2017-06-20 13:23:44 +03:00
|
|
|
RefPtr<EditorBase> mEditorBase;
|
2014-04-24 04:36:15 +04:00
|
|
|
|
2015-11-10 05:49:05 +03:00
|
|
|
/**
|
|
|
|
* Helper classes to notify IME.
|
|
|
|
*/
|
|
|
|
|
2016-04-26 03:23:21 +03:00
|
|
|
class AChangeEvent: public Runnable
|
2015-11-10 05:49:05 +03:00
|
|
|
{
|
|
|
|
protected:
|
|
|
|
enum ChangeEventType
|
|
|
|
{
|
|
|
|
eChangeEventType_Focus,
|
|
|
|
eChangeEventType_Selection,
|
|
|
|
eChangeEventType_Text,
|
|
|
|
eChangeEventType_Position,
|
Bug 1275906 part.2 TextComposition should use IMEContentObserver for sending NOTIFY_IME_OF_COMPOSITION_EVENT_HANDLED if the editor which has the composition is in the active IMEContentObserver r=smaug
For sending NOTIFY_IME_OF_COMPOSITION_EVENT_HANDLED after the other change notifications which was caused by the user input, we need to use IMEContentObserver::IMENotificationSender because it sends the notifications when it's safe to do it.
This patch makes TextComposition use IMEContentObserver to send the notification. However, if there is no active IMEContentObserver, e.g., composition events are fired on unfocused window, TextComposition sends it by itself (same as current implementation).
If IMEContentObserver stops observing when it has pending NOTIFY_IME_OF_COMPOSITION_EVENT_HANDLED, it cannot send the notification (i.e., it is discarded completely in such case). However, in such case, IMEContentObserver sends NOTIFY_IME_OF_BLUR. So, anyway, native IME handler should treat the blur notification as it including NOTIFY_IME_OF_COMPOSITION_EVENT_HANDLED.
On the other hand, we're buggy if composition events are fired in non-active window. Even in such case, IMEContentObserver should be created for active editor in each document and it notifies IME of the changes. But this is out of the scope of this bug.
MozReview-Commit-ID: 7Q0ZsJTh4hX
--HG--
extra : rebase_source : 6417f991fa8c0fbe3f25b27bacf4257e5485aecc
2016-06-01 16:14:41 +03:00
|
|
|
eChangeEventType_CompositionEventHandled
|
2015-11-10 05:49:05 +03:00
|
|
|
};
|
|
|
|
|
2017-02-11 09:11:48 +03:00
|
|
|
explicit AChangeEvent(const char* aName,
|
|
|
|
IMEContentObserver* aIMEContentObserver)
|
|
|
|
: Runnable(aName)
|
2017-06-29 14:46:11 +03:00
|
|
|
, mIMEContentObserver(
|
|
|
|
do_GetWeakReference(
|
|
|
|
static_cast<nsISelectionListener*>(aIMEContentObserver)))
|
2015-11-10 05:49:05 +03:00
|
|
|
{
|
2017-06-29 14:46:11 +03:00
|
|
|
MOZ_ASSERT(aIMEContentObserver);
|
2015-11-10 05:49:05 +03:00
|
|
|
}
|
|
|
|
|
2017-06-29 14:46:11 +03:00
|
|
|
already_AddRefed<IMEContentObserver> GetObserver() const
|
|
|
|
{
|
|
|
|
nsCOMPtr<nsISelectionListener> observer =
|
|
|
|
do_QueryReferent(mIMEContentObserver);
|
|
|
|
return observer.forget().downcast<IMEContentObserver>();
|
|
|
|
}
|
|
|
|
|
|
|
|
nsWeakPtr mIMEContentObserver;
|
2015-11-10 05:49:05 +03:00
|
|
|
|
|
|
|
/**
|
|
|
|
* CanNotifyIME() checks if mIMEContentObserver can and should notify IME.
|
|
|
|
*/
|
|
|
|
bool CanNotifyIME(ChangeEventType aChangeEventType) const;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* IsSafeToNotifyIME() checks if it's safe to noitify IME.
|
|
|
|
*/
|
|
|
|
bool IsSafeToNotifyIME(ChangeEventType aChangeEventType) const;
|
|
|
|
};
|
|
|
|
|
|
|
|
class IMENotificationSender: public AChangeEvent
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
explicit IMENotificationSender(IMEContentObserver* aIMEContentObserver)
|
2017-02-11 09:11:48 +03:00
|
|
|
: AChangeEvent("IMENotificationSender", aIMEContentObserver)
|
2015-11-10 05:49:05 +03:00
|
|
|
, mIsRunning(false)
|
2015-11-10 05:49:05 +03:00
|
|
|
{
|
|
|
|
}
|
|
|
|
NS_IMETHOD Run() override;
|
|
|
|
|
2017-06-29 14:46:11 +03:00
|
|
|
void Dispatch(nsIDocShell* aDocShell);
|
2015-11-10 05:49:05 +03:00
|
|
|
private:
|
|
|
|
void SendFocusSet();
|
|
|
|
void SendSelectionChange();
|
|
|
|
void SendTextChange();
|
|
|
|
void SendPositionChange();
|
Bug 1275906 part.2 TextComposition should use IMEContentObserver for sending NOTIFY_IME_OF_COMPOSITION_EVENT_HANDLED if the editor which has the composition is in the active IMEContentObserver r=smaug
For sending NOTIFY_IME_OF_COMPOSITION_EVENT_HANDLED after the other change notifications which was caused by the user input, we need to use IMEContentObserver::IMENotificationSender because it sends the notifications when it's safe to do it.
This patch makes TextComposition use IMEContentObserver to send the notification. However, if there is no active IMEContentObserver, e.g., composition events are fired on unfocused window, TextComposition sends it by itself (same as current implementation).
If IMEContentObserver stops observing when it has pending NOTIFY_IME_OF_COMPOSITION_EVENT_HANDLED, it cannot send the notification (i.e., it is discarded completely in such case). However, in such case, IMEContentObserver sends NOTIFY_IME_OF_BLUR. So, anyway, native IME handler should treat the blur notification as it including NOTIFY_IME_OF_COMPOSITION_EVENT_HANDLED.
On the other hand, we're buggy if composition events are fired in non-active window. Even in such case, IMEContentObserver should be created for active editor in each document and it notifies IME of the changes. But this is out of the scope of this bug.
MozReview-Commit-ID: 7Q0ZsJTh4hX
--HG--
extra : rebase_source : 6417f991fa8c0fbe3f25b27bacf4257e5485aecc
2016-06-01 16:14:41 +03:00
|
|
|
void SendCompositionEventHandled();
|
2015-11-10 05:49:05 +03:00
|
|
|
|
|
|
|
bool mIsRunning;
|
2015-11-10 05:49:05 +03:00
|
|
|
};
|
|
|
|
|
|
|
|
// mQueuedSender is, it was put into the event queue but not run yet.
|
|
|
|
RefPtr<IMENotificationSender> mQueuedSender;
|
|
|
|
|
2017-06-08 05:21:28 +03:00
|
|
|
/**
|
|
|
|
* IMEContentObserver is a mutation observer of mRootContent. However,
|
|
|
|
* it needs to know the beginning of content changes and end of it too for
|
|
|
|
* reducing redundant computation of text offset with ContentEventHandler.
|
|
|
|
* Therefore, it needs helper class to listen only them since if
|
|
|
|
* both mutations were observed by IMEContentObserver directly, each
|
|
|
|
* methods need to check if the changing node is in mRootContent but it's
|
|
|
|
* too expensive.
|
|
|
|
*/
|
|
|
|
class DocumentObserver final : public nsStubDocumentObserver
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
explicit DocumentObserver(IMEContentObserver& aIMEContentObserver)
|
|
|
|
: mIMEContentObserver(&aIMEContentObserver)
|
|
|
|
, mDocumentUpdating(0)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
NS_DECL_CYCLE_COLLECTION_CLASS(DocumentObserver)
|
|
|
|
NS_DECL_CYCLE_COLLECTING_ISUPPORTS
|
|
|
|
NS_DECL_NSIDOCUMENTOBSERVER_BEGINUPDATE
|
|
|
|
NS_DECL_NSIDOCUMENTOBSERVER_ENDUPDATE
|
|
|
|
|
|
|
|
void Observe(nsIDocument* aDocument);
|
|
|
|
void StopObserving();
|
|
|
|
void Destroy();
|
|
|
|
|
|
|
|
bool Destroyed() const { return !mIMEContentObserver; }
|
|
|
|
bool IsObserving() const { return mDocument != nullptr; }
|
|
|
|
bool IsUpdating() const { return mDocumentUpdating != 0; }
|
|
|
|
|
|
|
|
private:
|
|
|
|
DocumentObserver() = delete;
|
|
|
|
virtual ~DocumentObserver() { Destroy(); }
|
|
|
|
|
|
|
|
RefPtr<IMEContentObserver> mIMEContentObserver;
|
|
|
|
nsCOMPtr<nsIDocument> mDocument;
|
|
|
|
uint32_t mDocumentUpdating;
|
|
|
|
};
|
|
|
|
RefPtr<DocumentObserver> mDocumentObserver;
|
|
|
|
|
2014-07-31 08:38:00 +04:00
|
|
|
/**
|
|
|
|
* FlatTextCache stores flat text length from start of the content to
|
|
|
|
* mNodeOffset of mContainerNode.
|
|
|
|
*/
|
|
|
|
struct FlatTextCache
|
|
|
|
{
|
2017-09-06 20:47:09 +03:00
|
|
|
// mContainerNode and mNode represent a point in DOM tree. E.g.,
|
|
|
|
// if mContainerNode is a div element, mNode is a child.
|
2014-07-31 08:38:00 +04:00
|
|
|
nsCOMPtr<nsINode> mContainerNode;
|
2017-09-06 20:47:09 +03:00
|
|
|
// mNode points to the last child which participates in the current
|
|
|
|
// mFlatTextLength. If mNode is null, then that means that the end point for
|
|
|
|
// mFlatTextLength is immediately before the first child of mContainerNode.
|
|
|
|
nsCOMPtr<nsINode> mNode;
|
2014-07-31 08:38:00 +04:00
|
|
|
// Length of flat text generated from contents between the start of content
|
|
|
|
// and a child node whose index is mNodeOffset of mContainerNode.
|
|
|
|
uint32_t mFlatTextLength;
|
|
|
|
|
|
|
|
FlatTextCache()
|
2017-09-06 20:47:09 +03:00
|
|
|
: mFlatTextLength(0)
|
2014-07-31 08:38:00 +04:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
void Clear()
|
|
|
|
{
|
|
|
|
mContainerNode = nullptr;
|
2017-09-06 20:47:09 +03:00
|
|
|
mNode = nullptr;
|
2014-07-31 08:38:00 +04:00
|
|
|
mFlatTextLength = 0;
|
|
|
|
}
|
|
|
|
|
2017-09-06 20:47:09 +03:00
|
|
|
void Cache(nsINode* aContainer, nsINode* aNode,
|
2014-07-31 08:38:00 +04:00
|
|
|
uint32_t aFlatTextLength)
|
|
|
|
{
|
|
|
|
MOZ_ASSERT(aContainer, "aContainer must not be null");
|
2017-09-06 20:47:09 +03:00
|
|
|
MOZ_ASSERT(!aNode || aNode->GetParentNode() == aContainer,
|
|
|
|
"aNode must be either null or a child of aContainer");
|
2014-07-31 08:38:00 +04:00
|
|
|
mContainerNode = aContainer;
|
2017-09-06 20:47:09 +03:00
|
|
|
mNode = aNode;
|
2014-07-31 08:38:00 +04:00
|
|
|
mFlatTextLength = aFlatTextLength;
|
|
|
|
}
|
|
|
|
|
2017-09-06 20:47:09 +03:00
|
|
|
bool Match(nsINode* aContainer, nsINode* aNode) const
|
2014-07-31 08:38:00 +04:00
|
|
|
{
|
2017-09-06 20:47:09 +03:00
|
|
|
return aContainer == mContainerNode && aNode == mNode;
|
2014-07-31 08:38:00 +04:00
|
|
|
}
|
|
|
|
};
|
|
|
|
// mEndOfAddedTextCache caches text length from the start of content to
|
|
|
|
// the end of the last added content only while an edit action is being
|
|
|
|
// handled by the editor and no other mutation (e.g., removing node)
|
|
|
|
// occur.
|
|
|
|
FlatTextCache mEndOfAddedTextCache;
|
2014-07-31 08:38:00 +04:00
|
|
|
// mStartOfRemovingTextRangeCache caches text length from the start of content
|
|
|
|
// to the start of the last removed content only while an edit action is being
|
|
|
|
// handled by the editor and no other mutation (e.g., adding node) occur.
|
|
|
|
FlatTextCache mStartOfRemovingTextRangeCache;
|
2014-07-31 08:38:00 +04:00
|
|
|
|
2017-09-06 20:47:09 +03:00
|
|
|
// mFirstAddedContainer is parent node of first added node in current
|
2017-06-08 05:24:58 +03:00
|
|
|
// document change. So, this is not nullptr only when a node was added
|
|
|
|
// during a document change and the change has not been included into
|
|
|
|
// mTextChangeData yet.
|
|
|
|
// Note that this shouldn't be in cycle collection since this is not nullptr
|
|
|
|
// only during a document change.
|
2017-09-06 20:47:09 +03:00
|
|
|
nsCOMPtr<nsINode> mFirstAddedContainer;
|
|
|
|
// mLastAddedContainer is parent node of last added node in current
|
2017-06-08 05:24:58 +03:00
|
|
|
// document change. So, this is not nullptr only when a node was added
|
|
|
|
// during a document change and the change has not been included into
|
|
|
|
// mTextChangeData yet.
|
|
|
|
// Note that this shouldn't be in cycle collection since this is not nullptr
|
|
|
|
// only during a document change.
|
2017-09-06 20:47:09 +03:00
|
|
|
nsCOMPtr<nsINode> mLastAddedContainer;
|
|
|
|
|
|
|
|
// mFirstAddedContent is the first node added in mFirstAddedContainer.
|
|
|
|
nsCOMPtr<nsIContent> mFirstAddedContent;
|
|
|
|
// mLastAddedContent is the last node added in mLastAddedContainer;
|
|
|
|
nsCOMPtr<nsIContent> mLastAddedContent;
|
2017-06-08 05:24:58 +03:00
|
|
|
|
2014-07-31 08:37:59 +04:00
|
|
|
TextChangeData mTextChangeData;
|
|
|
|
|
2015-09-14 17:28:43 +03:00
|
|
|
// mSelectionData is the last selection data which was notified. The
|
|
|
|
// selection information is modified by UpdateSelectionCache(). The reason
|
|
|
|
// of the selection change is modified by MaybeNotifyIMEOfSelectionChange().
|
2015-08-21 19:43:41 +03:00
|
|
|
SelectionChangeData mSelectionData;
|
|
|
|
|
2014-04-24 04:36:15 +04:00
|
|
|
EventStateManager* mESM;
|
|
|
|
|
2017-04-13 08:32:12 +03:00
|
|
|
const IMENotificationRequests* mIMENotificationRequests;
|
2014-03-08 05:20:07 +04:00
|
|
|
uint32_t mPreAttrChangeLength;
|
2015-06-04 20:06:10 +03:00
|
|
|
uint32_t mSuppressNotifications;
|
2014-07-31 08:38:01 +04:00
|
|
|
int64_t mPreCharacterDataChangeLength;
|
2014-07-31 08:37:59 +04:00
|
|
|
|
2015-09-16 11:48:24 +03:00
|
|
|
// mSendingNotification is a notification which is now sending from
|
|
|
|
// IMENotificationSender. When the value is NOTIFY_IME_OF_NOTHING, it's
|
|
|
|
// not sending any notification.
|
|
|
|
IMEMessage mSendingNotification;
|
|
|
|
|
2015-05-26 10:45:26 +03:00
|
|
|
bool mIsObserving;
|
2015-06-17 04:03:57 +03:00
|
|
|
bool mIMEHasFocus;
|
2015-09-16 11:48:24 +03:00
|
|
|
bool mNeedsToNotifyIMEOfFocusSet;
|
|
|
|
bool mNeedsToNotifyIMEOfTextChange;
|
|
|
|
bool mNeedsToNotifyIMEOfSelectionChange;
|
|
|
|
bool mNeedsToNotifyIMEOfPositionChange;
|
Bug 1275906 part.2 TextComposition should use IMEContentObserver for sending NOTIFY_IME_OF_COMPOSITION_EVENT_HANDLED if the editor which has the composition is in the active IMEContentObserver r=smaug
For sending NOTIFY_IME_OF_COMPOSITION_EVENT_HANDLED after the other change notifications which was caused by the user input, we need to use IMEContentObserver::IMENotificationSender because it sends the notifications when it's safe to do it.
This patch makes TextComposition use IMEContentObserver to send the notification. However, if there is no active IMEContentObserver, e.g., composition events are fired on unfocused window, TextComposition sends it by itself (same as current implementation).
If IMEContentObserver stops observing when it has pending NOTIFY_IME_OF_COMPOSITION_EVENT_HANDLED, it cannot send the notification (i.e., it is discarded completely in such case). However, in such case, IMEContentObserver sends NOTIFY_IME_OF_BLUR. So, anyway, native IME handler should treat the blur notification as it including NOTIFY_IME_OF_COMPOSITION_EVENT_HANDLED.
On the other hand, we're buggy if composition events are fired in non-active window. Even in such case, IMEContentObserver should be created for active editor in each document and it notifies IME of the changes. But this is out of the scope of this bug.
MozReview-Commit-ID: 7Q0ZsJTh4hX
--HG--
extra : rebase_source : 6417f991fa8c0fbe3f25b27bacf4257e5485aecc
2016-06-01 16:14:41 +03:00
|
|
|
bool mNeedsToNotifyIMEOfCompositionEventHandled;
|
2015-09-16 11:48:24 +03:00
|
|
|
// mIsHandlingQueryContentEvent is true when IMEContentObserver is handling
|
|
|
|
// WidgetQueryContentEvent with ContentEventHandler.
|
|
|
|
bool mIsHandlingQueryContentEvent;
|
2014-03-08 05:20:07 +04:00
|
|
|
};
|
|
|
|
|
|
|
|
} // namespace mozilla
|
|
|
|
|
2014-03-08 05:20:07 +04:00
|
|
|
#endif // mozilla_IMEContentObserver_h_
|