Ideas about mshtml for GSoC 2014

Zhenbo Li litimetal at gmail.com
Sun Mar 9 23:21:09 CDT 2014


Hello,

I'm Zhenbo Li, a student in Shanghai JiaoTong University, China. I
have been a Wine user for almost 4 years, and I've been preparing for
GSoC for several month.

Since 2013, I've translated some wiki pages into Chinese[1], reported
nearly 40 bugs[2], involved in Appdb[3], and sent few patches[4]. I'm
glad to do more contribution to Wine in 2014.

While using Wine, it is common to face a bug in mshtml[5]. Native
iexplore may be a workaround, but it can cause other problems, too. So
my idea is to implement some functions in mshtml.dll.

I have a rough plan now, and I wish to get your advice. As I have
about 3 months, I want to implement some functions in IHTMLTable,
IHTMLTableCol, etc., and write testcaes for them. I've written some
draft patches for IHTMLTableRow, and I'll send them to wine-patches
after improving them with your advice. I hope I can establish a proper
schedule after communicating with my mentor.

I'm also open to any suggestion, and any comment or advice is great appreciated.

Thank you.

FYI, my first name is Zhenbo, and my last(family) name is Li. So
Zhenbo Li and Li Zhenbo means the same person lol.


[1]: I contributed to FAQ, RegressionTesting, Bugs, etc.
[2]: http://bugs.winehq.org/buglist.cgi?email1=litimetal%40gmail.com&emailreporter1=1&emailtype1=exact&list_id=141251
[3]: http://appdb.winehq.org/objectManager.php?sClass=maintainerView&iId=281642
[4]: http://source.winehq.org/git/wine.git/?a=search&h=HEAD&st=author&s=Zhenbo+Li
[5]: http://bugs.winehq.org/buglist.cgi?cmdtype=runnamed&list_id=141898&namedcmd=mshtml

-- 
Have a nice day!
Zhenbo Li
-------------- next part --------------
From bfa21bef2ee63545f8e6b7424f8f23bbc726e37b Mon Sep 17 00:00:00 2001
From: Li Zhenbo <litimetal at gmail.com>
Date: Fri, 28 Feb 2014 18:21:11 +0800
Subject: [PATCH 01/10] mshtml: Added IHTMLTableRow::put_align implementation.

---
 dlls/mshtml/htmltablerow.c | 23 +++++++++++++++++++++--
 1 file changed, 21 insertions(+), 2 deletions(-)

diff --git a/dlls/mshtml/htmltablerow.c b/dlls/mshtml/htmltablerow.c
index 7274ded..80994b5 100644
--- a/dlls/mshtml/htmltablerow.c
+++ b/dlls/mshtml/htmltablerow.c
@@ -102,8 +102,27 @@ static HRESULT WINAPI HTMLTableRow_Invoke(IHTMLTableRow *iface, DISPID dispIdMem
 static HRESULT WINAPI HTMLTableRow_put_align(IHTMLTableRow *iface, BSTR v)
 {
     HTMLTableRow *This = impl_from_IHTMLTableRow(iface);
-    FIXME("(%p)->(%s)\n", This, debugstr_w(v));
-    return E_NOTIMPL;
+    nsAString val;
+    BOOL ret;
+    nsresult nsres;
+
+    TRACE("(%p)->(%s)\n", This, debugstr_w(v));
+
+    ret = nsAString_Init(&val, v);
+    if (!ret){
+        ERR("nsAString_Init(%s) failed!\n", debugstr_w(v));
+        return E_FAIL;
+    }
+
+    nsres = nsIDOMHTMLTableRowElement_SetAlign(This->nsrow, &val);
+    if (NS_FAILED(nsres)){
+        ERR("Set Align(%s) failed!\n", debugstr_w(v));
+        nsAString_Finish(&val);
+        return E_FAIL;
+    }
+
+    nsAString_Finish(&val);
+    return S_OK;
 }
 
 static HRESULT WINAPI HTMLTableRow_get_align(IHTMLTableRow *iface, BSTR *p)
-- 
1.8.3.1

-------------- next part --------------
From dcfdbbfa41ec8658326ec5bcb8d34a7ca562723b Mon Sep 17 00:00:00 2001
From: Li Zhenbo <litimetal at gmail.com>
Date: Sat, 1 Mar 2014 17:04:50 +0800
Subject: [PATCH 02/10] mshtml: Added IHTMLTableRow::get_align implementation.

---
 dlls/mshtml/htmltablerow.c | 11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)

diff --git a/dlls/mshtml/htmltablerow.c b/dlls/mshtml/htmltablerow.c
index 80994b5..f024467 100644
--- a/dlls/mshtml/htmltablerow.c
+++ b/dlls/mshtml/htmltablerow.c
@@ -128,8 +128,15 @@ static HRESULT WINAPI HTMLTableRow_put_align(IHTMLTableRow *iface, BSTR v)
 static HRESULT WINAPI HTMLTableRow_get_align(IHTMLTableRow *iface, BSTR *p)
 {
     HTMLTableRow *This = impl_from_IHTMLTableRow(iface);
-    FIXME("(%p)->(%p)\n", This, p);
-    return E_NOTIMPL;
+    nsAString val;
+    nsresult nsres;
+
+    TRACE("(%p)->(%p)\n", This, p);
+
+    nsAString_Init(&val, NULL);
+    nsres = nsIDOMHTMLTableRowElement_GetAlign(This->nsrow, &val);
+
+    return return_nsstr(nsres, &val, p);
 }
 
 static HRESULT WINAPI HTMLTableRow_put_vAlign(IHTMLTableRow *iface, BSTR v)
-- 
1.8.3.1

-------------- next part --------------
From bedbe3c02abd58cf9c2f3d25b9273ec15e6ba498 Mon Sep 17 00:00:00 2001
From: Li Zhenbo <litimetal at gmail.com>
Date: Sat, 8 Mar 2014 17:22:21 +0800
Subject: [PATCH 03/10] mshtml/tests: Added IHTMLTableRow::align tests.

---
 dlls/mshtml/tests/dom.c | 13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/dlls/mshtml/tests/dom.c b/dlls/mshtml/tests/dom.c
index 892e812..2da1761 100644
--- a/dlls/mshtml/tests/dom.c
+++ b/dlls/mshtml/tests/dom.c
@@ -5576,6 +5576,7 @@ static void test_tr_elem(IHTMLElement *elem)
     IHTMLElementCollection *col;
     IHTMLTableRow *row;
     HRESULT hres;
+    BSTR bstr;
 
     static const elem_type_t cell_types[] = {ET_TD,ET_TD};
 
@@ -5592,6 +5593,18 @@ static void test_tr_elem(IHTMLElement *elem)
     test_elem_collection((IUnknown*)col, cell_types, sizeof(cell_types)/sizeof(*cell_types));
     IHTMLElementCollection_Release(col);
 
+    bstr = a2bstr("left");
+    hres = IHTMLTableRow_put_align(row, bstr);
+    ok(hres == S_OK, "set_align failed: %08x\n", hres);
+    SysFreeString(bstr);
+
+    bstr = NULL;
+    hres = IHTMLTableRow_get_align(row, &bstr);
+    ok(hres == S_OK, "get_align failed: %08x\n", hres);
+    ok(bstr != NULL, "get_align returned NULL\n");
+    ok(!strcmp_wa(bstr, "left"), "get_align returned %s\n", wine_dbgstr_w(bstr));
+    SysFreeString(bstr);
+
     IHTMLTableRow_Release(row);
 }
 
-- 
1.8.3.1

-------------- next part --------------
From 8fab9ff4e3c7facc410a25c3f570bf924eb77688 Mon Sep 17 00:00:00 2001
From: Li Zhenbo <litimetal at gmail.com>
Date: Wed, 5 Mar 2014 23:52:06 +0800
Subject: [PATCH 04/10] mshtml: Added IHTMLTableRow::put_vAlign implementation.

---
 dlls/mshtml/htmltablerow.c | 23 +++++++++++++++++++++--
 1 file changed, 21 insertions(+), 2 deletions(-)

diff --git a/dlls/mshtml/htmltablerow.c b/dlls/mshtml/htmltablerow.c
index f024467..ed71eab 100644
--- a/dlls/mshtml/htmltablerow.c
+++ b/dlls/mshtml/htmltablerow.c
@@ -142,8 +142,27 @@ static HRESULT WINAPI HTMLTableRow_get_align(IHTMLTableRow *iface, BSTR *p)
 static HRESULT WINAPI HTMLTableRow_put_vAlign(IHTMLTableRow *iface, BSTR v)
 {
     HTMLTableRow *This = impl_from_IHTMLTableRow(iface);
-    FIXME("(%p)->(%s)\n", This, debugstr_w(v));
-    return E_NOTIMPL;
+    nsAString val;
+    BOOL ret;
+    nsresult nsres;
+
+    TRACE("(%p)->(%s)\n", This, debugstr_w(v));
+
+    ret = nsAString_Init(&val, v);
+    if (!ret){
+        ERR("nsAString_Init(%s) failed!\n", debugstr_w(v));
+        return E_FAIL;
+    }
+
+    nsres = nsIDOMHTMLTableRowElement_SetVAlign(This->nsrow, &val);
+    if (NS_FAILED(nsres)){
+        ERR("Set VAlign(%s) failed!\n", debugstr_w(v));
+        nsAString_Finish(&val);
+        return E_FAIL;
+    }
+
+    nsAString_Finish(&val);
+    return S_OK;
 }
 
 static HRESULT WINAPI HTMLTableRow_get_vAlign(IHTMLTableRow *iface, BSTR *p)
-- 
1.8.3.1

-------------- next part --------------
From d2f515c93e33edb0393d2cace7bcc80032d39322 Mon Sep 17 00:00:00 2001
From: Li Zhenbo <litimetal at gmail.com>
Date: Thu, 6 Mar 2014 00:00:03 +0800
Subject: [PATCH 05/10] mshtml: Added IHTMLTableRow::get_vAlign implementation.

---
 dlls/mshtml/htmltablerow.c | 11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)

diff --git a/dlls/mshtml/htmltablerow.c b/dlls/mshtml/htmltablerow.c
index ed71eab..d70ac18 100644
--- a/dlls/mshtml/htmltablerow.c
+++ b/dlls/mshtml/htmltablerow.c
@@ -168,8 +168,15 @@ static HRESULT WINAPI HTMLTableRow_put_vAlign(IHTMLTableRow *iface, BSTR v)
 static HRESULT WINAPI HTMLTableRow_get_vAlign(IHTMLTableRow *iface, BSTR *p)
 {
     HTMLTableRow *This = impl_from_IHTMLTableRow(iface);
-    FIXME("(%p)->(%p)\n", This, p);
-    return E_NOTIMPL;
+    nsAString val;
+    nsresult nsres;
+
+    TRACE("(%p)->(%p)\n", This, p);
+
+    nsAString_Init(&val, NULL);
+    nsres = nsIDOMHTMLTableRowElement_GetVAlign(This->nsrow, &val);
+
+    return return_nsstr(nsres, &val, p);
 }
 
 static HRESULT WINAPI HTMLTableRow_put_bgColor(IHTMLTableRow *iface, VARIANT v)
-- 
1.8.3.1

-------------- next part --------------
From 8ca22b63ea10c7ee25f96bcdbc3236619dd11ef8 Mon Sep 17 00:00:00 2001
From: Li Zhenbo <litimetal at gmail.com>
Date: Sun, 9 Mar 2014 17:09:33 +0800
Subject: [PATCH 06/10] mshtml/tests: Added IHTMLTableRow::vAlign tests.

---
 dlls/mshtml/tests/dom.c | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/dlls/mshtml/tests/dom.c b/dlls/mshtml/tests/dom.c
index 2da1761..1aa8273 100644
--- a/dlls/mshtml/tests/dom.c
+++ b/dlls/mshtml/tests/dom.c
@@ -5605,6 +5605,18 @@ static void test_tr_elem(IHTMLElement *elem)
     ok(!strcmp_wa(bstr, "left"), "get_align returned %s\n", wine_dbgstr_w(bstr));
     SysFreeString(bstr);
 
+    bstr = a2bstr("top");
+    hres = IHTMLTableRow_put_vAlign(row, bstr);
+    ok(hres == S_OK, "set_valign failed: %08x\n", hres);
+    SysFreeString(bstr);
+
+    bstr = NULL;
+    hres = IHTMLTableRow_get_vAlign(row, &bstr);
+    ok(hres == S_OK, "get_valign failed: %08x\n", hres);
+    ok(bstr != NULL, "get_valign returned NULL\n");
+    ok(!strcmp_wa(bstr, "top"), "get_valign returned %s\n", wine_dbgstr_w(bstr));
+    SysFreeString(bstr);
+
     IHTMLTableRow_Release(row);
 }
 
-- 
1.8.3.1

-------------- next part --------------
From 853e5a5c0e3e56448e247534e44f9949a17f5dee Mon Sep 17 00:00:00 2001
From: Li Zhenbo <litimetal at gmail.com>
Date: Thu, 27 Feb 2014 16:25:32 +0800
Subject: [PATCH 07/10] mshtml: Added IHTMLTableRow::get_rowIndex
 implementation.

---
 dlls/mshtml/htmltablerow.c | 11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)

diff --git a/dlls/mshtml/htmltablerow.c b/dlls/mshtml/htmltablerow.c
index d70ac18..92bfacc 100644
--- a/dlls/mshtml/htmltablerow.c
+++ b/dlls/mshtml/htmltablerow.c
@@ -238,8 +238,15 @@ static HRESULT WINAPI HTMLTableRow_get_borderColorDark(IHTMLTableRow *iface, VAR
 static HRESULT WINAPI HTMLTableRow_get_rowIndex(IHTMLTableRow *iface, LONG *p)
 {
     HTMLTableRow *This = impl_from_IHTMLTableRow(iface);
-    FIXME("(%p)->(%p)\n", This, p);
-    return E_NOTIMPL;
+    nsresult nsres;
+
+    TRACE("(%p)->(%p)\n", This, p);
+    nsres = nsIDOMHTMLTableRowElement_GetRowIndex(This->nsrow, p);
+    if(NS_FAILED(nsres)) {
+        ERR("Get rowIndex failed: %08x\n", nsres);
+        return E_FAIL;
+    }
+    return S_OK;
 }
 
 static HRESULT WINAPI HTMLTableRow_get_selectionRowIndex(IHTMLTableRow *iface, LONG *p)
-- 
1.8.3.1

-------------- next part --------------
From fdbffd541af8b03a4c61700cb2041b8e0d0cbd3c Mon Sep 17 00:00:00 2001
From: Li Zhenbo <litimetal at gmail.com>
Date: Sun, 9 Mar 2014 17:20:15 +0800
Subject: [PATCH 08/10] mshtml/tests: Added IHTMLTableRow::get_rowIndex tests.

---
 dlls/mshtml/tests/dom.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/dlls/mshtml/tests/dom.c b/dlls/mshtml/tests/dom.c
index 1aa8273..4566df7 100644
--- a/dlls/mshtml/tests/dom.c
+++ b/dlls/mshtml/tests/dom.c
@@ -5577,6 +5577,7 @@ static void test_tr_elem(IHTMLElement *elem)
     IHTMLTableRow *row;
     HRESULT hres;
     BSTR bstr;
+    LONG lval;
 
     static const elem_type_t cell_types[] = {ET_TD,ET_TD};
 
@@ -5617,6 +5618,11 @@ static void test_tr_elem(IHTMLElement *elem)
     ok(!strcmp_wa(bstr, "top"), "get_valign returned %s\n", wine_dbgstr_w(bstr));
     SysFreeString(bstr);
 
+    lval = 0xdeadbeef;
+    hres = IHTMLTableRow_get_rowIndex(row, &lval);
+    ok(hres == S_OK, "get_rowIndex failed: %08x\n", hres);
+    ok(lval == 1, "get_rowIndex returned %d\n", lval);
+
     IHTMLTableRow_Release(row);
 }
 
-- 
1.8.3.1

-------------- next part --------------
From 9b90613d717bf02ee5265e8f61cc4fda00a9c820 Mon Sep 17 00:00:00 2001
From: Li Zhenbo <litimetal at gmail.com>
Date: Fri, 28 Feb 2014 12:47:50 +0800
Subject: [PATCH 09/10] mshtml: Added IHTMLTableRow::get_sectionRowIndex
 implementation.

---
 dlls/mshtml/htmltablerow.c | 11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)

diff --git a/dlls/mshtml/htmltablerow.c b/dlls/mshtml/htmltablerow.c
index 92bfacc..bbf22fc 100644
--- a/dlls/mshtml/htmltablerow.c
+++ b/dlls/mshtml/htmltablerow.c
@@ -252,8 +252,15 @@ static HRESULT WINAPI HTMLTableRow_get_rowIndex(IHTMLTableRow *iface, LONG *p)
 static HRESULT WINAPI HTMLTableRow_get_selectionRowIndex(IHTMLTableRow *iface, LONG *p)
 {
     HTMLTableRow *This = impl_from_IHTMLTableRow(iface);
-    FIXME("(%p)->(%p)\n", This, p);
-    return E_NOTIMPL;
+    nsresult nsres;
+
+    TRACE("(%p)->(%p)\n", This, p);
+    nsres = nsIDOMHTMLTableRowElement_GetSectionRowIndex(This->nsrow, p);
+    if(NS_FAILED(nsres)) {
+        ERR("Get selectionRowIndex failed: %08x\n", nsres);
+        return E_FAIL;
+    }
+    return S_OK;
 }
 
 static HRESULT WINAPI HTMLTableRow_get_cells(IHTMLTableRow *iface, IHTMLElementCollection **p)
-- 
1.8.3.1

-------------- next part --------------
From 9cd2c02fb760c5bc18f04575f91f28952a1cf16e Mon Sep 17 00:00:00 2001
From: Li Zhenbo <litimetal at gmail.com>
Date: Sun, 9 Mar 2014 17:25:39 +0800
Subject: [PATCH 10/10] mshtml/tests: Added IHTMLTableRow::get_sectionRowIndex
 tests.

---
 dlls/mshtml/tests/dom.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/dlls/mshtml/tests/dom.c b/dlls/mshtml/tests/dom.c
index 4566df7..895edd0 100644
--- a/dlls/mshtml/tests/dom.c
+++ b/dlls/mshtml/tests/dom.c
@@ -5623,6 +5623,11 @@ static void test_tr_elem(IHTMLElement *elem)
     ok(hres == S_OK, "get_rowIndex failed: %08x\n", hres);
     ok(lval == 1, "get_rowIndex returned %d\n", lval);
 
+    lval = 0xdeadbeef;
+    hres = IHTMLTableRow_get_sectionRowIndex(row, &lval);
+    ok(hres == S_OK, "get_sectionRowIndex failed: %08x\n", hres);
+    ok(lval == 1, "get_sectionRowIndex returned %d\n", lval);
+
     IHTMLTableRow_Release(row);
 }
 
-- 
1.8.3.1



More information about the wine-devel mailing list