mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-10 20:05:49 +00:00
fix for bug 17381 where leaving the frame before a drag gesture was began caused the event target to be set incorrectly. (r=saari).
This commit is contained in:
parent
4a6bd615ff
commit
b235ede1ff
@ -2516,13 +2516,18 @@ nsXULElement::HandleDOMEvent(nsIPresContext& aPresContext,
|
||||
// In order for the event to have a proper target for events that don't go through
|
||||
// the presshell (onselect, oncommand, oncreate, ondestroy) we need to set our target
|
||||
// ourselves. Also, key sets and menus don't have frames and therefore need their
|
||||
// targets explicitly specified.
|
||||
// targets explicitly specified.
|
||||
//
|
||||
// We need this for drag&drop as well since the mouse may have moved into a different
|
||||
// frame between the initial mouseDown and the generation of the drag gesture.
|
||||
// Obviously, the target should be the content/frame where the mouse was depressed,
|
||||
// not one computed by the current mouse location.
|
||||
nsAutoString tagName;
|
||||
GetTagName(tagName);
|
||||
if (aEvent->message == NS_MENU_ACTION || aEvent->message == NS_MENU_CREATE ||
|
||||
aEvent->message == NS_MENU_DESTROY || aEvent->message == NS_FORM_SELECTED ||
|
||||
aEvent->message == NS_XUL_BROADCAST || aEvent->message == NS_XUL_COMMAND_UPDATE ||
|
||||
aEvent->message == NS_DRAGDROP_ENTER || aEvent->message == NS_DRAGDROP_EXIT ||
|
||||
aEvent->message == NS_DRAGDROP_GESTURE ||
|
||||
tagName == "menu" || tagName == "menuitem" ||
|
||||
tagName == "menubar" || tagName == "key" || tagName == "keyset") {
|
||||
nsCOMPtr<nsIEventListenerManager> listenerManager;
|
||||
|
@ -2516,13 +2516,18 @@ nsXULElement::HandleDOMEvent(nsIPresContext& aPresContext,
|
||||
// In order for the event to have a proper target for events that don't go through
|
||||
// the presshell (onselect, oncommand, oncreate, ondestroy) we need to set our target
|
||||
// ourselves. Also, key sets and menus don't have frames and therefore need their
|
||||
// targets explicitly specified.
|
||||
// targets explicitly specified.
|
||||
//
|
||||
// We need this for drag&drop as well since the mouse may have moved into a different
|
||||
// frame between the initial mouseDown and the generation of the drag gesture.
|
||||
// Obviously, the target should be the content/frame where the mouse was depressed,
|
||||
// not one computed by the current mouse location.
|
||||
nsAutoString tagName;
|
||||
GetTagName(tagName);
|
||||
if (aEvent->message == NS_MENU_ACTION || aEvent->message == NS_MENU_CREATE ||
|
||||
aEvent->message == NS_MENU_DESTROY || aEvent->message == NS_FORM_SELECTED ||
|
||||
aEvent->message == NS_XUL_BROADCAST || aEvent->message == NS_XUL_COMMAND_UPDATE ||
|
||||
aEvent->message == NS_DRAGDROP_ENTER || aEvent->message == NS_DRAGDROP_EXIT ||
|
||||
aEvent->message == NS_DRAGDROP_GESTURE ||
|
||||
tagName == "menu" || tagName == "menuitem" ||
|
||||
tagName == "menubar" || tagName == "key" || tagName == "keyset") {
|
||||
nsCOMPtr<nsIEventListenerManager> listenerManager;
|
||||
|
Loading…
Reference in New Issue
Block a user