]> source.dussan.org Git - vaadin-framework.git/commitdiff
Change to a more efficient overflow fix and enable it for IE9 (#8615)
authorLeif Åstrand <leif@vaadin.com>
Wed, 11 Apr 2012 10:51:41 +0000 (13:51 +0300)
committerLeif Åstrand <leif@vaadin.com>
Wed, 11 Apr 2012 10:51:41 +0000 (13:51 +0300)
src/com/vaadin/terminal/gwt/client/LayoutManager.java

index 09c811a2dece875e33c261585b7fa49505e2a236..40823f4beee9d29e64c4ea0a2d8f1bea94904d1d 100644 (file)
@@ -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);