]> source.dussan.org Git - vaadin-framework.git/commitdiff
Fix for #2879 - IE8: IE7 CSS classname should be added to BODY in IE7 Standards mode.
authorArtur Signell <artur.signell@itmill.com>
Thu, 30 Apr 2009 10:36:02 +0000 (10:36 +0000)
committerArtur Signell <artur.signell@itmill.com>
Thu, 30 Apr 2009 10:36:02 +0000 (10:36 +0000)
svn changeset:7591/svn branch:6.0

src/com/itmill/toolkit/terminal/gwt/client/BrowserInfo.java

index 0cfc49e87921086722efe4183d4373e467f2c0ae..42e44d037455abebe41a60aa82bd11242fc43193 100644 (file)
@@ -96,12 +96,12 @@ public class BrowserInfo {
      * Examples: Internet Explorer 6: ".i-ie .i-ie6", Firefox 3.0.4:
      * ".i-ff .i-ff3", Opera 9.60: ".i-op .i-op96"
      * 
-     * @param prefix
-     *            a prefix to add to the classnames
      * @return
      */
     public String getCSSClass() {
         String prefix = "i-";
+        boolean ie8 = false;
+
         if (cssClass == null) {
             String bs = getBrowserString().toLowerCase();
             String b = "";
@@ -121,13 +121,25 @@ public class BrowserInfo {
             } else if (bs.indexOf(" msie ") != -1) {
                 b = "ie";
                 int i = bs.indexOf(" msie ") + 6;
-                v = b + bs.substring(i, i + 1);
+                String ieVersion = bs.substring(i, i + 1);
+                v = b + ieVersion;
+
+                // This adds .i-ie7 for ie8 also.
+                // TODO Remove this when IE8 is no longer run in compatibility
+                // mode
+                if (ieVersion != null && ieVersion.equals("8")) {
+                    ie8 = true;
+                }
+
             } else if (bs.indexOf("opera/") != -1) {
                 b = "op";
                 int i = bs.indexOf("opera/") + 6;
                 v = b + bs.substring(i, i + 3).replace(".", "");
             }
             cssClass = prefix + b + " " + prefix + v;
+            if (ie8) {
+                cssClass += " " + prefix + "ie7";
+            }
         }
 
         return cssClass;