Bug 910978 part.14 Implement nsUIEvent::AssignUIEventData() r=smaug

This commit is contained in:
Masayuki Nakano 2013-09-03 20:45:29 +09:00
parent 92eeafbf0c
commit 28c40b5168
3 changed files with 20 additions and 2 deletions

View File

@ -675,7 +675,7 @@ nsDOMEvent::DuplicatePrivateData()
{
nsUIEvent* oldUIEvent = static_cast<nsUIEvent*>(mEvent);
nsUIEvent* uiEvent = new nsUIEvent(false, msg, oldUIEvent->detail);
uiEvent->AssignEventData(*oldUIEvent, true);
uiEvent->AssignUIEventData(*oldUIEvent, true);
newEvent = uiEvent;
break;
}
@ -693,7 +693,7 @@ nsDOMEvent::DuplicatePrivateData()
nsUIEvent* oldUIEvent = static_cast<nsUIEvent*>(mEvent);
nsUIEvent* uiEvent = new nsUIEvent(false, msg, 0);
uiEvent->eventStructType = NS_SMIL_TIME_EVENT;
uiEvent->AssignGUIEventData(*oldUIEvent, true);
uiEvent->AssignUIEventData(*oldUIEvent, true);
newEvent = uiEvent;
break;
}

View File

@ -1883,6 +1883,13 @@ public:
}
int32_t detail;
void AssignUIEventData(const nsUIEvent& aEvent, bool aCopyTargets)
{
AssignGUIEventData(aEvent, aCopyTargets);
// detail must have been initialized with the constructor.
}
};
class nsFocusEvent : public nsUIEvent

View File

@ -404,6 +404,17 @@ const kTests = [
},
todoMismatch: [ ],
},
{ description: "nsUIEvent (DOMActivate)",
targetID: "button", eventType: "DOMActivate",
dispatchEvent: function () {
synthesizeMouseAtCenter(document.getElementById(this.targetID),
{ button: 0, shiftKey: true });
},
canRun: function () {
return true;
},
todoMismatch: [],
},
];
function doTest(aTest)