From: Gabriel Ivăncescu gabrielopcode@gmail.com
Signed-off-by: Gabriel Ivăncescu gabrielopcode@gmail.com --- dlls/mshtml/htmlinput.c | 184 ++++++++++++++++++++++++++++++ dlls/mshtml/tests/documentmode.js | 6 +- 2 files changed, 185 insertions(+), 5 deletions(-)
diff --git a/dlls/mshtml/htmlinput.c b/dlls/mshtml/htmlinput.c index 2231310ae2a..117e8008690 100644 --- a/dlls/mshtml/htmlinput.c +++ b/dlls/mshtml/htmlinput.c @@ -1664,6 +1664,8 @@ struct HTMLButtonElement { HTMLElement element;
IHTMLButtonElement IHTMLButtonElement_iface; + IWineHTMLInputPrivate IWineHTMLInputPrivate_iface; + IWineHTMLParentFormPrivate IWineHTMLParentFormPrivate_iface;
nsIDOMHTMLButtonElement *nsbutton; }; @@ -1841,6 +1843,178 @@ static const IHTMLButtonElementVtbl HTMLButtonElementVtbl = { HTMLButtonElement_createTextRange };
+static inline HTMLButtonElement *button_from_IWineHTMLInputPrivateVtbl(IWineHTMLInputPrivate *iface) +{ + return CONTAINING_RECORD(iface, HTMLButtonElement, IWineHTMLInputPrivate_iface); +} + +DISPEX_IDISPATCH_IMPL(HTMLButtonElement_private, IWineHTMLInputPrivate, + button_from_IWineHTMLInputPrivateVtbl(iface)->element.node.event_target.dispex) + +static HRESULT WINAPI HTMLButtonElement_private_put_autofocus(IWineHTMLInputPrivate *iface, VARIANT_BOOL v) +{ + HTMLButtonElement *This = button_from_IWineHTMLInputPrivateVtbl(iface); + FIXME("(%p)->(%x)\n", This, v); + return E_NOTIMPL; +} + +static HRESULT WINAPI HTMLButtonElement_private_get_autofocus(IWineHTMLInputPrivate *iface, VARIANT_BOOL *ret) +{ + HTMLButtonElement *This = button_from_IWineHTMLInputPrivateVtbl(iface); + FIXME("(%p)->(%p)\n", This, ret); + return E_NOTIMPL; +} + +static HRESULT WINAPI HTMLButtonElement_private_get_validationMessage(IWineHTMLInputPrivate *iface, BSTR *ret) +{ + HTMLButtonElement *This = button_from_IWineHTMLInputPrivateVtbl(iface); + FIXME("(%p)->(%p)\n", This, ret); + return E_NOTIMPL; +} + +static HRESULT WINAPI HTMLButtonElement_private_get_validity(IWineHTMLInputPrivate *iface, IDispatch **ret) +{ + HTMLButtonElement *This = button_from_IWineHTMLInputPrivateVtbl(iface); + FIXME("(%p)->(%p)\n", This, ret); + return E_NOTIMPL; +} + +static HRESULT WINAPI HTMLButtonElement_private_get_willValidate(IWineHTMLInputPrivate *iface, VARIANT_BOOL *ret) +{ + HTMLButtonElement *This = button_from_IWineHTMLInputPrivateVtbl(iface); + FIXME("(%p)->(%p)\n", This, ret); + return E_NOTIMPL; +} + +static HRESULT WINAPI HTMLButtonElement_private_setCustomValidity(IWineHTMLInputPrivate *iface, VARIANT *message) +{ + HTMLButtonElement *This = button_from_IWineHTMLInputPrivateVtbl(iface); + FIXME("(%p)->(%s)\n", This, debugstr_variant(message)); + return E_NOTIMPL; +} + +static HRESULT WINAPI HTMLButtonElement_private_checkValidity(IWineHTMLInputPrivate *iface, VARIANT_BOOL *ret) +{ + HTMLButtonElement *This = button_from_IWineHTMLInputPrivateVtbl(iface); + FIXME("(%p)->(%p)\n", This, ret); + return E_NOTIMPL; +} + +static const IWineHTMLInputPrivateVtbl WineHTMLButtonInputPrivateVtbl = { + HTMLButtonElement_private_QueryInterface, + HTMLButtonElement_private_AddRef, + HTMLButtonElement_private_Release, + HTMLButtonElement_private_GetTypeInfoCount, + HTMLButtonElement_private_GetTypeInfo, + HTMLButtonElement_private_GetIDsOfNames, + HTMLButtonElement_private_Invoke, + HTMLButtonElement_private_put_autofocus, + HTMLButtonElement_private_get_autofocus, + HTMLButtonElement_private_get_validationMessage, + HTMLButtonElement_private_get_validity, + HTMLButtonElement_private_get_willValidate, + HTMLButtonElement_private_setCustomValidity, + HTMLButtonElement_private_checkValidity +}; + +static inline HTMLButtonElement *button_from_IWineHTMLParentFormPrivateVtbl(IWineHTMLParentFormPrivate *iface) +{ + return CONTAINING_RECORD(iface, HTMLButtonElement, IWineHTMLParentFormPrivate_iface); +} + +DISPEX_IDISPATCH_IMPL(HTMLButtonElement_form_private, IWineHTMLParentFormPrivate, + button_from_IWineHTMLParentFormPrivateVtbl(iface)->element.node.event_target.dispex) + +static HRESULT WINAPI HTMLButtonElement_form_private_put_formAction(IWineHTMLParentFormPrivate *iface, BSTR v) +{ + HTMLButtonElement *This = button_from_IWineHTMLParentFormPrivateVtbl(iface); + FIXME("(%p)->(%s)\n", This, debugstr_w(v)); + return E_NOTIMPL; +} + +static HRESULT WINAPI HTMLButtonElement_form_private_get_formAction(IWineHTMLParentFormPrivate *iface, BSTR *ret) +{ + HTMLButtonElement *This = button_from_IWineHTMLParentFormPrivateVtbl(iface); + FIXME("(%p)->(%p)\n", This, ret); + return E_NOTIMPL; +} + +static HRESULT WINAPI HTMLButtonElement_form_private_put_formEnctype(IWineHTMLParentFormPrivate *iface, BSTR v) +{ + HTMLButtonElement *This = button_from_IWineHTMLParentFormPrivateVtbl(iface); + FIXME("(%p)->(%s)\n", This, debugstr_w(v)); + return E_NOTIMPL; +} + +static HRESULT WINAPI HTMLButtonElement_form_private_get_formEnctype(IWineHTMLParentFormPrivate *iface, BSTR *ret) +{ + HTMLButtonElement *This = button_from_IWineHTMLParentFormPrivateVtbl(iface); + FIXME("(%p)->(%p)\n", This, ret); + return E_NOTIMPL; +} + +static HRESULT WINAPI HTMLButtonElement_form_private_put_formMethod(IWineHTMLParentFormPrivate *iface, BSTR v) +{ + HTMLButtonElement *This = button_from_IWineHTMLParentFormPrivateVtbl(iface); + FIXME("(%p)->(%s)\n", This, debugstr_w(v)); + return E_NOTIMPL; +} + +static HRESULT WINAPI HTMLButtonElement_form_private_get_formMethod(IWineHTMLParentFormPrivate *iface, BSTR *ret) +{ + HTMLButtonElement *This = button_from_IWineHTMLParentFormPrivateVtbl(iface); + FIXME("(%p)->(%p)\n", This, ret); + return E_NOTIMPL; +} + +static HRESULT WINAPI HTMLButtonElement_form_private_put_formNoValidate(IWineHTMLParentFormPrivate *iface, VARIANT_BOOL v) +{ + HTMLButtonElement *This = button_from_IWineHTMLParentFormPrivateVtbl(iface); + FIXME("(%p)->(%x)\n", This, v); + return E_NOTIMPL; +} + +static HRESULT WINAPI HTMLButtonElement_form_private_get_formNoValidate(IWineHTMLParentFormPrivate *iface, VARIANT_BOOL *ret) +{ + HTMLButtonElement *This = button_from_IWineHTMLParentFormPrivateVtbl(iface); + FIXME("(%p)->(%p)\n", This, ret); + return E_NOTIMPL; +} + +static HRESULT WINAPI HTMLButtonElement_form_private_put_formTarget(IWineHTMLParentFormPrivate *iface, BSTR v) +{ + HTMLButtonElement *This = button_from_IWineHTMLParentFormPrivateVtbl(iface); + FIXME("(%p)->(%s)\n", This, debugstr_w(v)); + return E_NOTIMPL; +} + +static HRESULT WINAPI HTMLButtonElement_form_private_get_formTarget(IWineHTMLParentFormPrivate *iface, BSTR *ret) +{ + HTMLButtonElement *This = button_from_IWineHTMLParentFormPrivateVtbl(iface); + FIXME("(%p)->(%p)\n", This, ret); + return E_NOTIMPL; +} + +static const IWineHTMLParentFormPrivateVtbl WineHTMLButtonParentFormPrivateVtbl = { + HTMLButtonElement_form_private_QueryInterface, + HTMLButtonElement_form_private_AddRef, + HTMLButtonElement_form_private_Release, + HTMLButtonElement_form_private_GetTypeInfoCount, + HTMLButtonElement_form_private_GetTypeInfo, + HTMLButtonElement_form_private_GetIDsOfNames, + HTMLButtonElement_form_private_Invoke, + HTMLButtonElement_form_private_put_formAction, + HTMLButtonElement_form_private_get_formAction, + HTMLButtonElement_form_private_put_formEnctype, + HTMLButtonElement_form_private_get_formEnctype, + HTMLButtonElement_form_private_put_formMethod, + HTMLButtonElement_form_private_get_formMethod, + HTMLButtonElement_form_private_put_formNoValidate, + HTMLButtonElement_form_private_get_formNoValidate, + HTMLButtonElement_form_private_put_formTarget, + HTMLButtonElement_form_private_get_formTarget +}; + static inline HTMLButtonElement *button_from_HTMLDOMNode(HTMLDOMNode *iface) { return CONTAINING_RECORD(iface, HTMLButtonElement, element.node); @@ -1874,6 +2048,10 @@ static void *HTMLButtonElement_query_interface(DispatchEx *dispex, REFIID riid)
if(IsEqualGUID(&IID_IHTMLButtonElement, riid)) return &This->IHTMLButtonElement_iface; + if(IsEqualGUID(&IID_IWineHTMLInputPrivate, riid)) + return &This->IWineHTMLInputPrivate_iface; + if(IsEqualGUID(&IID_IWineHTMLParentFormPrivate, riid)) + return &This->IWineHTMLParentFormPrivate_iface;
return HTMLElement_query_interface(&This->element.node.event_target.dispex, riid); } @@ -1913,6 +2091,10 @@ static void HTMLButtonElement_init_dispex_info(dispex_data_t *info, compat_mode_ {DISPID_UNKNOWN} }; dispex_info_add_interface(info, IHTMLButtonElement_tid, button_hooks); + if(mode >= COMPAT_MODE_IE10) { + dispex_info_add_interface(info, IWineHTMLInputPrivate_tid, NULL); + dispex_info_add_interface(info, IWineHTMLParentFormPrivate_tid, NULL); + }
HTMLElement_init_dispex_info(info, mode); } @@ -1947,6 +2129,8 @@ HRESULT HTMLButtonElement_Create(HTMLDocumentNode *doc, nsIDOMElement *nselem, H return E_OUTOFMEMORY;
ret->IHTMLButtonElement_iface.lpVtbl = &HTMLButtonElementVtbl; + ret->IWineHTMLInputPrivate_iface.lpVtbl = &WineHTMLButtonInputPrivateVtbl; + ret->IWineHTMLParentFormPrivate_iface.lpVtbl = &WineHTMLButtonParentFormPrivateVtbl; ret->element.node.vtbl = &HTMLButtonElementImplVtbl;
HTMLElement_Init(&ret->element, doc, nselem, &HTMLButtonElement_dispex); diff --git a/dlls/mshtml/tests/documentmode.js b/dlls/mshtml/tests/documentmode.js index 56148a8cc87..46c2aa8a6eb 100644 --- a/dlls/mshtml/tests/documentmode.js +++ b/dlls/mshtml/tests/documentmode.js @@ -4288,11 +4288,7 @@ sync_test("prototype props", function() { ["autofocus",10], ["checkValidity",10], "createTextRange", ["dataFld",9,10], ["dataFormatAs",9,10], ["dataSrc",9,10], "form", ["formAction",10], ["formEnctype",10], ["formMethod",10], ["formNoValidate",10], ["formTarget",10], "name", ["setCustomValidity",10], "status", "type", ["validationMessage",10], ["validity",10], "value", ["willValidate",10] - ], [ - ["autofocus",10], ["checkValidity",10], ["dataFld",9,10], ["dataFormatAs",9,10], ["dataSrc",9,10], ["formAction",10], - ["formEnctype",10], ["formMethod",10], ["formNoValidate",10], ["formTarget",10], ["setCustomValidity",10], - ["validationMessage",10], ["validity",10], ["willValidate",10] - ]); + ], [ ["dataFld",9,10], ["dataFormatAs",9,10], ["dataSrc",9,10] ]); if(v >= 11) check(HTMLDocument, []); check(HTMLElement, [