mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 336160 - Crash when releasing mouse while dragging absolute positioned element in designMode [@ nsHTMLEditor::MouseUp], r=glazman, sr=peterv
This commit is contained in:
parent
19e2e52116
commit
ed8942f481
@ -443,14 +443,19 @@ nsHTMLEditor::EndMoving()
|
||||
}
|
||||
mMouseMotionListenerP = nsnull;
|
||||
|
||||
return NS_OK;
|
||||
mGrabberClicked = PR_FALSE;
|
||||
mIsMoving = PR_FALSE;
|
||||
nsCOMPtr<nsISelection> selection;
|
||||
GetSelection(getter_AddRefs(selection));
|
||||
if (!selection) {
|
||||
return NS_ERROR_NOT_INITIALIZED;
|
||||
}
|
||||
return CheckSelectionStateForAnonymousButtons(selection);
|
||||
}
|
||||
nsresult
|
||||
nsHTMLEditor::SetFinalPosition(PRInt32 aX, PRInt32 aY)
|
||||
{
|
||||
nsresult res = EndMoving();
|
||||
mGrabberClicked = PR_FALSE;
|
||||
mIsMoving = PR_FALSE;
|
||||
if (NS_FAILED(res)) return res;
|
||||
|
||||
// we have now to set the new width and height of the resized object
|
||||
|
@ -227,6 +227,11 @@ nsHTMLEditor::CheckSelectionStateForAnonymousButtons(nsISelection * aSelection)
|
||||
!mIsInlineTableEditingEnabled)
|
||||
return NS_OK;
|
||||
|
||||
// Don't change selection state if we're moving.
|
||||
if (mIsMoving) {
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
nsCOMPtr<nsIDOMElement> focusElement;
|
||||
// let's get the containing element of the selection
|
||||
nsresult res = GetSelectionContainer(getter_AddRefs(focusElement));
|
||||
|
@ -672,8 +672,6 @@ nsHTMLEditor::MouseUp(PRInt32 aClientX, PRInt32 aClientY,
|
||||
}
|
||||
if (mGrabberClicked) {
|
||||
EndMoving();
|
||||
mGrabberClicked = PR_FALSE;
|
||||
mIsMoving = PR_FALSE;
|
||||
}
|
||||
}
|
||||
return NS_OK;
|
||||
|
Loading…
Reference in New Issue
Block a user