Bug 389628 - "Implement UI for full page zoom" [p=dao r=mconnor r+sr=sicking (for content/events/) a=blocking-firefox3+ for M9]
authorreed@reedloden.com
Thu, 25 Oct 2007 16:02:20 -0700
changeset 7187 35ea3fbece78dbc1e7d2e5537346413b25d466db
parent 7186 d39f0dddef8c9618b924be75e963e36ad5fa04ec
child 7188 f8383d133e4a6d23a1aa5488f633e04f5d3dda2b
push idunknown
push userunknown
push dateunknown
reviewersmconnor, blocking-firefox3
bugs389628
milestone1.9a9pre
Bug 389628 - "Implement UI for full page zoom" [p=dao r=mconnor r+sr=sicking (for content/events/) a=blocking-firefox3+ for M9]
browser/base/content/browser-menubar.inc
browser/base/content/browser-sets.inc
browser/base/content/browser-textZoom.js
browser/base/content/browser.js
browser/locales/en-US/chrome/browser/browser.dtd
content/events/src/nsEventStateManager.cpp
content/events/src/nsEventStateManager.h
modules/libpref/src/init/all.js
toolkit/components/help/content/help.xul
toolkit/components/help/content/helpContextOverlay.xul
toolkit/components/viewsource/content/viewPartialSource.xul
toolkit/components/viewsource/content/viewSource.xul
toolkit/content/viewZoomOverlay.js
toolkit/locales/en-US/chrome/mozapps/help/help.dtd
--- a/browser/base/content/browser-menubar.inc
+++ b/browser/base/content/browser-menubar.inc
@@ -166,25 +166,25 @@
                           command="Browser:Stop"
 #ifdef XP_MACOSX
                           key="key_stop_mac"/>
 #else
                           key="key_stop"/>
 #endif
                 <menuitem label="&reloadCmd.label;" accesskey="&reloadCmd.accesskey;" command="Browser:Reload" key="key_reload"/>
                 <menuseparator/>
-                <menu id="viewTextZoomMenu" label="&textSize.label;" accesskey="&textSize.accesskey;" observes="isImage">
-                  <menupopup>                    
-                    <menuitem key="key_textZoomEnlarge" label="&textZoomEnlargeCmd.label;" accesskey="&textZoomEnlargeCmd.accesskey;"
-                              command="cmd_textZoomEnlarge"/>
-                    <menuitem key="key_textZoomReduce"  label="&textZoomReduceCmd.label;"  accesskey="&textZoomReduceCmd.accesskey;"
-                              command="cmd_textZoomReduce"/>
+                <menu id="viewFullZoomMenu" label="&fullZoom.label;" accesskey="&fullZoom.accesskey;" observes="isImage">
+                  <menupopup>
+                    <menuitem key="key_fullZoomEnlarge" label="&fullZoomEnlargeCmd.label;" accesskey="&fullZoomEnlargeCmd.accesskey;"
+                              command="cmd_fullZoomEnlarge"/>
+                    <menuitem key="key_fullZoomReduce"  label="&fullZoomReduceCmd.label;"  accesskey="&fullZoomReduceCmd.accesskey;"
+                              command="cmd_fullZoomReduce"/>
                     <menuseparator/>
-                    <menuitem key="key_textZoomReset" label="&textZoomResetCmd.label;" accesskey="&textZoomResetCmd.accesskey;"
-                              command="cmd_textZoomReset"/>
+                    <menuitem key="key_fullZoomReset" label="&fullZoomResetCmd.label;" accesskey="&fullZoomResetCmd.accesskey;"
+                              command="cmd_fullZoomReset"/>
                   </menupopup>
                 </menu>
                 <menu id="pageStyleMenu" label="&pageStyleMenu.label;" accesskey="&pageStyleMenu.accesskey;" observes="isImage">
                   <menupopup onpopupshowing="stylesheetFillPopup(this);"
                              oncommand="stylesheetSwitchAll(window.content, event.target.getAttribute('data')); setStyleDisabled(false);">
                     <menuitem label="&pageStyleNoStyle.label;" accesskey="&pageStyleNoStyle.accesskey;"
                               oncommand="setStyleDisabled(true); event.stopPropagation();" type="radio"/>
                     <menuitem label="&pageStylePersistentOnly.label;" accesskey="&pageStylePersistentOnly.accesskey;" type="radio" checked="true"/>
--- a/browser/base/content/browser-sets.inc
+++ b/browser/base/content/browser-sets.inc
@@ -96,19 +96,19 @@
              oncommand="gBookmarkAllTabsHandler.doCommand();"
              disabled="true"/>
     <command id="Browser:Home"    oncommand="BrowserHome();"/>
     <command id="Browser:Back"    oncommand="BrowserBack();" disabled="true"/>
     <command id="Browser:Forward" oncommand="BrowserForward();" disabled="true"/>
     <command id="Browser:Stop"    oncommand="BrowserStop();" disabled="true"/>
     <command id="Browser:Reload"  oncommand="if (event.shiftKey) BrowserReloadSkipCache(); else BrowserReload()" disabled="true"/>
     <command id="Browser:ReloadSkipCache"  oncommand="BrowserReloadSkipCache()" disabled="true"/>
-    <command id="cmd_textZoomReduce"  oncommand="TextZoom.reduce()"/>
-    <command id="cmd_textZoomEnlarge" oncommand="TextZoom.enlarge()"/>
-    <command id="cmd_textZoomReset" oncommand="TextZoom.reset()"/>
+    <command id="cmd_fullZoomReduce"  oncommand="FullZoom.reduce()"/>
+    <command id="cmd_fullZoomEnlarge" oncommand="FullZoom.enlarge()"/>
+    <command id="cmd_fullZoomReset"   oncommand="FullZoom.reset()"/>
     <command id="Browser:OpenLocation" oncommand="openLocation();"/>
 
     <command id="Tools:Search" oncommand="BrowserSearch.webSearch();"/>    
     <command id="Tools:Downloads" oncommand="toOpenWindowByType('Download:Manager', 
                                                                 'chrome://mozapps/content/downloads/downloads.xul',
                                                                 'chrome,dialog=no,resizable');"/>
     <command id="Tools:Addons" oncommand="BrowserOpenAddonsMgr();"/>
     <command id="Tools:Sanitize"
@@ -281,20 +281,20 @@
          key="&historySidebarCmd.commandKey;"
 #ifdef XP_MACOSX
          modifiers="accel,shift"
 #else
          modifiers="accel"
 #endif
          command="viewHistorySidebar"/>
 
-    <key id="key_textZoomReduce"  key="&textZoomReduceCmd.commandkey;"   command="cmd_textZoomReduce"  modifiers="accel"/>
-    <key id="key_textZoomEnlarge" key="&textZoomEnlargeCmd.commandkey;"  command="cmd_textZoomEnlarge" modifiers="accel"/>
-    <key                          key="&textZoomEnlargeCmd.commandkey2;" command="cmd_textZoomEnlarge" modifiers="accel"/>
-    <key id="key_textZoomReset"   key="&textZoomResetCmd.commandkey;"    command="cmd_textZoomReset"   modifiers="accel"/>
+    <key id="key_fullZoomReduce"  key="&fullZoomReduceCmd.commandkey;"   command="cmd_fullZoomReduce"  modifiers="accel"/>
+    <key id="key_fullZoomEnlarge" key="&fullZoomEnlargeCmd.commandkey;"  command="cmd_fullZoomEnlarge" modifiers="accel"/>
+    <key                          key="&fullZoomEnlargeCmd.commandkey2;" command="cmd_fullZoomEnlarge" modifiers="accel"/>
+    <key id="key_fullZoomReset"   key="&fullZoomResetCmd.commandkey;"    command="cmd_fullZoomReset"   modifiers="accel"/>
     
     <key id="key_switchTextDirection" key="&bidiSwitchTextDirectionItem.commandkey;" command="cmd_switchTextDirection" modifiers="accel,shift" />
 
     <key id="key_sanitize" command="Tools:Sanitize" keycode="VK_DELETE" modifiers="accel,shift"/>
 #ifdef XP_MACOSX
     <key id="key_sanitize_mac" command="Tools:Sanitize" keycode="VK_BACK" modifiers="accel,shift"/>
     <key id="key_quitApplicationCmdMac" key="&quitApplicationCmdMac.key;" modifiers="accel"/>
 #endif
--- a/browser/base/content/browser-textZoom.js
+++ b/browser/base/content/browser-textZoom.js
@@ -16,16 +16,17 @@
  * The Original Code is Content Preferences (cpref).
  *
  * The Initial Developer of the Original Code is Mozilla.
  * Portions created by the Initial Developer are Copyright (C) 2006
  * the Initial Developer. All Rights Reserved.
  *
  * Contributor(s):
  *   Myk Melez <myk@mozilla.org>
+ *   Dão Gottwald <dao@mozilla.com>
  *
  * Alternatively, the contents of this file may be used under the terms of
  * either the GNU General Public License Version 2 or later (the "GPL"), or
  * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
  * in which case the provisions of the GPL or the LGPL are applicable instead
  * of those above. If you wish to allow use of your version of this file only
  * under the terms of either the GPL or the LGPL, and not to allow others to
  * use your version of this file under the terms of the MPL, indicate your
@@ -36,105 +37,82 @@
  *
  * ***** END LICENSE BLOCK *****
 #endif
  */
 
 // From nsMouseScrollEvent::kIsHorizontal
 const MOUSE_SCROLL_IS_HORIZONTAL = 1 << 2;
 
-// Not sure where this comes from.  It's one of the possible values
-// for the mousewheel.* preferences.
-const MOUSE_SCROLL_TEXTSIZE = 3;
+// One of the possible values for the mousewheel.* preferences.
+// From nsEventStateManager.cpp.
+const MOUSE_SCROLL_FULLZOOM = 3;
 
 /**
- * Controls the "text zoom" setting and its site-specific preferences.
+ * Controls the "full zoom" setting and its site-specific preferences.
  */
-var TextZoom = {
+var FullZoom = {
 
   //**************************************************************************//
   // Name & Values
 
   // The name of the setting.  Identifies the setting in the prefs database.
-  name: "browser.content.text-zoom",
+  name: "browser.content.full-zoom",
 
   // The global value (if any) for the setting.  Retrieved from the prefs
   // database when this handler gets initialized, then updated as it changes.
   // If there is no global value, then this should be undefined.
   globalValue: undefined,
 
-  // From viewZoomOverlay.js
-  minValue: 1,
-  maxValue: 2000,
-  defaultValue: 100,
-
 
   //**************************************************************************//
   // Convenience Getters
 
-  __zoomManager: null,
-  get _zoomManager() {
-    if (!this.__zoomManager)
-      this.__zoomManager = ZoomManager.prototype.getInstance();
-    return this.__zoomManager;
-  },
-
   // Content Pref Service
-  __cps: null,
   get _cps() {
-    if (!this.__cps)
-      this.__cps = Cc["@mozilla.org/content-pref/service;1"].
-                   getService(Ci.nsIContentPrefService);
-    return this.__cps;
-  },
-
-  // Pref Branch
-  __prefBranch: null,
-  get _prefBranch() {
-    if (!this.__prefBranch)
-      this.__prefBranch = Cc["@mozilla.org/preferences-service;1"].
-                           getService(Ci.nsIPrefBranch);
-    return this.__prefBranch;
+    delete this._cps;
+    return this._cps = Cc["@mozilla.org/content-pref/service;1"].
+                       getService(Ci.nsIContentPrefService);
   },
 
 
   //**************************************************************************//
   // nsISupports
 
   // We can't use the Ci shortcut here because it isn't defined yet.
   interfaces: [Components.interfaces.nsIDOMEventListener,
                Components.interfaces.nsIContentPrefObserver,
                Components.interfaces.nsISupports],
 
-  QueryInterface: function TextZoom_QueryInterface(aIID) {
-    if (!this.interfaces.some( function(v) { return aIID.equals(v) } ))
+  QueryInterface: function (aIID) {
+    if (!this.interfaces.some(function (v) aIID.equals(v)))
       throw Cr.NS_ERROR_NO_INTERFACE;
     return this;
   },
 
 
   //**************************************************************************//
   // Initialization & Destruction
 
-  init: function TextZoom_init() {
+  init: function () {
     // Listen for scrollwheel events so we can save scrollwheel-based changes.
     window.addEventListener("DOMMouseScroll", this, false);
 
     // Register ourselves with the service so we know when our pref changes.
     this._cps.addObserver(this.name, this);
 
     // Register ourselves with the sink so we know when the location changes.
     var globalValue = ContentPrefSink.addObserver(this.name, this);
     this.globalValue = this._ensureValid(globalValue);
 
     // Set the initial value of the setting.
     this._applyPrefToSetting();
   },
 
-  destroy: function TextZoom_destroy() {
+  destroy: function () {
     ContentPrefSink.removeObserver(this.name, this);
     this._cps.removeObserver(this.name, this);
     window.removeEventListener("DOMMouseScroll", this, false);
 
     // Delete references to XPCOM components to make sure we don't leak them
     // (although we haven't observed leakage in tests).
     for (var i in this) {
       try { this[i] = null }
@@ -144,22 +122,25 @@ var TextZoom = {
   },
 
 
   //**************************************************************************//
   // Event Handlers
 
   // nsIDOMEventListener
 
-  handleEvent: function TextZoom_handleEvent(event) {
-    // The only events we handle are DOMMouseScroll events.
-    this._handleMouseScrolled(event);
+  handleEvent: function (event) {
+    switch (event.type) {
+      case "DOMMouseScroll":
+        this._handleMouseScrolled(event);
+        break;
+    }
   },
 
-  _handleMouseScrolled: function TextZoom__handleMouseScrolled(event) {
+  _handleMouseScrolled: function (event) {
     // Construct the "mousewheel action" pref key corresponding to this event.
     // Based on nsEventStateManager::GetBasePrefKeyForMouseWheel.
     var pref = "mousewheel";
     if (event.scrollFlags & MOUSE_SCROLL_IS_HORIZONTAL)
       pref += ".horizscroll";
 
     if (event.shiftKey)
       pref += ".withshiftkey";
@@ -169,163 +150,142 @@ var TextZoom = {
       pref += ".withaltkey";
     else if (event.metaKey)
       pref += ".withmetakey";
     else
       pref += ".withnokey";
 
     pref += ".action";
 
-    // Don't do anything if this isn't a "change text size" scroll event.
-    if (this._getAppPref(pref, null) != MOUSE_SCROLL_TEXTSIZE)
+    // Don't do anything if this isn't a "zoom" scroll event.
+    var isZoomEvent = false;
+    try {
+      isZoomEvent = (gPrefService.getIntPref(pref) == MOUSE_SCROLL_FULLZOOM);
+    } catch (e) {}
+    if (!isZoomEvent)
       return;
 
     // XXX Lazily cache all the possible action prefs so we don't have to get
     // them anew from the pref service for every scroll event?  We'd have to
     // make sure to observe them so we can update the cache when they change.
 
     // We have to call _applySettingToPref in a timeout because we handle
     // the event before the event state manager has a chance to apply the zoom
     // during nsEventStateManager::PostHandleEvent.
-    window.setTimeout(function() { TextZoom._applySettingToPref() }, 0);
+    window.setTimeout(function (self) { self._applySettingToPref() }, 0, this);
   },
 
   // nsIContentPrefObserver
 
-  onContentPrefSet: function TextZoom_onContentPrefSet(aGroup, aName, aValue) {
+  onContentPrefSet: function (aGroup, aName, aValue) {
     if (aGroup == this._cps.grouper.group(gBrowser.currentURI))
       this._applyPrefToSetting(aValue);
     else if (aGroup == null) {
       this.globalValue = this._ensureValid(aValue);
 
       // If the current page doesn't have a site-specific preference,
       // then its zoom should be set to the new global preference now that
       // the global preference has changed.
       if (!this._cps.hasPref(gBrowser.currentURI, this.name))
         this._applyPrefToSetting();
     }
   },
 
-  onContentPrefRemoved: function TextZoom_onContentPrefRemoved(aGroup, aName) {
+  onContentPrefRemoved: function (aGroup, aName) {
     if (aGroup == this._cps.grouper.group(gBrowser.currentURI))
       this._applyPrefToSetting();
     else if (aGroup == null) {
       this.globalValue = undefined;
 
       // If the current page doesn't have a site-specific preference,
       // then its zoom should be set to the default preference now that
       // the global preference has changed.
       if (!this._cps.hasPref(gBrowser.currentURI, this.name))
         this._applyPrefToSetting();
     }
   },
 
   // ContentPrefSink observer
 
-  onLocationChanged: function TextZoom_onLocationChanged(aURI, aName, aValue) {
+  onLocationChanged: function (aURI, aName, aValue) {
     this._applyPrefToSetting(aValue);
   },
 
 
   //**************************************************************************//
   // Setting & Pref Manipulation
 
-  reduce: function TextZoom_reduce() {
-    this._zoomManager.reduce();
+  reduce: function () {
+    ZoomManager.reduce();
     this._applySettingToPref();
   },
 
-  enlarge: function TextZoom_enlarge() {
-    this._zoomManager.enlarge();
+  enlarge: function () {
+    ZoomManager.enlarge();
     this._applySettingToPref();
   },
 
-  reset: function TextZoom_reset() {
+  reset: function () {
     if (typeof this.globalValue != "undefined")
-      this._zoomManager.textZoom = this.globalValue;
+      ZoomManager.fullZoom = this.globalValue;
     else
-      this._zoomManager.reset();
+      ZoomManager.reset();
 
     this._removePref();
   },
 
   /**
-   * Set the text zoom for the current tab.
+   * Set the zoom level for the current tab.
    *
-   * Per DocumentViewerImpl::SetTextZoom in nsDocumentViewer.cpp, it looks
+   * Per DocumentViewerImpl::SetFullZoom in nsDocumentViewer.cpp, it looks
    * like we can set the zoom to its current value without significant impact
    * on performance, as the setting is only applied if it differs from the
    * current setting.
    *
    * And perhaps we should always set the zoom even if it were to incur
-   * a performance penalty, since SetTextZoom claims that child documents
+   * a performance penalty, since SetFullZoom claims that child documents
    * may have a different zoom under unusual circumstances, and it implies
    * that those child zooms should get updated when the parent zoom gets set.
    *
    * So when we apply new zoom values to the browser, we simply set the zoom.
    * We don't check first to see if the new value is the same as the current
    * one.
    **/
-  _applyPrefToSetting: function TextZoom__applyPrefToSetting(aValue) {
+  _applyPrefToSetting: function (aValue) {
     // Bug 375918 means this will sometimes throw, so we catch it
     // and don't do anything in those cases.
     try {
       if (typeof aValue != "undefined")
-        this._zoomManager.textZoom = this._ensureValid(aValue);
+        ZoomManager.fullZoom = this._ensureValid(aValue);
       else if (typeof this.globalValue != "undefined")
-        this._zoomManager.textZoom = this.globalValue;
+        ZoomManager.fullZoom = this.globalValue;
       else
-        this._zoomManager.reset();
+        ZoomManager.reset();
     }
     catch(ex) {}
   },
 
-  _applySettingToPref: function TextZoom__applySettingToPref() {
-    var textZoom = this._zoomManager.textZoom;
-    this._cps.setPref(gBrowser.currentURI, this.name, textZoom);
+  _applySettingToPref: function () {
+    var fullZoom = ZoomManager.fullZoom;
+    this._cps.setPref(gBrowser.currentURI, this.name, fullZoom);
   },
 
-  _removePref: function TextZoom__removePref() {
+  _removePref: function () {
     this._cps.removePref(gBrowser.currentURI, this.name);
   },
 
 
   //**************************************************************************//
   // Utilities
 
-  _ensureValid: function TextZoom__ensureValid(aValue) {
+  _ensureValid: function (aValue) {
     if (isNaN(aValue))
-      return this.defaultValue;
+      return 1;
 
-    if (aValue < this.minValue)
-      return this.minValue;
+    if (aValue < ZoomManager.MIN)
+      return ZoomManager.MIN;
 
-    if (aValue > this.maxValue)
-      return this.maxValue;
+    if (aValue > ZoomManager.MAX)
+      return ZoomManager.MAX;
 
     return aValue;
-  },
-
-  /**
-   * Get a value from a pref or a default value if the pref doesn't exist.
-   *
-   * @param   aPrefName
-   * @param   aDefaultValue
-   * @returns the pref's value or the default (if it is missing)
-   */
-  _getAppPref: function TextZoom__getAppPref(aPrefName, aDefaultValue) {
-    try {
-      switch (this._prefBranch.getPrefType(aPrefName)) {
-        case this._prefBranch.PREF_STRING:
-          return this._prefBranch.getCharPref(aPrefName);
-
-        case this._prefBranch.PREF_BOOL:
-          return this._prefBranch.getBoolPref(aPrefName);
-
-        case this._prefBranch.PREF_INT:
-          return this._prefBranch.getIntPref(aPrefName);
-      }
-    }
-    catch (ex) { /* return the default value */ }
-    
-    return aDefaultValue;
   }
 };
--- a/browser/base/content/browser.js
+++ b/browser/base/content/browser.js
@@ -1161,17 +1161,17 @@ function delayedStartup()
     Components.utils.reportError("Failed to init microsummary service:\n" + ex);
   }
 
   // Initialize the content pref event sink and the text zoom setting.
   // We do this before the session restore service gets initialized so we can
   // apply text zoom settings to tabs restored by the session restore service.
   try {
     ContentPrefSink.init();
-    TextZoom.init();
+    FullZoom.init();
   }
   catch(ex) {
     Components.utils.reportError("Failed to init content pref service:\n" + ex);
   }
 
 #ifdef XP_WIN
   // For Vista, flip the default download folder pref once from Desktop to Downloads
   // on new profiles.
@@ -1204,17 +1204,17 @@ function delayedStartup()
 
   // bookmark-all-tabs command
   gBookmarkAllTabsHandler = new BookmarkAllTabsHandler();
 }
 
 function BrowserShutdown()
 {
   try {
-    TextZoom.destroy();
+    FullZoom.destroy();
     ContentPrefSink.destroy();
   }
   catch(ex) {
     Components.utils.reportError(ex);
   }
 
   var os = Components.classes["@mozilla.org/observer-service;1"]
     .getService(Components.interfaces.nsIObserverService);
@@ -1281,17 +1281,17 @@ function BrowserShutdown()
 // nonBrowserWindowShutdown() are used for non-browser windows in
 // macBrowserOverlay
 function nonBrowserWindowStartup()
 {
   // Disable inappropriate commands / submenus
   var disabledItems = ['cmd_newNavigatorTab', 'Browser:SavePage', 'Browser:SendLink',
                        'cmd_pageSetup', 'cmd_print', 'cmd_find', 'cmd_findAgain', 'viewToolbarsMenu',
                        'cmd_toggleTaskbar', 'viewSidebarMenuMenu', 'Browser:Reload', 'Browser:ReloadSkipCache',
-                       'viewTextZoomMenu', 'pageStyleMenu', 'charsetMenu', 'View:PageSource', 'View:FullScreen',
+                       'viewFullZoomMenu', 'pageStyleMenu', 'charsetMenu', 'View:PageSource', 'View:FullScreen',
                        'viewHistorySidebar', 'Browser:AddBookmarkAs', 'View:PageInfo', 'Tasks:InspectPage'];
   var element;
 
   for (var id in disabledItems)
   {
     element = document.getElementById(disabledItems[id]);
     if (element)
       element.setAttribute("disabled", "true");
--- a/browser/locales/en-US/chrome/browser/browser.dtd
+++ b/browser/locales/en-US/chrome/browser/browser.dtd
@@ -268,29 +268,29 @@
 <!ENTITY blockImageCmd.accesskey       "g">
 <!ENTITY metadataCmd.label            "Properties">
 <!ENTITY metadataCmd.accesskey        "P">
 <!ENTITY copyEmailCmd.label           "Copy Email Address">
 <!ENTITY copyEmailCmd.accesskey       "E">
 <!ENTITY thisFrameMenu.label              "This Frame">
 <!ENTITY thisFrameMenu.accesskey          "h">
 
-<!ENTITY textZoomEnlargeCmd.label       "Increase">
-<!ENTITY textZoomEnlargeCmd.accesskey   "I">
-<!ENTITY textZoomEnlargeCmd.commandkey  "+">
-<!ENTITY textZoomEnlargeCmd.commandkey2 "="> <!-- + is above this key on many keyboards -->
+<!ENTITY fullZoomEnlargeCmd.label       "Zoom In">
+<!ENTITY fullZoomEnlargeCmd.accesskey   "I">
+<!ENTITY fullZoomEnlargeCmd.commandkey  "+">
+<!ENTITY fullZoomEnlargeCmd.commandkey2 "="> <!-- + is above this key on many keyboards -->
 
-<!ENTITY textZoomReduceCmd.label        "Decrease">
-<!ENTITY textZoomReduceCmd.accesskey    "D">
-<!ENTITY textZoomReduceCmd.commandkey   "-">
-<!ENTITY textZoomResetCmd.commandkey    "0">
-<!ENTITY textZoomResetCmd.label         "Normal">
-<!ENTITY textZoomResetCmd.accesskey     "N">
-<!ENTITY textSize.label                 "Text Size">
-<!ENTITY textSize.accesskey             "z">
+<!ENTITY fullZoomReduceCmd.label        "Zoom Out">
+<!ENTITY fullZoomReduceCmd.accesskey    "O">
+<!ENTITY fullZoomReduceCmd.commandkey   "-">
+<!ENTITY fullZoomResetCmd.commandkey    "0">
+<!ENTITY fullZoomResetCmd.label         "Reset">
+<!ENTITY fullZoomResetCmd.accesskey     "R">
+<!ENTITY fullZoom.label                 "Zoom">
+<!ENTITY fullZoom.accesskey             "Z">
 
 <!ENTITY newTabButton.tooltip           "Open a new tab">
 <!ENTITY newWindowButton.tooltip        "Open a new window">
 <!ENTITY sidebarCloseButton.tooltip     "Close sidebar">
 
 <!ENTITY cutButton.tooltip              "Cut">
 <!ENTITY copyButton.tooltip             "Copy">
 <!ENTITY pasteButton.tooltip            "Paste">
--- a/content/events/src/nsEventStateManager.cpp
+++ b/content/events/src/nsEventStateManager.cpp
@@ -210,17 +210,17 @@ nsUITimerCallback::Notify(nsITimer* aTim
   mPreviousCount = gMouseOrKeyboardEventCounter;
   return NS_OK;
 }
 
 enum {
  MOUSE_SCROLL_N_LINES,
  MOUSE_SCROLL_PAGE,
  MOUSE_SCROLL_HISTORY,
- MOUSE_SCROLL_TEXTSIZE,
+ MOUSE_SCROLL_FULLZOOM,
  MOUSE_SCROLL_PIXELS
 };
 
 struct AccessKeyInfo {
   PRUint32 mAccessKey;
   nsIContent* mTarget;
 
   AccessKeyInfo(nsIContent* aTarget) : mAccessKey(0), mTarget(aTarget) {}
@@ -1933,17 +1933,17 @@ nsEventStateManager::GenerateDragGesture
 
     // Now flush all pending notifications, for better responsiveness
     // while dragging.
     FlushPendingEvents(aPresContext);
   }
 } // GenerateDragGesture
 
 nsresult
-nsEventStateManager::ChangeTextSize(PRInt32 change)
+nsEventStateManager::ChangeFullZoom(PRInt32 change)
 {
   if(!gLastFocusedDocument) return NS_ERROR_FAILURE;
 
   nsPIDOMWindow* ourWindow = gLastFocusedDocument->GetWindow();
   if(!ourWindow) return NS_ERROR_FAILURE;
 
   nsIDOMWindowInternal *rootWindow = ourWindow->GetPrivateRoot();
   if(!rootWindow) return NS_ERROR_FAILURE;
@@ -1968,21 +1968,26 @@ nsEventStateManager::ChangeTextSize(PRIn
 
   nsCOMPtr<nsIContentViewer> cv;
   docshell->GetContentViewer(getter_AddRefs(cv));
   if(!cv) return NS_ERROR_FAILURE;
 
   nsCOMPtr<nsIMarkupDocumentViewer> mv(do_QueryInterface(cv));
   if(!mv) return NS_ERROR_FAILURE;
 
-  float textzoom;
-  mv->GetTextZoom(&textzoom);
-  textzoom += ((float)change) / 10;
-  if (textzoom > 0 && textzoom <= 20)
-    mv->SetTextZoom(textzoom);
+  float fullzoom;
+  float zoomMin = ((float)nsContentUtils::GetIntPref("fullZoom.minPercent", 50)) / 100;
+  float zoomMax = ((float)nsContentUtils::GetIntPref("fullZoom.maxPercent", 300)) / 100;
+  mv->GetFullZoom(&fullzoom);
+  fullzoom += ((float)change) / 10;
+  if (fullzoom < zoomMin)
+    fullzoom = zoomMin;
+  else if (fullzoom > zoomMax)
+    fullzoom = zoomMax;
+  mv->SetFullZoom(fullzoom);
 
   return NS_OK;
 }
 
 void
 nsEventStateManager::DoScrollHistory(PRInt32 direction)
 {
   nsCOMPtr<nsISupports> pcContainer(mPresContext->GetContainer());
@@ -1994,27 +1999,27 @@ nsEventStateManager::DoScrollHistory(PRI
         webNav->GoBack();
       else
         webNav->GoForward();
     }
   }
 }
 
 void
-nsEventStateManager::DoScrollTextsize(nsIFrame *aTargetFrame,
+nsEventStateManager::DoScrollFullZoom(nsIFrame *aTargetFrame,
                                       PRInt32 adjustment)
 {
   // Exclude form controls and XUL content.
   nsIContent *content = aTargetFrame->GetContent();
   if (content &&
       !content->IsNodeOfType(nsINode::eHTML_FORM_CONTROL) &&
       !content->IsNodeOfType(nsINode::eXUL))
     {
       // negative adjustment to increase text size, positive to decrease
-      ChangeTextSize((adjustment > 0) ? -1 : 1);
+      ChangeFullZoom((adjustment > 0) ? -1 : 1);
     }
 }
 
 static nsIFrame*
 GetParentFrameToScroll(nsPresContext* aPresContext, nsIFrame* aFrame)
 {
   if (!aPresContext || !aFrame)
     return nsnull;
@@ -2385,19 +2390,19 @@ nsEventStateManager::PostHandleEvent(nsP
         break;
 
       case MOUSE_SCROLL_HISTORY:
         {
           DoScrollHistory(msEvent->delta);
         }
         break;
 
-      case MOUSE_SCROLL_TEXTSIZE:
+      case MOUSE_SCROLL_FULLZOOM:
         {
-          DoScrollTextsize(aTargetFrame, msEvent->delta);
+          DoScrollFullZoom(aTargetFrame, msEvent->delta);
         }
         break;
 
       default:  // Including -1 (do nothing)
         break;
       }
       *aStatus = nsEventStatus_eConsumeNoDefault;
 
--- a/content/events/src/nsEventStateManager.h
+++ b/content/events/src/nsEventStateManager.h
@@ -298,18 +298,18 @@ protected:
   nsresult DoScrollText(nsPresContext* aPresContext,
                         nsIFrame* aTargetFrame,
                         nsInputEvent* aEvent,
                         PRInt32 aNumLines,
                         PRBool aScrollHorizontal,
                         ScrollQuantity aScrollQuantity);
   void ForceViewUpdate(nsIView* aView);
   void DoScrollHistory(PRInt32 direction);
-  void DoScrollTextsize(nsIFrame *aTargetFrame, PRInt32 adjustment);
-  nsresult ChangeTextSize(PRInt32 change);
+  void DoScrollFullZoom(nsIFrame *aTargetFrame, PRInt32 adjustment);
+  nsresult ChangeFullZoom(PRInt32 change);
   // end mousewheel functions
 
   // routines for the d&d gesture tracking state machine
   void BeginTrackingDragGesture ( nsPresContext* aPresContext, nsMouseEvent* inDownEvent,
                                   nsIFrame* inDownFrame ) ;
   void StopTrackingDragGesture ( ) ;
   void GenerateDragGesture ( nsPresContext* aPresContext, nsMouseEvent *aEvent ) ;
   PRBool IsTrackingDragGesture ( ) const { return mGestureDownContent != nsnull; }
--- a/modules/libpref/src/init/all.js
+++ b/modules/libpref/src/init/all.js
@@ -2467,8 +2467,13 @@ pref("print.print_command", "lp -c -s ${
 
 // Login Manager prefs
 pref("signon.rememberSignons",              true);
 pref("signon.expireMasterPassword",         false);
 pref("signon.SignonFileName",               "signons.txt"); // obsolete 
 pref("signon.SignonFileName2",              "signons2.txt");
 pref("signon.autofillForms",                true); 
 pref("signon.debug",                        false); // logs to Error Console
+
+// Zoom prefs
+pref("fullZoom.minPercent", 50);
+pref("fullZoom.maxPercent", 300);
+pref("toolkit.zoomManager.fullZoomValues", ".5,.75,1,1.25,1.5,2,3");
--- a/toolkit/components/help/content/help.xul
+++ b/toolkit/components/help/content/help.xul
@@ -89,18 +89,19 @@
   <commandset id="globalEditMenuItems"/>
   <commandset id="selectEditMenuItems">
     <command id="cmd_close" oncommand="close();"/>
     <command id="Help:Home" oncommand="goHome();"/>
     <command id="Help:Back" oncommand="goBack();"       observes="canGoBack"/>
     <command id="Help:Forward" oncommand="goForward();" observes="canGoForward"/>
     <command id="Help:ToggleSidebar" oncommand="toggleSidebar();"/>
     <command id="cmd_closeWindow" oncommand="close();"/>
-    <command id="cmd_textZoomReduce" oncommand="ZoomManager.prototype.getInstance().reduce();"/>
-    <command id="cmd_textZoomEnlarge" oncommand="ZoomManager.prototype.getInstance().enlarge();"/>
+    <command id="cmd_fullZoomReduce" oncommand="ZoomManager.reduce();"/>
+    <command id="cmd_fullZoomEnlarge" oncommand="ZoomManager.enlarge();"/>
+    <command id="cmd_fullZoomReset" oncommand="ZoomManager.reset();"/>
     <command id="cmd_find"
              oncommand="document.getElementById('FindToolbar').onFindCommand();"/>
     <command id="cmd_findAgain"
              oncommand="document.getElementById('FindToolbar').onFindAgainCommand(false);"/>
     <command id="cmd_findPrevious"
              oncommand="document.getElementById('FindToolbar').onFindAgainCommand(true);"/>
     <command id="cmd_copy" oncommand="goDoCommand('cmd_copy')" disabled="true"/>
     <command id="cmd_selectAll" oncommand="goDoCommand('cmd_selectAll')"/>
@@ -126,24 +127,24 @@
     <key id="key_findAgain" key="&findAgainCmd.commandkey;" command="cmd_findAgain" modifiers="accel"/>
     <key id="key_findPrevious" key="&findAgainCmd.commandkey;" command="cmd_findPrevious" modifiers="accel,shift"/>
     <key keycode="&findAgainCmd.commandkey2;" command="cmd_findAgain"/>
     <key keycode="&findAgainCmd.commandkey2;"  command="cmd_findPrevious" modifiers="shift"/>
     <key id="key_closeWindow" key="&closeWindow.commandkey;"
          command="cmd_closeWindow" modifiers="accel"/>
     <key id="key_closeSearchSidebar" keycode="VK_ESCAPE"
          oncommand="hideSearchSidebar(event)"/>
-    <key id="key_textZoomEnlarge" key="&textZoomEnlargeCmd.commandkey;"
-         command="cmd_textZoomEnlarge" modifiers="accel"/>
-    <key id="key_textZoomEnlarge2" key="&textZoomEnlargeCmd.commandkey2;"
-         command="cmd_textZoomEnlarge" modifiers="accel"/>
-    <key id="key_textZoomReduce" key="&textZoomReduceCmd.commandkey;"
-         command="cmd_textZoomReduce" modifiers="accel"/>
-    <key id="key_textZoomReset" key="&textZoomResetCmd.commandkey;"
-         oncommand="ZoomManager.prototype.getInstance().reset();" modifiers="accel"/>
+    <key id="key_fullZoomEnlarge" key="&fullZoomEnlargeCmd.commandkey;"
+         command="cmd_fullZoomEnlarge" modifiers="accel"/>
+    <key id="key_fullZoomEnlarge2" key="&fullZoomEnlargeCmd.commandkey2;"
+         command="cmd_fullZoomEnlarge" modifiers="accel"/>
+    <key id="key_fullZoomReduce" key="&fullZoomReduceCmd.commandkey;"
+         command="cmd_fullZoomReduce" modifiers="accel"/>
+    <key id="key_fullZoomReset" key="&fullZoomResetCmd.commandkey;"
+         command="cmd_fullZoomReset" modifiers="accel"/>
     <key id="key_focusSearch" key="&helpSearch.commandkey;"
          oncommand="focusSearch()" modifiers="accel"/>
 
   </keyset>
   <stringbundle id="bundle_viewZoom"/>
   <stringbundle id="findBundle"
                 src="chrome://global/locale/finddialog.properties"/>
   <stringbundle id="bundle_help"
--- a/toolkit/components/help/content/helpContextOverlay.xul
+++ b/toolkit/components/help/content/helpContextOverlay.xul
@@ -63,23 +63,23 @@
                 command="cmd_copy"
                 disabled="true"/>
       <menuitem id="context-selectall"
                 label="&selectAllCmd.label;"
                 accesskey="&selectAllCmd.accesskey;"
                 command="cmd_selectAll"/>
       <menuseparator/>
       <menuitem id="zoom-in"
-      		label="&textZoomEnlargeBtn.label;"
-      		accesskey="&textZoomEnlargeBtn.accesskey;"
-      		oncommand="ZoomManager.prototype.getInstance().enlarge();"/>
+      	        label="&fullZoomEnlargeBtn.label;"
+      	        accesskey="&fullZoomEnlargeBtn.accesskey;"
+      	        oncommand="ZoomManager.enlarge();"/>
       <menuitem id="zoom-out"
-      		label="&textZoomReduceBtn.label;"
-      		accesskey="&textZoomReduceBtn.accesskey;"
-      		oncommand="ZoomManager.prototype.getInstance().reduce();"/>
+      		label="&fullZoomReduceBtn.label;"
+      		accesskey="&fullZoomReduceBtn.accesskey;"
+      		oncommand="ZoomManager.reduce();"/>
 #ifdef XP_MACOSX
 #define HELP_ALWAYS_RAISED_TOGGLE
 #endif
 #ifdef XP_WIN
 #define HELP_ALWAYS_RAISED_TOGGLE
 #endif
 #ifdef HELP_ALWAYS_RAISED_TOGGLE
       <menuseparator/>
--- a/toolkit/components/viewsource/content/viewPartialSource.xul
+++ b/toolkit/components/viewsource/content/viewPartialSource.xul
@@ -86,19 +86,19 @@
            oncommand="document.getElementById('FindToolbar').onFindCommand();"/>
   <command id="cmd_findAgain"
            oncommand="document.getElementById('FindToolbar').onFindAgainCommand(false);"/>
   <command id="cmd_findPrevious"
            oncommand="document.getElementById('FindToolbar').onFindAgainCommand(true);"/>
   <command id="cmd_goToLine" oncommand="ViewSourceGoToLine();" disabled="true"/>
   <command id="cmd_highlightSyntax" oncommand="highlightSyntax();"/>
   <command id="cmd_wrapLongLines" oncommand="wrapLongLines()"/>
-  <command id="cmd_textZoomReduce" oncommand="ZoomManager.prototype.getInstance().reduce();"/>
-  <command id="cmd_textZoomEnlarge" oncommand="ZoomManager.prototype.getInstance().enlarge();"/>
-  <command id="cmd_textZoomReset" oncommand="ZoomManager.prototype.getInstance().reset();"/>    
+  <command id="cmd_textZoomReduce" oncommand="ZoomManager.reduce();"/>
+  <command id="cmd_textZoomEnlarge" oncommand="ZoomManager.enlarge();"/>
+  <command id="cmd_textZoomReset" oncommand="ZoomManager.reset();"/>
 
   <keyset id="editMenuKeys"/>
   <keyset id="viewSourceKeys">
     <key id="key_savePage" key="&savePageCmd.commandkey;" modifiers="accel" command="cmd_savePage"/>
     <key id="key_print" key="&printCmd.commandkey;" modifiers="accel" command="cmd_print"/>
     <key id="key_close" key="&closeCmd.commandkey;" modifiers="accel" command="cmd_close"/>
     <key keycode="VK_ESCAPE" command="cmd_close"/>
 
--- a/toolkit/components/viewsource/content/viewSource.xul
+++ b/toolkit/components/viewsource/content/viewSource.xul
@@ -87,19 +87,19 @@
   <command id="cmd_findAgain"
            oncommand="document.getElementById('FindToolbar').onFindAgainCommand(false);"/>
   <command id="cmd_findPrevious"
            oncommand="document.getElementById('FindToolbar').onFindAgainCommand(true);"/>
   <command id="cmd_reload" oncommand="ViewSourceReload();"/>
   <command id="cmd_goToLine" oncommand="ViewSourceGoToLine();" disabled="true"/>
   <command id="cmd_highlightSyntax" oncommand="highlightSyntax();"/>
   <command id="cmd_wrapLongLines" oncommand="wrapLongLines()"/>
-  <command id="cmd_textZoomReduce" oncommand="ZoomManager.prototype.getInstance().reduce();"/>
-  <command id="cmd_textZoomEnlarge" oncommand="ZoomManager.prototype.getInstance().enlarge();"/>
-  <command id="cmd_textZoomReset" oncommand="ZoomManager.prototype.getInstance().reset();"/>
+  <command id="cmd_textZoomReduce" oncommand="ZoomManager.reduce();"/>
+  <command id="cmd_textZoomEnlarge" oncommand="ZoomManager.enlarge();"/>
+  <command id="cmd_textZoomReset" oncommand="ZoomManager.reset();"/>
 
   <keyset id="editMenuKeys"/>
   <keyset id="viewSourceKeys">
     <key id="key_savePage" key="&savePageCmd.commandkey;" modifiers="accel" command="cmd_savePage"/>
     <key id="key_print" key="&printCmd.commandkey;" modifiers="accel" command="cmd_print"/>
     <key id="key_close" key="&closeCmd.commandkey;" modifiers="accel" command="cmd_close"/>
     <key id="key_goToLine"     key="&goToLineCmd.commandkey;"  command="cmd_goToLine"  modifiers="accel"/>
 
--- a/toolkit/content/viewZoomOverlay.js
+++ b/toolkit/content/viewZoomOverlay.js
@@ -19,16 +19,17 @@
 # Peter Annema.
 # Portions created by the Initial Developer are Copyright (C) 2000
 # the Initial Developer. All Rights Reserved.
 #
 # Contributor(s):
 #   Peter Annema <disttsc@bart.nl> (Original Author)
 #   Jonas Sicking <sicking@bigfoot.com>
 #   Jason Barnabe <jason_barnabe@fastmail.fm>
+#   Dão Gottwald <dao@mozilla.com>
 #
 # Alternatively, the contents of this file may be used under the terms of
 # either the GNU General Public License Version 2 or later (the "GPL"), or
 # the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
 # in which case the provisions of the GPL or the LGPL are applicable instead
 # of those above. If you wish to allow use of your version of this file only
 # under the terms of either the GPL or the LGPL, and not to allow others to
 # use your version of this file under the terms of the MPL, indicate your
@@ -37,157 +38,80 @@
 # the provisions above, a recipient may use your version of this file under
 # the terms of any one of the MPL, the GPL or the LGPL.
 #
 # ***** END LICENSE BLOCK *****
 
 /** Document Zoom Management Code
  *
  * To use this, you'll need to have a getBrowser() function.
- *
  **/
 
-
-function ZoomManager() {
-}
+var ZoomManager = {
+  get _prefBranch() {
+    return Components.classes["@mozilla.org/preferences-service;1"]
+                     .getService(Components.interfaces.nsIPrefBranch);
+  },
 
-ZoomManager.prototype = {
-  instance : null,
-
-  getInstance : function() {
-    if (!ZoomManager.prototype.instance)
-      ZoomManager.prototype.instance = new ZoomManager();
-
-    return ZoomManager.prototype.instance;
+  get MIN() {
+    delete this.MIN;
+    return this.MIN = this._prefBranch.getIntPref("fullZoom.minPercent") / 100;
   },
 
-  MIN : 1,
-  MAX : 2000,
-  factorOther : 300,
-  factorAnchor : 300,
-    zoomFactors: [50, 75, 90, 100, 120, 150, 200],
-  steps : 0,
-
-  get textZoom() {
-    var currentZoom;
-    try {
-      currentZoom = Math.round(this.markupDocumentViewer.textZoom * 100);
-      if (this.indexOf(currentZoom) == -1) {
-        if (currentZoom != this.factorOther) {
-          this.factorOther = currentZoom;
-          this.factorAnchor = this.factorOther;
-        }
-      }
-    } catch (e) {
-      currentZoom = 100;
-    }
-    return currentZoom;
+  get MAX() {
+    delete this.MAX;
+    return this.MAX = this._prefBranch.getIntPref("fullZoom.maxPercent") / 100;
   },
 
-  set textZoom(aZoom) {
-    if (aZoom < this.MIN || aZoom > this.MAX)
+  get fullZoom() {
+    return getBrowser().markupDocumentViewer.fullZoom;
+  },
+
+  set fullZoom(aVal) {
+    if (aVal < this.MIN || aVal > this.MAX)
       throw Components.results.NS_ERROR_INVALID_ARG;
 
-    this.markupDocumentViewer.textZoom = aZoom / 100;
-  },
-
-  enlarge : function() {
-    this.jump(1);
-  },
-
-  reduce : function() {
-    this.jump(-1);
-  },
-  reset : function() {
-    this.textZoom = 100;
-  },
-  indexOf : function(aZoom) {
-    var index = -1;
-    if (this.isZoomInRange(aZoom)) {
-      index = this.zoomFactors.length - 1;
-      while (index >= 0 && this.zoomFactors[index] != aZoom)
-        --index;
-    }
-
-    return index;
-  },
-
-  /***** internal helper functions below here *****/
-
-  isZoomInRange : function(aZoom) {
-    return (aZoom >= this.zoomFactors[0] && aZoom <= this.zoomFactors[this.zoomFactors.length - 1]);
+    return (getBrowser().markupDocumentViewer.fullZoom = aVal);
   },
 
-  jump : function(aDirection) {
-    if (aDirection != -1 && aDirection != 1)
-      throw Components.results.NS_ERROR_INVALID_ARG;
+  get fullZoomValues() {
+    var fullZoomValues = this._prefBranch.getCharPref("toolkit.zoomManager.fullZoomValues")
+                                         .split(",").map(parseFloat);
+    fullZoomValues.sort();
 
-    var currentZoom = this.textZoom;
-    var insertIndex = -1;
-    const stepFactor = 1.5;
+    while (fullZoomValues[0] < this.MIN)
+      fullZoomValues.shift();
 
-    // temporarily add factorOther to list
-    if (this.isZoomInRange(this.factorOther)) {
-      insertIndex = 0;
-      while (this.zoomFactors[insertIndex] < this.factorOther)
-        ++insertIndex;
+    while (fullZoomValues[fullZoomValues.length - 1] > this.MAX)
+      fullZoomValues.pop();
+
+    delete this.fullZoomValues;
+    return this.fullZoomValues = fullZoomValues;
+  },
 
-      if (this.zoomFactors[insertIndex] != this.factorOther)
-        this.zoomFactors.splice(insertIndex, 0, this.factorOther);
-    }
+  enlarge: function () {
+    var i = this.fullZoomValues.indexOf(this.snap(this.fullZoom)) + 1;
+    if (i < this.fullZoomValues.length)
+      this.fullZoom = this.fullZoomValues[i];
+  },
 
-    var factor;
-    var done = false;
+  reduce: function () {
+    var i = this.fullZoomValues.indexOf(this.snap(this.fullZoom)) - 1;
+    if (i >= 0)
+      this.fullZoom = this.fullZoomValues[i];
+  },
 
-    if (this.isZoomInRange(currentZoom)) {
-      var index = this.indexOf(currentZoom);
-      if (aDirection == -1 && index == 0 ||
-          aDirection ==  1 && index == this.zoomFactors.length - 1) {
-        this.steps = 0;
-        this.factorAnchor = this.zoomFactors[index];
-      } else {
-        factor = this.zoomFactors[index + aDirection];
-        done = true;
+  reset: function () {
+    this.fullZoom = 1;
+  },
+
+  snap: function (aVal) {
+    var values = this.fullZoomValues;
+    for (var i = 0; i < values.length; i++) {
+      if (values[i] >= aVal) {
+        if (i > 0 && aVal - values[i - 1] < values[i] - aVal)
+          i--;
+        return values[i];
       }
     }
-
-    if (!done) {
-      this.steps += aDirection;
-      factor = this.factorAnchor * Math.pow(stepFactor, this.steps);
-      if (factor < this.MIN || factor > this.MAX) {
-        this.steps -= aDirection;
-        factor = this.factorAnchor * Math.pow(stepFactor, this.steps);
-      }
-      factor = Math.round(factor);
-      if (this.isZoomInRange(factor))
-        factor = this.snap(factor);
-      else
-        this.factorOther = factor;
-    }
-
-    if (insertIndex != -1)
-      this.zoomFactors.splice(insertIndex, 1);
-
-    this.textZoom = factor;
-  },
-
-  snap : function(aZoom) {
-    if (this.isZoomInRange(aZoom)) {
-      var level = 0;
-      while (this.zoomFactors[level + 1] < aZoom)
-        ++level;
-
-      // if aZoom closer to [level + 1] than [level], snap to [level + 1]
-      if ((this.zoomFactors[level + 1] - aZoom) < (aZoom - this.zoomFactors[level]))
-        ++level;
-
-      aZoom = this.zoomFactors[level];
-    }
-
-    return aZoom;
-  },
-
-  get markupDocumentViewer() {
-    return getBrowser().markupDocumentViewer;
+    return values[i - 1];
   }
 }
-
-
--- a/toolkit/locales/en-US/chrome/mozapps/help/help.dtd
+++ b/toolkit/locales/en-US/chrome/mozapps/help/help.dtd
@@ -23,22 +23,22 @@
 <!ENTITY closeWindow.commandkey         "W">
 
 <!ENTITY searchtab.label                "Search">
 <!ENTITY searchtab.accesskey            "S">
 <!ENTITY searchClose.tooltip            "Close search results">
 <!ENTITY toctab.label                   "Contents">
 <!ENTITY toctab.accesskey               "C">
 
-<!ENTITY textZoomReduceCmd.commandkey   "-">
-<!ENTITY textZoomEnlargeCmd.commandkey  "+">
-<!ENTITY textZoomEnlargeCmd.commandkey2 "="> <!-- + is above this key on many keyboards -->
-<!ENTITY textZoomResetCmd.commandkey    "0">
+<!ENTITY fullZoomReduceCmd.commandkey   "-">
+<!ENTITY fullZoomEnlargeCmd.commandkey  "+">
+<!ENTITY fullZoomEnlargeCmd.commandkey2 "="> <!-- + is above this key on many keyboards -->
+<!ENTITY fullZoomResetCmd.commandkey    "0">
 
 <!ENTITY helpSearch.commandkey          "k">
 
 <!ENTITY zLevel.label                   "Always on Top">
 <!ENTITY zLevel.accesskey               "T">
 
-<!ENTITY textZoomReduceBtn.label        "Decrease Text Size">
-<!ENTITY textZoomReduceBtn.accesskey    "D">
-<!ENTITY textZoomEnlargeBtn.label       "Increase Text Size">
-<!ENTITY textZoomEnlargeBtn.accesskey   "I">
+<!ENTITY fullZoomReduceBtn.label        "Zoom In">
+<!ENTITY fullZoomReduceBtn.accesskey    "I">
+<!ENTITY fullZoomEnlargeBtn.label       "Zoom Out">
+<!ENTITY fullZoomEnlargeBtn.accesskey   "O">