Bug 1357642 TextEditor::UpdateIMEComposition() shouldn't call NotifyEditorObservers(eNotifyEditorObserversOfBefore) by itself r?m_kato
TextEditor::UpdateIMEComposition() uses AutoPlaceHolderBatch class which calls NotifyEditorObservers(eNotifyEditorObserversOfBefore) automatically when it's created. Therefore, it causes calling NotifyEditorObservers(eNotifyEditorObserversOfBefore) twice from TextEditor::UpdateIMEComposition().
MozReview-Commit-ID: DJqzmCtyHCf
--- a/editor/libeditor/TextEditor.cpp
+++ b/editor/libeditor/TextEditor.cpp
@@ -872,24 +872,24 @@ TextEditor::UpdateIMEComposition(WidgetC
// of NotifiyEditorObservers(eNotifyEditorObserversOfEnd) or
// NotifiyEditorObservers(eNotifyEditorObserversOfCancel) which notifies
// TextComposition of a selection change.
MOZ_ASSERT(!mPlaceholderBatch,
"UpdateIMEComposition() must be called without place holder batch");
TextComposition::CompositionChangeEventHandlingMarker
compositionChangeEventHandlingMarker(mComposition, aCompsitionChangeEvent);
- NotifyEditorObservers(eNotifyEditorObserversOfBefore);
-
RefPtr<nsCaret> caretP = ps->GetCaret();
nsresult rv;
{
AutoPlaceHolderBatch batch(this, nsGkAtoms::IMETxnName);
+ MOZ_ASSERT(mIsInEditAction,
+ "AutoPlaceHolderBatch should've notified the observes of before-edit");
rv = InsertText(aCompsitionChangeEvent->mData);
if (caretP) {
caretP->SetSelection(selection);
}
}
// If still composing, we should fire input event via observer.