From: Leif Åstrand Date: Wed, 11 Apr 2012 10:51:41 +0000 (+0300) Subject: Change to a more efficient overflow fix and enable it for IE9 (#8615) X-Git-Tag: 7.0.0.alpha2~65^2~6 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=25d5b0eebdb841589ac8cb8c1301a4cc494d03ff;p=vaadin-framework.git Change to a more efficient overflow fix and enable it for IE9 (#8615) --- 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);