Jacek Caban (@jacek) commented about dlls/mshtml/htmldoc.c:
const PRUnichar *str;
nsAString nsstr;
nsresult nsres;
doc = alloc_doc_node(doc_obj, window, script_global); if(!doc) return E_OUTOFMEMORY;
nsAString_Init(&nsstr, NULL);
nsres = nsIDOMDocument_GetContentType(nsdoc, &nsstr);
if(NS_FAILED(nsres))
return map_nsresult(nsres);
nsAString_GetData(&nsstr, &str);
if(!wcscmp(str, L"application/xhtml+xml"))
doc->is_xhtml = TRUE;
nsAString_Finish(&nsstr);
Earlier I thought Gecko exposed `nsIDOMHTMLDocument` for XHTML. If it doesn’t, then the current `html_document` check should cover most cases. Why don’t we just skip the flag for now and do the fixup in `get_mimeType`? It seems to me we could always query the content type there, and use "text/xml" if it isn’t one of the known ones.