]> source.dussan.org Git - vaadin-framework.git/commitdiff
Do not apply fix on mobile devices or devices without scrollbars (#12736)
authorArtur Signell <artur@vaadin.com>
Fri, 8 Nov 2013 09:26:08 +0000 (11:26 +0200)
committerArtur Signell <artur@vaadin.com>
Fri, 8 Nov 2013 09:26:44 +0000 (11:26 +0200)
Change-Id: I38ef869d87418c18197a59a5ecd3fb7e12e1c02e

client/src/com/vaadin/client/BrowserInfo.java
client/src/com/vaadin/client/ui/VWindow.java

index 273964c889adad06ba2397ffe77dd9da44fb0fe4..78c5c1f59fdffcf8e71d4b02fccf1af5e11f5def 100644 (file)
@@ -346,6 +346,22 @@ public class BrowserInfo {
                 && Util.getNativeScrollbarSize() > 0;
     }
 
+    /**
+     * Indicates whether the browser might require juggling to properly update
+     * sizes inside elements with overflow: auto when adjusting absolutely
+     * positioned elements.
+     * <p>
+     * See https://bugs.webkit.org/show_bug.cgi?id=123958 and
+     * http://code.google.com/p/chromium/issues/detail?id=316549
+     * 
+     * @since 7.1.8
+     * @return <code>true</code> if the browser requires the workaround,
+     *         otherwise <code>false</code>
+     */
+    public boolean requiresPositionAbsoluteOverflowAutoFix() {
+        return (getWebkitVersion() > 0) && Util.getNativeScrollbarSize() > 0;
+    }
+
     /**
      * Checks if the browser is run on iOS
      * 
index 73b57c7e5b7ada77c81ccf683a85c3338b4f5120..03a65e8ece03d377e76e635616cf401783f1e639 100644 (file)
@@ -346,7 +346,8 @@ public class VWindow extends VOverlay implements ShortcutActionHandlerOwner,
             super.setVisible(visible);
         }
 
-        if (visible && BrowserInfo.get().isWebkit()) {
+        if (visible
+                && BrowserInfo.get().requiresPositionAbsoluteOverflowAutoFix()) {
 
             /*
              * Shake up the DOM a bit to make the window shed unnecessary