Jacek Caban (@jacek) commented about dlls/mshtml/htmldoc.c:
WINE_DEFAULT_DEBUG_CHANNEL(mshtml);
+static dispex_static_data_t *const dispex_from_document_type[] = {
- [DOCTYPE_HTML] = &HTMLDocument_dispex,
- [DOCTYPE_XHTML] = &XMLDocument_dispex,
- [DOCTYPE_XML] = &XMLDocument_dispex,
- [DOCTYPE_SVG] = &XMLDocument_dispex,
+};
While I'm not necessarily against those `DOCTYPE_*` enums, the current use does not seem convincing. For example, instead of this array that you need to keep in sync, we could simply use something like `doc_type == DOCTYPE_HTML ? &HTMLDocument_dispex : &XMLDocument_dispex`. In fact we don't need `doc_type` at all, we could just have something like a `is_xml` flag. That, in combination with `html_document != NULL` checks, should cover all use cases and would not require hardcoding all content types, unless I'm missing something.