From: Artur Signell Date: Thu, 6 Nov 2008 08:53:38 +0000 (+0000) Subject: Fixed vertical border measuring in IE X-Git-Tag: 6.7.0.beta1~3862 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=dd201278992fe5cd494adc9e3029692642a9df57;p=vaadin-framework.git Fixed vertical border measuring in IE svn changeset:5823/svn branch:trunk --- diff --git a/src/com/itmill/toolkit/terminal/gwt/client/Util.java b/src/com/itmill/toolkit/terminal/gwt/client/Util.java index cc25f1aad5..556ffe242a 100644 --- a/src/com/itmill/toolkit/terminal/gwt/client/Util.java +++ b/src/com/itmill/toolkit/terminal/gwt/client/Util.java @@ -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)"; }