Bug 1019248: Convert ProgressEvent to WebIDL codegen. r=smaug
authorKyle Huey <khuey@kylehuey.com>
Tue, 03 Jun 2014 15:52:36 -0700
changeset 205683 4febe53fc262de790c2ec2930baa7e8ec505d920
parent 205682 5c83b471068866e4b1070be8f4d03a5b0d174259
child 205684 c15e59678a6036e9e3db78e0ae6460581a4da8f6
push id3741
push userasasaki@mozilla.com
push dateMon, 21 Jul 2014 20:25:18 +0000
treeherdermozilla-beta@4d6f46f5af68 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssmaug
bugs1019248
milestone32.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1019248: Convert ProgressEvent to WebIDL codegen. r=smaug
content/base/src/FileIOObject.cpp
content/base/src/nsXMLHttpRequest.cpp
content/html/content/src/HTMLInputElement.cpp
content/html/content/src/HTMLVideoElement.cpp
dom/events/Event.h
dom/filehandle/FileRequest.cpp
dom/interfaces/events/moz.build
dom/interfaces/events/nsIDOMEvent.idl
dom/interfaces/events/nsIDOMProgressEvent.idl
dom/webidl/ProgressEvent.webidl
dom/webidl/moz.build
dom/workers/XMLHttpRequest.cpp
js/xpconnect/src/event_impl_gen.conf.in
xpcom/reflect/xptinfo/src/ShimInterfaceInfo.cpp
--- a/content/base/src/FileIOObject.cpp
+++ b/content/base/src/FileIOObject.cpp
@@ -3,17 +3,17 @@
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "FileIOObject.h"
 #include "mozilla/EventDispatcher.h"
 #include "nsDOMFile.h"
 #include "nsError.h"
 #include "nsIDOMEvent.h"
-#include "nsIDOMProgressEvent.h"
+#include "mozilla/dom/ProgressEvent.h"
 #include "nsComponentManagerUtils.h"
 
 #define ERROR_STR "error"
 #define ABORT_STR "abort"
 #define PROGRESS_STR "progress"
 
 namespace mozilla {
 namespace dom {
@@ -100,37 +100,31 @@ FileIOObject::DispatchError(nsresult rv,
   // Dispatch error event to signify load failure
   DispatchProgressEvent(NS_LITERAL_STRING(ERROR_STR));
   DispatchProgressEvent(finalEvent);
 }
 
 nsresult
 FileIOObject::DispatchProgressEvent(const nsAString& aType)
 {
-  nsCOMPtr<nsIDOMEvent> event;
-  nsresult rv = NS_NewDOMProgressEvent(getter_AddRefs(event), this,
-                                       nullptr, nullptr);
-  NS_ENSURE_SUCCESS(rv, rv);
-
-  event->SetTrusted(true);
-  nsCOMPtr<nsIDOMProgressEvent> progress = do_QueryInterface(event);
-  NS_ENSURE_TRUE(progress, NS_ERROR_UNEXPECTED);
+  ProgressEventInit init;
+  init.mBubbles = false;
+  init.mCancelable = false;
+  init.mLoaded = mTransferred;
 
-  bool known;
-  uint64_t size;
   if (mTotal != kUnknownSize) {
-    known = true;
-    size = mTotal;
+    init.mLengthComputable = true;
+    init.mTotal = mTotal;
   } else {
-    known = false;
-    size = 0;
+    init.mLengthComputable = false;
+    init.mTotal = 0;
   }
-  rv = progress->InitProgressEvent(aType, false, false, known,
-                                   mTransferred, size);
-  NS_ENSURE_SUCCESS(rv, rv);
+  nsRefPtr<ProgressEvent> event =
+    ProgressEvent::Constructor(this, aType, init);
+  event->SetTrusted(true);
 
   return DispatchDOMEvent(nullptr, event, nullptr, nullptr);
 }
 
 // nsITimerCallback
 NS_IMETHODIMP
 FileIOObject::Notify(nsITimer* aTimer)
 {
--- a/content/base/src/nsXMLHttpRequest.cpp
+++ b/content/base/src/nsXMLHttpRequest.cpp
@@ -11,17 +11,17 @@
 #endif
 #include "mozilla/ArrayUtils.h"
 #include "mozilla/dom/XMLHttpRequestUploadBinding.h"
 #include "mozilla/EventDispatcher.h"
 #include "mozilla/EventListenerManager.h"
 #include "mozilla/MemoryReporting.h"
 #include "nsDOMBlobBuilder.h"
 #include "nsIDOMDocument.h"
-#include "nsIDOMProgressEvent.h"
+#include "mozilla/dom/ProgressEvent.h"
 #include "nsIJARChannel.h"
 #include "nsIJARURI.h"
 #include "nsLayoutCID.h"
 #include "nsReadableUtils.h"
 
 #include "nsIURI.h"
 #include "nsILoadGroup.h"
 #include "nsNetUtil.h"
@@ -1460,31 +1460,25 @@ nsXMLHttpRequest::DispatchProgressEvent(
     return;
   }
 
   bool dispatchLoadend = aType.EqualsLiteral(LOAD_STR) ||
                          aType.EqualsLiteral(ERROR_STR) ||
                          aType.EqualsLiteral(TIMEOUT_STR) ||
                          aType.EqualsLiteral(ABORT_STR);
 
-  nsCOMPtr<nsIDOMEvent> event;
-  nsresult rv = NS_NewDOMProgressEvent(getter_AddRefs(event), this,
-                                       nullptr, nullptr);
-  if (NS_FAILED(rv)) {
-    return;
-  }
-
-  nsCOMPtr<nsIDOMProgressEvent> progress = do_QueryInterface(event);
-  if (!progress) {
-    return;
-  }
-
-  progress->InitProgressEvent(aType, false, false, aLengthComputable,
-                              aLoaded, (aTotal == UINT64_MAX) ? 0 : aTotal);
-
+  ProgressEventInit init;
+  init.mBubbles = false;
+  init.mCancelable = false;
+  init.mLengthComputable = aLengthComputable;
+  init.mLoaded = aLoaded;
+  init.mTotal = (aTotal == UINT64_MAX) ? 0 : aTotal;
+
+  nsRefPtr<ProgressEvent> event =
+    ProgressEvent::Constructor(aTarget, aType, init);
   event->SetTrusted(true);
 
   aTarget->DispatchDOMEvent(nullptr, event, nullptr, nullptr);
 
   if (dispatchLoadend) {
     DispatchProgressEvent(aTarget, NS_LITERAL_STRING(LOADEND_STR),
                           aLengthComputable, aLoaded, aTotal);
   }
--- a/content/html/content/src/HTMLInputElement.cpp
+++ b/content/html/content/src/HTMLInputElement.cpp
@@ -22,17 +22,17 @@
 #include "nsFocusManager.h"
 #include "nsColorControlFrame.h"
 #include "nsNumberControlFrame.h"
 #include "nsPIDOMWindow.h"
 #include "nsRepeatService.h"
 #include "nsContentCID.h"
 #include "nsIComponentManager.h"
 #include "nsIDOMHTMLFormElement.h"
-#include "nsIDOMProgressEvent.h"
+#include "mozilla/dom/ProgressEvent.h"
 #include "nsGkAtoms.h"
 #include "nsStyleConsts.h"
 #include "nsPresContext.h"
 #include "nsMappedAttributes.h"
 #include "nsIFormControl.h"
 #include "nsIForm.h"
 #include "nsFormSubmission.h"
 #include "nsFormSubmissionConstants.h"
@@ -2720,35 +2720,29 @@ HTMLInputElement::MaybeDispatchProgressE
 
 void
 HTMLInputElement::DispatchProgressEvent(const nsAString& aType,
                                         bool aLengthComputable,
                                         uint64_t aLoaded, uint64_t aTotal)
 {
   NS_ASSERTION(!aType.IsEmpty(), "missing event type");
 
-  nsCOMPtr<nsIDOMEvent> event;
-  nsresult rv = NS_NewDOMProgressEvent(getter_AddRefs(event), this,
-                                       nullptr, nullptr);
-  if (NS_FAILED(rv)) {
-    return;
-  }
-
-  nsCOMPtr<nsIDOMProgressEvent> progress = do_QueryInterface(event);
-  if (!progress) {
-    return;
-  }
-
-  progress->InitProgressEvent(aType, false, true, aLengthComputable,
-                              aLoaded, (aTotal == UINT64_MAX) ? 0 : aTotal);
-
+  ProgressEventInit init;
+  init.mBubbles = false;
+  init.mCancelable = true; // XXXkhuey why?
+  init.mLengthComputable = aLengthComputable;
+  init.mLoaded = aLoaded;
+  init.mTotal = (aTotal == UINT64_MAX) ? 0 : aTotal;
+
+  nsRefPtr<ProgressEvent> event =
+    ProgressEvent::Constructor(this, aType, init);
   event->SetTrusted(true);
 
   bool doDefaultAction;
-  rv = DispatchEvent(event, &doDefaultAction);
+  nsresult rv = DispatchEvent(event, &doDefaultAction);
   if (NS_SUCCEEDED(rv) && !doDefaultAction) {
     CancelDirectoryPickerScanIfRunning();
   }
 }
 
 nsresult
 HTMLInputElement::UpdateFileList()
 {
--- a/content/html/content/src/HTMLVideoElement.cpp
+++ b/content/html/content/src/HTMLVideoElement.cpp
@@ -20,17 +20,16 @@
 #include "nsThreadUtils.h"
 #include "ImageContainer.h"
 
 #include "nsIScriptSecurityManager.h"
 #include "nsIXPConnect.h"
 
 #include "nsITimer.h"
 
-#include "nsIDOMProgressEvent.h"
 #include "MediaError.h"
 #include "MediaDecoder.h"
 #include "mozilla/Preferences.h"
 #include "mozilla/dom/WakeLock.h"
 #include "mozilla/dom/power/PowerManagerService.h"
 #include "nsPerformance.h"
 #include "mozilla/dom/VideoPlaybackQuality.h"
 
--- a/dom/events/Event.h
+++ b/dom/events/Event.h
@@ -24,16 +24,17 @@ class nsIContent;
 class nsIDOMEventTarget;
 class nsPresContext;
 
 namespace mozilla {
 namespace dom {
 
 class EventTarget;
 class ErrorEvent;
+class ProgressEvent;
 
 // Dummy class so we can cast through it to get from nsISupports to
 // Event subclasses with only two non-ambiguous static casts.
 class EventBase : public nsIDOMEvent
 {
 };
 
 class Event : public EventBase,
@@ -92,16 +93,21 @@ public:
     return EventBinding::Wrap(aCx, this);
   }
 
   virtual ErrorEvent* AsErrorEvent()
   {
     return nullptr;
   }
 
+  virtual ProgressEvent* AsProgressEvent()
+  {
+    return nullptr;
+  }
+
   // nsIDOMEvent Interface
   NS_DECL_NSIDOMEVENT
 
   void InitPresContextData(nsPresContext* aPresContext);
 
   // Returns true if the event should be trusted.
   bool Init(EventTarget* aGlobal);
 
--- a/dom/filehandle/FileRequest.cpp
+++ b/dom/filehandle/FileRequest.cpp
@@ -13,17 +13,17 @@
 #include "MainThreadUtils.h"
 #include "mozilla/dom/FileRequestBinding.h"
 #include "mozilla/EventDispatcher.h"
 #include "nsCOMPtr.h"
 #include "nsCxPusher.h"
 #include "nsDebug.h"
 #include "nsError.h"
 #include "nsIDOMEvent.h"
-#include "nsIDOMProgressEvent.h"
+#include "mozilla/dom/ProgressEvent.h"
 #include "nsIScriptContext.h"
 #include "nsLiteralString.h"
 
 namespace mozilla {
 namespace dom {
 
 FileRequest::FileRequest(nsPIDOMWindow* aWindow)
   : DOMRequest(aWindow), mWrapAsDOMRequest(false)
@@ -130,28 +130,22 @@ FileRequest::GetLockedFile() const
 
 void
 FileRequest::FireProgressEvent(uint64_t aLoaded, uint64_t aTotal)
 {
   if (NS_FAILED(CheckInnerWindowCorrectness())) {
     return;
   }
 
-  nsCOMPtr<nsIDOMEvent> event;
-  nsresult rv = NS_NewDOMProgressEvent(getter_AddRefs(event), this,
-                                       nullptr, nullptr);
-  if (NS_FAILED(rv)) {
-    return;
-  }
+  ProgressEventInit init;
+  init.mBubbles = false;
+  init.mCancelable = false;
+  init.mLengthComputable = false;
+  init.mLoaded = aLoaded;
+  init.mTotal = aTotal;
 
-  nsCOMPtr<nsIDOMProgressEvent> progress = do_QueryInterface(event);
-  MOZ_ASSERT(progress);
-  rv = progress->InitProgressEvent(NS_LITERAL_STRING("progress"), false, false,
-                                   false, aLoaded, aTotal);
-  if (NS_FAILED(rv)) {
-    return;
-  }
-
+  nsRefPtr<ProgressEvent> event =
+    ProgressEvent::Constructor(this, NS_LITERAL_STRING("progress"), init);
   DispatchTrustedEvent(event);
 }
 
 } // namespace dom
 } // namespace mozilla
--- a/dom/interfaces/events/moz.build
+++ b/dom/interfaces/events/moz.build
@@ -29,17 +29,16 @@ XPIDL_SOURCES += [
     'nsIDOMMouseScrollEvent.idl',
     'nsIDOMMutationEvent.idl',
     'nsIDOMNotifyPaintEvent.idl',
     'nsIDOMNSEvent.idl',
     'nsIDOMPageTransitionEvent.idl',
     'nsIDOMPaintRequest.idl',
     'nsIDOMPopStateEvent.idl',
     'nsIDOMPopupBlockedEvent.idl',
-    'nsIDOMProgressEvent.idl',
     'nsIDOMRecordErrorEvent.idl',
     'nsIDOMScrollAreaEvent.idl',
     'nsIDOMSimpleGestureEvent.idl',
     'nsIDOMSmartCardEvent.idl',
     'nsIDOMStyleRuleChangeEvent.idl',
     'nsIDOMStyleSheetApplicableStateChangeEvent.idl',
     'nsIDOMStyleSheetChangeEvent.idl',
     'nsIDOMTouchEvent.idl',
--- a/dom/interfaces/events/nsIDOMEvent.idl
+++ b/dom/interfaces/events/nsIDOMEvent.idl
@@ -322,21 +322,16 @@ NS_NewDOMCommandEvent(nsIDOMEvent** aIns
                       mozilla::dom::EventTarget* aOwner,
                       nsPresContext* aPresContext,
                       mozilla::WidgetCommandEvent* aEvent);
 nsresult
 NS_NewDOMMessageEvent(nsIDOMEvent** aInstancePtrResult,
                       mozilla::dom::EventTarget* aOwner,
                       nsPresContext* aPresContext,
                       mozilla::WidgetEvent* aEvent);
-nsresult
-NS_NewDOMProgressEvent(nsIDOMEvent** aInstancePtrResult,
-                       mozilla::dom::EventTarget* aOwner,
-                       nsPresContext* aPresContext,
-                       mozilla::WidgetEvent* aEvent);
 // This empties aInvalidateRequests.
 nsresult
 NS_NewDOMNotifyPaintEvent(nsIDOMEvent** aResult,
                           mozilla::dom::EventTarget* aOwner,
                           nsPresContext* aPresContext,
                           mozilla::WidgetEvent* aEvent,
                           uint32_t aEventType = 0,
                           nsInvalidateRequestList* aInvalidateRequests = nullptr);
deleted file mode 100644
--- a/dom/interfaces/events/nsIDOMProgressEvent.idl
+++ /dev/null
@@ -1,26 +0,0 @@
-/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* vim:set ts=2 sw=2 sts=2 et cindent: */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-#include "nsIDOMEvent.idl"
-
-/**
- * ProgressEvent can be used for measuring progress.
- */
-
-[builtinclass, uuid(e0682338-4c3f-4d3a-9487-d7492ea76335)]
-interface nsIDOMProgressEvent : nsIDOMEvent
-{
-  readonly attribute boolean lengthComputable;
-  readonly attribute unsigned long long loaded;
-  readonly attribute unsigned long long total;
-  [noscript]
-  void initProgressEvent(in DOMString typeArg,
-                         in boolean canBubbleArg,
-                         in boolean cancelableArg,
-                         in boolean lengthComputableArg,
-                         in unsigned long long loadedArg,
-                         in unsigned long long totalArg);
-};
--- a/dom/webidl/ProgressEvent.webidl
+++ b/dom/webidl/ProgressEvent.webidl
@@ -1,15 +1,15 @@
 /* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this file,
  * You can obtain one at http://mozilla.org/MPL/2.0/.
  */
 
-[Constructor(DOMString type, optional ProgressEventInit eventInitDict), HeaderFile="GeneratedEventClasses.h"]
+[Constructor(DOMString type, optional ProgressEventInit eventInitDict)]
 interface ProgressEvent : Event
 {
   readonly attribute boolean lengthComputable;
   readonly attribute unsigned long long loaded;
   readonly attribute unsigned long long total;
 };
 
 dictionary ProgressEventInit : EventInit
--- a/dom/webidl/moz.build
+++ b/dom/webidl/moz.build
@@ -635,16 +635,17 @@ GENERATED_EVENTS_WEBIDL_FILES = [
     'IccChangeEvent.webidl',
     'MediaStreamEvent.webidl',
     'MozClirModeEvent.webidl',
     'MozContactChangeEvent.webidl',
     'MozEmergencyCbModeEvent.webidl',
     'MozInterAppMessageEvent.webidl',
     'MozOtaStatusEvent.webidl',
     'MozStkCommandEvent.webidl',
+    'ProgressEvent.webidl',
     'RTCDataChannelEvent.webidl',
     'RTCPeerConnectionIceEvent.webidl',
     'RTCPeerConnectionIdentityErrorEvent.webidl',
     'RTCPeerConnectionIdentityEvent.webidl',
     'TrackEvent.webidl',
     'UserProximityEvent.webidl',
     'USSDReceivedEvent.webidl',
 ]
--- a/dom/workers/XMLHttpRequest.cpp
+++ b/dom/workers/XMLHttpRequest.cpp
@@ -2,25 +2,25 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this file,
  * You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "XMLHttpRequest.h"
 
 #include "nsIDOMEvent.h"
 #include "nsIDOMEventListener.h"
-#include "nsIDOMProgressEvent.h"
 #include "nsIRunnable.h"
 #include "nsIVariant.h"
 #include "nsIXMLHttpRequest.h"
 #include "nsIXPConnect.h"
 
 #include "jsfriendapi.h"
 #include "mozilla/ArrayUtils.h"
 #include "mozilla/dom/Exceptions.h"
+#include "mozilla/dom/ProgressEvent.h"
 #include "nsComponentManagerUtils.h"
 #include "nsContentUtils.h"
 #include "nsCxPusher.h"
 #include "nsJSUtils.h"
 #include "nsThreadUtils.h"
 
 #include "File.h"
 #include "RuntimeService.h"
@@ -1035,39 +1035,33 @@ Proxy::HandleEvent(nsIDOMEvent* aEvent)
 
   nsCOMPtr<nsIDOMEventTarget> target;
   if (NS_FAILED(aEvent->GetTarget(getter_AddRefs(target)))) {
     NS_WARNING("Failed to get target!");
     return NS_ERROR_FAILURE;
   }
 
   nsCOMPtr<nsIXMLHttpRequestUpload> uploadTarget = do_QueryInterface(target);
-  nsCOMPtr<nsIDOMProgressEvent> progressEvent = do_QueryInterface(aEvent);
+  ProgressEvent* progressEvent = aEvent->InternalDOMEvent()->AsProgressEvent();
 
   nsRefPtr<EventRunnable> runnable;
 
   if (mInOpen && type.EqualsASCII(sEventStrings[STRING_readystatechange])) {
     uint16_t readyState = 0;
     if (NS_SUCCEEDED(mXHR->GetReadyState(&readyState)) &&
         readyState == nsIXMLHttpRequest::OPENED) {
       mInnerEventStreamId++;
     }
   }
 
   if (progressEvent) {
-    bool lengthComputable;
-    uint64_t loaded, total;
-    if (NS_FAILED(progressEvent->GetLengthComputable(&lengthComputable)) ||
-        NS_FAILED(progressEvent->GetLoaded(&loaded)) ||
-        NS_FAILED(progressEvent->GetTotal(&total))) {
-      NS_WARNING("Bad progress event!");
-      return NS_ERROR_FAILURE;
-    }
-    runnable = new EventRunnable(this, !!uploadTarget, type, lengthComputable,
-                                 loaded, total);
+    runnable = new EventRunnable(this, !!uploadTarget, type,
+                                 progressEvent->LengthComputable(),
+                                 progressEvent->Loaded(),
+                                 progressEvent->Total());
   }
   else {
     runnable = new EventRunnable(this, !!uploadTarget, type);
   }
 
   {
     AutoSafeJSContext cx;
     JSAutoRequest ar(cx);
@@ -1338,23 +1332,24 @@ EventRunnable::WorkerRun(JSContext* aCx,
   else {
     target = xhr;
   }
 
   MOZ_ASSERT(target);
 
   nsCOMPtr<nsIDOMEvent> event;
   if (mProgressEvent) {
-    NS_NewDOMProgressEvent(getter_AddRefs(event), target, nullptr, nullptr);
-    nsCOMPtr<nsIDOMProgressEvent> progress = do_QueryInterface(event);
+    ProgressEventInit init;
+    init.mBubbles = false;
+    init.mCancelable = false;
+    init.mLengthComputable = mLengthComputable;
+    init.mLoaded = mLoaded;
+    init.mTotal = mTotal;
 
-    if (progress) {
-      progress->InitProgressEvent(mType, false, false, mLengthComputable,
-                                  mLoaded, mTotal);
-    }
+    event = ProgressEvent::Constructor(target, mType, init);
   }
   else {
     NS_NewDOMEvent(getter_AddRefs(event), target, nullptr, nullptr);
 
     if (event) {
       event->InitEvent(mType, false, false);
     }
   }
@@ -1734,33 +1729,30 @@ XMLHttpRequest::DispatchPrematureAbortEv
   if (aEventType.EqualsLiteral("readystatechange")) {
     NS_NewDOMEvent(getter_AddRefs(event), aTarget, nullptr, nullptr);
 
     if (event) {
       event->InitEvent(aEventType, false, false);
     }
   }
   else {
-    NS_NewDOMProgressEvent(getter_AddRefs(event), aTarget, nullptr, nullptr);
-
-    nsCOMPtr<nsIDOMProgressEvent> progress = do_QueryInterface(event);
-    if (progress) {
-      if (aUploadTarget) {
-        progress->InitProgressEvent(aEventType, false, false,
-                                    mProxy->mLastUploadLengthComputable,
-                                    mProxy->mLastUploadLoaded,
-                                    mProxy->mLastUploadTotal);
-      }
-      else {
-        progress->InitProgressEvent(aEventType, false, false,
-                                    mProxy->mLastLengthComputable,
-                                    mProxy->mLastLoaded,
-                                    mProxy->mLastTotal);
-      }
+    ProgressEventInit init;
+    init.mBubbles = false;
+    init.mCancelable = false;
+    if (aUploadTarget) {
+      init.mLengthComputable = mProxy->mLastUploadLengthComputable;
+      init.mLoaded = mProxy->mLastUploadLoaded;
+      init.mTotal = mProxy->mLastUploadTotal;
     }
+    else {
+      init.mLengthComputable = mProxy->mLastLengthComputable;
+      init.mLoaded = mProxy->mLastLoaded;
+      init.mTotal = mProxy->mLastTotal;
+    }
+    event = ProgressEvent::Constructor(aTarget, aEventType, init);
   }
 
   if (!event) {
     aRv.Throw(NS_ERROR_FAILURE);
     return;
   }
 
   event->SetTrusted(true);
--- a/js/xpconnect/src/event_impl_gen.conf.in
+++ b/js/xpconnect/src/event_impl_gen.conf.in
@@ -3,17 +3,16 @@
  License, v. 2.0. If a copy of the MPL was not distributed with this
  file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
  The name of the event which real interface should have nsIDOM-prefix,
  and should be in nsIDOM<name>.idl file and which should have
  <name>Init dictionary for the event constructor. """
 
 simple_events = [
-    'ProgressEvent',
     'MozSettingsEvent',
     'CustomEvent',
     'PageTransitionEvent',
     'DOMTransactionEvent',
     'PopStateEvent',
     'HashChangeEvent',
     'CloseEvent',
     'DeviceOrientationEvent',
--- a/xpcom/reflect/xptinfo/src/ShimInterfaceInfo.cpp
+++ b/xpcom/reflect/xptinfo/src/ShimInterfaceInfo.cpp
@@ -134,17 +134,16 @@
 #include "nsIDOMNSEvent.h"
 #include "nsIDOMOfflineResourceList.h"
 #include "nsIDOMPageTransitionEvent.h"
 #include "nsIDOMPaintRequest.h"
 #include "nsIDOMParser.h"
 #include "nsIDOMPopStateEvent.h"
 #include "nsIDOMPopupBlockedEvent.h"
 #include "nsIDOMProcessingInstruction.h"
-#include "nsIDOMProgressEvent.h"
 #include "nsIDOMRange.h"
 #include "nsIDOMRecordErrorEvent.h"
 #include "nsIDOMRect.h"
 #include "nsIDOMScreen.h"
 #include "nsIDOMScrollAreaEvent.h"
 #include "nsIDOMSerializer.h"
 #include "nsIDOMSimpleGestureEvent.h"
 #include "nsIDOMSmartCardEvent.h"
@@ -304,17 +303,16 @@
 #include "mozilla/dom/EventBinding.h"
 #include "mozilla/dom/OfflineResourceListBinding.h"
 #include "mozilla/dom/PageTransitionEventBinding.h"
 #include "mozilla/dom/PaintRequestBinding.h"
 #include "mozilla/dom/PopStateEventBinding.h"
 #include "mozilla/dom/PopupBlockedEventBinding.h"
 #include "mozilla/dom/PositionErrorBinding.h"
 #include "mozilla/dom/ProcessingInstructionBinding.h"
-#include "mozilla/dom/ProgressEventBinding.h"
 #include "mozilla/dom/RangeBinding.h"
 #include "mozilla/dom/RecordErrorEventBinding.h"
 #include "mozilla/dom/RectBinding.h"
 #include "mozilla/dom/ScreenBinding.h"
 #include "mozilla/dom/SelectionBinding.h"
 #include "mozilla/dom/ScrollAreaEventBinding.h"
 #include "mozilla/dom/SimpleGestureEventBinding.h"
 #include "mozilla/dom/SmartCardEventBinding.h"
@@ -525,17 +523,16 @@ const ComponentsInterfaceShimEntry kComp
   DEFINE_SHIM_WITH_CUSTOM_INTERFACE(nsIDOMNSEvent, Event),
   DEFINE_SHIM(OfflineResourceList),
   DEFINE_SHIM(PageTransitionEvent),
   DEFINE_SHIM(PaintRequest),
   DEFINE_SHIM_WITH_CUSTOM_INTERFACE(nsIDOMParser, DOMParser),
   DEFINE_SHIM(PopStateEvent),
   DEFINE_SHIM(PopupBlockedEvent),
   DEFINE_SHIM(ProcessingInstruction),
-  DEFINE_SHIM(ProgressEvent),
   DEFINE_SHIM(Range),
   DEFINE_SHIM(RecordErrorEvent),
   DEFINE_SHIM(Rect),
   DEFINE_SHIM(Screen),
   DEFINE_SHIM(ScrollAreaEvent),
   DEFINE_SHIM_WITH_CUSTOM_INTERFACE(nsIDOMSerializer, XMLSerializer),
   DEFINE_SHIM(SimpleGestureEvent),
   DEFINE_SHIM(SmartCardEvent),