summaryrefslogtreecommitdiffstats
path: root/editor/libeditor/TextEditor.cpp
diff options
context:
space:
mode:
authorwolfbeast <mcwerewolf@gmail.com>2018-07-18 08:24:24 +0200
committerwolfbeast <mcwerewolf@gmail.com>2018-07-18 08:24:24 +0200
commitfc61780b35af913801d72086456f493f63197da6 (patch)
treef85891288a7bd988da9f0f15ae64e5c63f00d493 /editor/libeditor/TextEditor.cpp
parent69f7f9e5f1475891ce11cc4f431692f965b0cd30 (diff)
parent50d3e596bbe89c95615f96eb71f6bc5be737a1db (diff)
downloadUXP-9ccb235f04529c1ec345d87dad6521cb567d20bb.tar
UXP-9ccb235f04529c1ec345d87dad6521cb567d20bb.tar.gz
UXP-9ccb235f04529c1ec345d87dad6521cb567d20bb.tar.lz
UXP-9ccb235f04529c1ec345d87dad6521cb567d20bb.tar.xz
UXP-9ccb235f04529c1ec345d87dad6521cb567d20bb.zip
Merge commit '50d3e596bbe89c95615f96eb71f6bc5be737a1db' into Basilisk-releasev2018.07.18
# Conflicts: # browser/app/profile/firefox.js # browser/components/preferences/jar.mn
Diffstat (limited to 'editor/libeditor/TextEditor.cpp')
-rw-r--r--editor/libeditor/TextEditor.cpp24
1 files changed, 13 insertions, 11 deletions
diff --git a/editor/libeditor/TextEditor.cpp b/editor/libeditor/TextEditor.cpp
index 8fe824e11..1e855d769 100644
--- a/editor/libeditor/TextEditor.cpp
+++ b/editor/libeditor/TextEditor.cpp
@@ -834,17 +834,19 @@ TextEditor::BeginIMEComposition(WidgetCompositionEvent* aEvent)
}
nsresult
-TextEditor::UpdateIMEComposition(nsIDOMEvent* aDOMTextEvent)
+TextEditor::UpdateIMEComposition(WidgetCompositionEvent* aCompositionChangeEvent)
{
- MOZ_ASSERT(aDOMTextEvent, "aDOMTextEvent must not be nullptr");
+ MOZ_ASSERT(aCompositionChangeEvent,
+ "aCompositionChangeEvent must not be nullptr");
- WidgetCompositionEvent* compositionChangeEvent =
- aDOMTextEvent->WidgetEventPtr()->AsCompositionEvent();
- NS_ENSURE_TRUE(compositionChangeEvent, NS_ERROR_INVALID_ARG);
- MOZ_ASSERT(compositionChangeEvent->mMessage == eCompositionChange,
- "The internal event should be eCompositionChange");
+ if (NS_WARN_IF(!aCompositionChangeEvent)) {
+ return NS_ERROR_INVALID_ARG;
+ }
+
+ MOZ_ASSERT(aCompositionChangeEvent->mMessage == eCompositionChange,
+ "The event should be eCompositionChange");
- if (!EnsureComposition(compositionChangeEvent)) {
+ if (!EnsureComposition(aCompositionChangeEvent)) {
return NS_OK;
}
@@ -865,7 +867,7 @@ TextEditor::UpdateIMEComposition(nsIDOMEvent* aDOMTextEvent)
MOZ_ASSERT(!mPlaceHolderBatch,
"UpdateIMEComposition() must be called without place holder batch");
TextComposition::CompositionChangeEventHandlingMarker
- compositionChangeEventHandlingMarker(mComposition, compositionChangeEvent);
+ compositionChangeEventHandlingMarker(mComposition, aCompositionChangeEvent);
NotifyEditorObservers(eNotifyEditorObserversOfBefore);
@@ -875,7 +877,7 @@ TextEditor::UpdateIMEComposition(nsIDOMEvent* aDOMTextEvent)
{
AutoPlaceHolderBatch batch(this, nsGkAtoms::IMETxnName);
- rv = InsertText(compositionChangeEvent->mData);
+ rv = InsertText(aCompositionChangeEvent->mData);
if (caretP) {
caretP->SetSelection(selection);
@@ -887,7 +889,7 @@ TextEditor::UpdateIMEComposition(nsIDOMEvent* aDOMTextEvent)
// compositionend event, we don't need to notify editor observes of this
// change.
// NOTE: We must notify after the auto batch will be gone.
- if (!compositionChangeEvent->IsFollowedByCompositionEnd()) {
+ if (!aCompositionChangeEvent->IsFollowedByCompositionEnd()) {
NotifyEditorObservers(eNotifyEditorObserversOfEnd);
}