Bug 895274 part.194 Rename NS_COMPOSITION_COMMIT to eCompositionCommit r=smaug

This commit is contained in:
Masayuki Nakano 2015-09-11 21:21:27 +09:00
parent 3974e0e4ac
commit 5193247ef9
13 changed files with 26 additions and 27 deletions

View File

@ -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:

View File

@ -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;

View File

@ -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:

View File

@ -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.

View File

@ -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.

View File

@ -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);

View File

@ -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;
}
};

View File

@ -141,7 +141,7 @@ WidgetEvent::HasIMEEventMessage() const
case eCompositionUpdate:
case eCompositionChange:
case eCompositionCommitAsIs:
case NS_COMPOSITION_COMMIT:
case eCompositionCommit:
return true;
default:
return false;

View File

@ -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

View File

@ -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) {

View File

@ -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;
}

View File

@ -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);

View File

@ -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.