Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit f0c70a83 authored by Patrick Scott's avatar Patrick Scott
Browse files

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.
parent b4ec4010
Loading
Loading
Loading
Loading
+4 −18
Original line number Diff line number Diff line
@@ -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(
        return 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;
    }

    /**
+1 −0
Original line number Diff line number Diff line
@@ -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);