From 3f47f56d2f5bc7de5c091e3f51da2055b87f40d6 Mon Sep 17 00:00:00 2001 From: David Zbarsky Date: Tue, 11 Jun 2013 21:56:26 -0700 Subject: [PATCH] Bug 881128 - Remove nsIDOMGetSVGDocument r=bz --- .../html/content/src/HTMLIFrameElement.cpp | 11 ++------- content/html/content/src/HTMLIFrameElement.h | 5 ---- .../html/content/src/HTMLObjectElement.cpp | 12 ++-------- content/html/content/src/HTMLObjectElement.h | 5 ---- .../content/src/HTMLSharedObjectElement.cpp | 23 +------------------ .../content/src/HTMLSharedObjectElement.h | 5 ---- content/html/content/test/test_bug389797.html | 6 ++--- dom/interfaces/svg/moz.build | 1 - dom/interfaces/svg/nsIDOMGetSVGDocument.idl | 15 ------------ .../mochitest/general/test_interfaces.html | 1 - dom/webidl/HTMLEmbedElement.webidl | 2 +- dom/webidl/HTMLIFrameElement.webidl | 2 +- dom/webidl/HTMLObjectElement.webidl | 2 +- 13 files changed, 11 insertions(+), 79 deletions(-) delete mode 100644 dom/interfaces/svg/nsIDOMGetSVGDocument.idl diff --git a/content/html/content/src/HTMLIFrameElement.cpp b/content/html/content/src/HTMLIFrameElement.cpp index 882d90e36ef..4f679cde433 100644 --- a/content/html/content/src/HTMLIFrameElement.cpp +++ b/content/html/content/src/HTMLIFrameElement.cpp @@ -37,9 +37,8 @@ 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 @@ -82,12 +81,6 @@ 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, diff --git a/content/html/content/src/HTMLIFrameElement.h b/content/html/content/src/HTMLIFrameElement.h index 22205e7cf2a..df2aea4b16c 100644 --- a/content/html/content/src/HTMLIFrameElement.h +++ b/content/html/content/src/HTMLIFrameElement.h @@ -9,14 +9,12 @@ #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 aNodeInfo, @@ -40,9 +38,6 @@ public: // nsIDOMHTMLIFrameElement NS_DECL_NSIDOMHTMLIFRAMEELEMENT - // nsIDOMGetSVGDocument - NS_DECL_NSIDOMGETSVGDOCUMENT - // nsIContent virtual bool ParseAttribute(int32_t aNamespaceID, nsIAtom* aAttribute, diff --git a/content/html/content/src/HTMLObjectElement.cpp b/content/html/content/src/HTMLObjectElement.cpp index bea1b38cb82..305ce01c2e0 100644 --- a/content/html/content/src/HTMLObjectElement.cpp +++ b/content/html/content/src/HTMLObjectElement.cpp @@ -15,7 +15,6 @@ #include "nsIDocument.h" #include "nsIPluginDocument.h" #include "nsIDOMDocument.h" -#include "nsIDOMSVGDocument.h" #include "nsFormSubmission.h" #include "nsIObjectFrame.h" #include "nsNPAPIPluginInstance.h" @@ -81,7 +80,7 @@ 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, @@ -92,8 +91,7 @@ NS_INTERFACE_TABLE_HEAD_CYCLE_COLLECTION_INHERITED(HTMLObjectElement) imgIOnloadBlocker, nsIInterfaceRequestor, nsIChannelEventSink, - nsIConstraintValidation, - nsIDOMGetSVGDocument) + nsIConstraintValidation) NS_INTERFACE_TABLE_TO_MAP_SEGUE NS_ELEMENT_INTERFACE_MAP_END @@ -350,12 +348,6 @@ HTMLObjectElement::GetContentWindow() return nullptr; } -NS_IMETHODIMP -HTMLObjectElement::GetSVGDocument(nsIDOMDocument **aResult) -{ - return GetContentDocument(aResult); -} - bool HTMLObjectElement::ParseAttribute(int32_t aNamespaceID, nsIAtom *aAttribute, diff --git a/content/html/content/src/HTMLObjectElement.h b/content/html/content/src/HTMLObjectElement.h index 750a1df1893..fd12feb1b72 100644 --- a/content/html/content/src/HTMLObjectElement.h +++ b/content/html/content/src/HTMLObjectElement.h @@ -12,7 +12,6 @@ #include "nsObjectLoadingContent.h" #include "nsIDOMHTMLObjectElement.h" #include "nsIConstraintValidation.h" -#include "nsIDOMGetSVGDocument.h" namespace mozilla { namespace dom { @@ -21,7 +20,6 @@ class HTMLObjectElement MOZ_FINAL : public nsGenericHTMLFormElement , public nsObjectLoadingContent , public nsIDOMHTMLObjectElement , public nsIConstraintValidation - , public nsIDOMGetSVGDocument { public: HTMLObjectElement(already_AddRefed aNodeInfo, @@ -45,9 +43,6 @@ public: // nsIDOMHTMLObjectElement NS_DECL_NSIDOMHTMLOBJECTELEMENT - // nsIDOMGetSVGDocument - NS_DECL_NSIDOMGETSVGDOCUMENT - virtual nsresult BindToTree(nsIDocument *aDocument, nsIContent *aParent, nsIContent *aBindingParent, bool aCompileEventHandlers) MOZ_OVERRIDE; diff --git a/content/html/content/src/HTMLSharedObjectElement.cpp b/content/html/content/src/HTMLSharedObjectElement.cpp index 20548ad19a0..dff85b6298f 100644 --- a/content/html/content/src/HTMLSharedObjectElement.cpp +++ b/content/html/content/src/HTMLSharedObjectElement.cpp @@ -107,7 +107,6 @@ NS_INTERFACE_TABLE_HEAD_CYCLE_COLLECTION_INHERITED(HTMLSharedObjectElement) 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) @@ -224,27 +223,7 @@ 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 diff --git a/content/html/content/src/HTMLSharedObjectElement.h b/content/html/content/src/HTMLSharedObjectElement.h index 5d4e7c737cd..2ee49799c9d 100644 --- a/content/html/content/src/HTMLSharedObjectElement.h +++ b/content/html/content/src/HTMLSharedObjectElement.h @@ -14,7 +14,6 @@ #include "nsError.h" #include "nsIDOMHTMLAppletElement.h" #include "nsIDOMHTMLEmbedElement.h" -#include "nsIDOMGetSVGDocument.h" namespace mozilla { namespace dom { @@ -23,7 +22,6 @@ class HTMLSharedObjectElement : public nsGenericHTMLElement , public nsObjectLoadingContent , public nsIDOMHTMLAppletElement , public nsIDOMHTMLEmbedElement - , public nsIDOMGetSVGDocument { public: HTMLSharedObjectElement(already_AddRefed aNodeInfo, @@ -56,9 +54,6 @@ public: 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; diff --git a/content/html/content/test/test_bug389797.html b/content/html/content/test/test_bug389797.html index abb496e7aca..df628103b10 100644 --- a/content/html/content/test/test_bug389797.html +++ b/content/html/content/test/test_bug389797.html @@ -135,7 +135,7 @@ 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", "") @@ -156,7 +156,7 @@ 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" ], []); @@ -184,7 +184,7 @@ 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"); diff --git a/dom/interfaces/svg/moz.build b/dom/interfaces/svg/moz.build index a03d1d394eb..46a8e651f25 100644 --- a/dom/interfaces/svg/moz.build +++ b/dom/interfaces/svg/moz.build @@ -5,7 +5,6 @@ # file, You can obtain one at http://mozilla.org/MPL/2.0/. XPIDL_SOURCES += [ - 'nsIDOMGetSVGDocument.idl', 'nsIDOMSVGAnimatedEnum.idl', 'nsIDOMSVGAnimatedInteger.idl', 'nsIDOMSVGAnimatedLength.idl', diff --git a/dom/interfaces/svg/nsIDOMGetSVGDocument.idl b/dom/interfaces/svg/nsIDOMGetSVGDocument.idl deleted file mode 100644 index 433a3d6a2e4..00000000000 --- 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 ); -}; diff --git a/dom/tests/mochitest/general/test_interfaces.html b/dom/tests/mochitest/general/test_interfaces.html index e0fe56cd731..de9c15f2fba 100644 --- a/dom/tests/mochitest/general/test_interfaces.html +++ b/dom/tests/mochitest/general/test_interfaces.html @@ -140,7 +140,6 @@ var interfaceNamesInGlobalScope = "GeoPositionCoords", "GeoPositionError", "GeoPositionErrorCallback", - "GetSVGDocument", "GetUserMediaErrorCallback", "GetUserMediaSuccessCallback", "GlobalObjectConstructor", diff --git a/dom/webidl/HTMLEmbedElement.webidl b/dom/webidl/HTMLEmbedElement.webidl index 313b4fa201d..460f99e4ba1 100644 --- a/dom/webidl/HTMLEmbedElement.webidl +++ b/dom/webidl/HTMLEmbedElement.webidl @@ -36,7 +36,7 @@ partial interface HTMLEmbedElement { }; partial interface HTMLEmbedElement { - // nsIDOMGetSVGDocument + // GetSVGDocument Document? getSVGDocument(); }; diff --git a/dom/webidl/HTMLIFrameElement.webidl b/dom/webidl/HTMLIFrameElement.webidl index fce55b1f92e..e919317edb4 100644 --- a/dom/webidl/HTMLIFrameElement.webidl +++ b/dom/webidl/HTMLIFrameElement.webidl @@ -47,7 +47,7 @@ partial interface HTMLIFrameElement { }; partial interface HTMLIFrameElement { - // nsIDOMGetSVGDocument + // GetSVGDocument Document? getSVGDocument(); }; diff --git a/dom/webidl/HTMLObjectElement.webidl b/dom/webidl/HTMLObjectElement.webidl index 5f080eeb9f6..3c55acf2102 100644 --- a/dom/webidl/HTMLObjectElement.webidl +++ b/dom/webidl/HTMLObjectElement.webidl @@ -71,7 +71,7 @@ partial interface HTMLObjectElement { }; partial interface HTMLObjectElement { - // nsIDOMGetSVGDocument + // GetSVGDocument Document? getSVGDocument(); };