port changes from tenfourfox:

- #584: M1507180 M1598605 (7b58ac561)
- fix M1607443 as a precaution (b8657e696)
- #587: M1513855 M1596668 M1602944 M1599420 M1595399 (35a4358b3)
This commit is contained in:
2020-01-29 11:08:34 +08:00
parent a85a1fd22b
commit a61b8c3d3f
11 changed files with 31 additions and 17 deletions
+6 -2
View File
@@ -53,7 +53,8 @@ nsBaseDragService::nsBaseDragService()
mHasImage(false), mUserCancelled(false),
mDragAction(DRAGDROP_ACTION_NONE), mTargetSize(0,0),
mImageX(0), mImageY(0), mScreenX(-1), mScreenY(-1), mSuppressLevel(0),
mInputSource(nsIDOMMouseEvent::MOZ_SOURCE_MOUSE)
mInputSource(nsIDOMMouseEvent::MOZ_SOURCE_MOUSE),
mEndingSession(false)
{
}
@@ -332,10 +333,12 @@ nsBaseDragService::OpenDragPopup()
NS_IMETHODIMP
nsBaseDragService::EndDragSession(bool aDoneDrag)
{
if (!mDoingDrag) {
if (!mDoingDrag || mEndingSession) {
return NS_ERROR_FAILURE;
}
mEndingSession = true;
if (aDoneDrag && !mSuppressLevel)
FireDragEventAtSource(NS_DRAGDROP_END);
@@ -347,6 +350,7 @@ nsBaseDragService::EndDragSession(bool aDoneDrag)
}
mDoingDrag = false;
mEndingSession = false;
// release the source we've been holding on to.
mSourceDocument = nullptr;