Bug 1067243 - Refine the selection reason matching logic to toggle the visibility of selection carets. r=roc

This commit is contained in:
pchang 2014-09-26 15:14:35 +08:00
Родитель 51b2436fc1
Коммит 120fb11ce3
1 изменённых файлов: 4 добавлений и 2 удалений

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

@ -856,7 +856,9 @@ SelectionCarets::NotifySelectionChanged(nsIDOMDocument* aDoc,
SetVisibility(false);
return NS_OK;
}
if (aReason & nsISelectionListener::KEYPRESS_REASON) {
if (!aReason || (aReason & (nsISelectionListener::DRAG_REASON |
nsISelectionListener::KEYPRESS_REASON |
nsISelectionListener::MOUSEDOWN_REASON))) {
SetVisibility(false);
} else {
UpdateSelectionCarets();
@ -905,7 +907,7 @@ SelectionCarets::AsyncPanZoomStopped(const mozilla::CSSIntPoint aScrollPos)
void
SelectionCarets::ScrollPositionChanged()
{
if (!mAPZenabled) {
if (!mAPZenabled && mVisible) {
SetVisibility(false);
//TODO: handling scrolling for selection bubble when APZ is off
LaunchScrollEndDetector();