Treat application/xhtml+xml as xhtml+xml instead of text/html.

Previously we had converted application/xhtml+xml to text/html because of bad
server data. Now we need to treat xhtml as xhtml to get svg to be interpreted
correctly.
This commit is contained in:
Patrick Scott
2009-04-28 11:21:28 -04:00
parent b4ec401085
commit f0c70a8356
2 changed files with 5 additions and 18 deletions

View File

@@ -324,13 +324,10 @@ class LoadListener extends Handler implements EventHandler {
// As we don't support wml, render it as plain text
mMimeType = "text/plain";
} else {
// XXX: Until the servers send us either correct xhtml or
// text/html, treat application/xhtml+xml as text/html.
// It seems that xhtml+xml and vnd.wap.xhtml+xml mime
// subtypes are used interchangeably. So treat them the same.
if (mMimeType.equals("application/xhtml+xml") ||
mMimeType.equals("application/vnd.wap.xhtml+xml")) {
mMimeType = "text/html";
if (mMimeType.equals("application/vnd.wap.xhtml+xml")) {
mMimeType = "application/xhtml+xml";
}
}
} else {
@@ -1396,19 +1393,8 @@ class LoadListener extends Handler implements EventHandler {
Log.v(LOGTAG, "guessMimeTypeFromExtension: mURL = " + mUrl);
}
String mimeType =
MimeTypeMap.getSingleton().getMimeTypeFromExtension(
MimeTypeMap.getFileExtensionFromUrl(mUrl));
if (mimeType != null) {
// XXX: Until the servers send us either correct xhtml or
// text/html, treat application/xhtml+xml as text/html.
if (mimeType.equals("application/xhtml+xml")) {
mimeType = "text/html";
}
}
return mimeType;
return MimeTypeMap.getSingleton().getMimeTypeFromExtension(
MimeTypeMap.getFileExtensionFromUrl(mUrl));
}
/**

View File

@@ -358,6 +358,7 @@ public /* package */ class MimeTypeMap {
sMimeTypeMap.loadEntry("application/x-x509-ca-cert", "crt", false);
sMimeTypeMap.loadEntry("application/x-xcf", "xcf", false);
sMimeTypeMap.loadEntry("application/x-xfig", "fig", false);
sMimeTypeMap.loadEntry("application/xhtml+xml", "xhtml", false);
sMimeTypeMap.loadEntry("audio/basic", "snd", false);
sMimeTypeMap.loadEntry("audio/midi", "mid", false);
sMimeTypeMap.loadEntry("audio/midi", "midi", false);