Jacek Caban : mshtml: Added IE9+ mode support to HTMLFormElement:: elements property.

Alexandre Julliard julliard at winehq.org
Thu Feb 8 15:33:08 CST 2018


Module: wine
Branch: master
Commit: 86475d5bab78e243750bd40b22b375a60c5d229f
URL:    https://source.winehq.org/git/wine.git/?a=commit;h=86475d5bab78e243750bd40b22b375a60c5d229f

Author: Jacek Caban <jacek at codeweavers.com>
Date:   Thu Feb  8 20:53:41 2018 +0100

mshtml: Added IE9+ mode support to HTMLFormElement::elements property.

Signed-off-by: Jacek Caban <jacek at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/mshtml/htmlform.c | 17 +++++++++++++++--
 1 file changed, 15 insertions(+), 2 deletions(-)

diff --git a/dlls/mshtml/htmlform.c b/dlls/mshtml/htmlform.c
index f73970f..2957ad1 100644
--- a/dlls/mshtml/htmlform.c
+++ b/dlls/mshtml/htmlform.c
@@ -275,11 +275,24 @@ static HRESULT WINAPI HTMLFormElement_get_method(IHTMLFormElement *iface, BSTR *
 static HRESULT WINAPI HTMLFormElement_get_elements(IHTMLFormElement *iface, IDispatch **p)
 {
     HTMLFormElement *This = impl_from_IHTMLFormElement(iface);
+    nsIDOMHTMLCollection *elements;
+    nsresult nsres;
 
     TRACE("(%p)->(%p)\n", This, p);
 
-    *p = (IDispatch*)&This->IHTMLFormElement_iface;
-    IDispatch_AddRef(*p);
+    if(dispex_compat_mode(&This->element.node.event_target.dispex) < COMPAT_MODE_IE9) {
+        IDispatch_AddRef(*p = (IDispatch*)&This->IHTMLFormElement_iface);
+        return S_OK;
+    }
+
+    nsres = nsIDOMHTMLFormElement_GetElements(This->nsform, &elements);
+    if(NS_FAILED(nsres)) {
+        ERR("GetElements failed: %08x\n", nsres);
+        return E_FAIL;
+    }
+
+    *p = (IDispatch*)create_collection_from_htmlcol(This->element.node.doc, elements);
+    nsIDOMHTMLCollection_Release(elements);
     return S_OK;
 }
 




More information about the wine-cvs mailing list