Jacek Caban (@jacek) commented about dlls/mshtml/oleobj.c:
+HTMLDOCUMENTOBJ_FWD_TO_NODE_1(HTMLDocument5, put_onbeforeactivate, VARIANT) +HTMLDOCUMENTOBJ_FWD_TO_NODE_1(HTMLDocument5, get_onbeforeactivate, VARIANT*) +HTMLDOCUMENTOBJ_FWD_TO_NODE_1(HTMLDocument5, put_onbeforedeactivate, VARIANT) +HTMLDOCUMENTOBJ_FWD_TO_NODE_1(HTMLDocument5, get_onbeforedeactivate, VARIANT*)
+static HRESULT WINAPI DocObjHTMLDocument5_get_compatMode(IHTMLDocument5 *iface, BSTR *p) +{
- HTMLDocumentObj *This = impl_from_IHTMLDocument5(iface);
- if(This->basedoc.doc_node)
return IHTMLDocument5_get_compatMode(&This->basedoc.doc_node->IHTMLDocument5_iface, p);
- TRACE("(%p)->(%p)\n", This, p);
- return (*p = SysAllocString(L"BackCompat")) ? S_OK : E_OUTOFMEMORY;
+}
I think this should use the same logic for forwarding as other functions. I guess you didn't do that because of different NULL doc_node handling, but that rises a question: when does it matter? I don't think that NULL doc_node is a valid state. Unless I'm missing something, those tests for NULL are leftovers from times when we allowed creating document object even if creating Gecko object failed, but that's not the case anymore.