[PATCH 1/4] mshtml: Add stub for HTMLElement classList property.

Paul Gofman pgofman at codeweavers.com
Mon Jul 19 04:55:43 CDT 2021


Signed-off-by: Paul Gofman <pgofman at codeweavers.com>
---
 dlls/mshtml/htmlelem.c               | 88 ++++++++++++++++++++++++++++
 dlls/mshtml/mshtml_private.h         |  2 +
 dlls/mshtml/mshtml_private_iface.idl | 13 ++++
 dlls/mshtml/tests/documentmode.js    |  1 +
 4 files changed, 104 insertions(+)

diff --git a/dlls/mshtml/htmlelem.c b/dlls/mshtml/htmlelem.c
index b9677ec867a..961e4e79e08 100644
--- a/dlls/mshtml/htmlelem.c
+++ b/dlls/mshtml/htmlelem.c
@@ -6065,6 +6065,8 @@ HRESULT HTMLElement_QI(HTMLDOMNode *iface, REFIID riid, void **ppv)
         *ppv = &This->IProvideMultipleClassInfo_iface;
     }else if(IsEqualGUID(&IID_IProvideMultipleClassInfo, riid)) {
         *ppv = &This->IProvideMultipleClassInfo_iface;
+    }else if(IsEqualGUID(&IID_IWineHTMLElementPrivate, riid)) {
+        *ppv = &This->IWineHTMLElementPrivate_iface;
     }else {
         return HTMLDOMNode_QI(&This->node, riid, ppv);
     }
@@ -6366,7 +6368,10 @@ void HTMLElement_init_dispex_info(dispex_data_t *info, compat_mode_t mode)
     }
 
     if(mode >= COMPAT_MODE_IE10)
+    {
         dispex_info_add_interface(info, IHTMLElement7_tid, NULL);
+        dispex_info_add_interface(info, IWineHTMLElementPrivate_tid, NULL);
+    }
 }
 
 static const tid_t HTMLElement_iface_tids[] = {
@@ -6390,6 +6395,88 @@ static event_target_vtbl_t HTMLElement_event_target_vtbl = {
     HTMLElement_set_current_event
 };
 
+static inline HTMLElement *impl_from_IWineHTMLElementPrivateVtbl(IWineHTMLElementPrivate *iface)
+{
+    return CONTAINING_RECORD(iface, HTMLElement, IWineHTMLElementPrivate_iface);
+}
+
+static HRESULT WINAPI htmlelement_private_QueryInterface(IWineHTMLElementPrivate *iface,
+        REFIID riid, void **ppv)
+{
+    HTMLElement *This = impl_from_IWineHTMLElementPrivateVtbl(iface);
+
+    return IHTMLElement_QueryInterface(&This->IHTMLElement_iface, riid, ppv);
+}
+
+static ULONG WINAPI htmlelement_private_AddRef(IWineHTMLElementPrivate *iface)
+{
+    HTMLElement *This = impl_from_IWineHTMLElementPrivateVtbl(iface);
+
+    return IHTMLElement_AddRef(&This->IHTMLElement_iface);
+}
+
+static ULONG WINAPI htmlelement_private_Release(IWineHTMLElementPrivate *iface)
+{
+    HTMLElement *This = impl_from_IWineHTMLElementPrivateVtbl(iface);
+
+    return IHTMLElement_Release(&This->IHTMLElement_iface);
+}
+
+static HRESULT WINAPI htmlelement_private_GetTypeInfoCount(IWineHTMLElementPrivate *iface, UINT *pctinfo)
+{
+    HTMLElement *This = impl_from_IWineHTMLElementPrivateVtbl(iface);
+
+    return HTMLElement_GetTypeInfoCount(&This->IHTMLElement_iface, pctinfo);
+}
+
+static HRESULT WINAPI htmlelement_private_GetTypeInfo(IWineHTMLElementPrivate *iface, UINT iTInfo,
+                                              LCID lcid, ITypeInfo **ppTInfo)
+{
+    HTMLElement *This = impl_from_IWineHTMLElementPrivateVtbl(iface);
+
+    return HTMLElement_GetTypeInfo(&This->IHTMLElement_iface, iTInfo, lcid, ppTInfo);
+}
+
+static HRESULT WINAPI htmlelement_private_GetIDsOfNames(IWineHTMLElementPrivate *iface, REFIID riid,
+                                                LPOLESTR *rgszNames, UINT cNames,
+                                                LCID lcid, DISPID *rgDispId)
+{
+    HTMLElement *This = impl_from_IWineHTMLElementPrivateVtbl(iface);
+
+    return HTMLElement_GetIDsOfNames(&This->IHTMLElement_iface, riid, rgszNames, cNames, lcid,
+            rgDispId);
+}
+
+static HRESULT WINAPI htmlelement_private_Invoke(IWineHTMLElementPrivate *iface, DISPID dispIdMember,
+                            REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams,
+                            VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr)
+{
+    HTMLElement *This = impl_from_IWineHTMLElementPrivateVtbl(iface);
+
+    return HTMLElement_Invoke(&This->IHTMLElement_iface, dispIdMember, riid, lcid, wFlags,
+            pDispParams, pVarResult, pExcepInfo, puArgErr);
+}
+
+static HRESULT WINAPI htmlelement_private_get_classList(IWineHTMLElementPrivate *iface, IDispatch **class_list)
+{
+    FIXME("iface %p, class_list %p stub.\n", iface, class_list);
+
+    *class_list = NULL;
+
+    return S_OK;
+}
+
+static const IWineHTMLElementPrivateVtbl WineHTMLElementPrivateVtbl = {
+    htmlelement_private_QueryInterface,
+    htmlelement_private_AddRef,
+    htmlelement_private_Release,
+    htmlelement_private_GetTypeInfoCount,
+    htmlelement_private_GetTypeInfo,
+    htmlelement_private_GetIDsOfNames,
+    htmlelement_private_Invoke,
+    htmlelement_private_get_classList,
+};
+
 static dispex_static_data_t HTMLElement_dispex = {
     &HTMLElement_event_target_vtbl.dispex_vtbl,
     DispHTMLUnknownElement_tid,
@@ -6409,6 +6496,7 @@ void HTMLElement_Init(HTMLElement *This, HTMLDocumentNode *doc, nsIDOMElement *n
     This->IElementSelector_iface.lpVtbl = &ElementSelectorVtbl;
     This->IElementTraversal_iface.lpVtbl = &ElementTraversalVtbl;
     This->IProvideMultipleClassInfo_iface.lpVtbl = &ProvideMultipleClassInfoVtbl;
+    This->IWineHTMLElementPrivate_iface.lpVtbl = &WineHTMLElementPrivateVtbl;
 
     if(dispex_data && !dispex_data->vtbl)
         dispex_data->vtbl = &HTMLElement_event_target_vtbl.dispex_vtbl;
diff --git a/dlls/mshtml/mshtml_private.h b/dlls/mshtml/mshtml_private.h
index e2c1f221372..56bef40b4d0 100644
--- a/dlls/mshtml/mshtml_private.h
+++ b/dlls/mshtml/mshtml_private.h
@@ -273,6 +273,7 @@ typedef struct EventTarget EventTarget;
     XIID(ISVGTextContentElement)
 
 #define PRIVATE_TID_LIST \
+    XIID(IWineHTMLElementPrivate) \
     XIID(IWineHTMLWindowPrivate) \
     XIID(IWineMSHTMLConsole)
 
@@ -828,6 +829,7 @@ typedef struct {
     IElementSelector IElementSelector_iface;
     IElementTraversal IElementTraversal_iface;
     IProvideMultipleClassInfo IProvideMultipleClassInfo_iface;
+    IWineHTMLElementPrivate IWineHTMLElementPrivate_iface;
 
     nsIDOMElement *dom_element;       /* NULL for legacy comments represented as HTML elements */
     nsIDOMHTMLElement *html_element;  /* NULL for non-HTML elements (like SVG elements) */
diff --git a/dlls/mshtml/mshtml_private_iface.idl b/dlls/mshtml/mshtml_private_iface.idl
index 6c5c5db991f..9ca7e0d7421 100644
--- a/dlls/mshtml/mshtml_private_iface.idl
+++ b/dlls/mshtml/mshtml_private_iface.idl
@@ -89,4 +89,17 @@ interface IWineHTMLWindowPrivate : IDispatch
     HRESULT console([retval, out] IDispatch **console);
 }
 
+[
+    odl,
+    oleautomation,
+    dual,
+    hidden,
+    uuid(465908fd-f394-489f-b7a3-4c00fbbe9eec)
+]
+interface IWineHTMLElementPrivate : IDispatch
+{
+    [propget, id(1)]
+    HRESULT classList([retval, out] IDispatch **class_list);
+}
+
 } /* library MSHTML_private */
diff --git a/dlls/mshtml/tests/documentmode.js b/dlls/mshtml/tests/documentmode.js
index 859e1fe53db..c20f6ee18df 100644
--- a/dlls/mshtml/tests/documentmode.js
+++ b/dlls/mshtml/tests/documentmode.js
@@ -57,6 +57,7 @@ sync_test("elem_props", function() {
     test_exposed("sheet", v >= 9);
     test_exposed("readyState", v < 11);
     test_exposed("styleSheet", v < 11);
+    test_exposed("classList", v >= 10);
 });
 
 sync_test("doc_props", function() {
-- 
2.31.1




More information about the wine-devel mailing list