ie10 permutation causing browser errors? (gwt 2.6.1) really baffled here.

460 views
Skip to first unread message

darkflame

unread,
Oct 2, 2014, 6:34:04 PM10/2/14
to google-we...@googlegroups.com
If I want my GWT2.6.1 application to compile to ie10, this is correct isn't it;

<set-property name="user.agent" value="ie8,ie9,opera,gecko1_8,safari,ie10" />

?

Because my app is producing this bizarre error in ie10;

SEVERE: Exception caught: (TypeError) 
 description: Object doesn't support property or method 'replace'
 number: -2146827850
 stack: TypeError: Object doesn't support property or method 'replace'
 __gwt$exception: <skipped>: Object doesn't support property or method 'replace'com.google.gwt.user.client.ui.AttachDetachException: Exception caught: (TypeError) 
 description: Object doesn't support property or method 'replace'

Note the "trim()" - which I was astonished to learn recently wasn't supported on ie8.

Is this just a coincidence and the error lies elsewhere? or is somehow a ie8 permutation running in ie10?
Can anything else override what permutation is picked to run?

The application works fine on chrome, firefox and opera.

The problem is a bit more curious, however, as some trim statements do work.
Heres the code triggering the crash:

 SOLog.info("~~~~~Just before trimming");
 SOLog.info(""+GWT.getHostPageBaseURL().trim()); //displays the homepage url fine
       
 Element ParentElement = this.getElement().getParentElement();
 SOLog.info("Got parent E"); //displays
 Style ElementStyle = ParentElement.getStyle();
 SOLog.info("Got parent Style"); //displays
 String ZindexNonTrim = ElementStyle.getZIndex();
 SOLog.info("Got parent Zindex "+ZindexNonTrim); //reachs here fine. The zindex of the element happens to be 30 and that value displays in the log correctly
       
 SOLog.info(""+ZindexNonTrim.getClass().getName()); //this results in "java.lang.string"
       
 String blar = "30".trim();   //this trim works      
 SOLog.info("Well gosh darnit! "+blar);

 String zindexstring = ZindexNonTrim.trim(); //this one causes the crash <<<<<<<<<<<<<<
 SOLog.info("~~~~~zomg no crashyness?");



I just cant get my head around why a string.trim() is causing a crash when other string.trims() are not.


HELP!

;(

Appreciate anything,
Thomas Wrobel


Joseph Lust

unread,
Oct 3, 2014, 11:58:45 AM10/3/14
to google-we...@googlegroups.com
Thomas,

Have you tried looking at the PRETTY print version of this code to see exactly what output JS is causing the problem in IE10?

Thomas Wrobel

unread,
Oct 3, 2014, 1:11:23 PM10/3/14
to google-we...@googlegroups.com
Ok, heres where its crashing:

function java_lang_String_$trim__Ljava_lang_String_2Ljava_lang_String_2(this$static){
  if (this$static.length == 0 || this$static[0] > $intern_60 && this$static[this$static.length - 1] > $intern_60) {
    return this$static;
  }
  var r1 = this$static.replace(/^(\s*)/, $intern_8);
  var r2 = r1.replace(/\s*$/, $intern_8);
  return r2;
}

Specifically the; 
  var r1 = this$static.replace(/^(\s*)/, $intern_8);


 

~~~
Thomas & Bertines online review show:
http://randomreviewshow.com/index.html
Try it! You might even feel ambivalent about it :)

On 3 October 2014 17:58, Joseph Lust <lifeo...@gmail.com> wrote:
Thomas,

Have you tried looking at the PRETTY print version of this code to see exactly what output JS is causing the problem in IE10?

--
You received this message because you are subscribed to a topic in the Google Groups "Google Web Toolkit" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/google-web-toolkit/UoWCYwOCaVQ/unsubscribe.
To unsubscribe from this group and all its topics, send an email to google-web-tool...@googlegroups.com.
To post to this group, send email to google-we...@googlegroups.com.
Visit this group at http://groups.google.com/group/google-web-toolkit.
For more options, visit https://groups.google.com/d/optout.

Jens

unread,
Oct 3, 2014, 1:28:11 PM10/3/14
to google-we...@googlegroups.com
Could it be that your IE 10 runs in compatibility mode? In that case it might not support JavaScript String.replace().

-- J.

Thomas Wrobel

unread,
Oct 3, 2014, 1:38:51 PM10/3/14
to google-we...@googlegroups.com
ah, ok...hmm.
It crashes in EDGE which is selects by default.
It works in 10 if its specifically set to that.
It works in 9 (but other stuff is broken, which is expected)

(This was tested using IE's emulation selector)

Could my html markup be making IE select Edge wrongly?
Isn't Edge supposed to be the newest it can manage?



~~~
Thomas & Bertines online review show:
http://randomreviewshow.com/index.html
Try it! You might even feel ambivalent about it :)

On 3 October 2014 19:28, Jens <jens.ne...@gmail.com> wrote:
Could it be that your IE 10 runs in compatibility mode? In that case it might not support JavaScript String.replace().

-- J.

--

Thomas Wrobel

unread,
Oct 3, 2014, 1:49:10 PM10/3/14
to google-we...@googlegroups.com
Ok, it also works if its left as Edge, but the user agent is explicitly set to "Internet Explorer 10"
Whatever Ie10s default user agent is (ie, not touching the settings) does not work, however.
IE is weird.

It looks like my workaround is simple then; force it to use Ie10 mode and not compatibility?
(although Edge would be better for future proofing wouldn't it?)


~~~
Thomas & Bertines online review show:
http://randomreviewshow.com/index.html
Try it! You might even feel ambivalent about it :)

Steve C

unread,
Oct 4, 2014, 11:32:30 AM10/4/14
to google-we...@googlegroups.com
You should try to get your hands on a real IE10.  My experience with IE11 is that its emulation of earlier versions is far from perfect, particularly with the JS engine.  I've had GWT code that failed in IE11 emulating IE10, but worked fine in a real IE10.

Thomas Wrobel

unread,
Oct 4, 2014, 12:28:20 PM10/4/14
to google-we...@googlegroups.com
Well, it WAS a real IE10 we were testing previously, although it silently upgraded itself so I now need to work out how to downgrade.
Doesn't help though in either cases though - we need this working on IE11 anyway.

So either 
a) How do we force it to use IE10 mode (not "Edge" which seems to be the default)
b) Make JavaScript replace function work on IE11?

The second is naturally preferred. 
My suspicion is still that regardless of IE10 or 11 somehow its being run in compatibility mode, which if thats IE8 would explain problems with Trim().




~~~
Thomas & Bertines online review show:
http://randomreviewshow.com/index.html
Try it! You might even feel ambivalent about it :)

--

Jens

unread,
Oct 4, 2014, 12:43:15 PM10/4/14
to google-we...@googlegroups.com
My suspicion is still that regardless of IE10 or 11 somehow its being run in compatibility mode, which if thats IE8 would explain problems with Trim().

We only have the typical <!DOCTYPE html> at the top of our host page which puts all browsers in standards mode. The only way to get IE into compatibility mode then is to either click the corresponding icon in the browser or add the URL to the compatibility view list in IE settings (http://i.msdn.microsoft.com/dynimg/IC488476.png). We have our load balancers configured to serve a special page if a "compatibility view" user-agent is detected.

Also IE 11 might require IE 10 mode if your app has errors in IE 11 while executing the Firefox permutation. In that case you would add <meta http-equiv="X-UA-Compatible" content="IE=10"> to your head and file a bug on GWT to fix the issue.



-- J.

Brandon Donnelson

unread,
Oct 5, 2014, 12:12:17 PM10/5/14
to google-we...@googlegroups.com
Usually when I see property errors in IE browsers during debugging I always check the compatibility is off or I check the Browser Mode and DOM mode is the latest for the browser. What I find is somehow it switches for one reason or another to an earlier version. Not sure this is an issue but something easy to check. 

darkflame

unread,
Oct 28, 2014, 9:14:42 AM10/28/14
to google-we...@googlegroups.com
Doesn't solve all the mysteries but until ie11 is correctly supported

" <meta http-equiv="X-UA-Compatible" content="IE=10">" does the job for now....ish

The GWT code loads, but some page elements were using features only supported on ie11 (CSS borders, for example).

I don't suppose theres some hybred mode possible? The newest rendering engine while still serving the ie10 code?
Probably break everything else though I guess.
-sigh-
Reply all
Reply to author
Forward
0 new messages