aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJohannes Dahlström <johannes.dahlstrom@vaadin.com>2012-06-14 13:11:37 +0000
committerJohannes Dahlström <johannes.dahlstrom@vaadin.com>2012-06-14 13:11:37 +0000
commit0abcf847a27cff763f3dfea6aeec04b5aeb633d4 (patch)
treeb56e598709d2866019660079652153b1eb54b84f /src
parent835c03b8633454861b491dd6053a990579e19de8 (diff)
downloadvaadin-framework-0abcf847a27cff763f3dfea6aeec04b5aeb633d4.tar.gz
vaadin-framework-0abcf847a27cff763f3dfea6aeec04b5aeb633d4.zip
#8852 Applied Sami's patch with minor changes to comments and the test
svn changeset:23938/svn branch:6.8
Diffstat (limited to 'src')
-rw-r--r--src/com/vaadin/terminal/gwt/client/ui/VForm.java5
-rw-r--r--src/com/vaadin/terminal/gwt/client/ui/VWindow.java24
2 files changed, 20 insertions, 9 deletions
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()