From 2faf4a68e71e27fd77e01f38b6f8b04171cadec8 Mon Sep 17 00:00:00 2001 From: "darin%netscape.com" Date: Thu, 27 Sep 2001 01:42:06 +0000 Subject: [PATCH] fixes bug 95768 "about: services should be converted to XHTML 1.1" patch=alexey@ihug.com.au, r=cbiesinger@web.de, sr=darin,jst --- l10n/us/xp/mozilla.html | 36 ------------ netwerk/protocol/about/src/nsAboutCache.cpp | 55 ++++++++++--------- .../protocol/about/src/nsAboutCacheEntry.cpp | 26 +++++---- xpfe/global/resources/content/mozilla.html | 42 +++++++------- xpfe/global/resources/content/mozilla.xhtml | 42 +++++++------- xpfe/global/resources/locale/en-US/about.html | 31 ++++++++--- .../global/resources/locale/en-US/about.xhtml | 31 ++++++++--- 7 files changed, 135 insertions(+), 128 deletions(-) diff --git a/l10n/us/xp/mozilla.html b/l10n/us/xp/mozilla.html index ea3dacf0ec3..e69de29bb2d 100644 --- a/l10n/us/xp/mozilla.html +++ b/l10n/us/xp/mozilla.html @@ -1,36 +0,0 @@ - - -The Book of Mozilla, 3:31 - -
- -







- -And the beast shall be made legion. Its numbers shall -be increased a thousand thousand fold. The din of a -million keyboards like unto a great storm shall cover -the earth, and the followers of Mammon shall tremble. - -

-from The Book of Mozilla, 3:31
-(Red Letter Edition) diff --git a/netwerk/protocol/about/src/nsAboutCache.cpp b/netwerk/protocol/about/src/nsAboutCache.cpp index dee872e4f72..a8643375ee2 100644 --- a/netwerk/protocol/about/src/nsAboutCache.cpp +++ b/netwerk/protocol/about/src/nsAboutCache.cpp @@ -18,6 +18,7 @@ * Rights Reserved. * * Contributor(s): + * Alexey Chernyak (XHTML 1.1 conversion) * Henrik Gemal * Darin Fisher */ @@ -90,7 +91,6 @@ nsAboutCache::NewChannel(nsIURI *aURI, nsIChannel **result) nsCOMPtr storageStream; nsCOMPtr outputStream; - nsCString buffer; // Init: (block size, maximum length) rv = NS_NewStorageStream(256, (PRUint32)-1, getter_AddRefs(storageStream)); @@ -99,7 +99,12 @@ nsAboutCache::NewChannel(nsIURI *aURI, nsIChannel **result) rv = storageStream->GetOutputStream(0, getter_AddRefs(outputStream)); if (NS_FAILED(rv)) return rv; - mBuffer.Assign("\n\nInformation about the Cache Service\n\n\n"); + mBuffer.Assign("\n" + "\n" + "\n" + "\nInformation about the Cache Service\n\n" + "\n

\n"); outputStream->Write(mBuffer, mBuffer.Length(), &bytesWritten); @@ -110,7 +115,11 @@ nsAboutCache::NewChannel(nsIURI *aURI, nsIChannel **result) rv = cacheService->VisitEntries(this); if (NS_FAILED(rv)) return rv; - mBuffer.Assign("\n\n"); + mBuffer.Truncate(0); + if (!mDeviceID.IsEmpty()) { + mBuffer.Append("\n"); + } + mBuffer.Append("
\n\n\n"); outputStream->Write(mBuffer, mBuffer.Length(), &bytesWritten); nsCOMPtr inStr; @@ -148,27 +157,27 @@ nsAboutCache::VisitDevice(const char *deviceID, mBuffer.Assign("

"); mBuffer.Append(str); - mBuffer.Append("


\n"); + mBuffer.Append("\n
\n"); // Write out cache info mBuffer.Append("\n"); - mBuffer.Append("\n\n"); + mBuffer.Append("\n\n\n"); value = 0; deviceInfo->GetEntryCount(&value); mBuffer.Append("\n\n"); - mBuffer.Append("\n\n"); + mBuffer.Append("\n\n\n"); value = 0; deviceInfo->GetMaximumSize(&value); mBuffer.Append("\n\n"); - mBuffer.Append("\n\n"); + mBuffer.Append("\n\n\n"); mBuffer.Append("" TD_RIGHT_ALIGN ""); \ + buffer.Append("\n
Number of entries:
Number of entries: "); mBuffer.AppendInt(value); mBuffer.Append("
Maximum storage size:
Maximum storage size: "); mBuffer.AppendInt(value); mBuffer.Append(" Bytes
Storage in use:
Storage in use: "); value = 0; deviceInfo->GetTotalSize(&value); @@ -179,17 +188,18 @@ nsAboutCache::VisitDevice(const char *deviceID, deviceInfo->GetUsageReport(getter_Copies(str)); mBuffer.Append(str); - mBuffer.Append("\n
"); + mBuffer.Append("\n
"); if (mDeviceID.IsEmpty()) { mBuffer.Append("\nList Cache Entries\n"); + mBuffer.Append("
\n"); } else { *visitEntries = PR_TRUE; + mBuffer.Append("
\n
\n");
         }
         
-        mBuffer.Append("
\n"); mStream->Write(mBuffer, mBuffer.Length(), &bytesWritten); } @@ -220,56 +230,50 @@ nsAboutCache::VisitEntry(const char *deviceID, nsCAutoString url; url += NS_LITERAL_CSTRING("about:cache-entry?client="); url += clientID; - url += NS_LITERAL_CSTRING("&sb="); + url += NS_LITERAL_CSTRING("&sb="); url += streamBased ? "1" : "0"; - url += NS_LITERAL_CSTRING("&key="); + url += NS_LITERAL_CSTRING("&key="); url += key; // key // Entry start... - mBuffer.Assign("

\n"); // URI - mBuffer.Append("       " - "    Key: "); - mBuffer.Append(" Key: "); mBuffer.Append(key); - mBuffer.Append("
\n"); + mBuffer.Append(""); // Content length PRUint32 length = 0; entryInfo->GetDataSize(&length); - mBuffer.Append("     Data size: "); + mBuffer.Append("\n Data size: "); mBuffer.AppendInt(length); - mBuffer.Append(" Bytes
\n"); + mBuffer.Append(" Bytes"); // Number of accesses PRInt32 fetchCount = 0; entryInfo->GetFetchCount(&fetchCount); - mBuffer.Append("   Fetch count: "); + mBuffer.Append("\n Fetch count: "); mBuffer.AppendInt(fetchCount); - mBuffer.Append("
\n"); // vars for reporting time char buf[255]; PRUint32 t; // Last modified time - mBuffer.Append(" Last Modified: "); + mBuffer.Append("\n Last Modified: "); entryInfo->GetLastModified(&t); if (t) { PrintTimeString(buf, sizeof(buf), t); mBuffer.Append(buf); } else mBuffer.Append("No last modified time"); - mBuffer.Append("
"); // Expires time - mBuffer.Append("       " - "Expires: "); + mBuffer.Append("\n Expires: "); entryInfo->GetExpirationTime(&t); if (t) { PrintTimeString(buf, sizeof(buf), t); @@ -277,10 +281,9 @@ nsAboutCache::VisitEntry(const char *deviceID, } else { mBuffer.Append("No expiration time"); } - mBuffer.Append("
"); // Entry is done... - mBuffer.Append("

\n"); + mBuffer.Append("\n\n"); mStream->Write(mBuffer, mBuffer.Length(), &bytesWritten); diff --git a/netwerk/protocol/about/src/nsAboutCacheEntry.cpp b/netwerk/protocol/about/src/nsAboutCacheEntry.cpp index 5495fb5ffec..7c3a91b6812 100644 --- a/netwerk/protocol/about/src/nsAboutCacheEntry.cpp +++ b/netwerk/protocol/about/src/nsAboutCacheEntry.cpp @@ -19,6 +19,7 @@ * * Contributor(s): * Darin Fisher (original author) + * Alexey Chernyak (XHTML 1.1 conversion) */ #include @@ -80,7 +81,14 @@ nsAboutCacheEntry::OnCacheEntryAvailable(nsICacheEntryDescriptor *descriptor, rv = storageStream->GetOutputStream(0, getter_AddRefs(outputStream)); if (NS_FAILED(rv)) return rv; - buffer.Assign("\n\nCache entry information\n\n\n"); + buffer.Assign("\n" + "\n" + "\n" + "\nCache entry information\n" + "\n\n\n"); outputStream->Write(buffer, buffer.Length(), &n); if (NS_SUCCEEDED(status)) @@ -340,11 +348,9 @@ static void PrintTimeString(char *buf, PRUint32 bufsize, PRUint32 t_sec) PR_FormatTime(buf, bufsize, "%c", &et); } -#define TD_RIGHT_ALIGN "
" - #define APPEND_ROW(label, value) \ PR_BEGIN_MACRO \ - buffer.Append("
"); \ buffer.Append(label); \ buffer.Append(":
"); \
     buffer.Append(value); \
@@ -366,7 +372,7 @@ nsAboutCacheEntry::WriteCacheEntryDescription(nsIOutputStream *outputStream,
     
     buffer.Assign("");
 
-    buffer.Append("" TD_RIGHT_ALIGN "key:");
+    buffer.Append("\n");
 
 
     // temp vars for reporting
@@ -447,10 +453,10 @@ nsAboutCacheEntry::WriteCacheEntryDescription(nsIOutputStream *outputStream,
                    "This document does not have any security info associated with it.");
     }
 
-    buffer.Append("
"); + buffer.Append("
key:"); // Test if the key is actually a URI nsCOMPtr uri; @@ -381,7 +387,7 @@ nsAboutCacheEntry::WriteCacheEntryDescription(nsIOutputStream *outputStream, } else buffer.Append(str); - buffer.Append("
"); + buffer.Append("
\n"); // Meta Data // let's just look for some well known (HTTP) meta data tags, for now. - buffer.Append("
"); + buffer.Append("
\n
"); // Client ID str.Adopt(0); @@ -463,7 +469,7 @@ nsAboutCacheEntry::WriteCacheEntryDescription(nsIOutputStream *outputStream, mBuffer = nsnull; - buffer.Append("
"); + buffer.Append("\n"); outputStream->Write(buffer, buffer.Length(), &n); return NS_OK; @@ -539,7 +545,7 @@ nsAboutCacheEntry::VisitMetaDataElement(const char * key, const char * value, PRBool * keepGoing) { - mBuffer->Append(""); + mBuffer->Append(""); mBuffer->Append(key); mBuffer->Append(":\n
");
     mBuffer->Append(value);
diff --git a/xpfe/global/resources/content/mozilla.html b/xpfe/global/resources/content/mozilla.html
index 7146b7afbf9..6b12313da4c 100644
--- a/xpfe/global/resources/content/mozilla.html
+++ b/xpfe/global/resources/content/mozilla.html
@@ -1,3 +1,7 @@
+
+
+
 
-
+
+
 
 The Book of Mozilla, 3:31
 
 
 
 
-
-And the beast shall be made legion. Its numbers shall -be increased a thousand thousand fold. The din of a -million keyboards like unto a great storm shall cover -the earth, and the followers of Mammon shall tremble. +
+And the beast shall be made legion. Its numbers shall +be increased a thousand thousand fold. The din of a +million keyboards like unto a great storm shall cover +the earth, and the followers of Mammon shall tremble.
-
-
from The Book of Mozilla, 3:31
+
+from The Book of Mozilla, 3:31
(Red Letter Edition)
- diff --git a/xpfe/global/resources/content/mozilla.xhtml b/xpfe/global/resources/content/mozilla.xhtml index 7146b7afbf9..6b12313da4c 100644 --- a/xpfe/global/resources/content/mozilla.xhtml +++ b/xpfe/global/resources/content/mozilla.xhtml @@ -1,3 +1,7 @@ + + + - + + The Book of Mozilla, 3:31 -
-And the beast shall be made legion. Its numbers shall -be increased a thousand thousand fold. The din of a -million keyboards like unto a great storm shall cover -the earth, and the followers of Mammon shall tremble. +
+And the beast shall be made legion. Its numbers shall +be increased a thousand thousand fold. The din of a +million keyboards like unto a great storm shall cover +the earth, and the followers of Mammon shall tremble.
-
-
from The Book of Mozilla, 3:31
+
+from The Book of Mozilla, 3:31
(Red Letter Edition)
- diff --git a/xpfe/global/resources/locale/en-US/about.html b/xpfe/global/resources/locale/en-US/about.html index 3ebb00a452d..e3b99b15912 100644 --- a/xpfe/global/resources/locale/en-US/about.html +++ b/xpfe/global/resources/locale/en-US/about.html @@ -1,3 +1,6 @@ + + About: + - + -
@@ -66,7 +83,6 @@ University of California. All Rights Reserved.

- U.S. GOVERNMENT END USERS. The Software is a "commercial item," as that term is defined in 48 C.F.R. 2.101 (Oct. 1995), consisting of "commercial computer software" and "commercial computer software @@ -74,7 +90,6 @@ documentation," as such terms are used in 48 C.F.R. 12.212 (Sept. 1995). Consistent with 48 C.F.R. 12.212 and 48 C.F.R. 227.7202-1 through 227.7202-4 (June 1995), all U.S. Government End Users acquire the Software with only those rights set forth herein. -

diff --git a/xpfe/global/resources/locale/en-US/about.xhtml b/xpfe/global/resources/locale/en-US/about.xhtml index 3ebb00a452d..e3b99b15912 100644 --- a/xpfe/global/resources/locale/en-US/about.xhtml +++ b/xpfe/global/resources/locale/en-US/about.xhtml @@ -1,3 +1,6 @@ + + About: + - + -
@@ -66,7 +83,6 @@ University of California. All Rights Reserved.

- U.S. GOVERNMENT END USERS. The Software is a "commercial item," as that term is defined in 48 C.F.R. 2.101 (Oct. 1995), consisting of "commercial computer software" and "commercial computer software @@ -74,7 +90,6 @@ documentation," as such terms are used in 48 C.F.R. 12.212 (Sept. 1995). Consistent with 48 C.F.R. 12.212 and 48 C.F.R. 227.7202-1 through 227.7202-4 (June 1995), all U.S. Government End Users acquire the Software with only those rights set forth herein. -