Bug 1059165 - Part 1 - Always sync visibility for touch caret. r=ehsan

We should sync touch caret's visibility with caret every time since
touch caret might be hidden due to timeout while caret is enabled. Also
remove dead code.
This commit is contained in:
Ting-Yu Lin 2014-10-28 06:01:00 +01:00
Родитель 5e93e0f48a
Коммит 785ffc0d50
1 изменённых файлов: 7 добавлений и 10 удалений

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

@ -2224,20 +2224,17 @@ NS_IMETHODIMP PresShell::SetCaretEnabled(bool aInEnable)
if (mCaretEnabled != oldEnabled)
{
/* Don't change the caret's selection here! This was an evil side-effect of SetCaretEnabled()
nsCOMPtr<nsIDOMSelection> domSel;
if (NS_SUCCEEDED(GetSelection(nsISelectionController::SELECTION_NORMAL, getter_AddRefs(domSel))) && domSel)
mCaret->SetCaretDOMSelection(domSel);
*/
MOZ_ASSERT(mCaret || mTouchCaret);
MOZ_ASSERT(mCaret);
if (mCaret) {
mCaret->SetVisible(mCaretEnabled);
}
}
// We should sync touch caret's visibility with caret every time since touch
// caret might be hidden due to timeout while caret is enabled.
if (mTouchCaret) {
mTouchCaret->SyncVisibilityWithCaret();
}
}
return NS_OK;
}