From 3c0d1c8bc5d6c9a0da1ef06a5a62d621b18f0e52 Mon Sep 17 00:00:00 2001 From: Artur Signell Date: Tue, 8 Feb 2011 15:33:38 +0000 Subject: #6336 IE8 in compatibility mode does not work svn changeset:17226/svn branch:6.5 --- .../gwt/server/AbstractApplicationServlet.java | 35 +++++++++++++++------- 1 file changed, 24 insertions(+), 11 deletions(-) (limited to 'src/com/vaadin/terminal') diff --git a/src/com/vaadin/terminal/gwt/server/AbstractApplicationServlet.java b/src/com/vaadin/terminal/gwt/server/AbstractApplicationServlet.java index bf3ba8f759..c1df8cb40d 100644 --- a/src/com/vaadin/terminal/gwt/server/AbstractApplicationServlet.java +++ b/src/com/vaadin/terminal/gwt/server/AbstractApplicationServlet.java @@ -1622,9 +1622,9 @@ public abstract class AbstractApplicationServlet extends HttpServlet implements if (!fragment) { setAjaxPageHeaders(response); - writeAjaxPageHtmlHeadStart(page); - writeAjaxPageHtmlHeader(page, title, themeUri); - writeAjaxPageHtmlBodyStart(page); + writeAjaxPageHtmlHeadStart(page, request); + writeAjaxPageHtmlHeader(page, title, themeUri, request); + writeAjaxPageHtmlBodyStart(page, request); } String appId = appUrl; @@ -1913,10 +1913,11 @@ public abstract class AbstractApplicationServlet extends HttpServlet implements * Override this method if you want to add some custom html to the page. * * @param page + * @param request * @throws IOException */ - protected void writeAjaxPageHtmlBodyStart(final BufferedWriter page) - throws IOException { + protected void writeAjaxPageHtmlBodyStart(final BufferedWriter page, + final HttpServletRequest request) throws IOException { page.write("\n\n\n"); } @@ -1930,15 +1931,26 @@ public abstract class AbstractApplicationServlet extends HttpServlet implements * @param page * @param title * @param themeUri + * @param request * @throws IOException */ protected void writeAjaxPageHtmlHeader(final BufferedWriter page, - String title, String themeUri) throws IOException { + String title, String themeUri, final HttpServletRequest request) + throws IOException { page.write("\n"); - // Force IE9 into IE8 mode. Remove when IE 9 mode works (#5546), chrome - // frame if available #5261 - page.write("\n"); + WebBrowser browser = getApplicationContext(request.getSession()) + .getBrowser(); + if (browser.isIE()) { + // Chrome frame in all versions of IE (only if Chrome frame is + // installed) + if (browser.getBrowserMajorVersion() == 9) { + // Force IE9 into IE8 mode. Remove when IE 9 mode works (#5546) + page.write("\n"); + } else { + page.write("\n"); + } + } page.write(""); @@ -1962,10 +1974,11 @@ public abstract class AbstractApplicationServlet extends HttpServlet implements * beginning of the page. * * @param page + * @param request * @throws IOException */ - protected void writeAjaxPageHtmlHeadStart(final BufferedWriter page) - throws IOException { + protected void writeAjaxPageHtmlHeadStart(final BufferedWriter page, + final HttpServletRequest request) throws IOException { // write html header page.write("