Bug 1503674 - Remove now unused nsIScriptableUnescapeHTML.idl. r=hsivonen
authorMark Banner <standard8@mozilla.com>
Mon, 17 Dec 2018 09:33:28 +0000
changeset 450917 dfbe4026a7c58ae5305965568cbdd9defb1f00d2
parent 450916 11457d8b6163291d33cf4554f0d655199c8bbb41
child 450918 33dcbde4d881726a8051ed58fa73bf873cd82673
push id74809
push usermbanner@mozilla.com
push dateMon, 17 Dec 2018 09:37:21 +0000
treeherderautoland@dfbe4026a7c5 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewershsivonen
bugs1503674
milestone66.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 1503674 - Remove now unused nsIScriptableUnescapeHTML.idl. r=hsivonen Differential Revision: https://phabricator.services.mozilla.com/D14680
layout/build/nsLayoutModule.cpp
parser/html/moz.build
parser/html/nsIScriptableUnescapeHTML.idl
parser/html/nsParserUtils.cpp
parser/html/nsParserUtils.h
--- a/layout/build/nsLayoutModule.cpp
+++ b/layout/build/nsLayoutModule.cpp
@@ -448,17 +448,16 @@ NS_DEFINE_NAMED_CID(NS_LAYOUT_DEBUGGER_C
 NS_DEFINE_NAMED_CID(NS_FRAMETRAVERSAL_CID);
 NS_DEFINE_NAMED_CID(IN_DEEPTREEWALKER_CID);
 NS_DEFINE_NAMED_CID(NS_CONTENT_VIEWER_CID);
 NS_DEFINE_NAMED_CID(NS_XMLCONTENTSERIALIZER_CID);
 NS_DEFINE_NAMED_CID(NS_XHTMLCONTENTSERIALIZER_CID);
 NS_DEFINE_NAMED_CID(NS_HTMLCONTENTSERIALIZER_CID);
 NS_DEFINE_NAMED_CID(NS_PLAINTEXTSERIALIZER_CID);
 NS_DEFINE_NAMED_CID(NS_PARSERUTILS_CID);
-NS_DEFINE_NAMED_CID(NS_SCRIPTABLEUNESCAPEHTML_CID);
 NS_DEFINE_NAMED_CID(NS_CONTENTPOLICY_CID);
 NS_DEFINE_NAMED_CID(NS_DATADOCUMENTCONTENTPOLICY_CID);
 NS_DEFINE_NAMED_CID(NS_NODATAPROTOCOLCONTENTPOLICY_CID);
 NS_DEFINE_NAMED_CID(NS_CONTENT_DOCUMENT_LOADER_FACTORY_CID);
 NS_DEFINE_NAMED_CID(NS_JSPROTOCOLHANDLER_CID);
 NS_DEFINE_NAMED_CID(NS_JSURI_CID);
 NS_DEFINE_NAMED_CID(NS_JSURIMUTATOR_CID);
 NS_DEFINE_NAMED_CID(NS_PLUGINDOCLOADERFACTORY_CID);
@@ -540,17 +539,16 @@ static const mozilla::Module::CIDEntry k
   { &kNS_FRAMETRAVERSAL_CID, false, nullptr, CreateNewFrameTraversal },
   { &kIN_DEEPTREEWALKER_CID, false, nullptr, inDeepTreeWalkerConstructor },
   { &kNS_CONTENT_VIEWER_CID, false, nullptr, CreateContentViewer },
   { &kNS_XMLCONTENTSERIALIZER_CID, false, nullptr, CreateXMLContentSerializer },
   { &kNS_HTMLCONTENTSERIALIZER_CID, false, nullptr, CreateHTMLContentSerializer },
   { &kNS_XHTMLCONTENTSERIALIZER_CID, false, nullptr, CreateXHTMLContentSerializer },
   { &kNS_PLAINTEXTSERIALIZER_CID, false, nullptr, CreatePlainTextSerializer },
   { &kNS_PARSERUTILS_CID, false, nullptr, nsParserUtilsConstructor },
-  { &kNS_SCRIPTABLEUNESCAPEHTML_CID, false, nullptr, nsParserUtilsConstructor },
   { &kNS_CONTENTPOLICY_CID, false, nullptr, CreateContentPolicy },
   { &kNS_DATADOCUMENTCONTENTPOLICY_CID, false, nullptr, nsDataDocumentContentPolicyConstructor },
   { &kNS_NODATAPROTOCOLCONTENTPOLICY_CID, false, nullptr, nsNoDataProtocolContentPolicyConstructor },
   { &kNS_CONTENT_DOCUMENT_LOADER_FACTORY_CID, false, nullptr, CreateContentDLF },
   { &kNS_JSPROTOCOLHANDLER_CID, false, nullptr, nsJSProtocolHandler::Create },
   { &kNS_JSURI_CID, false, nullptr, nsJSURIMutatorConstructor }, // do_CreateInstance returns mutator
   { &kNS_JSURIMUTATOR_CID, false, nullptr, nsJSURIMutatorConstructor },
   { &kNS_PLUGINDOCLOADERFACTORY_CID, false, nullptr, CreateContentDLF },
@@ -617,17 +615,16 @@ static const mozilla::Module::ContractID
   { NS_CONTENTSERIALIZER_CONTRACTID_PREFIX "text/xml", &kNS_XMLCONTENTSERIALIZER_CID },
   { NS_CONTENTSERIALIZER_CONTRACTID_PREFIX "application/xml", &kNS_XMLCONTENTSERIALIZER_CID },
   { NS_CONTENTSERIALIZER_CONTRACTID_PREFIX "application/xhtml+xml", &kNS_XHTMLCONTENTSERIALIZER_CID },
   { NS_CONTENTSERIALIZER_CONTRACTID_PREFIX "image/svg+xml", &kNS_XMLCONTENTSERIALIZER_CID },
   { NS_CONTENTSERIALIZER_CONTRACTID_PREFIX "text/html", &kNS_HTMLCONTENTSERIALIZER_CID },
   { NS_CONTENTSERIALIZER_CONTRACTID_PREFIX "application/vnd.mozilla.xul+xml", &kNS_XMLCONTENTSERIALIZER_CID },
   { NS_CONTENTSERIALIZER_CONTRACTID_PREFIX "text/plain", &kNS_PLAINTEXTSERIALIZER_CID },
   { NS_PARSERUTILS_CONTRACTID, &kNS_PARSERUTILS_CID },
-  { NS_SCRIPTABLEUNESCAPEHTML_CONTRACTID, &kNS_SCRIPTABLEUNESCAPEHTML_CID },
   { NS_CONTENTPOLICY_CONTRACTID, &kNS_CONTENTPOLICY_CID },
   { NS_DATADOCUMENTCONTENTPOLICY_CONTRACTID, &kNS_DATADOCUMENTCONTENTPOLICY_CID },
   { NS_NODATAPROTOCOLCONTENTPOLICY_CONTRACTID, &kNS_NODATAPROTOCOLCONTENTPOLICY_CID },
   { CONTENT_DLF_CONTRACTID, &kNS_CONTENT_DOCUMENT_LOADER_FACTORY_CID },
   { NS_JSPROTOCOLHANDLER_CONTRACTID, &kNS_JSPROTOCOLHANDLER_CID },
   { PLUGIN_DLF_CONTRACTID, &kNS_PLUGINDOCLOADERFACTORY_CID },
   { NS_STYLESHEETSERVICE_CONTRACTID, &kNS_STYLESHEETSERVICE_CID },
   { NS_SDBCONNECTION_CONTRACTID, &kNS_SDBCONNECTION_CID },
--- a/parser/html/moz.build
+++ b/parser/html/moz.build
@@ -1,17 +1,16 @@
 # -*- Mode: python; 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 += [
-    'nsIParserUtils.idl',
-    'nsIScriptableUnescapeHTML.idl',
+    'nsIParserUtils.idl'
 ]
 
 XPIDL_MODULE = 'html5'
 
 EXPORTS += [
     'jArray.h',
     'nsAHtml5TreeBuilderState.h',
     'nsAHtml5TreeOpSink.h',
deleted file mode 100644
--- a/parser/html/nsIScriptableUnescapeHTML.idl
+++ /dev/null
@@ -1,55 +0,0 @@
-/* -*- Mode: C++; tab-width: 8; 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 "nsISupports.idl"
-
-interface nsIURI;
-
-webidl DocumentFragment;
-webidl Element;
-
-/**
- * This interface is OBSOLETE and exists solely for legacy extensions.
- */
-[scriptable, uuid(3ab244a9-f09d-44da-9e3f-ee4d67367f2d)]
-interface nsIScriptableUnescapeHTML : nsISupports 
-{
-  /** 
-   * Converts HTML to plain text. This is equivalent to calling
-   * nsIParserUtils::convertToPlainText(src, 
-   *   nsIDocumentEncoder::OutputSelectionOnly |
-   *   nsIDocumentEncoder::OutputAbsoluteLinks, 0).
-   *
-   * You should call nsIParserUtils::convertToPlainText() instead of calling 
-   * this method.
-   *
-   * @param src The HTML string to convert to plain text.
-   */ 
-  AString unescape(in AString src);
-        
-  /**
-   * Parses markup into a sanitized document fragment. This is equivalent to
-   * calling nsIParserUtils::parseFragment(fragment, 0, isXML, baseURI,
-   * element).
-   *
-   * You should call nsIParserUtils::parseFragment() instead of calling this 
-   * method.
-   * @param fragment the input markup
-   * @param isXML true if |fragment| is XML and false if HTML
-   * @param baseURI the base URL for this fragment
-   * @param element the context node for the fragment parsing algorithm
-   */
-  DocumentFragment parseFragment(in AString fragment,
-                                 in boolean isXML,
-                                 in nsIURI baseURI,
-                                 in Element element);
-};
-
-%{ C++
-#define NS_SCRIPTABLEUNESCAPEHTML_CONTRACTID \
-  "@mozilla.org/feed-unescapehtml;1"
-#define NS_SCRIPTABLEUNESCAPEHTML_CID  \
-{ 0x10f2f5f0, 0xf103, 0x4901, { 0x98, 0x0f, 0xba, 0x11, 0xbd, 0x70, 0xd6, 0x0d} }
-%}
--- a/parser/html/nsParserUtils.cpp
+++ b/parser/html/nsParserUtils.cpp
@@ -19,47 +19,37 @@
 #include "nsIComponentManager.h"
 #include "nsIContent.h"
 #include "nsIContentSink.h"
 #include "nsIDTD.h"
 #include "nsIDocument.h"
 #include "nsIDocumentEncoder.h"
 #include "nsIFragmentContentSink.h"
 #include "nsIParser.h"
-#include "nsIScriptableUnescapeHTML.h"
 #include "nsISupportsPrimitives.h"
 #include "nsNetCID.h"
 #include "nsNetUtil.h"
 #include "nsParserCIID.h"
 #include "nsString.h"
 #include "nsTreeSanitizer.h"
 #include "nsXPCOM.h"
 
 #define XHTML_DIV_TAG "div xmlns=\"http://www.w3.org/1999/xhtml\""
 
 using namespace mozilla::dom;
 
-NS_IMPL_ISUPPORTS(nsParserUtils, nsIScriptableUnescapeHTML, nsIParserUtils)
+NS_IMPL_ISUPPORTS(nsParserUtils, nsIParserUtils)
 
 NS_IMETHODIMP
 nsParserUtils::ConvertToPlainText(const nsAString& aFromStr, uint32_t aFlags,
                                   uint32_t aWrapCol, nsAString& aToStr) {
   return nsContentUtils::ConvertToPlainText(aFromStr, aToStr, aFlags, aWrapCol);
 }
 
 NS_IMETHODIMP
-nsParserUtils::Unescape(const nsAString& aFromStr, nsAString& aToStr) {
-  return nsContentUtils::ConvertToPlainText(
-      aFromStr, aToStr,
-      nsIDocumentEncoder::OutputSelectionOnly |
-          nsIDocumentEncoder::OutputAbsoluteLinks,
-      0);
-}
-
-NS_IMETHODIMP
 nsParserUtils::Sanitize(const nsAString& aFromStr, uint32_t aFlags,
                         nsAString& aToStr) {
   nsCOMPtr<nsIURI> uri;
   NS_NewURI(getter_AddRefs(uri), "about:blank");
   nsCOMPtr<nsIPrincipal> principal =
       mozilla::NullPrincipal::CreateWithoutOriginAttributes();
   nsCOMPtr<nsIDocument> document;
   nsresult rv = NS_NewDOMDocument(getter_AddRefs(document), EmptyString(),
@@ -81,24 +71,16 @@ nsParserUtils::Sanitize(const nsAString&
                           nsIDocumentEncoder::OutputEncodeBasicEntities |
                           nsIDocumentEncoder::OutputLFLineBreak |
                           nsIDocumentEncoder::OutputRaw);
 
   return encoder->EncodeToString(aToStr);
 }
 
 NS_IMETHODIMP
-nsParserUtils::ParseFragment(const nsAString& aFragment, bool aIsXML,
-                             nsIURI* aBaseURI, Element* aContextElement,
-                             DocumentFragment** aReturn) {
-  return nsParserUtils::ParseFragment(aFragment, 0, aIsXML, aBaseURI,
-                                      aContextElement, aReturn);
-}
-
-NS_IMETHODIMP
 nsParserUtils::ParseFragment(const nsAString& aFragment, uint32_t aFlags,
                              bool aIsXML, nsIURI* aBaseURI,
                              Element* aContextElement,
                              DocumentFragment** aReturn) {
   NS_ENSURE_ARG(aContextElement);
   *aReturn = nullptr;
 
   nsCOMPtr<nsIDocument> document;
--- a/parser/html/nsParserUtils.h
+++ b/parser/html/nsParserUtils.h
@@ -1,23 +1,20 @@
 /* -*- Mode: C++; tab-width: 8; 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/. */
 
 #ifndef nsParserUtils_h
 #define nsParserUtils_h
 
-#include "nsIScriptableUnescapeHTML.h"
 #include "nsIParserUtils.h"
 #include "mozilla/Attributes.h"
 
-class nsParserUtils final : public nsIScriptableUnescapeHTML,
-                            public nsIParserUtils {
+class nsParserUtils final : public nsIParserUtils {
   ~nsParserUtils() {}
 
  public:
   NS_DECL_ISUPPORTS
-  NS_DECL_NSISCRIPTABLEUNESCAPEHTML
   NS_DECL_NSIPARSERUTILS
 };
 
 #endif  // nsParserUtils_h