From: Artur Signell Date: Wed, 12 Nov 2008 09:54:02 +0000 (+0000) Subject: Less flicker for captions in Safari X-Git-Tag: 6.7.0.beta1~3819 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=65b10b856815dd2c08f7ec86e258b4233dd391b5;p=vaadin-framework.git Less flicker for captions in Safari svn changeset:5875/svn branch:trunk --- diff --git a/src/com/itmill/toolkit/terminal/gwt/client/ICaption.java b/src/com/itmill/toolkit/terminal/gwt/client/ICaption.java index 1efcf3bf05..55f459ea63 100644 --- a/src/com/itmill/toolkit/terminal/gwt/client/ICaption.java +++ b/src/com/itmill/toolkit/terminal/gwt/client/ICaption.java @@ -14,7 +14,6 @@ import com.google.gwt.user.client.ui.HTML; import com.google.gwt.user.client.ui.Widget; import com.itmill.toolkit.terminal.gwt.client.ui.Icon; -//TODO Move styles to CSS public class ICaption extends HTML { public static final String CLASSNAME = "i-caption"; @@ -59,8 +58,6 @@ public class ICaption extends HTML { setStyleName(CLASSNAME); sinkEvents(ITooltip.TOOLTIP_EVENTS); - DOM.setStyleAttribute(getElement(), "whiteSpace", "nowrap"); - } /** @@ -84,6 +81,8 @@ public class ICaption extends HTML { if (uidl.hasAttribute(ATTRIBUTE_ICON)) { if (icon == null) { icon = new Icon(client); + icon.setWidth("0px"); + icon.setHeight("0px"); DOM.sinkEvents(icon.getElement(), Event.ONLOAD); DOM.insertChild(getElement(), icon.getElement(), @@ -219,6 +218,9 @@ public class ICaption extends HTML { if (DOM.eventGetType(event) == Event.ONLOAD && icon.getElement() == target && !iconOnloadHandled) { + icon.setWidth(""); + icon.setHeight(""); + /* * IE6 pngFix causes two onload events to be fired and we want to * react only to the first one @@ -311,13 +313,6 @@ public class ICaption extends HTML { public int getHeight() { int height = clearElement.getOffsetTop() - getElement().getOffsetTop(); - if (icon != null) { - int iconHeight = icon.getOffsetHeight(); - ApplicationConnection.getConsole().log( - "Caption height: " + height + ", icon height: " - + iconHeight); - } - return height; }