Bug 1436605 - Replace remaining Components.interface/Components.utils uses with Ci/Cu in suite. r=frg a=jorgk
authoraceman <acelists@atlas.sk>
Mon, 12 Mar 2018 14:06:00 +0100
changeset 31300 653f2039952a976cdda8500d8b69a81cbefc3e98
parent 31299 ebb2e9fc3e3579b8854b50f87c249b8479ab7c15
child 31301 31f99e02f7b02c927c38157835d74dc0853fc02b
push id383
push userclokep@gmail.com
push dateMon, 07 May 2018 21:52:48 +0000
reviewersfrg, jorgk
bugs1436605
Bug 1436605 - Replace remaining Components.interface/Components.utils uses with Ci/Cu in suite. r=frg a=jorgk
suite/browser/navigatorOverlay.xul
suite/browser/tabbrowser.xml
suite/browser/urlbarBindings.xml
suite/common/bindings/notification.xml
suite/common/bindings/toolbar-xpfe.xml
suite/common/dataman/dataman.xml
suite/common/helpviewer/help.js
suite/common/search/search.xml
suite/common/tests/browser/browser_637020_slow.sjs
suite/extensions/debugQA/content/debugQAMenuOverlay.xul
suite/mailnews/commandglue.js
suite/mailnews/mailWidgets.xml
suite/mailnews/start.xhtml
suite/mailnews/tabmail.xml
--- a/suite/browser/navigatorOverlay.xul
+++ b/suite/browser/navigatorOverlay.xul
@@ -200,17 +200,17 @@
     <command id="Browser:Forward" oncommand="BrowserForward();" observes="canGoForward"/>
     <command id="Browser:Up"      oncommand="BrowserUp();"      observes="canGoUp"/>
     <commandset id="viewZoomCommands"/>
     <commandset id="tasksCommands"/>
 
     <!-- Tools Menu -->
     <command id="Browser:SearchInternet" oncommand="BrowserSearch.webSearch();"/>
     <command id="Tools:Sanitize"
-             oncommand="Components.classes['@mozilla.org/suite/suiteglue;1'].getService(Components.interfaces.nsISuiteGlue).sanitize(window);"/>
+             oncommand="Cc['@mozilla.org/suite/suiteglue;1'].getService(Ci.nsISuiteGlue).sanitize(window);"/>
 
   </commandset>
 
   <broadcasterset id="navBroadcasters">
     <broadcaster id="canGoBack"    disabled="true"/>
     <broadcaster id="canGoForward" disabled="true"/>
     <broadcaster id="canGoUp"      disabled="true"/>
     <broadcaster id="Communicator:WorkMode"/>
--- a/suite/browser/tabbrowser.xml
+++ b/suite/browser/tabbrowser.xml
@@ -93,39 +93,35 @@
                          xbl:inherits="tooltip=contenttooltip,contextmenu=contentcontextmenu,autocompletepopup"/>
           </xul:notificationbox>
         </xul:tabpanels>
       </xul:tabbox>
       <children/>
     </content>
     <implementation implements="nsIObserver">
       <field name="mSessionStore" readonly="true">
-        Components.classes["@mozilla.org/suite/sessionstore;1"]
-                   .getService(Components.interfaces.nsISessionStore);
+        Cc["@mozilla.org/suite/sessionstore;1"].getService(Ci.nsISessionStore);
       </field>
       <field name="mPrefs" readonly="true">
-        Components.classes['@mozilla.org/preferences-service;1']
-                  .getService(Components.interfaces.nsIPrefBranch);
+        Cc['@mozilla.org/preferences-service;1'].getService(Ci.nsIPrefBranch);
       </field>
       <field name="mURIFixup" readonly="true">
-        Components.classes["@mozilla.org/docshell/urifixup;1"]
-                  .getService(Components.interfaces.nsIURIFixup);
+        Cc["@mozilla.org/docshell/urifixup;1"].getService(Ci.nsIURIFixup);
       </field>
       <field name="mFaviconService" readonly="true">
-        Components.classes["@mozilla.org/browser/favicon-service;1"]
-                  .getService(Components.interfaces.nsIFaviconService)
-                  .QueryInterface(Components.interfaces.mozIAsyncFavicons);
+        Cc["@mozilla.org/browser/favicon-service;1"]
+          .getService(Ci.nsIFaviconService)
+          .QueryInterface(Ci.mozIAsyncFavicons);
       </field>
       <field name="mIOService" readonly="true">
-        Components.classes["@mozilla.org/network/io-service;1"]
-                  .getService(Components.interfaces.nsIIOService);
+        Cc["@mozilla.org/network/io-service;1"].getService(Ci.nsIIOService);
       </field>
       <field name="mSecMan" readonly="true">
-        Components.classes["@mozilla.org/scriptsecuritymanager;1"]
-                  .getService(Components.interfaces.nsIScriptSecurityManager);
+        Cc["@mozilla.org/scriptsecuritymanager;1"]
+          .getService(Ci.nsIScriptSecurityManager);
       </field>
       <field name="mTabBox" readonly="true">
         document.getAnonymousElementByAttribute(this, "anonid", "tabbox");
       </field>
       <field name="mStrip" readonly="true">
         document.getAnonymousElementByAttribute(this, "anonid", "strip");
       </field>
       <field name="tabContainer" readonly="true">
@@ -160,20 +156,20 @@
       </field>
       <field name="mTabFilters">
         new Array()
       </field>
       <field name="mLastRelatedIndex">
         0
       </field>
       <field name="usePrivateBrowsing" readonly="true">
-        window.QueryInterface(Components.interfaces.nsIInterfaceRequestor)
-              .getInterface(Components.interfaces.nsIWebNavigation)
-              .QueryInterface(Components.interfaces.nsILoadContext)
-              .usePrivateBrowsing
+        window.QueryInterface(Ci.nsIInterfaceRequestor)
+              .getInterface(Ci.nsIWebNavigation)
+              .QueryInterface(Ci.nsILoadContext)
+              .usePrivateBrowsing;
       </field>
       <field name="mContextTab">
         null
       </field>
       <field name="_keyEventHandler" readonly="true">
       <![CDATA[({
         handleEvent: function handleEvent(aEvent) {
           if (aEvent.altKey)
@@ -3338,18 +3334,17 @@
 
       <destructor>
         <![CDATA[
           window.removeEventListener("resize", this);
         ]]>
       </destructor>
 
       <field name="mPrefs" readonly="true">
-        Components.classes["@mozilla.org/preferences-service;1"]
-                  .getService(Components.interfaces.nsIPrefBranch);
+        Cc["@mozilla.org/preferences-service;1"].getService(Ci.nsIPrefBranch);
       </field>
 
       <field name="arrowScrollboxWidth">0</field>
 
       <field name="arrowScrollbox">
         document.getAnonymousElementByAttribute(this, "anonid", "arrowscrollbox");
       </field>
 
--- a/suite/browser/urlbarBindings.xml
+++ b/suite/browser/urlbarBindings.xml
@@ -65,19 +65,19 @@
       <destructor><![CDATA[
         this.inputField.removeEventListener("underflow", this);
         this.inputField.removeEventListener("overflow", this);
         this.inputField.controllers.removeController(this._editItemsController);
         this.mPrefs.removeObserver("browser.urlbar", this.mPrefObserver);
       ]]></destructor>
 
       <field name="mPrefs">
-        var svc = Components.classes["@mozilla.org/preferences-service;1"]
-                            .getService(Components.interfaces.nsIPrefService);
-        svc.getBranch(null);
+        Cc["@mozilla.org/preferences-service;1"]
+          .getService(Ci.nsIPrefService);
+          .getBranch(null);
       </field>
 
       <field name="mPrefObserver"><![CDATA[
         ({
           urlbar: this,
 
           observe: function(aObserver, aBlah, aPref) {
             if (/^browser\.urlbar\./.test(aPref))
@@ -381,29 +381,28 @@
                 onget="return this.textbox.getAttribute('defaultSearchEngine') == 'true';"
                 onset="this.textbox.setAttribute('defaultSearchEngine', val); return val;"/>
 
       <field name="mSearchBox">
          document.getAnonymousElementByAttribute(this, "role", "search-box");
       </field>
 
       <field name="mPrefs">
-        Components.classes["@mozilla.org/preferences-service;1"]
-                  .getService(Components.interfaces.nsIPrefService)
-                  .getBranch(null);
+        Cc["@mozilla.org/preferences-service;1"]
+          .getService(Ci.nsIPrefService)
+          .getBranch(null);
       </field>
 
       <field name="mObSvc">
-        Components.classes["@mozilla.org/observer-service;1"]
-                  .getService(Components.interfaces.nsIObserverService);
+        Cc["@mozilla.org/observer-service;1"].getService(Ci.nsIObserverService);
       </field>
 
       <field name="mSearchService">
-        Components.classes["@mozilla.org/browser/search-service;1"]
-                  .getService(Components.interfaces.nsIBrowserSearchService);
+        Cc["@mozilla.org/browser/search-service;1"]
+          .getService(Ci.nsIBrowserSearchService);
       </field>
 
       <field name="mObserver"><![CDATA[
         ({
           resultsPopup: this,
 
           observe: function(aSubject, aTopic, aData) {
             switch (aTopic) {
@@ -570,18 +569,18 @@
           this.searchValue = text;
       ]]></constructor>
 
       <field name="mSelectedIndex">
         -1
       </field>
 
       <field name="mSearchService">
-        Components.classes["@mozilla.org/browser/search-service;1"]
-                  .getService(Components.interfaces.nsIBrowserSearchService);
+        Cc["@mozilla.org/browser/search-service;1"]
+          .getService(Ci.nsIBrowserSearchService);
       </field>
 
       <property name="activeChild"
                 onget="return this.childNodes[this.mSelectedIndex]"/>
 
       <property name="selectedIndex">
         <getter>return this.mSelectedIndex;</getter>
 
--- a/suite/common/bindings/notification.xml
+++ b/suite/common/bindings/notification.xml
@@ -78,19 +78,19 @@
                               .QueryInterface(Ci.nsIInterfaceRequestor)
                               .getInterface(Ci.nsIDOMWindowUtils);
             return this._cwu;
           ]]>
         </getter>
       </property>
 
       <field name="usePrivateBrowsing" readonly="true">
-        window.QueryInterface(Components.interfaces.nsIInterfaceRequestor)
-              .getInterface(Components.interfaces.nsIWebNavigation)
-              .QueryInterface(Components.interfaces.nsILoadContext)
+        window.QueryInterface(Ci.nsIInterfaceRequestor)
+              .getInterface(Ci.nsIWebNavigation)
+              .QueryInterface(Ci.nsILoadContext)
               .usePrivateBrowsing
       </field>
 
       <method name="onDocumentChange">
         <body>
           <![CDATA[
             this.crashNotified = false;
             this.clickToPlayPluginsActivated = false;
--- a/suite/common/bindings/toolbar-xpfe.xml
+++ b/suite/common/bindings/toolbar-xpfe.xml
@@ -185,18 +185,18 @@
         this.prefs.removeObserver(this.domain, this);
       </destructor>
 
       <field name="domain" readonly="true">
         "browser.chrome.toolbar_style"
       </field>
 
       <field name="prefs" readonly="true">
-        Components.classes["@mozilla.org/preferences-service;1"]
-                  .getService(Components.interfaces.nsIPrefService).getBranch(null)
+        Cc["@mozilla.org/preferences-service;1"]
+          .getService(Ci.nsIPrefService).getBranch(null)
       </field>
 
       <method name="observe">
         <parameter name="subject"/>
         <parameter name="topic"/>
         <parameter name="name"/>
         <body>
           <![CDATA[
--- a/suite/common/dataman/dataman.xml
+++ b/suite/common/dataman/dataman.xml
@@ -145,17 +145,17 @@
       <xul:hbox role="group" aria-labelledby="permLabel">
         <xul:checkbox class="indent" anonid="useDefault" label="&perm.UseDefault;"
                       oncommand="document.getBindingParent(this).useDefault(this.checked);"/>
         <xul:spacer flex="1"/>
         <xul:radiogroup anonid="radioGroup" orient="horizontal">
           <xul:radio anonid="permSetting-1" label="&perm.Allow;"
                      oncommand="document.getBindingParent(this).setCapability(Services.perms.ALLOW_ACTION);"/>
           <xul:radio anonid="permSetting-8" label="&perm.AllowSession;"
-                     oncommand="document.getBindingParent(this).setCapability(Components.interfaces.nsICookiePermission.ACCESS_SESSION);"/>
+                     oncommand="document.getBindingParent(this).setCapability(Ci.nsICookiePermission.ACCESS_SESSION);"/>
           <xul:radio anonid="permSetting-2" label="&perm.Block;"
                      oncommand="document.getBindingParent(this).setCapability(Services.perms.DENY_ACTION);"/>
         </xul:radiogroup>
       </xul:hbox>
     </content>
   </binding>
 
   <binding id="perm-geo-item"
--- a/suite/common/helpviewer/help.js
+++ b/suite/common/helpviewer/help.js
@@ -29,38 +29,36 @@ const platform = "win";
 #ifdef XP_MACOSX
 const platform = "mac";
 #else
 const platform = "unix";
 #endif
 #endif
 
 # Resources
-const RDF = Components.classes["@mozilla.org/rdf/rdf-service;1"]
-    .getService(Components.interfaces.nsIRDFService);
+const RDF = Cc["@mozilla.org/rdf/rdf-service;1"].getService(Ci.nsIRDFService);
 const RDF_ROOT = RDF.GetResource("urn:root");
 const NC_PANELLIST = RDF.GetResource(NC + "panellist");
 const NC_PANELID = RDF.GetResource(NC + "panelid");
 const NC_EMPTY_SEARCH_TEXT = RDF.GetResource(NC + "emptysearchtext");
 const NC_EMPTY_SEARCH_LINK = RDF.GetResource(NC + "emptysearchlink");
 const NC_DATASOURCES = RDF.GetResource(NC + "datasources");
 const NC_PLATFORM = RDF.GetResource(NC + "platform");
 const NC_SUBHEADINGS = RDF.GetResource(NC + "subheadings");
 const NC_NAME = RDF.GetResource(NC + "name");
 const NC_CHILD = RDF.GetResource(NC + "child");
 const NC_LINK = RDF.GetResource(NC + "link");
 const NC_TITLE = RDF.GetResource(NC + "title");
 const NC_BASE = RDF.GetResource(NC + "base");
 const NC_DEFAULTTOPIC = RDF.GetResource(NC + "defaulttopic");
 
 var RDFContainer =
-   Components.classes["@mozilla.org/rdf/container;1"]
-             .createInstance(Components.interfaces.nsIRDFContainer);
-const CONSOLE_SERVICE = Components.classes['@mozilla.org/consoleservice;1']
-    .getService(Components.interfaces.nsIConsoleService);
+      Cc["@mozilla.org/rdf/container;1"].createInstance(Ci.nsIRDFContainer);
+const CONSOLE_SERVICE = Cc['@mozilla.org/consoleservice;1']
+                          .getService(Ci.nsIConsoleService);
 
 var RE;
 
 var helpFileURI;
 var helpFileDS;
 # Set from nc:base attribute on help rdf file. It may be used for prefix
 # reduction on all links within the current help set.
 var helpBaseURI;
@@ -107,60 +105,59 @@ function init() {
   helpBrowser.docShell.allowSubframes = false;
   helpBrowser.docShell.allowMetaRedirects = false;
 
   strBundle = document.getElementById("bundle_help");
   emptySearchText = strBundle.getString("emptySearchText");
 
   // Get the content pack, base URL, and help topic
   var helpTopic = defaultTopic;
-  if ("arguments" in window && 
-       window.arguments[0] instanceof Components.interfaces.nsIDialogParamBlock) {
+  if ("arguments" in window &&
+      window.arguments[0] instanceof Ci.nsIDialogParamBlock) {
     helpFileURI = window.arguments[0].GetString(0);
     // trailing "/" included.
     helpBaseURI = helpFileURI.substring(0, helpFileURI.lastIndexOf("/")+1);
     helpTopic = window.arguments[0].GetString(1);
   }
 
   loadHelpRDF();
   displayTopic(helpTopic);
 
   // Move to Center of Screen
   const width = document.documentElement.getAttribute("width");
   const height = document.documentElement.getAttribute("height");
   window.moveTo((screen.availWidth - width) / 2, (screen.availHeight - height) / 2);
 
   // Initialize history.
-  getWebNavigation().sessionHistory = 
-    Components.classes["@mozilla.org/browser/shistory;1"]
-              .createInstance(Components.interfaces.nsISHistory);
+  getWebNavigation().sessionHistory =
+    Cc["@mozilla.org/browser/shistory;1"].createInstance(Ci.nsISHistory);
   window.XULBrowserWindow = new nsHelpStatusHandler();
 
   //Start the status handler.
   window.XULBrowserWindow.init();
 
   // Hook up UI through Progress Listener
-  const interfaceRequestor = helpBrowser.docShell.QueryInterface(Components.interfaces.nsIInterfaceRequestor);
-  const webProgress = interfaceRequestor.getInterface(Components.interfaces.nsIWebProgress);
+  const interfaceRequestor = helpBrowser.docShell.QueryInterface(Ci.nsIInterfaceRequestor);
+  const webProgress = interfaceRequestor.getInterface(Ci.nsIWebProgress);
 
-  webProgress.addProgressListener(window.XULBrowserWindow, Components.interfaces.nsIWebProgress.NOTIFY_ALL);
+  webProgress.addProgressListener(window.XULBrowserWindow, Ci.nsIWebProgress.NOTIFY_ALL);
 
   var searchBox = document.getElementById("findText");
   searchBox.clickSelectsAll = getBoolPref("browser.urlbar.clickSelectsAll", true);
 
   setTimeout(focusSearch, 0);
 
   helpExternal = document.getElementById("help-external");
   helpExternal.docShell.useErrorPages = false;
   helpExternal
     .docShell
-    .QueryInterface(Components.interfaces.nsIInterfaceRequestor)
-    .getInterface(Components.interfaces.nsIURIContentListener)
+    .QueryInterface(Ci.nsIInterfaceRequestor)
+    .getInterface(Ci.nsIURIContentListener)
     .parentContentListener = helpContentListener;
-  helpExternal.addProgressListener(window.XULBrowserWindow, Components.interfaces.nsIWebProgress.NOTIFY_ALL);
+  helpExternal.addProgressListener(window.XULBrowserWindow, Ci.nsIWebProgress.NOTIFY_ALL);
 
 }
 function contentClick(event) {
   // is this a left click on a link?
   if (event.shiftKey || event.ctrlKey || event.altKey || event.metaKey || event.button != 0)
     return true;
 
   // is this a link?
@@ -172,17 +169,17 @@ function contentClick(event) {
   // is this an internal link?
   if (target.href.lastIndexOf("chrome:", 0) == 0)
     return true;
 
   var uri = target.href;
   if (/^x-moz-url-link:/.test(uri))
     uri = Services.urlFormatter.formatURLPref(RegExp.rightContext);
 
-  const loadFlags = Components.interfaces.nsIWebNavigation.LOAD_FLAGS_IS_LINK;
+  const loadFlags = Ci.nsIWebNavigation.LOAD_FLAGS_IS_LINK;
   try {
     helpExternal.webNavigation.loadURI(uri, loadFlags, null, null, null);
   } catch (e) {}
   return false;
 }
 
 function showSidebar() {
   document.getElementById("help-sidebar-splitter").setAttribute("state", "open");
@@ -323,44 +320,43 @@ function filterNodeByPlatform(aDatasourc
      log("Datasources over " + MAX_LEVEL + " levels deep are unsupported.");
      return;
   }
 
   // get the subheadings under aCurrentResource and filter them
   var nodes = aDatasource.GetTargets(aCurrentResource, NC_SUBHEADINGS, true);
   while (nodes.hasMoreElements()) {
     var node = nodes.getNext();
-    node = node.QueryInterface(Components.interfaces.nsIRDFResource);
+    node = node.QueryInterface(Ci.nsIRDFResource);
     // should we test for rdf:Seq here?  see also doFindOnDatasource
     filterSeqByPlatform(aDatasource, node, aCurrentLevel+1);
   }
 }
 
 # filterSeqByPlatform
 # Go through the children of aNode, if any, removing statements applicable
 # only on other platforms.
 function filterSeqByPlatform(aDatasource, aNode, aCurrentLevel) {
   // get nc:subheading children into an enumerator
-  var RDFC = Components.classes["@mozilla.org/rdf/container;1"]
-                       .createInstance(Components.interfaces.nsIRDFContainer);
+  var RDFC = Cc["@mozilla.org/rdf/container;1"].createInstance(Ci.nsIRDFContainer);
   RDFC.Init(aDatasource, aNode);
   var targets = RDFC.GetElements();
 
   // process items in the rdf:Seq
   while (targets.hasMoreElements()) {
     var currentTarget = targets.getNext();
 
     // find out on which platforms this node is meaningful
     var nodePlatforms = getAttribute(aDatasource,
-                                     currentTarget.QueryInterface(Components.interfaces.nsIRDFResource),
+                                     currentTarget.QueryInterface(Ci.nsIRDFResource),
                                      NC_PLATFORM,
                                      platform);
 
     if (nodePlatforms.split(/\s+/).indexOf(platform) == -1) { // node is for another platform
-      var currentNode = currentTarget.QueryInterface(Components.interfaces.nsIRDFNode);
+      var currentNode = currentTarget.QueryInterface(Ci.nsIRDFNode);
       // "false" because we don't want to renumber elements in the container
       RDFC.RemoveElement(currentNode, false);
 
       // move to next node - ignore the children, because 1) they might be
       // needed elsewhere and 2) nodes not connected to RDF_ROOT are ignored
       continue;
     }
 
@@ -402,17 +398,17 @@ function getLink(ID) {
     var tocDSArray = gTocDSList.split(/\s+/)
                                .filter(function(x) { return x != "rdf:null"; });
 
     for (var i = 0; i < tocDSArray.length; i++) {
       var resource = RDF.GetResource(tocDSArray[i] + "#" + ID);
       var link = tocDS.GetTarget(resource, NC_LINK, true);
       if (!link)  // no such rdf:ID found
         continue;
-      return link.QueryInterface(Components.interfaces.nsIRDFLiteral).Value;
+      return link.QueryInterface(Ci.nsIRDFLiteral).Value;
     }
     return null;
 }
 
 # Called by contextHelp.js to determine if this window is displaying the
 # requested help file.
 function getHelpFileURI() {
     return helpFileURI;
@@ -430,17 +426,17 @@ function getWebNavigation() {
     return null;
   }
 }
 
 function loadURI(uri) {
     if (uri.substr(0,7) != "chrome:") {
         uri = helpBaseURI + uri;
     }
-    getWebNavigation().loadURI(uri, Components.interfaces.nsIWebNavigation.LOAD_FLAGS_NONE,
+    getWebNavigation().loadURI(uri, Ci.nsIWebNavigation.LOAD_FLAGS_NONE,
         null, null, null);
 }
 
 function goBack() {
   try
   {
     getWebNavigation().goBack();
   } catch (e)
@@ -558,23 +554,23 @@ nsHelpStatusHandler.prototype = {
     onProgressChange : function(aWebProgress, aRequest, aCurSelfProgress,
         aMaxSelfProgress, aCurTotalProgress, aMaxTotalProgress) {},
     onStatusChange : function(aWebProgress, aRequest, aStatus, aMessage) {},
     onSecurityChange : function(aWebProgress, aRequest, state) {},
     onLocationChange : function(aWebProgress, aRequest, aLocation, aFlags) {
         UpdateBackForwardButtons();
     },
     QueryInterface : function(aIID) {
-        if (aIID.equals(Components.interfaces.nsIWebProgressListener) ||
-                aIID.equals(Components.interfaces.nsISupportsWeakReference) ||
-                aIID.equals(Components.interfaces.nsIXULBrowserWindow) ||
-                aIID.equals(Components.interfaces.nsISupports)) {
-            return this;
+        if (aIID.equals(Ci.nsIWebProgressListener) ||
+            aIID.equals(Ci.nsISupportsWeakReference) ||
+            aIID.equals(Ci.nsIXULBrowserWindow) ||
+            aIID.equals(Ci.nsISupports)) {
+          return this;
         }
-        throw Components.results.NS_NOINTERFACE;
+        throw Cr.NS_NOINTERFACE;
     },
 
     init : function() {},
 
     destroy : function() {},
 
     setJSStatus : function(status) {},
     setOverLink : function(link, context) {},
@@ -609,17 +605,17 @@ function UpdateBackForwardButtons() {
     }
 }
 
 function onselect_loadURI(tree) {
     try {
         var resource = tree.view.getResourceAtIndex(tree.currentIndex);
         var link = tree.database.GetTarget(resource, NC_LINK, true);
         if (link) {
-            link = link.QueryInterface(Components.interfaces.nsIRDFLiteral);
+            link = link.QueryInterface(Ci.nsIRDFLiteral);
             loadURI(link.Value);
         }
     } catch (e) {
     }// when switching between tabs a spurious row number is returned.
 }
 
 function focusSearch() {
   var searchBox = document.getElementById("findText");
@@ -648,18 +644,18 @@ function doFind() {
 
     // compile the search string, which has already been split up above, into regexps
     for (var i=0; i < RE.length; ++i) {
       RE[i] = new RegExp(RE[i], "i");
     }
     emptySearch = true;
 
     // search TOC
-    var resultsDS = Components.classes["@mozilla.org/rdf/datasource;1?name=in-memory-datasource"]
-        .createInstance(Components.interfaces.nsIRDFDataSource);
+    var resultsDS = Cc["@mozilla.org/rdf/datasource;1?name=in-memory-datasource"]
+                      .createInstance(Ci.nsIRDFDataSource);
     var sourceDS = helpTocPanel.database;
     doFindOnDatasource(resultsDS, sourceDS, RDF_ROOT, 0);
 
     // search glossary.
     sourceDS = helpGlossaryPanel.database;
     doFindOnDatasource(resultsDS, sourceDS, RDF_ROOT, 0);
 
     // search index
@@ -692,37 +688,34 @@ function doFindOnDatasource(resultsDS, s
         } catch (e) {
             log("Recursive reference to unknown resource.");
         }
         return;
     }
     // find all SUBHEADING children of current resource.
     var targets = sourceDS.GetTargets(resource, NC_SUBHEADINGS, true);
     while (targets.hasMoreElements()) {
-        var target = targets.getNext();
-        target = target.QueryInterface(Components.interfaces.nsIRDFResource);
+        var target = targets.getNext().QueryInterface(Ci.nsIRDFResource);
         // The first child of a rdf:subheading should (must) be a rdf:seq.
         // Should we test for a SEQ here?
         doFindOnSeq(resultsDS, sourceDS, target, level+1);
     }
 }
 
 function doFindOnSeq(resultsDS, sourceDS, resource, level) {
     // load up an RDFContainer so we can access the contents of the current
     // rdf:seq.
     RDFContainer.Init(sourceDS, resource);
     var targets = RDFContainer.GetElements();
     while (targets.hasMoreElements()) {
         var target = targets.getNext();
         var link = sourceDS.GetTarget(target, NC_LINK, true);
         var name = sourceDS.GetTarget(target, NC_NAME, true);
 
-        if (link &&
-            name instanceof Components.interfaces.nsIRDFLiteral &&
-            isMatch(name.Value)) {
+        if (link && name instanceof Ci.nsIRDFLiteral && isMatch(name.Value)) {
             // we have found a search entry - add it to the results datasource.
             var urn = RDF.GetAnonymousResource();
             resultsDS.Assert(urn, NC_NAME, name, true);
             resultsDS.Assert(urn, NC_LINK, link, true);
             resultsDS.Assert(RDF_ROOT, NC_CHILD, urn, true);
 
             emptySearch = false;
         }
@@ -762,17 +755,17 @@ function getAttribute(datasource, resour
     if (!literal) {
         return defaultValue;
     }
     return getLiteralValue(literal, defaultValue);
 }
 
 function getLiteralValue(literal, defaultValue) {
     if (literal) {
-        literal = literal.QueryInterface(Components.interfaces.nsIRDFLiteral);
+        literal = literal.QueryInterface(Ci.nsIRDFLiteral);
         if (literal) {
             return literal.Value;
         }
     }
     if (defaultValue) {
         return defaultValue;
     }
     return null;
@@ -780,36 +773,36 @@ function getLiteralValue(literal, defaul
 
 # Write debug string to error console.
 function log(aText) {
     CONSOLE_SERVICE.logStringMessage(aText);
 }
 
 function getBoolPref (aPrefname, aDefault)
 {
-  try { 
-    var pref = Components.classes["@mozilla.org/preferences-service;1"]
-                         .getService(Components.interfaces.nsIPrefBranch);
+  try {
+    var pref = Cc["@mozilla.org/preferences-service;1"]
+                 .getService(Ci.nsIPrefBranch);
     return pref.getBoolPref(aPrefname);
   }
   catch(e) {
     return aDefault;
   }
 }
 
 # getXulWin - Returns the current Help window as a nsIXULWindow.
 function getXulWin()
 {
-  window.QueryInterface(Components.interfaces.nsIInterfaceRequestor);
-  var webnav = window.getInterface(Components.interfaces.nsIWebNavigation);
-  var dsti = webnav.QueryInterface(Components.interfaces.nsIDocShellTreeItem);
+  window.QueryInterface(Ci.nsIInterfaceRequestor);
+  var webnav = window.getInterface(Ci.nsIWebNavigation);
+  var dsti = webnav.QueryInterface(Ci.nsIDocShellTreeItem);
   var treeowner = dsti.treeOwner;
-  var ifreq = treeowner.QueryInterface(Components.interfaces.nsIInterfaceRequestor);
+  var ifreq = treeowner.QueryInterface(Ci.nsIInterfaceRequestor);
 
-  return ifreq.getInterface(Components.interfaces.nsIXULWindow);
+  return ifreq.getInterface(Ci.nsIXULWindow);
 }
 
 # toggleZLevel - Toggles whether or not the window will always appear on top. Because
 #   alwaysRaised is not supported on an OS other than Windows, this code will not
 #   appear in those builds.
 #
 #   element - The DOM node that persists the checked state.
 #ifdef XP_WIN
@@ -831,27 +824,27 @@ function toggleZLevel(element)
 }
 #endif
 
 var helpContentListener = {
   onStartURIOpen: function(aURI) {
     return false;
   },
   doContent: function(aContentType, aIsContentPreferred, aRequest, aContentHandler) {
-    throw Components.results.NS_ERROR_UNEXPECTED;
+    throw Cr.NS_ERROR_UNEXPECTED;
   },
   isPreferred: function(aContentType, aDesiredContentType) {
     return false;
   },
   canHandleContent: function(aContentType, aIsContentPreferred, aDesiredContentType) {
     return false;
   },
   loadCookie: null,
   parentContentListener: null,
   QueryInterface: function (aIID) {
-    if (aIID.equals(Components.interfaces.nsIURIContentListener) ||
-        aIID.equals(Components.interfaces.nsISupportsWeakReference) ||
-        aIID.equals(Components.interfaces.nsISupports))
+    if (aIID.equals(Ci.nsIURIContentListener) ||
+        aIID.equals(Ci.nsISupportsWeakReference) ||
+        aIID.equals(Ci.nsISupports))
       return this;
 
-    throw Components.results.NS_ERROR_NO_INTERFACE;
+    throw Cr.NS_ERROR_NO_INTERFACE;
   }
 };
--- a/suite/common/search/search.xml
+++ b/suite/common/search/search.xml
@@ -103,23 +103,23 @@
       <field name="_textboxInitialized">false</field>
       <field name="_textbox">document.getAnonymousElementByAttribute(this,
           "anonid", "searchbar-textbox");</field>
       <field name="_popup">document.getAnonymousElementByAttribute(this,
           "anonid", "searchbar-popup");</field>
       <field name="searchButton">document.getAnonymousElementByAttribute(this,
           "anonid", "searchbar-engine-button");</field>
       <field name="_searchService">
-        Components.classes["@mozilla.org/browser/search-service;1"]
-                  .getService(Components.interfaces.nsIBrowserSearchService);
+        Cc["@mozilla.org/browser/search-service;1"]
+          .getService(Ci.nsIBrowserSearchService);
       </field>
       <field name="usePrivateBrowsing" readonly="true">
-        window.QueryInterface(Components.interfaces.nsIInterfaceRequestor)
-              .getInterface(Components.interfaces.nsIWebNavigation)
-              .QueryInterface(Components.interfaces.nsILoadContext)
+        window.QueryInterface(Ci.nsIInterfaceRequestor)
+              .getInterface(Ci.nsIWebNavigation)
+              .QueryInterface(Ci.nsILoadContext)
               .usePrivateBrowsing
       </field>
       <field name="_addedObserver">false</field>
       <field name="_engines">null</field>
       <field name="_needToBuildPopup">true</field>
       <field name="FormHistory" readonly="true"><![CDATA[
         (ChromeUtils.import("resource://gre/modules/FormHistory.jsm", {}))
                     .FormHistory;
@@ -545,24 +545,23 @@
 
         // Because XBL and the customize toolbar code interacts poorly,
         // there may not be anything to remove here
         try {
           this.controllers.removeController(this.searchbarController);
         } catch (ex) { }
       ]]></destructor>
       <field name="_prefBranch">
-        Components.classes["@mozilla.org/preferences-service;1"]
-                  .getService(Components.interfaces.nsIPrefBranch)
+        Cc["@mozilla.org/preferences-service;1"].getService(Ci.nsIPrefBranch);
       </field>
       <field name="_inputBox">
         document.getAnonymousElementByAttribute(this, "anonid", "textbox-input-box");
       </field>
       <field name="_suggestEnabled">
-        this._prefBranch.getBoolPref("browser.search.suggest.enabled")
+        this._prefBranch.getBoolPref("browser.search.suggest.enabled");
       </field>
 
       <method name="observe">
         <parameter name="aSubject"/>
         <parameter name="aTopic"/>
         <parameter name="aData"/>
         <body><![CDATA[
           if (aTopic == "nsPref:changed") {
--- a/suite/common/tests/browser/browser_637020_slow.sjs
+++ b/suite/common/tests/browser/browser_637020_slow.sjs
@@ -1,14 +1,11 @@
 /* Any copyright is dedicated to the Public Domain.
  * http://creativecommons.org/publicdomain/zero/1.0/ */
 
-const Cc = Components.classes;
-const Ci = Components.interfaces;
-
 const DELAY_MS = "2000";
 
 let timer;
 
 function handleRequest(req, resp) {
   resp.processAsync();
   resp.setHeader("Cache-Control", "no-cache", false);
   resp.setHeader("Content-Type", "text/html;charset=utf-8", false);
--- a/suite/extensions/debugQA/content/debugQAMenuOverlay.xul
+++ b/suite/extensions/debugQA/content/debugQAMenuOverlay.xul
@@ -154,17 +154,17 @@
           </menupopup>
         </menu>
 
         <menuseparator/>
 
         <menuitem label="Composer (with test page)"
                   oncommand="window.openDialog('chrome://editor/content/','_blank','chrome,all,dialog=no','chrome://debugqa/content/EditorInitPage.html')"/>
         <menuitem label="Flush Memory"
-                  oncommand="Components.classes['@mozilla.org/xpcom/memory-service;1'].getService(Components.interfaces.nsIMemory).heapMinimize(true);"/>
+                  oncommand="Cc['@mozilla.org/xpcom/memory-service;1'].getService(Ci.nsIMemory).heapMinimize(true);"/>
         <menuitem label="Show Build Configuration"
                   oncommand="openTopWin('about:buildconfig');"/>
 
       </menupopup>
     </menu>
 
     <menu id="qaMenu" accesskey="Q" label="QA" insertbefore="menu_Help">
       <menupopup id="qaMenuPopup">
--- a/suite/mailnews/commandglue.js
+++ b/suite/mailnews/commandglue.js
@@ -57,23 +57,22 @@ function GetServer(uri)
 function LoadMessageByUri(uri)
 {
   //dump("XXX LoadMessageByUri " + uri + " vs " + gCurrentDisplayedMessage + "\n");
   if(uri != gCurrentDisplayedMessage)
   {
         dump("fix this, get the nsIMsgDBHdr and the nsIMsgFolder from the uri...\n");
 /*
     var resource = RDF.GetResource(uri);
-    var message = resource.QueryInterface(Components.interfaces.nsIMessage);
+    var message = resource.QueryInterface(Ci.nsIMessage);
     if (message)
       setTitleFromFolder(message.msgFolder, message.mimef2DecodedSubject);
 
-    var nsIMsgFolder = Components.interfaces.nsIMsgFolder;
     if (message.msgFolder.server.downloadOnBiff)
-      message.msgFolder.biffState = nsIMsgFolder.nsMsgBiffState_NoMail;
+      message.msgFolder.biffState = Ci.nsIMsgFolder.nsMsgBiffState_NoMail;
 */
 
     gCurrentDisplayedMessage = uri;
     gHaveLoadedMessage = true;
     OpenURL(uri);
   }
 
 }
--- a/suite/mailnews/mailWidgets.xml
+++ b/suite/mailnews/mailWidgets.xml
@@ -766,18 +766,18 @@
       <field name="internalScope">null</field>
       <field name="internalValue">-1</field>
       <field readonly="true" name="validityManager">
         <![CDATA[
            Cc['@mozilla.org/mail/search/validityManager;1'].getService(Ci.nsIMsgSearchValidityManager);
         ]]>
       </field>
       <field name="filterService">
-        Components.classes["@mozilla.org/messenger/services/filters;1"]
-                  .getService(Components.interfaces.nsIMsgFilterService)
+        Cc["@mozilla.org/messenger/services/filters;1"]
+          .getService(Ci.nsIMsgFilterService);
       </field>
       <property name="searchScope" onget="return this.internalScope;">
         <!-- scope ID - retrieve the table -->
         <setter>
           <![CDATA[
             // if scope isn't changing this is a noop
             if (this.internalScope == val) return val;
 
@@ -1066,17 +1066,17 @@
       </constructor>
     </implementation>
   </binding>
 
   <!-- searchoperator - Contains, Is Less than, etc -->
   <binding id="searchoperator" name="searchOperator"
            extends="chrome://messenger/content/mailWidgets.xml#search-menulist-abstract">
     <implementation>
-      <field name="searchAttribute">Components.interfaces.nsMsgSearchAttrib.Default</field>
+      <field name="searchAttribute">Ci.nsMsgSearchAttrib.Default</field>
       <field name="stringBundle">
         <![CDATA[
           Cc["@mozilla.org/intl/stringbundle;1"]
             .getService(Ci.nsIStringBundleService)
             .createBundle("chrome://messenger/locale/search-operators.properties")
         ]]>
       </field>
       <property name="valueLabel" readonly="true">
@@ -1202,18 +1202,18 @@
       </xul:menulist>
       <xul:hbox flex="1" class="search-value-custom" xbl:inherits="disabled"/>
     </content>
     <implementation>
       <field name="internalOperator">null</field>
       <field name="internalAttribute">null</field>
       <field name="internalValue">null</field>
       <field name="filterService">
-        Components.classes["@mozilla.org/messenger/services/filters;1"]
-                  .getService(Components.interfaces.nsIMsgFilterService);
+        Cc["@mozilla.org/messenger/services/filters;1"]
+          .getService(Ci.nsIMsgFilterService);
       </field>
       <property name="opParentValue" onget="return this.internalOperator;">
         <setter>
           <![CDATA[
             // noop if we're not changing it
             if (this.internalOperator == val) return val;
 
             // Keywords has the null field IsEmpty
--- a/suite/mailnews/start.xhtml
+++ b/suite/mailnews/start.xhtml
@@ -39,18 +39,18 @@
 <p>&dict_intro.label;</p>
 <p>&dict_info.label;</p>
 <h2>&info.title;</h2>
 <p>&info_bugs.label;</p>
 </div>
 
 <script type="application/javascript">
   // get vendor, dictionaries and release notes URLs from prefs
-  var formatter = Components.classes["@mozilla.org/toolkit/URLFormatterService;1"]
-                            .getService(Components.interfaces.nsIURLFormatter);
+  var formatter = Cc["@mozilla.org/toolkit/URLFormatterService;1"]
+                    .getService(Ci.nsIURLFormatter);
   var vendorURL = formatter.formatURLPref("app.vendorURL");
 
   if (vendorURL != "about:blank") {
     var vendor = document.getElementById("vendorURL");
     if (vendor)
       vendor.setAttribute("href", vendorURL);
   }
 
--- a/suite/mailnews/tabmail.xml
+++ b/suite/mailnews/tabmail.xml
@@ -222,18 +222,17 @@
       <destructor>
         <![CDATA[
           this.mPrefs.removeObserver("browser.tabs.autoHide", this);
           window.controllers.removeController(this);
         ]]>
       </destructor>
 
       <field name="mPrefs">
-        Components.classes["@mozilla.org/preferences-service;1"]
-                  .getService(Components.interfaces.nsIPrefBranch);
+        Cc["@mozilla.org/preferences-service;1"].getService(Ci.nsIPrefBranch);
       </field>
 
       <field name="currentTabInfo">
         null
       </field>
 
       <field name="tabTypes" readonly="true">
         new Object()
@@ -1076,18 +1075,17 @@
             this._animateTimer = null;
           }
           this.arrowScrollbox.removeEventListener("overflow", this);
           this.arrowScrollbox.removeEventListener("underflow", this);
         ]]>
       </destructor>
 
       <field name="mPrefs">
-        Components.classes["@mozilla.org/preferences-service;1"]
-                  .getService(Components.interfaces.nsIPrefBranch);
+        Cc["@mozilla.org/preferences-service;1"].getService(Ci.nsIPrefBranch);
       </field>
 
       <field name="arrowScrollboxWidth">0</field>
 
       <field name="arrowScrollbox">
         document.getAnonymousElementByAttribute(this, "anonid", "arrowscrollbox");
       </field>