From: Artur Signell Date: Fri, 22 May 2009 16:47:33 +0000 (+0000) Subject: Test case and fix for #2902 - IE fails to size ICaption icon correctly on consecutive... X-Git-Tag: 6.7.0.beta1~2793 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=f56fa46c5a6c66fdb427d411b118a93f4b26e9c2;p=vaadin-framework.git Test case and fix for #2902 - IE fails to size ICaption icon correctly on consecutive reloads svn changeset:7972/svn branch:6.0 --- diff --git a/src/com/vaadin/terminal/gwt/client/ui/layout/ChildComponentContainer.java b/src/com/vaadin/terminal/gwt/client/ui/layout/ChildComponentContainer.java index 299bbd6918..c44e298d1e 100644 --- a/src/com/vaadin/terminal/gwt/client/ui/layout/ChildComponentContainer.java +++ b/src/com/vaadin/terminal/gwt/client/ui/layout/ChildComponentContainer.java @@ -12,10 +12,10 @@ import com.google.gwt.user.client.ui.Panel; import com.google.gwt.user.client.ui.Widget; import com.vaadin.terminal.gwt.client.ApplicationConnection; import com.vaadin.terminal.gwt.client.BrowserInfo; -import com.vaadin.terminal.gwt.client.VCaption; import com.vaadin.terminal.gwt.client.Paintable; import com.vaadin.terminal.gwt.client.UIDL; import com.vaadin.terminal.gwt.client.Util; +import com.vaadin.terminal.gwt.client.VCaption; import com.vaadin.terminal.gwt.client.RenderInformation.FloatSize; import com.vaadin.terminal.gwt.client.RenderInformation.Size; import com.vaadin.terminal.gwt.client.ui.AlignmentInfo; @@ -424,6 +424,13 @@ public class ChildComponentContainer extends Panel { newCaption.setHeight("18px"); // newCaption.setHeight(newCaption.getHeight()); // This might // be better... ?? + if (BrowserInfo.get().isIE()) { + /* + * Must attach caption here so IE sends an immediate onload + * event for images coming from the cache + */ + setCaption(newCaption); + } } boolean positionChanged = newCaption.updateCaption(uidl); diff --git a/src/com/vaadin/tests/components/caption/LargeCaptionIcon.java b/src/com/vaadin/tests/components/caption/LargeCaptionIcon.java new file mode 100644 index 0000000000..0ff82e9847 --- /dev/null +++ b/src/com/vaadin/tests/components/caption/LargeCaptionIcon.java @@ -0,0 +1,31 @@ +package com.vaadin.tests.components.caption; + +import com.vaadin.terminal.ThemeResource; +import com.vaadin.tests.components.TestBase; +import com.vaadin.ui.GridLayout; +import com.vaadin.ui.Label; + +public class LargeCaptionIcon extends TestBase { + + @Override + protected String getDescription() { + return "The icon should be completetly visible on both initial load and after subsequent refreshes."; + } + + @Override + protected Integer getTicketNumber() { + return 2902; + } + + @Override + protected void setup() { + GridLayout gl = new GridLayout(); + gl.setWidth("100%"); + + Label l = new Label("This is a label"); + l.setCaption("This is its caption, it also has a large icon"); + l.setIcon(new ThemeResource("../runo/icons/64/ok.png")); + gl.addComponent(l); + addComponent(gl); + } +}