Author: [email protected]
Date: Thu Apr 16 08:01:49 2009
New Revision: 5243

Modified:
    releases/1.6/user/src/com/google/gwt/dom/client/DOMImplIE6.java

Log:
Fixed a bug where getZoomMultiple() can throw a divide by zero error if  
body.offsetWidth() is zero, which can happen on a slow system in hosted  
mode.

Patch by: jlabanca
Review by: rjrjr
Issue: 3564



Modified: releases/1.6/user/src/com/google/gwt/dom/client/DOMImplIE6.java
==============================================================================
--- releases/1.6/user/src/com/google/gwt/dom/client/DOMImplIE6.java      
(original)
+++ releases/1.6/user/src/com/google/gwt/dom/client/DOMImplIE6.java     Thu Apr 
 
16 08:01:49 2009
@@ -282,8 +282,9 @@
      if (doc.getCompatMode().equals("CSS1Compat")) {
        return 1;
      } else {
-      return doc.getBody().getParentElement().getOffsetWidth() /
-        doc.getBody().getOffsetWidth();
+      int bodyOffset = doc.getBody().getOffsetWidth();
+      return bodyOffset == 0 ? 1
+          : doc.getBody().getParentElement().getOffsetWidth() / bodyOffset;
      }
    }
  }

--~--~---------~--~----~------------~-------~--~----~
http://groups.google.com/group/Google-Web-Toolkit-Contributors
-~----------~----~----~----~------~----~------~--~---

Reply via email to