fixes bug 95768 "about: services should be converted to XHTML 1.1"

patch=alexey@ihug.com.au, r=cbiesinger@web.de, sr=darin,jst
This commit is contained in:
darin%netscape.com 2001-09-27 01:42:06 +00:00
Родитель 8a2f92055f
Коммит 2faf4a68e7
7 изменённых файлов: 135 добавлений и 128 удалений

Просмотреть файл

@ -1,36 +0,0 @@
<!-- -*- Mode: HTML; tab-width: 8; indent-tabs-mode: nil -*-
The contents of this file are subject to the Netscape Public
License Version 1.1 (the "License"); you may not use this file
except in compliance with the License. You may obtain a copy of
the License at http://www.mozilla.org/NPL/
Software distributed under the License is distributed on an "AS
IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
implied. See the License for the specific language governing
rights and limitations under the License.
The Original Code is mozilla.org code.
The Initial Developer of the Original Code is Netscape
Communications Corporation. Portions created by Netscape are
Copyright (C) 1998 Netscape Communications Corporation. All
Rights Reserved.
Contributor(s):
-->
<HEAD>
<TITLE>The Book of Mozilla, 3:31</TITLE>
<BODY bgcolor="#800000" text="#FFFFFF">
<CENTER>
<FONT size=4><I>
<BR><BR><BR><BR><BR><BR><BR><BR>
And the beast shall be made <FONT size="+2">legion</FONT>. Its numbers shall
be increased a <FONT size="+2">thousand thousand</FONT> fold. The din of a
million keyboards like unto a great <FONT size="+2">storm</FONT> shall cover
the earth, and the followers of Mammon shall <FONT size="+2">tremble.</FONT>
<P ALIGN=RIGHT>
<FONT SIZE=6>from <B>The Book of Mozilla,</B> 3:31</FONT><BR>
<FONT SIZE=5>(Red Letter Edition)</FONT>

Просмотреть файл

@ -18,6 +18,7 @@
* Rights Reserved.
*
* Contributor(s):
* Alexey Chernyak <alexeyc@bigfoot.com> (XHTML 1.1 conversion)
* Henrik Gemal <gemal@gemal.dk>
* Darin Fisher <darin@netscape.com>
*/
@ -90,7 +91,6 @@ nsAboutCache::NewChannel(nsIURI *aURI, nsIChannel **result)
nsCOMPtr<nsIStorageStream> storageStream;
nsCOMPtr<nsIOutputStream> 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("<html>\n<head>\n<title>Information about the Cache Service</title>\n</head>\n<body>\n");
mBuffer.Assign("<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n"
"<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.1//EN\"\n"
" \"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd\">\n"
"<html xmlns=\"http://www.w3.org/1999/xhtml\">\n"
"<head>\n<title>Information about the Cache Service</title>\n</head>\n"
"<body>\n<div>\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("</body>\n</html>\n");
mBuffer.Truncate(0);
if (!mDeviceID.IsEmpty()) {
mBuffer.Append("</pre>\n");
}
mBuffer.Append("</div>\n</body>\n</html>\n");
outputStream->Write(mBuffer, mBuffer.Length(), &bytesWritten);
nsCOMPtr<nsIInputStream> inStr;
@ -148,27 +157,27 @@ nsAboutCache::VisitDevice(const char *deviceID,
mBuffer.Assign("<h2>");
mBuffer.Append(str);
mBuffer.Append("</h2><br>\n");
mBuffer.Append("</h2>\n<br />\n");
// Write out cache info
mBuffer.Append("<table>\n");
mBuffer.Append("\n<tr><td><b>Number of entries: </b></td>\n");
mBuffer.Append("\n<tr>\n<td><b>Number of entries: </b></td>\n");
value = 0;
deviceInfo->GetEntryCount(&value);
mBuffer.Append("<td><tt>");
mBuffer.AppendInt(value);
mBuffer.Append("</tt></td>\n</tr>\n");
mBuffer.Append("\n<tr><td><b>Maximum storage size: </b></td>\n");
mBuffer.Append("\n<tr>\n<td><b>Maximum storage size: </b></td>\n");
value = 0;
deviceInfo->GetMaximumSize(&value);
mBuffer.Append("<td><tt>");
mBuffer.AppendInt(value);
mBuffer.Append(" Bytes</tt></td>\n</tr>\n");
mBuffer.Append("\n<tr><td><b>Storage in use: </b></td>\n");
mBuffer.Append("\n<tr>\n<td><b>Storage in use: </b></td>\n");
mBuffer.Append("<td><tt>");
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<br>");
mBuffer.Append("\n<br />");
if (mDeviceID.IsEmpty()) {
mBuffer.Append("\n<a href=\"about:cache?device=");
mBuffer.Append(deviceID);
mBuffer.Append("\">List Cache Entries</a>\n");
mBuffer.Append("<hr />\n");
} else {
*visitEntries = PR_TRUE;
mBuffer.Append("<hr />\n<pre>\n");
}
mBuffer.Append("<hr>\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("&amp;sb=");
url += streamBased ? "1" : "0";
url += NS_LITERAL_CSTRING("&key=");
url += NS_LITERAL_CSTRING("&amp;key=");
url += key; // key
// Entry start...
mBuffer.Assign("<p><tt>\n");
// URI
mBuffer.Append("<b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"
"&nbsp;&nbsp;&nbsp;&nbsp;Key: </b>");
mBuffer.Append("<a href=\"");
mBuffer.Assign("<b> Key: </b><a href=\"");
mBuffer.Append(url);
mBuffer.Append("\">");
mBuffer.Append(key);
mBuffer.Append("</a><br>\n");
mBuffer.Append("</a>");
// Content length
PRUint32 length = 0;
entryInfo->GetDataSize(&length);
mBuffer.Append("<b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Data size: </b>");
mBuffer.Append("\n<b> Data size: </b>");
mBuffer.AppendInt(length);
mBuffer.Append(" Bytes<br>\n");
mBuffer.Append(" Bytes");
// Number of accesses
PRInt32 fetchCount = 0;
entryInfo->GetFetchCount(&fetchCount);
mBuffer.Append("<b>&nbsp;&nbsp;&nbsp;Fetch count: </b>");
mBuffer.Append("\n<b> Fetch count: </b>");
mBuffer.AppendInt(fetchCount);
mBuffer.Append("<br>\n");
// vars for reporting time
char buf[255];
PRUint32 t;
// Last modified time
mBuffer.Append("<b>&nbsp;Last Modified: </b>");
mBuffer.Append("\n<b> Last Modified: </b>");
entryInfo->GetLastModified(&t);
if (t) {
PrintTimeString(buf, sizeof(buf), t);
mBuffer.Append(buf);
} else
mBuffer.Append("No last modified time");
mBuffer.Append("<br>");
// Expires time
mBuffer.Append("<b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"
"Expires: </b>");
mBuffer.Append("\n<b> Expires: </b>");
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("<br>");
// Entry is done...
mBuffer.Append("</p></tt>\n");
mBuffer.Append("\n\n");
mStream->Write(mBuffer, mBuffer.Length(), &bytesWritten);

Просмотреть файл

@ -19,6 +19,7 @@
*
* Contributor(s):
* Darin Fisher <darin@netscape.com> (original author)
* Alexey Chernyak <alexeyc@bigfoot.com> (XHTML 1.1 conversion)
*/
#include <limits.h>
@ -80,7 +81,14 @@ nsAboutCacheEntry::OnCacheEntryAvailable(nsICacheEntryDescriptor *descriptor,
rv = storageStream->GetOutputStream(0, getter_AddRefs(outputStream));
if (NS_FAILED(rv)) return rv;
buffer.Assign("<html>\n<head>\n<title>Cache entry information</title>\n</head>\n<body>\n");
buffer.Assign("<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n"
"<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.1//EN\"\n"
" \"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd\">\n"
"<html xmlns=\"http://www.w3.org/1999/xhtml\">\n"
"<head>\n<title>Cache entry information</title>\n"
"<style type=\"text/css\">\npre {\n margin: 0;\n}\n"
"td:first-child {\n text-align: right;\n vertical-align: top;\n"
" line-height: 0.8em;\n}\n</style>\n</head>\n<body>\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 "<td valign=top align=right>"
#define APPEND_ROW(label, value) \
PR_BEGIN_MACRO \
buffer.Append("<tr>" TD_RIGHT_ALIGN "<tt><b>"); \
buffer.Append("<tr><td><tt><b>"); \
buffer.Append(label); \
buffer.Append(":</b></tt></td>\n<td><pre>"); \
buffer.Append(value); \
@ -366,7 +372,7 @@ nsAboutCacheEntry::WriteCacheEntryDescription(nsIOutputStream *outputStream,
buffer.Assign("<table>");
buffer.Append("<tr>" TD_RIGHT_ALIGN "<tt><b>key:</b></tt></td><td>");
buffer.Append("<tr><td><tt><b>key:</b></tt></td><td>");
// Test if the key is actually a URI
nsCOMPtr<nsIURI> uri;
@ -381,7 +387,7 @@ nsAboutCacheEntry::WriteCacheEntryDescription(nsIOutputStream *outputStream,
}
else
buffer.Append(str);
buffer.Append("</td></tr>");
buffer.Append("</td></tr>\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("</table>");
buffer.Append("</table>\n");
// Meta Data
// let's just look for some well known (HTTP) meta data tags, for now.
buffer.Append("<hr><table>");
buffer.Append("<hr />\n<table>");
// Client ID
str.Adopt(0);
@ -463,7 +469,7 @@ nsAboutCacheEntry::WriteCacheEntryDescription(nsIOutputStream *outputStream,
mBuffer = nsnull;
buffer.Append("</table>");
buffer.Append("</table>\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("<tr><td valign=top align=right><tt><b>");
mBuffer->Append("<tr><td><tt><b>");
mBuffer->Append(key);
mBuffer->Append(":</b></tt></td>\n<td><pre>");
mBuffer->Append(value);

Просмотреть файл

@ -1,3 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<!--
The contents of this file are subject to the Netscape Public License
Version 1.0 (the "NPL"); you may not use this file except in
@ -16,51 +20,49 @@
Contributor(s):
Henrik Gemal <gemal@gemal.dk>
Alexey Chernyak <alexeyc@bigfoot.com> (XHTML 1.1 conversion)
-->
<html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>The Book of Mozilla, 3:31</title>
<style type="text/css">
<!--
body {
html {
background: maroon;
color: white;
font-style: italic;
}
.moztext {
#moztext {
margin-top: 15%;
font-size: 1.1em;
text-align: center;
font-style: italic;
}
.larger {
font-size: 1.3em;
}
.from {
#from {
margin-top: 1em;
font-size: 1.5em;
text-align: right;
font-style: italic;
}
-->
span {
font-size: 1.3em;
}
</style>
</head>
<body>
<div class="moztext">
And the beast shall be made <span class="larger">legion</span>. Its numbers shall
be increased a <span class="larger">thousand thousand</span> fold. The din of a
million keyboards like unto a great <span class="larger">storm</span> shall cover
the earth, and the followers of Mammon shall <span class="larger">tremble</span>.
<div id="moztext">
And the beast shall be made <span>legion</span>. Its numbers shall
be increased a <span>thousand thousand</span> fold. The din of a
million keyboards like unto a great <span>storm</span> shall cover
the earth, and the followers of Mammon shall <span>tremble</span>.
</div>
<div class="from">
<div class="larger">from <b>The Book of Mozilla,</b> 3:31</div>
<div id="from">
<span>from <b>The Book of Mozilla,</b> 3:31</span><br />
(Red Letter Edition)
</div>
</body>
</html>

Просмотреть файл

@ -1,3 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<!--
The contents of this file are subject to the Netscape Public License
Version 1.0 (the "NPL"); you may not use this file except in
@ -16,51 +20,49 @@
Contributor(s):
Henrik Gemal <gemal@gemal.dk>
Alexey Chernyak <alexeyc@bigfoot.com> (XHTML 1.1 conversion)
-->
<html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>The Book of Mozilla, 3:31</title>
<style type="text/css">
<!--
body {
html {
background: maroon;
color: white;
font-style: italic;
}
.moztext {
#moztext {
margin-top: 15%;
font-size: 1.1em;
text-align: center;
font-style: italic;
}
.larger {
font-size: 1.3em;
}
.from {
#from {
margin-top: 1em;
font-size: 1.5em;
text-align: right;
font-style: italic;
}
-->
span {
font-size: 1.3em;
}
</style>
</head>
<body>
<div class="moztext">
And the beast shall be made <span class="larger">legion</span>. Its numbers shall
be increased a <span class="larger">thousand thousand</span> fold. The din of a
million keyboards like unto a great <span class="larger">storm</span> shall cover
the earth, and the followers of Mammon shall <span class="larger">tremble</span>.
<div id="moztext">
And the beast shall be made <span>legion</span>. Its numbers shall
be increased a <span>thousand thousand</span> fold. The din of a
million keyboards like unto a great <span>storm</span> shall cover
the earth, and the followers of Mammon shall <span>tremble</span>.
</div>
<div class="from">
<div class="larger">from <b>The Book of Mozilla,</b> 3:31</div>
<div id="from">
<span>from <b>The Book of Mozilla,</b> 3:31</span><br />
(Red Letter Edition)
</div>
</body>
</html>

Просмотреть файл

@ -1,3 +1,6 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<!--
- The contents of this file are subject to the Netscape Public
- License Version 1.1 (the "License"); you may not use this file
@ -20,27 +23,42 @@
- Contributor(s):
- Henrik Gemal <gemal@gemal.dk>
- Daniel Veditz <dveditz@netscape.com>
- Alexey Chernyak <alexeyc@bigfoot.com>
-->
<html>
<head>
<title>About:</title>
<style type="text/css">
table {
margin: auto;
text-align: center;
}
img {
border: 0;
}
p {
font-size: smaller;
}
h1 {
margin: 0;
}
</style>
</head>
<body bgcolor="#FFFFFF" text="#000000" link="#0000EE" vlink="#551A8B" alink="#FF0000">
<body>
<div align="center">
<table>
<tr>
<td>
<a href="http://www.mozilla.org/">
<img src="chrome://global/content/logo.gif" border="0" alt="Mozilla" width="200" height="200"></a>
<img src="chrome://global/content/logo.gif" alt="Mozilla" width="200" height="200"></a>
</td>
<td align="center">
<td>
<h1>
<a href="http://www.mozilla.org/releases/">Mozilla
<script type="text/javascript">
<script type="application/x-javascript">
document.write( navigator.userAgent.match(/rv:([^;)]+)/)[1] );
</script></a>
</h1>
@ -49,7 +67,6 @@
</tr>
</table>
</div>
<hr>
@ -66,7 +83,6 @@ University of California. All Rights Reserved.</li>
</ul>
<p>
<font size="-1">
U.S. GOVERNMENT END USERS. The Software is a &quot;commercial
item,&quot; as that term is defined in 48 C.F.R. 2.101 (Oct. 1995), consisting
of &quot;commercial computer software&quot; and &quot;commercial computer software
@ -74,7 +90,6 @@ documentation,&quot; 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.
</font>
</p>
</body>

Просмотреть файл

@ -1,3 +1,6 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<!--
- The contents of this file are subject to the Netscape Public
- License Version 1.1 (the "License"); you may not use this file
@ -20,27 +23,42 @@
- Contributor(s):
- Henrik Gemal <gemal@gemal.dk>
- Daniel Veditz <dveditz@netscape.com>
- Alexey Chernyak <alexeyc@bigfoot.com>
-->
<html>
<head>
<title>About:</title>
<style type="text/css">
table {
margin: auto;
text-align: center;
}
img {
border: 0;
}
p {
font-size: smaller;
}
h1 {
margin: 0;
}
</style>
</head>
<body bgcolor="#FFFFFF" text="#000000" link="#0000EE" vlink="#551A8B" alink="#FF0000">
<body>
<div align="center">
<table>
<tr>
<td>
<a href="http://www.mozilla.org/">
<img src="chrome://global/content/logo.gif" border="0" alt="Mozilla" width="200" height="200"></a>
<img src="chrome://global/content/logo.gif" alt="Mozilla" width="200" height="200"></a>
</td>
<td align="center">
<td>
<h1>
<a href="http://www.mozilla.org/releases/">Mozilla
<script type="text/javascript">
<script type="application/x-javascript">
document.write( navigator.userAgent.match(/rv:([^;)]+)/)[1] );
</script></a>
</h1>
@ -49,7 +67,6 @@
</tr>
</table>
</div>
<hr>
@ -66,7 +83,6 @@ University of California. All Rights Reserved.</li>
</ul>
<p>
<font size="-1">
U.S. GOVERNMENT END USERS. The Software is a &quot;commercial
item,&quot; as that term is defined in 48 C.F.R. 2.101 (Oct. 1995), consisting
of &quot;commercial computer software&quot; and &quot;commercial computer software
@ -74,7 +90,6 @@ documentation,&quot; 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.
</font>
</p>
</body>