summaryrefslogtreecommitdiffstats
path: root/shared
diff options
context:
space:
mode:
authorJohn Ahlroos <john@vaadin.com>2012-09-13 11:02:13 +0300
committerJohn Ahlroos <john@vaadin.com>2012-09-13 11:02:13 +0300
commiteef6af3029923b6ad9076e264394bfa8b9b4b789 (patch)
treea622577e9f2360faa8254d7874b5ee355a9f8fef /shared
parent0bd47dcbb4813d08ecba6941ac63465f21cfde0b (diff)
downloadvaadin-framework-eef6af3029923b6ad9076e264394bfa8b9b4b789.tar.gz
vaadin-framework-eef6af3029923b6ad9076e264394bfa8b9b4b789.zip
Ensures negative height is not returned in HorizontalLayout height calculations #9596
Diffstat (limited to 'shared')
-rw-r--r--shared/src/com/vaadin/shared/ui/ComponentStateUtil.java8
1 files changed, 8 insertions, 0 deletions
diff --git a/shared/src/com/vaadin/shared/ui/ComponentStateUtil.java b/shared/src/com/vaadin/shared/ui/ComponentStateUtil.java
index a7b3d5a281..5e6700b425 100644
--- a/shared/src/com/vaadin/shared/ui/ComponentStateUtil.java
+++ b/shared/src/com/vaadin/shared/ui/ComponentStateUtil.java
@@ -26,6 +26,14 @@ public final class ComponentStateUtil {
return state.styles != null && !state.styles.isEmpty();
}
+ public static final boolean isRelativeWidth(ComponentState state) {
+ return state.width != null && state.width.endsWith("%");
+ }
+
+ public static final boolean isRelativeHeight(ComponentState state) {
+ return state.height != null && state.height.endsWith("%");
+ }
+
/**
* Removes an event listener id.
*