Bug 1109800 - Call CancelLongTapDetector when Selection carets are blurred. r=roc

This commit is contained in:
Morris Tseng 2014-12-18 22:50:00 +01:00
Родитель cab58b9fec
Коммит 0b3d49e12b
2 изменённых файлов: 8 добавлений и 6 удалений

Просмотреть файл

@ -1614,11 +1614,6 @@ nsFocusManager::Blur(nsPIDOMWindow* aWindowToClear,
return true;
}
nsRefPtr<SelectionCarets> selectionCarets = presShell->GetSelectionCarets();
if (selectionCarets) {
selectionCarets->NotifyBlur();
}
bool clearFirstBlurEvent = false;
if (!mFirstBlurEvent) {
mFirstBlurEvent = content;
@ -1688,8 +1683,14 @@ nsFocusManager::Blur(nsPIDOMWindow* aWindowToClear,
// if we are leaving the document or the window was lowered, make the caret
// invisible.
if (aIsLeavingDocument || !mActiveWindow)
if (aIsLeavingDocument || !mActiveWindow) {
SetCaretVisible(presShell, false, nullptr);
nsRefPtr<SelectionCarets> selectionCarets = presShell->GetSelectionCarets();
if (selectionCarets) {
selectionCarets->NotifyBlur();
}
}
// at this point, it is expected that this window will be still be
// focused, but the focused content will be null, as it was cleared before

Просмотреть файл

@ -1086,6 +1086,7 @@ void
SelectionCarets::NotifyBlur()
{
SetVisibility(false);
CancelLongTapDetector();
DispatchSelectionStateChangedEvent(nullptr, SelectionState::Blur);
}