Jacek Caban (@jacek) commented about dlls/mshtml/htmldoc.c:
TRACE("(%p)->(%p)\n", This, p); if(!This->dom_document) {
WARN("NULL dom_document\n");
return E_UNEXPECTED;
*p = create_all_collection(&This->node, FALSE);
}return S_OK;
Could we just unconditionally use this code path (even if we have dom_document)? It seems to me that it should just always work. This would change handling empty collection (we currently return NULL in get_all), but that could maybe be handled in create_all_collection (although some tests would be nice to confirm it).