summaryrefslogtreecommitdiffstats
path: root/server/src
diff options
context:
space:
mode:
authorTeemu Suo-Anttila <teemusa@vaadin.com>2015-07-21 14:00:03 +0300
committerTeemu Suo-Anttila <teemusa@vaadin.com>2016-01-05 14:06:25 +0200
commit4cae98861643f25b112d313bb56f02f3f2ee80a1 (patch)
tree1649c57a843a091077429a8f4d7b90d501f3988d /server/src
parente2f25d6ca1d159c76eaaa8f63d0e196d5a9ced85 (diff)
downloadvaadin-framework-4cae98861643f25b112d313bb56f02f3f2ee80a1.tar.gz
vaadin-framework-4cae98861643f25b112d313bb56f02f3f2ee80a1.zip
Revert changes which were previously reverted from only 7.5 (#19424)
Revert "Take Window special case into account for invalid layouts (#17598)" This reverts commit abc1c5dff6438d65e53473b69ae9a3ca2b8e60e1. Revert "Render nested invalid layouts correctly (#17598)" This reverts commit ac4e85f4e35a57d1ba6e6f3448744cbb0c2df60f. Added test to ensure a similar problem is not reintroduced later Change-Id: I680c20384e62c7c00b4ac0e2dc91f65f1585d37c
Diffstat (limited to 'server/src')
-rw-r--r--server/src/com/vaadin/server/ComponentSizeValidator.java53
1 files changed, 5 insertions, 48 deletions
diff --git a/server/src/com/vaadin/server/ComponentSizeValidator.java b/server/src/com/vaadin/server/ComponentSizeValidator.java
index eb2aa52297..b8b06c780f 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,52 +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) {
- 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());
- }
- 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) {
- 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());
- }
- return false;
- }
-
private static boolean hasNonRelativeWidthComponent(Form form) {
Layout layout = form.getLayout();
Layout footer = form.getFooter();