Backed out changeset 1222ad5d15b4 (bug 940907) for breaking l10n. a=backout
authorRyan VanderMeulen <ryanvm@gmail.com>
Fri, 17 Jan 2014 12:16:28 -0500
changeset 174870 f8613903c6b164b8f02826ef1589f37a2c1d60ef
parent 174869 8d2d7087d6ad683ac10431bdd8700eebdcdff2d0
child 174871 9b91c7e0aa11117a3b6aa4d8dcb6e58f084fa942
push id3224
push userlsblakk@mozilla.com
push dateTue, 04 Feb 2014 01:06:49 +0000
treeherdermozilla-beta@60c04d0987f1 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbackout
bugs940907
milestone28.0a2
backs out1222ad5d15b402a10187678be338bc80f452f121
Backed out changeset 1222ad5d15b4 (bug 940907) for breaking l10n. a=backout
browser/base/content/browser-charsetmenu.inc
browser/base/content/browser-doctype.inc
browser/base/content/browser.js
browser/locales/en-US/chrome/browser/charsetMenu.dtd
browser/locales/en-US/chrome/browser/charsetMenu.properties
browser/locales/jar.mn
browser/modules/CharsetMenu.jsm
browser/modules/moz.build
toolkit/components/viewsource/content/viewSource.js
toolkit/components/viewsource/content/viewSource.xul
toolkit/locales/en-US/chrome/global/charsetMenu.dtd
toolkit/locales/en-US/chrome/global/charsetMenu.properties
toolkit/locales/jar.mn
toolkit/modules/CharsetMenu.jsm
toolkit/modules/moz.build
--- a/browser/base/content/browser-charsetmenu.inc
+++ b/browser/base/content/browser-charsetmenu.inc
@@ -6,19 +6,19 @@
 
 #expand <menu id="__ID_PREFIX__charsetMenu"
     label="&charsetMenu.label;"
 #ifndef OMIT_ACCESSKEYS
     accesskey="&charsetMenu.accesskey;"
 #endif
     oncommand="MultiplexHandler(event)"
 #ifdef OMIT_ACCESSKEYS
-#expand    onpopupshowing="CharsetMenu.build(event, '__ID_PREFIX__', false);"
+#expand    onpopupshowing="CharsetMenu.build(event, '__ID_PREFIX__');"
 #else
-#expand    onpopupshowing="CharsetMenu.build(event, '__ID_PREFIX__');"
+#expand    onpopupshowing="CharsetMenu.build(event, '__ID_PREFIX__', true);"
 #endif
     onpopupshown="UpdateMenus(event);">
   <menupopup>
     <menu label="&charsetMenuAutodet.label;"
 #ifndef OMIT_ACCESSKEYS
           accesskey="&charsetMenuAutodet.accesskey;"
 #endif
         >
--- a/browser/base/content/browser-doctype.inc
+++ b/browser/base/content/browser-doctype.inc
@@ -1,16 +1,16 @@
 <!DOCTYPE window [
 <!ENTITY % brandDTD SYSTEM "chrome://branding/locale/brand.dtd" >
 %brandDTD;
 <!ENTITY % browserDTD SYSTEM "chrome://browser/locale/browser.dtd" >
 %browserDTD;
 <!ENTITY % baseMenuDTD SYSTEM "chrome://browser/locale/baseMenuOverlay.dtd" >
 %baseMenuDTD;
-<!ENTITY % charsetDTD SYSTEM "chrome://global/locale/charsetMenu.dtd" >
+<!ENTITY % charsetDTD SYSTEM "chrome://browser/locale/charsetMenu.dtd" >
 %charsetDTD;
 <!ENTITY % textcontextDTD SYSTEM "chrome://global/locale/textcontext.dtd" >
 %textcontextDTD;
 <!ENTITY % customizeToolbarDTD SYSTEM "chrome://global/locale/customizeToolbar.dtd">
   %customizeToolbarDTD;
 <!ENTITY % placesDTD SYSTEM "chrome://browser/locale/places/places.dtd">
 %placesDTD;
 #ifdef MOZ_SAFE_BROWSING
--- a/browser/base/content/browser.js
+++ b/browser/base/content/browser.js
@@ -9,17 +9,17 @@ let Cu = Components.utils;
 Cu.import("resource://gre/modules/XPCOMUtils.jsm");
 Cu.import("resource://gre/modules/NotificationDB.jsm");
 Cu.import("resource:///modules/RecentWindow.jsm");
 Cu.import("resource://gre/modules/WindowsPrefSync.jsm");
 
 XPCOMUtils.defineLazyModuleGetter(this, "Task",
                                   "resource://gre/modules/Task.jsm");
 XPCOMUtils.defineLazyModuleGetter(this, "CharsetMenu",
-                                  "resource://gre/modules/CharsetMenu.jsm");
+                                  "resource:///modules/CharsetMenu.jsm");
 
 const nsIWebNavigation = Ci.nsIWebNavigation;
 
 var gLastBrowserCharset = null;
 var gPrevCharset = null;
 var gProxyFavIcon = null;
 var gLastValidURLStr = "";
 var gInPrintPreviewMode = false;
rename from toolkit/locales/en-US/chrome/global/charsetMenu.dtd
rename to browser/locales/en-US/chrome/browser/charsetMenu.dtd
rename from toolkit/locales/en-US/chrome/global/charsetMenu.properties
rename to browser/locales/en-US/chrome/browser/charsetMenu.properties
--- a/browser/locales/jar.mn
+++ b/browser/locales/jar.mn
@@ -17,16 +17,18 @@
     locale/browser/aboutSessionRestore.dtd         (%chrome/browser/aboutSessionRestore.dtd)
 #ifdef MOZ_SERVICES_SYNC
     locale/browser/syncProgress.dtd                (%chrome/browser/syncProgress.dtd)
     locale/browser/aboutSyncTabs.dtd               (%chrome/browser/aboutSyncTabs.dtd)
 #endif
     locale/browser/browser.dtd                     (%chrome/browser/browser.dtd)
     locale/browser/baseMenuOverlay.dtd             (%chrome/browser/baseMenuOverlay.dtd)
     locale/browser/browser.properties              (%chrome/browser/browser.properties)
+    locale/browser/charsetMenu.properties          (%chrome/browser/charsetMenu.properties)
+    locale/browser/charsetMenu.dtd                 (%chrome/browser/charsetMenu.dtd)
     locale/browser/devtools/appcacheutils.properties  (%chrome/browser/devtools/appcacheutils.properties)
     locale/browser/devtools/debugger.dtd              (%chrome/browser/devtools/debugger.dtd)
     locale/browser/devtools/debugger.properties       (%chrome/browser/devtools/debugger.properties)
     locale/browser/devtools/netmonitor.dtd            (%chrome/browser/devtools/netmonitor.dtd)
     locale/browser/devtools/netmonitor.properties     (%chrome/browser/devtools/netmonitor.properties)
     locale/browser/devtools/shadereditor.dtd          (%chrome/browser/devtools/shadereditor.dtd)
     locale/browser/devtools/shadereditor.properties   (%chrome/browser/devtools/shadereditor.properties)
     locale/browser/devtools/gcli.properties           (%chrome/browser/devtools/gcli.properties)
rename from toolkit/modules/CharsetMenu.jsm
rename to browser/modules/CharsetMenu.jsm
--- a/toolkit/modules/CharsetMenu.jsm
+++ b/browser/modules/CharsetMenu.jsm
@@ -4,17 +4,17 @@
 
 this.EXPORTED_SYMBOLS = [ "CharsetMenu" ];
 
 const { classes: Cc, interfaces: Ci, utils: Cu} = Components;
 
 Cu.import("resource://gre/modules/Services.jsm");
 Cu.import("resource://gre/modules/XPCOMUtils.jsm");
 XPCOMUtils.defineLazyGetter(this, "gBundle", function() {
-  const kUrl = "chrome://global/locale/charsetMenu.properties";
+  const kUrl = "chrome://browser/locale/charsetMenu.properties";
   return Services.strings.createBundle(kUrl);
 });
 /**
  * This set contains encodings that are in the Encoding Standard, except:
  *  - XSS-dangerous encodings (except ISO-2022-JP which is assumed to be
  *    too common not to be included).
  *  - x-user-defined, which practically never makes sense as an end-user-chosen
  *    override.
@@ -76,17 +76,17 @@ const kEncodings = new Set([
 
 // Always at the start of the menu, in this order, followed by a separator.
 const kPinned = [
   "UTF-8",
   "windows-1252"
 ];
 
 this.CharsetMenu = Object.freeze({
-  build: function BuildCharsetMenu(event, idPrefix="", showAccessKeys=true) {
+  build: function BuildCharsetMenu(event, idPrefix="", showAccessKeys=false) {
     let parent = event.target;
     if (parent.lastChild.localName != "menuseparator") {
       // Detector menu or charset menu already built
       return;
     }
     let doc = parent.ownerDocument;
 
     function createItem(encoding) {
--- a/browser/modules/moz.build
+++ b/browser/modules/moz.build
@@ -3,16 +3,17 @@
 # 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/.
 
 TEST_DIRS += ['test']
 
 EXTRA_JS_MODULES += [
     'BrowserNewTabPreloader.jsm',
+    'CharsetMenu.jsm',
     'ContentClick.jsm',
     'NetworkPrioritizer.jsm',
     'offlineAppCache.jsm',
     'openLocationLastURL.jsm',
     'SharedFrame.jsm',
     'SignInToWebsite.jsm',
     'SitePermissions.jsm',
     'Social.jsm',
--- a/toolkit/components/viewsource/content/viewSource.js
+++ b/toolkit/components/viewsource/content/viewSource.js
@@ -1,16 +1,15 @@
 // -*- Mode: Java; tab-width: 2; 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/. */
 
 Components.utils.import("resource://gre/modules/Services.jsm");
-Components.utils.import("resource://gre/modules/CharsetMenu.jsm");
 
 const Cc = Components.classes;
 const Ci = Components.interfaces;
 
 var gLastLineFound = '';
 var gGoToLine = 0;
 
 [
@@ -662,77 +661,16 @@ function BrowserCharsetReload()
 }
 
 function BrowserSetForcedCharacterSet(aCharset)
 {
   gBrowser.docShell.charset = aCharset;
   BrowserCharsetReload();
 }
 
-function MultiplexHandler(event)
-{
-  var node = event.target;
-  var name = node.getAttribute("name");
-
-  if (name == "detectorGroup") {
-    SelectDetector(event);
-    BrowserCharsetReload();
-  } else if (name == "charsetGroup") {
-    var charset = node.getAttribute("id");
-    charset = charset.substring(charset.indexOf("charset.") + "charset.".length);
-    BrowserSetForcedCharacterSet(charset);
-  }
-}
-
-function SelectDetector(event)
-{
-  var uri =  event.target.getAttribute("id");
-  var prefvalue = uri.substring(uri.indexOf("chardet.") + "chardet.".length);
-  if ("off" == prefvalue) { // "off" is special value to turn off the detectors
-    prefvalue = "";
-  }
-
-  try {
-    var str = Cc["@mozilla.org/supports-string;1"].
-              createInstance(Ci.nsISupportsString);
-    str.data = prefvalue;
-    gPrefService.setComplexValue("intl.charset.detector", Ci.nsISupportsString, str);
-  }
-  catch (ex) {
-    dump("Failed to set the intl.charset.detector preference.\n");
-  }
-}
-
-function UpdateCurrentCharset() {
-  var menuitem = document.getElementById("charset." + content.document.characterSet);
-  if (menuitem)
-    menuitem.setAttribute("checked", "true");
-}
-
-function UpdateCharsetDetector() {
-  var prefvalue;
-
-  try {
-    prefvalue = gPrefService.getComplexValue("intl.charset.detector", Ci.nsIPrefLocalizedString).data;
-  }
-  catch (ex) {}
-
-  if (!prefvalue)
-    prefvalue = "off";
-
-  var menuitem = document.getElementById("chardet." + prefvalue);
-  if (menuitem)
-    menuitem.setAttribute("checked", "true");
-}
-
-function UpdateMenus() {
-  UpdateCurrentCharset();
-  UpdateCharsetDetector();
-}
-
 function BrowserForward(aEvent) {
   try {
     gBrowser.goForward();
   }
   catch(ex) {
   }
 }
 
--- a/toolkit/components/viewsource/content/viewSource.xul
+++ b/toolkit/components/viewsource/content/viewSource.xul
@@ -9,18 +9,16 @@
 <?xml-stylesheet href="chrome://mozapps/skin/viewsource/viewsource.css" type="text/css"?>
 <?xul-overlay href="chrome://global/content/editMenuOverlay.xul"?>
 
 <!DOCTYPE window [
 <!ENTITY % brandDTD SYSTEM "chrome://branding/locale/brand.dtd" >
 %brandDTD;
 <!ENTITY % sourceDTD SYSTEM "chrome://global/locale/viewSource.dtd" >
 %sourceDTD;
-<!ENTITY % charsetDTD SYSTEM "chrome://global/locale/charsetMenu.dtd" >
-%charsetDTD;
 ]>
 
 <window id="viewSource"
         xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
         onload="onLoadViewSource();"
         contenttitlesetting="true"
         title="&mainWindow.title;" 
         titlemodifier="&mainWindow.titlemodifier;" 
@@ -191,53 +189,16 @@
                         label="&menu_textReduce.label;" accesskey="&menu_textReduce.accesskey;"
                         key="key_textZoomReduce"/>
               <menuseparator/>
               <menuitem id="menu_textReset" command="cmd_textZoomReset"
                         label="&menu_textReset.label;" accesskey="&menu_textReset.accesskey;"
                         key="key_textZoomReset"/>
             </menupopup>
           </menu>
-
-          <!-- Charset Menu -->
-          <menu id="charsetMenu"
-                label="&charsetMenu.label;"
-                accesskey="&charsetMenu.accesskey;"
-                oncommand="MultiplexHandler(event);"
-                onpopupshowing="CharsetMenu.build(event);"
-                onpopupshown="UpdateMenus();">
-            <menupopup>
-              <menu label="&charsetMenuAutodet.label;"
-                    accesskey="&charsetMenuAutodet.accesskey;">
-                <menupopup>
-                  <menuitem type="radio"
-                            name="detectorGroup"
-                            id="chardet.off"
-                            label="&charsetMenuAutodet.off.label;"
-                            accesskey="&charsetMenuAutodet.off.accesskey;"/>
-                  <menuitem type="radio"
-                            name="detectorGroup"
-                            id="chardet.ja_parallel_state_machine"
-                            label="&charsetMenuAutodet.ja.label;"
-                            accesskey="&charsetMenuAutodet.ja.accesskey;"/>
-                  <menuitem type="radio"
-                            name="detectorGroup"
-                            id="chardet.ruprob"
-                            label="&charsetMenuAutodet.ru.label;"
-                            accesskey="&charsetMenuAutodet.ru.accesskey;"/>
-                  <menuitem type="radio"
-                            name="detectorGroup"
-                            id="chardet.ukprob"
-                            label="&charsetMenuAutodet.uk.label;"
-                            accesskey="&charsetMenuAutodet.uk.accesskey;"/>
-                </menupopup>
-              </menu>
-              <menuseparator/>
-            </menupopup>
-          </menu>
           <menuseparator/>
           <menuitem id="menu_wrapLongLines" type="checkbox" command="cmd_wrapLongLines"
                     label="&menu_wrapLongLines.title;" accesskey="&menu_wrapLongLines.accesskey;"/>
           <menuitem type="checkbox" id="menu_highlightSyntax" command="cmd_highlightSyntax"
                     label="&menu_highlightSyntax.label;" accesskey="&menu_highlightSyntax.accesskey;"/>
         </menupopup>
       </menu>
     </menubar>  
--- a/toolkit/locales/jar.mn
+++ b/toolkit/locales/jar.mn
@@ -13,18 +13,16 @@
   locale/@AB_CD@/global/aboutSupport.dtd                (%chrome/global/aboutSupport.dtd)
   locale/@AB_CD@/global/aboutSupport.properties         (%chrome/global/aboutSupport.properties)
   locale/@AB_CD@/global/aboutTelemetry.dtd              (%chrome/global/aboutTelemetry.dtd)
   locale/@AB_CD@/global/aboutTelemetry.properties       (%chrome/global/aboutTelemetry.properties)
   locale/@AB_CD@/global/actions.dtd                     (%chrome/global/actions.dtd)
   locale/@AB_CD@/global/appPicker.dtd                   (%chrome/global/appPicker.dtd)
   locale/@AB_CD@/global/brand.dtd                       (generic/chrome/global/brand.dtd)
   locale/@AB_CD@/global/browser.properties              (%chrome/global/browser.properties)
-  locale/@AB_CD@/global/charsetMenu.dtd                 (%chrome/global/charsetMenu.dtd)
-  locale/@AB_CD@/global/charsetMenu.properties          (%chrome/global/charsetMenu.properties)
   locale/@AB_CD@/global/charsetOverlay.dtd              (%chrome/global/charsetOverlay.dtd)
   locale/@AB_CD@/global/commonDialog.dtd                (%chrome/global/commonDialog.dtd)
   locale/@AB_CD@/global/commonDialogs.properties        (%chrome/global/commonDialogs.properties)
   locale/@AB_CD@/global/config.dtd                      (%chrome/global/config.dtd)
   locale/@AB_CD@/global/config.properties               (%chrome/global/config.properties)
   locale/@AB_CD@/global/console.dtd                     (%chrome/global/console.dtd)
   locale/@AB_CD@/global/console.properties              (%chrome/global/console.properties)
   locale/@AB_CD@/global/contentAreaCommands.properties  (%chrome/global/contentAreaCommands.properties)
--- a/toolkit/modules/moz.build
+++ b/toolkit/modules/moz.build
@@ -3,17 +3,16 @@
 # 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/.
 
 TEST_DIRS += ['tests']
 
 EXTRA_JS_MODULES += [
     'AsyncShutdown.jsm',
-    'CharsetMenu.jsm',
     'debug.js',
     'DeferredTask.jsm',
     'Deprecated.jsm',
     'Dict.jsm',
     'FileUtils.jsm',
     'Finder.jsm',
     'Geometry.jsm',
     'Http.jsm',