As far as I could find out, GWT does officially, but not really support IE7. Apparently there have been some changes to the code that make GWT work with IE7 at all (instead of doing nothing when presented with that browser), but the solutions seems to be to just use IE6 implementations. Check out this thread for more information and check the current UserAgent.gwt.xml ( in gwt-user.jar/com.google.gwt.user).
I haven't tested the bugs I encountered with IE6, so I can't say if it's necessary to recognise IE7 as a separate browser in GWT, but I suspect that a separate implementation will be required sooner or later.
Update: Both issues mentioned here are non-IE7 specific, they also occur in IE6.
But now for the bugs that I found: issues with white-space:nowrap and the preventDefault method on events.
white-space:nowrap
I hit this problem when I used text in tables that I wanted to stay in one line even when the surrounding element (in this case a td) did have less width than the text (thus the nowrap). The markup worked fine in FireFox, but IE7 ignored the white-space property, breaking text to the width of the td element.
After some tests it seems I can classify nowrap behaviour into three areas:
- overflow: when used on a div with fixed width, nowrap causes the text to be in one line, overflowing the border of the div, which keeps its set width. Divs display the same behaviour in IE7 and FireFox.
- expansion: when used on a td element with fixed width in FireFox, nowrap causes the text to be in one line and the table cell expanded to encompass the text's width. (This behaviour is also displayed by both browsers when using a span element with set width and nowrap)
- wrapping: when used on a td element with fixed width in IE7, nowrap is ignored and the text broken into several lines, the table cell keeps its original width.
The problem can be fixed in IE7 by surrounding the text in the table cell with an additional span element upon which the fixed width and nowrap attributed are applied. However, this increases the element load and can, when used with a lot of text, cause a slowdown of the application.
Additionally, since there is no way to fix IE7 bugs specifically in GWT (without hacking the UserAgent.gwt.xml), the workaround cannot be included directly into GWT for IE7 alone. This results in the HTMLTable.CellFormatter.setWordWrap() method to fail silently in IE7.
preventDefault
Another issue I encountered when using GWT with IE7 was the DOM.eventPreventDefault(); method, or rather it not working. I use this method to prevent the selection of text on mouse down, but IE7 ignores it. I haven't tested this issue yet, but my guess would be that IE7 implementation actually fixed the incorrect behaviour displayed by IE6 (IE6 required the event handling method to return false to prevent an event from its default action instead of calling preventDefault() on it as is standard). Since GWT uses its IE6 implementation for IE7 however, the method returns false, and preventDefault() is not used on the event.
Update: This is not a general preventDefault problem but limited to text selection and works the same in both IE6 and IE7. A workaround is to set
element.onselectstart= function(){return false};
No comments:
Post a Comment