From 25d5b0eebdb841589ac8cb8c1301a4cc494d03ff Mon Sep 17 00:00:00 2001 From: =?utf8?q?Leif=20=C3=85strand?= Date: Wed, 11 Apr 2012 13:51:41 +0300 Subject: [PATCH] Change to a more efficient overflow fix and enable it for IE9 (#8615) --- .../vaadin/terminal/gwt/client/LayoutManager.java | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/src/com/vaadin/terminal/gwt/client/LayoutManager.java b/src/com/vaadin/terminal/gwt/client/LayoutManager.java index 09c811a2de..40823f4bee 100644 --- a/src/com/vaadin/terminal/gwt/client/LayoutManager.java +++ b/src/com/vaadin/terminal/gwt/client/LayoutManager.java @@ -12,7 +12,8 @@ import java.util.Set; import com.google.gwt.core.client.Duration; import com.google.gwt.core.client.JsArrayString; import com.google.gwt.dom.client.Element; -import com.google.gwt.dom.client.Style.Unit; +import com.google.gwt.dom.client.Style; +import com.google.gwt.dom.client.Style.Overflow; import com.google.gwt.user.client.Timer; import com.vaadin.terminal.gwt.client.MeasuredSize.MeasureResult; import com.vaadin.terminal.gwt.client.ui.ManagedLayout; @@ -349,8 +350,10 @@ public class LayoutManager { if (!pendingOverflowFixes.isEmpty()) { Duration duration = new Duration(); for (ComponentConnector componentConnector : pendingOverflowFixes) { - componentConnector.getWidget().getElement().getParentElement() - .getStyle().setTop(1, Unit.PX); + Style style = componentConnector.getWidget().getElement() + .getParentElement().getStyle(); + assert (style.getOverflow() == null); + style.setOverflow(Overflow.HIDDEN); } for (ComponentConnector componentConnector : pendingOverflowFixes) { componentConnector.getWidget().getElement().getParentElement() @@ -358,7 +361,7 @@ public class LayoutManager { } for (ComponentConnector componentConnector : pendingOverflowFixes) { componentConnector.getWidget().getElement().getParentElement() - .getStyle().setTop(0, Unit.PX); + .getStyle().clearOverflow(); layoutDependencyTree.setNeedsMeasure(componentConnector, true); ComponentContainerConnector parent = componentConnector .getParent(); @@ -425,8 +428,10 @@ public class LayoutManager { } private void doOverflowAutoFix(ComponentConnector connector) { + // IE9 doesn't need the original fix, but for some reason it needs one if (connector.getParent() instanceof MayScrollChildren - && BrowserInfo.get().requiresOverflowAutoFix() + && (BrowserInfo.get().requiresOverflowAutoFix() || BrowserInfo + .get().isIE9()) && !"absolute".equals(connector.getWidget().getElement() .getStyle().getPosition())) { pendingOverflowFixes.add(connector); -- 2.39.5