This change appear to have broken all of my scrollable content in
IE6/7.  What I see now is the scroll panel with scrollbar and the
content exceeding the bounds of the scrollpanel. Interaction with the
scrollbar has no effect on the content.

The use of the ScrollPanels and their child Widgets vary. So I do not
know if this is an error in my implementation.

Using IE Dev tools I remove the relative positioning from the
containerElem and it displays correctly.


On Oct 13, 8:53 am, codesite-nore...@google.com wrote:
> Revision: 6354
> Author: j...@google.com
> Date: Tue Oct 13 05:52:22 2009
> Log: Fixes IE bug inScrollPanelat 100% width; Adds  
> Requires/ProvidesResize.
> Review:http://gwt-code-reviews.appspot.com/78810http://code.google.com/p/google-web-toolkit/source/detail?r=6354
>
> Modified:
>   /trunk/user/src/com/google/gwt/user/client/ui/ScrollPanel.java
>
> =======================================
> --- /trunk/user/src/com/google/gwt/user/client/ui/ScrollPanel.java      Tue 
> May  
> 12 11:20:32 2009
> +++ /trunk/user/src/com/google/gwt/user/client/ui/ScrollPanel.java      Tue 
> Oct  
> 13 05:52:22 2009
> @@ -27,15 +27,26 @@
>    */
>   @SuppressWarnings("deprecation")
>   public classScrollPanelextends SimplePanel implements  
> SourcesScrollEvents,
> -    HasScrollHandlers {
> +    HasScrollHandlers, RequiresResize, ProvidesResize {
> +
> +  private Element containerElem;
>
>     /**
>      * Creates an empty scroll panel.
>      */
>     publicScrollPanel() {
>       setAlwaysShowScrollBars(false);
> +
> +    containerElem = DOM.createDiv();
> +    getElement().appendChild(containerElem);
> +
>       // Prevent IE standard mode bug when a AbsolutePanel is contained.
> -    DOM.setStyleAttribute(getElement(), "position", "relative");
> +    DOM.setStyleAttribute(containerElem, "position", "relative");
> +
> +    // Hack to account for the IE6/7 scrolling bug described here:
> +    //    
> http://stackoverflow.com/questions/139000/div-with-overflowauto-and-a...
> +    DOM.setStyleAttribute(getElement(), "zoom", "1");
> +    DOM.setStyleAttribute(containerElem, "zoom", "1");
>     }
>
>     /**
> @@ -89,6 +100,13 @@
>     public int getScrollPosition() {
>       return DOM.getElementPropertyInt(getElement(), "scrollTop");
>     }
> +
> +  public void onResize() {
> +    Widget child = getWidget();
> +    if ((child != null) && (child instanceof RequiresResize)) {
> +      ((RequiresResize) child).onResize();
> +    }
> +  }
>
>     /**
>      * @deprecated Use the {...@link HandlerRegistration#removeHandler}
> @@ -194,6 +212,10 @@
>     public void setWidth(String width) {
>       super.setWidth(width);
>     }
> +
> +  protected Element getContainerElement() {
> +    return containerElem;
> +  }
>
>     private native void ensureVisibleImpl(Element scroll, Element e) /*-{
>       if (!e)
--~--~---------~--~----~------------~-------~--~----~
http://groups.google.com/group/Google-Web-Toolkit-Contributors
-~----------~----~----~----~------~----~------~--~---

Reply via email to