Permalink
Browse files

[fix] Resource: xhtml+xml mimetype only on xhtml1_1 doctype

  • Loading branch information...
1 parent d606df3 commit 78eab7944e4852adb93d1869e7fac5d4db284008 @cedricss cedricss committed Apr 24, 2012
Showing with 16 additions and 11 deletions.
  1. +16 −11 stdlib/core/web/resource/resource_private.opa
View
27 stdlib/core/web/resource/resource_private.opa
@@ -704,17 +704,22 @@ default_customizers = [customizer_for_google_frame,required_customizer_for_incom
{body = <body id="Body">{body_content}{body_custom}{js_links_custom}{js_inline}</body>
head = head_custom
//Additional IE-specific fix -- note that the mime type can be ignored if the resource uses [override_mime_type]
- mime_type = match user_compat.renderer with
- /* hack for IE (considers application/xhtml+xml as files to save) */
- // FIXME: do this? http://www.w3.org/MarkUp/2004/xhtml-faq#ie
- | { Trident=_ } -> "text/html"
- /* work-around for Chrome & Safari's bug http://code.google.com/p/chromium/issues/detail?id=45440
- if we serve application/xhtml+xml, we loose the password-saving mechanism for login forms
- but unfortunately, with text/html, we loose some features (e.g. ability to have SVG)
- TODO: remove next line when Chrome bug 45440 is fixed */
- | { Webkit=_; variant=_ } -> "text/html"
- /* application/xhtml+xml is the right content-type by default */
- | _ -> "application/xhtml+xml"
+ mime_type =
+ match default_doctype.get() with
+ | {xhtml1_1} -> (
+ match user_compat.renderer with
+ /* hack for IE (considers application/xhtml+xml as files to save) */
+ // FIXME: do this? http://www.w3.org/MarkUp/2004/xhtml-faq#ie
+ | { Trident=_ } -> "text/html"
+ /* work-around for Chrome & Safari's bug http://code.google.com/p/chromium/issues/detail?id=45440
+ if we serve application/xhtml+xml, we loose the password-saving mechanism for login forms
+ but unfortunately, with text/html, we loose some features (e.g. ability to have SVG)
+ TODO: remove next line when Chrome bug 45440 is fixed */
+ | { Webkit=_; variant=_ } -> "text/html"
+ /* application/xhtml+xml is the right content-type by default */
+ | _ -> "application/xhtml+xml"
+ )
+ | _ -> "text/html"
end }
compute_everything(customizers, body:xhtml, user_agent) =

0 comments on commit 78eab79

Please sign in to comment.