Bug 1444991 - Part 5: Make some XPCOM methods more strongly typed, r=bz
authorNika Layzell <nika@thelayzells.com>
Fri, 06 Apr 2018 18:32:25 -0400
changeset 414204 25b2e5c62dbf1c5ef699a6705fdcdd525fd35e64
parent 414203 667b0dbdc19019818ee3c42654ff18b2acaa36f6
child 414205 8e754a50cee54e4d516657e52c6fe9779df82762
push id33861
push userccoroiu@mozilla.com
push dateWed, 18 Apr 2018 10:50:38 +0000
treeherdermozilla-central@4af4ae0aee55 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbz
bugs1444991
milestone61.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 1444991 - Part 5: Make some XPCOM methods more strongly typed, r=bz This patch goes through and changes a bunch of places in our tree which mention this bug to use the new feature, making the methods more strongly typed. There are probably more places in tree which could be changed, but I didn't try to find them.
dom/base/nsDOMWindowUtils.cpp
dom/base/nsFrameLoader.cpp
dom/base/nsIDroppedLinkHandler.idl
dom/browser-element/nsIBrowserElementAPI.idl
dom/html/HTMLFormElement.cpp
dom/html/nsBrowserElement.cpp
dom/html/nsIFormSubmitObserver.idl
dom/interfaces/base/nsIBrowser.idl
dom/interfaces/base/nsIDOMWindowUtils.idl
dom/ipc/ProcessHangMonitor.cpp
dom/ipc/nsIHangReport.idl
editor/nsIEditActionListener.idl
editor/spellchecker/TextServicesDocument.cpp
layout/xul/tree/nsITreeView.idl
layout/xul/tree/nsTreeContentView.cpp
security/manager/pki/nsASN1Tree.cpp
security/manager/ssl/nsCertTree.cpp
widget/android/fennec/ThumbnailHelper.h
widget/nsBaseDragService.cpp
widget/nsIDragService.idl
widget/nsIDragSession.idl
--- a/dom/base/nsDOMWindowUtils.cpp
+++ b/dom/base/nsDOMWindowUtils.cpp
@@ -1665,17 +1665,17 @@ nsDOMWindowUtils::GetScrollbarSize(bool 
   *aWidth = nsPresContext::AppUnitsToIntCSSPixels(sizes.LeftRight());
   *aHeight = nsPresContext::AppUnitsToIntCSSPixels(sizes.TopBottom());
 
   return NS_OK;
 }
 
 NS_IMETHODIMP
 nsDOMWindowUtils::GetBoundsWithoutFlushing(nsIDOMElement *aElement,
-                                           nsISupports** aResult)
+                                           DOMRect** aResult)
 {
   nsCOMPtr<nsPIDOMWindowOuter> window = do_QueryReferent(mWindow);
   NS_ENSURE_STATE(window);
 
   nsresult rv;
   nsCOMPtr<nsIContent> content = do_QueryInterface(aElement, &rv);
   NS_ENSURE_SUCCESS(rv, rv);
 
@@ -1734,17 +1734,17 @@ nsDOMWindowUtils::FlushLayoutWithoutThro
     doc->FlushPendingNotifications(
       ChangesToFlush(FlushType::Layout, false /* flush animations */));
   }
 
   return NS_OK;
 }
 
 NS_IMETHODIMP
-nsDOMWindowUtils::GetRootBounds(nsISupports** aResult)
+nsDOMWindowUtils::GetRootBounds(DOMRect** aResult)
 {
   nsIDocument* doc = GetDocument();
   NS_ENSURE_STATE(doc);
 
   nsRect bounds(0, 0, 0, 0);
   nsIPresShell* presShell = doc->GetShell();
   if (presShell) {
     nsIScrollableFrame* sf = presShell->GetRootScrollFrameAsScrollable();
--- a/dom/base/nsFrameLoader.cpp
+++ b/dom/base/nsFrameLoader.cpp
@@ -2517,19 +2517,18 @@ GetContentParent(Element* aBrowser)
 {
   using ReturnTuple = Tuple<ContentParent*, TabParent*>;
 
   nsCOMPtr<nsIBrowser> browser = do_QueryInterface(aBrowser);
   if (!browser) {
     return ReturnTuple(nullptr, nullptr);
   }
 
-  nsCOMPtr<nsISupports> otherLoaderAsSupports;
-  browser->GetSameProcessAsFrameLoader(getter_AddRefs(otherLoaderAsSupports));
-  RefPtr<nsFrameLoader> otherLoader = do_QueryObject(otherLoaderAsSupports);
+  RefPtr<nsFrameLoader> otherLoader;
+  browser->GetSameProcessAsFrameLoader(getter_AddRefs(otherLoader));
   if (!otherLoader) {
     return ReturnTuple(nullptr, nullptr);
   }
 
   TabParent* tabParent = TabParent::GetFrom(otherLoader);
   if (tabParent &&
       tabParent->Manager() &&
       tabParent->Manager()->IsContentParent()) {
--- a/dom/base/nsIDroppedLinkHandler.idl
+++ b/dom/base/nsIDroppedLinkHandler.idl
@@ -2,16 +2,19 @@
  * 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"
 #include "nsIPrincipal.idl"
 
 interface nsIDOMEvent;
 
+webidl DragEvent;
+webidl DataTransfer;
+
 [scriptable, uuid(69E14F91-2E09-4CA6-A511-A715C99A2804)]
 interface nsIDroppedLinkItem : nsISupports
 {
   /**
    * Returns the URL of the link.
    */
   readonly attribute DOMString url;
 
@@ -32,20 +35,18 @@ interface nsIDroppedLinkHandler : nsISup
   /**
    * Determines if a link being dragged can be dropped and returns true if so.
    * aEvent should be a dragenter or dragover event.
    *
    * If aAllowSameDocument is false, drops are only allowed if the document
    * of the source of the drag is different from the destination. This check
    * includes any parent, sibling and child frames in the same content tree.
    * If true, the source is not checked.
-   *
-   * aEvent should be a DragEvent.  See bug 1444991.
    */
-  boolean canDropLink(in nsIDOMEvent aEvent, in boolean aAllowSameDocument);
+  boolean canDropLink(in DragEvent aEvent, in boolean aAllowSameDocument);
 
   /**
    * Given a drop event aEvent, determines the link being dragged and returns
    * it. If a uri is returned the caller can, for instance, load it. If null
    * is returned, there is no valid link to be dropped.
    *
    * A NS_ERROR_DOM_SECURITY_ERR error will be thrown and the event cancelled if
    * the receiving target should not load the uri for security reasons. This
@@ -53,67 +54,57 @@ interface nsIDroppedLinkHandler : nsISup
    *  - the source of the drag initiated a link for dragging that
    *    it itself cannot access. This prevents a source document from tricking
    *    the user into a dragging a chrome url, for example.
    *  - aDisallowInherit is true, and the URI being dropped would inherit the
    *    current document's security context (URI_INHERITS_SECURITY_CONTEXT).
    *
    * aName is filled in with the link title if it exists, or an empty string
    * otherwise.
-   *
-   * aEvent should be a DragEvent.  See bug 1444991.
    */
-  AString dropLink(in nsIDOMEvent aEvent, out AString aName,
+  AString dropLink(in DragEvent aEvent, out AString aName,
                    [optional] in boolean aDisallowInherit);
 
   /**
    * Given a drop event aEvent, determines links being dragged and returns
    * them. If links are returned the caller can, for instance, load them. If
    * the count of links is 0, there is no valid link to be dropped.
    *
    * A NS_ERROR_DOM_SECURITY_ERR error will be thrown and the event cancelled if
    * the receiving target should not load the uri for security reasons. This
    * will occur if any of the following conditions are true:
    *  - the source of the drag initiated a link for dragging that
    *    it itself cannot access. This prevents a source document from tricking
    *    the user into a dragging a chrome url, for example.
    *  - aDisallowInherit is true, and the URI being dropped would inherit the
    *    current document's security context (URI_INHERITS_SECURITY_CONTEXT).
-   *
-   * aEvent should be a DragEvent.  See bug 1444991.
    */
-  void dropLinks(in nsIDOMEvent aEvent,
+  void dropLinks(in DragEvent aEvent,
                  [optional] in boolean aDisallowInherit,
                  [optional] out unsigned long aCount,
                  [retval, array, size_is(aCount)] out nsIDroppedLinkItem aLinks);
 
   /**
    * Given a drop event aEvent, validate the extra URIs for the event,
    * this is used when the caller extracts yet another URIs from the dropped
    * text, like home button that splits the text with "|".
-   *
-   * aEvent should be a DragEvent.  See bug 1444991.
    */
-  void validateURIsForDrop(in nsIDOMEvent aEvent,
+  void validateURIsForDrop(in DragEvent aEvent,
                            in unsigned long aURIsCount,
                            [array, size_is(aURIsCount)] in wstring aURIs,
                            [optional] in boolean aDisallowInherit);
 
   /**
    * Given a dataTransfer, allows caller to determine and verify links being
    * dragged. Since drag/drop performs a roundtrip of parent, child, parent,
    * it allows the parent to verify that the child did not modify links
    * being dropped.
-   *
-   * @param dataTransfer is a DataTransfer.  See bug 1444991.
    */
-  void queryLinks(in nsISupports aDataTransfer,
+  void queryLinks(in DataTransfer aDataTransfer,
                   [optional] out unsigned long aCount,
                   [retval, array, size_is(aCount)] out nsIDroppedLinkItem aLinks);
 
   /**
    * Given a drop event aEvent, determines the triggering principal for the
    * event and returns it.
-   *
-   * aEvent should be a DragEvent.  See bug 1444991.
    */
-  nsIPrincipal getTriggeringPrincipal(in nsIDOMEvent aEvent);
+  nsIPrincipal getTriggeringPrincipal(in DragEvent aEvent);
 };
--- a/dom/browser-element/nsIBrowserElementAPI.idl
+++ b/dom/browser-element/nsIBrowserElementAPI.idl
@@ -3,16 +3,18 @@
 /* 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 nsIDOMDOMRequest;
 
+webidl FrameLoader;
+
 [scriptable, function, uuid(00d0e19d-bd67-491f-8e85-b9905224d3bb)]
 interface nsIBrowserElementNextPaintListener : nsISupports
 {
   void recvNextPaint();
 };
 
 %{C++
 #define BROWSER_ELEMENT_API_CONTRACTID "@mozilla.org/dom/browser-element-api;1"
@@ -34,18 +36,17 @@ interface nsIBrowserElementAPI : nsISupp
   const long FIND_FORWARD = 0;
   const long FIND_BACKWARD = 1;
 
   /**
    * Notify frame scripts that support the API to destroy.
    */
   void destroyFrameScripts();
 
-  // The argument should be a FrameLoader.  Fix that when bug 1444991 is fixed.
-  void setFrameLoader(in nsISupports frameLoader);
+  void setFrameLoader(in FrameLoader frameLoader);
 
   void sendMouseEvent(in DOMString type,
                       in uint32_t x,
                       in uint32_t y,
                       in uint32_t button,
                       in uint32_t clickCount,
                       in uint32_t mifiers);
   void sendTouchEvent(in DOMString aType,
--- a/dom/html/HTMLFormElement.cpp
+++ b/dom/html/HTMLFormElement.cpp
@@ -974,17 +974,17 @@ HTMLFormElement::NotifySubmitObservers(n
 
     bool loop = true;
     while (NS_SUCCEEDED(theEnum->HasMoreElements(&loop)) && loop) {
       theEnum->GetNext(getter_AddRefs(inst));
 
       nsCOMPtr<nsIFormSubmitObserver> formSubmitObserver(
                       do_QueryInterface(inst));
       if (formSubmitObserver) {
-        rv = formSubmitObserver->Notify(static_cast<nsIContent*>(this),
+        rv = formSubmitObserver->Notify(this,
                                         window ? window->GetCurrentInnerWindow() : nullptr,
                                         aActionURL,
                                         aCancelSubmit);
         NS_ENSURE_SUCCESS(rv, rv);
       }
       if (*aCancelSubmit) {
         return NS_OK;
       }
@@ -1972,17 +1972,17 @@ HTMLFormElement::CheckValidFormSubmissio
       nsCOMPtr<nsISupports> inst;
       nsCOMPtr<nsIFormSubmitObserver> observer;
       bool more = true;
       while (NS_SUCCEEDED(theEnum->HasMoreElements(&more)) && more) {
         theEnum->GetNext(getter_AddRefs(inst));
         observer = do_QueryInterface(inst);
 
         if (observer) {
-          observer->NotifyInvalidSubmit(static_cast<nsIContent*>(this),
+          observer->NotifyInvalidSubmit(this,
                                         static_cast<nsIArray*>(invalidElements));
         }
       }
 
       // The form is invalid. Observers have been alerted. Do not submit.
       return false;
     }
   } else {
--- a/dom/html/nsBrowserElement.cpp
+++ b/dom/html/nsBrowserElement.cpp
@@ -46,17 +46,17 @@ nsBrowserElement::InitBrowserElementAPI(
   }
 
   if (!mBrowserElementAPI) {
     mBrowserElementAPI = do_CreateInstance("@mozilla.org/dom/browser-element-api;1");
     if (NS_WARN_IF(!mBrowserElementAPI)) {
       return;
     }
   }
-  mBrowserElementAPI->SetFrameLoader(ToSupports(frameLoader));
+  mBrowserElementAPI->SetFrameLoader(frameLoader);
 }
 
 void
 nsBrowserElement::DestroyBrowserElementFrameScripts()
 {
   if (!mBrowserElementAPI) {
     return;
   }
--- a/dom/html/nsIFormSubmitObserver.idl
+++ b/dom/html/nsIFormSubmitObserver.idl
@@ -5,24 +5,24 @@
 
 
 #include "nsISupports.idl"
 
 interface mozIDOMWindow;
 interface nsIURI;
 interface nsIArray;
 
+webidl HTMLFormElement;
+
 [scriptable, uuid(867cb7e7-835d-408b-9788-d2834d284e03)]
 interface nsIFormSubmitObserver: nsISupports
 {
-  // formNode must be a HTMLFormElement (bug 1444991 can clean it up)
-  void notify(in nsISupports formNode, in mozIDOMWindow window, in nsIURI actionURL, out boolean cancelSubmit);
+  void notify(in HTMLFormElement formNode, in mozIDOMWindow window, in nsIURI actionURL, out boolean cancelSubmit);
 
-  // formNode must be a HTMLFormElement (bug 1444991 can clean it up)
-  void notifyInvalidSubmit(in nsISupports formNode,
+  void notifyInvalidSubmit(in HTMLFormElement formNode,
                            in nsIArray invalidElements);
 };
 
 %{C++
 #define NS_FORMSUBMIT_SUBJECT "formsubmit"
 #define NS_EARLYFORMSUBMIT_SUBJECT "earlyformsubmit"
 #define NS_FIRST_FORMSUBMIT_CATEGORY "firstformsubmit"
 #define NS_PASSWORDMANAGER_CATEGORY "passwordmanager"
--- a/dom/interfaces/base/nsIBrowser.idl
+++ b/dom/interfaces/base/nsIBrowser.idl
@@ -1,29 +1,28 @@
 /* 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 nsIPrincipal;
 
+webidl FrameLoader;
+
 [scriptable, uuid(14e5a0cb-e223-4202-95e8-fe53275193ea)]
 interface nsIBrowser : nsISupports
 {
   /**
    * Gets an optional frame loader that is "related" to this browser.
    * If this exists, then we should attempt to use the same content parent as
    * this frame loader for any new tab parents.  For example, view source
    * browsers set this to the frame loader for the original content to ensure
    * they are loaded in the same process as the content.
-   *
-   * This returns a FrameLoader, but we have no good way to represent
-   * one in xpidl.  Fix this when bug 1444991 is fixed.
    */
-  readonly attribute nsISupports sameProcessAsFrameLoader;
+  readonly attribute FrameLoader sameProcessAsFrameLoader;
 
   /*
    * Called by the child to inform the parent that links are dropped into
    * content area.
    *
    * @param linksCount length of links
    * @param links a flat array of url, name, and type for each link
    * @param triggeringPrincipal a principal that initiated loading
--- a/dom/interfaces/base/nsIDOMWindowUtils.idl
+++ b/dom/interfaces/base/nsIDOMWindowUtils.idl
@@ -44,16 +44,18 @@ interface nsIURI;
 interface nsIDOMEventTarget;
 interface nsIRunnable;
 interface nsITranslationNodeList;
 interface nsIJSRAIIHelper;
 interface nsIContentPermissionRequest;
 interface nsIObserver;
 interface nsIDOMStorage;
 
+webidl DOMRect;
+
 [scriptable, uuid(4d6732ca-9da7-4176-b8a1-8dde15cd0bf9)]
 interface nsIDOMWindowUtils : nsISupports {
 
   /**
    * Image animation mode of the window. When this attribute's value
    * is changed, the implementation should set all images in the window
    * to the given value. That is, when set to kDontAnimMode, all images
    * will stop animating. The attribute's value must be one of the
@@ -837,19 +839,18 @@ interface nsIDOMWindowUtils : nsISupport
    * Returns the scrollbar width of the window's scroll frame.
    *
    * @param aFlushLayout flushes layout if true. Otherwise, no flush occurs.
    */
   void getScrollbarSize(in boolean aFlushLayout, out long aWidth, out long aHeight);
 
   /**
    * Returns the given element's bounds without flushing pending layout changes.
-   * The returned object is a DOMRect (bug 1444991 may remove this walkaround).
    */
-  nsISupports getBoundsWithoutFlushing(in nsIDOMElement aElement);
+  DOMRect getBoundsWithoutFlushing(in nsIDOMElement aElement);
 
   const long FLUSH_NONE = -1;
   const long FLUSH_STYLE = 0;
   const long FLUSH_LAYOUT = 1;
   const long FLUSH_DISPLAY = 2;
 
   /**
    * Returns true if a flush of the given type is needed.
@@ -861,19 +862,18 @@ interface nsIDOMWindowUtils : nsISupport
    * animations.
    */
   void flushLayoutWithoutThrottledAnimations();
 
   /**
    * Returns the bounds of the window's currently loaded document. This will
    * generally be (0, 0, pageWidth, pageHeight) but in some cases (e.g. RTL
    * documents) may have a negative left value.
-   * The returned object is a DOMRect (bug 1444991 may remove this walkaround).
    */
-  nsISupports getRootBounds();
+  DOMRect getRootBounds();
 
   /**
    * Get IME open state. TRUE means 'Open', otherwise, 'Close'.
    * This property works only when IMEEnabled is IME_STATUS_ENABLED.
    */
   readonly attribute boolean IMEIsOpen;
 
   /**
--- a/dom/ipc/ProcessHangMonitor.cpp
+++ b/dom/ipc/ProcessHangMonitor.cpp
@@ -179,17 +179,17 @@ public:
 
   NS_IMETHOD TerminateScript() override;
   NS_IMETHOD TerminateGlobal() override;
   NS_IMETHOD BeginStartingDebugger() override;
   NS_IMETHOD EndStartingDebugger() override;
   NS_IMETHOD TerminatePlugin() override;
   NS_IMETHOD UserCanceled() override;
 
-  NS_IMETHOD IsReportForBrowser(nsISupports* aFrameLoader, bool* aResult) override;
+  NS_IMETHOD IsReportForBrowser(nsFrameLoader* aFrameLoader, bool* aResult) override;
 
   // Called when a content process shuts down.
   void Clear() {
     mContentParent = nullptr;
     mActor = nullptr;
   }
 
   /**
@@ -1119,29 +1119,28 @@ HangMonitoredProcess::TerminatePlugin()
                            contentPid,
                            NS_LITERAL_CSTRING("HangMonitor"),
                            mDumpId,
                            Move(callback));
   return NS_OK;
 }
 
 NS_IMETHODIMP
-HangMonitoredProcess::IsReportForBrowser(nsISupports* aFrameLoader, bool* aResult)
+HangMonitoredProcess::IsReportForBrowser(nsFrameLoader* aFrameLoader, bool* aResult)
 {
   MOZ_RELEASE_ASSERT(NS_IsMainThread());
 
   if (!mActor) {
     *aResult = false;
     return NS_OK;
   }
 
-  RefPtr<nsFrameLoader> frameLoader = do_QueryObject(aFrameLoader);
-  NS_ENSURE_STATE(frameLoader);
+  NS_ENSURE_STATE(aFrameLoader);
 
-  TabParent* tp = TabParent::GetFrom(frameLoader);
+  TabParent* tp = TabParent::GetFrom(aFrameLoader);
   if (!tp) {
     *aResult = false;
     return NS_OK;
   }
 
   *aResult = mContentParent == tp->Manager();
   return NS_OK;
 }
--- a/dom/ipc/nsIHangReport.idl
+++ b/dom/ipc/nsIHangReport.idl
@@ -3,16 +3,18 @@
 /* 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 nsIDOMElement;
 
+webidl FrameLoader;
+
 /**
  * When a content process hangs, Gecko notifies "process-hang-report" observers
  * and passes an nsIHangReport for the subject parameter. There is at most one
  * nsIHangReport associated with a given content process. As long as the content
  * process stays stuck, the "process-hang-report" observer will continue to be
  * notified at regular intervals (approximately once per second). The content
  * process will continue to run uninhibitedly during this time.
  */
@@ -60,11 +62,11 @@ interface nsIHangReport : nsISupports
 
   // Inform the content process that the slow script debugger has finished
   // spinning up. The content process will run a nested event loop until this
   // method is called.
   // Only valid for SLOW_SCRIPT reports.
   void endStartingDebugger();
 
   // Inquire whether the report is for a content process loaded by the given
-  // frameloader.  Make this take a FrameLoader once bug 1444991 is fixed.
-  bool isReportForBrowser(in nsISupports aFrameLoader);
+  // frameloader.
+  bool isReportForBrowser(in FrameLoader aFrameLoader);
 };
--- a/editor/nsIEditActionListener.idl
+++ b/editor/nsIEditActionListener.idl
@@ -3,16 +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 "nsISupports.idl"
 #include "domstubs.idl"
 
 interface nsISelection;
 
+webidl CharacterData;
 
 /*
 Editor Action Listener interface to outside world
 */
 
 
 /**
  * A generic editor action listener interface.
@@ -74,47 +75,47 @@ interface nsIEditActionListener : nsISup
    */
   void DidJoinNodes(in nsIDOMNode aLeftNode,
                           in nsIDOMNode aRightNode,
                           in nsIDOMNode aParent,
                           in nsresult    aResult);
 
   /**
    * Called after the editor inserts text.
-   * @param aTextNode   This node getting inserted text.  Should be a CharacterData after bug 1444991.
+   * @param aTextNode   This node getting inserted text.
    * @param aOffset     The offset in aTextNode to insert at.
    * @param aString     The string that gets inserted.
    * @param aResult     The result of the insert text operation.
    */
-  void DidInsertText(in nsISupports aTextNode,
+  void DidInsertText(in CharacterData       aTextNode,
                      in long                aOffset,
                      in DOMString           aString,
                      in nsresult            aResult);
 
   /**
    * Called before the editor deletes text.
-   * @param aTextNode   This node getting text deleted.  Should be a CharacterData after bug 1444991.
+   * @param aTextNode   This node getting text deleted.
    * @param aOffset     The offset in aTextNode to delete at.
    * @param aLength     The amount of text to delete.
    */
-  void WillDeleteText(in nsISupports aTextNode,
+  void WillDeleteText(in CharacterData       aTextNode,
                       in long                aOffset,
                       in long                aLength);
 
   /**
    * Called before the editor deletes text.
-   * @param aTextNode   This node getting text deleted.  Should be a CharacterData after bug 1444991.
+   * @param aTextNode   This node getting text deleted.
    * @param aOffset     The offset in aTextNode to delete at.
    * @param aLength     The amount of text to delete.
    * @param aResult     The result of the delete text operation.
    */
-  void DidDeleteText(in nsISupports aTextNode,
+  void DidDeleteText(in CharacterData       aTextNode,
                      in long                aOffset,
                      in long                aLength,
-                     in nsresult              aResult);
+                     in nsresult            aResult);
 
   /**
    * Called before the editor deletes the selection.
    * @param aSelection   The selection to be deleted
    */
   void WillDeleteSelection(in nsISelection aSelection);
 
   /**
--- a/editor/spellchecker/TextServicesDocument.cpp
+++ b/editor/spellchecker/TextServicesDocument.cpp
@@ -3215,34 +3215,34 @@ NS_IMETHODIMP
 TextServicesDocument::DidCreateNode(const nsAString& aTag,
                                     nsIDOMNode* aNewNode,
                                     nsresult aResult)
 {
   return NS_OK;
 }
 
 NS_IMETHODIMP
-TextServicesDocument::DidInsertText(nsISupports* aTextNode,
+TextServicesDocument::DidInsertText(CharacterData* aTextNode,
                                     int32_t aOffset,
                                     const nsAString& aString,
                                     nsresult aResult)
 {
   return NS_OK;
 }
 
 NS_IMETHODIMP
-TextServicesDocument::WillDeleteText(nsISupports* aTextNode,
+TextServicesDocument::WillDeleteText(CharacterData* aTextNode,
                                      int32_t aOffset,
                                      int32_t aLength)
 {
   return NS_OK;
 }
 
 NS_IMETHODIMP
-TextServicesDocument::DidDeleteText(nsISupports* aTextNode,
+TextServicesDocument::DidDeleteText(CharacterData* aTextNode,
                                     int32_t aOffset,
                                     int32_t aLength,
                                     nsresult aResult)
 {
   return NS_OK;
 }
 
 NS_IMETHODIMP
--- a/layout/xul/tree/nsITreeView.idl
+++ b/layout/xul/tree/nsITreeView.idl
@@ -4,16 +4,18 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "nsISupports.idl"
 
 interface nsITreeBoxObject;
 interface nsITreeSelection;
 interface nsITreeColumn;
 
+webidl DataTransfer;
+
 [scriptable, uuid(091116f0-0bdc-4b32-b9c8-c8d5a37cb088)]
 interface nsITreeView : nsISupports
 {
   /**
    * The total number of rows in the tree (including the offscreen rows).
    */
   readonly attribute long rowCount;
 
@@ -70,28 +72,24 @@ interface nsITreeView : nsISupports
   const short DROP_BEFORE = -1;
   const short DROP_ON = 0;
   const short DROP_AFTER = 1;
   /**
    * Methods used by the drag feedback code to determine if a drag is allowable at
    * the current location. To get the behavior where drops are only allowed on
    * items, such as the mailNews folder pane, always return false when
    * the orientation is not DROP_ON.
-   *
-   * @param dataTransfer should be a DataTransfer once bug 1444991 is fixed.
    */
-  boolean canDrop(in long index, in long orientation, in nsISupports dataTransfer);
+  boolean canDrop(in long index, in long orientation, in DataTransfer dataTransfer);
 
   /**
    * Called when the user drops something on this view. The |orientation| param
    * specifies before/on/after the given |row|.
-   *
-   * @param dataTransfer should be a DataTransfer once bug 1444991 is fixed.
    */
-  void drop(in long row, in long orientation, in nsISupports dataTransfer);
+  void drop(in long row, in long orientation, in DataTransfer dataTransfer);
 
   /**
    * Methods used by the tree to draw thread lines in the tree.
    * getParentIndex is used to obtain the index of a parent row.
    * If there is no parent row, getParentIndex returns -1.
    */
   long getParentIndex(in long rowIndex);
 
--- a/layout/xul/tree/nsTreeContentView.cpp
+++ b/layout/xul/tree/nsTreeContentView.cpp
@@ -363,17 +363,17 @@ bool
 nsTreeContentView::CanDrop(int32_t aRow, int32_t aOrientation,
                            DataTransfer* aDataTransfer, ErrorResult& aError)
 {
   return CanDrop(aRow, aOrientation, aError);
 }
 
 NS_IMETHODIMP
 nsTreeContentView::CanDrop(int32_t aIndex, int32_t aOrientation,
-                           nsISupports* aDataTransfer, bool *_retval)
+                           DataTransfer* aDataTransfer, bool *_retval)
 {
   ErrorResult rv;
   *_retval = CanDrop(aIndex, aOrientation, rv);
   return rv.StealNSResult();
 }
 
 void
 nsTreeContentView::Drop(int32_t aRow, int32_t aOrientation, ErrorResult& aError)
@@ -387,17 +387,17 @@ void
 nsTreeContentView::Drop(int32_t aRow, int32_t aOrientation,
                         DataTransfer* aDataTransfer, ErrorResult& aError)
 {
   Drop(aRow, aOrientation, aError);
 }
 
 NS_IMETHODIMP
 nsTreeContentView::Drop(int32_t aRow, int32_t aOrientation,
-                        nsISupports* aDataTransfer)
+                        DataTransfer* aDataTransfer)
 {
   ErrorResult rv;
   Drop(aRow, aOrientation, rv);
   return rv.StealNSResult();
 }
 
 int32_t
 nsTreeContentView::GetParentIndex(int32_t aRow, ErrorResult& aError)
--- a/security/manager/pki/nsASN1Tree.cpp
+++ b/security/manager/pki/nsASN1Tree.cpp
@@ -393,25 +393,25 @@ nsNSSASN1Tree::PerformActionOnRow(const 
 
 NS_IMETHODIMP
 nsNSSASN1Tree::PerformActionOnCell(const char16_t*, int32_t, nsITreeColumn*)
 {
   return NS_OK;
 }
 
 NS_IMETHODIMP
-nsNSSASN1Tree::CanDrop(int32_t, int32_t, nsISupports*, bool* _retval)
+nsNSSASN1Tree::CanDrop(int32_t, int32_t, mozilla::dom::DataTransfer*, bool* _retval)
 {
   NS_ENSURE_ARG_POINTER(_retval);
   *_retval = false;
   return NS_OK;
 }
 
 NS_IMETHODIMP
-nsNSSASN1Tree::Drop(int32_t, int32_t, nsISupports*)
+nsNSSASN1Tree::Drop(int32_t, int32_t, mozilla::dom::DataTransfer*)
 {
   return NS_OK;
 }
 
 NS_IMETHODIMP
 nsNSSASN1Tree::IsSorted(bool* _retval)
 {
   NS_ENSURE_ARG_POINTER(_retval);
--- a/security/manager/ssl/nsCertTree.cpp
+++ b/security/manager/ssl/nsCertTree.cpp
@@ -1219,30 +1219,31 @@ nsCertTree::dumpMap()
   }
 }
 #endif
 
 //
 // CanDrop
 //
 NS_IMETHODIMP nsCertTree::CanDrop(int32_t index, int32_t orientation,
-                                  nsISupports* aDataTransfer, bool *_retval)
+                                  mozilla::dom::DataTransfer* aDataTransfer,
+                                  bool *_retval)
 {
   NS_ENSURE_ARG_POINTER(_retval);
   *_retval = false;
 
   return NS_OK;
 }
 
 
 //
 // Drop
 //
 NS_IMETHODIMP nsCertTree::Drop(int32_t row, int32_t orient,
-			       nsISupports* aDataTransfer)
+			                         mozilla::dom::DataTransfer* aDataTransfer)
 {
   return NS_OK;
 }
 
 
 //
 // IsSorted
 //
--- a/widget/android/fennec/ThumbnailHelper.h
+++ b/widget/android/fennec/ThumbnailHelper.h
@@ -235,26 +235,24 @@ public:
         if (!window || !aData) {
             java::ThumbnailHelper::NotifyThumbnail(
                     aData, aTab, /* success */ false, /* store */ false);
             return;
         }
 
         // take a screenshot, as wide as possible, proportional to the destination size
         nsCOMPtr<nsIDOMWindowUtils> utils = do_GetInterface(window);
-        nsCOMPtr<nsISupports> rectSupports;
+        RefPtr<DOMRect> rect;
         if (!utils ||
-                NS_FAILED(utils->GetRootBounds(getter_AddRefs(rectSupports))) ||
-                !rectSupports) {
+                NS_FAILED(utils->GetRootBounds(getter_AddRefs(rect))) ||
+                !rect) {
             java::ThumbnailHelper::NotifyThumbnail(
                     aData, aTab, /* success */ false, /* store */ false);
             return;
         }
-        // this is safe, as GetRootBounds returns a DOMRect instance.
-        DOMRect* rect = DOMRect::FromSupports(rectSupports);
         float pageLeft = rect->Left();
         float pageTop = rect->Top();
         float pageWidth = rect->Width();
         float pageHeight = rect->Height();
         if (int32_t(pageWidth) == 0 || int32_t(pageHeight) == 0) {
             java::ThumbnailHelper::NotifyThumbnail(
                     aData, aTab, /* success */ false, /* store */ false);
             return;
--- a/widget/nsBaseDragService.cpp
+++ b/widget/nsBaseDragService.cpp
@@ -199,29 +199,28 @@ nsBaseDragService::GetData(nsITransferab
 NS_IMETHODIMP
 nsBaseDragService::IsDataFlavorSupported(const char *aDataFlavor,
                                          bool *_retval)
 {
   return NS_ERROR_FAILURE;
 }
 
 NS_IMETHODIMP
-nsBaseDragService::GetDataTransferXPCOM(nsISupports** aDataTransfer)
+nsBaseDragService::GetDataTransferXPCOM(DataTransfer** aDataTransfer)
 {
   *aDataTransfer = mDataTransfer;
   NS_IF_ADDREF(*aDataTransfer);
   return NS_OK;
 }
 
 NS_IMETHODIMP
-nsBaseDragService::SetDataTransferXPCOM(nsISupports* aDataTransfer)
+nsBaseDragService::SetDataTransferXPCOM(DataTransfer* aDataTransfer)
 {
-  RefPtr<DataTransfer> dataTransfer = do_QueryObject(aDataTransfer);
-  NS_ENSURE_STATE(dataTransfer);
-  mDataTransfer = dataTransfer.forget();
+  NS_ENSURE_STATE(aDataTransfer);
+  mDataTransfer = aDataTransfer;
   return NS_OK;
 }
 
 DataTransfer*
 nsBaseDragService::GetDataTransfer()
 {
   return mDataTransfer;
 }
@@ -276,38 +275,33 @@ nsBaseDragService::InvokeDragSession(nsI
 NS_IMETHODIMP
 nsBaseDragService::InvokeDragSessionWithImage(nsIDOMNode* aDOMNode,
                                               const nsACString& aPrincipalURISpec,
                                               nsIArray* aTransferableArray,
                                               nsIScriptableRegion* aRegion,
                                               uint32_t aActionType,
                                               nsIDOMNode* aImage,
                                               int32_t aImageX, int32_t aImageY,
-                                              nsIDOMEvent* aDragEvent,
+                                              DragEvent* aDragEvent,
                                               DataTransfer* aDataTransfer)
 {
   NS_ENSURE_TRUE(aDragEvent, NS_ERROR_NULL_POINTER);
   NS_ENSURE_TRUE(aDataTransfer, NS_ERROR_NULL_POINTER);
   NS_ENSURE_TRUE(mSuppressLevel == 0, NS_ERROR_FAILURE);
 
   mDataTransfer = aDataTransfer;
   mSelection = nullptr;
   mHasImage = true;
   mDragPopup = nullptr;
   mImage = aImage;
   mImageOffset = CSSIntPoint(aImageX, aImageY);
 
-  DragEvent* dragEvent = aDragEvent->InternalDOMEvent()->AsDragEvent();
-  if (NS_WARN_IF(!dragEvent)) {
-    return NS_ERROR_INVALID_ARG;
-  }
-
-  mScreenPosition.x = dragEvent->ScreenX(CallerType::System);
-  mScreenPosition.y = dragEvent->ScreenY(CallerType::System);
-  mInputSource = dragEvent->MozInputSource();
+  mScreenPosition.x = aDragEvent->ScreenX(CallerType::System);
+  mScreenPosition.y = aDragEvent->ScreenY(CallerType::System);
+  mInputSource = aDragEvent->MozInputSource();
 
   nsresult rv = InvokeDragSession(aDOMNode, aPrincipalURISpec,
                                   aTransferableArray,
                                   aRegion, aActionType,
                                   nsIContentPolicy::TYPE_INTERNAL_IMAGE);
 
   if (NS_FAILED(rv)) {
     mImage = nullptr;
@@ -318,38 +312,33 @@ nsBaseDragService::InvokeDragSessionWith
   return rv;
 }
 
 NS_IMETHODIMP
 nsBaseDragService::InvokeDragSessionWithSelection(nsISelection* aSelection,
                                                   const nsACString& aPrincipalURISpec,
                                                   nsIArray* aTransferableArray,
                                                   uint32_t aActionType,
-                                                  nsIDOMEvent* aDragEvent,
+                                                  DragEvent* aDragEvent,
                                                   DataTransfer* aDataTransfer)
 {
   NS_ENSURE_TRUE(aSelection, NS_ERROR_NULL_POINTER);
   NS_ENSURE_TRUE(aDragEvent, NS_ERROR_NULL_POINTER);
   NS_ENSURE_TRUE(mSuppressLevel == 0, NS_ERROR_FAILURE);
 
   mDataTransfer = aDataTransfer;
   mSelection = aSelection ? aSelection->AsSelection() : nullptr;
   mHasImage = true;
   mDragPopup = nullptr;
   mImage = nullptr;
   mImageOffset = CSSIntPoint();
 
-  DragEvent* dragEvent = aDragEvent->InternalDOMEvent()->AsDragEvent();
-  if (NS_WARN_IF(!dragEvent)) {
-    return NS_ERROR_INVALID_ARG;
-  }
-
-  mScreenPosition.x = dragEvent->ScreenX(CallerType::System);
-  mScreenPosition.y = dragEvent->ScreenY(CallerType::System);
-  mInputSource = dragEvent->MozInputSource();
+  mScreenPosition.x = aDragEvent->ScreenX(CallerType::System);
+  mScreenPosition.y = aDragEvent->ScreenY(CallerType::System);
+  mInputSource = aDragEvent->MozInputSource();
 
   // just get the focused node from the selection
   // XXXndeakin this should actually be the deepest node that contains both
   // endpoints of the selection
   nsCOMPtr<nsIDOMNode> node;
   aSelection->GetFocusNode(getter_AddRefs(node));
 
   nsresult rv = InvokeDragSession(node, aPrincipalURISpec,
--- a/widget/nsIDragService.idl
+++ b/widget/nsIDragService.idl
@@ -9,16 +9,18 @@
 #include "nsIDragSession.idl"
 #include "nsIScriptableRegion.idl"
 #include "nsIContentPolicy.idl"
 
 interface nsIDOMNode;
 interface nsIDOMEvent;
 interface nsISelection;
 
+webidl DragEvent;
+
 %{C++
 #include "mozilla/EventForwards.h"
 
 namespace mozilla {
 namespace dom {
 class ContentParent;
 class DataTransfer;
 } // namespace dom
@@ -81,45 +83,41 @@ interface nsIDragService : nsISupports
    * <canvas>, the drag image is taken from the image data. If the element is in
    * a document, it will be rendered at its displayed size, othewise, it will be
    * rendered at its real size. For other types of elements, the element is
    * rendered into an offscreen buffer in the same manner as it is currently
    * displayed. The document selection is hidden while drawing.
    *
    * The aDragEvent must be supplied as the current screen coordinates of the
    * event are needed to calculate the image location.
-   *
-   * aDragEvent should be a DragEvent.  See bug 1444991.
    */
   [noscript]
   void invokeDragSessionWithImage(in nsIDOMNode aDOMNode,
                                   in AUTF8String aPrincipalURISpec,
                                   in nsIArray aTransferableArray,
                                   in nsIScriptableRegion aRegion,
                                   in unsigned long aActionType,
                                   in nsIDOMNode aImage,
                                   in long aImageX,
                                   in long aImageY,
-                                  in nsIDOMEvent aDragEvent,
+                                  in DragEvent aDragEvent,
                                   in DataTransferPtr aDataTransfer);
 
   /**
    * Start a modal drag session using the selection as the drag image.
    * The aDragEvent must be supplied as the current screen coordinates of the
    * event are needed to calculate the image location.
    *
    * Note: This method is deprecated for non-native code.
-   *
-   * aDragEvent should be a DragEvent.  See bug 1444991.
    */
   void invokeDragSessionWithSelection(in nsISelection aSelection,
                                       in AUTF8String aPrincipalURISpec,
                                       in nsIArray aTransferableArray,
                                       in unsigned long aActionType,
-                                      in nsIDOMEvent aDragEvent,
+                                      in DragEvent aDragEvent,
                                       in DataTransferPtr aDataTransfer);
 
   /**
     * Returns the current Drag Session
     */
   nsIDragSession getCurrentSession();
 
   /**
--- a/widget/nsIDragSession.idl
+++ b/widget/nsIDragSession.idl
@@ -5,30 +5,25 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "nsISupports.idl"
 #include "nsITransferable.idl"
 
 
 %{ C++
 #include "nsSize.h"
-
-namespace mozilla {
-namespace dom {
-class DataTransfer;
-} // namespace dom
-} // namespace mozilla
 %}
 
 native nsSize (nsSize);
-[ptr] native DataTransferPtr(mozilla::dom::DataTransfer);
 
 interface nsIDOMDocument;
 interface nsIDOMNode;
 
+webidl DataTransfer;
+
 [scriptable, builtinclass, uuid(25bce737-73f0-43c7-bc20-c71044a73c5a)]
 interface nsIDragSession : nsISupports
 {
   /**
     * Set the current state of the drag, whether it can be dropped or not.
     * usually the target "frame" sets this so the native system can render the correct feedback
     */
   attribute boolean canDrop;
@@ -70,23 +65,22 @@ interface nsIDragSession : nsISupports
   /**
    * The URI spec of the triggering principal.  This may be different than
    * sourceNode's principal when sourceNode is xul:browser and the drag is
    * triggered in a browsing context inside it.
    */
   attribute AUTF8String triggeringPrincipalURISpec;
 
   /**
-   * The data transfer object for the current drag.  Should become a
-   * DataTransfer once bug 1444991 is fixed.
+   * The data transfer object for the current drag.
    */
   [binaryname(DataTransferXPCOM)]
-  attribute nsISupports dataTransfer;
-  [notxpcom, nostdcall] DataTransferPtr getDataTransfer();
-  [notxpcom, nostdcall] void setDataTransfer(in DataTransferPtr aDataTransfer);
+  attribute DataTransfer dataTransfer;
+  [notxpcom, nostdcall] DataTransfer getDataTransfer();
+  [notxpcom, nostdcall] void setDataTransfer(in DataTransfer aDataTransfer);
 
   /**
     * Get data from a Drag&Drop. Can be called while the drag is in process
     * or after the drop has completed.
     *
     * @param  aTransferable the transferable for the data to be put into
     * @param  aItemIndex which of multiple drag items, zero-based
     */