mshtml: Added IHTMLTableCell::rowSpan property implementation.

Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Jacek Caban 2017-04-07 19:19:09 +02:00 committed by Alexandre Julliard
parent 7d8cf318a4
commit b1c7b89125
2 changed files with 55 additions and 15 deletions

View File

@ -100,15 +100,36 @@ static HRESULT WINAPI HTMLTableCell_Invoke(IHTMLTableCell *iface, DISPID dispIdM
static HRESULT WINAPI HTMLTableCell_put_rowSpan(IHTMLTableCell *iface, LONG v)
{
HTMLTableCell *This = impl_from_IHTMLTableCell(iface);
FIXME("(%p)->(%d)\n", This, v);
return E_NOTIMPL;
nsresult nsres;
TRACE("(%p)->(%d)\n", This, v);
if(v <= 0)
return E_INVALIDARG;
nsres = nsIDOMHTMLTableCellElement_SetRowSpan(This->nscell, v);
if(NS_FAILED(nsres)) {
ERR("SetRowSpan failed: %08x\n", nsres);
return E_FAIL;
}
return S_OK;
}
static HRESULT WINAPI HTMLTableCell_get_rowSpan(IHTMLTableCell *iface, LONG *p)
{
HTMLTableCell *This = impl_from_IHTMLTableCell(iface);
FIXME("(%p)->(%p)\n", This, p);
return E_NOTIMPL;
nsresult nsres;
TRACE("(%p)->(%p)\n", This, p);
nsres = nsIDOMHTMLTableCellElement_GetRowSpan(This->nscell, p);
if(NS_FAILED(nsres)) {
ERR("GetRowSpan failed: %08x\n", nsres);
return E_FAIL;
}
return S_OK;
}
static HRESULT WINAPI HTMLTableCell_put_colSpan(IHTMLTableCell *iface, LONG v)

View File

@ -7234,23 +7234,31 @@ static void test_tr_elem(IHTMLElement *elem)
IHTMLTableRow_Release(row);
}
static void test_td_elem(IHTMLElement *elem)
static void test_td_elem(IHTMLDocument2 *doc, IHTMLElement *div)
{
IHTMLTableCell *cell;
IHTMLElement *elem;
HRESULT hres;
LONG lval;
BSTR str;
VARIANT vbg, vDefaultbg;
test_elem_set_innerhtml((IUnknown*)div,
"<table id=\"tbl\"><tbody>"
" <tr></tr>"
" <tr id=\"row2\"><td id=\"td1\">td1 text</td><td id=\"td2\">td2 text</td><td></td></tr>"
" <tr></tr>"
"</tbody></table>");
elem = get_doc_elem_by_id(doc, "td1");
hres = IHTMLElement_QueryInterface(elem, &IID_IHTMLTableCell, (void**)&cell);
ok(hres == S_OK, "Could not get IHTMLTableRow iface: %08x\n", hres);
if(FAILED(hres))
return;
IHTMLElement_Release(elem);
lval = 0xdeadbeef;
hres = IHTMLTableCell_get_cellIndex(cell, &lval);
ok(hres == S_OK, "get cellIndex failed: %08x\n", hres);
ok(lval == 1, "Expected 1, got %d\n", lval);
ok(!lval, "Expected 0, got %d\n", lval);
str = a2bstr("left");
hres = IHTMLTableCell_put_align(cell, str);
@ -7300,6 +7308,23 @@ static void test_td_elem(IHTMLElement *elem)
ok(hres == S_OK, "put_bgColor failed: %08x\n", hres);
VariantClear(&vDefaultbg);
hres = IHTMLTableCell_get_rowSpan(cell, &lval);
ok(hres == S_OK, "get_rowSpan failed: %08x\n", hres);
ok(lval == 1, "rowSpan = %d\n", lval);
hres = IHTMLTableCell_put_rowSpan(cell, -1);
ok(hres == E_INVALIDARG, "put_rowSpan failed: %08x\n", hres);
hres = IHTMLTableCell_put_rowSpan(cell, 0);
ok(hres == E_INVALIDARG, "put_rowSpan failed: %08x\n", hres);
hres = IHTMLTableCell_put_rowSpan(cell, 2);
ok(hres == S_OK, "put_rowSpan failed: %08x\n", hres);
hres = IHTMLTableCell_get_rowSpan(cell, &lval);
ok(hres == S_OK, "get_rowSpan failed: %08x\n", hres);
ok(lval == 2, "rowSpan = %d\n", lval);
IHTMLTableCell_Release(cell);
}
@ -8543,13 +8568,6 @@ static void test_elems(IHTMLDocument2 *doc)
IHTMLElement_Release(elem);
}
elem = get_doc_elem_by_id(doc, "td2");
ok(elem != NULL, "elem == NULL\n");
if(elem) {
test_td_elem(elem);
IHTMLElement_Release(elem);
}
elem = get_doc_elem_by_id(doc, "row2");
ok(elem != NULL, "elem == NULL\n");
if(elem) {
@ -9246,6 +9264,7 @@ static void test_elems2(IHTMLDocument2 *doc)
IHTMLElement_Release(elem);
}
test_td_elem(doc, div);
test_attr(doc, div);
test_blocked(doc, div);
test_elem_names(doc);