Changeset 4978

Show
Ignore:
Timestamp:
06/30/08 12:17:25 (5 months ago)
Author:
joonas.lehtinen@…
Message:

Fixes #1837 : Window dragging (move and resize) bug in Mac Firefox 3

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/src/com/itmill/toolkit/terminal/gwt/client/ui/IWindow.java

    r4856 r4978  
    2121import com.google.gwt.user.client.ui.Widget; 
    2222import com.itmill.toolkit.terminal.gwt.client.ApplicationConnection; 
     23import com.itmill.toolkit.terminal.gwt.client.BrowserInfo; 
    2324import com.itmill.toolkit.terminal.gwt.client.Paintable; 
    2425import com.itmill.toolkit.terminal.gwt.client.UIDL; 
     
    360361 
    361362        setFF2CaretFixEnabled(true); 
    362  
    363     } 
    364  
    365     private void setFF2CaretFixEnabled(boolean enable) { 
    366         // "missing cursor" browser bug workaround for FF2 in Windows andLinux 
    367         if (!Util.isFF2()) { 
    368             return; 
    369         } 
    370         if (enable) { 
     363        fixFF3OverflowBug(); 
     364    } 
     365 
     366    /** Disable overflow auto with FF3 to fix #1837. */ 
     367    private void fixFF3OverflowBug() { 
     368        if (BrowserInfo.get().isFF3()) { 
    371369            DeferredCommand.addCommand(new Command() { 
    372370                public void execute() { 
    373                     String overflow = DOM.getStyleAttribute(getElement(), 
    374                             "overflow"); 
    375                     DOM.setStyleAttribute(getElement(), "overflow", "auto"); 
     371                    DOM.setStyleAttribute(getElement(), "overflow", ""); 
    376372                } 
    377  
    378373            }); 
    379         } else { 
    380             DOM.setStyleAttribute(getElement(), "overflow", ""); 
    381         } 
    382  
     374        } 
     375    } 
     376 
     377    /** 
     378     * Fix "missing cursor" browser bug workaround for FF2 in Windows and Linux. 
     379     *  
     380     * Calling this method has no effect on other browsers than the ones based 
     381     * on Gecko 1.8 
     382     *  
     383     * @param enable 
     384     */ 
     385    private void setFF2CaretFixEnabled(boolean enable) { 
     386        if (BrowserInfo.get().isFF2()) { 
     387            if (enable) { 
     388                DeferredCommand.addCommand(new Command() { 
     389                    public void execute() { 
     390                        DOM.setStyleAttribute(getElement(), "overflow", "auto"); 
     391                    } 
     392                }); 
     393            } else { 
     394                DOM.setStyleAttribute(getElement(), "overflow", ""); 
     395            } 
     396        } 
    383397    } 
    384398