Bug 596326 - [mobile2] Dispatch ZoomChanged event from browser binding [r=mfinkle]
authorMatt Brubeck <mbrubeck@mozilla.com>
Tue, 14 Sep 2010 13:51:22 -0700
changeset 2005 683880353ae07361be1ed15ae8ef855fa5ac6969
parent 2004 512289018ae41c7350c425aaf7adb44a9bc75189
child 2006 064626fa17454ec335e6b4cc6aee1e10536a48bc
push id1714
push userdougt@mozilla.com
push dateThu, 16 Sep 2010 02:04:21 +0000
reviewersmfinkle
bugs596326
Bug 596326 - [mobile2] Dispatch ZoomChanged event from browser binding [r=mfinkle]
chrome/content/bindings/browser.xml
--- a/chrome/content/bindings/browser.xml
+++ b/chrome/content/bindings/browser.xml
@@ -462,16 +462,20 @@
         <parameter name="zl"/>
         <body>
           <![CDATA[
             if (zl <= 0) throw "Bad zoom level given.";
 
             this._zoomLevel = zl;
             this._frameLoader.setViewportScale(zl, zl);
             this._updateCacheViewport();
+
+            let event = document.createEvent("Events");
+            event.initEvent("ZoomChanged", true, false);
+            this.dispatchEvent(event);
           ]]>
         </body>
       </method>
 
       <!-- Sets size of CSS viewport, which affects how page is layout. -->
       <method name="setCssViewportSize">
         <parameter name="width"/>
         <parameter name="height"/>