Bug 987443: [Australis] fix zoom button label rounding. r=Gijs a=sylvestre
authorMike de Boer <mdeboer@mozilla.com>
Tue, 25 Mar 2014 12:12:17 +0100
changeset 192356 ce9cfb44f9c295e8d9d540d81cdffc6b8b933d5c
parent 192355 4a0223fb8ac0fe0008d7b6c99a6c7d8fb1a75c4a
child 192357 83f1fa9a7ca903cadc97c6ecec8ccda6142f3c99
push id474
push userasasaki@mozilla.com
push dateMon, 02 Jun 2014 21:01:02 +0000
treeherdermozilla-release@967f4cf1b31c [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersGijs, sylvestre
bugs987443
milestone30.0a2
Bug 987443: [Australis] fix zoom button label rounding. r=Gijs a=sylvestre
browser/components/customizableui/src/CustomizableWidgets.jsm
--- a/browser/components/customizableui/src/CustomizableWidgets.jsm
+++ b/browser/components/customizableui/src/CustomizableWidgets.jsm
@@ -498,17 +498,17 @@ const CustomizableWidgets = [{
         // Label should always show 100% in customize mode, so don't update:
         if (aDocument.documentElement.hasAttribute("customizing")) {
           updateDisplay = false;
         }
         //XXXgijs in some tests we get called very early, and there's no docShell on the
         // tabbrowser. This breaks the zoom toolkit code (see bug 897410). Don't let that happen:
         let zoomFactor = 100;
         try {
-          zoomFactor = Math.floor(window.ZoomManager.zoom * 100);
+          zoomFactor = Math.round(window.ZoomManager.zoom * 100);
         } catch (e) {}
         zoomResetButton.setAttribute("label", CustomizableUI.getLocalizedProperty(
           buttons[1], "label", [updateDisplay ? zoomFactor : 100]
         ));
       };
 
       // Register ourselves with the service so we know when the zoom prefs change.
       Services.obs.addObserver(updateZoomResetButton, "browser-fullZoom:zoomChange", false);