Bug 455871 - [mac] Regression: drag & drop is not working at all after some-time of browser usage; fix, v2 + colorpicker test update; r+sr=roc

This commit is contained in:
Honza Bambas 2008-10-28 05:44:29 +01:00
parent 19179e88b6
commit 7f2567b670
3 changed files with 13 additions and 1 deletions

View File

@ -24,12 +24,18 @@ var gCp = null;
SimpleTest.waitForExplicitFinish();
function preventDefault(event) {
event.preventDefault();
}
function runTests()
{
gCp = document.getElementById("colorpicker-popup");
is(gCp.color, "#FF0000", "popup color is initialized");
is(gCp.tabIndex, 1, "button tabindex is initialized");
is(gCp.disabled, false, "button is not disabled");
document.addEventListener("keypress", preventDefault, false);
goNext();
}
@ -97,6 +103,7 @@ function goNext()
{
gTestPhase++;
if (gTestPhase >= phases.length) {
document.removeEventListener("keypress", preventDefault, false);
SimpleTest.finish();
return;
}

View File

@ -1284,7 +1284,9 @@ NS_IMETHODIMP nsViewManager::DispatchEvent(nsGUIEvent *aEvent, nsEventStatus *aS
if ((aEvent->message == NS_MOUSE_MOVE &&
static_cast<nsMouseEvent*>(aEvent)->reason ==
nsMouseEvent::eReal) ||
aEvent->message == NS_MOUSE_ENTER) {
aEvent->message == NS_MOUSE_ENTER ||
aEvent->message == NS_MOUSE_BUTTON_DOWN ||
aEvent->message == NS_MOUSE_BUTTON_UP) {
// aEvent->point is relative to the widget, i.e. the view top-left,
// so we need to add the offset to the view origin
nsPoint rootOffset = baseView->GetDimensions().TopLeft();

View File

@ -312,6 +312,9 @@ nsDragService::InvokeDragSession(nsIDOMNode* aDOMNode, nsISupportsArray* aTransf
source:mNativeDragView
slideBack:YES];
if (mDoingDrag)
nsBaseDragService::EndDragSession(PR_FALSE);
return NS_OK;
NS_OBJC_END_TRY_ABORT_BLOCK_NSRESULT;