From: Artur Signell Date: Fri, 8 Nov 2013 09:26:08 +0000 (+0200) Subject: Do not apply fix on mobile devices or devices without scrollbars (#12736) X-Git-Tag: 7.1.9~34 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=1385857;p=vaadin-framework.git Do not apply fix on mobile devices or devices without scrollbars (#12736) Change-Id: I38ef869d87418c18197a59a5ecd3fb7e12e1c02e --- diff --git a/client/src/com/vaadin/client/BrowserInfo.java b/client/src/com/vaadin/client/BrowserInfo.java index 273964c889..78c5c1f59f 100644 --- a/client/src/com/vaadin/client/BrowserInfo.java +++ b/client/src/com/vaadin/client/BrowserInfo.java @@ -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. + *

+ * 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 true if the browser requires the workaround, + * otherwise false + */ + public boolean requiresPositionAbsoluteOverflowAutoFix() { + return (getWebkitVersion() > 0) && Util.getNativeScrollbarSize() > 0; + } + /** * Checks if the browser is run on iOS * diff --git a/client/src/com/vaadin/client/ui/VWindow.java b/client/src/com/vaadin/client/ui/VWindow.java index 73b57c7e5b..03a65e8ece 100644 --- a/client/src/com/vaadin/client/ui/VWindow.java +++ b/client/src/com/vaadin/client/ui/VWindow.java @@ -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