From dd201278992fe5cd494adc9e3029692642a9df57 Mon Sep 17 00:00:00 2001 From: Artur Signell Date: Thu, 6 Nov 2008 08:53:38 +0000 Subject: [PATCH] Fixed vertical border measuring in IE svn changeset:5823/svn branch:trunk --- .../toolkit/terminal/gwt/client/Util.java | 35 +++++++++++++++++-- 1 file changed, 32 insertions(+), 3 deletions(-) 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)"; } -- 2.39.5