From: Joonas Lehtinen Date: Mon, 30 Jun 2008 12:17:25 +0000 (+0000) Subject: Fixes #1837 : Window dragging (move and resize) bug in Mac Firefox 3 X-Git-Tag: 6.7.0.beta1~4539 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=1c616b24f9b0b06b6fae00cb2cd470a27ace67ff;p=vaadin-framework.git Fixes #1837 : Window dragging (move and resize) bug in Mac Firefox 3 svn changeset:4978/svn branch:trunk --- diff --git a/src/com/itmill/toolkit/terminal/gwt/client/ui/IWindow.java b/src/com/itmill/toolkit/terminal/gwt/client/ui/IWindow.java index 8b17f8704f..e34a8efbc9 100644 --- a/src/com/itmill/toolkit/terminal/gwt/client/ui/IWindow.java +++ b/src/com/itmill/toolkit/terminal/gwt/client/ui/IWindow.java @@ -20,6 +20,7 @@ import com.google.gwt.user.client.ui.ScrollListener; import com.google.gwt.user.client.ui.ScrollPanel; import com.google.gwt.user.client.ui.Widget; import com.itmill.toolkit.terminal.gwt.client.ApplicationConnection; +import com.itmill.toolkit.terminal.gwt.client.BrowserInfo; import com.itmill.toolkit.terminal.gwt.client.Paintable; import com.itmill.toolkit.terminal.gwt.client.UIDL; import com.itmill.toolkit.terminal.gwt.client.Util; @@ -359,27 +360,40 @@ public class IWindow extends PopupPanel implements Paintable, ScrollListener { super.show(); setFF2CaretFixEnabled(true); - + fixFF3OverflowBug(); } - private void setFF2CaretFixEnabled(boolean enable) { - // "missing cursor" browser bug workaround for FF2 in Windows andLinux - if (!Util.isFF2()) { - return; - } - if (enable) { + /** Disable overflow auto with FF3 to fix #1837. */ + private void fixFF3OverflowBug() { + if (BrowserInfo.get().isFF3()) { DeferredCommand.addCommand(new Command() { public void execute() { - String overflow = DOM.getStyleAttribute(getElement(), - "overflow"); - DOM.setStyleAttribute(getElement(), "overflow", "auto"); + DOM.setStyleAttribute(getElement(), "overflow", ""); } - }); - } else { - DOM.setStyleAttribute(getElement(), "overflow", ""); } + } + /** + * Fix "missing cursor" browser bug workaround for FF2 in Windows and Linux. + * + * Calling this method has no effect on other browsers than the ones based + * on Gecko 1.8 + * + * @param enable + */ + private void setFF2CaretFixEnabled(boolean enable) { + if (BrowserInfo.get().isFF2()) { + if (enable) { + DeferredCommand.addCommand(new Command() { + public void execute() { + DOM.setStyleAttribute(getElement(), "overflow", "auto"); + } + }); + } else { + DOM.setStyleAttribute(getElement(), "overflow", ""); + } + } } public void hide() {