Followup on "elem is null" issue (Firefox 3)

2009-03-04 Thread dunhamst...@gmail.com

The previous thread for this issue is no longer taking new posts, but
after receiving a few emails, I wanted to follow up on this issue.

   
http://groups.google.com/group/Google-Web-Toolkit/browse_thread/thread/fabd646526aaf2bc?pli=1

In short, it manifests itself as Widget.element and sometimes other
fields appearing to be null in cases where they shouldn't be.  For
example, immediately after being assigned a non-null value.  (The real
value shows up later on.)

This occurs sporadically, and only on Firefox 3. It seems to occur
within a constructor (e.g. soon after the object was created). What I
believe is happening is that the value from the prototype is being
used instead of the value on the object itself, possibly due to some
kind of property caching within Firefox. We're seeing this a _lot_ on
our application in production.

The upstream bug for this issue is 449809, 
https://bugzilla.mozilla.org/show_bug.cgi?id=449809

Our current production application is silently ignoring these issues,
but reporting them back to us. This required a bunch of patching of
GWT and seems non-optimal.

The next release of our application is taking a different approach.
I've added the following code to UIObject, which seems to eliminate
all occurrences of this issue with the "element" field.

  public UIObject() {
  /*
   * FF3 HACK - we set this to null explicitly in the constructor
(rather than on the JS prototype),
   * hoping that the actual non-null setElement() will be more
likely to "take".
   */
  element = null;
  }


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To post to this group, send email to Google-Web-Toolkit@googlegroups.com
To unsubscribe from this group, send email to 
google-web-toolkit+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/Google-Web-Toolkit?hl=en
-~--~~~~--~~--~--~---



Re: Safari 5 - (RangeError): Maximum call stack size exceeded

2010-06-09 Thread dunhamst...@gmail.com
This is occurring for us in the Arrays.mergeSort() code.  A reduced
testcase (which looks like the binarySearch code) is in the webkit bug
tracking system at:

https://bugs.webkit.org/show_bug.cgi?id=40355

It appears that in some complex expressions the right shift operator
is not evaluating correctly.  Assigning the result of the right shift
to a temporary variable and then using it appears to make the problem
go away.

As a temporary fix, we're patching Arrays.java:mergeSort() to assign
the result of the right shift to a temporary variable before using it.
If you're using binary search you'd need to patch those functions as
well.  It's a bit of a hack, but it seems to work. I've included our
patch below, in case it is helpful to someone.


diff --git a/super/com/google/gwt/emul/java/util/Arrays.java b/super/
com/google/
index 89dcc33..b7ba6fa 100644
--- a/super/com/google/gwt/emul/java/util/Arrays.java
+++ b/super/com/google/gwt/emul/java/util/Arrays.java
@@ -1322,7 +1322,8 @@ public class Arrays {
 // recursively sort both halves, using the array as temp space
 int tempLow = low + ofs;
 int tempHigh = high + ofs;
-int tempMid = tempLow + ((tempHigh - tempLow) >> 1);
+int half = length >> 1;
+int tempMid = tempLow + half;
 mergeSort(array, temp, tempLow, tempMid, -ofs, comp);
 mergeSort(array, temp, tempMid, tempHigh, -ofs, comp);

-- 
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To post to this group, send email to google-web-tool...@googlegroups.com.
To unsubscribe from this group, send email to 
google-web-toolkit+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.



Re: Strange scrolling div problem in WebKit browsers

2012-05-02 Thread dunhamst...@gmail.com


On Thursday, April 21, 2011 2:38:51 AM UTC-7, Jens wrote:
>
> After some research I figured out that GWT's PopupPanel is probably 
> responsible for that behavior. I have some wizard views which contain the 
> custom list mentioned before and these wizards use a PopupPanel which is 
> set to modal. I think there might be a bug in the way PopupPanels cancel 
> events if the PopupPanel is set to modal. 
> But its really strange that it only happens when the mouse cursor hovers 
> text inside a ScrollPanel inside a modal PopupPanel. So maybe its more a 
> WebKit bug.
>
>
I tracked this down by stepping through the code in a javascript debugger. 
 The issue is in PopupPanel.eventTargetsPopup().  The mouse scroll event is 
coming through with a target of type "Text" rather than "Element".   

(You'll notice that the scrolling stops on the text, but in the rest of the 
div containing the text.) 

Changing the code to the following seems to fix it:

  private boolean eventTargetsPopup(NativeEvent event) {
> EventTarget target = event.getEventTarget();
> if (Node.is(target)) {
>   return getElement().isOrHasChild(Node.as(target));
> }
> return false;
>   }


But it might be better to tweak DOMImplWebKit.eventGetCurrentTarget() to 
return the parent of the target if the target is of type Text. (In case 
other code is expecting EventTarget to be an Element.)

 

-- 
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/google-web-toolkit/-/Cj2Y12JhgCkJ.
To post to this group, send email to google-web-toolkit@googlegroups.com.
To unsubscribe from this group, send email to 
google-web-toolkit+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.



Re: Strange scrolling div problem in WebKit browsers

2012-05-02 Thread dunhamst...@gmail.com
I think this was causing some issues with click events not being 
recognized, so I ended up adding this code to DOMImplWebkit to fix it:

  @Override
>   public native EventTarget eventGetTarget(NativeEvent evt) /*-{
> var target = evt.target;
> if (target && target.nodeType == 3) {
>   target = target.parentNode;
> }
> return target;
>   }-*/;



-- 
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/google-web-toolkit/-/-j7Ml9c94voJ.
To post to this group, send email to google-web-toolkit@googlegroups.com.
To unsubscribe from this group, send email to 
google-web-toolkit+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.



Re: Strange scrolling div problem in WebKit browsers

2012-05-02 Thread dunhamst...@gmail.com


On Wednesday, May 2, 2012 11:38:20 AM UTC-7, Jens wrote:
>
> Pretty cool, I haven't followed it anymore because I just changed my 
> PopupPanel back to setModal(false) and live with it ;-)
>
> Do you want to create a GWT issue for it on the issue tracker? Otherwise 
> I'll do it.
>
> -- J.
>
>
Thanks, I just filed #7349

-- 
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/google-web-toolkit/-/D2idRrfSiPYJ.
To post to this group, send email to google-web-toolkit@googlegroups.com.
To unsubscribe from this group, send email to 
google-web-toolkit+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.