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
ac4117fd
Commit
ac4117fd
authored
Sep 30, 2008
by
Jacek Caban
Committed by
Alexandre Julliard
Oct 01, 2008
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mshtml: Added IHTMLTable::get_rows implementation.
parent
bf9155db
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
88 additions
and
4 deletions
+88
-4
htmlelemcol.c
dlls/mshtml/htmlelemcol.c
+25
-0
htmltable.c
dlls/mshtml/htmltable.c
+15
-2
mshtml_private.h
dlls/mshtml/mshtml_private.h
+1
-0
nsiface.idl
dlls/mshtml/nsiface.idl
+13
-1
dom.c
dlls/mshtml/tests/dom.c
+34
-1
No files found.
dlls/mshtml/htmlelemcol.c
View file @
ac4117fd
...
...
@@ -503,6 +503,31 @@ IHTMLElementCollection *create_collection_from_nodelist(HTMLDocument *doc, IUnkn
return
HTMLElementCollection_Create
(
unk
,
buf
.
buf
,
buf
.
len
);
}
IHTMLElementCollection
*
create_collection_from_htmlcol
(
HTMLDocument
*
doc
,
IUnknown
*
unk
,
nsIDOMHTMLCollection
*
nscol
)
{
PRUint32
length
=
0
,
i
;
elem_vector_t
buf
;
nsIDOMHTMLCollection_GetLength
(
nscol
,
&
length
);
buf
.
len
=
buf
.
size
=
length
;
if
(
buf
.
len
)
{
nsIDOMNode
*
nsnode
;
buf
.
buf
=
heap_alloc
(
buf
.
size
*
sizeof
(
HTMLElement
*
));
for
(
i
=
0
;
i
<
length
;
i
++
)
{
nsIDOMHTMLCollection_Item
(
nscol
,
i
,
&
nsnode
);
buf
.
buf
[
i
]
=
HTMLELEM_NODE_THIS
(
get_node
(
doc
,
nsnode
,
TRUE
));
nsIDOMNode_Release
(
nsnode
);
}
}
else
{
buf
.
buf
=
NULL
;
}
return
HTMLElementCollection_Create
(
unk
,
buf
.
buf
,
buf
.
len
);
}
IHTMLElementCollection
*
HTMLElementCollection_Create
(
IUnknown
*
ref_unk
,
HTMLElement
**
elems
,
DWORD
len
)
{
...
...
dlls/mshtml/htmltable.c
View file @
ac4117fd
...
...
@@ -274,8 +274,21 @@ static HRESULT WINAPI HTMLTable_refresh(IHTMLTable *iface)
static
HRESULT
WINAPI
HTMLTable_get_rows
(
IHTMLTable
*
iface
,
IHTMLElementCollection
**
p
)
{
HTMLTable
*
This
=
HTMLTABLE_THIS
(
iface
);
FIXME
(
"(%p)->(%p)
\n
"
,
This
,
p
);
return
E_NOTIMPL
;
nsIDOMHTMLCollection
*
nscol
;
nsresult
nsres
;
TRACE
(
"(%p)->(%p)
\n
"
,
This
,
p
);
nsres
=
nsIDOMHTMLTableElement_GetRows
(
This
->
nstable
,
&
nscol
);
if
(
NS_FAILED
(
nsres
))
{
ERR
(
"GetRows failed: %08x
\n
"
,
nsres
);
return
E_FAIL
;
}
*
p
=
create_collection_from_htmlcol
(
This
->
element
.
node
.
doc
,
(
IUnknown
*
)
HTMLTABLE
(
This
),
nscol
);
nsIDOMHTMLCollection_Release
(
nscol
);
return
S_OK
;
}
static
HRESULT
WINAPI
HTMLTable_put_width
(
IHTMLTable
*
iface
,
VARIANT
v
)
...
...
dlls/mshtml/mshtml_private.h
View file @
ac4117fd
...
...
@@ -587,6 +587,7 @@ void set_script_mode(HTMLDocument*,SCRIPTMODE);
IHTMLElementCollection
*
HTMLElementCollection_Create
(
IUnknown
*
,
HTMLElement
**
,
DWORD
);
IHTMLElementCollection
*
create_all_collection
(
HTMLDOMNode
*
,
BOOL
);
IHTMLElementCollection
*
create_collection_from_nodelist
(
HTMLDocument
*
,
IUnknown
*
,
nsIDOMNodeList
*
);
IHTMLElementCollection
*
create_collection_from_htmlcol
(
HTMLDocument
*
,
IUnknown
*
,
nsIDOMHTMLCollection
*
);
/* commands */
typedef
struct
{
...
...
dlls/mshtml/nsiface.idl
View file @
ac4117fd
...
...
@@ -115,7 +115,6 @@ typedef nsISupports nsIDOMProcessingInstruction;
typedef nsISupports nsIDOMEntityReference;
typedef nsISupports nsIDOMHTMLFormElement;
typedef nsISupports nsIDOMHTMLOptionsCollection;
typedef nsISupports nsIDOMHTMLCollection;
typedef nsISupports nsIWebProgressListener;
typedef nsISupports nsIDOMCSSValue;
typedef nsISupports nsIPrintSession;
...
...
@@ -826,6 +825,19 @@ interface nsIDOMNSHTMLElement : nsISupports
[
object,
uuid(a6cf9083-15b3-11d2-932e-00805f8add32),
local
/* FROZEN */
]
interface nsIDOMHTMLCollection : nsISupports
{
nsresult GetLength(PRUint32 *aLength);
nsresult Item(PRUint32 index, nsIDOMNode **_retval);
nsresult NamedItem(const nsAString *name, nsIDOMNode **_retval);
}
[
object,
uuid(a6cf9072-15b3-11d2-932e-00805f8add32),
local
/* FROZEN */
...
...
dlls/mshtml/tests/dom.c
View file @
ac4117fd
...
...
@@ -45,7 +45,7 @@ static const char elem_test_str[] =
"<input id=
\"
in
\"
class=
\"
testclass
\"
tabIndex=
\"
2
\"
title=
\"
test title
\"
/>"
"<select id=
\"
s
\"
><option id=
\"
x
\"
value=
\"
val1
\"
>opt1</option><option id=
\"
y
\"
>opt2</option></select>"
"<textarea id=
\"
X
\"
>text text</textarea>"
"<table
><tbody><tr
></tr></tbody></table>"
"<table
id=
\"
tbl
\"
><tbody><tr></tr><tr id=
\"
row2
\"
></tr></tbody></table>"
"<script id=
\"
sc
\"
type=
\"
text/javascript
\"
></script>"
"<test />"
"<img id=
\"
imgid
\"
/>"
...
...
@@ -2243,6 +2243,30 @@ static void test_defaults(IHTMLDocument2 *doc)
test_doc_title
(
doc
,
""
);
}
static
void
test_table_elem
(
IHTMLElement
*
elem
)
{
IHTMLElementCollection
*
col
;
IHTMLTable
*
table
;
HRESULT
hres
;
static
const
elem_type_t
row_types
[]
=
{
ET_TR
,
ET_TR
};
hres
=
IHTMLElement_QueryInterface
(
elem
,
&
IID_IHTMLTable
,
(
void
**
)
&
table
);
ok
(
hres
==
S_OK
,
"Could not get IHTMLTable iface: %08x
\n
"
,
hres
);
if
(
FAILED
(
hres
))
return
;
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
"
);
test_elem_collection
((
IUnknown
*
)
col
,
row_types
,
sizeof
(
row_types
)
/
sizeof
(
*
row_types
));
IHTMLElementCollection_Release
(
col
);
IHTMLTable_Release
(
table
);
}
static
void
test_stylesheet
(
IDispatch
*
disp
)
{
IHTMLStyleSheetRulesCollection
*
col
=
NULL
;
...
...
@@ -2359,6 +2383,7 @@ static void test_elems(IHTMLDocument2 *doc)
static
const
WCHAR
sW
[]
=
{
's'
,
0
};
static
const
WCHAR
scW
[]
=
{
's'
,
'c'
,
0
};
static
const
WCHAR
xxxW
[]
=
{
'x'
,
'x'
,
'x'
,
0
};
static
const
WCHAR
tblW
[]
=
{
't'
,
'b'
,
'l'
,
0
};
static
const
elem_type_t
all_types
[]
=
{
ET_HTML
,
...
...
@@ -2376,6 +2401,7 @@ static void test_elems(IHTMLDocument2 *doc)
ET_TABLE
,
ET_TBODY
,
ET_TR
,
ET_TR
,
ET_SCRIPT
,
ET_TEST
,
ET_IMG
...
...
@@ -2537,6 +2563,13 @@ static void test_elems(IHTMLDocument2 *doc)
IHTMLElement_Release
(
elem
);
}
elem
=
get_doc_elem_by_id
(
doc
,
tblW
);
ok
(
elem
!=
NULL
,
"elem == NULL
\n
"
);
if
(
elem
)
{
test_table_elem
(
elem
);
IHTMLElement_Release
(
elem
);
}
hres
=
IHTMLDocument2_get_body
(
doc
,
&
elem
);
ok
(
hres
==
S_OK
,
"get_body failed: %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