diff --git a/content/events/src/nsDOMEvent.cpp b/content/events/src/nsDOMEvent.cpp index e0f5dd9941c1..635855b8f408 100644 --- a/content/events/src/nsDOMEvent.cpp +++ b/content/events/src/nsDOMEvent.cpp @@ -675,7 +675,7 @@ nsDOMEvent::DuplicatePrivateData() { nsUIEvent* oldUIEvent = static_cast(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(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; } diff --git a/widget/nsGUIEvent.h b/widget/nsGUIEvent.h index 98e1677eff9f..858554ccbb9a 100644 --- a/widget/nsGUIEvent.h +++ b/widget/nsGUIEvent.h @@ -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 diff --git a/widget/tests/test_assign_event_data.html b/widget/tests/test_assign_event_data.html index 93c6d82388be..b31b31b0f1ca 100644 --- a/widget/tests/test_assign_event_data.html +++ b/widget/tests/test_assign_event_data.html @@ -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)