mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 960871 part.6 Use WidgetCompositionEvent for NS_COMPOSITION_CHANGE instead of WidgetTextEvent r=smaug
This commit is contained in:
parent
db5313485e
commit
c2bf46d0e4
@ -135,7 +135,7 @@ CompositionStringSynthesizer::DispatchEvent(bool* aDefaultPrevented)
|
||||
mClauses->AppendElement(mCaret);
|
||||
}
|
||||
|
||||
WidgetTextEvent textEvent(true, NS_COMPOSITION_CHANGE, widget);
|
||||
WidgetCompositionEvent textEvent(true, NS_COMPOSITION_CHANGE, widget);
|
||||
textEvent.time = PR_IntervalNow();
|
||||
textEvent.mData = mString;
|
||||
if (!mClauses->IsEmpty()) {
|
||||
|
@ -702,6 +702,7 @@ EventDispatcher::CreateEvent(EventTarget* aOwner,
|
||||
return NS_NewDOMKeyboardEvent(aDOMEvent, aOwner, aPresContext,
|
||||
aEvent->AsKeyboardEvent());
|
||||
case eCompositionEventClass:
|
||||
case eTextEventClass:
|
||||
return NS_NewDOMCompositionEvent(aDOMEvent, aOwner, aPresContext,
|
||||
aEvent->AsCompositionEvent());
|
||||
case eMouseEventClass:
|
||||
@ -722,9 +723,6 @@ EventDispatcher::CreateEvent(EventTarget* aOwner,
|
||||
case eDragEventClass:
|
||||
return NS_NewDOMDragEvent(aDOMEvent, aOwner, aPresContext,
|
||||
aEvent->AsDragEvent());
|
||||
case eTextEventClass:
|
||||
return NS_NewDOMUIEvent(aDOMEvent, aOwner, aPresContext,
|
||||
aEvent->AsTextEvent());
|
||||
case eClipboardEventClass:
|
||||
return NS_NewDOMClipboardEvent(aDOMEvent, aOwner, aPresContext,
|
||||
aEvent->AsClipboardEvent());
|
||||
@ -772,14 +770,14 @@ EventDispatcher::CreateEvent(EventTarget* aOwner,
|
||||
if (aEventType.LowerCaseEqualsLiteral("keyboardevent") ||
|
||||
aEventType.LowerCaseEqualsLiteral("keyevents"))
|
||||
return NS_NewDOMKeyboardEvent(aDOMEvent, aOwner, aPresContext, nullptr);
|
||||
if (aEventType.LowerCaseEqualsLiteral("compositionevent"))
|
||||
if (aEventType.LowerCaseEqualsLiteral("compositionevent") ||
|
||||
aEventType.LowerCaseEqualsLiteral("textevent") ||
|
||||
aEventType.LowerCaseEqualsLiteral("textevents")) {
|
||||
return NS_NewDOMCompositionEvent(aDOMEvent, aOwner, aPresContext, nullptr);
|
||||
}
|
||||
if (aEventType.LowerCaseEqualsLiteral("mutationevent") ||
|
||||
aEventType.LowerCaseEqualsLiteral("mutationevents"))
|
||||
return NS_NewDOMMutationEvent(aDOMEvent, aOwner, aPresContext, nullptr);
|
||||
if (aEventType.LowerCaseEqualsLiteral("textevent") ||
|
||||
aEventType.LowerCaseEqualsLiteral("textevents"))
|
||||
return NS_NewDOMUIEvent(aDOMEvent, aOwner, aPresContext, nullptr);
|
||||
if (aEventType.LowerCaseEqualsLiteral("deviceorientationevent")) {
|
||||
DeviceOrientationEventInit init;
|
||||
nsRefPtr<DeviceOrientationEvent> event =
|
||||
|
@ -658,7 +658,7 @@ NON_IDL_EVENT(speakerforcedchange,
|
||||
NON_IDL_EVENT(text,
|
||||
NS_COMPOSITION_CHANGE,
|
||||
EventNameType_XUL,
|
||||
eTextEventClass)
|
||||
eCompositionEventClass)
|
||||
NON_IDL_EVENT(compositionstart,
|
||||
NS_COMPOSITION_START,
|
||||
EventNameType_XUL,
|
||||
|
@ -798,7 +798,7 @@ EventStateManager::PreHandleEvent(nsPresContext* aPresContext,
|
||||
break;
|
||||
case NS_COMPOSITION_CHANGE:
|
||||
{
|
||||
WidgetTextEvent *textEvent = aEvent->AsTextEvent();
|
||||
WidgetCompositionEvent* textEvent = aEvent->AsCompositionEvent();
|
||||
if (IsTargetCrossProcess(textEvent)) {
|
||||
// Will not be handled locally, remote the event
|
||||
if (GetCrossProcessTarget()->SendTextEvent(*textEvent)) {
|
||||
|
@ -130,19 +130,6 @@ GetIMEStateSetOpenName(IMEState::Open aOpen)
|
||||
}
|
||||
}
|
||||
|
||||
static const char*
|
||||
GetEventClassIDName(EventClassID aEventClassID)
|
||||
{
|
||||
switch (aEventClassID) {
|
||||
case eCompositionEventClass:
|
||||
return "eCompositionEventClass";
|
||||
case eTextEventClass:
|
||||
return "eTextEventClass";
|
||||
default:
|
||||
return "unacceptable event struct type";
|
||||
}
|
||||
}
|
||||
|
||||
static const char*
|
||||
GetEventMessageName(uint32_t aMessage)
|
||||
{
|
||||
@ -892,18 +879,16 @@ IMEStateManager::DispatchCompositionEvent(nsINode* aEventTargetNode,
|
||||
{
|
||||
PR_LOG(sISMLog, PR_LOG_ALWAYS,
|
||||
("ISM: IMEStateManager::DispatchCompositionEvent(aNode=0x%p, "
|
||||
"aPresContext=0x%p, aEvent={ mClass=%s, message=%s, "
|
||||
"aPresContext=0x%p, aEvent={ message=%s, "
|
||||
"mFlags={ mIsTrusted=%s, mPropagationStopped=%s } }, "
|
||||
"aIsSynthesized=%s)",
|
||||
aEventTargetNode, aPresContext,
|
||||
GetEventClassIDName(aEvent->mClass),
|
||||
GetEventMessageName(aEvent->message),
|
||||
GetBoolName(aEvent->mFlags.mIsTrusted),
|
||||
GetBoolName(aEvent->mFlags.mPropagationStopped),
|
||||
GetBoolName(aIsSynthesized)));
|
||||
|
||||
MOZ_ASSERT(aEvent->mClass == eCompositionEventClass ||
|
||||
aEvent->mClass == eTextEventClass);
|
||||
MOZ_ASSERT(aEvent->mClass == eCompositionEventClass);
|
||||
if (!aEvent->mFlags.mIsTrusted || aEvent->mFlags.mPropagationStopped) {
|
||||
return;
|
||||
}
|
||||
@ -975,14 +960,12 @@ IMEStateManager::OnCompositionEventDiscarded(WidgetEvent* aEvent)
|
||||
// commit or cancel composition.
|
||||
|
||||
PR_LOG(sISMLog, PR_LOG_ALWAYS,
|
||||
("ISM: IMEStateManager::OnCompositionEventDiscarded(aEvent={ mClass=%s, "
|
||||
("ISM: IMEStateManager::OnCompositionEventDiscarded(aEvent={ "
|
||||
"message=%s, mFlags={ mIsTrusted=%s } })",
|
||||
GetEventClassIDName(aEvent->mClass),
|
||||
GetEventMessageName(aEvent->message),
|
||||
GetBoolName(aEvent->mFlags.mIsTrusted)));
|
||||
|
||||
MOZ_ASSERT(aEvent->mClass == eCompositionEventClass ||
|
||||
aEvent->mClass == eTextEventClass);
|
||||
MOZ_ASSERT(aEvent->mClass == eCompositionEventClass);
|
||||
if (!aEvent->mFlags.mIsTrusted) {
|
||||
return;
|
||||
}
|
||||
@ -1233,10 +1216,8 @@ IMEStateManager::GetTextCompositionFor(nsIWidget* aWidget)
|
||||
already_AddRefed<TextComposition>
|
||||
IMEStateManager::GetTextCompositionFor(WidgetGUIEvent* aEvent)
|
||||
{
|
||||
MOZ_ASSERT(aEvent->AsCompositionEvent() || aEvent->AsTextEvent() ||
|
||||
aEvent->AsKeyboardEvent(),
|
||||
"aEvent has to be WidgetCompositionEvent, WidgetTextEvent or "
|
||||
"WidgetKeyboardEvent");
|
||||
MOZ_ASSERT(aEvent->AsCompositionEvent() || aEvent->AsKeyboardEvent(),
|
||||
"aEvent has to be WidgetCompositionEvent or WidgetKeyboardEvent");
|
||||
return GetTextCompositionFor(aEvent->widget);
|
||||
}
|
||||
|
||||
|
@ -61,7 +61,8 @@ TextComposition::MatchesNativeContext(nsIWidget* aWidget) const
|
||||
}
|
||||
|
||||
bool
|
||||
TextComposition::MaybeDispatchCompositionUpdate(const WidgetTextEvent* aEvent)
|
||||
TextComposition::MaybeDispatchCompositionUpdate(
|
||||
const WidgetCompositionEvent* aEvent)
|
||||
{
|
||||
if (Destroyed()) {
|
||||
return false;
|
||||
@ -95,8 +96,7 @@ TextComposition::OnCompositionEventDiscarded(const WidgetGUIEvent* aEvent)
|
||||
|
||||
MOZ_ASSERT(aEvent->mFlags.mIsTrusted,
|
||||
"Shouldn't be called with untrusted event");
|
||||
MOZ_ASSERT(aEvent->mClass == eCompositionEventClass ||
|
||||
aEvent->mClass == eTextEventClass);
|
||||
MOZ_ASSERT(aEvent->mClass == eCompositionEventClass);
|
||||
|
||||
// XXX If composition events are discarded, should we dispatch them with
|
||||
// runnable event? However, even if we do so, it might make native IME
|
||||
@ -146,10 +146,8 @@ TextComposition::DispatchEvent(WidgetGUIEvent* aEvent,
|
||||
nsString* committingData = nullptr;
|
||||
switch (aEvent->message) {
|
||||
case NS_COMPOSITION_END:
|
||||
committingData = &aEvent->AsCompositionEvent()->mData;
|
||||
break;
|
||||
case NS_COMPOSITION_CHANGE:
|
||||
committingData = &aEvent->AsTextEvent()->mData;
|
||||
committingData = &aEvent->AsCompositionEvent()->mData;
|
||||
break;
|
||||
default:
|
||||
NS_WARNING("Unexpected event comes during committing or "
|
||||
@ -167,7 +165,7 @@ TextComposition::DispatchEvent(WidgetGUIEvent* aEvent,
|
||||
}
|
||||
|
||||
if (aEvent->message == NS_COMPOSITION_CHANGE) {
|
||||
if (!MaybeDispatchCompositionUpdate(aEvent->AsTextEvent())) {
|
||||
if (!MaybeDispatchCompositionUpdate(aEvent->AsCompositionEvent())) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
@ -182,7 +180,7 @@ TextComposition::DispatchEvent(WidgetGUIEvent* aEvent,
|
||||
// Emulate editor behavior of compositionchange event (DOM text event) handler
|
||||
// if no editor handles composition events.
|
||||
if (aEvent->message == NS_COMPOSITION_CHANGE && !HasEditor()) {
|
||||
EditorWillHandleTextEvent(aEvent->AsTextEvent());
|
||||
EditorWillHandleTextEvent(aEvent->AsCompositionEvent());
|
||||
EditorDidHandleTextEvent();
|
||||
}
|
||||
|
||||
@ -220,11 +218,12 @@ TextComposition::NotityUpdateComposition(WidgetGUIEvent* aEvent)
|
||||
mCompositionStartOffset = 0;
|
||||
}
|
||||
mCompositionTargetOffset = mCompositionStartOffset;
|
||||
} else if (aEvent->mClass != eTextEventClass) {
|
||||
return;
|
||||
} else {
|
||||
} else if (aEvent->message == NS_COMPOSITION_CHANGE) {
|
||||
mCompositionTargetOffset =
|
||||
mCompositionStartOffset + aEvent->AsTextEvent()->TargetClauseOffset();
|
||||
mCompositionStartOffset +
|
||||
aEvent->AsCompositionEvent()->TargetClauseOffset();
|
||||
} else {
|
||||
return;
|
||||
}
|
||||
|
||||
NotifyIME(NOTIFY_IME_OF_COMPOSITION_UPDATE);
|
||||
@ -286,7 +285,7 @@ TextComposition::RequestToCommit(nsIWidget* aWidget, bool aDiscard)
|
||||
nsAutoString commitData(aDiscard ? EmptyString() : lastData);
|
||||
bool changingData = lastData != commitData;
|
||||
|
||||
WidgetTextEvent textEvent(true, NS_COMPOSITION_CHANGE, widget);
|
||||
WidgetCompositionEvent textEvent(true, NS_COMPOSITION_CHANGE, widget);
|
||||
textEvent.mData = commitData;
|
||||
textEvent.mFlags.mIsSynthesizedForTests = true;
|
||||
|
||||
@ -340,7 +339,8 @@ TextComposition::NotifyIME(IMEMessage aMessage)
|
||||
}
|
||||
|
||||
void
|
||||
TextComposition::EditorWillHandleTextEvent(const WidgetTextEvent* aTextEvent)
|
||||
TextComposition::EditorWillHandleTextEvent(
|
||||
const WidgetCompositionEvent* aTextEvent)
|
||||
{
|
||||
mIsComposing = aTextEvent->IsComposing();
|
||||
mRanges = aTextEvent->mRanges;
|
||||
@ -454,7 +454,7 @@ TextComposition::CompositionEventDispatcher::Run()
|
||||
break;
|
||||
}
|
||||
case NS_COMPOSITION_CHANGE: {
|
||||
WidgetTextEvent textEvent(true, NS_COMPOSITION_CHANGE, widget);
|
||||
WidgetCompositionEvent textEvent(true, NS_COMPOSITION_CHANGE, widget);
|
||||
textEvent.mData = mData;
|
||||
textEvent.mFlags.mIsSynthesizedForTests =
|
||||
mTextComposition->IsSynthesizedForTests();
|
||||
|
@ -132,7 +132,7 @@ public:
|
||||
{
|
||||
public:
|
||||
TextEventHandlingMarker(TextComposition* aComposition,
|
||||
const WidgetTextEvent* aTextEvent)
|
||||
const WidgetCompositionEvent* aTextEvent)
|
||||
: mComposition(aComposition)
|
||||
{
|
||||
mComposition->EditorWillHandleTextEvent(aTextEvent);
|
||||
@ -235,7 +235,7 @@ private:
|
||||
* EditorWillHandleTextEvent() must be called before the focused editor
|
||||
* handles the compositionchange event.
|
||||
*/
|
||||
void EditorWillHandleTextEvent(const WidgetTextEvent* aTextEvent);
|
||||
void EditorWillHandleTextEvent(const WidgetCompositionEvent* aTextEvent);
|
||||
|
||||
/**
|
||||
* EditorDidHandleTextEvent() must be called after the focused editor handles
|
||||
@ -258,7 +258,7 @@ private:
|
||||
* @return Returns false if dispatching the compositionupdate event caused
|
||||
* destroying this composition.
|
||||
*/
|
||||
bool MaybeDispatchCompositionUpdate(const WidgetTextEvent* aEvent);
|
||||
bool MaybeDispatchCompositionUpdate(const WidgetCompositionEvent* aEvent);
|
||||
|
||||
/**
|
||||
* If IME has already dispatched compositionend event but it was discarded
|
||||
|
@ -44,7 +44,6 @@ using class mozilla::WidgetMouseEvent from "ipc/nsGUIEventIPC.h";
|
||||
using class mozilla::WidgetWheelEvent from "ipc/nsGUIEventIPC.h";
|
||||
using struct nsRect from "nsRect.h";
|
||||
using class mozilla::WidgetSelectionEvent from "ipc/nsGUIEventIPC.h";
|
||||
using class mozilla::WidgetTextEvent from "ipc/nsGUIEventIPC.h";
|
||||
using class mozilla::WidgetTouchEvent from "ipc/nsGUIEventIPC.h";
|
||||
using struct mozilla::dom::RemoteDOMEvent from "mozilla/dom/TabMessageUtils.h";
|
||||
using mozilla::dom::ScreenOrientation from "mozilla/dom/ScreenOrientation.h";
|
||||
@ -479,7 +478,7 @@ child:
|
||||
|
||||
CompositionEvent(WidgetCompositionEvent event);
|
||||
|
||||
TextEvent(WidgetTextEvent event);
|
||||
TextEvent(WidgetCompositionEvent event);
|
||||
|
||||
SelectionEvent(WidgetSelectionEvent event);
|
||||
|
||||
|
@ -2389,9 +2389,9 @@ TabChild::RecvCompositionEvent(const WidgetCompositionEvent& event)
|
||||
}
|
||||
|
||||
bool
|
||||
TabChild::RecvTextEvent(const WidgetTextEvent& event)
|
||||
TabChild::RecvTextEvent(const WidgetCompositionEvent& event)
|
||||
{
|
||||
WidgetTextEvent localEvent(event);
|
||||
WidgetCompositionEvent localEvent(event);
|
||||
localEvent.widget = mWidget;
|
||||
DispatchWidgetEvent(localEvent);
|
||||
return true;
|
||||
|
@ -360,7 +360,7 @@ public:
|
||||
const int32_t& aModifiers,
|
||||
const bool& aPreventDefault) MOZ_OVERRIDE;
|
||||
virtual bool RecvCompositionEvent(const mozilla::WidgetCompositionEvent& event) MOZ_OVERRIDE;
|
||||
virtual bool RecvTextEvent(const mozilla::WidgetTextEvent& event) MOZ_OVERRIDE;
|
||||
virtual bool RecvTextEvent(const mozilla::WidgetCompositionEvent& event) MOZ_OVERRIDE;
|
||||
virtual bool RecvSelectionEvent(const mozilla::WidgetSelectionEvent& event) MOZ_OVERRIDE;
|
||||
virtual bool RecvActivateFrameEvent(const nsString& aType, const bool& capture) MOZ_OVERRIDE;
|
||||
virtual bool RecvLoadRemoteScript(const nsString& aURL,
|
||||
|
@ -1582,7 +1582,7 @@ TabParent::SendCompositionEvent(WidgetCompositionEvent& event)
|
||||
* here and pass the text as the EndIMEComposition return value
|
||||
*/
|
||||
bool
|
||||
TabParent::SendTextEvent(WidgetTextEvent& event)
|
||||
TabParent::SendTextEvent(WidgetCompositionEvent& event)
|
||||
{
|
||||
if (mIsDestroyed) {
|
||||
return false;
|
||||
|
@ -318,7 +318,7 @@ public:
|
||||
static TabParent *GetIMETabParent() { return mIMETabParent; }
|
||||
bool HandleQueryContentEvent(mozilla::WidgetQueryContentEvent& aEvent);
|
||||
bool SendCompositionEvent(mozilla::WidgetCompositionEvent& event);
|
||||
bool SendTextEvent(mozilla::WidgetTextEvent& event);
|
||||
bool SendTextEvent(mozilla::WidgetCompositionEvent& event);
|
||||
bool SendSelectionEvent(mozilla::WidgetSelectionEvent& event);
|
||||
|
||||
static TabParent* GetFrom(nsFrameLoader* aFrameLoader);
|
||||
|
@ -5109,15 +5109,10 @@ nsEditor::IsAcceptableInputEvent(nsIDOMEvent* aEvent)
|
||||
// If events are not created with proper event interface, their message
|
||||
// are initialized with NS_USER_DEFINED_EVENT. Let's ignore such event.
|
||||
return false;
|
||||
case NS_COMPOSITION_CHANGE:
|
||||
// Don't allow compositionchange events whose internal event are not
|
||||
// WidgetTextEvent.
|
||||
widgetGUIEvent = aEvent->GetInternalNSEvent()->AsTextEvent();
|
||||
needsWidget = true;
|
||||
break;
|
||||
case NS_COMPOSITION_START:
|
||||
case NS_COMPOSITION_END:
|
||||
case NS_COMPOSITION_UPDATE:
|
||||
case NS_COMPOSITION_CHANGE:
|
||||
// Don't allow composition events whose internal event are not
|
||||
// WidgetCompositionEvent.
|
||||
widgetGUIEvent = aEvent->GetInternalNSEvent()->AsCompositionEvent();
|
||||
|
@ -846,9 +846,11 @@ nsPlaintextEditor::UpdateIMEComposition(nsIDOMEvent* aDOMTextEvent)
|
||||
{
|
||||
NS_ABORT_IF_FALSE(aDOMTextEvent, "aDOMTextEvent must not be nullptr");
|
||||
|
||||
WidgetTextEvent* widgetTextEvent =
|
||||
aDOMTextEvent->GetInternalNSEvent()->AsTextEvent();
|
||||
WidgetCompositionEvent* widgetTextEvent =
|
||||
aDOMTextEvent->GetInternalNSEvent()->AsCompositionEvent();
|
||||
NS_ENSURE_TRUE(widgetTextEvent, NS_ERROR_INVALID_ARG);
|
||||
MOZ_ASSERT(compChangeEvent->message == NS_COMPOSITION_CHANGE,
|
||||
"The internal event should be NS_COMPOSITION_CHANGE");
|
||||
|
||||
EnsureComposition(widgetTextEvent);
|
||||
|
||||
|
@ -6942,8 +6942,7 @@ PresShell::HandleEvent(nsIFrame* aFrame,
|
||||
|
||||
if (!nsContentUtils::IsSafeToRunScript() &&
|
||||
aEvent->IsAllowedToDispatchDOMEvent()) {
|
||||
if (aEvent->mClass == eCompositionEventClass ||
|
||||
aEvent->mClass == eTextEventClass) {
|
||||
if (aEvent->mClass == eCompositionEventClass) {
|
||||
IMEStateManager::OnCompositionEventDiscarded(aEvent);
|
||||
}
|
||||
#ifdef DEBUG
|
||||
@ -7859,8 +7858,7 @@ PresShell::HandleEventInternal(WidgetEvent* aEvent, nsEventStatus* aStatus)
|
||||
}
|
||||
}
|
||||
if (eventTarget) {
|
||||
if (aEvent->mClass == eCompositionEventClass ||
|
||||
aEvent->mClass == eTextEventClass) {
|
||||
if (aEvent->mClass == eCompositionEventClass) {
|
||||
IMEStateManager::DispatchCompositionEvent(eventTarget,
|
||||
mPresContext, aEvent, aStatus, eventCBPtr);
|
||||
} else {
|
||||
|
@ -685,7 +685,7 @@ nsWindow::DispatchEvent(WidgetGUIEvent* aEvent)
|
||||
break;
|
||||
case NS_COMPOSITION_CHANGE:
|
||||
MOZ_ASSERT(mIMEComposing);
|
||||
mIMEComposingText = aEvent->AsTextEvent()->mData;
|
||||
mIMEComposingText = aEvent->AsCompositionEvent()->mData;
|
||||
break;
|
||||
}
|
||||
return status;
|
||||
@ -1707,7 +1707,7 @@ nsWindow::RemoveIMEComposition()
|
||||
AutoIMEMask selMask(mIMEMaskSelectionUpdate);
|
||||
AutoIMEMask textMask(mIMEMaskTextUpdate);
|
||||
|
||||
WidgetTextEvent textEvent(true, NS_COMPOSITION_CHANGE, this);
|
||||
WidgetCompositionEvent textEvent(true, NS_COMPOSITION_CHANGE, this);
|
||||
InitEvent(textEvent, nullptr);
|
||||
textEvent.mData = mIMEComposingText;
|
||||
DispatchEvent(&textEvent);
|
||||
@ -1845,7 +1845,7 @@ nsWindow::OnIMEEvent(AndroidGeckoEvent *ae)
|
||||
}
|
||||
|
||||
{
|
||||
WidgetTextEvent event(true, NS_COMPOSITION_CHANGE, this);
|
||||
WidgetCompositionEvent event(true, NS_COMPOSITION_CHANGE, this);
|
||||
InitEvent(event, nullptr);
|
||||
event.mData = ae->Characters();
|
||||
|
||||
@ -1955,7 +1955,7 @@ nsWindow::OnIMEEvent(AndroidGeckoEvent *ae)
|
||||
AutoIMEMask selMask(mIMEMaskSelectionUpdate);
|
||||
AutoIMEMask textMask(mIMEMaskTextUpdate);
|
||||
|
||||
WidgetTextEvent event(true, NS_COMPOSITION_CHANGE, this);
|
||||
WidgetCompositionEvent event(true, NS_COMPOSITION_CHANGE, this);
|
||||
InitEvent(event, nullptr);
|
||||
|
||||
event.mRanges = new TextRangeArray();
|
||||
@ -2086,7 +2086,7 @@ nsWindow::NotifyIME(const IMENotification& aIMENotification)
|
||||
if (mIMEComposing) {
|
||||
nsRefPtr<nsWindow> kungFuDeathGrip(this);
|
||||
|
||||
WidgetTextEvent textEvent(true, NS_COMPOSITION_CHANGE, this);
|
||||
WidgetCompositionEvent textEvent(true, NS_COMPOSITION_CHANGE, this);
|
||||
InitEvent(textEvent, nullptr);
|
||||
DispatchEvent(&textEvent);
|
||||
|
||||
|
@ -2716,7 +2716,7 @@ IMEInputHandler::DispatchTextEvent(const nsString& aText,
|
||||
|
||||
nsRefPtr<IMEInputHandler> kungFuDeathGrip(this);
|
||||
|
||||
WidgetTextEvent textEvent(true, NS_COMPOSITION_CHANGE, mWidget);
|
||||
WidgetCompositionEvent textEvent(true, NS_COMPOSITION_CHANGE, mWidget);
|
||||
textEvent.time = PR_IntervalNow();
|
||||
textEvent.mData = aText;
|
||||
if (!aDoCommit) {
|
||||
|
@ -1107,7 +1107,8 @@ nsGtkIMModule::DispatchTextEvent(const nsAString &aCompositionString,
|
||||
}
|
||||
}
|
||||
|
||||
WidgetTextEvent textEvent(true, NS_COMPOSITION_CHANGE, mLastFocusedWindow);
|
||||
WidgetCompositionEvent textEvent(true, NS_COMPOSITION_CHANGE,
|
||||
mLastFocusedWindow);
|
||||
InitEvent(textEvent);
|
||||
|
||||
uint32_t targetOffset = mCompositionStart;
|
||||
|
@ -3046,7 +3046,7 @@ nsWindow::OnKeyPressEvent(GdkEventKey *aEvent)
|
||||
DispatchEvent(&event, status);
|
||||
}
|
||||
else {
|
||||
WidgetTextEvent textEvent(true, NS_COMPOSITION_CHANGE, this);
|
||||
WidgetCompositionEvent textEvent(true, NS_COMPOSITION_CHANGE, this);
|
||||
char16_t textString[3];
|
||||
textString[0] = H_SURROGATE(event.charCode);
|
||||
textString[1] = L_SURROGATE(event.charCode);
|
||||
|
@ -1591,7 +1591,7 @@ nsIMM32Handler::DispatchTextEvent(nsWindow* aWindow,
|
||||
|
||||
nsIntPoint point(0, 0);
|
||||
|
||||
WidgetTextEvent event(true, NS_COMPOSITION_CHANGE, aWindow);
|
||||
WidgetCompositionEvent event(true, NS_COMPOSITION_CHANGE, aWindow);
|
||||
|
||||
aWindow->InitEvent(event, &point);
|
||||
|
||||
|
@ -1650,7 +1650,7 @@ nsTextStore::FlushPendingActions()
|
||||
PR_LOG(sTextStoreLog, PR_LOG_DEBUG,
|
||||
("TSF: 0x%p nsTextStore::FlushPendingActions(), "
|
||||
"dispatching compositionchange event...", this));
|
||||
WidgetTextEvent textEvent(true, NS_COMPOSITION_CHANGE, mWidget);
|
||||
WidgetCompositionEvent textEvent(true, NS_COMPOSITION_CHANGE, mWidget);
|
||||
mWidget->InitEvent(textEvent);
|
||||
textEvent.mData = action.mData;
|
||||
if (action.mRanges->IsEmpty()) {
|
||||
@ -1677,7 +1677,7 @@ nsTextStore::FlushPendingActions()
|
||||
PR_LOG(sTextStoreLog, PR_LOG_DEBUG,
|
||||
("TSF: 0x%p nsTextStore::FlushPendingActions(), "
|
||||
"dispatching compositionchange event...", this));
|
||||
WidgetTextEvent textEvent(true, NS_COMPOSITION_CHANGE, mWidget);
|
||||
WidgetCompositionEvent textEvent(true, NS_COMPOSITION_CHANGE, mWidget);
|
||||
mWidget->InitEvent(textEvent);
|
||||
textEvent.mData = action.mData;
|
||||
mWidget->DispatchWindowEvent(&textEvent);
|
||||
|
@ -382,7 +382,7 @@ PuppetWidget::IMEEndComposition(bool aCancel)
|
||||
#endif
|
||||
|
||||
nsEventStatus status;
|
||||
WidgetTextEvent textEvent(true, NS_COMPOSITION_CHANGE, this);
|
||||
WidgetCompositionEvent textEvent(true, NS_COMPOSITION_CHANGE, this);
|
||||
InitEvent(textEvent, nullptr);
|
||||
textEvent.mSeqno = mIMELastReceivedSeqno;
|
||||
// SendEndIMEComposition is always called since ResetInputState
|
||||
|
Loading…
Reference in New Issue
Block a user