Internet Explorer 11 - compatibility mode

988 views
Skip to first unread message

ckuetbach

unread,
Jun 17, 2014, 12:37:11 PM6/17/14
to google-we...@googlegroups.com
Hello,

I had some trouble with embedded IE11-webviews. The useragent contains msie and the documentMode is 11. This is why they get the IE10 permutation. But the IE11-"browser" has removed some functions in the compat mode. (createStyleSheet for example)

So I used a custom UserAgentPropertyGenerator based on

https://gwt.googlesource.com/gwt/+/2.6.1/user/src/com/google/gwt/useragent/rebind/UserAgentPropertyGenerator.java

to rewrite the binding for IE11. In fact the IE11 compatibility mode is not compatible with older IE.
See: http://msdn.microsoft.com/en-us/library/ie/bg182625(v=vs.85).aspx

I added a new Block before the IE10-code block
  1. // IE11
  2. new UserAgentPropertyGeneratorPredicate("gecko1_8")
  3. .getPredicateBlock()
  4. .println("return ($doc.documentMode >= 11);")
  5. .returns("'gecko1_8'"),
  6. // IE10
The first tests looked good to me. But I am not sure, if I will cause some serious trouble with this approach.

The IE11 will get the gecko1_8 permutation in Standard mode and Compatibility mode now.

There may be errors, if one sets a variable "documentMode=11" onto the document. I may also need to add another condition to the oterh IE-code blocks

return (ua.indexOf('msie') != -1 && ($doc.documentMode >= 10) && $doc.createStyleSheet);

I know I may also get into trouble with IE12. But ....uhm .... One always get into trouble with never IE-versions.


Is there a problem with this approach I don't see?


Thanks,

Christian Kütbach

Eric Metcalf

unread,
Oct 14, 2014, 2:56:26 PM10/14/14
to google-we...@googlegroups.com
We ran into the same problem.  We took a different approach particular to the function no longer being supported.

The DOM.gwt.xml switches user.agents with ie10 or less from StyleInjectorImpl to StyleInjectorImplIE.

In the gwt.xml file we check if the function exists 
return typeof $doc.createStyleSheet === 'function';

If that function does not exist and the user.agent is ie10 or less switch StyleInjectorImpl to IeCompatibilityStyleInjectorImpl.

IeCompatibilityStyleInjectorImpl is a class we created that just extends StyleInjectorImpl.  This was required so that the DOM.gwt.xml doesn't find and try to switch StyleInjectorImpl.

Jens

unread,
Oct 14, 2014, 3:18:56 PM10/14/14
to google-we...@googlegroups.com
Reply all
Reply to author
Forward
0 new messages