2013-09-24 14:04:15 +04:00
|
|
|
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
|
|
|
/* 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_TextEvents_h__
|
|
|
|
#define mozilla_TextEvents_h__
|
|
|
|
|
|
|
|
#include <stdint.h>
|
|
|
|
|
|
|
|
#include "mozilla/Assertions.h"
|
|
|
|
#include "mozilla/BasicEvents.h"
|
2015-06-05 12:28:21 +03:00
|
|
|
#include "mozilla/CheckedInt.h"
|
2013-09-24 14:04:15 +04:00
|
|
|
#include "mozilla/EventForwards.h" // for KeyNameIndex, temporarily
|
2013-10-22 17:27:36 +04:00
|
|
|
#include "mozilla/TextRange.h"
|
2015-01-31 10:17:12 +03:00
|
|
|
#include "mozilla/FontRange.h"
|
2013-09-24 14:04:15 +04:00
|
|
|
#include "nsCOMPtr.h"
|
|
|
|
#include "nsIDOMKeyEvent.h"
|
2015-12-01 23:25:06 +03:00
|
|
|
#include "nsISelectionListener.h"
|
2013-09-24 14:04:15 +04:00
|
|
|
#include "nsITransferable.h"
|
|
|
|
#include "nsRect.h"
|
|
|
|
#include "nsStringGlue.h"
|
|
|
|
#include "nsTArray.h"
|
2014-11-22 17:39:03 +03:00
|
|
|
#include "WritingModes.h"
|
2013-09-24 14:04:15 +04:00
|
|
|
|
2015-02-19 09:50:19 +03:00
|
|
|
class nsStringHashKey;
|
|
|
|
template<class, class> class nsDataHashtable;
|
|
|
|
|
2013-09-24 14:04:15 +04:00
|
|
|
/******************************************************************************
|
|
|
|
* virtual keycode values
|
|
|
|
******************************************************************************/
|
|
|
|
|
|
|
|
#define NS_DEFINE_VK(aDOMKeyName, aDOMKeyCode) NS_##aDOMKeyName = aDOMKeyCode
|
|
|
|
|
|
|
|
enum
|
|
|
|
{
|
2014-04-01 15:42:16 +04:00
|
|
|
#include "mozilla/VirtualKeyCodeList.h"
|
2013-09-24 14:04:15 +04:00
|
|
|
};
|
|
|
|
|
|
|
|
#undef NS_DEFINE_VK
|
|
|
|
|
|
|
|
namespace mozilla {
|
|
|
|
|
|
|
|
namespace dom {
|
|
|
|
class PBrowserParent;
|
|
|
|
class PBrowserChild;
|
|
|
|
} // namespace dom
|
|
|
|
namespace plugins {
|
|
|
|
class PPluginInstanceChild;
|
|
|
|
} // namespace plugins
|
|
|
|
|
|
|
|
/******************************************************************************
|
|
|
|
* mozilla::AlternativeCharCode
|
|
|
|
*
|
|
|
|
* This stores alternative charCode values of a key event with some modifiers.
|
|
|
|
* The stored values proper for testing shortcut key or access key.
|
|
|
|
******************************************************************************/
|
|
|
|
|
|
|
|
struct AlternativeCharCode
|
|
|
|
{
|
2014-07-23 15:05:45 +04:00
|
|
|
AlternativeCharCode() :
|
|
|
|
mUnshiftedCharCode(0), mShiftedCharCode(0)
|
|
|
|
{
|
|
|
|
}
|
2013-09-24 14:04:15 +04:00
|
|
|
AlternativeCharCode(uint32_t aUnshiftedCharCode, uint32_t aShiftedCharCode) :
|
|
|
|
mUnshiftedCharCode(aUnshiftedCharCode), mShiftedCharCode(aShiftedCharCode)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
uint32_t mUnshiftedCharCode;
|
|
|
|
uint32_t mShiftedCharCode;
|
|
|
|
};
|
|
|
|
|
|
|
|
/******************************************************************************
|
|
|
|
* mozilla::WidgetKeyboardEvent
|
|
|
|
******************************************************************************/
|
|
|
|
|
|
|
|
class WidgetKeyboardEvent : public WidgetInputEvent
|
|
|
|
{
|
|
|
|
private:
|
|
|
|
friend class dom::PBrowserParent;
|
|
|
|
friend class dom::PBrowserChild;
|
|
|
|
|
2014-11-03 10:05:12 +03:00
|
|
|
protected:
|
2013-09-24 14:04:15 +04:00
|
|
|
WidgetKeyboardEvent()
|
2016-01-12 21:16:59 +03:00
|
|
|
: keyCode(0)
|
|
|
|
, charCode(0)
|
|
|
|
, location(nsIDOMKeyEvent::DOM_KEY_LOCATION_STANDARD)
|
|
|
|
, isChar(false)
|
|
|
|
, mIsRepeat(false)
|
|
|
|
, mIsComposing(false)
|
|
|
|
, mKeyNameIndex(mozilla::KEY_NAME_INDEX_Unidentified)
|
|
|
|
, mCodeNameIndex(CODE_NAME_INDEX_UNKNOWN)
|
|
|
|
, mNativeKeyEvent(nullptr)
|
|
|
|
, mUniqueId(0)
|
|
|
|
#ifdef XP_MACOSX
|
|
|
|
, mNativeKeyCode(0)
|
|
|
|
, mNativeModifierFlags(0)
|
|
|
|
#endif
|
2013-09-24 14:04:15 +04:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2013-10-18 10:10:20 +04:00
|
|
|
public:
|
2015-03-21 19:28:04 +03:00
|
|
|
virtual WidgetKeyboardEvent* AsKeyboardEvent() override { return this; }
|
2013-10-18 10:10:20 +04:00
|
|
|
|
2015-08-26 15:56:59 +03:00
|
|
|
WidgetKeyboardEvent(bool aIsTrusted, EventMessage aMessage,
|
|
|
|
nsIWidget* aWidget,
|
2014-11-03 10:05:12 +03:00
|
|
|
EventClassID aEventClassID = eKeyboardEventClass)
|
|
|
|
: WidgetInputEvent(aIsTrusted, aMessage, aWidget, aEventClassID)
|
2014-04-10 11:11:36 +04:00
|
|
|
, keyCode(0)
|
|
|
|
, charCode(0)
|
|
|
|
, location(nsIDOMKeyEvent::DOM_KEY_LOCATION_STANDARD)
|
|
|
|
, isChar(false)
|
|
|
|
, mIsRepeat(false)
|
|
|
|
, mIsComposing(false)
|
|
|
|
, mKeyNameIndex(mozilla::KEY_NAME_INDEX_Unidentified)
|
2014-05-25 06:08:58 +04:00
|
|
|
, mCodeNameIndex(CODE_NAME_INDEX_UNKNOWN)
|
2014-04-10 11:11:36 +04:00
|
|
|
, mNativeKeyEvent(nullptr)
|
|
|
|
, mUniqueId(0)
|
2014-12-11 17:44:07 +03:00
|
|
|
#ifdef XP_MACOSX
|
|
|
|
, mNativeKeyCode(0)
|
|
|
|
, mNativeModifierFlags(0)
|
|
|
|
#endif
|
2013-09-24 14:04:15 +04:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2015-03-21 19:28:04 +03:00
|
|
|
virtual WidgetEvent* Duplicate() const override
|
2014-01-27 10:10:44 +04:00
|
|
|
{
|
2014-08-04 09:28:48 +04:00
|
|
|
MOZ_ASSERT(mClass == eKeyboardEventClass,
|
2014-01-27 10:10:44 +04:00
|
|
|
"Duplicate() must be overridden by sub class");
|
|
|
|
// Not copying widget, it is a weak reference.
|
|
|
|
WidgetKeyboardEvent* result =
|
2015-08-22 04:34:51 +03:00
|
|
|
new WidgetKeyboardEvent(false, mMessage, nullptr);
|
2014-01-27 10:10:44 +04:00
|
|
|
result->AssignKeyEventData(*this, true);
|
|
|
|
result->mFlags = mFlags;
|
|
|
|
return result;
|
|
|
|
}
|
|
|
|
|
2013-09-24 14:04:15 +04:00
|
|
|
// A DOM keyCode value or 0. If a keypress event whose charCode is 0, this
|
|
|
|
// should be 0.
|
|
|
|
uint32_t keyCode;
|
|
|
|
// If the instance is a keypress event of a printable key, this is a UTF-16
|
|
|
|
// value of the key. Otherwise, 0. This value must not be a control
|
|
|
|
// character when some modifiers are active. Then, this value should be an
|
|
|
|
// unmodified value except Shift and AltGr.
|
|
|
|
uint32_t charCode;
|
|
|
|
// One of nsIDOMKeyEvent::DOM_KEY_LOCATION_*
|
|
|
|
uint32_t location;
|
|
|
|
// OS translated Unicode chars which are used for accesskey and accelkey
|
|
|
|
// handling. The handlers will try from first character to last character.
|
|
|
|
nsTArray<AlternativeCharCode> alternativeCharCodes;
|
|
|
|
// Indicates whether the event signifies a printable character
|
|
|
|
bool isChar;
|
2013-11-07 15:17:32 +04:00
|
|
|
// Indicates whether the event is generated by auto repeat or not.
|
|
|
|
// if this is keyup event, always false.
|
|
|
|
bool mIsRepeat;
|
2014-04-10 11:11:36 +04:00
|
|
|
// Indicates whether the event is generated during IME (or deadkey)
|
|
|
|
// composition. This is initialized by EventStateManager. So, key event
|
|
|
|
// dispatchers don't need to initialize this.
|
|
|
|
bool mIsComposing;
|
2013-09-24 14:04:15 +04:00
|
|
|
// DOM KeyboardEvent.key
|
|
|
|
KeyNameIndex mKeyNameIndex;
|
2014-05-25 06:08:58 +04:00
|
|
|
// DOM KeyboardEvent.code
|
|
|
|
CodeNameIndex mCodeNameIndex;
|
2013-12-10 20:14:53 +04:00
|
|
|
// DOM KeyboardEvent.key only when mKeyNameIndex is KEY_NAME_INDEX_USE_STRING.
|
|
|
|
nsString mKeyValue;
|
2014-05-25 06:08:58 +04:00
|
|
|
// DOM KeyboardEvent.code only when mCodeNameIndex is
|
|
|
|
// CODE_NAME_INDEX_USE_STRING.
|
|
|
|
nsString mCodeValue;
|
2013-09-24 14:04:15 +04:00
|
|
|
// OS-specific native event can optionally be preserved
|
|
|
|
void* mNativeKeyEvent;
|
|
|
|
// Unique id associated with a keydown / keypress event. Used in identifing
|
|
|
|
// keypress events for removal from async event dispatch queue in metrofx
|
|
|
|
// after preventDefault is called on keydown events. It's ok if this wraps
|
|
|
|
// over long periods.
|
|
|
|
uint32_t mUniqueId;
|
|
|
|
|
2014-12-11 17:44:07 +03:00
|
|
|
#ifdef XP_MACOSX
|
|
|
|
// Values given by a native NSEvent, for use with Cocoa NPAPI plugins.
|
|
|
|
uint16_t mNativeKeyCode;
|
|
|
|
uint32_t mNativeModifierFlags;
|
|
|
|
nsString mNativeCharacters;
|
|
|
|
nsString mNativeCharactersIgnoringModifiers;
|
2015-02-20 19:37:02 +03:00
|
|
|
// If this is non-empty, create a text event for plugins instead of a
|
|
|
|
// keyboard event.
|
|
|
|
nsString mPluginTextEventString;
|
2014-12-11 17:44:07 +03:00
|
|
|
#endif
|
|
|
|
|
2015-02-19 09:50:18 +03:00
|
|
|
// If the key should cause keypress events, this returns true.
|
|
|
|
// Otherwise, false.
|
|
|
|
bool ShouldCauseKeypressEvents() const;
|
|
|
|
|
2013-09-24 14:04:15 +04:00
|
|
|
void GetDOMKeyName(nsAString& aKeyName)
|
|
|
|
{
|
2013-12-10 20:14:53 +04:00
|
|
|
if (mKeyNameIndex == KEY_NAME_INDEX_USE_STRING) {
|
|
|
|
aKeyName = mKeyValue;
|
|
|
|
return;
|
|
|
|
}
|
2013-09-24 14:04:15 +04:00
|
|
|
GetDOMKeyName(mKeyNameIndex, aKeyName);
|
|
|
|
}
|
2014-05-25 06:08:58 +04:00
|
|
|
void GetDOMCodeName(nsAString& aCodeName)
|
|
|
|
{
|
|
|
|
if (mCodeNameIndex == CODE_NAME_INDEX_USE_STRING) {
|
|
|
|
aCodeName = mCodeValue;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
GetDOMCodeName(mCodeNameIndex, aCodeName);
|
|
|
|
}
|
2013-09-24 14:04:15 +04:00
|
|
|
|
2015-02-19 09:50:20 +03:00
|
|
|
bool IsModifierKeyEvent() const
|
|
|
|
{
|
|
|
|
return GetModifierForKeyName(mKeyNameIndex) != MODIFIER_NONE;
|
|
|
|
}
|
|
|
|
|
2015-02-19 09:50:19 +03:00
|
|
|
static void Shutdown();
|
|
|
|
|
2015-02-19 09:50:19 +03:00
|
|
|
/**
|
|
|
|
* ComputeLocationFromCodeValue() returns one of .location value
|
|
|
|
* (nsIDOMKeyEvent::DOM_KEY_LOCATION_*) which is the most preferred value
|
|
|
|
* for the specified specified code value.
|
|
|
|
*/
|
2015-01-28 16:36:53 +03:00
|
|
|
static uint32_t ComputeLocationFromCodeValue(CodeNameIndex aCodeNameIndex);
|
|
|
|
|
2015-02-19 09:50:19 +03:00
|
|
|
/**
|
|
|
|
* ComputeKeyCodeFromKeyNameIndex() return a .keyCode value which can be
|
|
|
|
* mapped from the specified key value. Note that this returns 0 if the
|
|
|
|
* key name index is KEY_NAME_INDEX_Unidentified or KEY_NAME_INDEX_USE_STRING.
|
|
|
|
* This means that this method is useful only for non-printable keys.
|
|
|
|
*/
|
|
|
|
static uint32_t ComputeKeyCodeFromKeyNameIndex(KeyNameIndex aKeyNameIndex);
|
|
|
|
|
2015-02-19 09:50:19 +03:00
|
|
|
/**
|
|
|
|
* GetModifierForKeyName() returns a value of Modifier which is activated
|
|
|
|
* by the aKeyNameIndex.
|
|
|
|
*/
|
|
|
|
static Modifier GetModifierForKeyName(KeyNameIndex aKeyNameIndex);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* IsLockableModifier() returns true if aKeyNameIndex is a lockable modifier
|
|
|
|
* key such as CapsLock and NumLock.
|
|
|
|
*/
|
|
|
|
static bool IsLockableModifier(KeyNameIndex aKeyNameIndex);
|
|
|
|
|
2014-05-25 06:08:58 +04:00
|
|
|
static void GetDOMKeyName(KeyNameIndex aKeyNameIndex,
|
2014-01-08 20:45:30 +04:00
|
|
|
nsAString& aKeyName);
|
2014-05-25 06:08:58 +04:00
|
|
|
static void GetDOMCodeName(CodeNameIndex aCodeNameIndex,
|
|
|
|
nsAString& aCodeName);
|
2013-09-24 14:04:15 +04:00
|
|
|
|
2015-02-19 09:50:19 +03:00
|
|
|
static KeyNameIndex GetKeyNameIndex(const nsAString& aKeyValue);
|
|
|
|
static CodeNameIndex GetCodeNameIndex(const nsAString& aCodeValue);
|
|
|
|
|
2014-03-14 17:13:30 +04:00
|
|
|
static const char* GetCommandStr(Command aCommand);
|
|
|
|
|
2013-09-24 14:04:15 +04:00
|
|
|
void AssignKeyEventData(const WidgetKeyboardEvent& aEvent, bool aCopyTargets)
|
|
|
|
{
|
|
|
|
AssignInputEventData(aEvent, aCopyTargets);
|
|
|
|
|
|
|
|
keyCode = aEvent.keyCode;
|
|
|
|
charCode = aEvent.charCode;
|
|
|
|
location = aEvent.location;
|
|
|
|
alternativeCharCodes = aEvent.alternativeCharCodes;
|
|
|
|
isChar = aEvent.isChar;
|
2013-11-07 15:17:32 +04:00
|
|
|
mIsRepeat = aEvent.mIsRepeat;
|
2014-04-10 11:11:36 +04:00
|
|
|
mIsComposing = aEvent.mIsComposing;
|
2013-09-24 14:04:15 +04:00
|
|
|
mKeyNameIndex = aEvent.mKeyNameIndex;
|
2014-05-25 06:08:58 +04:00
|
|
|
mCodeNameIndex = aEvent.mCodeNameIndex;
|
2013-12-10 20:14:53 +04:00
|
|
|
mKeyValue = aEvent.mKeyValue;
|
2014-05-25 06:08:58 +04:00
|
|
|
mCodeValue = aEvent.mCodeValue;
|
2013-09-24 14:04:15 +04:00
|
|
|
// Don't copy mNativeKeyEvent because it may be referred after its instance
|
|
|
|
// is destroyed.
|
|
|
|
mNativeKeyEvent = nullptr;
|
|
|
|
mUniqueId = aEvent.mUniqueId;
|
2015-02-20 19:37:02 +03:00
|
|
|
#ifdef XP_MACOSX
|
|
|
|
mNativeKeyCode = aEvent.mNativeKeyCode;
|
|
|
|
mNativeModifierFlags = aEvent.mNativeModifierFlags;
|
|
|
|
mNativeCharacters.Assign(aEvent.mNativeCharacters);
|
|
|
|
mNativeCharactersIgnoringModifiers.
|
|
|
|
Assign(aEvent.mNativeCharactersIgnoringModifiers);
|
|
|
|
mPluginTextEventString.Assign(aEvent.mPluginTextEventString);
|
|
|
|
#endif
|
2013-09-24 14:04:15 +04:00
|
|
|
}
|
2015-02-19 09:50:19 +03:00
|
|
|
|
|
|
|
private:
|
|
|
|
static const char16_t* kKeyNames[];
|
|
|
|
static const char16_t* kCodeNames[];
|
|
|
|
typedef nsDataHashtable<nsStringHashKey,
|
|
|
|
KeyNameIndex> KeyNameIndexHashtable;
|
|
|
|
typedef nsDataHashtable<nsStringHashKey,
|
|
|
|
CodeNameIndex> CodeNameIndexHashtable;
|
|
|
|
static KeyNameIndexHashtable* sKeyNameIndexHashtable;
|
|
|
|
static CodeNameIndexHashtable* sCodeNameIndexHashtable;
|
2013-09-24 14:04:15 +04:00
|
|
|
};
|
|
|
|
|
2014-11-03 10:05:12 +03:00
|
|
|
|
|
|
|
/******************************************************************************
|
|
|
|
* mozilla::InternalBeforeAfterKeyboardEvent
|
|
|
|
*
|
|
|
|
* This is extended from WidgetKeyboardEvent and is mapped to DOM event
|
|
|
|
* "BeforeAfterKeyboardEvent".
|
|
|
|
*
|
2015-08-29 02:58:27 +03:00
|
|
|
* Event mMessage: eBeforeKeyDown
|
2015-08-29 02:58:28 +03:00
|
|
|
* eBeforeKeyUp
|
2015-08-29 02:58:28 +03:00
|
|
|
* eAfterKeyDown
|
2015-08-29 02:58:28 +03:00
|
|
|
* eAfterKeyUp
|
2014-11-03 10:05:12 +03:00
|
|
|
******************************************************************************/
|
|
|
|
class InternalBeforeAfterKeyboardEvent : public WidgetKeyboardEvent
|
|
|
|
{
|
|
|
|
private:
|
|
|
|
friend class dom::PBrowserParent;
|
|
|
|
friend class dom::PBrowserChild;
|
|
|
|
|
|
|
|
InternalBeforeAfterKeyboardEvent()
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
public:
|
|
|
|
// Extra member for InternalBeforeAfterKeyboardEvent. Indicates whether
|
|
|
|
// default actions of keydown/keyup event is prevented.
|
|
|
|
Nullable<bool> mEmbeddedCancelled;
|
|
|
|
|
2015-03-21 19:28:04 +03:00
|
|
|
virtual InternalBeforeAfterKeyboardEvent* AsBeforeAfterKeyboardEvent() override
|
2014-11-03 10:05:12 +03:00
|
|
|
{
|
|
|
|
return this;
|
|
|
|
}
|
|
|
|
|
2015-08-26 15:56:59 +03:00
|
|
|
InternalBeforeAfterKeyboardEvent(bool aIsTrusted, EventMessage aMessage,
|
2014-11-03 10:05:12 +03:00
|
|
|
nsIWidget* aWidget)
|
2015-08-26 15:56:59 +03:00
|
|
|
: WidgetKeyboardEvent(aIsTrusted, aMessage, aWidget,
|
|
|
|
eBeforeAfterKeyboardEventClass)
|
2014-11-03 10:05:12 +03:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2015-03-21 19:28:04 +03:00
|
|
|
virtual WidgetEvent* Duplicate() const override
|
2014-11-03 10:05:12 +03:00
|
|
|
{
|
|
|
|
MOZ_ASSERT(mClass == eBeforeAfterKeyboardEventClass,
|
|
|
|
"Duplicate() must be overridden by sub class");
|
|
|
|
// Not copying widget, it is a weak reference.
|
|
|
|
InternalBeforeAfterKeyboardEvent* result =
|
2015-08-22 04:34:51 +03:00
|
|
|
new InternalBeforeAfterKeyboardEvent(false, mMessage, nullptr);
|
2014-11-03 10:05:12 +03:00
|
|
|
result->AssignBeforeAfterKeyEventData(*this, true);
|
|
|
|
result->mFlags = mFlags;
|
|
|
|
return result;
|
|
|
|
}
|
|
|
|
|
|
|
|
void AssignBeforeAfterKeyEventData(
|
|
|
|
const InternalBeforeAfterKeyboardEvent& aEvent,
|
|
|
|
bool aCopyTargets)
|
|
|
|
{
|
|
|
|
AssignKeyEventData(aEvent, aCopyTargets);
|
|
|
|
mEmbeddedCancelled = aEvent.mEmbeddedCancelled;
|
|
|
|
}
|
|
|
|
|
|
|
|
void AssignBeforeAfterKeyEventData(
|
|
|
|
const WidgetKeyboardEvent& aEvent,
|
|
|
|
bool aCopyTargets)
|
|
|
|
{
|
|
|
|
AssignKeyEventData(aEvent, aCopyTargets);
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
2013-09-24 14:04:15 +04:00
|
|
|
/******************************************************************************
|
|
|
|
* mozilla::WidgetCompositionEvent
|
|
|
|
******************************************************************************/
|
|
|
|
|
|
|
|
class WidgetCompositionEvent : public WidgetGUIEvent
|
|
|
|
{
|
|
|
|
private:
|
|
|
|
friend class mozilla::dom::PBrowserParent;
|
|
|
|
friend class mozilla::dom::PBrowserChild;
|
|
|
|
|
|
|
|
WidgetCompositionEvent()
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
public:
|
2015-03-21 19:28:04 +03:00
|
|
|
virtual WidgetCompositionEvent* AsCompositionEvent() override
|
2013-10-18 10:10:20 +04:00
|
|
|
{
|
|
|
|
return this;
|
|
|
|
}
|
|
|
|
|
2015-08-26 15:56:59 +03:00
|
|
|
WidgetCompositionEvent(bool aIsTrusted, EventMessage aMessage,
|
2014-01-15 18:41:39 +04:00
|
|
|
nsIWidget* aWidget)
|
2014-08-04 09:28:48 +04:00
|
|
|
: WidgetGUIEvent(aIsTrusted, aMessage, aWidget, eCompositionEventClass)
|
2015-12-11 09:15:57 +03:00
|
|
|
, mNativeIMEContext(aWidget)
|
2015-09-08 06:54:14 +03:00
|
|
|
, mOriginalMessage(eVoidEvent)
|
2013-09-24 14:04:15 +04:00
|
|
|
{
|
|
|
|
// XXX compositionstart is cancelable in draft of DOM3 Events.
|
|
|
|
// However, it doesn't make sense for us, we cannot cancel composition
|
|
|
|
// when we send compositionstart event.
|
|
|
|
mFlags.mCancelable = false;
|
|
|
|
}
|
|
|
|
|
2015-03-21 19:28:04 +03:00
|
|
|
virtual WidgetEvent* Duplicate() const override
|
2014-01-27 10:10:44 +04:00
|
|
|
{
|
2014-08-04 09:28:48 +04:00
|
|
|
MOZ_ASSERT(mClass == eCompositionEventClass,
|
2014-01-27 10:10:44 +04:00
|
|
|
"Duplicate() must be overridden by sub class");
|
|
|
|
// Not copying widget, it is a weak reference.
|
|
|
|
WidgetCompositionEvent* result =
|
2015-08-22 04:34:51 +03:00
|
|
|
new WidgetCompositionEvent(false, mMessage, nullptr);
|
2014-01-27 10:10:44 +04:00
|
|
|
result->AssignCompositionEventData(*this, true);
|
|
|
|
result->mFlags = mFlags;
|
|
|
|
return result;
|
|
|
|
}
|
|
|
|
|
2013-09-24 14:04:15 +04:00
|
|
|
// The composition string or the commit string. If the instance is a
|
|
|
|
// compositionstart event, this is initialized with selected text by
|
|
|
|
// TextComposition automatically.
|
2014-10-07 14:01:46 +04:00
|
|
|
nsString mData;
|
2013-09-24 14:04:15 +04:00
|
|
|
|
2015-10-18 08:24:48 +03:00
|
|
|
RefPtr<TextRangeArray> mRanges;
|
2014-10-07 14:01:47 +04:00
|
|
|
|
2015-12-11 09:15:57 +03:00
|
|
|
// mNativeIMEContext stores the native IME context which causes the
|
|
|
|
// composition event.
|
|
|
|
widget::NativeIMEContext mNativeIMEContext;
|
|
|
|
|
2015-09-08 06:54:14 +03:00
|
|
|
// If the instance is a clone of another event, mOriginalMessage stores
|
|
|
|
// the another event's mMessage.
|
|
|
|
EventMessage mOriginalMessage;
|
|
|
|
|
2013-09-24 14:04:15 +04:00
|
|
|
void AssignCompositionEventData(const WidgetCompositionEvent& aEvent,
|
|
|
|
bool aCopyTargets)
|
|
|
|
{
|
|
|
|
AssignGUIEventData(aEvent, aCopyTargets);
|
|
|
|
|
2014-10-07 14:01:46 +04:00
|
|
|
mData = aEvent.mData;
|
2015-09-08 06:54:14 +03:00
|
|
|
mOriginalMessage = aEvent.mOriginalMessage;
|
2014-10-07 14:01:47 +04:00
|
|
|
|
|
|
|
// Currently, we don't need to copy the other members because they are
|
|
|
|
// for internal use only (not available from JS).
|
|
|
|
}
|
|
|
|
|
|
|
|
bool IsComposing() const
|
|
|
|
{
|
|
|
|
return mRanges && mRanges->IsComposing();
|
|
|
|
}
|
|
|
|
|
|
|
|
uint32_t TargetClauseOffset() const
|
|
|
|
{
|
|
|
|
return mRanges ? mRanges->TargetClauseOffset() : 0;
|
|
|
|
}
|
|
|
|
|
2015-06-11 13:50:15 +03:00
|
|
|
uint32_t TargetClauseLength() const
|
|
|
|
{
|
|
|
|
uint32_t length = UINT32_MAX;
|
|
|
|
if (mRanges) {
|
|
|
|
length = mRanges->TargetClauseLength();
|
|
|
|
}
|
|
|
|
return length == UINT32_MAX ? mData.Length() : length;
|
|
|
|
}
|
|
|
|
|
2014-10-07 14:01:47 +04:00
|
|
|
uint32_t RangeCount() const
|
|
|
|
{
|
|
|
|
return mRanges ? mRanges->Length() : 0;
|
2013-09-24 14:04:15 +04:00
|
|
|
}
|
2014-11-25 08:02:30 +03:00
|
|
|
|
|
|
|
bool CausesDOMTextEvent() const
|
|
|
|
{
|
2015-09-11 15:21:27 +03:00
|
|
|
return mMessage == eCompositionChange ||
|
2015-09-11 15:21:27 +03:00
|
|
|
mMessage == eCompositionCommit ||
|
2015-09-11 15:21:26 +03:00
|
|
|
mMessage == eCompositionCommitAsIs;
|
2014-11-25 08:02:30 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
bool CausesDOMCompositionEndEvent() const
|
|
|
|
{
|
2015-09-11 15:21:27 +03:00
|
|
|
return mMessage == eCompositionEnd ||
|
2015-09-11 15:21:27 +03:00
|
|
|
mMessage == eCompositionCommit ||
|
2015-09-11 15:21:26 +03:00
|
|
|
mMessage == eCompositionCommitAsIs;
|
2014-11-25 08:02:30 +03:00
|
|
|
}
|
2015-09-08 06:54:14 +03:00
|
|
|
|
|
|
|
bool IsFollowedByCompositionEnd() const
|
|
|
|
{
|
2015-09-11 15:21:27 +03:00
|
|
|
return mOriginalMessage == eCompositionCommit ||
|
2015-09-11 15:21:26 +03:00
|
|
|
mOriginalMessage == eCompositionCommitAsIs;
|
2015-09-08 06:54:14 +03:00
|
|
|
}
|
2013-09-24 14:04:15 +04:00
|
|
|
};
|
|
|
|
|
|
|
|
/******************************************************************************
|
|
|
|
* mozilla::WidgetQueryContentEvent
|
|
|
|
******************************************************************************/
|
|
|
|
|
|
|
|
class WidgetQueryContentEvent : public WidgetGUIEvent
|
|
|
|
{
|
|
|
|
private:
|
|
|
|
friend class dom::PBrowserParent;
|
|
|
|
friend class dom::PBrowserChild;
|
|
|
|
|
|
|
|
WidgetQueryContentEvent()
|
2016-01-12 21:16:59 +03:00
|
|
|
: mSucceeded(false)
|
|
|
|
, mUseNativeLineBreak(true)
|
|
|
|
, mWithFontRanges(false)
|
2013-09-24 14:04:15 +04:00
|
|
|
{
|
|
|
|
MOZ_CRASH("WidgetQueryContentEvent is created without proper arguments");
|
|
|
|
}
|
|
|
|
|
|
|
|
public:
|
2015-03-21 19:28:04 +03:00
|
|
|
virtual WidgetQueryContentEvent* AsQueryContentEvent() override
|
2013-10-18 10:10:20 +04:00
|
|
|
{
|
|
|
|
return this;
|
|
|
|
}
|
|
|
|
|
2015-08-26 15:56:59 +03:00
|
|
|
WidgetQueryContentEvent(bool aIsTrusted, EventMessage aMessage,
|
2014-04-26 03:52:12 +04:00
|
|
|
nsIWidget* aWidget)
|
2014-08-04 09:28:49 +04:00
|
|
|
: WidgetGUIEvent(aIsTrusted, aMessage, aWidget, eQueryContentEventClass)
|
2014-04-26 03:52:12 +04:00
|
|
|
, mSucceeded(false)
|
|
|
|
, mUseNativeLineBreak(true)
|
2015-01-31 10:17:12 +03:00
|
|
|
, mWithFontRanges(false)
|
2013-09-24 14:04:15 +04:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2015-03-21 19:28:04 +03:00
|
|
|
virtual WidgetEvent* Duplicate() const override
|
2014-01-27 10:10:44 +04:00
|
|
|
{
|
|
|
|
// This event isn't an internal event of any DOM event.
|
2014-03-27 17:53:19 +04:00
|
|
|
NS_ASSERTION(!IsAllowedToDispatchDOMEvent(),
|
|
|
|
"WidgetQueryContentEvent needs to support Duplicate()");
|
2014-01-27 10:10:44 +04:00
|
|
|
MOZ_CRASH("WidgetQueryContentEvent doesn't support Duplicate()");
|
|
|
|
}
|
|
|
|
|
2014-04-26 03:52:12 +04:00
|
|
|
void InitForQueryTextContent(uint32_t aOffset, uint32_t aLength,
|
|
|
|
bool aUseNativeLineBreak = true)
|
2013-09-24 14:04:15 +04:00
|
|
|
{
|
2015-09-10 04:40:05 +03:00
|
|
|
NS_ASSERTION(mMessage == eQueryTextContent,
|
2013-09-24 14:04:15 +04:00
|
|
|
"wrong initializer is called");
|
|
|
|
mInput.mOffset = aOffset;
|
|
|
|
mInput.mLength = aLength;
|
2014-04-26 03:52:12 +04:00
|
|
|
mUseNativeLineBreak = aUseNativeLineBreak;
|
2013-09-24 14:04:15 +04:00
|
|
|
}
|
|
|
|
|
2014-04-26 03:52:12 +04:00
|
|
|
void InitForQueryCaretRect(uint32_t aOffset,
|
|
|
|
bool aUseNativeLineBreak = true)
|
2013-09-24 14:04:15 +04:00
|
|
|
{
|
2015-09-10 04:40:06 +03:00
|
|
|
NS_ASSERTION(mMessage == eQueryCaretRect,
|
2013-09-24 14:04:15 +04:00
|
|
|
"wrong initializer is called");
|
|
|
|
mInput.mOffset = aOffset;
|
2014-04-26 03:52:12 +04:00
|
|
|
mUseNativeLineBreak = aUseNativeLineBreak;
|
2013-09-24 14:04:15 +04:00
|
|
|
}
|
|
|
|
|
2014-04-26 03:52:12 +04:00
|
|
|
void InitForQueryTextRect(uint32_t aOffset, uint32_t aLength,
|
|
|
|
bool aUseNativeLineBreak = true)
|
2013-09-24 14:04:15 +04:00
|
|
|
{
|
2015-09-11 15:21:26 +03:00
|
|
|
NS_ASSERTION(mMessage == eQueryTextRect,
|
2013-09-24 14:04:15 +04:00
|
|
|
"wrong initializer is called");
|
|
|
|
mInput.mOffset = aOffset;
|
|
|
|
mInput.mLength = aLength;
|
2014-04-26 03:52:12 +04:00
|
|
|
mUseNativeLineBreak = aUseNativeLineBreak;
|
2013-09-24 14:04:15 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
void InitForQueryDOMWidgetHittest(const mozilla::LayoutDeviceIntPoint& aPoint)
|
|
|
|
{
|
2015-09-10 04:40:06 +03:00
|
|
|
NS_ASSERTION(mMessage == eQueryDOMWidgetHittest,
|
2013-09-24 14:04:15 +04:00
|
|
|
"wrong initializer is called");
|
|
|
|
refPoint = aPoint;
|
|
|
|
}
|
|
|
|
|
2015-01-31 10:17:12 +03:00
|
|
|
void RequestFontRanges()
|
|
|
|
{
|
2015-09-10 04:40:05 +03:00
|
|
|
NS_ASSERTION(mMessage == eQueryTextContent,
|
2015-01-31 10:17:12 +03:00
|
|
|
"not querying text content");
|
|
|
|
mWithFontRanges = true;
|
|
|
|
}
|
|
|
|
|
2013-09-24 14:04:15 +04:00
|
|
|
uint32_t GetSelectionStart(void) const
|
|
|
|
{
|
2015-09-10 04:40:05 +03:00
|
|
|
NS_ASSERTION(mMessage == eQuerySelectedText,
|
2013-09-24 14:04:15 +04:00
|
|
|
"not querying selection");
|
|
|
|
return mReply.mOffset + (mReply.mReversed ? mReply.mString.Length() : 0);
|
|
|
|
}
|
|
|
|
|
|
|
|
uint32_t GetSelectionEnd(void) const
|
|
|
|
{
|
2015-09-10 04:40:05 +03:00
|
|
|
NS_ASSERTION(mMessage == eQuerySelectedText,
|
2013-09-24 14:04:15 +04:00
|
|
|
"not querying selection");
|
|
|
|
return mReply.mOffset + (mReply.mReversed ? 0 : mReply.mString.Length());
|
|
|
|
}
|
|
|
|
|
2014-12-05 05:15:43 +03:00
|
|
|
mozilla::WritingMode GetWritingMode(void) const
|
|
|
|
{
|
2015-09-10 04:40:05 +03:00
|
|
|
NS_ASSERTION(mMessage == eQuerySelectedText ||
|
2015-09-10 04:40:06 +03:00
|
|
|
mMessage == eQueryCaretRect ||
|
2015-09-11 15:21:26 +03:00
|
|
|
mMessage == eQueryTextRect,
|
2015-02-10 18:28:05 +03:00
|
|
|
"not querying selection or text rect");
|
2014-12-05 05:15:43 +03:00
|
|
|
return mReply.mWritingMode;
|
|
|
|
}
|
|
|
|
|
2013-09-24 14:04:15 +04:00
|
|
|
bool mSucceeded;
|
2014-04-26 03:52:12 +04:00
|
|
|
bool mUseNativeLineBreak;
|
2015-01-31 10:17:12 +03:00
|
|
|
bool mWithFontRanges;
|
2013-09-24 14:04:15 +04:00
|
|
|
struct
|
|
|
|
{
|
2015-05-26 11:14:35 +03:00
|
|
|
uint32_t EndOffset() const
|
|
|
|
{
|
2015-06-05 12:28:21 +03:00
|
|
|
CheckedInt<uint32_t> endOffset =
|
|
|
|
CheckedInt<uint32_t>(mOffset) + mLength;
|
|
|
|
return NS_WARN_IF(!endOffset.isValid()) ? UINT32_MAX : endOffset.value();
|
2015-05-26 11:14:35 +03:00
|
|
|
}
|
|
|
|
|
2013-09-24 14:04:15 +04:00
|
|
|
uint32_t mOffset;
|
|
|
|
uint32_t mLength;
|
|
|
|
} mInput;
|
2015-04-14 13:46:51 +03:00
|
|
|
|
|
|
|
struct Reply
|
2013-09-24 14:04:15 +04:00
|
|
|
{
|
|
|
|
void* mContentsRoot;
|
|
|
|
uint32_t mOffset;
|
2015-09-10 04:40:06 +03:00
|
|
|
// mTentativeCaretOffset is used by only eQueryCharacterAtPoint.
|
2015-04-14 08:27:37 +03:00
|
|
|
// This is the offset where caret would be if user clicked at the refPoint.
|
|
|
|
uint32_t mTentativeCaretOffset;
|
2013-09-24 14:04:15 +04:00
|
|
|
nsString mString;
|
2015-10-05 08:46:39 +03:00
|
|
|
// mRect is used by eQueryTextRect, eQueryCaretRect, eQueryCharacterAtPoint
|
|
|
|
// and eQueryEditorRect. The coordinates is system coordinates relative to
|
|
|
|
// the top level widget of mFocusedWidget. E.g., if a <xul:panel> which
|
|
|
|
// is owned by a window has focused editor, the offset of mRect is relative
|
|
|
|
// to the owner window, not the <xul:panel>.
|
2015-02-04 23:21:03 +03:00
|
|
|
mozilla::LayoutDeviceIntRect mRect;
|
2013-09-24 14:04:15 +04:00
|
|
|
// The return widget has the caret. This is set at all query events.
|
|
|
|
nsIWidget* mFocusedWidget;
|
2014-11-22 17:39:03 +03:00
|
|
|
// mozilla::WritingMode value at the end (focus) of the selection
|
|
|
|
mozilla::WritingMode mWritingMode;
|
2015-09-10 04:40:05 +03:00
|
|
|
// Used by eQuerySelectionAsTransferable
|
2013-09-24 14:04:15 +04:00
|
|
|
nsCOMPtr<nsITransferable> mTransferable;
|
2015-09-10 04:40:05 +03:00
|
|
|
// Used by eQueryTextContent with font ranges requested
|
2016-02-02 18:36:30 +03:00
|
|
|
AutoTArray<mozilla::FontRange, 1> mFontRanges;
|
2015-04-14 13:46:51 +03:00
|
|
|
// true if selection is reversed (end < start)
|
|
|
|
bool mReversed;
|
|
|
|
// true if the selection exists
|
|
|
|
bool mHasSelection;
|
|
|
|
// true if DOM element under mouse belongs to widget
|
|
|
|
bool mWidgetIsHit;
|
|
|
|
|
|
|
|
Reply()
|
|
|
|
: mContentsRoot(nullptr)
|
|
|
|
, mOffset(NOT_FOUND)
|
|
|
|
, mTentativeCaretOffset(NOT_FOUND)
|
|
|
|
, mFocusedWidget(nullptr)
|
|
|
|
, mReversed(false)
|
|
|
|
, mHasSelection(false)
|
|
|
|
, mWidgetIsHit(false)
|
|
|
|
{
|
|
|
|
}
|
2013-09-24 14:04:15 +04:00
|
|
|
} mReply;
|
|
|
|
|
|
|
|
enum
|
|
|
|
{
|
|
|
|
NOT_FOUND = UINT32_MAX
|
|
|
|
};
|
|
|
|
|
|
|
|
// values of mComputedScrollAction
|
|
|
|
enum
|
|
|
|
{
|
|
|
|
SCROLL_ACTION_NONE,
|
|
|
|
SCROLL_ACTION_LINE,
|
|
|
|
SCROLL_ACTION_PAGE
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
/******************************************************************************
|
|
|
|
* mozilla::WidgetSelectionEvent
|
|
|
|
******************************************************************************/
|
|
|
|
|
|
|
|
class WidgetSelectionEvent : public WidgetGUIEvent
|
|
|
|
{
|
|
|
|
private:
|
|
|
|
friend class mozilla::dom::PBrowserParent;
|
|
|
|
friend class mozilla::dom::PBrowserChild;
|
|
|
|
|
|
|
|
WidgetSelectionEvent()
|
2015-05-28 07:51:40 +03:00
|
|
|
: mOffset(0)
|
2014-01-15 18:41:39 +04:00
|
|
|
, mLength(0)
|
|
|
|
, mReversed(false)
|
|
|
|
, mExpandToClusterBoundary(true)
|
|
|
|
, mSucceeded(false)
|
2016-01-12 21:16:59 +03:00
|
|
|
, mUseNativeLineBreak(true)
|
2013-09-24 14:04:15 +04:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
public:
|
2015-03-21 19:28:04 +03:00
|
|
|
virtual WidgetSelectionEvent* AsSelectionEvent() override
|
2013-10-18 10:10:20 +04:00
|
|
|
{
|
|
|
|
return this;
|
|
|
|
}
|
|
|
|
|
2015-08-26 15:56:59 +03:00
|
|
|
WidgetSelectionEvent(bool aIsTrusted, EventMessage aMessage,
|
|
|
|
nsIWidget* aWidget)
|
2014-08-04 09:28:49 +04:00
|
|
|
: WidgetGUIEvent(aIsTrusted, aMessage, aWidget, eSelectionEventClass)
|
2014-01-15 18:41:39 +04:00
|
|
|
, mOffset(0)
|
|
|
|
, mLength(0)
|
|
|
|
, mReversed(false)
|
|
|
|
, mExpandToClusterBoundary(true)
|
|
|
|
, mSucceeded(false)
|
2014-04-26 03:52:12 +04:00
|
|
|
, mUseNativeLineBreak(true)
|
2015-12-01 23:25:06 +03:00
|
|
|
, mReason(nsISelectionListener::NO_REASON)
|
2013-09-24 14:04:15 +04:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2015-03-21 19:28:04 +03:00
|
|
|
virtual WidgetEvent* Duplicate() const override
|
2014-01-27 10:10:44 +04:00
|
|
|
{
|
|
|
|
// This event isn't an internal event of any DOM event.
|
2014-03-27 17:53:19 +04:00
|
|
|
NS_ASSERTION(!IsAllowedToDispatchDOMEvent(),
|
|
|
|
"WidgetSelectionEvent needs to support Duplicate()");
|
2014-01-27 10:10:44 +04:00
|
|
|
MOZ_CRASH("WidgetSelectionEvent doesn't support Duplicate()");
|
|
|
|
return nullptr;
|
|
|
|
}
|
|
|
|
|
2013-09-24 14:04:15 +04:00
|
|
|
// Start offset of selection
|
|
|
|
uint32_t mOffset;
|
|
|
|
// Length of selection
|
|
|
|
uint32_t mLength;
|
|
|
|
// Selection "anchor" should be in front
|
|
|
|
bool mReversed;
|
|
|
|
// Cluster-based or character-based
|
|
|
|
bool mExpandToClusterBoundary;
|
|
|
|
// true if setting selection succeeded.
|
|
|
|
bool mSucceeded;
|
2014-04-26 03:52:12 +04:00
|
|
|
// true if native line breaks are used for mOffset and mLength
|
|
|
|
bool mUseNativeLineBreak;
|
2015-12-01 23:25:06 +03:00
|
|
|
// Fennec provides eSetSelection reason codes for downstream
|
|
|
|
// use in AccessibleCaret visibility logic.
|
|
|
|
int16_t mReason;
|
2013-09-24 14:04:15 +04:00
|
|
|
};
|
|
|
|
|
2014-04-10 11:11:37 +04:00
|
|
|
/******************************************************************************
|
|
|
|
* mozilla::InternalEditorInputEvent
|
|
|
|
******************************************************************************/
|
|
|
|
|
|
|
|
class InternalEditorInputEvent : public InternalUIEvent
|
|
|
|
{
|
|
|
|
private:
|
|
|
|
InternalEditorInputEvent()
|
|
|
|
: mIsComposing(false)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
public:
|
2015-03-21 19:28:04 +03:00
|
|
|
virtual InternalEditorInputEvent* AsEditorInputEvent() override
|
2014-04-10 11:11:37 +04:00
|
|
|
{
|
|
|
|
return this;
|
|
|
|
}
|
|
|
|
|
2015-08-26 15:56:59 +03:00
|
|
|
InternalEditorInputEvent(bool aIsTrusted, EventMessage aMessage,
|
2014-04-10 11:11:37 +04:00
|
|
|
nsIWidget* aWidget)
|
2014-08-04 09:28:49 +04:00
|
|
|
: InternalUIEvent(aIsTrusted, aMessage, aWidget, eEditorInputEventClass)
|
2014-04-10 11:11:37 +04:00
|
|
|
, mIsComposing(false)
|
|
|
|
{
|
|
|
|
if (!aIsTrusted) {
|
|
|
|
mFlags.mBubbles = false;
|
|
|
|
mFlags.mCancelable = false;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
mFlags.mBubbles = true;
|
|
|
|
mFlags.mCancelable = false;
|
|
|
|
}
|
|
|
|
|
2015-03-21 19:28:04 +03:00
|
|
|
virtual WidgetEvent* Duplicate() const override
|
2014-04-10 11:11:37 +04:00
|
|
|
{
|
2014-08-04 09:28:49 +04:00
|
|
|
MOZ_ASSERT(mClass == eEditorInputEventClass,
|
2014-04-10 11:11:37 +04:00
|
|
|
"Duplicate() must be overridden by sub class");
|
|
|
|
// Not copying widget, it is a weak reference.
|
|
|
|
InternalEditorInputEvent* result =
|
2015-08-22 04:34:51 +03:00
|
|
|
new InternalEditorInputEvent(false, mMessage, nullptr);
|
2014-04-10 11:11:37 +04:00
|
|
|
result->AssignEditorInputEventData(*this, true);
|
|
|
|
result->mFlags = mFlags;
|
|
|
|
return result;
|
|
|
|
}
|
|
|
|
|
|
|
|
bool mIsComposing;
|
|
|
|
|
|
|
|
void AssignEditorInputEventData(const InternalEditorInputEvent& aEvent,
|
|
|
|
bool aCopyTargets)
|
|
|
|
{
|
|
|
|
AssignUIEventData(aEvent, aCopyTargets);
|
|
|
|
|
|
|
|
mIsComposing = aEvent.mIsComposing;
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
2013-09-24 14:04:15 +04:00
|
|
|
} // namespace mozilla
|
|
|
|
|
|
|
|
#endif // mozilla_TextEvents_h__
|