tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From micha...@apache.org
Subject [tomcat] branch 7.0.x updated: BZ 63905: Clean up Tomcat CSS
Date Fri, 08 Nov 2019 22:51:24 GMT
This is an automated email from the ASF dual-hosted git repository.

michaelo pushed a commit to branch 7.0.x
in repository https://gitbox.apache.org/repos/asf/tomcat.git


The following commit(s) were added to refs/heads/7.0.x by this push:
     new 4b78394  BZ 63905: Clean up Tomcat CSS
4b78394 is described below

commit 4b78394123e9cb4aeeaec6ed113b2bee5cca8e1a
Author: Michael Osipov <michaelo@apache.org>
AuthorDate: Thu Nov 7 22:21:27 2019 +0100

    BZ 63905: Clean up Tomcat CSS
    
    Remove duplication in Tomcat CSS and align its usage which applies to
    ErrorReportValve, and several servlets. Also update update incorrect
    documentation as well.
---
 java/org/apache/catalina/servlets/DefaultServlet.java | 16 ++++++++++------
 java/org/apache/catalina/util/TomcatCSS.java          | 19 ++++++++-----------
 webapps/docs/changelog.xml                            |  3 +++
 webapps/docs/config/valve.xml                         |  2 +-
 4 files changed, 22 insertions(+), 18 deletions(-)

diff --git a/java/org/apache/catalina/servlets/DefaultServlet.java b/java/org/apache/catalina/servlets/DefaultServlet.java
index 5a5eddd..1b95f95 100644
--- a/java/org/apache/catalina/servlets/DefaultServlet.java
+++ b/java/org/apache/catalina/servlets/DefaultServlet.java
@@ -1482,14 +1482,18 @@ public class DefaultServlet extends HttpServlet {
         String rewrittenContextPath =  rewriteUrl(contextPath);
 
         // Render the page header
-        sb.append("<html>\r\n");
+        sb.append("<!doctype html><html>\r\n");
+        /* TODO Activate this as soon as we use smClient with the request locales
+        sb.append("<!doctype html><html lang=\"");
+        sb.append(smClient.getLocale().getLanguage()).append("\">\r\n");
+        */
         sb.append("<head>\r\n");
         sb.append("<title>");
         sb.append(sm.getString("directory.title", name));
         sb.append("</title>\r\n");
-        sb.append("<STYLE><!--");
+        sb.append("<style>");
         sb.append(org.apache.catalina.util.TomcatCSS.TOMCAT_CSS);
-        sb.append("--></STYLE> ");
+        sb.append("</style> ");
         sb.append("</head>\r\n");
         sb.append("<body>");
         sb.append("<h1>");
@@ -1519,7 +1523,7 @@ public class DefaultServlet extends HttpServlet {
         }
 
         sb.append("</h1>");
-        sb.append("<HR size=\"1\" noshade=\"noshade\">");
+        sb.append("<hr class=\"line\">");
 
         sb.append("<table width=\"100%\" cellspacing=\"0\"" +
                      " cellpadding=\"5\" align=\"center\">\r\n");
@@ -1599,12 +1603,12 @@ public class DefaultServlet extends HttpServlet {
         // Render the page footer
         sb.append("</table>\r\n");
 
-        sb.append("<HR size=\"1\" noshade=\"noshade\">");
+        sb.append("<hr class=\"line\">");
 
         String readme = getReadme(cacheEntry.context);
         if (readme!=null) {
             sb.append(readme);
-            sb.append("<HR size=\"1\" noshade=\"noshade\">");
+            sb.append("<hr class=\"line\">");
         }
 
         if (showServerInfo) {
diff --git a/java/org/apache/catalina/util/TomcatCSS.java b/java/org/apache/catalina/util/TomcatCSS.java
index 89084b7..93f15a9 100644
--- a/java/org/apache/catalina/util/TomcatCSS.java
+++ b/java/org/apache/catalina/util/TomcatCSS.java
@@ -22,16 +22,13 @@ package org.apache.catalina.util;
 public class TomcatCSS {
 
     public static final String TOMCAT_CSS =
-        "H1 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:22px;}
" +
-        "H2 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:16px;}
" +
-        "H3 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:14px;}
" +
-        "BODY {font-family:Tahoma,Arial,sans-serif;color:black;background-color:white;} "
+
-        "B {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;} "
+
-        "P {font-family:Tahoma,Arial,sans-serif;background:white;color:black;font-size:12px;}"
+
-        "A {color : black;}" +
-        "A.name {color : black;}" +
-        "HR {color : #525D76;}";
-
+        "body {font-family:Tahoma,Arial,sans-serif;} " +
+        "h1, h2, h3, b {color:white;background-color:#525D76;} " +
+        "h1 {font-size:22px;} " +
+        "h2 {font-size:16px;} " +
+        "h3 {font-size:14px;} " +
+        "p {font-size:12px;} " +
+        "a {color:black;} " +
+        ".line {height:1px;background-color:#525D76;border:none;}";
 
 }
-
diff --git a/webapps/docs/changelog.xml b/webapps/docs/changelog.xml
index cd1a8f0..3c1af27 100644
--- a/webapps/docs/changelog.xml
+++ b/webapps/docs/changelog.xml
@@ -70,6 +70,9 @@
         Make a best efforts attempt to clean-up if a request fails during
         processing due to an <code>OutOfMemoryException</code>. (markt)
       </fix>
+      <update>
+        <bug>63905</bug> Clean up Tomcat CSS. (michaelo)
+      </update>
     </changelog>
   </subsection>
   <subsection name="Coyote">
diff --git a/webapps/docs/config/valve.xml b/webapps/docs/config/valve.xml
index 288020e..5a9f671 100644
--- a/webapps/docs/config/valve.xml
+++ b/webapps/docs/config/valve.xml
@@ -1750,7 +1750,7 @@
     for HTTP status codes that will generate and return HTML error pages.</p>
 
     <p><strong>NOTE:</strong> Disabling both showServerInfo and showReport
will
-    only return the HTTP status code and remove all CSS.</p>
+    only return the HTTP status code.</p>
 
   </subsection>
 


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


Mime
View raw message