From 428911a287d5c26440da8bc4fd04e6a09719ef97 Mon Sep 17 00:00:00 2001 From: "bzbarsky%mit.edu" Date: Wed, 6 Feb 2002 21:05:52 +0000 Subject: [PATCH] Make image/x-icon show ICON in title bar, not X-ICON. Bug 42093, r=sicking, sr=jag --- content/html/document/src/nsImageDocument.cpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/content/html/document/src/nsImageDocument.cpp b/content/html/document/src/nsImageDocument.cpp index 28ca43fa5ea..80d6838445c 100644 --- a/content/html/document/src/nsImageDocument.cpp +++ b/content/html/document/src/nsImageDocument.cpp @@ -545,6 +545,19 @@ nsresult nsImageDocument::UpdateTitle( void ) mimeType.EndReading(end); nsXPIDLCString::const_iterator iter = end; if (FindInReadable(NS_LITERAL_CSTRING("IMAGE/"), start, iter) && iter != end) { + // strip out "X-" if any + if (*iter == 'X') { + ++iter; + if (iter != end && *iter == '-') { + ++iter; + if (iter == end) { + // looks like "IMAGE/X-" is the type?? Bail out of here. + mimeType.BeginReading(iter); + } + } else { + --iter; + } + } CopyASCIItoUCS2(Substring(iter, end), typeStr); } else { CopyASCIItoUCS2(mimeType, typeStr);