Bug 910978 part.11 Implement nsFormEvent::AssignFormEventData() r=smaug

This commit is contained in:
Masayuki Nakano 2013-09-03 20:45:29 +09:00
parent 8572bd5112
commit ffc994f8f5
3 changed files with 19 additions and 1 deletions

View File

@ -648,7 +648,7 @@ nsDOMEvent::DuplicatePrivateData()
{ {
nsFormEvent* oldFormEvent = static_cast<nsFormEvent*>(mEvent); nsFormEvent* oldFormEvent = static_cast<nsFormEvent*>(mEvent);
nsFormEvent* formEvent = new nsFormEvent(false, msg); nsFormEvent* formEvent = new nsFormEvent(false, msg);
formEvent->AssignEventData(*oldFormEvent, true); formEvent->AssignFormEventData(*oldFormEvent, true);
newEvent = formEvent; newEvent = formEvent;
break; break;
} }

View File

@ -1811,6 +1811,13 @@ public:
} }
nsIContent *originator; nsIContent *originator;
void AssignFormEventData(const nsFormEvent& aEvent, bool aCopyTargets)
{
AssignEventData(aEvent, aCopyTargets);
// Don't copy originator due to a weak pointer.
}
}; };
/** /**

View File

@ -13,6 +13,7 @@
<input id="input-text"> <input id="input-text">
<button id="button">button</button> <button id="button">button</button>
<div id="scrollable-div" style="overflow: auto; width: 30px; height: 30px;"><div id="scrolled-div" style="width: 10px; height: 10px;"></div></div> <div id="scrollable-div" style="overflow: auto; width: 30px; height: 30px;"><div id="scrolled-div" style="width: 10px; height: 10px;"></div></div>
<form id="form"></form>
</div> </div>
<div id="content" style="display: none"> <div id="content" style="display: none">
</div> </div>
@ -369,6 +370,16 @@ const kTests = [
}, },
todoMismatch: [ ], todoMismatch: [ ],
}, },
{ description: "nsFormEvent (reset)",
targetID: "form", eventType: "reset",
dispatchEvent: function () {
document.getElementById("form").reset();
},
canRun: function () {
return true;
},
todoMismatch: [ ],
},
]; ];
function doTest(aTest) function doTest(aTest)