зеркало из https://github.com/mozilla/pjs.git
Bug 155752 - Use the XML parser for XHTML about: services
Patch contributed by Alexey Chernyak <alexey@ihug.com.au> r=timeless, sr=jst, a=asa
This commit is contained in:
Родитель
a2c9a65423
Коммит
1cd878f62a
|
@ -49,6 +49,7 @@
|
|||
#include "nsCOMPtr.h"
|
||||
#include "nsNetUtil.h"
|
||||
#include "prtime.h"
|
||||
#include "nsEscape.h"
|
||||
|
||||
#include "nsICacheService.h"
|
||||
|
||||
|
@ -251,7 +252,8 @@ nsAboutCache::VisitEntry(const char *deviceID,
|
|||
url += NS_LITERAL_CSTRING("&sb=");
|
||||
url += streamBased ? "1" : "0";
|
||||
url += NS_LITERAL_CSTRING("&key=");
|
||||
url += key; // key
|
||||
char* escapedKey = nsEscapeHTML(key);
|
||||
url += escapedKey; // key
|
||||
|
||||
// Entry start...
|
||||
|
||||
|
@ -259,7 +261,8 @@ nsAboutCache::VisitEntry(const char *deviceID,
|
|||
mBuffer.Assign("<b> Key: </b><a href=\"");
|
||||
mBuffer.Append(url);
|
||||
mBuffer.Append("\">");
|
||||
mBuffer.Append(key);
|
||||
mBuffer.Append(escapedKey);
|
||||
nsMemory::Free(escapedKey);
|
||||
mBuffer.Append("</a>");
|
||||
|
||||
// Content length
|
||||
|
|
|
@ -135,7 +135,7 @@ nsAboutCacheEntry::OnCacheEntryAvailable(nsICacheEntryDescriptor *descriptor,
|
|||
|
||||
nsCOMPtr<nsIInputStreamIO> io;
|
||||
rv = NS_NewInputStreamIO(getter_AddRefs(io), spec, inStr,
|
||||
NS_LITERAL_CSTRING("text/html"),
|
||||
NS_LITERAL_CSTRING("application/xhtml+xml"),
|
||||
NS_LITERAL_CSTRING(""),
|
||||
size);
|
||||
|
||||
|
@ -410,16 +410,18 @@ nsAboutCacheEntry::WriteCacheEntryDescription(nsIOutputStream *outputStream,
|
|||
// Test if the key is actually a URI
|
||||
nsCOMPtr<nsIURI> uri;
|
||||
rv = NS_NewURI(getter_AddRefs(uri), str);
|
||||
char* escapedStr = nsEscapeHTML(str);
|
||||
if (NS_SUCCEEDED(rv)) {
|
||||
buffer.Append("<a href=\"");
|
||||
buffer.Append(str);
|
||||
buffer.Append(escapedStr);
|
||||
buffer.Append("\">");
|
||||
buffer.Append(str);
|
||||
buffer.Append(escapedStr);
|
||||
buffer.Append("</a>");
|
||||
uri = 0;
|
||||
}
|
||||
else
|
||||
buffer.Append(str);
|
||||
buffer.Append(escapedStr);
|
||||
nsMemory::Free(escapedStr);
|
||||
buffer.Append("</td></tr>\n");
|
||||
|
||||
|
||||
|
|
|
@ -67,7 +67,7 @@ struct RedirEntry {
|
|||
*/
|
||||
static RedirEntry kRedirMap[] = {
|
||||
{ "credits", "http://www.mozilla.org/credits/", PR_TRUE },
|
||||
{ "mozilla", "chrome://global/content/mozilla.html", PR_TRUE },
|
||||
{ "mozilla", "chrome://global/content/mozilla.xhtml", PR_TRUE },
|
||||
{ "plugins", "chrome://global/content/plugins.html", PR_TRUE },
|
||||
{ "config", "chrome://global/content/config.xul", PR_FALSE }
|
||||
};
|
||||
|
|
|
@ -48,7 +48,7 @@ static NS_DEFINE_CID(kIOServiceCID, NS_IOSERVICE_CID);
|
|||
|
||||
NS_IMPL_ISUPPORTS1(nsAbout, nsIAboutModule)
|
||||
|
||||
static const char kURI[] = "chrome://global/locale/about.html";
|
||||
static const char kURI[] = "chrome://global/locale/about.xhtml";
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsAbout::NewChannel(nsIURI *aURI, nsIChannel **result)
|
||||
|
|
|
@ -16,7 +16,7 @@ toolkit.jar:
|
|||
content/global/config.xul (resources/content/config.xul)
|
||||
content/global/config.css (resources/content/config.css)
|
||||
content/global/config.js (resources/content/config.js)
|
||||
content/global/mozilla.html (resources/content/mozilla.html)
|
||||
content/global/mozilla.xhtml (resources/content/mozilla.xhtml)
|
||||
content/global/plugins.html (resources/content/plugins.html)
|
||||
content/global/charsetOverlay.xul (resources/content/charsetOverlay.xul)
|
||||
content/global/charsetOverlay.js (resources/content/charsetOverlay.js)
|
||||
|
@ -97,7 +97,7 @@ en-US.jar:
|
|||
locale/en-US/global/accept2locale.properties (resources/locale/en-US/accept2locale.properties)
|
||||
locale/en-US/global/languageNames.properties (resources/locale/en-US/languageNames.properties)
|
||||
locale/en-US/global/regionNames.properties (resources/locale/en-US/regionNames.properties)
|
||||
locale/en-US/global/about.html (resources/locale/en-US/about.html)
|
||||
locale/en-US/global/about.xhtml (resources/locale/en-US/about.xhtml)
|
||||
locale/en-US/global/commonDialogs.properties (resources/locale/en-US/commonDialogs.properties)
|
||||
locale/en-US/global/plugins.properties (resources/locale/en-US/plugins.properties)
|
||||
locale/en-US/global/nsTreeSorting.properties (resources/locale/en-US/nsTreeSorting.properties)
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
intl.css
|
||||
about.html
|
||||
about.xhtml
|
||||
globalOverlay.dtd
|
||||
dialogOverlay.dtd
|
||||
builtinURLs.rdf
|
||||
|
|
|
@ -1,54 +0,0 @@
|
|||
#!nmake
|
||||
#
|
||||
# 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):
|
||||
|
||||
DEPTH=..\..\..\..\..
|
||||
|
||||
DIRS=win unix mac
|
||||
|
||||
CHROME_DIR=locales\en-US
|
||||
CHROME_L10N_DIR=global\locale
|
||||
|
||||
CHROME_L10N = \
|
||||
.\intl.css \
|
||||
.\about.html \
|
||||
.\globalOverlay.dtd \
|
||||
.\dialogOverlay.dtd \
|
||||
.\builtinURLs.rdf \
|
||||
.\commonDialog.dtd \
|
||||
.\charsetOverlay.dtd \
|
||||
.\charsetDetectorsOverlay.dtd \
|
||||
.\brand.properties \
|
||||
.\brand.dtd \
|
||||
.\wizardManager.properties \
|
||||
.\wizardOverlay.dtd \
|
||||
.\about.dtd \
|
||||
.\accept2locale.properties \
|
||||
.\languageNames.properties \
|
||||
.\regionNames.properties \
|
||||
.\commonDialogs.properties \
|
||||
.\plugins.properties \
|
||||
.\printdialog.dtd \
|
||||
.\printPageSetup.dtd \
|
||||
.\printPageSetup.properties \
|
||||
$(NULL)
|
||||
|
||||
include <$(DEPTH)\config\rules.mak>
|
||||
|
Загрузка…
Ссылка в новой задаче