mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 895274 part.194 Rename NS_COMPOSITION_COMMIT to eCompositionCommit r=smaug
This commit is contained in:
parent
4c0bc5fc89
commit
bd1e0cfe88
@ -147,8 +147,8 @@ GetEventMessageName(EventMessage aMessage)
|
||||
return "eCompositionChange";
|
||||
case eCompositionCommitAsIs:
|
||||
return "eCompositionCommitAsIs";
|
||||
case NS_COMPOSITION_COMMIT:
|
||||
return "NS_COMPOSITION_COMMIT";
|
||||
case eCompositionCommit:
|
||||
return "eCompositionCommit";
|
||||
case eSetSelection:
|
||||
return "eSetSelection";
|
||||
default:
|
||||
|
@ -248,9 +248,9 @@ TextComposition::DispatchCompositionEvent(
|
||||
} else {
|
||||
aCompositionEvent->mData = mLastData;
|
||||
}
|
||||
} else if (aCompositionEvent->mMessage == NS_COMPOSITION_COMMIT) {
|
||||
} else if (aCompositionEvent->mMessage == eCompositionCommit) {
|
||||
NS_ASSERTION(!aCompositionEvent->mRanges,
|
||||
"mRanges of NS_COMPOSITION_COMMIT should be null");
|
||||
"mRanges of eCompositionCommit should be null");
|
||||
aCompositionEvent->mRanges = nullptr;
|
||||
}
|
||||
|
||||
@ -287,7 +287,7 @@ TextComposition::DispatchCompositionEvent(
|
||||
case eCompositionEnd:
|
||||
case eCompositionChange:
|
||||
case eCompositionCommitAsIs:
|
||||
case NS_COMPOSITION_COMMIT:
|
||||
case eCompositionCommit:
|
||||
committingData = &aCompositionEvent->mData;
|
||||
break;
|
||||
default:
|
||||
@ -493,7 +493,7 @@ TextComposition::RequestToCommit(nsIWidget* aWidget, bool aDiscard)
|
||||
DispatchCompositionEventRunnable(eCompositionCommitAsIs, EmptyString(),
|
||||
true);
|
||||
} else {
|
||||
DispatchCompositionEventRunnable(NS_COMPOSITION_COMMIT, data, true);
|
||||
DispatchCompositionEventRunnable(eCompositionCommit, data, true);
|
||||
}
|
||||
return NS_OK;
|
||||
}
|
||||
@ -627,7 +627,7 @@ TextComposition::CompositionEventDispatcher::Run()
|
||||
}
|
||||
case eCompositionChange:
|
||||
case eCompositionCommitAsIs:
|
||||
case NS_COMPOSITION_COMMIT: {
|
||||
case eCompositionCommit: {
|
||||
WidgetCompositionEvent compEvent(true, mEventMessage, widget);
|
||||
if (mEventMessage != eCompositionCommitAsIs) {
|
||||
compEvent.mData = mData;
|
||||
|
@ -37,8 +37,8 @@ GetEventMessageName(EventMessage aMessage)
|
||||
return "eCompositionChange";
|
||||
case eCompositionCommitAsIs:
|
||||
return "eCompositionCommitAsIs";
|
||||
case NS_COMPOSITION_COMMIT:
|
||||
return "NS_COMPOSITION_COMMIT";
|
||||
case eCompositionCommit:
|
||||
return "eCompositionCommit";
|
||||
case eSetSelection:
|
||||
return "eSetSelection";
|
||||
default:
|
||||
|
@ -148,7 +148,7 @@ NS_EVENT_MESSAGE(eUnidentifiedEvent, 2000)
|
||||
NS_EVENT_MESSAGE(eCompositionEventFirst, 2200)
|
||||
NS_EVENT_MESSAGE(eCompositionStart, eCompositionEventFirst)
|
||||
// eCompositionEnd is the message for DOM compositionend event.
|
||||
// This event should NOT be dispatched from widget if NS_COMPOSITION_COMMIT
|
||||
// This event should NOT be dispatched from widget if eCompositionCommit
|
||||
// is available.
|
||||
NS_EVENT_MESSAGE(eCompositionEnd, eCompositionEventFirst + 1)
|
||||
// eCompositionUpdate is the message for DOM compositionupdate event.
|
||||
@ -168,12 +168,12 @@ NS_EVENT_MESSAGE(eCompositionChange, eCompositionEventFirst + 3)
|
||||
// eCompositionEnd will be dispatched automatically.
|
||||
// Its mData and mRanges should be empty and nullptr.
|
||||
NS_EVENT_MESSAGE(eCompositionCommitAsIs, eCompositionEventFirst + 4)
|
||||
// NS_COMPOSITION_COMMIT is the message for representing a commit of
|
||||
// eCompositionCommit is the message for representing a commit of
|
||||
// composition string with its mData value. TextComposition will dispatch this
|
||||
// event to the DOM tree as eCompositionChange without clause information.
|
||||
// After that, eCompositionEnd will be dispatched automatically.
|
||||
// Its mRanges should be nullptr.
|
||||
NS_EVENT_MESSAGE(NS_COMPOSITION_COMMIT, eCompositionEventFirst + 5)
|
||||
NS_EVENT_MESSAGE(eCompositionCommit, eCompositionEventFirst + 5)
|
||||
|
||||
// Following events are defined for deprecated DOM events which are using
|
||||
// InternalUIEvent class.
|
||||
|
@ -575,8 +575,7 @@ PuppetWidget::IMEEndComposition(bool aCancel)
|
||||
|
||||
nsEventStatus status;
|
||||
bool noCompositionEvent = true;
|
||||
WidgetCompositionEvent compositionCommitEvent(true, NS_COMPOSITION_COMMIT,
|
||||
this);
|
||||
WidgetCompositionEvent compositionCommitEvent(true, eCompositionCommit, this);
|
||||
InitEvent(compositionCommitEvent, nullptr);
|
||||
// SendEndIMEComposition is always called since ResetInputState
|
||||
// should always be called even if we aren't composing something.
|
||||
|
@ -268,11 +268,11 @@ TextEventDispatcher::CommitComposition(nsEventStatus& aStatus,
|
||||
// End current composition and make this free for other IMEs.
|
||||
mIsComposing = false;
|
||||
|
||||
EventMessage message = aCommitString ? NS_COMPOSITION_COMMIT :
|
||||
EventMessage message = aCommitString ? eCompositionCommit :
|
||||
eCompositionCommitAsIs;
|
||||
WidgetCompositionEvent compositionCommitEvent(true, message, widget);
|
||||
InitEvent(compositionCommitEvent);
|
||||
if (message == NS_COMPOSITION_COMMIT) {
|
||||
if (message == eCompositionCommit) {
|
||||
compositionCommitEvent.mData = *aCommitString;
|
||||
}
|
||||
rv = DispatchEvent(widget, compositionCommitEvent, aStatus);
|
||||
|
@ -435,20 +435,20 @@ public:
|
||||
bool CausesDOMTextEvent() const
|
||||
{
|
||||
return mMessage == eCompositionChange ||
|
||||
mMessage == NS_COMPOSITION_COMMIT ||
|
||||
mMessage == eCompositionCommit ||
|
||||
mMessage == eCompositionCommitAsIs;
|
||||
}
|
||||
|
||||
bool CausesDOMCompositionEndEvent() const
|
||||
{
|
||||
return mMessage == eCompositionEnd ||
|
||||
mMessage == NS_COMPOSITION_COMMIT ||
|
||||
mMessage == eCompositionCommit ||
|
||||
mMessage == eCompositionCommitAsIs;
|
||||
}
|
||||
|
||||
bool IsFollowedByCompositionEnd() const
|
||||
{
|
||||
return mOriginalMessage == NS_COMPOSITION_COMMIT ||
|
||||
return mOriginalMessage == eCompositionCommit ||
|
||||
mOriginalMessage == eCompositionCommitAsIs;
|
||||
}
|
||||
};
|
||||
|
@ -141,7 +141,7 @@ WidgetEvent::HasIMEEventMessage() const
|
||||
case eCompositionUpdate:
|
||||
case eCompositionChange:
|
||||
case eCompositionCommitAsIs:
|
||||
case NS_COMPOSITION_COMMIT:
|
||||
case eCompositionCommit:
|
||||
return true;
|
||||
default:
|
||||
return false;
|
||||
|
@ -2053,7 +2053,7 @@ nsWindow::NotifyIMEInternal(const IMENotification& aIMENotification)
|
||||
nsRefPtr<nsWindow> kungFuDeathGrip(this);
|
||||
|
||||
WidgetCompositionEvent compositionCommitEvent(
|
||||
true, NS_COMPOSITION_COMMIT, this);
|
||||
true, eCompositionCommit, this);
|
||||
InitEvent(compositionCommitEvent, nullptr);
|
||||
// Dispatch it with empty mData value for canceling the
|
||||
// composition
|
||||
|
@ -2740,7 +2740,7 @@ IMEInputHandler::DispatchCompositionCommitEvent(const nsAString* aCommitString)
|
||||
nsRefPtr<IMEInputHandler> kungFuDeathGrip(this);
|
||||
|
||||
EventMessage message =
|
||||
aCommitString ? NS_COMPOSITION_COMMIT : eCompositionCommitAsIs;
|
||||
aCommitString ? eCompositionCommit : eCompositionCommitAsIs;
|
||||
WidgetCompositionEvent compositionCommitEvent(true, message, mWidget);
|
||||
compositionCommitEvent.time = PR_IntervalNow();
|
||||
if (aCommitString) {
|
||||
|
@ -1439,7 +1439,7 @@ IMContextWrapper::DispatchCompositionCommitEvent(
|
||||
|
||||
nsRefPtr<nsWindow> lastFocusedWindow(mLastFocusedWindow);
|
||||
|
||||
EventMessage message = aCommitString ? NS_COMPOSITION_COMMIT :
|
||||
EventMessage message = aCommitString ? eCompositionCommit :
|
||||
eCompositionCommitAsIs;
|
||||
mCompositionState = eCompositionState_NotComposing;
|
||||
mCompositionStart = UINT32_MAX;
|
||||
@ -1449,7 +1449,7 @@ IMContextWrapper::DispatchCompositionCommitEvent(
|
||||
WidgetCompositionEvent compositionCommitEvent(true, message,
|
||||
mLastFocusedWindow);
|
||||
InitEvent(compositionCommitEvent);
|
||||
if (message == NS_COMPOSITION_COMMIT) {
|
||||
if (message == eCompositionCommit) {
|
||||
compositionCommitEvent.mData = *aCommitString;
|
||||
}
|
||||
|
||||
|
@ -1525,7 +1525,7 @@ IMMHandler::HandleEndComposition(nsWindow* aWindow,
|
||||
}
|
||||
|
||||
EventMessage message =
|
||||
aCommitString ? NS_COMPOSITION_COMMIT : eCompositionCommitAsIs;
|
||||
aCommitString ? eCompositionCommit : eCompositionCommitAsIs;
|
||||
WidgetCompositionEvent compositionCommitEvent(true, message, aWindow);
|
||||
nsIntPoint point(0, 0);
|
||||
aWindow->InitEvent(compositionCommitEvent, &point);
|
||||
|
@ -1798,11 +1798,11 @@ TSFTextStore::FlushPendingActions()
|
||||
MOZ_LOG(sTextStoreLog, LogLevel::Debug,
|
||||
("TSF: 0x%p TSFTextStore::FlushPendingActions(), "
|
||||
"dispatching compositioncommit event...", this));
|
||||
WidgetCompositionEvent compositionCommit(true, NS_COMPOSITION_COMMIT,
|
||||
WidgetCompositionEvent compositionCommit(true, eCompositionCommit,
|
||||
mWidget);
|
||||
mWidget->InitEvent(compositionCommit);
|
||||
compositionCommit.mData = action.mData;
|
||||
// When the NS_COMPOSITION_COMMIT causes a DOM text event,
|
||||
// When the eCompositionCommit causes a DOM text event,
|
||||
// the IME will be notified of NOTIFY_IME_OF_COMPOSITION_UPDATE. In
|
||||
// such case, we should not clear the locked content until we notify
|
||||
// the IME of the composition update.
|
||||
|
Loading…
Reference in New Issue
Block a user