diff options
author | New Tobin Paradigm <email@mattatobin.com> | 2018-04-12 10:49:23 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-04-12 10:49:23 -0400 |
commit | 4c2e77404f43040ce7a9f0d9052448b3f23a8c28 (patch) | |
tree | d7161a645a98f38dd18797cc80581446929f99c7 /dom/events/Event.cpp | |
parent | a0968fc6a86c8ab1abfa83d3c1986fadf3ec2766 (diff) | |
parent | 9f7f0f1172d67ab29e4f72eb1b34ab6f4bb231b1 (diff) | |
download | UXP-4c2e77404f43040ce7a9f0d9052448b3f23a8c28.tar UXP-4c2e77404f43040ce7a9f0d9052448b3f23a8c28.tar.gz UXP-4c2e77404f43040ce7a9f0d9052448b3f23a8c28.tar.lz UXP-4c2e77404f43040ce7a9f0d9052448b3f23a8c28.tar.xz UXP-4c2e77404f43040ce7a9f0d9052448b3f23a8c28.zip |
Merge pull request #126 from janekptacijarabaci/js_X-Content-Type-Options_nosniff_json_1
Align XCTO: nosniff allowed script MIME types with the spec
Diffstat (limited to 'dom/events/Event.cpp')
-rwxr-xr-x | dom/events/Event.cpp | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/dom/events/Event.cpp b/dom/events/Event.cpp index 2af34136e..2546a81ad 100755 --- a/dom/events/Event.cpp +++ b/dom/events/Event.cpp @@ -412,8 +412,17 @@ Event::Constructor(const GlobalObject& aGlobal, ErrorResult& aRv) { nsCOMPtr<mozilla::dom::EventTarget> t = do_QueryInterface(aGlobal.GetAsSupports()); - RefPtr<Event> e = new Event(t, nullptr, nullptr); - bool trusted = e->Init(t); + return Constructor(t, aType, aParam); +} + +// static +already_AddRefed<Event> +Event::Constructor(EventTarget* aEventTarget, + const nsAString& aType, + const EventInit& aParam) +{ + RefPtr<Event> e = new Event(aEventTarget, nullptr, nullptr); + bool trusted = e->Init(aEventTarget); e->InitEvent(aType, aParam.mBubbles, aParam.mCancelable); e->SetTrusted(trusted); e->SetComposed(aParam.mComposed); @@ -1209,7 +1218,7 @@ Event::Deserialize(const IPC::Message* aMsg, PickleIterator* aIter) } NS_IMETHODIMP_(void) -Event::SetOwner(mozilla::dom::EventTarget* aOwner) +Event::SetOwner(EventTarget* aOwner) { mOwner = nullptr; |