]> source.dussan.org Git - vaadin-framework.git/commitdiff
Fixed vertical border measuring in IE
authorArtur Signell <artur.signell@itmill.com>
Thu, 6 Nov 2008 08:53:38 +0000 (08:53 +0000)
committerArtur Signell <artur.signell@itmill.com>
Thu, 6 Nov 2008 08:53:38 +0000 (08:53 +0000)
svn changeset:5823/svn branch:trunk

src/com/itmill/toolkit/terminal/gwt/client/Util.java

index cc25f1aad5d91daa1b34885012504fec1faeb90d..556ffe242a2daa384f5ce9943266de7749de19a2 100644 (file)
@@ -246,9 +246,38 @@ public class Util {
     }
 
     public static int measureVerticalBorder(Element element) {
-        int borders = element.getOffsetHeight()
-                - element.getPropertyInt("clientHeight");
+        int borders;
+        if (BrowserInfo.get().isIE()) {
+            String width = element.getStyle().getProperty("width");
+            String height = element.getStyle().getProperty("height");
+
+            int offsetWidth = element.getOffsetWidth();
+            int offsetHeight = element.getOffsetHeight();
+            // if (BrowserInfo.get().isIE6()) {
+            if (offsetHeight < 1) {
+                offsetHeight = 1;
+            }
+            if (offsetWidth < 1) {
+                offsetWidth = 10;
+            }
+            element.getStyle().setPropertyPx("width", offsetWidth);
+            // }
+
+            element.getStyle().setPropertyPx("height", offsetHeight);
+
+            borders = element.getOffsetHeight()
+                    - element.getPropertyInt("clientHeight");
+
+            element.getStyle().setProperty("height", height);
+            // if (BrowserInfo.get().isIE6()) {
+            element.getStyle().setProperty("width", width);
+            // }
+        } else {
+            borders = element.getOffsetHeight()
+                    - element.getPropertyInt("clientHeight");
+        }
         assert borders >= 0;
+
         return borders;
     }
 
@@ -279,7 +308,7 @@ public class Util {
 
     }
 
-    public static String getSimpleName(Widget widget) {
+    public static String getSimpleName(Object widget) {
         if (widget == null) {
             return "(null)";
         }