From 13858578966dad8cf5a6f10448b42961817beafc Mon Sep 17 00:00:00 2001 From: Artur Signell Date: Fri, 8 Nov 2013 11:26:08 +0200 Subject: [PATCH] Do not apply fix on mobile devices or devices without scrollbars (#12736) Change-Id: I38ef869d87418c18197a59a5ecd3fb7e12e1c02e --- client/src/com/vaadin/client/BrowserInfo.java | 16 ++++++++++++++++ client/src/com/vaadin/client/ui/VWindow.java | 3 ++- 2 files changed, 18 insertions(+), 1 deletion(-) 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 -- 2.39.5