Bug 1240286 - Deleting text with backspace causes the action bar to glitch, r=smaug, TYLin, jchen

This commit is contained in:
Mark Capella 2016-01-30 00:08:55 -05:00
parent 52ca557cf0
commit 41443fd558
2 changed files with 6 additions and 10 deletions

View File

@ -116,17 +116,10 @@ AccessibleCaretManager::OnSelectionChanged(nsIDOMDocument* aDoc,
}
// eSetSelection events from the Fennec widget IME can be generated
// by autoSuggest, autoCorrect, and nsCaret position changes.
// by autoSuggest / autoCorrect composition changes, or by TYPE_REPLACE_TEXT
// actions, either positioning cursor for text insert, or selecting
// text-to-be-replaced. None should affect AccessibleCaret visibility.
if (aReason & nsISelectionListener::IME_REASON) {
if (GetCaretMode() == CaretMode::Cursor) {
// Caret position changes need us to open/update,
// or hide the AccessibleCaret.
FlushLayout();
UpdateCarets();
} else {
// Ignore transient autoSuggest selection styling,
// or autoCorrect text updates.
}
return NS_OK;
}

View File

@ -2919,11 +2919,14 @@ nsWindow::GeckoViewSupport::OnImeReplaceText(int32_t aStart, int32_t aEnd,
window.RemoveIMEComposition();
{
// Use text selection to set target postion(s) for
// insert, or replace, of text.
WidgetSelectionEvent event(true, eSetSelection, &window);
window.InitEvent(event, nullptr);
event.mOffset = uint32_t(aStart);
event.mLength = uint32_t(aEnd - aStart);
event.mExpandToClusterBoundary = false;
event.mReason = nsISelectionListener::IME_REASON;
window.DispatchEvent(&event);
}