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
parent 9d03234368
commit 7de92c1f87

View File

@ -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();