From 41db27c0adfe9a75352ed4e1f58ac0eee5b23422 Mon Sep 17 00:00:00 2001 From: Teemu Suo-Anttila Date: Tue, 21 Jul 2015 14:00:43 +0300 Subject: Revert "Render nested invalid layouts correctly (#17598)" This reverts commit ac4e85f4e35a57d1ba6e6f3448744cbb0c2df60f. Change-Id: I892896e953637d793d0c0a788f28f3b61494d441 --- .../com/vaadin/server/ComponentSizeValidator.java | 41 +++------------------- 1 file changed, 5 insertions(+), 36 deletions(-) (limited to 'server/src/com') diff --git a/server/src/com/vaadin/server/ComponentSizeValidator.java b/server/src/com/vaadin/server/ComponentSizeValidator.java index 1fbd840932..2d88ae3b53 100644 --- a/server/src/com/vaadin/server/ComponentSizeValidator.java +++ b/server/src/com/vaadin/server/ComponentSizeValidator.java @@ -415,7 +415,7 @@ public class ComponentSizeValidator implements Serializable { // main window, valid situation return true; } - if (isEffectiveUndefinedHeight(component)) { + if (parent.getHeight() < 0) { // Undefined height if (parent instanceof Window) { // Sub window with undefined size has a min-height @@ -513,7 +513,10 @@ public class ComponentSizeValidator implements Serializable { // Sub window with undefined size has a min-width return true; } - if (isEffectiveUndefinedWidth(parent)) { + + if (parent.getWidth() < 0) { + // Undefined width + if (parent instanceof AbstractOrderedLayout) { AbstractOrderedLayout ol = (AbstractOrderedLayout) parent; boolean horizontal = true; @@ -588,40 +591,6 @@ public class ComponentSizeValidator implements Serializable { } - /** - * Checks if this component will be rendered with undefined width, either - * because it has been set to undefined wide or because the parent forces it - * to be (100% inside undefined) - * - */ - private static boolean isEffectiveUndefinedWidth(Component parent) { - if (parent == null) { - return false; - } else if (parent.getWidth() < 0) { - return true; - } else if (parent.getWidthUnits() == Unit.PERCENTAGE) { - return isEffectiveUndefinedWidth(parent.getParent()); - } - return false; - } - - /** - * Checks if this component will be rendered with undefined Height, either - * because it has been set to undefined wide or because the parent forces it - * to be (100% inside undefined) - * - */ - private static boolean isEffectiveUndefinedHeight(Component parent) { - if (parent == null) { - return false; - } else if (parent.getHeight() < 0) { - return true; - } else if (parent.getHeightUnits() == Unit.PERCENTAGE) { - return isEffectiveUndefinedHeight(parent.getParent()); - } - return false; - } - private static boolean hasNonRelativeWidthComponent(Form form) { Layout layout = form.getLayout(); Layout footer = form.getFooter(); -- cgit v1.2.3