Bug 906901 - Use webIDL dictionaries for BrowerElementParent's event details r=bz
authorDavid Zbarsky <dzbarsky@gmail.com>
Sat, 24 Aug 2013 10:08:55 -0400
changeset 144215 bedb4f9707ce21836ffb5a3c887e29ac913990a5
parent 144214 c55a56be94f24d5216c462b1a20c5b42f9ca7962
child 144216 62a1a184b2c3a8833921d27a095f41ab9b07f379
push id32915
push userdzbarsky@gmail.com
push dateSat, 24 Aug 2013 14:08:38 +0000
treeherdermozilla-inbound@bedb4f9707ce [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbz
bugs906901
milestone26.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 906901 - Use webIDL dictionaries for BrowerElementParent's event details r=bz
b2g/installer/package-manifest.in
browser/installer/package-manifest.in
dom/base/nsDOMClassInfo.cpp
dom/base/nsDOMClassInfoClasses.h
dom/browser-element/BrowserElementParent.cpp
dom/browser-element/BrowserElementParent.h
dom/browser-element/moz.build
dom/browser-element/nsAsyncScrollEventDetail.cpp
dom/browser-element/nsAsyncScrollEventDetail.h
dom/browser-element/nsIOpenWindowEventDetail.idl
dom/browser-element/nsOpenWindowEventDetail.cpp
dom/browser-element/nsOpenWindowEventDetail.h
dom/tests/mochitest/general/test_interfaces.html
dom/webidl/BrowserElementDictionaries.webidl
dom/webidl/DummyBinding.webidl
dom/webidl/WebIDL.mk
mobile/android/installer/package-manifest.in
--- a/b2g/installer/package-manifest.in
+++ b/b2g/installer/package-manifest.in
@@ -191,17 +191,16 @@
 @BINPATH@/components/dom_media.xpt
 @BINPATH@/components/dom_network.xpt
 @BINPATH@/components/dom_notification.xpt
 @BINPATH@/components/dom_html.xpt
 @BINPATH@/components/dom_indexeddb.xpt
 @BINPATH@/components/dom_offline.xpt
 @BINPATH@/components/dom_payment.xpt
 @BINPATH@/components/dom_json.xpt
-@BINPATH@/components/dom_browserelement.xpt
 @BINPATH@/components/dom_messages.xpt
 @BINPATH@/components/dom_power.xpt
 @BINPATH@/components/dom_quota.xpt
 @BINPATH@/components/dom_range.xpt
 @BINPATH@/components/dom_settings.xpt
 @BINPATH@/components/dom_permissionsettings.xpt
 @BINPATH@/components/dom_sidebar.xpt
 @BINPATH@/components/dom_mobilemessage.xpt
--- a/browser/installer/package-manifest.in
+++ b/browser/installer/package-manifest.in
@@ -198,17 +198,16 @@
 @BINPATH@/components/dom_geolocation.xpt
 @BINPATH@/components/dom_media.xpt
 @BINPATH@/components/dom_network.xpt
 @BINPATH@/components/dom_notification.xpt
 @BINPATH@/components/dom_html.xpt
 @BINPATH@/components/dom_indexeddb.xpt
 @BINPATH@/components/dom_offline.xpt
 @BINPATH@/components/dom_json.xpt
-@BINPATH@/components/dom_browserelement.xpt
 @BINPATH@/components/dom_power.xpt
 @BINPATH@/components/dom_quota.xpt
 @BINPATH@/components/dom_range.xpt
 @BINPATH@/components/dom_settings.xpt
 @BINPATH@/components/dom_permissionsettings.xpt
 @BINPATH@/components/dom_sidebar.xpt
 @BINPATH@/components/dom_mobilemessage.xpt
 @BINPATH@/components/dom_storage.xpt
--- a/dom/base/nsDOMClassInfo.cpp
+++ b/dom/base/nsDOMClassInfo.cpp
@@ -180,18 +180,16 @@
 #include "FMRadio.h"
 #endif
 
 #ifdef MOZ_B2G_BT
 #include "BluetoothDevice.h"
 #endif
 
 #include "nsIDOMCameraManager.h"
-#include "nsIOpenWindowEventDetail.h"
-#include "nsIAsyncScrollEventDetail.h"
 #include "nsIDOMGlobalObjectConstructor.h"
 #include "nsIDOMLockedFile.h"
 #include "nsDebug.h"
 
 #include "mozilla/dom/BindingUtils.h"
 #include "mozilla/Likely.h"
 #include "WindowNamedPropertiesHandler.h"
 
@@ -556,21 +554,16 @@ static nsDOMClassInfoData sClassInfoData
                            EVENTTARGET_SCRIPTABLE_FLAGS)
 #endif
 
   NS_DEFINE_CLASSINFO_DATA(CameraControl, nsDOMGenericSH,
                            DOM_DEFAULT_SCRIPTABLE_FLAGS)
   NS_DEFINE_CLASSINFO_DATA(CameraCapabilities, nsDOMGenericSH,
                            DOM_DEFAULT_SCRIPTABLE_FLAGS)
 
-  NS_DEFINE_CLASSINFO_DATA(OpenWindowEventDetail, nsDOMGenericSH,
-                           DOM_DEFAULT_SCRIPTABLE_FLAGS)
-  NS_DEFINE_CLASSINFO_DATA(AsyncScrollEventDetail, nsDOMGenericSH,
-                           DOM_DEFAULT_SCRIPTABLE_FLAGS)
-
   NS_DEFINE_CLASSINFO_DATA(LockedFile, nsEventTargetSH,
                            EVENTTARGET_SCRIPTABLE_FLAGS)
   NS_DEFINE_CLASSINFO_DATA(CSSFontFeatureValuesRule, nsDOMGenericSH,
                            DOM_DEFAULT_SCRIPTABLE_FLAGS)
 
   NS_DEFINE_CLASSINFO_DATA(UserDataHandler, nsDOMGenericSH,
                            DOM_DEFAULT_SCRIPTABLE_FLAGS)
   NS_DEFINE_CLASSINFO_DATA(LoadStatus, nsDOMGenericSH,
@@ -1442,24 +1435,16 @@ nsDOMClassInfo::Init()
   DOM_CLASSINFO_MAP_BEGIN(CameraControl, nsICameraControl)
     DOM_CLASSINFO_MAP_ENTRY(nsICameraControl)
   DOM_CLASSINFO_MAP_END
 
   DOM_CLASSINFO_MAP_BEGIN(CameraCapabilities, nsICameraCapabilities)
     DOM_CLASSINFO_MAP_ENTRY(nsICameraCapabilities)
   DOM_CLASSINFO_MAP_END
 
-  DOM_CLASSINFO_MAP_BEGIN(OpenWindowEventDetail, nsIOpenWindowEventDetail)
-    DOM_CLASSINFO_MAP_ENTRY(nsIOpenWindowEventDetail)
-  DOM_CLASSINFO_MAP_END
-
-  DOM_CLASSINFO_MAP_BEGIN(AsyncScrollEventDetail, nsIAsyncScrollEventDetail)
-    DOM_CLASSINFO_MAP_ENTRY(nsIAsyncScrollEventDetail)
-  DOM_CLASSINFO_MAP_END
-
   DOM_CLASSINFO_MAP_BEGIN(LockedFile, nsIDOMLockedFile)
     DOM_CLASSINFO_MAP_ENTRY(nsIDOMLockedFile)
   DOM_CLASSINFO_MAP_END
 
   DOM_CLASSINFO_MAP_BEGIN(CSSFontFeatureValuesRule, nsIDOMCSSFontFeatureValuesRule)
     DOM_CLASSINFO_MAP_ENTRY(nsIDOMCSSFontFeatureValuesRule)
   DOM_CLASSINFO_MAP_END
 
--- a/dom/base/nsDOMClassInfoClasses.h
+++ b/dom/base/nsDOMClassInfoClasses.h
@@ -138,19 +138,16 @@ DOMCI_CLASS(FMRadio)
 
 #ifdef MOZ_B2G_BT
 DOMCI_CLASS(BluetoothDevice)
 #endif
 
 DOMCI_CLASS(CameraControl)
 DOMCI_CLASS(CameraCapabilities)
 
-DOMCI_CLASS(OpenWindowEventDetail)
-DOMCI_CLASS(AsyncScrollEventDetail)
-
 DOMCI_CLASS(LockedFile)
 
 DOMCI_CLASS(CSSFontFeatureValuesRule)
 
 DOMCI_CLASS(UserDataHandler)
 DOMCI_CLASS(LoadStatus)
 DOMCI_CLASS(XPathNamespace)
 DOMCI_CLASS(XULControlElement)
--- a/dom/browser-element/BrowserElementParent.cpp
+++ b/dom/browser-element/BrowserElementParent.cpp
@@ -9,26 +9,26 @@
 // That messes up our call to nsEventDispatcher::CreateEvent below.
 
 #ifdef CreateEvent
 #undef CreateEvent
 #endif
 
 #include "BrowserElementParent.h"
 #include "mozilla/dom/HTMLIFrameElement.h"
-#include "nsOpenWindowEventDetail.h"
 #include "nsEventDispatcher.h"
 #include "nsIDOMCustomEvent.h"
 #include "nsIInterfaceRequestorUtils.h"
 #include "nsVariant.h"
-#include "nsAsyncScrollEventDetail.h"
+#include "mozilla/dom/BrowserElementDictionariesBinding.h"
+#include "nsCxPusher.h"
+#include "GeneratedEventClasses.h"
 
-using mozilla::dom::Element;
-using mozilla::dom::HTMLIFrameElement;
-using mozilla::dom::TabParent;
+using namespace mozilla;
+using namespace mozilla::dom;
 
 namespace {
 
 /**
  * Create an <iframe mozbrowser> owned by the same document as
  * aOpenerFrameElement.
  */
 already_AddRefed<HTMLIFrameElement>
@@ -67,45 +67,49 @@ CreateIframe(Element* aOpenerFrameElemen
                                        NS_LITERAL_STRING("false"),
                              /* aNotify = */ false);
 
   return popupFrameElement.forget();
 }
 
 bool
 DispatchCustomDOMEvent(Element* aFrameElement, const nsAString& aEventName,
-                       nsISupports *aDetailValue)
+                       JSContext* cx, JS::Handle<JS::Value> aDetailValue)
 {
   NS_ENSURE_TRUE(aFrameElement, false);
   nsIPresShell *shell = aFrameElement->OwnerDoc()->GetShell();
   nsRefPtr<nsPresContext> presContext;
   if (shell) {
     presContext = shell->GetPresContext();
   }
 
   nsCOMPtr<nsIDOMEvent> domEvent;
   nsEventDispatcher::CreateEvent(aFrameElement, presContext, nullptr,
                                  NS_LITERAL_STRING("customevent"),
                                  getter_AddRefs(domEvent));
   NS_ENSURE_TRUE(domEvent, false);
 
-  nsCOMPtr<nsIWritableVariant> detailVariant = new nsVariant();
-  nsresult rv = detailVariant->SetAsISupports(aDetailValue);
-  NS_ENSURE_SUCCESS(rv, false);
   nsCOMPtr<nsIDOMCustomEvent> customEvent = do_QueryInterface(domEvent);
   NS_ENSURE_TRUE(customEvent, false);
-  customEvent->InitCustomEvent(aEventName,
-                               /* bubbles = */ true,
-                               /* cancelable = */ false,
-                               detailVariant);
+  ErrorResult res;
+  CustomEvent* event = static_cast<CustomEvent*>(customEvent.get());
+  event->InitCustomEvent(cx,
+                         aEventName,
+                         /* bubbles = */ true,
+                         /* cancelable = */ false,
+                         aDetailValue,
+                         res);
+  if (res.Failed()) {
+    return false;
+  }
   customEvent->SetTrusted(true);
   // Dispatch the event.
   nsEventStatus status = nsEventStatus_eIgnore;
-  rv = nsEventDispatcher::DispatchDOMEvent(aFrameElement, nullptr,
-                                           domEvent, presContext, &status);
+  nsresult rv = nsEventDispatcher::DispatchDOMEvent(aFrameElement, nullptr,
+                                                    domEvent, presContext, &status);
   return NS_SUCCEEDED(rv);
 }
 
 /**
  * Dispatch a mozbrowseropenwindow event to the given opener frame element.
  * The "popup iframe" (event.detail.frameElement) will be |aPopupFrameElement|.
  *
  * Returns true iff there were no unexpected failures and the window.open call
@@ -114,28 +118,46 @@ DispatchCustomDOMEvent(Element* aFrameEl
 bool
 DispatchOpenWindowEvent(Element* aOpenerFrameElement,
                         Element* aPopupFrameElement,
                         const nsAString& aURL,
                         const nsAString& aName,
                         const nsAString& aFeatures)
 {
   // Dispatch a CustomEvent at aOpenerFrameElement with a detail object
-  // (nsIOpenWindowEventDetail) containing aPopupFrameElement, aURL, aName, and
+  // (OpenWindowEventDetail) containing aPopupFrameElement, aURL, aName, and
   // aFeatures.
 
   // Create the event's detail object.
-  nsRefPtr<nsOpenWindowEventDetail> detail =
-    new nsOpenWindowEventDetail(aURL, aName, aFeatures,
-                                aPopupFrameElement->AsDOMNode());
+  OpenWindowEventDetailInitializer detail;
+  detail.mUrl = aURL;
+  detail.mName = aName;
+  detail.mFeatures = aFeatures;
+  detail.mFrameElement = aPopupFrameElement;
+
+  AutoJSContext cx;
+  JS::Rooted<JS::Value> val(cx);
+
+  nsIGlobalObject* sgo = aPopupFrameElement->OwnerDoc()->GetScopeObject();
+  if (!sgo) {
+    return false;
+  }
+
+  JS::Rooted<JSObject*> global(cx, sgo->GetGlobalJSObject());
+  JSAutoCompartment ac(cx, global);
+  if (!detail.ToObject(cx, global, &val)) {
+    MOZ_CRASH("Failed to convert dictionary to JS::Value due to OOM.");
+    return false;
+  }
 
   bool dispatchSucceeded =
     DispatchCustomDOMEvent(aOpenerFrameElement,
                            NS_LITERAL_STRING("mozbrowseropenwindow"),
-                           detail);
+                           cx,
+                           val);
 
   // If the iframe is not in some document's DOM at this point, the embedder
   // has "blocked" the popup.
   return (dispatchSucceeded && aPopupFrameElement->IsInDoc());
 }
 
 } // anonymous namespace
 
@@ -258,23 +280,37 @@ private:
   const CSSRect mContentRect;
   const CSSSize mContentSize;
 };
 
 NS_IMETHODIMP DispatchAsyncScrollEventRunnable::Run()
 {
   nsCOMPtr<Element> frameElement = mTabParent->GetOwnerElement();
   // Create the event's detail object.
-  nsRefPtr<nsAsyncScrollEventDetail> detail =
-    new nsAsyncScrollEventDetail(mContentRect.x, mContentRect.y,
-                                 mContentRect.width, mContentRect.height,
-                                 mContentSize.width, mContentSize.height);
+  AsyncScrollEventDetailInitializer detail;
+  detail.mLeft = mContentRect.x;
+  detail.mTop = mContentRect.y;
+  detail.mWidth = mContentRect.width;
+  detail.mHeight = mContentRect.height;
+  detail.mScrollWidth = mContentRect.width;
+  detail.mScrollHeight = mContentRect.height;
+  AutoSafeJSContext cx;
+  JS::Rooted<JS::Value> val(cx);
+
+  // We can get away with a null global here because
+  // AsyncScrollEventDetail only contains numeric values.
+  if (!detail.ToObject(cx, JS::NullPtr(), &val)) {
+    MOZ_CRASH("Failed to convert dictionary to JS::Value due to OOM.");
+    return NS_ERROR_FAILURE;
+  }
+
   DispatchCustomDOMEvent(frameElement,
                          NS_LITERAL_STRING("mozbrowserasyncscroll"),
-                         detail);
+                         cx,
+                         val);
   return NS_OK;
 }
 
 bool
 BrowserElementParent::DispatchAsyncScrollEvent(TabParent* aTabParent,
                                                const CSSRect& aContentRect,
                                                const CSSSize& aContentSize)
 {
--- a/dom/browser-element/BrowserElementParent.h
+++ b/dom/browser-element/BrowserElementParent.h
@@ -41,17 +41,17 @@ public:
    * the <iframe mozbrowser> whose content called window.open) gets the
    * opportunity to place a new <iframe mozbrowser> in the DOM somewhere.  This
    * new "popup" iframe acts as the opened window.
    *
    * This method proceeds in three steps.
    *
    * 1) We fire a mozbrowseropenwindow CustomEvent on the opener
    *    iframe element.  This event's detail is an instance of
-   *    nsIOpenWindowEventDetail.
+   *    OpenWindowEventDetail.
    *
    * 2) The embedder (the document which contains the opener iframe) can accept
    *    the window.open request by inserting event.detail.frameElement (an iframe
    *    element) into the DOM somewhere.
    *
    * 3) If the embedder accepted the window.open request, we return true and
    *    set aPopupTabParent's frame element to event.detail.frameElement.
    *    Otherwise, we return false.
--- a/dom/browser-element/moz.build
+++ b/dom/browser-element/moz.build
@@ -1,38 +1,26 @@
 # -*- Mode: python; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 40 -*-
 # vim: set filetype=python:
 # 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/.
 
 TEST_DIRS += ['mochitest']
 
-XPIDL_SOURCES += [
-    'nsIAsyncScrollEventDetail.idl',
-    'nsIOpenWindowEventDetail.idl',
-]
-
 XPIDL_MODULE = 'dom_browserelement'
 
 MODULE = 'dom'
 
-EXPORTS += [
-    'nsAsyncScrollEventDetail.h',
-    'nsOpenWindowEventDetail.h',
-]
-
 EXPORTS.mozilla += [
     'BrowserElementParent.h',
 ]
 
 CPP_SOURCES += [
     'BrowserElementParent.cpp',
-    'nsAsyncScrollEventDetail.cpp',
-    'nsOpenWindowEventDetail.cpp',
 ]
 
 EXTRA_COMPONENTS += [
     'BrowserElementParent.js',
     'BrowserElementParent.manifest',
 ]
 
 EXTRA_JS_MODULES += [
deleted file mode 100644
--- a/dom/browser-element/nsAsyncScrollEventDetail.cpp
+++ /dev/null
@@ -1,62 +0,0 @@
-/* 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 "nsAsyncScrollEventDetail.h"
-#include "nsDOMClassInfoID.h"
-#include "nsIDOMClassInfo.h"
-#include "nsIClassInfo.h"
-#include "nsDOMClassInfo.h"
-
-NS_IMPL_ADDREF(nsAsyncScrollEventDetail)
-NS_IMPL_RELEASE(nsAsyncScrollEventDetail)
-NS_INTERFACE_MAP_BEGIN(nsAsyncScrollEventDetail)
-  NS_INTERFACE_MAP_ENTRY(nsISupports)
-  NS_INTERFACE_MAP_ENTRY(nsIAsyncScrollEventDetail)
-  NS_DOM_INTERFACE_MAP_ENTRY_CLASSINFO(AsyncScrollEventDetail)
-NS_INTERFACE_MAP_END
-
-DOMCI_DATA(AsyncScrollEventDetail, nsAsyncScrollEventDetail)
-
-/* readonly attribute float top; */
-NS_IMETHODIMP nsAsyncScrollEventDetail::GetTop(float *aTop)
-{
-  *aTop = mTop;
-  return NS_OK;
-}
-
-/* readonly attribute float left; */
-NS_IMETHODIMP nsAsyncScrollEventDetail::GetLeft(float *aLeft)
-{
-  *aLeft = mLeft;
-  return NS_OK;
-}
-
-/* readonly attribute float width; */
-NS_IMETHODIMP nsAsyncScrollEventDetail::GetWidth(float *aWidth)
-{
-  *aWidth = mWidth;
-  return NS_OK;
-}
-
-/* readonly attribute float height; */
-NS_IMETHODIMP nsAsyncScrollEventDetail::GetHeight(float *aHeight)
-{
-  *aHeight = mHeight;
-  return NS_OK;
-}
-
-/* readonly attribute float scrollWidth; */
-NS_IMETHODIMP nsAsyncScrollEventDetail::GetScrollWidth(float *aScrollWidth)
-{
-  *aScrollWidth = mScrollWidth;
-  return NS_OK;
-}
-
-/* readonly attribute float scrollHeight; */
-NS_IMETHODIMP nsAsyncScrollEventDetail::GetScrollHeight(float *aScrollHeight)
-{
-  *aScrollHeight = mScrollHeight;
-  return NS_OK;
-}
-
deleted file mode 100644
--- a/dom/browser-element/nsAsyncScrollEventDetail.h
+++ /dev/null
@@ -1,36 +0,0 @@
-/* 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 "nsIAsyncScrollEventDetail.h"
-
-/**
- * When we send a mozbrowserasyncscroll event (an instance of CustomEvent), we
- * use an instance of this class as the event's detail.
- */
-class nsAsyncScrollEventDetail : public nsIAsyncScrollEventDetail
-{
-public:
-  nsAsyncScrollEventDetail(const float left, const float top,
-                           const float width, const float height,
-                           const float contentWidth, const float contentHeigh)
-    : mTop(top)
-    , mLeft(left)
-    , mWidth(width)
-    , mHeight(height)
-    , mScrollWidth(contentWidth)
-    , mScrollHeight(contentHeigh)
-  {}
-
-  NS_DECL_ISUPPORTS
-  NS_DECL_NSIASYNCSCROLLEVENTDETAIL
-
-private:
-  virtual ~nsAsyncScrollEventDetail() {}
-  const float mTop;
-  const float mLeft;
-  const float mWidth;
-  const float mHeight;
-  const float mScrollWidth;
-  const float mScrollHeight;
-};
deleted file mode 100644
--- a/dom/browser-element/nsIOpenWindowEventDetail.idl
+++ /dev/null
@@ -1,20 +0,0 @@
-/* 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 "nsISupports.idl"
-
-interface nsIDOMNode;
-
-/**
- * When we send a mozbrowseropenwindow event (an instance of CustomEvent), we
- * use an instance of this interface as the event's detail.
- */
-[scriptable, uuid(94377af6-956a-4adf-908b-363f7023ae1a)]
-interface nsIOpenWindowEventDetail : nsISupports
-{
-  readonly attribute AString url;
-  readonly attribute AString name;
-  readonly attribute AString features;
-  readonly attribute nsIDOMNode frameElement;
-};
deleted file mode 100644
--- a/dom/browser-element/nsOpenWindowEventDetail.cpp
+++ /dev/null
@@ -1,49 +0,0 @@
-/* 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 "nsOpenWindowEventDetail.h"
-#include "nsDOMClassInfoID.h"
-#include "nsIDOMClassInfo.h"
-#include "nsIClassInfo.h"
-#include "nsDOMClassInfo.h"
-
-NS_IMPL_CYCLE_COLLECTION_1(nsOpenWindowEventDetail, mFrameElement)
-NS_IMPL_CYCLE_COLLECTING_ADDREF(nsOpenWindowEventDetail)
-NS_IMPL_CYCLE_COLLECTING_RELEASE(nsOpenWindowEventDetail)
-NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(nsOpenWindowEventDetail)
-  NS_INTERFACE_MAP_ENTRY(nsISupports)
-  NS_INTERFACE_MAP_ENTRY(nsIOpenWindowEventDetail)
-  NS_DOM_INTERFACE_MAP_ENTRY_CLASSINFO(OpenWindowEventDetail)
-NS_INTERFACE_MAP_END
-
-DOMCI_DATA(OpenWindowEventDetail, nsOpenWindowEventDetail)
-
-NS_IMETHODIMP
-nsOpenWindowEventDetail::GetUrl(nsAString& aOut)
-{
-  aOut.Assign(mURL);
-  return NS_OK;
-}
-
-NS_IMETHODIMP
-nsOpenWindowEventDetail::GetName(nsAString& aOut)
-{
-  aOut.Assign(mName);
-  return NS_OK;
-}
-
-NS_IMETHODIMP
-nsOpenWindowEventDetail::GetFeatures(nsAString& aOut)
-{
-  aOut.Assign(mFeatures);
-  return NS_OK;
-}
-
-NS_IMETHODIMP
-nsOpenWindowEventDetail::GetFrameElement(nsIDOMNode** aOut)
-{
-  nsCOMPtr<nsIDOMNode> out = mFrameElement;
-  out.forget(aOut);
-  return NS_OK;
-}
deleted file mode 100644
--- a/dom/browser-element/nsOpenWindowEventDetail.h
+++ /dev/null
@@ -1,39 +0,0 @@
-/* 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 "nsIOpenWindowEventDetail.h"
-#include "nsIDOMNode.h"
-#include "nsCycleCollectionParticipant.h"
-#include "nsCOMPtr.h"
-#include "nsString.h"
-
-/**
- * When we send a mozbrowseropenwindow event (an instance of CustomEvent), we
- * use an instance of this class as the event's detail.
- */
-class nsOpenWindowEventDetail : public nsIOpenWindowEventDetail
-{
-public:
-  nsOpenWindowEventDetail(const nsAString& aURL,
-                          const nsAString& aName,
-                          const nsAString& aFeatures,
-                          nsIDOMNode* aFrameElement)
-    : mURL(aURL)
-    , mName(aName)
-    , mFeatures(aFeatures)
-    , mFrameElement(aFrameElement)
-  {}
-
-  virtual ~nsOpenWindowEventDetail() {}
-
-  NS_DECL_CYCLE_COLLECTING_ISUPPORTS
-  NS_DECL_CYCLE_COLLECTION_CLASS(nsOpenWindowEventDetail)
-  NS_DECL_NSIOPENWINDOWEVENTDETAIL
-
-private:
-  const nsString mURL;
-  const nsString mName;
-  const nsString mFeatures;
-  nsCOMPtr<nsIDOMNode> mFrameElement;
-};
--- a/dom/tests/mochitest/general/test_interfaces.html
+++ b/dom/tests/mochitest/general/test_interfaces.html
@@ -68,17 +68,16 @@ var ecmaGlobals =
 // IMPORTANT: Do not change this list without review from a JavaScript Engine peer!
 
 // IMPORTANT: Do not change this list without review from a DOM peer!
 var interfaceNamesInGlobalScope =
   [
     "AnalyserNode",
     "AnimationEvent",
     "ArchiveRequest",
-    "AsyncScrollEventDetail",
     "Attr",
     "Audio",
     "AudioBuffer",
     "AudioContext",
     "AudioBufferSourceNode",
     "AudioDestinationNode",
     "AudioListener",
     "AudioNode",
@@ -330,17 +329,16 @@ var interfaceNamesInGlobalScope =
     "NodeIterator",
     "NodeList",
     "NotifyAudioAvailableEvent",
     "Notification",
     "NotifyPaintEvent",
     "OfflineAudioCompletionEvent",
     "OfflineAudioContext",
     "OfflineResourceList",
-    "OpenWindowEventDetail",
     "Option",
     "OscillatorNode",
     "PageTransitionEvent",
     "PaintRequest",
     "PaintRequestList",
     "PannerNode",
     "Performance",
     "PerformanceNavigation",
new file mode 100644
--- /dev/null
+++ b/dom/webidl/BrowserElementDictionaries.webidl
@@ -0,0 +1,24 @@
+/* -*- 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/.
+ *
+ * Copyright © 2012 W3C® (MIT, ERCIM, Keio), All Rights Reserved. W3C
+ * liability, trademark and document use rules apply.
+ */
+
+dictionary AsyncScrollEventDetail {
+  float top = 0;
+  float left = 0;
+  float width = 0;
+  float height = 0;
+  float scrollWidth = 0;
+  float scrollHeight = 0;
+};
+
+dictionary OpenWindowEventDetail {
+  DOMString url = "";
+  DOMString name = "";
+  DOMString features = "";
+  Node? frameElement = null;
+};
--- a/dom/webidl/DummyBinding.webidl
+++ b/dom/webidl/DummyBinding.webidl
@@ -17,13 +17,15 @@ interface DummyInterface {
   void funcWebSocketDict(optional WebSocketDict arg);
   void funcDNSCacheDict(optional DNSCacheDict arg);
   void funcDNSLookupDict(optional DNSLookupDict arg);
   void funcConnStatusDict(optional ConnStatusDict arg);
   void frameRequestCallback(FrameRequestCallback arg);
   void CameraPictureOptions(optional CameraPictureOptions arg);
   void MmsParameters(optional MmsParameters arg);
   void MmsAttachment(optional MmsAttachment arg);
+  void AsyncScrollEventDetail(optional AsyncScrollEventDetail arg);
+  void OpenWindowEventDetail(optional OpenWindowEventDetail arg);
 };
 
 interface DummyInterfaceWorkers {
   BlobPropertyBag blobBag();
 };
--- a/dom/webidl/WebIDL.mk
+++ b/dom/webidl/WebIDL.mk
@@ -28,16 +28,17 @@ webidl_files = \
   AudioParam.webidl \
   AudioProcessingEvent.webidl \
   AudioStreamTrack.webidl \
   BarProp.webidl \
   BatteryManager.webidl \
   BeforeUnloadEvent.webidl \
   BiquadFilterNode.webidl \
   Blob.webidl \
+  BrowserElementDictionaries.webidl \
   CameraManager.webidl \
   CanvasRenderingContext2D.webidl \
   CaretPosition.webidl \
   CDATASection.webidl \
   ChannelMergerNode.webidl \
   ChannelSplitterNode.webidl \
   CharacterData.webidl \
   ChildNode.webidl \
--- a/mobile/android/installer/package-manifest.in
+++ b/mobile/android/installer/package-manifest.in
@@ -145,17 +145,16 @@
 @BINPATH@/components/dom_geolocation.xpt
 @BINPATH@/components/dom_media.xpt
 @BINPATH@/components/dom_network.xpt
 @BINPATH@/components/dom_notification.xpt
 @BINPATH@/components/dom_html.xpt
 @BINPATH@/components/dom_indexeddb.xpt
 @BINPATH@/components/dom_offline.xpt
 @BINPATH@/components/dom_json.xpt
-@BINPATH@/components/dom_browserelement.xpt
 @BINPATH@/components/dom_payment.xpt
 @BINPATH@/components/dom_power.xpt
 @BINPATH@/components/dom_quota.xpt
 @BINPATH@/components/dom_range.xpt
 @BINPATH@/components/dom_settings.xpt
 @BINPATH@/components/dom_permissionsettings.xpt
 @BINPATH@/components/dom_sidebar.xpt
 @BINPATH@/components/dom_mobilemessage.xpt