Bug 1437300 - Remove nsIDocCharset. r?bz draft
authorAdrian Wielgosik <adrian.wielgosik@gmail.com>
Sat, 10 Feb 2018 19:12:42 +0100
changeset 754068 85e366cb90b2542f481f6615335260f3f2fc9f42
parent 753522 a8e153c55eeee93a11e87d325fb20c644421036f
push id98746
push userbmo:adrian.wielgosik@gmail.com
push dateMon, 12 Feb 2018 20:01:41 +0000
reviewersbz
bugs1437300
milestone60.0a1
Bug 1437300 - Remove nsIDocCharset. r?bz MozReview-Commit-ID: Ldl4utK3JKr
docshell/base/moz.build
docshell/base/nsDocShell.cpp
docshell/base/nsDocShell.h
docshell/base/nsIDocCharset.idl
docshell/test/mochitest.ini
docshell/test/moz.build
docshell/test/test_bug713825.html
dom/base/nsGlobalWindowInner.cpp
dom/base/nsGlobalWindowOuter.cpp
--- a/docshell/base/moz.build
+++ b/docshell/base/moz.build
@@ -35,17 +35,16 @@ DIRS += [
     'timeline',
 ]
 
 XPIDL_SOURCES += [
     'nsCDefaultURIFixup.idl',
     'nsIClipboardCommands.idl',
     'nsIContentViewer.idl',
     'nsIContentViewerEdit.idl',
-    'nsIDocCharset.idl',
     'nsIDocShell.idl',
     'nsIDocShellLoadInfo.idl',
     'nsIDocShellTreeItem.idl',
     'nsIDocShellTreeOwner.idl',
     'nsIDocumentLoaderFactory.idl',
     'nsIDownloadHistory.idl',
     'nsIGlobalHistory2.idl',
     'nsILoadContext.idl',
--- a/docshell/base/nsDocShell.cpp
+++ b/docshell/base/nsDocShell.cpp
@@ -513,17 +513,16 @@ NS_IMPL_RELEASE_INHERITED(nsDocShell, ns
 
 NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(nsDocShell)
   NS_INTERFACE_MAP_ENTRY(nsIDocShell)
   NS_INTERFACE_MAP_ENTRY(nsIDocShellTreeItem)
   NS_INTERFACE_MAP_ENTRY(nsIWebNavigation)
   NS_INTERFACE_MAP_ENTRY(nsIBaseWindow)
   NS_INTERFACE_MAP_ENTRY(nsIScrollable)
   NS_INTERFACE_MAP_ENTRY(nsITextScroll)
-  NS_INTERFACE_MAP_ENTRY(nsIDocCharset)
   NS_INTERFACE_MAP_ENTRY(nsIRefreshURI)
   NS_INTERFACE_MAP_ENTRY(nsIWebProgressListener)
   NS_INTERFACE_MAP_ENTRY(nsISupportsWeakReference)
   NS_INTERFACE_MAP_ENTRY(nsIWebPageDescriptor)
   NS_INTERFACE_MAP_ENTRY(nsIAuthPromptProvider)
   NS_INTERFACE_MAP_ENTRY(nsILoadContext)
   NS_INTERFACE_MAP_ENTRY(nsIWebShellServices)
   NS_INTERFACE_MAP_ENTRY(nsILinkHandler)
--- a/docshell/base/nsDocShell.h
+++ b/docshell/base/nsDocShell.h
@@ -16,17 +16,16 @@
 #include "mozilla/WeakPtr.h"
 
 #include "mozilla/dom/ProfileTimelineMarkerBinding.h"
 
 #include "nsIAuthPromptProvider.h"
 #include "nsIBaseWindow.h"
 #include "nsIClipboardCommands.h"
 #include "nsIDeprecationWarner.h"
-#include "nsIDocCharset.h"
 #include "nsIDocShell.h"
 #include "nsIDocShellLoadInfo.h"
 #include "nsIDocShellTreeItem.h"
 #include "nsIDOMStorageManager.h"
 #include "nsIInterfaceRequestor.h"
 #include "nsILinkHandler.h"
 #include "nsILoadContext.h"
 #include "nsILoadURIDelegate.h"
@@ -120,17 +119,16 @@ enum eCharsetReloadState
 
 class nsDocShell final
   : public nsDocLoader
   , public nsIDocShell
   , public nsIWebNavigation
   , public nsIBaseWindow
   , public nsIScrollable
   , public nsITextScroll
-  , public nsIDocCharset
   , public nsIRefreshURI
   , public nsIWebProgressListener
   , public nsIWebPageDescriptor
   , public nsIAuthPromptProvider
   , public nsILoadContext
   , public nsIWebShellServices
   , public nsILinkHandler
   , public nsIClipboardCommands
@@ -172,17 +170,16 @@ public:
   NS_DECL_ISUPPORTS_INHERITED
   NS_DECL_CYCLE_COLLECTION_CLASS_INHERITED(nsDocShell, nsDocLoader)
   NS_DECL_NSIDOCSHELL
   NS_DECL_NSIDOCSHELLTREEITEM
   NS_DECL_NSIWEBNAVIGATION
   NS_DECL_NSIBASEWINDOW
   NS_DECL_NSISCROLLABLE
   NS_DECL_NSITEXTSCROLL
-  NS_DECL_NSIDOCCHARSET
   NS_DECL_NSIINTERFACEREQUESTOR
   NS_DECL_NSIWEBPROGRESSLISTENER
   NS_DECL_NSIREFRESHURI
   NS_DECL_NSIWEBPAGEDESCRIPTOR
   NS_DECL_NSIAUTHPROMPTPROVIDER
   NS_DECL_NSICLIPBOARDCOMMANDS
   NS_DECL_NSIWEBSHELLSERVICES
   NS_DECL_NSINETWORKINTERCEPTCONTROLLER
deleted file mode 100644
--- a/docshell/base/nsIDocCharset.idl
+++ /dev/null
@@ -1,19 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/* 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"
-
-/**
- * The functionality of the nsIDocCharset interface has been incorporated into
- * nsIDocShell.
- *
- * This is an empty interface for backwards compatibility that will go away at
- * some point in the future
- *
- */
-
-[scriptable, uuid(c3faaf6e-40f0-11e1-95fc-6c626d69675c)]
-interface nsIDocCharset : nsISupports
-{};
--- a/docshell/test/mochitest.ini
+++ b/docshell/test/mochitest.ini
@@ -93,17 +93,16 @@ skip-if = toolkit == 'android'
 support-files = file_bug668513.html
 [test_bug669671.html]
 [test_bug675587.html]
 support-files = file_bug675587.html
 [test_bug680257.html]
 [test_bug691547.html]
 [test_bug694612.html]
 [test_bug703855.html]
-[test_bug713825.html]
 [test_bug728939.html]
 [test_bug797909.html]
 [test_bug1045096.html]
 [test_bug1121701.html]
 [test_bug1151421.html]
 [test_bug1186774.html]
 [test_forceinheritprincipal_overrule_owner.html]
 [test_framedhistoryframes.html]
--- a/docshell/test/moz.build
+++ b/docshell/test/moz.build
@@ -131,16 +131,13 @@ with Files('*637644*'):
     BUG_COMPONENT = ('Core', 'DOM: Core & HTML')
 
 with Files('*640387*'):
     BUG_COMPONENT = ('Core', 'DOM: Events')
 
 with Files('*668513*'):
     BUG_COMPONENT = ('Core', 'DOM')
 
-with Files('*713825*'):
-    BUG_COMPONENT = ('Core', 'Internationalization')
-
 with Files('*797909*'):
     BUG_COMPONENT = ('Core', 'DOM: Core & HTML')
 
 with Files('*forceinheritprincipal*'):
     BUG_COMPONENT = ('Core', 'DOM: Security')
deleted file mode 100644
--- a/docshell/test/test_bug713825.html
+++ /dev/null
@@ -1,42 +0,0 @@
-<!DOCTYPE HTML>
-<html>
-<!--
-https://bugzilla.mozilla.org/show_bug.cgi?id=713825
--->
-<head>
-  <meta charset="utf-8">
-  <title>Test for Bug 713825</title>
-  <script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
-  <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
-</head>
-<body>
-<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=713825">Mozilla Bug 713825</a>
-<p id="display"></p>
-<div id="content" style="display: none">
-  
-</div>
-<pre id="test">
-<script type="application/javascript">
-
-/** 
- * Test for Bug 713825 
- *  test that nsIDocCharset still works backward compatibly
- */
-var Ci = SpecialPowers.Ci;
-var docShell = SpecialPowers.wrap(window).QueryInterface(Ci.nsIInterfaceRequestor).
-                      getInterface(Ci.nsIWebNavigation).
-                      QueryInterface(Ci.nsIDocShell);
-
-var charset1 = docShell.charset;
-var charset2 = docShell.QueryInterface(Ci.nsIDocCharset).charset;
-var charset3 = SpecialPowers.wrap(window).QueryInterface(Ci.nsIInterfaceRequestor).
-                      getInterface(Ci.nsIDocCharset).charset;
-
-/* if we get here without throwing and the three charsets are equal, all is OK */
-is(charset1, charset2, "QI'd nsIDocCharset.charset should equal nsIDocShell.charset");
-is(charset1, charset3, "getInterface'd nsIDocCharset.charset should equal nsIDocShell.charset");
-
-</script>
-</pre>
-</body>
-</html>
--- a/dom/base/nsGlobalWindowInner.cpp
+++ b/dom/base/nsGlobalWindowInner.cpp
@@ -103,17 +103,16 @@
 #include "nsIFrame.h"
 #include "nsCanvasFrame.h"
 #include "nsIWidget.h"
 #include "nsIWidgetListener.h"
 #include "nsIBaseWindow.h"
 #include "nsIDeviceSensors.h"
 #include "nsIContent.h"
 #include "nsIDocShell.h"
-#include "nsIDocCharset.h"
 #include "nsIDocument.h"
 #include "Crypto.h"
 #include "nsIDOMDocument.h"
 #include "nsIDOMElement.h"
 #include "nsIDOMEvent.h"
 #include "nsIDOMOfflineResourceList.h"
 #include "nsDOMString.h"
 #include "nsIEmbeddingSiteWindow.h"
--- a/dom/base/nsGlobalWindowOuter.cpp
+++ b/dom/base/nsGlobalWindowOuter.cpp
@@ -101,17 +101,16 @@
 #include "nsIFrame.h"
 #include "nsCanvasFrame.h"
 #include "nsIWidget.h"
 #include "nsIWidgetListener.h"
 #include "nsIBaseWindow.h"
 #include "nsIDeviceSensors.h"
 #include "nsIContent.h"
 #include "nsIDocShell.h"
-#include "nsIDocCharset.h"
 #include "nsIDocument.h"
 #include "Crypto.h"
 #include "nsIDOMDocument.h"
 #include "nsIDOMElement.h"
 #include "nsIDOMEvent.h"
 #include "nsIDOMOfflineResourceList.h"
 #include "nsDOMString.h"
 #include "nsIEmbeddingSiteWindow.h"
@@ -6903,25 +6902,17 @@ nsGlobalWindowOuter::GetComputedStyleHel
 //*****************************************************************************
 
 nsresult
 nsGlobalWindowOuter::GetInterfaceInternal(const nsIID& aIID, void** aSink)
 {
   NS_ENSURE_ARG_POINTER(aSink);
   *aSink = nullptr;
 
-  if (aIID.Equals(NS_GET_IID(nsIDocCharset))) {
-    nsGlobalWindowOuter* outer = GetOuterWindowInternal();
-    NS_ENSURE_TRUE(outer, NS_ERROR_NOT_INITIALIZED);
-
-    NS_WARNING("Using deprecated nsIDocCharset: use nsIDocShell.GetCharset() instead ");
-    nsCOMPtr<nsIDocCharset> docCharset(do_QueryInterface(outer->mDocShell));
-    docCharset.forget(aSink);
-  }
-  else if (aIID.Equals(NS_GET_IID(nsIWebNavigation))) {
+  if (aIID.Equals(NS_GET_IID(nsIWebNavigation))) {
     nsGlobalWindowOuter* outer = GetOuterWindowInternal();
     NS_ENSURE_TRUE(outer, NS_ERROR_NOT_INITIALIZED);
 
     nsCOMPtr<nsIWebNavigation> webNav(do_QueryInterface(outer->mDocShell));
     webNav.forget(aSink);
   }
   else if (aIID.Equals(NS_GET_IID(nsIDocShell))) {
     nsGlobalWindowOuter* outer = GetOuterWindowInternal();