Bug 628799 (followup) - Fix the ZoomChanged event used by Tzoom tests [r=stechz]
authorMatt Brubeck <mbrubeck@mozilla.com>
Wed, 02 Feb 2011 16:25:42 -0800
changeset 2735 1165fcc93242
parent 2734 ecb835121837
child 2736 43e6a7f68527
push id2297
push usermbrubeck@mozilla.com
push dateThu, 03 Feb 2011 00:27:21 +0000
reviewersstechz
bugs628799
Bug 628799 (followup) - Fix the ZoomChanged event used by Tzoom tests [r=stechz]
chrome/content/bindings/browser.xml
--- a/chrome/content/bindings/browser.xml
+++ b/chrome/content/bindings/browser.xml
@@ -1022,35 +1022,36 @@
           rootView._contentView.scrollTo(x, y);
         ]]></body>
       </method>
 
       <!-- After fuzzy zoom, sync the displayport with the new viewport. -->
       <method name="finishFuzzyZoom">
         <body><![CDATA[
           this.getRootView()._updateCacheViewport();
+
+          let event = document.createEvent("Events");
+          event.initEvent("ZoomChanged", true, false);
+          this.dispatchEvent(event);
         ]]></body>
       </method>
 
       <!-- The ratio of CSS pixels to device pixels. -->
       <property name="scale">
         <getter><![CDATA[
           return this.getRootView()._scale;
         ]]></getter>
         <setter><![CDATA[
           if (val <= 0 || val == this.scale)
             return;
 
           let rootView = this.getRootView();
           rootView._setScale(val);
-          rootView._updateCacheViewport();
+          this.finishFuzzyZoom();
 
-          let event = document.createEvent("Events");
-          event.initEvent("ZoomChanged", true, false);
-          this.dispatchEvent(event);
           return val;
         ]]></setter>
       </property>
 
       <method name="_getView">
         <parameter name="contentView"/>
         <body>
           <![CDATA[