Bug 842986 - Implement MozFrameLoaderOwner on HTMLFrameElement. r=bz
authorAndrea Marchesini <amarchesini@mozilla.com>
Tue, 26 Feb 2013 12:02:32 -0500
changeset 123033 f5481770263dc96f2fbe4ba319836402b82e9f1a
parent 123032 41d43416168d32db5683ffe0bccfc727c1a66b6f
child 123034 fe6e46c055871cc8139c964eb9c58beb19781c68
push id24372
push useremorley@mozilla.com
push dateWed, 27 Feb 2013 13:22:59 +0000
treeherdermozilla-central@0a91da5f5eab [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbz
bugs842986
milestone22.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 842986 - Implement MozFrameLoaderOwner on HTMLFrameElement. r=bz
content/html/content/src/HTMLFrameElement.h
content/html/content/src/nsGenericHTMLFrameElement.cpp
content/html/content/src/nsGenericHTMLFrameElement.h
dom/webidl/HTMLFrameElement.webidl
--- a/content/html/content/src/HTMLFrameElement.h
+++ b/content/html/content/src/HTMLFrameElement.h
@@ -14,16 +14,18 @@ class nsIDOMDocument;
 
 namespace mozilla {
 namespace dom {
 
 class HTMLFrameElement : public nsGenericHTMLFrameElement,
                          public nsIDOMHTMLFrameElement
 {
 public:
+  using nsGenericHTMLFrameElement::SwapFrameLoaders;
+
   HTMLFrameElement(already_AddRefed<nsINodeInfo> aNodeInfo,
                    FromParser aFromParser = NOT_FROM_PARSER);
   virtual ~HTMLFrameElement();
 
   // nsISupports
   NS_DECL_ISUPPORTS_INHERITED
 
   // nsIDOMNode
--- a/content/html/content/src/nsGenericHTMLFrameElement.cpp
+++ b/content/html/content/src/nsGenericHTMLFrameElement.cpp
@@ -4,16 +4,17 @@
 /* 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 "nsGenericHTMLFrameElement.h"
 #include "nsIInterfaceRequestorUtils.h"
 #include "nsContentUtils.h"
 #include "mozilla/Preferences.h"
+#include "mozilla/ErrorResult.h"
 #include "nsIAppsService.h"
 #include "nsServiceManagerUtils.h"
 #include "nsIDOMApplicationRegistry.h"
 #include "nsIPermissionManager.h"
 #include "sampler.h"
 
 using namespace mozilla;
 using namespace mozilla::dom;
@@ -389,8 +390,16 @@ nsGenericHTMLFrameElement::DisallowCreat
 NS_IMETHODIMP
 nsGenericHTMLFrameElement::AllowCreateFrameLoader()
 {
   MOZ_ASSERT(!mFrameLoader);
   MOZ_ASSERT(mFrameLoaderCreationDisallowed);
   mFrameLoaderCreationDisallowed = false;
   return NS_OK;
 }
+
+void
+nsGenericHTMLFrameElement::SwapFrameLoaders(nsXULElement& aOtherOwner,
+                                            ErrorResult& aError)
+{
+  aError.Throw(NS_ERROR_NOT_IMPLEMENTED);
+}
+
--- a/content/html/content/src/nsGenericHTMLFrameElement.h
+++ b/content/html/content/src/nsGenericHTMLFrameElement.h
@@ -4,19 +4,22 @@
 /* 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 "nsGenericHTMLElement.h"
 #include "nsIFrameLoader.h"
 #include "nsIMozBrowserFrame.h"
 #include "nsIDOMEventListener.h"
+#include "mozilla/ErrorResult.h"
 
 #include "nsFrameLoader.h"
 
+class nsXULElement;
+
 /**
  * A helper class for frame elements
  */
 class nsGenericHTMLFrameElement : public nsGenericHTMLElement,
                                   public nsIFrameLoaderOwner,
                                   public nsIMozBrowserFrame
 {
 public:
@@ -55,16 +58,18 @@ public:
 
   nsresult CopyInnerTo(mozilla::dom::Element* aDest);
 
   virtual int32_t TabIndexDefault() MOZ_OVERRIDE;
 
   NS_DECL_CYCLE_COLLECTION_CLASS_INHERITED_NO_UNLINK(nsGenericHTMLFrameElement,
                                                      nsGenericHTMLElement)
 
+  void SwapFrameLoaders(nsXULElement& aOtherOwner, mozilla::ErrorResult& aError);
+
 protected:
   /**
    * Listens to titlechanged events from the document inside the iframe and
    * forwards them along to the iframe so it can fire a mozbrowsertitlechange
    * event if appropriate.
    */
   class TitleChangedListener MOZ_FINAL : public nsIDOMEventListener
   {
--- a/dom/webidl/HTMLFrameElement.webidl
+++ b/dom/webidl/HTMLFrameElement.webidl
@@ -27,8 +27,10 @@ interface HTMLFrameElement : HTMLElement
   [GetterThrows]
   readonly attribute Document? contentDocument;
   [GetterThrows]
   readonly attribute WindowProxy? contentWindow;
 
   [TreatNullAs=EmptyString, SetterThrows] attribute DOMString marginHeight;
   [TreatNullAs=EmptyString, SetterThrows] attribute DOMString marginWidth;
 };
+
+HTMLFrameElement implements MozFrameLoaderOwner;