Nikolay Sivov : mshtml: Implement IHTMLTable_get_tBodies.

Alexandre Julliard julliard at winehq.org
Mon Apr 15 13:09:40 CDT 2013


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

Author: Nikolay Sivov <nsivov at codeweavers.com>
Date:   Sun Apr 14 18:43:30 2013 +0400

mshtml: Implement IHTMLTable_get_tBodies.

---

 dlls/mshtml/htmltable.c |   17 +++++++++++++++--
 dlls/mshtml/tests/dom.c |   11 ++++++++++-
 2 files changed, 25 insertions(+), 3 deletions(-)

diff --git a/dlls/mshtml/htmltable.c b/dlls/mshtml/htmltable.c
index 85daf5b..f3c7ba8 100644
--- a/dlls/mshtml/htmltable.c
+++ b/dlls/mshtml/htmltable.c
@@ -379,8 +379,21 @@ static HRESULT WINAPI HTMLTable_get_tFoot(IHTMLTable *iface, IHTMLTableSection *
 static HRESULT WINAPI HTMLTable_get_tBodies(IHTMLTable *iface, IHTMLElementCollection **p)
 {
     HTMLTable *This = impl_from_IHTMLTable(iface);
-    FIXME("(%p)->(%p)\n", This, p);
-    return E_NOTIMPL;
+    nsIDOMHTMLCollection *nscol = NULL;
+    nsresult nsres;
+
+    TRACE("(%p)->(%p)\n", This, p);
+
+    nsres = nsIDOMHTMLTableElement_GetTBodies(This->nstable, &nscol);
+    if(NS_FAILED(nsres)) {
+        ERR("GetTBodies failed: %08x\n", nsres);
+        return E_FAIL;
+    }
+
+    *p = create_collection_from_htmlcol(This->element.node.doc, nscol);
+
+    nsIDOMHTMLCollection_Release(nscol);
+    return S_OK;
 }
 
 static HRESULT WINAPI HTMLTable_get_caption(IHTMLTable *iface, IHTMLTableCaption **p)
diff --git a/dlls/mshtml/tests/dom.c b/dlls/mshtml/tests/dom.c
index 5cb0a94..44306ee 100644
--- a/dlls/mshtml/tests/dom.c
+++ b/dlls/mshtml/tests/dom.c
@@ -5466,6 +5466,7 @@ static void test_table_elem(IHTMLElement *elem)
 
     static const elem_type_t row_types[] = {ET_TR,ET_TR};
     static const elem_type_t all_types[] = {ET_TBODY,ET_TR,ET_TR,ET_TD,ET_TD};
+    static const elem_type_t tbodies_types[] = {ET_TBODY};
 
     hres = IHTMLElement_QueryInterface(elem, &IID_IHTMLTable, (void**)&table);
     ok(hres == S_OK, "Could not get IHTMLTable iface: %08x\n", hres);
@@ -5475,7 +5476,7 @@ static void test_table_elem(IHTMLElement *elem)
     col = NULL;
     hres = IHTMLTable_get_rows(table, &col);
     ok(hres == S_OK, "get_rows failed: %08x\n", hres);
-    ok(col != NULL, "get_ros returned NULL\n");
+    ok(col != NULL, "get_rows returned NULL\n");
 
     test_elem_collection((IUnknown*)col, row_types, sizeof(row_types)/sizeof(*row_types));
     IHTMLElementCollection_Release(col);
@@ -5492,6 +5493,14 @@ static void test_table_elem(IHTMLElement *elem)
     test_elem_all((IUnknown*)node, NULL, 0);
     IHTMLDOMNode_Release(node);
 
+    col = NULL;
+    hres = IHTMLTable_get_tBodies(table, &col);
+    ok(hres == S_OK, "get_tBodies failed: %08x\n", hres);
+    ok(col != NULL, "get_tBodies returned NULL\n");
+
+    test_elem_collection((IUnknown*)col, tbodies_types, sizeof(tbodies_types)/sizeof(*tbodies_types));
+    IHTMLElementCollection_Release(col);
+
     IHTMLTable_Release(table);
 }
 




More information about the wine-cvs mailing list