From: Gabriel Ivăncescu <gabrielopcode(a)gmail.com> Signed-off-by: Gabriel Ivăncescu <gabrielopcode(a)gmail.com> --- dlls/mshtml/htmlinput.c | 160 +++++++++++++++++++++++++++ dlls/mshtml/mshtml_private.h | 1 + dlls/mshtml/mshtml_private_iface.idl | 45 ++++++++ dlls/mshtml/tests/documentmode.js | 6 +- 4 files changed, 208 insertions(+), 4 deletions(-) diff --git a/dlls/mshtml/htmlinput.c b/dlls/mshtml/htmlinput.c index 779085e4107..8f68a32745d 100644 --- a/dlls/mshtml/htmlinput.c +++ b/dlls/mshtml/htmlinput.c @@ -40,6 +40,7 @@ struct HTMLInputElement { IHTMLInputElement IHTMLInputElement_iface; IHTMLInputTextElement IHTMLInputTextElement_iface; IHTMLInputTextElement2 IHTMLInputTextElement2_iface; + IWineHTMLInputPrivate IWineHTMLInputPrivate_iface; nsIDOMHTMLInputElement *nsinput; }; @@ -1190,6 +1191,160 @@ static const IHTMLInputTextElement2Vtbl HTMLInputTextElement2Vtbl = { HTMLInputTextElement2_setSelectionRange }; +static inline HTMLInputElement *impl_from_IWineHTMLInputPrivateVtbl(IWineHTMLInputPrivate *iface) +{ + return CONTAINING_RECORD(iface, HTMLInputElement, IWineHTMLInputPrivate_iface); +} + +DISPEX_IDISPATCH_IMPL(HTMLInputElement_private, IWineHTMLInputPrivate, + impl_from_IWineHTMLInputPrivateVtbl(iface)->element.node.event_target.dispex) + +static HRESULT WINAPI HTMLInputElement_private_put_autofocus(IWineHTMLInputPrivate *iface, VARIANT_BOOL v) +{ + HTMLInputElement *This = impl_from_IWineHTMLInputPrivateVtbl(iface); + FIXME("(%p)->(%x)\n", This, v); + return E_NOTIMPL; +} + +static HRESULT WINAPI HTMLInputElement_private_get_autofocus(IWineHTMLInputPrivate *iface, VARIANT_BOOL *ret) +{ + HTMLInputElement *This = impl_from_IWineHTMLInputPrivateVtbl(iface); + FIXME("(%p)->(%p)\n", This, ret); + return E_NOTIMPL; +} + +static HRESULT WINAPI HTMLInputElement_private_get_validationMessage(IWineHTMLInputPrivate *iface, BSTR *ret) +{ + HTMLInputElement *This = impl_from_IWineHTMLInputPrivateVtbl(iface); + FIXME("(%p)->(%p)\n", This, ret); + return E_NOTIMPL; +} + +static HRESULT WINAPI HTMLInputElement_private_get_validity(IWineHTMLInputPrivate *iface, IDispatch **ret) +{ + HTMLInputElement *This = impl_from_IWineHTMLInputPrivateVtbl(iface); + FIXME("(%p)->(%p)\n", This, ret); + return E_NOTIMPL; +} + +static HRESULT WINAPI HTMLInputElement_private_get_willValidate(IWineHTMLInputPrivate *iface, VARIANT_BOOL *ret) +{ + HTMLInputElement *This = impl_from_IWineHTMLInputPrivateVtbl(iface); + FIXME("(%p)->(%p)\n", This, ret); + return E_NOTIMPL; +} + +static HRESULT WINAPI HTMLInputElement_private_setCustomValidity(IWineHTMLInputPrivate *iface, VARIANT *message) +{ + HTMLInputElement *This = impl_from_IWineHTMLInputPrivateVtbl(iface); + FIXME("(%p)->(%s)\n", This, debugstr_variant(message)); + return E_NOTIMPL; +} + +static HRESULT WINAPI HTMLInputElement_private_checkValidity(IWineHTMLInputPrivate *iface, VARIANT_BOOL *ret) +{ + HTMLInputElement *This = impl_from_IWineHTMLInputPrivateVtbl(iface); + FIXME("(%p)->(%p)\n", This, ret); + return E_NOTIMPL; +} + +static HRESULT WINAPI HTMLInputElement_private_put_formAction(IWineHTMLInputPrivate *iface, BSTR v) +{ + HTMLInputElement *This = impl_from_IWineHTMLInputPrivateVtbl(iface); + FIXME("(%p)->(%s)\n", This, debugstr_w(v)); + return E_NOTIMPL; +} + +static HRESULT WINAPI HTMLInputElement_private_get_formAction(IWineHTMLInputPrivate *iface, BSTR *ret) +{ + HTMLInputElement *This = impl_from_IWineHTMLInputPrivateVtbl(iface); + FIXME("(%p)->(%p)\n", This, ret); + return E_NOTIMPL; +} + +static HRESULT WINAPI HTMLInputElement_private_put_formEnctype(IWineHTMLInputPrivate *iface, BSTR v) +{ + HTMLInputElement *This = impl_from_IWineHTMLInputPrivateVtbl(iface); + FIXME("(%p)->(%s)\n", This, debugstr_w(v)); + return E_NOTIMPL; +} + +static HRESULT WINAPI HTMLInputElement_private_get_formEnctype(IWineHTMLInputPrivate *iface, BSTR *ret) +{ + HTMLInputElement *This = impl_from_IWineHTMLInputPrivateVtbl(iface); + FIXME("(%p)->(%p)\n", This, ret); + return E_NOTIMPL; +} + +static HRESULT WINAPI HTMLInputElement_private_put_formMethod(IWineHTMLInputPrivate *iface, BSTR v) +{ + HTMLInputElement *This = impl_from_IWineHTMLInputPrivateVtbl(iface); + FIXME("(%p)->(%s)\n", This, debugstr_w(v)); + return E_NOTIMPL; +} + +static HRESULT WINAPI HTMLInputElement_private_get_formMethod(IWineHTMLInputPrivate *iface, BSTR *ret) +{ + HTMLInputElement *This = impl_from_IWineHTMLInputPrivateVtbl(iface); + FIXME("(%p)->(%p)\n", This, ret); + return E_NOTIMPL; +} + +static HRESULT WINAPI HTMLInputElement_private_put_formNoValidate(IWineHTMLInputPrivate *iface, VARIANT_BOOL v) +{ + HTMLInputElement *This = impl_from_IWineHTMLInputPrivateVtbl(iface); + FIXME("(%p)->(%x)\n", This, v); + return E_NOTIMPL; +} + +static HRESULT WINAPI HTMLInputElement_private_get_formNoValidate(IWineHTMLInputPrivate *iface, VARIANT_BOOL *ret) +{ + HTMLInputElement *This = impl_from_IWineHTMLInputPrivateVtbl(iface); + FIXME("(%p)->(%p)\n", This, ret); + return E_NOTIMPL; +} + +static HRESULT WINAPI HTMLInputElement_private_put_formTarget(IWineHTMLInputPrivate *iface, BSTR v) +{ + HTMLInputElement *This = impl_from_IWineHTMLInputPrivateVtbl(iface); + FIXME("(%p)->(%s)\n", This, debugstr_w(v)); + return E_NOTIMPL; +} + +static HRESULT WINAPI HTMLInputElement_private_get_formTarget(IWineHTMLInputPrivate *iface, BSTR *ret) +{ + HTMLInputElement *This = impl_from_IWineHTMLInputPrivateVtbl(iface); + FIXME("(%p)->(%p)\n", This, ret); + return E_NOTIMPL; +} + +static const IWineHTMLInputPrivateVtbl WineHTMLInputPrivateVtbl = { + HTMLInputElement_private_QueryInterface, + HTMLInputElement_private_AddRef, + HTMLInputElement_private_Release, + HTMLInputElement_private_GetTypeInfoCount, + HTMLInputElement_private_GetTypeInfo, + HTMLInputElement_private_GetIDsOfNames, + HTMLInputElement_private_Invoke, + HTMLInputElement_private_put_autofocus, + HTMLInputElement_private_get_autofocus, + HTMLInputElement_private_get_validationMessage, + HTMLInputElement_private_get_validity, + HTMLInputElement_private_get_willValidate, + HTMLInputElement_private_setCustomValidity, + HTMLInputElement_private_checkValidity, + HTMLInputElement_private_put_formAction, + HTMLInputElement_private_get_formAction, + HTMLInputElement_private_put_formEnctype, + HTMLInputElement_private_get_formEnctype, + HTMLInputElement_private_put_formMethod, + HTMLInputElement_private_get_formMethod, + HTMLInputElement_private_put_formNoValidate, + HTMLInputElement_private_get_formNoValidate, + HTMLInputElement_private_put_formTarget, + HTMLInputElement_private_get_formTarget +}; + static inline HTMLInputElement *impl_from_HTMLDOMNode(HTMLDOMNode *iface) { return CONTAINING_RECORD(iface, HTMLInputElement, element.node); @@ -1241,6 +1396,8 @@ static void *HTMLInputElement_query_interface(DispatchEx *dispex, REFIID riid) return &This->IHTMLInputTextElement_iface; if(IsEqualGUID(&IID_IHTMLInputTextElement2, riid)) return &This->IHTMLInputTextElement2_iface; + if(IsEqualGUID(&IID_IWineHTMLInputPrivate, riid)) + return &This->IWineHTMLInputPrivate_iface; return HTMLElement_query_interface(&This->element.node.event_target.dispex, riid); } @@ -1288,6 +1445,8 @@ static void HTMLInputElement_init_dispex_info(dispex_data_t *info, compat_mode_t }; dispex_info_add_interface(info, IHTMLInputElement_tid, input_hooks); dispex_info_add_interface(info, IHTMLInputTextElement2_tid, inputtext_hooks); + if(mode >= COMPAT_MODE_IE10) + dispex_info_add_interface(info, IWineHTMLInputPrivate_tid, NULL); HTMLElement_init_dispex_info(info, mode); } @@ -1324,6 +1483,7 @@ HRESULT HTMLInputElement_Create(HTMLDocumentNode *doc, nsIDOMElement *nselem, HT ret->IHTMLInputElement_iface.lpVtbl = &HTMLInputElementVtbl; ret->IHTMLInputTextElement_iface.lpVtbl = &HTMLInputTextElementVtbl; ret->IHTMLInputTextElement2_iface.lpVtbl = &HTMLInputTextElement2Vtbl; + ret->IWineHTMLInputPrivate_iface.lpVtbl = &WineHTMLInputPrivateVtbl; ret->element.node.vtbl = &HTMLInputElementImplVtbl; HTMLElement_Init(&ret->element, doc, nselem, &HTMLInputElement_dispex); diff --git a/dlls/mshtml/mshtml_private.h b/dlls/mshtml/mshtml_private.h index dd2ccb7f05f..2f59e0dca5d 100644 --- a/dlls/mshtml/mshtml_private.h +++ b/dlls/mshtml/mshtml_private.h @@ -311,6 +311,7 @@ struct constructor; XIID(IWineHTMLCharacterData) \ XIID(IWineHTMLDOMNodePrivate) \ XIID(IWineHTMLElementPrivate) \ + XIID(IWineHTMLInputPrivate) \ XIID(IWineHTMLFormPrivate) \ XIID(IWineHTMLWindowPrivate) \ XIID(IWineHTMLWindowCompatPrivate) \ diff --git a/dlls/mshtml/mshtml_private_iface.idl b/dlls/mshtml/mshtml_private_iface.idl index e5d8a93060d..29fd18bb157 100644 --- a/dlls/mshtml/mshtml_private_iface.idl +++ b/dlls/mshtml/mshtml_private_iface.idl @@ -226,6 +226,51 @@ interface IWineHTMLFormPrivate : IDispatch HRESULT checkValidity([retval, out] VARIANT_BOOL *ret); } +[ + odl, + oleautomation, + dual, + hidden, + uuid(f356f6d2-f210-4f54-24c7-3f88fa3c20fc) +] +interface IWineHTMLInputPrivate : IDispatch +{ + [propput, id(50)] + HRESULT autofocus([in] VARIANT_BOOL v); + [propget, id(50)] + HRESULT autofocus([retval, out] VARIANT_BOOL *ret); + [propget, id(51)] + HRESULT validationMessage([retval, out] BSTR *ret); + [propget, id(52)] + HRESULT validity([retval, out] IDispatch **ret); + [propget, id(53)] + HRESULT willValidate([retval, out] VARIANT_BOOL *ret); + [id(54)] + HRESULT setCustomValidity([in] VARIANT *message); + [id(55)] + HRESULT checkValidity([retval, out] VARIANT_BOOL *ret); + [propput, id(56)] + HRESULT formAction([in] BSTR v); + [propget, id(56)] + HRESULT formAction([retval, out] BSTR *ret); + [propput, id(57)] + HRESULT formEnctype([in] BSTR v); + [propget, id(57)] + HRESULT formEnctype([retval, out] BSTR *ret); + [propput, id(58)] + HRESULT formMethod([in] BSTR v); + [propget, id(58)] + HRESULT formMethod([retval, out] BSTR *ret); + [propput, id(59)] + HRESULT formNoValidate([in] VARIANT_BOOL v); + [propget, id(59)] + HRESULT formNoValidate([retval, out] VARIANT_BOOL *ret); + [propput, id(60)] + HRESULT formTarget([in] BSTR v); + [propget, id(60)] + HRESULT formTarget([retval, out] BSTR *ret); +} + [ odl, oleautomation, diff --git a/dlls/mshtml/tests/documentmode.js b/dlls/mshtml/tests/documentmode.js index b4ad5dd39bd..56148a8cc87 100644 --- a/dlls/mshtml/tests/documentmode.js +++ b/dlls/mshtml/tests/documentmode.js @@ -4361,10 +4361,8 @@ sync_test("prototype props", function() { "size", "src", "start", "status", ["step",10], ["stepDown",10], ["stepUp",10], "type", "useMap", ["validationMessage",10], ["validity",10], "value", ["valueAsNumber",10], "vrml", "vspace", "width", ["willValidate",10] ], [ - "accept", ["autocomplete",10], ["autofocus",10], ["checkValidity",10], ["dataFld",9,10], ["dataFormatAs",9,10], ["dataSrc",9,10], ["files",10], ["formAction",10], - ["formEnctype",10], ["formMethod",10], ["formNoValidate",10], ["formTarget",10], ["list",10], ["max",10], ["min",10], ["multiple",10], ["pattern",10], - ["placeholder",10], ["readyState",11], ["required",10], ["setCustomValidity",10], ["step",10], ["stepDown",10], ["stepUp",10], "useMap", ["validationMessage",10], - ["validity",10], ["valueAsNumber",10], ["willValidate",10] + "accept", ["autocomplete",10], ["dataFld",9,10], ["dataFormatAs",9,10], ["dataSrc",9,10], ["files",10],["list",10], ["max",10], ["min",10], ["multiple",10], + ["pattern",10], ["placeholder",10], ["readyState",11], ["required",10], ["step",10], ["stepDown",10], ["stepUp",10], "useMap", ["valueAsNumber",10] ]); check(HTMLLabelElement, [ ["dataFld",9,10], ["dataFormatAs",9,10], ["dataSrc",9,10], "form", "htmlFor" ], [ ["dataFld",9,10], ["dataFormatAs",9,10], ["dataSrc",9,10], "form" ]); check(HTMLLinkElement, [ "charset", "href", "hreflang", "media", "rel", "rev", "sheet", ["styleSheet",9,10], "target", "type" ], -- GitLab https://gitlab.winehq.org/wine/wine/-/merge_requests/9252