diff options
-rw-r--r-- | client/src/com/vaadin/client/ui/label/LabelConnector.java | 1 | ||||
-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 | ||||
-rw-r--r-- | shared/src/com/vaadin/shared/ui/label/ContentMode.java | 12 |
8 files changed, 35 insertions, 18 deletions
diff --git a/client/src/com/vaadin/client/ui/label/LabelConnector.java b/client/src/com/vaadin/client/ui/label/LabelConnector.java index 33ec07b9f2..b52809c90e 100644 --- a/client/src/com/vaadin/client/ui/label/LabelConnector.java +++ b/client/src/com/vaadin/client/ui/label/LabelConnector.java @@ -58,6 +58,7 @@ public class LabelConnector extends AbstractComponentConnector { break; case XHTML: + case HTML: case RAW: sinkOnloads = true; case XML: 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 diff --git a/shared/src/com/vaadin/shared/ui/label/ContentMode.java b/shared/src/com/vaadin/shared/ui/label/ContentMode.java index 1927b6c01b..3e6e5b8e45 100644 --- a/shared/src/com/vaadin/shared/ui/label/ContentMode.java +++ b/shared/src/com/vaadin/shared/ui/label/ContentMode.java @@ -15,6 +15,7 @@ */ package com.vaadin.shared.ui.label; + /** * Content modes defining how the client should interpret a Label's value. * @@ -33,9 +34,16 @@ public enum ContentMode { PREFORMATTED, /** - * Content mode, where the label contains XHTML. Care should be taken to - * ensure + * Content mode, where the label contains HTML. + */ + HTML, + + /** + * Content mode, where the label contains XHTML. + * + * @deprecated Use {@link ContentMode.HTML} */ + @Deprecated XHTML, /** |