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
53f00d02
Commit
53f00d02
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: Use create_collection_from_nodelist in IHTMLElement::get_children implementation.
parent
c584effc
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
34 deletions
+10
-34
htmlelem.c
dlls/mshtml/htmlelem.c
+8
-33
htmlelemcol.c
dlls/mshtml/htmlelemcol.c
+2
-1
No files found.
dlls/mshtml/htmlelem.c
View file @
53f00d02
...
...
@@ -1210,48 +1210,23 @@ static HRESULT WINAPI HTMLElement_get_onfilterchange(IHTMLElement *iface, VARIAN
return
E_NOTIMPL
;
}
static
void
create_child_list
(
HTMLDocument
*
doc
,
HTMLElement
*
elem
,
elem_vector
*
buf
)
static
HRESULT
WINAPI
HTMLElement_get_children
(
IHTMLElement
*
iface
,
IDispatch
**
p
)
{
HTMLElement
*
This
=
HTMLELEM_THIS
(
iface
);
nsIDOMNodeList
*
nsnode_list
;
nsIDOMNode
*
iter
;
PRUint32
list_len
=
0
,
i
;
nsresult
nsres
;
nsres
=
nsIDOMNode_GetChildNodes
(
elem
->
node
.
nsnode
,
&
nsnode_list
);
TRACE
(
"(%p)->(%p)
\n
"
,
This
,
p
);
nsres
=
nsIDOMNode_GetChildNodes
(
This
->
node
.
nsnode
,
&
nsnode_list
);
if
(
NS_FAILED
(
nsres
))
{
ERR
(
"GetChildNodes failed: %08x
\n
"
,
nsres
);
return
;
}
nsIDOMNodeList_GetLength
(
nsnode_list
,
&
list_len
);
if
(
!
list_len
)
return
;
buf
->
size
=
list_len
;
buf
->
buf
=
heap_alloc
(
buf
->
size
*
sizeof
(
HTMLElement
**
));
for
(
i
=
0
;
i
<
list_len
;
i
++
)
{
nsres
=
nsIDOMNodeList_Item
(
nsnode_list
,
i
,
&
iter
);
if
(
NS_FAILED
(
nsres
))
{
ERR
(
"Item failed: %08x
\n
"
,
nsres
);
continue
;
}
if
(
is_elem_node
(
iter
))
elem_vector_add
(
buf
,
HTMLELEM_NODE_THIS
(
get_node
(
doc
,
iter
,
TRUE
)));
return
E_FAIL
;
}
}
static
HRESULT
WINAPI
HTMLElement_get_children
(
IHTMLElement
*
iface
,
IDispatch
**
p
)
{
HTMLElement
*
This
=
HTMLELEM_THIS
(
iface
);
elem_vector
buf
=
{
NULL
,
0
,
0
};
*
p
=
(
IDispatch
*
)
create_collection_from_nodelist
(
This
->
node
.
doc
,
(
IUnknown
*
)
HTMLELEM
(
This
),
nsnode_list
);
TRACE
(
"(%p)->(%p)
\n
"
,
This
,
p
);
create_child_list
(
This
->
node
.
doc
,
This
,
&
buf
);
*
p
=
(
IDispatch
*
)
HTMLElementCollection_Create
((
IUnknown
*
)
HTMLELEM
(
This
),
buf
.
buf
,
buf
.
len
);
nsIDOMNodeList_Release
(
nsnode_list
);
return
S_OK
;
}
...
...
dlls/mshtml/htmlelemcol.c
View file @
53f00d02
...
...
@@ -491,7 +491,8 @@ IHTMLElementCollection *create_collection_from_nodelist(HTMLDocument *doc, IUnkn
for
(
i
=
0
;
i
<
length
;
i
++
)
{
nsIDOMNodeList_Item
(
nslist
,
i
,
&
nsnode
);
buf
.
buf
[
i
]
=
HTMLELEM_NODE_THIS
(
get_node
(
doc
,
nsnode
,
TRUE
));
if
(
is_elem_node
(
nsnode
))
buf
.
buf
[
i
]
=
HTMLELEM_NODE_THIS
(
get_node
(
doc
,
nsnode
,
TRUE
));
nsIDOMNode_Release
(
nsnode
);
}
}
else
{
...
...
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