зеркало из https://github.com/mozilla/gecko-dev.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:
Родитель
86598e7d78
Коммит
5ebd34f7ff
|
@ -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
|
||||
|
|
|
@ -28,7 +28,7 @@ CHROME_L10N_DIR=global\locale
|
|||
|
||||
CHROME_L10N = \
|
||||
.\intl.css \
|
||||
.\about.html \
|
||||
.\about.xhtml \
|
||||
.\globalOverlay.dtd \
|
||||
.\dialogOverlay.dtd \
|
||||
.\builtinURLs.rdf \
|
||||
|
|
Загрузка…
Ссылка в новой задаче