From 7308e0e9fe988064d5381e7c99bc77a50b079163 Mon Sep 17 00:00:00 2001 From: Kyle Machulis Date: Fri, 27 Oct 2017 15:00:42 -0700 Subject: [PATCH] Bug 1412414 - Remove nsIDOMHTMLSourceElement; r=bz MozReview-Commit-ID: 3ZK1GremntX --HG-- extra : rebase_source : c25b1a449596130ec8d2e7936f52cc651988af85 --- dom/html/HTMLMediaElement.cpp | 1 - dom/html/HTMLSourceElement.cpp | 13 +-------- dom/html/HTMLSourceElement.h | 7 +---- dom/html/HTMLVideoElement.cpp | 1 - dom/interfaces/html/moz.build | 1 - .../html/nsIDOMHTMLSourceElement.idl | 27 ------------------- .../WebBrowserPersistLocalDocument.cpp | 8 +++--- xpcom/reflect/xptinfo/ShimInterfaceInfo.cpp | 3 --- 8 files changed, 5 insertions(+), 56 deletions(-) delete mode 100644 dom/interfaces/html/nsIDOMHTMLSourceElement.idl diff --git a/dom/html/HTMLMediaElement.cpp b/dom/html/HTMLMediaElement.cpp index 4abfde1e7b75..f6b33c741e67 100644 --- a/dom/html/HTMLMediaElement.cpp +++ b/dom/html/HTMLMediaElement.cpp @@ -18,7 +18,6 @@ #include "base/basictypes.h" #include "nsIDOMHTMLMediaElement.h" -#include "nsIDOMHTMLSourceElement.h" #include "TimeRanges.h" #include "nsGenericHTMLElement.h" #include "nsAttrValueInlines.h" diff --git a/dom/html/HTMLSourceElement.cpp b/dom/html/HTMLSourceElement.cpp index 90d42310f2b6..1fdcc0214ca6 100644 --- a/dom/html/HTMLSourceElement.cpp +++ b/dom/html/HTMLSourceElement.cpp @@ -35,21 +35,10 @@ HTMLSourceElement::~HTMLSourceElement() NS_IMPL_CYCLE_COLLECTION_INHERITED(HTMLSourceElement, nsGenericHTMLElement, mSrcMediaSource) -NS_IMPL_ADDREF_INHERITED(HTMLSourceElement, nsGenericHTMLElement) -NS_IMPL_RELEASE_INHERITED(HTMLSourceElement, nsGenericHTMLElement) - -NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(HTMLSourceElement) - NS_INTERFACE_MAP_ENTRY(nsIDOMHTMLSourceElement) -NS_INTERFACE_MAP_END_INHERITING(nsGenericHTMLElement) +NS_IMPL_ISUPPORTS_CYCLE_COLLECTION_INHERITED_0(HTMLSourceElement, nsGenericHTMLElement) NS_IMPL_ELEMENT_CLONE(HTMLSourceElement) -NS_IMPL_URI_ATTR(HTMLSourceElement, Src, src) -NS_IMPL_STRING_ATTR(HTMLSourceElement, Type, type) -NS_IMPL_STRING_ATTR(HTMLSourceElement, Srcset, srcset) -NS_IMPL_STRING_ATTR(HTMLSourceElement, Sizes, sizes) -NS_IMPL_STRING_ATTR(HTMLSourceElement, Media, media) - bool HTMLSourceElement::MatchesCurrentMedia() { diff --git a/dom/html/HTMLSourceElement.h b/dom/html/HTMLSourceElement.h index 2999da80791a..1b17ef9bb635 100644 --- a/dom/html/HTMLSourceElement.h +++ b/dom/html/HTMLSourceElement.h @@ -8,7 +8,6 @@ #define mozilla_dom_HTMLSourceElement_h #include "mozilla/Attributes.h" -#include "nsIDOMHTMLSourceElement.h" #include "nsGenericHTMLElement.h" #include "mozilla/dom/HTMLMediaElement.h" @@ -19,8 +18,7 @@ namespace dom { class MediaList; -class HTMLSourceElement final : public nsGenericHTMLElement, - public nsIDOMHTMLSourceElement +class HTMLSourceElement final : public nsGenericHTMLElement { public: explicit HTMLSourceElement(already_AddRefed& aNodeInfo); @@ -32,9 +30,6 @@ public: NS_IMPL_FROMCONTENT_HTML_WITH_TAG(HTMLSourceElement, source) - // nsIDOMHTMLSourceElement - NS_DECL_NSIDOMHTMLSOURCEELEMENT - virtual nsresult Clone(mozilla::dom::NodeInfo* aNodeInfo, nsINode** aResult, bool aPreallocateChildren) const override; diff --git a/dom/html/HTMLVideoElement.cpp b/dom/html/HTMLVideoElement.cpp index 1460d3dbd296..ecc99c99bd1e 100644 --- a/dom/html/HTMLVideoElement.cpp +++ b/dom/html/HTMLVideoElement.cpp @@ -4,7 +4,6 @@ * 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 "nsIDOMHTMLSourceElement.h" #include "mozilla/dom/HTMLVideoElement.h" #include "mozilla/dom/HTMLVideoElementBinding.h" #include "nsGenericHTMLElement.h" diff --git a/dom/interfaces/html/moz.build b/dom/interfaces/html/moz.build index e84b94429c56..437beab34a42 100644 --- a/dom/interfaces/html/moz.build +++ b/dom/interfaces/html/moz.build @@ -20,7 +20,6 @@ XPIDL_SOURCES += [ 'nsIDOMHTMLOptionsCollection.idl', 'nsIDOMHTMLScriptElement.idl', 'nsIDOMHTMLSelectElement.idl', - 'nsIDOMHTMLSourceElement.idl', 'nsIDOMMozBrowserFrame.idl', 'nsIDOMTimeRanges.idl', 'nsIDOMValidityState.idl', diff --git a/dom/interfaces/html/nsIDOMHTMLSourceElement.idl b/dom/interfaces/html/nsIDOMHTMLSourceElement.idl deleted file mode 100644 index 907e4b632b8e..000000000000 --- a/dom/interfaces/html/nsIDOMHTMLSourceElement.idl +++ /dev/null @@ -1,27 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* vim:set ts=2 sw=2 sts=2 et cindent: */ -/* 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 "nsIDOMHTMLElement.idl" - -/** - * The nsIDOMHTMLSourceElement interface is the interface to a HTML - * element. - * - * For more information on this interface, please see - * http://www.whatwg.org/specs/web-apps/current-work/#source - * - * @status UNDER_DEVELOPMENT - */ - -[uuid(1deb68f8-2ed6-4a41-b8c8-e0f86510f799)] -interface nsIDOMHTMLSourceElement : nsISupports -{ - attribute DOMString src; - attribute DOMString type; - attribute DOMString srcset; - attribute DOMString sizes; - attribute DOMString media; -}; diff --git a/dom/webbrowserpersist/WebBrowserPersistLocalDocument.cpp b/dom/webbrowserpersist/WebBrowserPersistLocalDocument.cpp index 2f930d800d93..07014e44ef63 100644 --- a/dom/webbrowserpersist/WebBrowserPersistLocalDocument.cpp +++ b/dom/webbrowserpersist/WebBrowserPersistLocalDocument.cpp @@ -31,7 +31,6 @@ #include "nsIDOMHTMLMediaElement.h" #include "nsIDOMHTMLOptionElement.h" #include "nsIDOMHTMLScriptElement.h" -#include "nsIDOMHTMLSourceElement.h" #include "nsIDOMMozNamedAttrMap.h" #include "nsIDOMNode.h" #include "nsIDOMNodeFilter.h" @@ -494,8 +493,8 @@ ResourceReader::OnWalkDOMNode(nsIDOMNode* aNode) if (nodeAsMedia) { return OnWalkAttribute(aNode, "src"); } - nsCOMPtr nodeAsSource = do_QueryInterface(aNode); - if (nodeAsSource) { + + if (content->IsHTMLElement(nsGkAtoms::source)) { return OnWalkAttribute(aNode, "src"); } @@ -1009,8 +1008,7 @@ PersistNodeFixup::FixupNode(nsIDOMNode *aNodeIn, return rv; } - nsCOMPtr nodeAsSource = do_QueryInterface(aNodeIn); - if (nodeAsSource) { + if (content->IsHTMLElement(nsGkAtoms::source)) { rv = GetNodeToFixup(aNodeIn, aNodeOut); if (NS_SUCCEEDED(rv) && *aNodeOut) { FixupAttribute(*aNodeOut, "src"); diff --git a/xpcom/reflect/xptinfo/ShimInterfaceInfo.cpp b/xpcom/reflect/xptinfo/ShimInterfaceInfo.cpp index 5dcf613abda3..52ec37926167 100644 --- a/xpcom/reflect/xptinfo/ShimInterfaceInfo.cpp +++ b/xpcom/reflect/xptinfo/ShimInterfaceInfo.cpp @@ -57,7 +57,6 @@ #include "nsIDOMHTMLOptionsCollection.h" #include "nsIDOMHTMLScriptElement.h" #include "nsIDOMHTMLSelectElement.h" -#include "nsIDOMHTMLSourceElement.h" #include "nsIDOMKeyEvent.h" #include "nsIDOMMediaList.h" #include "nsIDOMMouseEvent.h" @@ -161,7 +160,6 @@ #include "mozilla/dom/HTMLOptionsCollectionBinding.h" #include "mozilla/dom/HTMLScriptElementBinding.h" #include "mozilla/dom/HTMLSelectElementBinding.h" -#include "mozilla/dom/HTMLSourceElementBinding.h" #include "mozilla/dom/KeyEventBinding.h" #include "mozilla/dom/ListBoxObjectBinding.h" #include "mozilla/dom/MediaListBinding.h" @@ -316,7 +314,6 @@ const ComponentsInterfaceShimEntry kComponentsInterfaceShimMap[] = DEFINE_SHIM(HTMLOptionsCollection), DEFINE_SHIM(HTMLScriptElement), DEFINE_SHIM(HTMLSelectElement), - DEFINE_SHIM(HTMLSourceElement), DEFINE_SHIM(KeyEvent), DEFINE_SHIM_WITH_CUSTOM_INTERFACE(nsIListBoxObject, ListBoxObject), DEFINE_SHIM(MediaList),