Bug 1394298 - Don't use atom service in Gecko versions > 22. r=gijs
authorBill Gianopoulos <wgianopoulos@gmail.com>
Wed, 05 Sep 2018 07:38:15 -0400
changeset 2123 a9db5fb61a08
parent 2060 4f72d8882106
child 2124 3adf399a054e
push id522
push userfrgrahl@gmx.net
push dateSun, 14 Oct 2018 13:39:19 +0000
reviewersgijs
bugs1394298
Bug 1394298 - Don't use atom service in Gecko versions > 22. r=gijs
xul/content/static.js
--- a/xul/content/static.js
+++ b/xul/content/static.js
@@ -291,25 +291,28 @@ function initStatic()
 
     // XXX Bug 335998: See cmdHideView for usage of this.
     client.hiddenDocument = document.implementation.createDocument(null, null, null);
 
     multilineInputMode(client.prefs["multiline"]);
     updateSpellcheck(client.prefs["inputSpellcheck"]);
 
     // Initialize userlist stuff
-    // cache all the atoms to stop us crossing XPCOM boundaries *all the time*
-    client.atomCache = new Object();
-    var atomSvc = getService("@mozilla.org/atom-service;1", "nsIAtomService");
-    var atoms = ["founder-true", "founder-false", "admin-true", "admin-false",
-                 "op-true", "op-false", "halfop-true", "halfop-false",
-                 "voice-true", "voice-false", "away-true", "away-false",
-                 "unselected"];
-    for (var i = 0; i < atoms.length; i++)
-        client.atomCache[atoms[i]] = atomSvc.getAtom(atoms[i]);
+
+    if (Services.vc.compare(Services.appinfo.platformVersion, "22.0") < 0) {
+        // cache all the atoms to stop us crossing XPCOM boundaries *all the time*
+        client.atomCache = new Object();
+        var atomSvc = getService("@mozilla.org/atom-service;1", "nsIAtomService");
+        var atoms = ["founder-true", "founder-false", "admin-true", "admin-false",
+                     "op-true", "op-false", "halfop-true", "halfop-false",
+                     "voice-true", "voice-false", "away-true", "away-false",
+                     "unselected"];
+        for (var i = 0; i < atoms.length; i++)
+            client.atomCache[atoms[i]] = atomSvc.getAtom(atoms[i]);
+    }
 
     if (client.prefs["showModeSymbols"])
         setListMode("symbol");
     else
         setListMode("graphic");
 
     var tree = document.getElementById('user-list');
     tree.setAttribute("ondragstart",