diff options
author | John Ahlroos <john@vaadin.com> | 2013-04-17 17:17:39 +0300 |
---|---|---|
committer | John Ahlroos <john@vaadin.com> | 2013-04-17 17:17:39 +0300 |
commit | fc4aeac8b43bb3f200b25a997ade05075592ee90 (patch) | |
tree | 5a6b2cf6610832acf0447674d26308fa37a08bf4 | |
parent | c7ff7d5dda23f434eb8e056c808c63efefc0d904 (diff) | |
download | vaadin-framework-fc4aeac8b43bb3f200b25a997ade05075592ee90.tar.gz vaadin-framework-fc4aeac8b43bb3f200b25a997ade05075592ee90.zip |
Fixed IE8 scrollbar issue with vertical layout when using both expansions and alignments #11169
Change-Id: Ia62db30e4e7f9bd02966db31b3bb691a1a60e58d
3 files changed, 84 insertions, 3 deletions
diff --git a/client/src/com/vaadin/client/ui/orderedlayout/VAbstractOrderedLayout.java b/client/src/com/vaadin/client/ui/orderedlayout/VAbstractOrderedLayout.java index 93176f67bb..d8b0888936 100644 --- a/client/src/com/vaadin/client/ui/orderedlayout/VAbstractOrderedLayout.java +++ b/client/src/com/vaadin/client/ui/orderedlayout/VAbstractOrderedLayout.java @@ -29,6 +29,7 @@ import com.google.gwt.user.client.Element; import com.google.gwt.user.client.ui.FlowPanel; import com.google.gwt.user.client.ui.RequiresResize; import com.google.gwt.user.client.ui.Widget; +import com.vaadin.client.BrowserInfo; import com.vaadin.client.LayoutManager; import com.vaadin.client.Util; import com.vaadin.shared.ui.MarginInfo; @@ -411,10 +412,19 @@ public class VAbstractOrderedLayout extends FlowPanel { } else { // Non-relative child without expansion should be unconstrained - if (vertical) { - slotStyle.clearHeight(); + if (BrowserInfo.get().isIE8()) { + // unconstrained in IE8 is auto + if (vertical) { + slot.setHeight("auto"); + } else { + slot.setWidth("auto"); + } } else { - slotStyle.clearWidth(); + if (vertical) { + slotStyle.clearHeight(); + } else { + slotStyle.clearWidth(); + } } } } diff --git a/uitest/src/com/vaadin/tests/layouts/VerticalLayoutSlotExpansionAndAlignment.html b/uitest/src/com/vaadin/tests/layouts/VerticalLayoutSlotExpansionAndAlignment.html new file mode 100644 index 0000000000..e0b17ec8cf --- /dev/null +++ b/uitest/src/com/vaadin/tests/layouts/VerticalLayoutSlotExpansionAndAlignment.html @@ -0,0 +1,26 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> +<head profile="http://selenium-ide.openqa.org/profiles/test-case"> +<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> +<link rel="selenium.base" href="http://localhost:7070" /> +<title>New Test</title> +</head> +<body> +<table cellpadding="1" cellspacing="1" border="1"> +<thead> +<tr><td rowspan="1" colspan="3">New Test</td></tr> +</thead><tbody> +<tr> + <td>open</td> + <td>run/com.vaadin.tests.layouts.VerticalLayoutSlotExpansionAndAlignment?restartApplication</td> + <td></td> +</tr> +<tr> + <td>screenCapture</td> + <td></td> + <td>no-scrollbars</td> +</tr> +</tbody></table> +</body> +</html> diff --git a/uitest/src/com/vaadin/tests/layouts/VerticalLayoutSlotExpansionAndAlignment.java b/uitest/src/com/vaadin/tests/layouts/VerticalLayoutSlotExpansionAndAlignment.java new file mode 100644 index 0000000000..bba8ccf120 --- /dev/null +++ b/uitest/src/com/vaadin/tests/layouts/VerticalLayoutSlotExpansionAndAlignment.java @@ -0,0 +1,45 @@ +package com.vaadin.tests.layouts; + +import com.vaadin.annotations.Theme; +import com.vaadin.server.VaadinRequest; +import com.vaadin.ui.Alignment; +import com.vaadin.ui.HorizontalLayout; +import com.vaadin.ui.Label; +import com.vaadin.ui.UI; +import com.vaadin.ui.VerticalLayout; +import com.vaadin.ui.themes.Reindeer; + +@SuppressWarnings("serial") +public class VerticalLayoutSlotExpansionAndAlignment extends UI { + + @Override + protected void init(VaadinRequest request) { + + VerticalLayout layout = new VerticalLayout(); + layout.setSizeFull(); + setContent(layout); + + HorizontalLayout header = new HorizontalLayout(new Label("HEADER")); + header.setHeight("100px"); + header.setWidth("100%"); + header.setStyleName(Reindeer.LAYOUT_WHITE); + layout.addComponent(header); + + HorizontalLayout content = new HorizontalLayout(new Label("CONTENT")); + content.setSizeFull(); + content.setStyleName(Reindeer.LAYOUT_BLUE); + layout.addComponent(content); + + HorizontalLayout footer = new HorizontalLayout(new Label("FOOTER")); + footer.setHeight("150px"); + footer.setWidth("100%"); + footer.setStyleName(Reindeer.LAYOUT_BLACK); + layout.addComponent(footer); + + // This break things + layout.setComponentAlignment(footer, Alignment.BOTTOM_LEFT); + layout.setExpandRatio(content, 1); + + } + +}
\ No newline at end of file |