Bug 881128 - Remove nsIDOMGetSVGDocument r=bz
authorDavid Zbarsky <dzbarsky@gmail.com>
Tue, 11 Jun 2013 21:56:26 -0700
changeset 134743 0c813a56965862b890a8c289a817ea9e18e64209
parent 134742 51369eb28a8f6312a438d4161b7f91af7e142fbf
child 134744 66d987002b36bb3092ef809873dec35823e7e00a
push id24812
push useremorley@mozilla.com
push dateWed, 12 Jun 2013 12:48:33 +0000
treeherdermozilla-central@f8a5db121ab8 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbz
bugs881128
milestone24.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 881128 - Remove nsIDOMGetSVGDocument r=bz
content/html/content/src/HTMLIFrameElement.cpp
content/html/content/src/HTMLIFrameElement.h
content/html/content/src/HTMLObjectElement.cpp
content/html/content/src/HTMLObjectElement.h
content/html/content/src/HTMLSharedObjectElement.cpp
content/html/content/src/HTMLSharedObjectElement.h
content/html/content/test/test_bug389797.html
dom/interfaces/svg/moz.build
dom/interfaces/svg/nsIDOMGetSVGDocument.idl
dom/tests/mochitest/general/test_interfaces.html
dom/webidl/HTMLEmbedElement.webidl
dom/webidl/HTMLIFrameElement.webidl
dom/webidl/HTMLObjectElement.webidl
--- a/content/html/content/src/HTMLIFrameElement.cpp
+++ b/content/html/content/src/HTMLIFrameElement.cpp
@@ -32,19 +32,18 @@ HTMLIFrameElement::~HTMLIFrameElement()
 }
 
 NS_IMPL_ADDREF_INHERITED(HTMLIFrameElement, Element)
 NS_IMPL_RELEASE_INHERITED(HTMLIFrameElement, Element)
 
 // QueryInterface implementation for HTMLIFrameElement
 NS_INTERFACE_TABLE_HEAD(HTMLIFrameElement)
   NS_HTML_CONTENT_INTERFACES(nsGenericHTMLFrameElement)
-  NS_INTERFACE_TABLE_INHERITED2(HTMLIFrameElement,
-                                nsIDOMHTMLIFrameElement,
-                                nsIDOMGetSVGDocument)
+  NS_INTERFACE_TABLE_INHERITED1(HTMLIFrameElement,
+                                nsIDOMHTMLIFrameElement)
   NS_INTERFACE_TABLE_TO_MAP_SEGUE
 NS_ELEMENT_INTERFACE_MAP_END
 
 NS_IMPL_ELEMENT_CLONE(HTMLIFrameElement)
 
 NS_IMPL_STRING_ATTR(HTMLIFrameElement, Align, align)
 NS_IMPL_STRING_ATTR(HTMLIFrameElement, FrameBorder, frameborder)
 NS_IMPL_STRING_ATTR(HTMLIFrameElement, Height, height)
@@ -77,22 +76,16 @@ HTMLIFrameElement::GetContentDocument(ns
 }
 
 NS_IMETHODIMP
 HTMLIFrameElement::GetContentWindow(nsIDOMWindow** aContentWindow)
 {
   return nsGenericHTMLFrameElement::GetContentWindow(aContentWindow);
 }
 
-NS_IMETHODIMP
-HTMLIFrameElement::GetSVGDocument(nsIDOMDocument **aResult)
-{
-  return GetContentDocument(aResult);
-}
-
 bool
 HTMLIFrameElement::ParseAttribute(int32_t aNamespaceID,
                                   nsIAtom* aAttribute,
                                   const nsAString& aValue,
                                   nsAttrValue& aResult)
 {
   if (aNamespaceID == kNameSpaceID_None) {
     if (aAttribute == nsGkAtoms::marginwidth) {
--- a/content/html/content/src/HTMLIFrameElement.h
+++ b/content/html/content/src/HTMLIFrameElement.h
@@ -4,24 +4,22 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #ifndef mozilla_dom_HTMLIFrameElement_h
 #define mozilla_dom_HTMLIFrameElement_h
 
 #include "mozilla/Attributes.h"
 #include "nsGenericHTMLFrameElement.h"
 #include "nsIDOMHTMLIFrameElement.h"
-#include "nsIDOMGetSVGDocument.h"
 
 namespace mozilla {
 namespace dom {
 
 class HTMLIFrameElement MOZ_FINAL : public nsGenericHTMLFrameElement
                                   , public nsIDOMHTMLIFrameElement
-                                  , public nsIDOMGetSVGDocument
 {
 public:
   HTMLIFrameElement(already_AddRefed<nsINodeInfo> aNodeInfo,
                     FromParser aFromParser = NOT_FROM_PARSER);
   virtual ~HTMLIFrameElement();
 
   NS_IMPL_FROMCONTENT_HTML_WITH_TAG(HTMLIFrameElement, iframe)
 
@@ -35,19 +33,16 @@ public:
   NS_FORWARD_NSIDOMELEMENT_TO_GENERIC
 
   // nsIDOMHTMLElement
   NS_FORWARD_NSIDOMHTMLELEMENT_TO_GENERIC
 
   // nsIDOMHTMLIFrameElement
   NS_DECL_NSIDOMHTMLIFRAMEELEMENT
 
-  // nsIDOMGetSVGDocument
-  NS_DECL_NSIDOMGETSVGDOCUMENT
-
   // nsIContent
   virtual bool ParseAttribute(int32_t aNamespaceID,
                                 nsIAtom* aAttribute,
                                 const nsAString& aValue,
                                 nsAttrValue& aResult) MOZ_OVERRIDE;
   NS_IMETHOD_(bool) IsAttributeMapped(const nsIAtom* aAttribute) const MOZ_OVERRIDE;
   virtual nsMapRuleToAttributesFunc GetAttributeMappingFunction() const MOZ_OVERRIDE;
 
--- a/content/html/content/src/HTMLObjectElement.cpp
+++ b/content/html/content/src/HTMLObjectElement.cpp
@@ -10,17 +10,16 @@
 #include "mozilla/dom/HTMLObjectElementBinding.h"
 #include "nsAutoPtr.h"
 #include "nsAttrValueInlines.h"
 #include "nsGkAtoms.h"
 #include "nsError.h"
 #include "nsIDocument.h"
 #include "nsIPluginDocument.h"
 #include "nsIDOMDocument.h"
-#include "nsIDOMSVGDocument.h"
 #include "nsFormSubmission.h"
 #include "nsIObjectFrame.h"
 #include "nsNPAPIPluginInstance.h"
 #include "nsIWidget.h"
 #include "nsContentUtils.h"
 
 namespace mozilla {
 namespace dom {
@@ -76,29 +75,28 @@ NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN_IN
   NS_IMPL_CYCLE_COLLECTION_UNLINK(mValidity)
 NS_IMPL_CYCLE_COLLECTION_TRAVERSE_END
 
 NS_IMPL_ADDREF_INHERITED(HTMLObjectElement, Element)
 NS_IMPL_RELEASE_INHERITED(HTMLObjectElement, Element)
 
 NS_INTERFACE_TABLE_HEAD_CYCLE_COLLECTION_INHERITED(HTMLObjectElement)
   NS_HTML_CONTENT_INTERFACES(nsGenericHTMLFormElement)
-  NS_INTERFACE_TABLE_INHERITED12(HTMLObjectElement,
+  NS_INTERFACE_TABLE_INHERITED11(HTMLObjectElement,
                                  nsIDOMHTMLObjectElement,
                                  imgINotificationObserver,
                                  nsIRequestObserver,
                                  nsIStreamListener,
                                  nsIFrameLoaderOwner,
                                  nsIObjectLoadingContent,
                                  nsIImageLoadingContent,
                                  imgIOnloadBlocker,
                                  nsIInterfaceRequestor,
                                  nsIChannelEventSink,
-                                 nsIConstraintValidation,
-                                 nsIDOMGetSVGDocument)
+                                 nsIConstraintValidation)
   NS_INTERFACE_TABLE_TO_MAP_SEGUE
 NS_ELEMENT_INTERFACE_MAP_END
 
 NS_IMPL_ELEMENT_CLONE(HTMLObjectElement)
 
 // nsIConstraintValidation
 NS_IMPL_NSICONSTRAINTVALIDATION(HTMLObjectElement)
 
@@ -345,22 +343,16 @@ HTMLObjectElement::GetContentWindow()
   nsIDocument* doc = GetContentDocument();
   if (doc) {
     return doc->GetWindow();
   }
 
   return nullptr;
 }
 
-NS_IMETHODIMP
-HTMLObjectElement::GetSVGDocument(nsIDOMDocument **aResult)
-{
-  return GetContentDocument(aResult);
-}
-
 bool
 HTMLObjectElement::ParseAttribute(int32_t aNamespaceID,
                                   nsIAtom *aAttribute,
                                   const nsAString &aValue,
                                   nsAttrValue &aResult)
 {
   if (aNamespaceID == kNameSpaceID_None) {
     if (aAttribute == nsGkAtoms::align) {
--- a/content/html/content/src/HTMLObjectElement.h
+++ b/content/html/content/src/HTMLObjectElement.h
@@ -7,26 +7,24 @@
 #ifndef mozilla_dom_HTMLObjectElement_h
 #define mozilla_dom_HTMLObjectElement_h
 
 #include "mozilla/Attributes.h"
 #include "nsGenericHTMLElement.h"
 #include "nsObjectLoadingContent.h"
 #include "nsIDOMHTMLObjectElement.h"
 #include "nsIConstraintValidation.h"
-#include "nsIDOMGetSVGDocument.h"
 
 namespace mozilla {
 namespace dom {
 
 class HTMLObjectElement MOZ_FINAL : public nsGenericHTMLFormElement
                                   , public nsObjectLoadingContent
                                   , public nsIDOMHTMLObjectElement
                                   , public nsIConstraintValidation
-                                  , public nsIDOMGetSVGDocument
 {
 public:
   HTMLObjectElement(already_AddRefed<nsINodeInfo> aNodeInfo,
                     FromParser aFromParser = NOT_FROM_PARSER);
   virtual ~HTMLObjectElement();
 
   // nsISupports
   NS_DECL_ISUPPORTS_INHERITED
@@ -40,19 +38,16 @@ public:
   // nsIDOMHTMLElement
   NS_FORWARD_NSIDOMHTMLELEMENT_TO_GENERIC
 
   virtual int32_t TabIndexDefault() MOZ_OVERRIDE;
 
   // nsIDOMHTMLObjectElement
   NS_DECL_NSIDOMHTMLOBJECTELEMENT
 
-  // nsIDOMGetSVGDocument
-  NS_DECL_NSIDOMGETSVGDOCUMENT
-
   virtual nsresult BindToTree(nsIDocument *aDocument, nsIContent *aParent,
                               nsIContent *aBindingParent,
                               bool aCompileEventHandlers) MOZ_OVERRIDE;
   virtual void UnbindFromTree(bool aDeep = true,
                               bool aNullParent = true) MOZ_OVERRIDE;
   virtual nsresult SetAttr(int32_t aNameSpaceID, nsIAtom *aName,
                            nsIAtom *aPrefix, const nsAString &aValue,
                            bool aNotify) MOZ_OVERRIDE;
--- a/content/html/content/src/HTMLSharedObjectElement.cpp
+++ b/content/html/content/src/HTMLSharedObjectElement.cpp
@@ -102,17 +102,16 @@ NS_INTERFACE_TABLE_HEAD_CYCLE_COLLECTION
                                 imgINotificationObserver,
                                 nsIImageLoadingContent,
                                 imgIOnloadBlocker,
                                 nsIInterfaceRequestor,
                                 nsIChannelEventSink)
   NS_INTERFACE_TABLE_TO_MAP_SEGUE
   NS_INTERFACE_MAP_ENTRY_IF_TAG(nsIDOMHTMLAppletElement, applet)
   NS_INTERFACE_MAP_ENTRY_IF_TAG(nsIDOMHTMLEmbedElement, embed)
-  NS_INTERFACE_MAP_ENTRY_IF_TAG(nsIDOMGetSVGDocument, embed)
 NS_ELEMENT_INTERFACE_MAP_END
 
 NS_IMPL_ELEMENT_CLONE(HTMLSharedObjectElement)
 
 nsresult
 HTMLSharedObjectElement::BindToTree(nsIDocument *aDocument,
                                     nsIContent *aParent,
                                     nsIContent *aBindingParent,
@@ -219,37 +218,17 @@ NS_IMPL_URI_ATTR_WITH_BASE(HTMLSharedObj
 NS_IMPL_URI_ATTR(HTMLSharedObjectElement, Src, src)
 NS_IMPL_STRING_ATTR(HTMLSharedObjectElement, Type, type)
 NS_IMPL_INT_ATTR(HTMLSharedObjectElement, Vspace, vspace)
 NS_IMPL_STRING_ATTR(HTMLSharedObjectElement, Width, width)
 
 int32_t
 HTMLSharedObjectElement::TabIndexDefault()
 {
-  return -1; 
-}
-
-NS_IMETHODIMP
-HTMLSharedObjectElement::GetSVGDocument(nsIDOMDocument **aResult)
-{
-  NS_ENSURE_ARG_POINTER(aResult);
-
-  *aResult = nullptr;
-
-  if (!IsInDoc()) {
-    return NS_OK;
-  }
-
-  // XXXbz should this use GetCurrentDoc()?  sXBL/XBL2 issue!
-  nsIDocument *sub_doc = OwnerDoc()->GetSubDocumentFor(this);
-  if (!sub_doc) {
-    return NS_OK;
-  }
-
-  return CallQueryInterface(sub_doc, aResult);
+  return -1;
 }
 
 bool
 HTMLSharedObjectElement::ParseAttribute(int32_t aNamespaceID,
                                         nsIAtom *aAttribute,
                                         const nsAString &aValue,
                                         nsAttrValue &aResult)
 {
--- a/content/html/content/src/HTMLSharedObjectElement.h
+++ b/content/html/content/src/HTMLSharedObjectElement.h
@@ -9,26 +9,24 @@
 
 #include "mozilla/Attributes.h"
 #include "nsGenericHTMLElement.h"
 #include "nsObjectLoadingContent.h"
 #include "nsGkAtoms.h"
 #include "nsError.h"
 #include "nsIDOMHTMLAppletElement.h"
 #include "nsIDOMHTMLEmbedElement.h"
-#include "nsIDOMGetSVGDocument.h"
 
 namespace mozilla {
 namespace dom {
 
 class HTMLSharedObjectElement : public nsGenericHTMLElement
                               , public nsObjectLoadingContent
                               , public nsIDOMHTMLAppletElement
                               , public nsIDOMHTMLEmbedElement
-                              , public nsIDOMGetSVGDocument
 {
 public:
   HTMLSharedObjectElement(already_AddRefed<nsINodeInfo> aNodeInfo,
                           mozilla::dom::FromParser aFromParser = mozilla::dom::NOT_FROM_PARSER);
   virtual ~HTMLSharedObjectElement();
 
   // nsISupports
   NS_DECL_ISUPPORTS_INHERITED
@@ -51,19 +49,16 @@ public:
   // NS_DECL_NSIDOMHTMLAPPLETELEMENT.
 
   // nsIDOMHTMLEmbedElement
   NS_IMETHOD GetSrc(nsAString &aSrc) MOZ_OVERRIDE;
   NS_IMETHOD SetSrc(const nsAString &aSrc) MOZ_OVERRIDE;
   NS_IMETHOD GetType(nsAString &aType) MOZ_OVERRIDE;
   NS_IMETHOD SetType(const nsAString &aType) MOZ_OVERRIDE;
 
-  // nsIDOMGetSVGDocument
-  NS_DECL_NSIDOMGETSVGDOCUMENT
-
   virtual nsresult BindToTree(nsIDocument *aDocument, nsIContent *aParent,
                               nsIContent *aBindingParent,
                               bool aCompileEventHandlers) MOZ_OVERRIDE;
   virtual void UnbindFromTree(bool aDeep = true,
                               bool aNullParent = true) MOZ_OVERRIDE;
   virtual nsresult SetAttr(int32_t aNameSpaceID, nsIAtom *aName,
                            nsIAtom *aPrefix, const nsAString &aValue,
                            bool aNotify) MOZ_OVERRIDE;
--- a/content/html/content/test/test_bug389797.html
+++ b/content/html/content/test/test_bug389797.html
@@ -130,17 +130,17 @@ HTML_TAG("datalist", "DataList");
 HTML_TAG("dd", "");
 HTML_TAG("del", "Mod");
 HTML_TAG("dfn", "");
 HTML_TAG("dir", "Directory");
 HTML_TAG("div", "Div");
 HTML_TAG("dl", "DList");
 HTML_TAG("dt", "");
 HTML_TAG("em", "");
-HTML_TAG("embed", "Embed", [ "nsIDOMGetSVGDocument" ], objectIfaces);
+HTML_TAG("embed", "Embed", [], objectIfaces);
 HTML_TAG("fieldset", "FieldSet");
 HTML_TAG("figcaption", "")
 HTML_TAG("figure", "")
 HTML_TAG("font", "Font");
 HTML_TAG("footer", "")
 HTML_TAG("form", "Form", [], [ "nsIWebProgressListener" ]);
 HTML_TAG("frame", "Frame", [ "nsIDOMMozBrowserFrame" ], [ "nsIFrameLoaderOwner" ]);
 HTML_TAG("frameset", "FrameSet");
@@ -151,17 +151,17 @@ HTML_TAG("h4", "Heading");
 HTML_TAG("h5", "Heading");
 HTML_TAG("h6", "Heading");
 HTML_TAG("head", "Head");
 HTML_TAG("header", "")
 HTML_TAG("hgroup", "")
 HTML_TAG("hr", "HR");
 HTML_TAG("html", "Html");
 HTML_TAG("i", "");
-HTML_TAG("iframe", "IFrame", [ "nsIDOMGetSVGDocument", "nsIDOMMozBrowserFrame" ],
+HTML_TAG("iframe", "IFrame", [ "nsIDOMMozBrowserFrame" ],
                              [ "nsIFrameLoaderOwner" ]);
 HTML_TAG("image", "");
 HTML_TAG("img", "Image", [ "nsIImageLoadingContent" ], []);
 HTML_TAG("input", "Input", [], [ "imgINotificationObserver",
                                  "nsIImageLoadingContent",
                                  "nsIDOMNSEditableElement" ]);
 HTML_TAG("ins", "Mod");
 HTML_TAG("kbd", "");
@@ -179,17 +179,17 @@ HTML_TAG("menu", "Menu");
 HTML_TAG("meta", "Meta");
 HTML_TAG("meter", "Meter");
 HTML_TAG("multicol", "Unknown");
 HTML_TAG("nav", "")
 HTML_TAG("nobr", "");
 HTML_TAG("noembed", "");
 HTML_TAG("noframes", "");
 HTML_TAG("noscript", "");
-HTML_TAG("object", "Object", [ "nsIDOMGetSVGDocument" ],
+HTML_TAG("object", "Object", [],
                              objectIfaces.concat([ "nsIImageLoadingContent" ]));
 HTML_TAG("ol", "OList");
 HTML_TAG("optgroup", "OptGroup");
 HTML_TAG("option", "Option");
 HTML_TAG("p", "Paragraph");
 HTML_TAG("param", "Param");
 HTML_TAG("plaintext", "");
 HTML_TAG("pre", "Pre");
--- a/dom/interfaces/svg/moz.build
+++ b/dom/interfaces/svg/moz.build
@@ -1,16 +1,15 @@
 # -*- 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/.
 
 XPIDL_SOURCES += [
-    'nsIDOMGetSVGDocument.idl',
     'nsIDOMSVGAnimatedEnum.idl',
     'nsIDOMSVGAnimatedInteger.idl',
     'nsIDOMSVGAnimatedLength.idl',
     'nsIDOMSVGAnimatedNumber.idl',
     'nsIDOMSVGAnimatedString.idl',
     'nsIDOMSVGDocument.idl',
     'nsIDOMSVGElement.idl',
     'nsIDOMSVGLength.idl',
deleted file mode 100644
--- a/dom/interfaces/svg/nsIDOMGetSVGDocument.idl
+++ /dev/null
@@ -1,15 +0,0 @@
-/* -*- 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/. */
-
-#include "domstubs.idl"
-
-interface nsIDOMSVGDocument;
-
-[scriptable, uuid(b5d3074c-4f63-4936-bf39-49034efa26a5)]
-interface nsIDOMGetSVGDocument : nsISupports
-{
-  nsIDOMDocument getSVGDocument ( );
-      // raises( DOMException );
-};
--- a/dom/tests/mochitest/general/test_interfaces.html
+++ b/dom/tests/mochitest/general/test_interfaces.html
@@ -135,17 +135,16 @@ var interfaceNamesInGlobalScope =
     "GamepadButtonEvent",
     "GamepadEvent",
     "GeoGeolocation",
     "GeoPosition",
     "GeoPositionCallback",
     "GeoPositionCoords",
     "GeoPositionError",
     "GeoPositionErrorCallback",
-    "GetSVGDocument",
     "GetUserMediaErrorCallback",
     "GetUserMediaSuccessCallback",
     "GlobalObjectConstructor",
     "GlobalPropertyInitializer",
     "HashChangeEvent",
     "History",
     "HTMLAnchorElement",
     "HTMLAppletElement",
--- a/dom/webidl/HTMLEmbedElement.webidl
+++ b/dom/webidl/HTMLEmbedElement.webidl
@@ -31,15 +31,15 @@ interface HTMLEmbedElement : HTMLElement
 partial interface HTMLEmbedElement {
   [Pure, SetterThrows]
            attribute DOMString align;
   [Pure, SetterThrows]
            attribute DOMString name;
 };
 
 partial interface HTMLEmbedElement {
-  // nsIDOMGetSVGDocument
+  // GetSVGDocument
   Document? getSVGDocument();
 };
 
 HTMLEmbedElement implements MozImageLoadingContent;
 HTMLEmbedElement implements MozFrameLoaderOwner;
 HTMLEmbedElement implements MozObjectLoadingContent;
--- a/dom/webidl/HTMLIFrameElement.webidl
+++ b/dom/webidl/HTMLIFrameElement.webidl
@@ -42,17 +42,17 @@ partial interface HTMLIFrameElement {
   [SetterThrows, Pure]
            attribute DOMString longDesc;
 
   [TreatNullAs=EmptyString,SetterThrows,Pure] attribute DOMString marginHeight;
   [TreatNullAs=EmptyString,SetterThrows,Pure] attribute DOMString marginWidth;
 };
 
 partial interface HTMLIFrameElement {
-  // nsIDOMGetSVGDocument
+  // GetSVGDocument
   Document? getSVGDocument();
 };
 
 partial interface HTMLIFrameElement {
   // nsIDOMMozBrowserFrame
   [ChromeOnly,SetterThrows]
            attribute boolean mozbrowser;
 };
--- a/dom/webidl/HTMLObjectElement.webidl
+++ b/dom/webidl/HTMLObjectElement.webidl
@@ -66,17 +66,17 @@ partial interface HTMLObjectElement {
   [Pure, SetterThrows]
            attribute DOMString codeType;
 
   [TreatNullAs=EmptyString, Pure, SetterThrows]
            attribute DOMString border;
 };
 
 partial interface HTMLObjectElement {
-  // nsIDOMGetSVGDocument
+  // GetSVGDocument
   Document? getSVGDocument();
 };
 
 [NoInterfaceObject]
 interface MozObjectLoadingContent {
   // Mirrored chrome-only scriptable nsIObjectLoadingContent methods.  Please
   // make sure to update this list if nsIObjectLoadingContent changes.  Also,
   // make sure everything on here is [ChromeOnly].