Paul Vriens : mshtml: Match IE8 implementation.

Alexandre Julliard julliard at winehq.org
Wed May 27 09:26:57 CDT 2009


Module: wine
Branch: master
Commit: 79fcaa78357b87e550f0d65fe832d300fd5ca694
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=79fcaa78357b87e550f0d65fe832d300fd5ca694

Author: Paul Vriens <Paul.Vriens.Wine at gmail.com>
Date:   Wed May 27 13:21:25 2009 +0200

mshtml: Match IE8 implementation.

---

 dlls/mshtml/htmlnode.c  |    5 +++++
 dlls/mshtml/tests/dom.c |   10 ++++++----
 2 files changed, 11 insertions(+), 4 deletions(-)

diff --git a/dlls/mshtml/htmlnode.c b/dlls/mshtml/htmlnode.c
index 32b0801..720bbfe 100644
--- a/dlls/mshtml/htmlnode.c
+++ b/dlls/mshtml/htmlnode.c
@@ -157,6 +157,11 @@ static HRESULT WINAPI HTMLDOMChildrenCollection_item(IHTMLDOMChildrenCollection
 
     TRACE("(%p)->(%d %p)\n", This, index, ppItem);
 
+    if (ppItem)
+        *ppItem = NULL;
+    else
+        return E_POINTER;
+
     nsIDOMNodeList_GetLength(This->nslist, &length);
     if(index < 0 || index >= length)
         return E_INVALIDARG;
diff --git a/dlls/mshtml/tests/dom.c b/dlls/mshtml/tests/dom.c
index aaf1a39..497fc0a 100644
--- a/dlls/mshtml/tests/dom.c
+++ b/dlls/mshtml/tests/dom.c
@@ -4456,15 +4456,17 @@ static void test_elems(IHTMLDocument2 *doc)
             IHTMLDOMNode_Release(node);
         }
 
-        disp = (void*)0xdeadbeef;
+        hres = IHTMLDOMChildrenCollection_item(child_col, length - 1, NULL);
+        ok(hres == E_POINTER, "item failed: %08x, expected E_POINTER\n", hres);
+
+        hres = IHTMLDOMChildrenCollection_item(child_col, length, NULL);
+        ok(hres == E_POINTER, "item failed: %08x, expected E_POINTER\n", hres);
+
         hres = IHTMLDOMChildrenCollection_item(child_col, 6000, &disp);
         ok(hres == E_INVALIDARG, "item failed: %08x, expected E_INVALIDARG\n", hres);
-        ok(disp == (void*)0xdeadbeef, "disp=%p\n", disp);
 
-        disp = (void*)0xdeadbeef;
         hres = IHTMLDOMChildrenCollection_item(child_col, length, &disp);
         ok(hres == E_INVALIDARG, "item failed: %08x, expected E_INVALIDARG\n", hres);
-        ok(disp == (void*)0xdeadbeef, "disp=%p\n", disp);
 
         test_child_col_disp(child_col);
 




More information about the wine-cvs mailing list