Gabriel Ivăncescu (@insn) commented about dlls/mshtml/htmlwindow.c:
return S_OK;
}
+static HRESULT WINAPI window_private_MutationObserver(IWineHTMLWindowPrivate *iface, IDispatch *callback, IDispatch **mutation_observer) +{
- HTMLWindow *This = impl_from_IWineHTMLWindowPrivateVtbl(iface);
- IWineMSHTMLMutationObserver *ret = NULL;
- FIXME("iface %p, mutation_observer %p, stub.\n", iface, mutation_observer);
- create_mutation_observer(dispex_compat_mode(&This->inner_window->event_target.dispex), callback, &ret);
- *mutation_observer = (IDispatch *)ret;
You should handle allocation failure here (probably by having it return HRESULT and E_OUTOFMEMORY, but you could also check for NULL and return it here).
Note that the result should likely be cached in the inner window, so that you return the same constructor everytime, and you create it if the window has the cached one NULL. Then you'd have to AddRef before returning it from this method, because the created ref is held by the window (and released in `release_inner_window`).
BTW I suggest you add a simple test in documentmode.js "window_props" test to check how it's exposed, probably in IE11 only.
Also note that this is a constructor, and as such you should add a getter in the private idl that returns the constructor itself (and not an instance created from it).
Since I expect this to be IE11 specific (I haven't tested yet but I looked at caniuse.com), and the `IWineHTMLWindowPrivate` interface is IE10+, you can probably add a hook to remove this from being exposed in IE10 rather than creating a new interface.
First give it some named DISPID like:
```idl const long DISPID_IWINEHTMLWINDOWPRIVATE_MUTATIONOBS = 55; ```
above the interface definition then use it in the interface (note that it's a getter now, since it "gets" the constructor):
```idl [propget, id(DISPID_IWINEHTMLWINDOWPRIVATE_MUTATIONOBS)] HRESULT MutationObserver([retval, out] IDispatch **observer); ```
next add a hook in `HTMLWindow_init_dispex_info` like:
```c static const dispex_hook_t private_ie10_hooks[] = { {DISPID_IWINEHTMLWINDOWPRIVATE_MUTATIONOBS}, {DISPID_UNKNOWN} }; ```
and use it:
```diff if(compat_mode >= COMPAT_MODE_IE10) - dispex_info_add_interface(info, IWineHTMLWindowPrivate_tid, NULL); + dispex_info_add_interface(info, IWineHTMLWindowPrivate_tid, compat_mode <= COMPAT_MODE_IE10 ? private_ie10_hooks : NULL); ```
this hook itself is set to NULL so basically it removes it in IE10 from being exposed (since it's IE11 only).
Note that if it is also exposed in IE10 then you don't need to do this of course. I did something similar for msCrypto which is IE11 in Proton.