diff options
author | John Ahlroos <john@vaadin.com> | 2012-09-07 10:09:02 +0300 |
---|---|---|
committer | John Ahlroos <john@vaadin.com> | 2012-09-07 10:23:35 +0300 |
commit | 074b1095ee302af67626055820853ed1b8a4ea86 (patch) | |
tree | a6a6c72465748cb97fc83f5a84f37e151b7618de /server | |
parent | 4222b99bf020c8d7a3d49f4105507be4308cddd2 (diff) | |
download | vaadin-framework-074b1095ee302af67626055820853ed1b8a4ea86.tar.gz vaadin-framework-074b1095ee302af67626055820853ed1b8a4ea86.zip |
Now using HTML5 content mode. Also deprecated the XHTML content modes.
Diffstat (limited to 'server')
-rw-r--r-- | server/src/com/vaadin/server/AbstractErrorMessage.java | 15 | ||||
-rw-r--r-- | server/src/com/vaadin/server/BootstrapHandler.java | 7 | ||||
-rw-r--r-- | server/src/com/vaadin/server/SystemError.java | 4 | ||||
-rw-r--r-- | server/src/com/vaadin/server/UserError.java | 4 | ||||
-rw-r--r-- | server/src/com/vaadin/ui/Label.java | 5 | ||||
-rw-r--r-- | server/src/com/vaadin/ui/LoginForm.java | 5 |
6 files changed, 24 insertions, 16 deletions
diff --git a/server/src/com/vaadin/server/AbstractErrorMessage.java b/server/src/com/vaadin/server/AbstractErrorMessage.java index 4e30dff06f..3ab0e73c8a 100644 --- a/server/src/com/vaadin/server/AbstractErrorMessage.java +++ b/server/src/com/vaadin/server/AbstractErrorMessage.java @@ -1,4 +1,4 @@ -/* +/* * Copyright 2011 Vaadin Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not @@ -43,9 +43,19 @@ public abstract class AbstractErrorMessage implements ErrorMessage { * Content mode, where the error contains preformatted text. */ PREFORMATTED, + + /** + * Content mode, where the error contains XHTML. + * + */ + HTML, + /** * Content mode, where the error contains XHTML. + * + * @deprecated Use {@link ContentMode.HTML} */ + @Deprecated XHTML; } @@ -116,6 +126,7 @@ public abstract class AbstractErrorMessage implements ErrorMessage { + "</pre>"; break; case XHTML: + case HTML: result = getMessage(); break; } @@ -151,7 +162,7 @@ public abstract class AbstractErrorMessage implements ErrorMessage { } else if (t instanceof Validator.InvalidValueException) { UserError error = new UserError( ((Validator.InvalidValueException) t).getHtmlMessage(), - ContentMode.XHTML, ErrorLevel.ERROR); + ContentMode.HTML, ErrorLevel.ERROR); for (Validator.InvalidValueException nestedException : ((Validator.InvalidValueException) t) .getCauses()) { error.addCause(getErrorMessageForException(nestedException)); diff --git a/server/src/com/vaadin/server/BootstrapHandler.java b/server/src/com/vaadin/server/BootstrapHandler.java index 491830fb81..1301978fd4 100644 --- a/server/src/com/vaadin/server/BootstrapHandler.java +++ b/server/src/com/vaadin/server/BootstrapHandler.java @@ -200,10 +200,9 @@ public abstract class BootstrapHandler implements RequestHandler { Document document = response.getDocument(); - DocumentType doctype = new DocumentType("html", - "-//W3C//DTD XHTML 1.0 Transitional//EN", - "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd", + DocumentType doctype = new DocumentType("html", "", "", document.baseUri()); + document.child(0).before(doctype); document.body().parent().attr("xmlns", "http://www.w3.org/1999/xhtml"); @@ -303,7 +302,7 @@ public abstract class BootstrapHandler implements RequestHandler { * .v-app-loading * .v-app-<simpleName for app class> *- Additionally added from javascript: - * .v-theme-<themeName, remove non-alphanum> + * .v-theme-<themeName, remove non-alphanum> */ String appClass = "v-app-" diff --git a/server/src/com/vaadin/server/SystemError.java b/server/src/com/vaadin/server/SystemError.java index aa9ffcaf52..14fc0831a4 100644 --- a/server/src/com/vaadin/server/SystemError.java +++ b/server/src/com/vaadin/server/SystemError.java @@ -1,4 +1,4 @@ -/* +/* * Copyright 2011 Vaadin Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not @@ -40,7 +40,7 @@ public class SystemError extends AbstractErrorMessage { public SystemError(String message) { super(message); setErrorLevel(ErrorLevel.SYSTEMERROR); - setMode(ContentMode.XHTML); + setMode(ContentMode.HTML); setMessage(getHtmlMessage()); } diff --git a/server/src/com/vaadin/server/UserError.java b/server/src/com/vaadin/server/UserError.java index 756f2e70e0..c59eb382ee 100644 --- a/server/src/com/vaadin/server/UserError.java +++ b/server/src/com/vaadin/server/UserError.java @@ -1,4 +1,4 @@ -/* +/* * Copyright 2011 Vaadin Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not @@ -39,7 +39,7 @@ public class UserError extends AbstractErrorMessage { public static final ContentMode CONTENT_PREFORMATTED = ContentMode.PREFORMATTED; /** - * @deprecated from 7.0, use {@link ContentMode#XHTML} instead + * @deprecated from 7.0, use {@link ContentMode#HTML} instead */ @Deprecated public static final ContentMode CONTENT_XHTML = ContentMode.XHTML; diff --git a/server/src/com/vaadin/ui/Label.java b/server/src/com/vaadin/ui/Label.java index 86cbdb3253..b3a6f43e64 100644 --- a/server/src/com/vaadin/ui/Label.java +++ b/server/src/com/vaadin/ui/Label.java @@ -1,4 +1,4 @@ -/* +/* * Copyright 2011 Vaadin Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not @@ -414,7 +414,8 @@ public class Label extends AbstractComponent implements Property<String>, } if (getContentMode() == ContentMode.XHTML - || getContentMode() == ContentMode.XML) { + || getContentMode() == ContentMode.XML + || getContentMode() == ContentMode.HTML) { return stripTags(stringValue); } else { return stringValue; diff --git a/server/src/com/vaadin/ui/LoginForm.java b/server/src/com/vaadin/ui/LoginForm.java index 2e372e8512..69778c4c07 100644 --- a/server/src/com/vaadin/ui/LoginForm.java +++ b/server/src/com/vaadin/ui/LoginForm.java @@ -135,10 +135,7 @@ public class LoginForm extends CustomComponent { String appUri = getSession().getURL().toString(); try { - return ("<!DOCTYPE html PUBLIC \"-//W3C//DTD " - + "XHTML 1.0 Transitional//EN\" " - + "\"http://www.w3.org/TR/xhtml1/" - + "DTD/xhtml1-transitional.dtd\">\n" + "<html>" + return ("<!DOCTYPE html>\n" + "<html>" + "<head><script type='text/javascript'>" + "var setTarget = function() {" + "var uri = '" + appUri |