From 0abcf847a27cff763f3dfea6aeec04b5aeb633d4 Mon Sep 17 00:00:00 2001 From: Johannes Dahlström Date: Thu, 14 Jun 2012 13:11:37 +0000 Subject: #8852 Applied Sami's patch with minor changes to comments and the test svn changeset:23938/svn branch:6.8 --- src/com/vaadin/terminal/gwt/client/ui/VForm.java | 5 ----- src/com/vaadin/terminal/gwt/client/ui/VWindow.java | 24 ++++++++++++++++++---- 2 files changed, 20 insertions(+), 9 deletions(-) (limited to 'src') diff --git a/src/com/vaadin/terminal/gwt/client/ui/VForm.java b/src/com/vaadin/terminal/gwt/client/ui/VForm.java index c0a6e5b275..546f90a39b 100644 --- a/src/com/vaadin/terminal/gwt/client/ui/VForm.java +++ b/src/com/vaadin/terminal/gwt/client/ui/VForm.java @@ -6,7 +6,6 @@ package com.vaadin.terminal.gwt.client.ui; import java.util.Set; -import com.google.gwt.dom.client.Style.Display; import com.google.gwt.event.dom.client.KeyDownEvent; import com.google.gwt.event.dom.client.KeyDownHandler; import com.google.gwt.event.shared.HandlerRegistration; @@ -39,7 +38,6 @@ public class VForm extends ComplexPanel implements Container, KeyDownHandler { private Container lo; private Element legend = DOM.createLegend(); private Element caption = DOM.createSpan(); - private Element errorIndicatorElement = DOM.createDiv(); private Element desc = DOM.createDiv(); private Icon icon; private VErrorMessage errorMessage = new VErrorMessage(); @@ -70,9 +68,6 @@ public class VForm extends ComplexPanel implements Container, KeyDownHandler { setStyleName(CLASSNAME); fieldSet.appendChild(legend); legend.appendChild(caption); - errorIndicatorElement.setClassName("v-errorindicator"); - errorIndicatorElement.getStyle().setDisplay(Display.NONE); - errorIndicatorElement.setInnerText(" "); // needed for IE desc.setClassName("v-form-description"); fieldSet.appendChild(desc); // Adding description for initial padding // measurements, removed later if no diff --git a/src/com/vaadin/terminal/gwt/client/ui/VWindow.java b/src/com/vaadin/terminal/gwt/client/ui/VWindow.java index 2355a9c65a..2384ee7ddd 100644 --- a/src/com/vaadin/terminal/gwt/client/ui/VWindow.java +++ b/src/com/vaadin/terminal/gwt/client/ui/VWindow.java @@ -390,6 +390,17 @@ public class VWindow extends VOverlay implements Container, layoutRelativeWidth = uidl.hasAttribute("layoutRelativeWidth"); layoutRelativeHeight = uidl.hasAttribute("layoutRelativeHeight"); + // Ticket #8852: We have to override min height if height of both window + // and layout have undefined height. 0 is used to as undefined value and + // replacing it with 30 will lead to calculation errors (as browser + // takes care of height modifications). + if (dynamicHeight && !layoutRelativeHeight + && !childUidl.hasAttribute("height")) { + renderSpace.setHeight(0); + } else if (renderSpace.getHeight() < MIN_CONTENT_AREA_HEIGHT) { + renderSpace.setHeight(MIN_CONTENT_AREA_HEIGHT); + } + if (dynamicWidth && layoutRelativeWidth) { /* * Relative layout width, fix window width before rendering (width @@ -1161,12 +1172,17 @@ public class VWindow extends VOverlay implements Container, return; } if (height == null || "".equals(height)) { + getElement().getStyle().clearHeight(); contentPanel.getElement().getStyle().clearHeight(); - // Reset to default, the exact value does not actually - // matter as an undefined-height parent should not have - // a relative-height child anyway. - renderSpace.setHeight(MIN_CONTENT_AREA_HEIGHT); + + // If content and window both have undefined height do not set min + // height to render space + if (renderSpace.getHeight() != 0 || !dynamicHeight + || layoutRelativeHeight) { + renderSpace.setHeight(MIN_CONTENT_AREA_HEIGHT); + } + } else { getElement().getStyle().setProperty("height", height); int contentHeight = getElement().getOffsetHeight() -- cgit v1.2.3