summaryrefslogtreecommitdiffstats
path: root/dom/events
diff options
context:
space:
mode:
authorjanekptacijarabaci <janekptacijarabaci@seznam.cz>2018-04-04 21:36:19 +0200
committerjanekptacijarabaci <janekptacijarabaci@seznam.cz>2018-04-04 21:36:19 +0200
commitaea1fd640e01b5e36fb5e9f435681d8d4501d6f5 (patch)
treeb60e6c7937103afdd7cd158292c07ae2c7abbb95 /dom/events
parent3968897fb4b227b1a634700cbeaea715e58ac543 (diff)
downloadUXP-aea1fd640e01b5e36fb5e9f435681d8d4501d6f5.tar
UXP-aea1fd640e01b5e36fb5e9f435681d8d4501d6f5.tar.gz
UXP-aea1fd640e01b5e36fb5e9f435681d8d4501d6f5.tar.lz
UXP-aea1fd640e01b5e36fb5e9f435681d8d4501d6f5.tar.xz
UXP-aea1fd640e01b5e36fb5e9f435681d8d4501d6f5.zip
Bug 1288768 - Better error reporting for network errors in workers
Diffstat (limited to 'dom/events')
-rwxr-xr-xdom/events/Event.cpp15
-rwxr-xr-xdom/events/Event.h4
2 files changed, 16 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;
diff --git a/dom/events/Event.h b/dom/events/Event.h
index c28226e8a..0817aa809 100755
--- a/dom/events/Event.h
+++ b/dom/events/Event.h
@@ -142,6 +142,10 @@ public:
LayoutDeviceIntPoint aPoint,
CSSIntPoint aDefaultPoint);
+ static already_AddRefed<Event> Constructor(EventTarget* aEventTarget,
+ const nsAString& aType,
+ const EventInit& aParam);
+
static already_AddRefed<Event> Constructor(const GlobalObject& aGlobal,
const nsAString& aType,
const EventInit& aParam,