Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
bc582f09
Commit
bc582f09
authored
Aug 18, 2014
by
Zhenbo Li
Committed by
Alexandre Julliard
Aug 18, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mshtml: Added IHTMLTable::insertRow/deleteRow methods implementation.
parent
9ee4b8b0
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
85 additions
and
4 deletions
+85
-4
htmltable.c
dlls/mshtml/htmltable.c
+30
-4
dom.c
dlls/mshtml/tests/dom.c
+55
-0
No files found.
dlls/mshtml/htmltable.c
View file @
bc582f09
...
...
@@ -622,15 +622,41 @@ static HRESULT WINAPI HTMLTable_deleteCaption(IHTMLTable *iface)
static
HRESULT
WINAPI
HTMLTable_insertRow
(
IHTMLTable
*
iface
,
LONG
index
,
IDispatch
**
row
)
{
HTMLTable
*
This
=
impl_from_IHTMLTable
(
iface
);
FIXME
(
"(%p)->(%d %p)
\n
"
,
This
,
index
,
row
);
return
E_NOTIMPL
;
nsIDOMHTMLElement
*
nselem
;
HTMLElement
*
elem
;
nsresult
nsres
;
HRESULT
hres
;
TRACE
(
"(%p)->(%d %p)
\n
"
,
This
,
index
,
row
);
nsres
=
nsIDOMHTMLTableElement_InsertRow
(
This
->
nstable
,
index
,
&
nselem
);
if
(
NS_FAILED
(
nsres
))
{
ERR
(
"Insert Row at %d failed: %08x
\n
"
,
index
,
nsres
);
return
E_FAIL
;
}
hres
=
HTMLTableRow_Create
(
This
->
element
.
node
.
doc
,
nselem
,
&
elem
);
nsIDOMHTMLElement_Release
(
nselem
);
if
(
FAILED
(
hres
))
{
ERR
(
"Create TableRow failed: %08x
\n
"
,
hres
);
return
hres
;
}
*
row
=
(
IDispatch
*
)
&
elem
->
IHTMLElement_iface
;
return
S_OK
;
}
static
HRESULT
WINAPI
HTMLTable_deleteRow
(
IHTMLTable
*
iface
,
LONG
index
)
{
HTMLTable
*
This
=
impl_from_IHTMLTable
(
iface
);
FIXME
(
"(%p)->(%d)
\n
"
,
This
,
index
);
return
E_NOTIMPL
;
nsresult
nsres
;
TRACE
(
"(%p)->(%d)
\n
"
,
This
,
index
);
nsres
=
nsIDOMHTMLTableElement_DeleteRow
(
This
->
nstable
,
index
);
if
(
NS_FAILED
(
nsres
))
{
ERR
(
"Delete Row failed: %08x
\n
"
,
nsres
);
return
E_FAIL
;
}
return
S_OK
;
}
static
HRESULT
WINAPI
HTMLTable_get_readyState
(
IHTMLTable
*
iface
,
BSTR
*
p
)
...
...
dlls/mshtml/tests/dom.c
View file @
bc582f09
...
...
@@ -5080,6 +5080,25 @@ static void _test_language_string(unsigned line, const WCHAR *lang, LCID lcid)
}
}
#define test_table_length(t,l) _test_table_length(__LINE__,t,l)
static
void
_test_table_length
(
unsigned
line
,
IHTMLTable
*
table
,
LONG
expect
)
{
IHTMLElementCollection
*
col
;
HRESULT
hres
;
LONG
len
;
hres
=
IHTMLTable_get_rows
(
table
,
&
col
);
ok_
(
__FILE__
,
line
)(
hres
==
S_OK
,
"get_rows failed: %08x
\n
"
,
hres
);
ok_
(
__FILE__
,
line
)(
col
!=
NULL
,
"col = NULL
\n
"
);
if
(
hres
!=
S_OK
||
col
==
NULL
)
return
;
hres
=
IHTMLElementCollection_get_length
(
col
,
&
len
);
ok_
(
__FILE__
,
line
)(
hres
==
S_OK
,
"get_length failed: %08x
\n
"
,
hres
);
ok_
(
__FILE__
,
line
)(
len
==
expect
,
"Expect %d, got %d
\n
"
,
expect
,
len
);
IHTMLElementCollection_Release
(
col
);
}
static
void
test_navigator
(
IHTMLDocument2
*
doc
)
{
IHTMLWindow2
*
window
;
...
...
@@ -5990,6 +6009,40 @@ static void _test_table_cell_spacing(unsigned line, IHTMLTable *table, const cha
VariantClear
(
&
v
);
}
static
void
test_table_modify
(
IHTMLTable
*
table
)
{
IDispatch
*
disp
;
IHTMLTableRow
*
row
;
HRESULT
hres
;
LONG
index
;
test_table_length
(
table
,
2
);
hres
=
IHTMLTable_insertRow
(
table
,
0
,
&
disp
);
ok
(
hres
==
S_OK
,
"insertRow failed: %08x
\n
"
,
hres
);
ok
(
disp
!=
NULL
,
"disp == NULL
\n
"
);
test_table_length
(
table
,
3
);
if
(
hres
!=
S_OK
||
disp
==
NULL
)
return
;
hres
=
IDispatch_QueryInterface
(
disp
,
&
IID_IHTMLTableRow
,
(
void
**
)
&
row
);
IDispatch_Release
(
disp
);
ok
(
hres
==
S_OK
,
"QueryInterface failed: %08x
\n
"
,
hres
);
ok
(
row
!=
NULL
,
"row == NULL
\n
"
);
index
=
0xdeadbeef
;
hres
=
IHTMLTableRow_get_rowIndex
(
row
,
&
index
);
ok
(
hres
==
S_OK
,
"get_rowIndex failed: %08x
\n
"
,
hres
);
ok
(
index
==
0
,
"index = %d, expected 0
\n
"
,
index
);
IHTMLTableRow_Release
(
row
);
hres
=
IHTMLTable_deleteRow
(
table
,
0
);
ok
(
hres
==
S_OK
,
"deleteRow failed: %08x
\n
"
,
hres
);
test_table_length
(
table
,
2
);
}
static
void
test_table_elem
(
IHTMLElement
*
elem
)
{
IHTMLElementCollection
*
col
;
...
...
@@ -6152,6 +6205,8 @@ static void test_table_elem(IHTMLElement *elem)
ok
(
!
strcmp_wa
(
V_BSTR
(
&
v
),
"11"
),
"Expected 11, got %s
\n
"
,
wine_dbgstr_w
(
V_BSTR
(
&
v
)));
VariantClear
(
&
v
);
test_table_modify
(
table
);
bstr
=
a2bstr
(
"summary"
);
hres
=
IHTMLTable3_put_summary
(
table3
,
bstr
);
ok
(
hres
==
S_OK
,
"put_summary = %08x
\n
"
,
hres
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment