Bug 523693 Inline spell checker shouuld be a module r=gavin
authorNeil Rashbrook <neil@parkwaycc.co.uk>
Wed, 28 Oct 2009 11:15:22 +0000
changeset 34241 1ad6877618197ca24a8be1a4104cdc9517ca581d
parent 34240 a27b5299bc1ef50e565895ef9af13df3a2281508
child 34242 9ed3e755663aa475f1e90f8ffed27bef315506bd
push idunknown
push userunknown
push dateunknown
reviewersgavin
bugs523693
milestone1.9.3a1pre
Bug 523693 Inline spell checker shouuld be a module r=gavin
toolkit/content/Makefile.in
toolkit/content/jar.mn
toolkit/content/widgets/textbox.xml
toolkit/obsolete/jar.mn
--- a/toolkit/content/Makefile.in
+++ b/toolkit/content/Makefile.in
@@ -74,16 +74,17 @@ ifeq (http,$(patsubst http%,http,$(SOURC
 DEFINES += -DSOURCE_REPO="$(SOURCE_REPO)"
 endif
 
 ifdef ENABLE_TESTS
 DIRS += tests
 endif
 
 EXTRA_JS_MODULES = \
+  InlineSpellChecker.jsm \
   WindowDraggingUtils.jsm \
   $(NULL)
 
 EXTRA_PP_JS_MODULES = \
   debug.js \
   LightweightThemeConsumer.jsm \
   $(NULL)
 
--- a/toolkit/content/jar.mn
+++ b/toolkit/content/jar.mn
@@ -29,17 +29,16 @@ toolkit.jar:
 *  content/global/customizeToolbar.js         (customizeToolbar.js)
 *  content/global/customizeToolbar.xul        (customizeToolbar.xul)
 *+ content/global/editMenuOverlay.js          (editMenuOverlay.js)
 *+ content/global/editMenuOverlay.xul         (editMenuOverlay.xul)
 *+ content/global/finddialog.js               (finddialog.js)
 *+ content/global/finddialog.xul              (finddialog.xul)
 *+ content/global/findUtils.js                (findUtils.js)
 *+ content/global/globalOverlay.js            (globalOverlay.js)
-*+ content/global/inlineSpellCheckUI.js       (inlineSpellCheckUI.js)
 +  content/global/mozilla.xhtml               (mozilla.xhtml)
 *+ content/global/nsDragAndDrop.js            (nsDragAndDrop.js)
 +  content/global/selectDialog.js             (selectDialog.js)
 +  content/global/selectDialog.xul            (selectDialog.xul)
 *+ content/global/viewZoomOverlay.js          (viewZoomOverlay.js)
 *+ content/global/bindings/autocomplete.xml    (widgets/autocomplete.xml)
 *+ content/global/bindings/browser.xml         (widgets/browser.xml)
 *+ content/global/bindings/button.xml          (widgets/button.xml)
--- a/toolkit/content/widgets/textbox.xml
+++ b/toolkit/content/widgets/textbox.xml
@@ -624,21 +624,18 @@
             if (!(document instanceof CI.nsIDOMXULDocument))
               return null;
 
             var textbox = document.getBindingParent(this);
             if (!textbox || !(textbox instanceof CI.nsIDOMXULTextBoxElement))
               return null;
 
             try {
-              var loader = Components.classes["@mozilla.org/moz/jssubscript-loader;1"].
-                             getService(CI.mozIJSSubScriptLoader);
-              loader.loadSubScript("chrome://global/content/inlineSpellCheckUI.js", this);
-              if ("InlineSpellCheckerUI" in this)
-                this.InlineSpellCheckerUI.init(textbox.editor);
+              Components.utils.import("resource://gre/modules/InlineSpellChecker.jsm", this);
+              this.InlineSpellCheckerUI = new this.InlineSpellChecker(textbox.editor);
             } catch(ex) { }
           }
 
           return this.InlineSpellCheckerUI;
         ]]></getter>
       </property>
 
       <constructor>
--- a/toolkit/obsolete/jar.mn
+++ b/toolkit/obsolete/jar.mn
@@ -1,7 +1,8 @@
 toolkit.jar:
 +  content/global/globalOverlay.xul             (content/globalOverlay.xul)
 *+ content/global/dialogOverlay.xul             (content/dialogOverlay.xul)
 *+ content/global/dialogOverlay.js              (content/dialogOverlay.js)
+   content/global/inlineSpellCheckUI.js         (content/inlineSpellCheckUI.js)
 +  content/global/nsClipboard.js                (content/nsClipboard.js)
 +  content/global/nsUserSettings.js             (content/nsUserSettings.js)
 +  content/global/strres.js                     (content/strres.js)