Module: wine Branch: master Commit: 724e54d54faac1f3fd8ce8fd536aa19308275894 URL: https://gitlab.winehq.org/wine/wine/-/commit/724e54d54faac1f3fd8ce8fd536aa19...
Author: Yuxuan Shui yshui@codeweavers.com Date: Tue Jul 25 23:53:11 2023 +0100
mshtml: Add stubs for MutationObserver methods.
---
dlls/mshtml/mshtml_private_iface.idl | 7 +++++++ dlls/mshtml/mutation.c | 31 +++++++++++++++++++++++++++++++ dlls/mshtml/tests/documentmode.js | 10 +++++++++- 3 files changed, 47 insertions(+), 1 deletion(-)
diff --git a/dlls/mshtml/mshtml_private_iface.idl b/dlls/mshtml/mshtml_private_iface.idl index 46bae638fa5..e4d97361ce1 100644 --- a/dlls/mshtml/mshtml_private_iface.idl +++ b/dlls/mshtml/mshtml_private_iface.idl @@ -21,6 +21,7 @@ #include <mshtmdid.h>
import "ocidl.idl"; +import "mshtml.idl";
[ version(1.0), @@ -85,6 +86,12 @@ interface IWineMSHTMLConsole : IDispatch ] interface IWineMSHTMLMutationObserver : IDispatch { + [id(1)] + HRESULT disconnect(); + [id(2)] + HRESULT observe([in] IHTMLDOMNode *target, [in] IDispatch *options); + [id(3)] + HRESULT takeRecords([retval, out] IDispatch **records); }
[ diff --git a/dlls/mshtml/mutation.c b/dlls/mshtml/mutation.c index 09b2098bcb3..e6d080cff16 100644 --- a/dlls/mshtml/mutation.c +++ b/dlls/mshtml/mutation.c @@ -1172,6 +1172,34 @@ static HRESULT WINAPI MutationObserver_Invoke(IWineMSHTMLMutationObserver *iface pDispParams, pVarResult, pExcepInfo, puArgErr); }
+static HRESULT WINAPI MutationObserver_disconnect(IWineMSHTMLMutationObserver *iface) +{ + struct mutation_observer *This = impl_from_IWineMSHTMLMutationObserver(iface); + + FIXME("(%p), stub\n", This); + + return S_OK; +} + +static HRESULT WINAPI MutationObserver_observe(IWineMSHTMLMutationObserver *iface, IHTMLDOMNode *target, + IDispatch *options) +{ + struct mutation_observer *This = impl_from_IWineMSHTMLMutationObserver(iface); + + FIXME("(%p)->(%p %p), stub\n", This, target, options); + + return S_OK; +} + +static HRESULT WINAPI MutationObserver_takeRecords(IWineMSHTMLMutationObserver *iface, IDispatch **ret) +{ + struct mutation_observer *This = impl_from_IWineMSHTMLMutationObserver(iface); + + FIXME("(%p)->(%p), stub\n", This, ret); + + return E_NOTIMPL; +} + static const IWineMSHTMLMutationObserverVtbl WineMSHTMLMutationObserverVtbl = { MutationObserver_QueryInterface, MutationObserver_AddRef, @@ -1180,6 +1208,9 @@ static const IWineMSHTMLMutationObserverVtbl WineMSHTMLMutationObserverVtbl = { MutationObserver_GetTypeInfo, MutationObserver_GetIDsOfNames, MutationObserver_Invoke, + MutationObserver_disconnect, + MutationObserver_observe, + MutationObserver_takeRecords };
static const tid_t mutation_observer_iface_tids[] = { diff --git a/dlls/mshtml/tests/documentmode.js b/dlls/mshtml/tests/documentmode.js index 35921ca565f..9f46de12466 100644 --- a/dlls/mshtml/tests/documentmode.js +++ b/dlls/mshtml/tests/documentmode.js @@ -2909,7 +2909,15 @@ sync_test("MutationObserver", function() { } catch(e) { ok(false, "MutationObserver with extra args threw exception " + e.number); } -}) + + var mutation_observer = new MutationObserver(function() {}); + function test_exposed(prop) { + ok(prop in mutation_observer, prop + " not found in MutationObserver."); + } + test_exposed("observe"); + test_exposed("disconnect"); + test_exposed("takeRecords"); +});
async_test("postMessage", function() { var v = document.documentMode;