From abc1c5dff6438d65e53473b69ae9a3ca2b8e60e1 Mon Sep 17 00:00:00 2001 From: Artur Signell Date: Wed, 17 Jun 2015 20:24:02 +0300 Subject: [PATCH] Take Window special case into account for invalid layouts (#17598) Change-Id: Ie2482df803b7f7004ad0da33ef1df39557f9560b --- .../com/vaadin/server/ComponentSizeValidator.java | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/server/src/com/vaadin/server/ComponentSizeValidator.java b/server/src/com/vaadin/server/ComponentSizeValidator.java index 1fbd840932..71023782ef 100644 --- a/server/src/com/vaadin/server/ComponentSizeValidator.java +++ b/server/src/com/vaadin/server/ComponentSizeValidator.java @@ -598,6 +598,12 @@ public class ComponentSizeValidator implements Serializable { if (parent == null) { return false; } else if (parent.getWidth() < 0) { + if (parent instanceof Window) { + // Window has some weird haxxors to support 100% children when + // window is -1 + return false; + } + return true; } else if (parent.getWidthUnits() == Unit.PERCENTAGE) { return isEffectiveUndefinedWidth(parent.getParent()); @@ -615,6 +621,12 @@ public class ComponentSizeValidator implements Serializable { if (parent == null) { return false; } else if (parent.getHeight() < 0) { + if (parent instanceof Window) { + // Window has some weird haxxors to support 100% children when + // window is -1 + return false; + } + return true; } else if (parent.getHeightUnits() == Unit.PERCENTAGE) { return isEffectiveUndefinedHeight(parent.getParent()); -- 2.39.5